From bd8354c8316b176d66f7babbf7b1fb589c1708be Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sun, 24 Jun 2012 17:08:32 +0200 Subject: [PATCH] Adding destroy method. The control now removes its markup from the DOM. A nice aspect of our event handling is that no events need to be registered on any of the dom elements that controls create. --- src/ol/control/Zoom.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ol/control/Zoom.js b/src/ol/control/Zoom.js index ecd976cbea..c92f7a95de 100644 --- a/src/ol/control/Zoom.js +++ b/src/ol/control/Zoom.js @@ -95,6 +95,13 @@ ol.control.Zoom.prototype.handle = function(evt) { return !handled; }; +ol.control.Zoom.prototype.destroy = function() { + goog.dom.removeNode(goog.dom.getElementByClass( + ol.control.Zoom.RES.CLS, this.map_.getViewport() + )); + goog.base(this, 'destroy'); +}; + ol.control.addControl('zoom', ol.control.Zoom); ol.control.Zoom.RES = {