diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index adb78f0553..5c35cb7d47 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -14,21 +14,53 @@ OpenLayers.Control.PanZoomBar.Y = 4; OpenLayers.Control.PanZoomBar.prototype = OpenLayers.Class.inherit( OpenLayers.Control.PanZoom, { - /** @type Array(...) */ - buttons: null, - /** @type int */ zoomStopWidth: 18, /** @type int */ zoomStopHeight: 11, + /** @type DOMElement */ + slider: null, + + /** @type OpenLayers.Events */ + sliderEvents: null, + + /** @type DOMElement */ + zoomBarDiv: null, + + /** @type OpenLayers.Events */ + divEvents: null, + initialize: function() { OpenLayers.Control.PanZoom.prototype.initialize.apply(this, arguments); this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoomBar.X, OpenLayers.Control.PanZoomBar.Y); }, + /** + * + */ + destroy: function() { + + this.div.removeChild(this.slider); + this.slider = null; + + this.sliderEvents.destroy(); + this.sliderEvents = null; + + this.div.removeChild(this.zoombarDiv); + this.zoomBarDiv = null; + + this.divEvents.destroy(); + this.divEvents = null; + + this.map.events.unregister("zoomend", this, this.moveZoomBar); + this.map.events.unregister("changebaselayer", this, this.redraw) + + OpenLayers.Control.PanZoom.prototype.destroy.apply(this, arguments); + }, + /** * @param {OpenLayers.Map} map */