ol.Map now have a LAYERGROUP property

The LAYERS property is gone.
This commit is contained in:
Bruno Binet
2013-06-27 18:58:32 +02:00
parent d84477c1c0
commit e4c36378ac
5 changed files with 81 additions and 42 deletions
+10
View File
@@ -45,6 +45,16 @@ ol.layer.Layer.prototype.dispatchLoadEvent_ = function() {
};
/**
* @inheritDoc
*/
ol.layer.Layer.prototype.getLayersArray = function(opt_array) {
var array = (goog.isDef(opt_array)) ? opt_array : [];
array.push(this);
return array;
};
/**
* @inheritDoc
*/
+8
View File
@@ -122,6 +122,14 @@ ol.layer.LayerBase.prototype.getLayerState = function() {
};
/**
* @param {Array.<ol.layer.Layer>=} opt_array Array of layers (to be
* modified in place).
* @return {Array.<ol.layer.Layer>} Array of layers.
*/
ol.layer.LayerBase.prototype.getLayersArray = goog.abstractMethod;
/**
* @param {{
* layers: Array.<ol.layer.Layer>,
+12
View File
@@ -167,6 +167,18 @@ goog.exportProperty(
ol.layer.LayerGroup.prototype.setLayers);
/**
* @inheritDoc
*/
ol.layer.LayerGroup.prototype.getLayersArray = function(opt_array) {
var array = (goog.isDef(opt_array)) ? opt_array : [];
this.getLayers().forEach(function(layer) {
layer.getLayersArray(array);
});
return array;
};
/**
* @inheritDoc
*/