************* getLayersVisibleAtScale does not work *************

983
3
08-20-2013 07:38 AM
yanivarazi
New Contributor
hi,
I am using javascript api ver 3.6.
I have 2 layers, one base and one dynamic.
The getLayersVisibleAtScale does not work at all.
I manually hide my dynamic layer and see it gone on the screen, but i still get 2 layers objects and .

var layers = map.getLayersVisibleAtScale(  map.getScale() );

can you please help me  ? 

thanks
yaniv
0 Kudos
3 Replies
derekswingley1
Frequent Contributor
It's not clear from our documentation, but the purpose of getLayersVisibleAtScale is to determine whether or not a layer's min and max scale would cause a layer to be visible or not. If you want to know whether or not a layer is currently shown on the map, do what you're doing and check layer.visible. If both are true, the layer is currently displayed on the map.
0 Kudos
yanivarazi
New Contributor
Thank you for your reply.
0 Kudos
yanivarazi
New Contributor
Drilling down to layers, how do i checklayer.layerInfos item in the current extent  ?
0 Kudos