From 3b443ca2c963e3b36975ccf2bd9858db73d90cb5 Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 7 Jun 2006 15:37:51 +0000 Subject: [PATCH] if we destroy a popup, have it remove itself from the map. good programming says that a popup should be removed by the same person who added it... but if the user destroys a popup, s/he assumes it will dissapear, and unless we remove it, it wont do that. git-svn-id: http://svn.openlayers.org/trunk/openlayers@538 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Popup.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index 872ce21bd4..06526d6f03 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -75,6 +75,9 @@ OpenLayers.Popup.prototype = { /** */ destroy: function() { + if (this.map != null) { + this.map.removePopup(this); + } this.div = null; this.map = null; },