Select to view content in your preferred language

Get map in Web_Map_as_JSON format in JavaScript

1818
4
Jump to solution
09-20-2013 02:07 PM
HaoHu
by
Emerging Contributor
Hi,

I was trying to export map using Export Web Map Task, but I don't know how can I specify the map object in Web_Map_as_JSON format. Anyone has solutions? Or is there a better way to export the map(including all types of layers)?

Thanks!
0 Kudos
1 Solution

Accepted Solutions
JasonZou
Frequent Contributor
The map object is included in PrintParameters object which will be fed to PrintTask for execution.

require([   "esri/map", "esri/tasks/PrintTask", "esri/tasks/PrintParameters", ...  ], function(Map, PrintTask, PrintParameters, ... ) {   var map = new Map( ... );   var printTask = new PrintTask( ... );   var params = new PrintParameters();   params.map = map;      printTask.execute(params, printResult);   ... });


You can also use Print dijit to print map. Here are some samples.

View solution in original post

0 Kudos
4 Replies
JasonZou
Frequent Contributor
The map object is included in PrintParameters object which will be fed to PrintTask for execution.

require([   "esri/map", "esri/tasks/PrintTask", "esri/tasks/PrintParameters", ...  ], function(Map, PrintTask, PrintParameters, ... ) {   var map = new Map( ... );   var printTask = new PrintTask( ... );   var params = new PrintParameters();   params.map = map;      printTask.execute(params, printResult);   ... });


You can also use Print dijit to print map. Here are some samples.
0 Kudos
HaoHu
by
Emerging Contributor
Thanks Jason, your code really helps!
0 Kudos
JasonZou
Frequent Contributor
Glad to help. If you think your question has been answered, can you mark your thread as "Answered" so other people may find it helpful? Thanks.
0 Kudos
HaoHu
by
Emerging Contributor
Sure thing!
0 Kudos