The ArcGIS Server API for JavaScript includes a couple of utility methods for working with maps from ArcGIS Online. Both methods are found in the esri/arcgis/utils
module, usually aliased as arcgisUtils
.
To create a map from an ArcGIS Online resource, you use the arcgisUtils.createMap()
method. Before you can call createMap()
, you need to tell the ArcGIS API for JavaScript which ArcGIS Online map you want to use in your application.
Every map in ArcGIS Online has a unique ID. This unique ID, called webmap,
is vital information if you want to use that map in your ArcGIS API for JavaScript applications. To get the webmap
ID for a map, just open the map in ArcGIS Online. The URL in the browser's address bar will contain the webmap
ID for the map. You'll see how to access this ID in the practice for this chapter.
Once you have obtained the webmap
ID for the ArcGIS Online map that you'd like to integrate into your custom JavaScript...