Hi, I think you have an error because you're removing layer[1], and right after that, you're trying to destroy a layer that is already removed for the map's list of layer.
I suppose you could just destroy the layer, or you could just remove it and refresh the map object. Maxime -- View this message in context: http://n2.nabble.com/Delete-layer-vector-on-a-map-tp4540464p4541229.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users