Select to view content in your preferred language

PrintDigit not setting exportOptions in req. - problem with scale dependencies

1024
2
07-27-2012 02:11 PM
ArtUllman
Emerging Contributor
Scale dependancies are not working correctly in a print task using the print digit.  The map layers are drawing correctly in the web interface, but the scales depenancies are not being honoured when printing.  I used fiddler to capture the URL going to the 10.1 Print Utility. I noticed that the exportOptions parameter is not in the URL.  I am wondering if this is causing ArcGIS Server issues in determining the the correct resolution.  The map looks correct in all respects, except that it showing a layer that should definitely be turned off at the current scale.   I am not sure how it is working at all without exportOptions in the JSON.

Here is the request that was sent to the 10.1 server from the printDigit:

GET /arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task/execute?f=json&Web_Map_as_JSON={"mapOptions":{"extent":{"xmin":-11147195.71856907,"ymin":2961706.9129124978,"xmax":-9437452.26988671,"ymax":4056285.1579559264,"spatialReference":{"wkid":102100}},"spatialReference":{"wkid":102100},"scale":4622324.43430898},"operationalLayers":[{"id":"layer0","url":"http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer","title":"layer0","opacity":1},{"id":"layer1","url":"http://xxx.xxx.xxx.xxx:6080/arcgis/rest/services/plants/plantsgen1/MapServer","title":"layer1","opacity":1,"visibleLayers":[0,2,3,4],"layers":[{"id":2,"layerDefinition":{"definitionExpression":"SYMBOL='SPAL'"}},{"id":3,"layerDefinition":{"definitionExpression":"SYMBOL='SPAL'"}},{"id":4,"layerDefinition":{"definitionExpression":"SYMBOL='SPAL'"}}]}],"layoutOptions":{"titleText":"NRCS Plant Database - SPAL","authorText":"xxxx","copyrightText":"xxxx","scaleBarOptions":{"metricUnit":"Kilometers","metricLabel":"km","nonMetricUnit":"Miles","nonMetricLabel":"mi"},"legendOptions":{"operationalLayers":[{"id":"layer1","subLayerIds":[0,2,3,4]}]}}}&Format=JPG&Layout_Template=A3 Landscape

The print task works correctly in silverlight API.  It specifies exportOptions
0 Kudos
2 Replies
JianHuang
Deactivated User
exportOptions control output size and dpi, which shouldn't affect the scale dependency.
There is a parameter "preserveScale", please make sure it's been set as true.
0 Kudos
ArtUllman
Emerging Contributor
Thanks.  You were correct.  There was nothing wrong with the scale dependancies or exportOptions parameter. 

It turns out that there was another layer that was being drawn which looked identical to the layer that I thought I had scale dependancy issue.  I did not expect this layer to be drawn because of the filters I set in the Query Definition.  However, my Java Script added a new filter using a layer definition.  It looks like the LayerDefinition overrode the query definition in the MXD.  I thought it would just append to it.

Anyway, my problem had nothing to do with scale dependancies or exportOptions.  My problem was that I did not understand how layerDefinition interacted with Query Definition in the MXD.  I am not sure why it worked correctly in the Java Script interface, but did not work in the Print Task.  It doesn't matter though, since I was able to fix my code by appending the original query definition in my layer definition.  Once I did this, I got consistent results.

Thank you for your assistance.
0 Kudos