diff --git a/src/ol/map.exports b/src/ol/map.exports index 656ef9cef4..1364db3960 100644 --- a/src/ol/map.exports +++ b/src/ol/map.exports @@ -1,4 +1,5 @@ @exportClass ol.Map ol.MapOptions +@exportProperty ol.Map.prototype.addLayer @exportProperty ol.Map.prototype.addPreRenderFunction @exportProperty ol.Map.prototype.addPreRenderFunctions @exportProperty ol.Map.prototype.getInteractions diff --git a/src/ol/map.js b/src/ol/map.js index 8f9af2249f..a388d92f89 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -292,6 +292,16 @@ ol.Map = function(mapOptions) { goog.inherits(ol.Map, ol.Object); +/** + * @param {ol.layer.Layer} layer Layer. + */ +ol.Map.prototype.addLayer = function(layer) { + var layers = this.getLayers(); + goog.asserts.assert(goog.isDef(layers)); + layers.push(layer); +}; + + /** * @param {ol.PreRenderFunction} preRenderFunction Pre-render function. */