Get map in Web_Map_as_JSON format in JavaScript

1678
4
Jump to solution
09-20-2013 02:07 PM
HaoHu
by
New Contributor II
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
Occasional Contributor III
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
Occasional Contributor III
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
New Contributor II
Thanks Jason, your code really helps!
0 Kudos
JasonZou
Occasional Contributor III
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
New Contributor II
Sure thing!
0 Kudos