How to Convert Esri.Map object to json

4414
2
02-13-2013 03:23 AM
GyanendraAgnihotri
New Contributor
hi,
i have created a map object using Esri.Map namespace, and added some layer(ArcGISTiledMapServiceLayer, graphic layer etc)
to the map object like
            map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"));

now i want to convert map object to json since i want to add this map to 'arcGis online portal' using arcGis online api rest services addItem.
any kind of help would be greatly appreciated
thanks..
0 Kudos
2 Replies
Maartenvan_Hulzen
Esri Contributor

I'm trying to achieve the exact same thing. Did you ever find a solution?

Or is there anyone who is able to do this?

0 Kudos
TomWayson
Esri Contributor

This JSAPI team plans to add this capability in 4.0.

For a JSAIPI 3.x stop gap you can try Cereal (https://github.com/swingley/cereal) if you have a simple map, but it is very incomplete and not actively maintained.

0 Kudos