concept web map specification in category arcgis

appears as: web map specification, The web map specification
ArcGIS Web Development

This is an excerpt from Manning's book ArcGIS Web Development.

7.3.3. Using the web map specification

For the ArcGIS API for JavaScript to load a map from ArcGIS Online, it must follow a standard format so the API can re-create the map as needed. That standard is called the web map specification.

We won’t cover the entirety of the web map specification, but we’ll stick to the parts that get you the most bang for your buck. Start by adding a basemap and mapOptions to the configuration and removing the webmapid option, as shown in the following listing.

Listing 7.12. basemap and mapOptions—web map specification
{ "type": "map", "path": "widgets/map/map", "options" : { "id": "map-div", "mapOptions": { "center": [-118.209,34.285], "zoom": 10, }, "webmap": { "itemData": { "baseMap": { "baseMapLayers": [{ "url": "http://services.arcgisonline.com/arcgis/rest"+ "/services/World_Topo_Map/MapServer", "opacity" : 1, "visibility": true }] } } } } }

You now have a mapOptions object as well as a webmap object in the configuration. Use the mapOptions object the same way you’d use a regular map object; in this case, you can define the center and zoom of the map when it loads. The webmap object is where you can define the specification for the web map in the application. The baseMap object contains an array of baseMapLayers. Add a single layer as shown. This is a perfectly suitable JSON object that meets the web map specification.