Adding a webmap from Arcgis Enterprise

146
3
03-29-2020 05:39 AM
Highlighted
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"
    });
  }
Reply
0 Kudos
3 Replies
Highlighted
Occasional Contributor II

Hi,

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

Reply
0 Kudos
Highlighted
New Contributor II

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

Reply
0 Kudos
Highlighted
Occasional Contributor II

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

Reply
0 Kudos