Add ol.Map.addLayer

This commit is contained in:
Tom Payne committed 2013-03-06 17:00:17 +01:00
1 parent 441092dad6
commit fcbd758f48
2 files changed
+11

No files matched your search

+1
View File
@@ -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
+10
View File
@@ -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.
*/