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.
This commit is contained in:
ahocevar
2012-06-24 17:08:32 +02:00
parent 45222ac5cb
commit bd8354c831

View File

@@ -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 = {