Remove undefined from ol.Map#getLayers return type
It's already assumed that the collection is defined in ol.Map#addLayer and ol.Map#removeLayer.
This commit is contained in:
+3
-7
@@ -702,16 +702,12 @@ goog.exportProperty(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the collection of layers associated with this map.
|
* Get the collection of layers associated with this map.
|
||||||
* @return {!ol.Collection.<ol.layer.Base>|undefined} Layers.
|
* @return {!ol.Collection.<ol.layer.Base>} Layers.
|
||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getLayers = function() {
|
ol.Map.prototype.getLayers = function() {
|
||||||
var layerGroup = this.getLayerGroup();
|
var layers = this.getLayerGroup().getLayers();
|
||||||
if (goog.isDef(layerGroup)) {
|
return layers;
|
||||||
return layerGroup.getLayers();
|
|
||||||
} else {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user