An alternative to creating a map using the web map ID is to create a map using a JSON object that represents the web map. This can be useful in situations where the application does not have access to the ArcGIS Online platform:
var webmap = {}; webmap.item = { "title":"Census Map of USA", "snippet": "Detailed description of data", "extent": [[-139.4916, 10.7191],[-52.392, 59.5199]] };
Next, specify the layers that make up the map. In this snippet, the World Terrain basemap from ArcGIS Online is added, along with an overlay layer that adds additional information to the map such as boundaries, cities, water features, landmarks, and roads. An operational layer is added that displays the US census:
webmap.itemData = { "operationalLayers": [{ "url...