Use correct track attribute

Previously, the last track attribute name would be used as the
feature attribute name.  For tracks with multiple attributes, this
doesn't work.
This commit is contained in:
tschaub
2012-10-23 14:15:22 -06:00
parent 8a8b3076c8
commit 596ac680da

View File

@@ -731,7 +731,8 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
}
if (this.trackAttributes) {
for (var j=0, jj=this.trackAttributes.length; j<jj; ++j) {
feature.attributes[name] = obj.attributes[this.trackAttributes[j]][i];
var name = this.trackAttributes[j];
feature.attributes[name] = obj.attributes[name][i];
}
}
feature.attributes.when = obj.whens[i];