map as JSON object

3308
5
07-29-2015 11:19 AM
SameerSawakare
New Contributor

​is there any way to draw a map using JSON data which contains a polygon or circle in it?

0 Kudos
5 Replies
ChrisSmith7
Frequent Contributor

Sameer,

You can create a web map using a JSON object:

Web map using JSON | ArcGIS API for JavaScript

And you can also create feature layers within the map using JSON:

Importing GeoJSON data in ArcGIS Javascript maps | GeoThread

In my own application, I create JSON point layers that are populated by a separate SQL query - the lat/longs are returned and programmatically made into a JSON object, then displayed on the map. I'm sorry I can't link directly to it, but the above link should give you a sample that will put you in the right direction.

SameerSawakare
New Contributor

​Chris,

can i also achieve this functionality:

Draw a polygon on a basemap layer, get its JSON and use the same JSON object to create a whole new map?

like save a map into JSON and load it whenever required?

0 Kudos
ChrisSmith7
Frequent Contributor

So, you're looking to serialize the entire map as JSON and load it somewhere else? Not just for like printing the map, but actually as the entire application? Or, are you just looking to save the polygon feature layer as JSON?

0 Kudos
SameerSawakare
New Contributor

​Yes, i am looking to serialize the entire map as JSON and load it somewhere else

0 Kudos
zhongrenGu
New Contributor III

Sammer ,this link is a opensource site,you can look up it;hope to find something

Documentation - Leaflet - a JavaScript library for interactive maps

0 Kudos