[OpenLayers-Users] remove all layers

Marc Jansen jansen.marc at gmx.de
Thu Oct 18 05:44:38 EDT 2007

Hi Armin,

I'd guess that map.getNumLayers() helps... if you can assure that they 
are named in the right way


-- Marc

Armin Wäspy schrieb:
> hi list,
> is there a function which removes all displayed layers?
> my map has up to 50 layers, named box1....box50.
> i tried a for-loop with map.removeLayer('BOX'+i) but this don't work 
> if less than 50 layers rendered.
> anybody an idea how i can manage that?
> thanks.
> ------------------------------------------------------------------------
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

More information about the Users mailing list