I want to remove a set of layers from the map, while keeping other
layers. I see there is a map.getLayersByClass() method which returns
an array of layers of a certain class. I am guessing, I can do
something like so

var layers = map.getLayersByClass('foo');
for (var i=0; i < layers.length; i++) {
    map.removeLayer(i);
}

Is the above assumption correct? And, that said, how and where do I
attach a class to a layer? I don't see any option to set a WMS layer
to class = 'foo' when adding it. What am I missing?


-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to