Hi, 

Try this

function setOverlaysVisibility(flag)
{
    var layers = map.layers;
    for(var i=0, len=layers.length; i<len; i++) 
    {
        var layer = layers[i];
        var baseLayer = layer.isBaseLayer;
    
        if(!baseLayer)
            layer.setVisibility(flag);
    }
}        
setOverlaysVisibility(true); //or false

Arnd 

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Jan
Tappenbeck
Gesendet: Donnerstag, 23. Juni 2011 10:48
An: [email protected]
Betreff: [OpenLayers-Users] Simple Function for deactive all overlays



   hi !

i search a simple function to de/active all overlays by a function like
foreach ....

can anybody help me ?

regards Jan :-)

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to