Select to view content in your preferred language

Javascript API Print webmap Sample Question

2398
1
06-04-2014 05:53 AM
MichaelVolz
Esteemed Contributor
To All Javascript API Developers:

https://developers.arcgis.com/javascript/jssamples/widget_print_webmap.html

The above link shows an ESRI sample of using the Print Dijit to print a webmap.

I am confused about the line of code below:

app.webmapId = "8315cf7d20f0484e869c4791f70f4f15";

Is this webmapId required here because the sample is printing a webmap from ArcGIS.com?

Can I remove this line of code if I want to use my own custom print service in this sample?
0 Kudos
1 Reply
ScottGunn
New Contributor III
Yep, that is the "Print webmap" dijit and it is printing an AGO webmap. 

To use your own services, you would need to use the Print widget:

Sample:
https://developers.arcgis.com/javascript/jssamples/widget_print.html

API reference:
https://developers.arcgis.com/javascript/jsapi/print-amd.html

You can also use the Print Task:
https://developers.arcgis.com/javascript/jsapi/printtask-amd.html

if you want more control over your printing. 

If you use the Print widget or Print Task, there are parameters in each method that would need to be set to your print service URL.
0 Kudos