protect for in loops with hasOwnProperty
This commit is contained in:
@@ -325,15 +325,17 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
featureNode.appendChild(linkNode);
|
||||
}
|
||||
for(var attr in feature.attributes) {
|
||||
if (attr == "link" || attr == "title" || attr == "description") { continue; }
|
||||
var attrText = this.createTextNode(feature.attributes[attr]);
|
||||
var nodename = attr;
|
||||
if (attr.search(":") != -1) {
|
||||
nodename = attr.split(":")[1];
|
||||
}
|
||||
var attrContainer = this.createElementNS(this.featureNS, "feature:"+nodename);
|
||||
attrContainer.appendChild(attrText);
|
||||
featureNode.appendChild(attrContainer);
|
||||
if (feature.attributes.hasOwnProperty(attr)) {
|
||||
if (attr == "link" || attr == "title" || attr == "description") { continue; }
|
||||
var attrText = this.createTextNode(feature.attributes[attr]);
|
||||
var nodename = attr;
|
||||
if (attr.search(":") != -1) {
|
||||
nodename = attr.split(":")[1];
|
||||
}
|
||||
var attrContainer = this.createElementNS(this.featureNS, "feature:"+nodename);
|
||||
attrContainer.appendChild(attrText);
|
||||
featureNode.appendChild(attrContainer);
|
||||
}
|
||||
}
|
||||
featureNode.appendChild(geometryNode);
|
||||
return featureNode;
|
||||
|
||||
Reference in New Issue
Block a user