Skip to content

Instantly share code, notes, and snippets.

@JanDW
Created October 31, 2024 17:47
Show Gist options
  • Save JanDW/a55c8378382ec30c78b56c3d0ccd2a56 to your computer and use it in GitHub Desktop.
Save JanDW/a55c8378382ec30c78b56c3d0ccd2a56 to your computer and use it in GitHub Desktop.
return {
fileName: gpxFile,
// gpxString: gpxStringClean,
trkName,
totalDistance: totalDistance.toFixed(2),
startWaypoint: {
name: startWaypoint.getElementsByTagName('name')[0]?.textContent,
lat: startWaypoint.getAttribute('lat'),
lon: startWaypoint.getAttribute('lon'),
ele: startWaypoint.getElementsByTagName('ele')[0]?.textContent,
time: startWaypoint.getElementsByTagName('time')[0]?.textContent,
},
endWaypoint: {
name: endWaypoint.getElementsByTagName('name')[0]?.textContent,
lat: endWaypoint.getAttribute('lat'),
lon: endWaypoint.getAttribute('lon'),
ele: endWaypoint.getElementsByTagName('ele')[0]?.textContent,
time: endWaypoint.getElementsByTagName('time')[0]?.textContent,
},
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment