[OpenLayers-Users] removing a layer

Puneet Kishor punk.kish at gmail.com
Thu Jan 19 16:00:03 EST 2012


I am trying to remove a layer with

    if (map.getLayerIndex(layer) > 0) {
        map.removeLayer(layer);
    }

but no joy. How can I remove a layer?

A bonus question: if I want to reconstruct a  vector layer on map "zoomend", that is, redraw all the features on it so they are resized accordingly, should I remove the layer (hence, the question above), or simply remove all the features and redraw the features? If the latter, then how?

Many thanks,

--
Puneet Kishor 


More information about the Users mailing list