Select to view content in your preferred language

Convert Web Map to JSON format

2297
0
04-04-2012 07:21 PM
ShaunWeston
Frequent Contributor
I thought this would be a pretty simple task, but can't seem to do it.

I just want to convert the current contents of my web application into JSON, so the extent and all the layers information, something like this:


    "operationalLayers": [        {            "url": "http://maps1.arcgisonline.com/ArcGIS/rest/services/USA_Federal_Lands/MapServer",            "id": "USA_Federal_Lands_4572",            "visibility": true,            "opacity": 1,            "title": "USA Federal Lands"        }    ],        "baseMap": {        "baseMapLayers": [            {                "id": "World_Street_Map_4844",                "opacity": 1,                "visibility": true,                "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"            }        ],        "title": "Streets"    },    "exportOptions": {        "dpi": 300,        "outputSize": [            1500,            1500        ]    },    "mapOptions": {        "extent": {            "xmin": -13055000,            "ymin": 4041000,            "xmax": -13046000,            "ymax": 4049000        }    },    "version": "1.2"


So I basically want to generate of that somehow?

I thought I could do it through the encode method?
Tags (2)
0 Kudos
0 Replies