parse waypoints last, so that they're on top. patch by Edgemaster, r=elemoine,

(Closes #1763) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@8531 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-12-21 14:43:58 +00:00
parent 34959835fb
commit e2319ffa12
2 changed files with 17 additions and 17 deletions

View File

@@ -72,18 +72,6 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, {
}
var features = [];
if(this.extractWaypoints) {
var waypoints = doc.getElementsByTagName("wpt");
for (var l = 0, len = waypoints.length; l < len; l++) {
var attrs = {};
if(this.extractAttributes) {
attrs = this.parseAttributes(waypoints[l]);
}
var wpt = new OpenLayers.Geometry.Point(waypoints[l].getAttribute("lon"), waypoints[l].getAttribute("lat"));
features.push(new OpenLayers.Feature.Vector(wpt, attrs));
}
}
if(this.extractTracks) {
var tracks = doc.getElementsByTagName("trk");
for (var i=0, len=tracks.length; i<len; i++) {
@@ -115,6 +103,18 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, {
}
}
if(this.extractWaypoints) {
var waypoints = doc.getElementsByTagName("wpt");
for (var l = 0, len = waypoints.length; l < len; l++) {
var attrs = {};
if(this.extractAttributes) {
attrs = this.parseAttributes(waypoints[l]);
}
var wpt = new OpenLayers.Geometry.Point(waypoints[l].getAttribute("lon"), waypoints[l].getAttribute("lat"));
features.push(new OpenLayers.Feature.Vector(wpt, attrs));
}
}
if (this.internalProjection && this.externalProjection) {
for (var g = 0, featLength = features.length; g < featLength; g++) {
features[g].geometry.transform(this.externalProjection,