From c0c14cb09c5adee91dc73dc89b3d5dda71648b4f Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 3 Sep 2014 12:44:54 +0200 Subject: [PATCH] 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. --- src/ol/map.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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; };