Select to view content in your preferred language

How to change the scale bar unit when using the print widget for exporting a map

842
0
01-29-2014 10:55 AM
LixianDai
Deactivated User
Hi, All,
What I did is using the print widget in the ArcGIS JavaScript Api to execute the map export to pdf.
But the issue is when I change the scale bar unit from default one (miles) to feet. Only the unit label changed but the number on the scale bar did not change along with the unit change.

I also test the scale bar unit change in an online sample http://developers.arcgis.com/javascr..._print_webmap/

This is what I did.
var templates = new esri.tasks.PrintParameters;
templates = [{
label: "Layout-Landscape",
format: "pdf",
layout: "A4 Landscape",
layoutOptions: {
titleText: "Default Title",
authorText: "NOTE:",
scaleBarOptions: {
metricUnit: "meters",
metricLabel: "m",
nonMetricUnit: "feet",
nonMetricLabel: "ft"
},
scalebarUnit: "Feet"
},
exportOptions: {
dpi: 96
}
}];

// create the print dijit
printer = new esri.dijit.Print({
"map": map,
"templates": templates,
url: ConfigPrintUrl
}, dojo.byId("print_button"));
printer.startup();


But it only change the unit label from miles to feet, not the real number on the scale bar.
Any one knows any solution?
Thank you very much.
0 Kudos
0 Replies