Custom Print Service Scalebar Properties

1592
4
10-03-2013 12:34 PM
KevinGooss
Occasional Contributor
10.1 sp1 ags .net

I created a custom ExportWebMap Task as outlined here:

http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005n1000000

In my custom mxd layout I have two scalebars - one shows miles the other show feet.

When i generate my print output all scalebars show miles.

How can i get the scalebar to show feet?
0 Kudos
4 Replies
TanuHoque
Esri Regular Contributor
can you please share the json being sent out from your app with me?
thanks.
0 Kudos
KevinGooss
Occasional Contributor
here it is, lots of coords because there are selections
0 Kudos
KevinGooss
Occasional Contributor
{"mapOptions":{"showAttribution":false,"extent":{"xmin":449678.6470890906,"ymin":520631.85906350036,"xmax":632339.5564109093,"ymax":578434.2466682756,"spatialReference":{"wkid":3071}},"spatialReference":{"wkid":3071}},"operationalLayers":[{"id":"lyrBaseEditing","title":"lyrBaseEditing","opacity":1,"minScale":0,"maxScale":0,"url":"http://apwmad0d1600/arcgis/rest/services/PUBLIC/PUBLIC_Base_WTM_INT/MapServer","visibleLayers":null,"layers":[]},{"id":"map_graphics","minScale":0,"maxScale":0,"featureCollection":{"layers":[]}}],"exportOptions":{"outputSize":[500,400],"dpi":96},"layoutOptions":{"titleText":"Test Title","copyrightText":"in R 2013","customTextElements":[{"Title":"Test Title"},{"Compartment":"22"},{"Text 2":"40 Acres"},{"Text 1":"Ashland"},{"Forester":"Smokey Bear"},{"userId":"KG"},{"TRS0":""},{"TRS1":""},{"TRS2":""},{"TRS3":""},{"Property":"LINCOLN COUNTY FOREST"}],"scaleBarOptions":{"metricUnit":"Kilometers","metricLabel":"km","nonMetricUnit":"Miles","nonMetricLabel":"mi"},"legendOptions":{"operationalLayers":[{"id":"lyrBaseEditing","subLayerIds":[10,14,15,17,21,22,25,29,30,38,39,41,42]}]}}}
0 Kudos
TanuHoque
Esri Regular Contributor
Kevin,
Sorry it took me a while to respond.

In your case, you should remove "scaleBarOptions" option from the request that going to the printing service. When printing service does not find that element in the request, it does not touch any scale bars elements on the layout.

this is how it'd look:
{"mapOptions":{"showAttribution":false,"extent":{"xmin":449678.6470890906,"ymin":520631.85906350036,"xmax":632339.5564109093,"ymax":578434.2466682756,"spatialReference":{"wkid":3071}},"spatialReference":{"wkid":3071}},"operationalLayers":[{"id":"lyrBaseEditing","title":"lyrBaseEditing","opacity":1,"minScale":0,"maxScale":0,"url":"http://apwmad0d1600/arcgis/rest/services/PUBLIC/PUBLIC_Base_WTM_INT/MapServer","visibleLayers":null,"layers":[]},{"id":"map_graphics","minScale":0,"maxScale":0,"featureCollection":{"layers":[]}}],"exportOptions":{"outputSize":[500,400],"dpi":96},"layoutOptions":{"titleText":"Test Title","copyrightText":"in R 2013","customTextElements":[{"Title":"Test Title"},{"Compartment":"22"},{"Text 2":"40 Acres"},{"Text 1":"Ashland"},{"Forester":"Smokey Bear"},{"userId":"KG"},{"TRS0":""},{"TRS1":""},{"TRS2":""},{"TRS3":""},{"Property":"LINCOLN COUNTY FOREST"}],"legendOptions":{"operationalLayers":[{"id":"lyrBaseEditing","subLayerIds":[10,14,15,17,21,22,25,29,30,38,39,41,42]}]}}}


The 'scaleBarOptions' in ExportWebMap specs (that Printing service uses) is meant to modify unit (on per request basis) of a scalebar in metric and another in non-metric system. e.g. you can have a scalebar to show units in yards and another in meters or miles and km.

It is not designed to modify units of scalebars in the same system but two different units (e.g. mi and yards in your case, or another example where you would want to have two scale bars showing units in 'km' and 'meters').
0 Kudos