ol.Map now have a LAYERGROUP property
The LAYERS property is gone.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user