[OpenLayers-Users] remove all layers

Christopher Schmidt crschmidt at metacarta.com
Thu Oct 18 07:33:32 EDT 2007


On Thu, Oct 18, 2007 at 10:51:50AM +0200, Armin W??spy wrote:
> hi list,
> is there a function which removes all displayed layers?

for (var i = map.layers.length - 1; i >= 0; i--) {
    map.removeLayer(map.layers[i]);
}    

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list