diff --git a/src/ol/map.js b/src/ol/map.js index 8dfb3a678c..0f3dce3e9d 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -702,16 +702,12 @@ goog.exportProperty( /** * Get the collection of layers associated with this map. - * @return {!ol.Collection.|undefined} Layers. + * @return {!ol.Collection.} 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; };