Fix PanZoom destroy. Test passes. Fixes #591.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2932 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -32,6 +32,20 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
OpenLayers.Control.PanZoom.Y);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
destroy: function() {
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
while(this.buttons.length) {
|
||||
var btn = this.buttons.shift();
|
||||
btn.map = null;
|
||||
OpenLayers.Event.stopObservingElement(btn);
|
||||
}
|
||||
this.buttons = null;
|
||||
this.position = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
@@ -142,16 +156,6 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
destroy: function() {
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
for(i=0; i<this.buttons.length; i++) {
|
||||
this.buttons[i].map = null;
|
||||
}
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Control.PanZoom"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user