diff --git a/src/api/map.js b/src/api/map.js index f6a090fe9b..3c2e1b50bd 100644 --- a/src/api/map.js +++ b/src/api/map.js @@ -7,6 +7,7 @@ goog.require('ol.loc'); goog.require('ol.projection'); goog.require('ol.error'); +goog.require('goog.dispose'); /** * @typedef {ol.Map|{center, zoom, numZoomLevels, projection, userProjection, maxExtent, maxResolution, resolutions, renderTo, layers, controls}|string} @@ -247,3 +248,9 @@ ol.Map.prototype.renderTo = function(arg) { this.setContainer(goog.dom.getElement(arg)); return this; }; + +/** + */ +ol.Map.prototype.destroy = function() { + goog.dispose(this); +}; diff --git a/src/ol.export.js b/src/ol.export.js index a948538215..48f5786f8f 100644 --- a/src/ol.export.js +++ b/src/ol.export.js @@ -13,6 +13,7 @@ goog.exportProperty( ol.Map.prototype, 'resolutions', ol.Map.prototype.resolutio goog.exportProperty( ol.Map.prototype, 'layers', ol.Map.prototype.layers ); goog.exportProperty( ol.Map.prototype, 'controls', ol.Map.prototype.controls ); goog.exportProperty( ol.Map.prototype, 'maxExtent', ol.Map.prototype.maxExtent ); +goog.exportProperty( ol.Map.prototype, 'destroy', ol.Map.prototype.destroy ); // ol.loc goog.exportSymbol('ol.loc', ol.loc ); diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index 12dc1c50a9..eaa1c693d6 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -82,4 +82,4 @@ ol.control.Control.prototype.deactivate = function() { ol.control.Control.prototype.destroy = function() { this.deactivate(); goog.object.clear(this); -}; \ No newline at end of file +};