AnsweredAssumed Answered

How to determine whether a layer is on but outside the scale range

Question asked by stevel on Apr 11, 2012
Latest reply on Apr 13, 2012 by jeff.pace
Is there a way to determine whether a layer is switched on, but is not currently shown due to the scale threshold?

See the attached file for an example. When the map first loads, the counties layer is "on" but is not shown due to the map scale. Zoom in a level and and the counties appear.

How can I determine this programmatically? featureLayer.visible returns "true" at all scales. featureLayer.onVisibilityChange doesn't fire when the scale threshold is crossed.

The workaround is to check the current map scale (by finding the LOD and figuring out the corresponding scale?) and compare it to the layer's minScale and maxScale. This seems like a clumsy workaround - is it the only option?