From cd152cca14f313d4148427e996d1d39ea9e5d4f7 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 24 Sep 2015 10:59:48 +0200 Subject: [PATCH] Use a for loop instead of goog.array.forEach The variable is a NodeList, not an Array. https://developer.mozilla.org/en-US/docs/Web/API/NodeList#Why_is_NodeList_not_an_Array --- src/ol/format/wmsgetfeatureinfoformat.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ol/format/wmsgetfeatureinfoformat.js b/src/ol/format/wmsgetfeatureinfoformat.js index 6b439459dd..36c8eee202 100644 --- a/src/ol/format/wmsgetfeatureinfoformat.js +++ b/src/ol/format/wmsgetfeatureinfoformat.js @@ -75,9 +75,10 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = return features; } if (localName == 'msGMLOutput') { - goog.array.forEach(node.childNodes, function(layer) { + for (var i = 0, ii = node.childNodes.length; i < ii; i++) { + var layer = node.childNodes[i]; if (layer.nodeType !== goog.dom.NodeType.ELEMENT) { - return; + continue; } var context = objectStack[0]; goog.asserts.assert(goog.isObject(context), @@ -105,7 +106,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = if (layerFeatures) { goog.array.extend(features, layerFeatures); } - }, this); + } } if (localName == 'FeatureCollection') { var gmlFeatures = ol.xml.pushParseAndPop([],