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:
Frederic Junod
2014-09-03 12:44:54 +02:00
parent 96f7d6323a
commit c0c14cb09c

View File

@@ -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;
};