Hello all,
I work in a secure environment (no access to internet) that has ArcGIS for Server and we have Portal for ArcGIS. I have a customer create a web map and then I am trying to bring his web map into my custom HTML template using the ArcGIS API for Javascript using his web map ID (as shown in this example on the ArcGIS documentation page). But...I just can't seem to get the map to show. The only thing that seems to work is a basemap, but none of the webmap layers show.
How do I get the web map to show? How do I get the data layers from the webmap to show over the basemap?
I have ensured his web map is open to everyone (not private) and I am pretty sure I captured the ID correctly.
webmap.itemData = {
"operationalLayers": [{
"url": "WHAT GOES HERE?",
"visibility": true,
"opacity": 0.75,
"title": "Soil Survey Map",
"itemId": "his_webmap_ID"
}],
"baseMap": {
"baseMapLayers": [{
"opacity": 1,
"visibility": true,
"url": "why_do_we_need_a_basemap_here_if_the_webmap_already_contains_one?"
},{
"isReference": true,
"opacity": 1,
"visibility": true,
"url": "what_goes_here?"
}],
"title": "Title here"
},
"version": "1.1"
};
Hi Nick,
The item ID 204d94c9b1374de9a21574c9efa31164 in the example page you shared is a map service and not a map.
E.g.
Map Service: http://www.arcgis.com/home/item.html?id=204d94c9b1374de9a21574c9efa31164
Web Map: http://www.arcgis.com/home/item.html?id=d5e02a0c1f2b4ec399823fdd3c2fdebd
To view your colleagues web map on your application you should simply use
var mapid="d5e02a0c1f2b4ec399823fdd3c2fdebd" THIS would be your colleagues web map ID.
var mapDeferred = esri.arcgis.utils.createMap(mapid, "map", {
mapOptions: {
slider: true,
nav:false
}
});
I think ESRI should update documentation for Working with web maps | Guide | ArcGIS API for JavaScript to stress that US soil map example uses map services and not a web map.