amarsden

BUG? .visibleLayers returns group layeys

Discussion created by amarsden on Oct 11, 2012
Latest reply on Oct 15, 2012 by amarsden
Hi

I *think* this may be a bug, but please be kind if it isn't.

I have a Map Service with sublayers in groups - defined in the ArcMap MXD.

Becausehttp://forums.arcgis.com/threads/49289-IdentifyParameters.LAYER_OPTION_VISIBLE-still-gives-identify-results-on-all-layers?highlight=LAYER_OPTION_VISIBLE[LEFT]IdentifyParameters.LAYER_OPTION_VISIBLE doesn't work [/LEFT]I use
 identifyParams.layerIds = dynamicMapServiceLayer.visibleLayers;


However the first time this is run, the array returned by dynamicMapServiceLayer.visibleLayers contains group0 layer IDs - this causes the ID task to return very odd results.  Several results are repeated (I've check the JSON in Fiddler and this is in the actual returned data, not a code glitch on my side)

After a layer has been switched on (or off) the returned array by dynamicMapServiceLayer.visibleLayers returns just the real sublayers - not the group Ids and the Id task works fine

Alas, this is an internal service so I can't provide the links

Outcomes