give the navigation control a proper destroy and also give it a test file while we're at it. (Closes #1289)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5990 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2008-02-05 06:34:20 +00:00
parent 8311449985
commit 672d3c4eed
3 changed files with 91 additions and 4 deletions

View File

@@ -62,11 +62,28 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*/
destroy: function() {
OpenLayers.Control.prototype.destroy.apply(this,arguments);
this.deactivate();
this.dragPan.destroy();
this.wheelHandler.destroy();
this.clickHandler.destroy();
this.zoomBox.destroy();
if (this.dragPan) {
this.dragPan.destroy();
}
this.dragPan = null;
if (this.wheelHandler) {
this.wheelHandler.destroy();
}
this.wheelHandler = null;
if (this.clickHandler) {
this.clickHandler.destroy();
}
this.clickHandler = null;
if (this.zoomBox) {
this.zoomBox.destroy();
}
this.zoomBox = null;
},
/**