myera

layer.setVisibleLayers() behaves differently in 10 from 9.3

Discussion created by myera on Jul 20, 2011
Latest reply on Jul 20, 2011 by gvyas-esristaff
Hello,

We have run across what we feel is a bug.  In ArcGIS server 9.3, if you tried the following:

layer.setVisibleLayers([]);


it would hide all the layers appropriately.

When you do the same thing in ArcGIS server 10, it does not remove the last layer.

In our scenario, a user may choose to toggle layer visibility by clicking on a checkbox list of layers.  When they try to toggle visibility off for all layers, the last layer always remains, unless you toggle the visibility of it's parent layer as well.

You can see this behavior in the working example on esri's website too.

Is this working as intended?  Or is this a bug?  If it is working as intended, is there a workaround for this behavior?

Outcomes