[OpenLayers-Users] Delete layer.vector on a map

Maxime Phaneuf maxime.phaneuf at usherbrooke.ca
Tue Feb 9 10:03:24 EST 2010


Hello,

Since you removed the layer from the map, you cannot use
map.layer[1].destroy(). You can still use the destroy() function, but you'll
have to use it on the layer variable directly. For example:
var myLayer = new OpenLayers.Layer.XXX

map.removeLayer(map.layer[1])
//map.layer[1].destroy()
myLayer.destroy();

Hope this helps

Maxime
-- 
View this message in context: http://n2.nabble.com/Delete-layer-vector-on-a-map-tp4540464p4541517.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list