Cleanup after the Navigation control (at least slightly more)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5891 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-01-25 01:35:34 +00:00
parent 233af36280
commit e4ec1b58b0

View File

@@ -54,6 +54,21 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.initialize.apply(this, arguments);
},
/**
* Method: destroy
* The destroy method is used to perform any clean up before the control
* is dereferenced. Typically this is where event listeners are removed
* to prevent memory leaks.
*/
destroy: function() {
OpenLayers.Control.prototype.destroy.apply(this,arguments);
this.deactivate();
this.dragPan.destroy();
this.wheelHandler.destroy();
this.clickHandler.destroy();
this.zoomBox.destroy();
},
/**
* Method: activate
*/