Not all ESRI WMSGetFeatureInfo formats parsed, p=me, r=cmoullet,erilem (closes #3177)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11741 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2011-03-29 09:44:07 +00:00
parent af2f3b7a70
commit 46fc3182e4
2 changed files with 38 additions and 4 deletions

View File

@@ -150,10 +150,25 @@ OpenLayers.Format.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Format.XML, {
var featureNode = featureNodes[i];
var geom = null;
// attributes can be actual attributes on the FIELDS tag,
// or FIELD children
var attributes = {};
for(var j=0, jlen=featureNode.attributes.length; j<jlen; j++) {
var attribute = featureNode.attributes[j];
attributes[attribute.nodeName] = attribute.nodeValue;
var j;
var jlen = featureNode.attributes.length;
if (jlen > 0) {
for(j=0; j<jlen; j++) {
var attribute = featureNode.attributes[j];
attributes[attribute.nodeName] = attribute.nodeValue;
}
} else {
var nodes = featureNode.childNodes;
for (j=0, jlen=nodes.length; j<jlen; ++j) {
var node = nodes[j];
if (node.nodeType != 3) {
attributes[node.getAttribute("name")] =
node.getAttribute("value");
}
}
}
response.push(