BUG? .visibleLayers returns group layeys

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

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.

Because[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