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
This commit is contained in:
Frederic Junod
2015-09-24 10:59:48 +02:00
parent 252e60b5af
commit cd152cca14

View File

@@ -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([],