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:
@@ -95,6 +95,13 @@ ol.control.Zoom.prototype.handle = function(evt) {
|
|||||||
return !handled;
|
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.addControl('zoom', ol.control.Zoom);
|
||||||
|
|
||||||
ol.control.Zoom.RES = {
|
ol.control.Zoom.RES = {
|
||||||
|
|||||||
Reference in New Issue
Block a user