ArcGIS Server 10.1 fails to print the legend with and without sublayerid.

4934
10
08-28-2013 08:36 AM
hs
by
New Contributor
Hi Folks,

We have encountered an issue with ArcGIS Server 10.1 print service. It fails to print the legend with and without sublayerid as opposed to the bug NIM083432 that reads "PrintService does not draw the legends of mapservice sub-layers when subLayerIds are specified". This does not seem to be a related bug as it fails to draw the legend items without sublayerids too. Any clues what must be missing on this.

Thanks,
Harshal

Below is the WebMap JSON that doesn't show up legend for layer 0 having Class Breaks Renderer and the other layers with Simple Renderer does show up fine.

{"mapOptions":{"showAttribution":true,"extent":{"xmin":-8851509.581441754,"ymin":4234412.018976383,"xmax":-8642683.620166572,"ymax":4296784.63405711,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":577790.5542890031},"operationalLayers":[{"id":"layerActiveMonumentsLayer","title":"layerActiveMonumentsLayer","opacity":1,"url":"http://servicesbeta2.esri.com/arcgis/rest/services/Census/MapServer","layers":[]}],"exportOptions":{"outputSize":[800,1100],"dpi":96},"layoutOptions":{"customTextElements":[{"titleText":"title"},{"projectName":"NC Geodetic Database"}],"scaleBarOptions":{},"legendOptions":{"operationalLayers":[{"id":"layerActiveMonumentsLayer","subLayerIds":[0]}]}}}
Tags (2)
0 Kudos
10 Replies
TanuHoque
Esri Regular Contributor
Harshal,
the reason you are not seeing anything on the legend is because the sublayer id you specified inside 'legendOptions.opertaionalLayers.sublayerIds' has scale-visibility range set. the scale you are requesting the output is beyond that scale range, as result the layer does not draw, therefore nothing shows up in the legend.

here is the modified version (scale is set to 1:50,000) of your json that I tried and got the legends shown up in the output:
{"mapOptions":{"showAttribution":true,"extent":{"xmin":-8851509.581441754,"ymin":4234412.018976383,"xmax":-8642683.620166572,"ymax":4296784.63405711,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":50000},"operationalLayers":[{"id":"layerActiveMonumentsLayer","title":"layerActiveMonumentsLayer","opacity":1,"url":"http://servicesbeta2.esri.com/arcgis/rest/services/Census/MapServer","layers":[]}],"exportOptions":{"outputSize":[800,1100],"dpi":96},"layoutOptions":{"customTextElements":[{"titleText":"title"},{"projectName":"NC Geodetic Database"}],"scaleBarOptions":{},"legendOptions":{"operationalLayers":[{"id":"layerActiveMonumentsLayer","subLayerIds":[0]}]}}}

here is the entire request to the printing service.
http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/....


you can also try by removing the subLayerIds to have legends from all layers shown.
http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools...

Thanks.
Tanu
0 Kudos
hs
by
New Contributor
Hi Tanu,

Thanks for the reply. I guess the issue we are currently  facing is different than the one you specified. I have shared  the online service that I used since we had issues with our services. There is no scale dependency on the layers at my end.

Regards,
Harshal S


Harshal
the reason you are not seeing anything on the legend is because the sublayer id you specified inside 'legendOptions.opertaionalLayers.sublayerIds' has scale-visibility range set. the scale you are requesting the output is beyond that scale range, as result the layer does not draw, therefore nothing shows up in the legend.

here is the modified version (scale is set to 1:50,000) of your json that I tried and got the legends shown up in the output:
{"mapOptions":{"showAttribution":true,"extent":{"xmin":-8851509.581441754,"ymin":4234412.018976383,"xmax":-8642683.620166572,"ymax":4296784.63405711,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":50000},"operationalLayers":[{"id":"layerActiveMonumentsLayer","title":"layerActiveMonumentsLayer","opacity":1,"url":"http://servicesbeta2.esri.com/arcgis/rest/services/Census/MapServer","layers":[]}],"exportOptions":{"outputSize":[800,1100],"dpi":96},"layoutOptions":{"customTextElements":[{"titleText":"title"},{"projectName":"NC Geodetic Database"}],"scaleBarOptions":{},"legendOptions":{"operationalLayers":[{"id":"layerActiveMonumentsLayer","subLayerIds":[0]}]}}}

here is the entire request to the printing service.
http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/....


you can also try by removing the subLayerIds to have legends from all layers shown.
http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools...

Thanks.
Tanu
0 Kudos
TanuHoque
Esri Regular Contributor
Harshal,
if you service is shared publicly, I'd appreciate if could share the new json (with url pointing to your service) with me and I will be more than happy to take a look.

thanks.
Tanu
0 Kudos
hs
by
New Contributor
Thanks for replying Tanu! I would not be able to share the url however I can share the screen if you wish through skype if it is alrite with you.. My skype id is 'harshal_82' and msn is 'harshal2009@live.com.

Thanks,
Harshal

Harshal,
if you service is shared publicly, I'd appreciate if could share the new json (with url pointing to your service) with me and I will be more than happy to take a look.

thanks.
Tanu
0 Kudos
hs
by
New Contributor
Just wanted to provide some additional info regarding the printing task. We have tried to test the print task with the template data published and it failed too with the printing of legends for the unique value renderer. This require us to go with simple renderer instead of unique value renderer. This seems to be a software defect with ArcGIS 10.1 print task. Logged bugs so far does not lead us to any know similar issue.

Thanks for replying Tanu! I would not be able to share the url however I can share the screen if you wish through skype if it is alrite with you.. My skype id is 'harshal_82' and msn is 'harshal2009@live.com.

Thanks,
Harshal
0 Kudos
TanuHoque
Esri Regular Contributor
Harshal,
Unfortunately I can't do the skype thing.
I'd really appreciate if you could contact Esri Tech Support and have them look into the problem remotely.

Thanks a lot.
Tanu
0 Kudos
hs
by
New Contributor
Thanks for the reply Tanu! That sounds good, we will do that.

Regards,
Harshal

Harshal,
Unfortunately I can't do the skype thing.
I'd really appreciate if you could contact Esri Tech Support and have them look into the problem remotely.

Thanks a lot.
Tanu
0 Kudos
TanuHoque
Esri Regular Contributor

I'm not sure why/how the email on this thread showed up in my inbox today.

Anyways, I think it is a good thing that happened I probably understand what you mean this time around. You meant the 'layer names' are not showing up in the legend element for "class breaks" and "unique value" renderers, no job failure or error right? and because of that you'd not know which layer a legend patch belongs too.

If i understood the issue correctly, then there is a good news that the bug got fixed in 10.3.

0 Kudos
FC_Basson
MVP Regular Contributor

Hi Tanu

You can test if the issue is resolved with Esri's 10.3 version of the print service at http://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%2...

0 Kudos