Web Map ID of a map in Portal for ArcGIS

2973
2
Jump to solution
09-29-2016 09:56 AM
SarojThapa1
Occasional Contributor III

I have web maps created in Portal for ArcGIS and are shared within the organization. I am trying to bring those maps into my app using ArcGIS API for JavaScript. When I use the unique web map id, the map does not show up. However, if I use the map id of a map created in ArcGIS Online, the map shows up.

require([
    "esri/views/MapView",
    "esri/WebMap",
    "dojo/on",
    "dojo/domReady!"
], function(
        MapView, WebMap,
        on
) {

    var webmapids = [
        "f2777e16f8734dc19321558bde5b26ba",
        "71ba2a96c368452bb73d54eadbd59faa",
        "45ded9b3e0e145139cc433b503a8f5ab"
    ];

    /************************************************************
     * Create multiple WebMap instances
     ************************************************************/
    var webmaps = webmapids.map(function(webmapid) {
        return new WebMap({
            portalItem: {
                id: webmapid
            }
        });
    });
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KarstenRank
Occasional Contributor III

Hi,

you have to specify a portal URL, via thearcgisUrlproperty, Besides the default ArcGIS Online URL ofhttp://www.arcgis.com/sharing/rest/content/items.

arcgisUtils.arcgisUrl = "http://mydomain/sharing/rest/content/items";

View solution in original post

0 Kudos
2 Replies
KarstenRank
Occasional Contributor III

Hi,

you have to specify a portal URL, via thearcgisUrlproperty, Besides the default ArcGIS Online URL ofhttp://www.arcgis.com/sharing/rest/content/items.

arcgisUtils.arcgisUrl = "http://mydomain/sharing/rest/content/items";
0 Kudos
SarojThapa1
Occasional Contributor III

Thank you so much Karsten.

0 Kudos