Map export with zero visible layers

657
2
09-16-2010 12:43 AM
AleksandrasKapitanovas
New Contributor
Hi,
Today I noticed interesting behavior of ArcGISDynamicMapServiceLayer when working with my application that uses ArcGIS JavaScript API 2.0. The problem is that if I turn off my all layers I recieve an error from ArcGIS Server 10 that states that there was an error while exporting image. After bit of digging I found that the problem was in query string specifically with "layers" variable. When there is no visible layers this parameters has a value of "show:" or in encoded form "show%3A". It seems that ArcGIS Server 10 fails to handle this value correctly (I did not noticed this behavior with ArcGIS Server 9.4 b2) and just throws 404 exception. If I eliminate this parameter server returns image with by default visible layers. So is this a problem of ArcGIS Server 10 or JavaScript API 2.0?

P.S. Sorry if I missed and existing topic about this.
0 Kudos
2 Replies
AxelSchaefer
New Contributor II
Some additional points.

- The behaviour is different to the AGS 9.3.1 version. That version returned a blank image, not an exception.

- The provided solution says, that you have to build your own logic in your layercontrol. If no layer is checked you have fill the "show" attribute with the layer ID -1. I don't know if this is an appropriate workflow or if the server should behave differently.

- For a layer-control, you can ignore the grouplayers. They are not needed in the REST-request for the "show" parameter. The analog behaviour of ArcMap (grouplayer affects the visibility of sublayers) is not implemented in the REST API. It doesn't matter for the "show" parameter in the API if the group-layer is checked or not. Only the sublayer, which are not group-layers, count. The "hide" parameter behaves differently.

HTH and Regards.
0 Kudos