Export Web Map JSON

4721
3
08-08-2013 02:28 AM
GISScientist
New Contributor
Hi all,

I've been trying to use the Export Web Map Tool in ArcToolbox to export one of my local ArcGIS Server maps to PDF.

Every time I keep getting the error 'Invalid JSON in WebMap'

Rather handily, ESRI do not actually say where the JSON is for local maps, but just keep referring to what a generic specification should look like, which to anyone who is a webmap novice is about as handy as a hot poker up the rear.

So does anybody know where exactly the JSON is for a map created with ArcGIS Server?

The location I tried was:
http://<server name>/arcgis/rest/services/MyMap/MapServer?f=pjson

And I have also tried every other JSON link I could find whilst browsing around, but with no luck.

Any help appreciated in what should probably be a simple task.
Tags (2)
0 Kudos
3 Replies
nicogis
MVP Frequent Contributor
if you have this error the JSON string does not conform to the ExportWebMap specification
0 Kudos
by Anonymous User
Not applicable
I would point out that the link you mentioned (http://<server name>/arcgis/rest/services/MyMap/MapServer?f=pjson) gives you JSON that describes a service...not a 'Web Map'.

The Web Map JSON generally has to be constructed - usually by an application that has a web map somewhere.  For example, look at some of the samples for the PrintTask module in the JavaScript API (e.g., https://developers.arcgis.com/en/javascript/jssamples/widget_print_webmap.html).  What that module does is dynamically generate the JSON text based on the existing Map object that displays the map the application.  If you capture the requests that are submitted to the ExportWebMap printing service in a browser's Dev console, you can see the web map JSON that is submitted...which would follow the specification that ciava.at linked to above.
0 Kudos
GISScientist
New Contributor
Thanks for another hot poker.

The help states:

"When you use the ArcGIS web APIs, you don't need to worry about constructing the JSON; the APIs take care of it for you."

I would like to know what this actually is to input it ino a tool.
0 Kudos