Make getLayerStatesArray return an array of layer states

This commit is contained in:
Tim Schaub
2014-04-03 12:39:48 -06:00
parent 78324fb54b
commit 7826036307
6 changed files with 27 additions and 64 deletions
+4 -9
View File
@@ -57,15 +57,10 @@ ol.layer.Layer.prototype.getLayersArray = function(opt_array) {
/**
* @inheritDoc
*/
ol.layer.Layer.prototype.getLayerStatesArray = function(opt_obj) {
var obj = (goog.isDef(opt_obj)) ? opt_obj : {
layers: [],
layerStates: []
};
goog.asserts.assert(obj.layers.length === obj.layerStates.length);
obj.layers.push(this);
obj.layerStates.push(this.getLayerState());
return obj;
ol.layer.Layer.prototype.getLayerStatesArray = function(opt_states) {
var states = (goog.isDef(opt_states)) ? opt_states : [];
states.push(this.getLayerState());
return states;
};