diff --git a/src/ol/format/gml/gmlbaseformat.js b/src/ol/format/gml/gmlbaseformat.js index 4d4d7809e0..77cd3aeb9f 100644 --- a/src/ol/format/gml/gmlbaseformat.js +++ b/src/ol/format/gml/gmlbaseformat.js @@ -5,7 +5,6 @@ goog.provide('ol.format.GMLBase'); goog.require('goog.asserts'); goog.require('goog.dom.NodeType'); -goog.require('goog.object'); goog.require('goog.string'); goog.require('ol.array'); goog.require('ol.Feature'); @@ -123,14 +122,19 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) { if (child.nodeType === 1) { var ft = child.nodeName.split(':').pop(); if (featureType.indexOf(ft) === -1) { - var key; - if (!goog.object.contains(featureNS, child.namespaceURI)) { - key = prefix + goog.object.getCount(featureNS); - featureNS[key] = child.namespaceURI; - } else { - key = goog.object.findKey(featureNS, function(value) { - return value === child.namespaceURI; - }); + var key = ''; + var count = 0; + var uri = child.namespaceURI; + for (var candidate in featureNS) { + if (featureNS[candidate] === uri) { + key = candidate; + break; + } + ++count; + } + if (!key) { + key = prefix + count; + featureNS[key] = uri; } featureType.push(key + ':' + ft); }