diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index ea5ca628ef..b1cad1541f 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -150,6 +150,7 @@ OpenLayers.Map.prototype = { removeLayer: function(layer) { this.layerContainerDiv.removeChild(layer.div); this.layers.remove(layer); + layer.map = null; this.events.triggerEvent("removelayer"); }, @@ -199,6 +200,7 @@ OpenLayers.Map.prototype = { if (popup.div) { this.layerContainerDiv.removeChild(popup.div); } + popup.map = null; }, /**