Adding a webmap from Arcgis Enterprise

644
3
03-29-2020 05:39 AM
MohamadMousheimish1
New Contributor II

I'm trying to add a webmap from an arcgis enterprise portal. I followed the tutorials on esri WebMap API with the following link: WebMap API Reference

I'm getting the following error: Invalid portal item type 'Web Mapping Application', expected 'Web Map'

You can see in the code that I've already specified the type of the portal Item to 'Web Map'

Any Idea about what's happening?

Here's how I'm adding the Webmap:

 

  async SetWebMap() {
    const [WebMapMapViewEsriConfigPortalItem] = await loadModules(["esri/WebMap""esri/views/MapView""esri/config""esri/portal/PortalItem"]);
    EsriConfig.portalUrl = portalUrl;
    var portalItem = new PortalItem({
      id: "XXXXXXXX",
      type: "Web Map",
    });
    var webmap = new WebMap({
      portalItem: portalItem
    });
    var view = new MapView({
      map: webmap,
      container: "mapViewNode"
    });
  }
0 Kudos
3 Replies
KarstenRank
Occasional Contributor III

Hi,

I guess your chosen ID belongs to the Web Mapping Application not to a Web Map

0 Kudos
MohamadMousheimish1
New Contributor II

How do you specify the type of the application if may I ask?

0 Kudos
KarstenRank
Occasional Contributor III

If you look in the Content, you see what kind of item it is. 

0 Kudos