From 68bf0c0c4cfab069efe42f429a01fd4546f8c6c9 Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Fri, 30 Mar 2007 21:58:26 +0000 Subject: [PATCH] Permalink gets a destroy method. Fixes #594. git-svn-id: http://svn.openlayers.org/trunk/openlayers@2935 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/Permalink.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/OpenLayers/Control/Permalink.js b/lib/OpenLayers/Control/Permalink.js index 25b3d153a4..0235e719de 100644 --- a/lib/OpenLayers/Control/Permalink.js +++ b/lib/OpenLayers/Control/Permalink.js @@ -32,6 +32,20 @@ OpenLayers.Control.Permalink.prototype = } }, + /** + * + */ + destroy: function() { + if (this.element.parentNode == this.div) { + this.div.removeChild(this.element); + } + this.element = null; + + this.map.events.unregister('moveend', this, this.updateLink); + + OpenLayers.Control.prototype.destroy.apply(this, arguments); + }, + /** Set the map property for the control. * * @param {OpenLayers.Map} map