var template = esri.tasks.PrintTemplate(); template.preserveScale = false;
Will be spending the day fixing that with an extent reprojection.
@beni dont think thats actually correct. its my understanding that the projection of the print output will be determined by the spatial reference which is passed within the WebMapJSON.
Another option is to set the projection of your print task template map to that of the data if you want to keep the scale bar and have it accurate
function printPDF() { var printUrl = 'http://services.kgs.ku.edu/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task'; var printTask = new esri.tasks.PrintTask(printUrl); var params = new esri.tasks.PrintParameters(); var template = new esri.tasks.PrintTemplate(); template.layout = layout; // layout set elsewhere template.format = "PDF"; template.preserveScale = true; template.showAttribution = false; template.layoutOptions = { scaleBarUnit: "Miles", titleText: title, // title set elsewhere legendLayers: [] }; params.map = app.map; params.outSpatialReference = sr; // sr set elsewhere to 102100, also tried setting it to 3857 params.template = template; printTask.execute(params, printResult, printError); }
var plate = new esri.tasks.PrintTemplate(); plate.format = "pdf"; plate.layout = "MAP_ONLY"; plate.exportOptions = { width: map.width, height: map.height, dpi: 96 };
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.