1

I have some enquiries relatively to the use of PrintTask, so as to export the map in various formats:

  1. Should I use the esri/dijit/Print dijit like in this example ? or it is better to usee the PrintTask like in this ? which one is suggested ?

  2. I want my map to have specific dimensions, and show the entire word at a specific scale? How can I tell the map not to show the current map extent? but the entire world ? I tried setting like in the examples here the preserveScale to true and the exportOptions to template.exportOptions = { width: 500, height: 400, dpi: 96 }; But the printed map was empty (white) with just the logo on it .

  3. In case I need to use tiled layer as basemap should I only use the ArcGISTiledMapServiceLayer? I tried with WebTiledLayer but the background map is white, despite the fact that the feature services items are exported/printed

0
  1. The Print dijit gives you the UI (dojo widget) out of the box

  2. Use the esriRequest.setRequestPreCallback to specify extents to the request.

Example on how to use the setRequestPreCallback is here https://developers.arcgis.com/javascript/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback

Just check for ioArgs.content.Web_Map_as_Json and parse it to JSON if present

  1. Yes use the ArcGISTiledMapServiceLayer unless you have a non ArcGIS tile provider.

Just like in this example https://developers.arcgis.com/javascript/jssamples/layers_custom_tiled.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.