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:
@@ -702,16 +702,12 @@ goog.exportProperty(
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
ol.Map.prototype.getLayers = function() {
|
||||
var layerGroup = this.getLayerGroup();
|
||||
if (goog.isDef(layerGroup)) {
|
||||
return layerGroup.getLayers();
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
var layers = this.getLayerGroup().getLayers();
|
||||
return layers;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user