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:
@@ -14,21 +14,53 @@ OpenLayers.Control.PanZoomBar.Y = 4;
|
|||||||
OpenLayers.Control.PanZoomBar.prototype =
|
OpenLayers.Control.PanZoomBar.prototype =
|
||||||
OpenLayers.Class.inherit( OpenLayers.Control.PanZoom, {
|
OpenLayers.Class.inherit( OpenLayers.Control.PanZoom, {
|
||||||
|
|
||||||
/** @type Array(...) */
|
|
||||||
buttons: null,
|
|
||||||
|
|
||||||
/** @type int */
|
/** @type int */
|
||||||
zoomStopWidth: 18,
|
zoomStopWidth: 18,
|
||||||
|
|
||||||
/** @type int */
|
/** @type int */
|
||||||
zoomStopHeight: 11,
|
zoomStopHeight: 11,
|
||||||
|
|
||||||
|
/** @type DOMElement */
|
||||||
|
slider: null,
|
||||||
|
|
||||||
|
/** @type OpenLayers.Events */
|
||||||
|
sliderEvents: null,
|
||||||
|
|
||||||
|
/** @type DOMElement */
|
||||||
|
zoomBarDiv: null,
|
||||||
|
|
||||||
|
/** @type OpenLayers.Events */
|
||||||
|
divEvents: null,
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
OpenLayers.Control.PanZoom.prototype.initialize.apply(this, arguments);
|
OpenLayers.Control.PanZoom.prototype.initialize.apply(this, arguments);
|
||||||
this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoomBar.X,
|
this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoomBar.X,
|
||||||
OpenLayers.Control.PanZoomBar.Y);
|
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
|
* @param {OpenLayers.Map} map
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user