Select to view content in your preferred language

ArcGIS Online and the Javascript API.

570
2
03-22-2012 05:19 AM
RichardGordon1
New Contributor
Hi,

Just trying out the beta of ArcGIS Online and have created a map and added some of my own data. My query is can I use the JavaScript API in the same way as a local ArcGIS Server. Not sure how you find out what the REST MapServer end points are for adding the MapService to my JavaScript API.

Best Regards,
Richard
Tags (2)
0 Kudos
2 Replies
KellyHutchins
Esri Notable Contributor
Since you've created a map in ArcGIS Online the easiest way to get started with the JavaScript API is to use that web map to build an application. The JS API has a method that takes in the id for the web map and builds a JavaScript map from it with the same layers, symbology and popup information. See this sample for an example:

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/ags_createwebmapid.html
0 Kudos
MikeMinami
Esri Notable Contributor
...have created a map and added some of my own data


How have you added your own data? If you've added it directly to the map, then it is being stored inside the map and is available in this map only. What you want to do is create a web service out of your data. You can do this by publishing your data from ArcGIS Desktop (ArcMap) or adding a shapefile or csv as an item in My Content. With a subscription, you have the option to create a feature service out of it. Once created, you'll see the REST URL on the item details page that you could use directly. But, as Kelly says, you'll probably want to add that service to a web map because then you can symbolize the features.

Thanks,

Mike
0 Kudos