Using online map from the JavaScript API
Although the ArcGIS online map viewer is incredibly easy to use and configure, it is still limited, and doesn't allow us to add our own code and functionality. That is why Esri allowed you to use ArcGIS JavaScript API to extend the functionality of ArcGIS Online so that they can host the data and you work on the application. Luckily, Esri has provided us with the source code of a complete JavaScript API viewer for ArcGIS Online. All you have to do is to add some configurations and you are ready to use it. In this section, we will learn how to connect ArcGIS Online using the JavaScript API viewer.
Each map you create in ArcGIS Online has a unique global map ID; yes, even the one you just created has an ID and we will need this ID to connect to our map. Follow these steps to get your map ID and configure your ArcGIS online viewer:
- Log in to www.arcgis.com and then click on My Content.
- Click on Bestaurants map to open it.
- Take a look at the address...