Destroy and doc fixes to PanZoomBar. Fixes #592. Passes all tests.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2933 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2007-03-30 21:54:42 +00:00
parent 882c71a424
commit 6c166a40e6

View File

@@ -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
*/