Avoid emitting empty <ele>
items in GPX
This commit is contained in:
parent
6a70deec70
commit
2cce5e9dba
11
src/App.vue
11
src/App.vue
@ -98,9 +98,14 @@ export default {
|
||||
methods: {
|
||||
exportGPX() {
|
||||
const activityName = this.$t('misc.activityName');
|
||||
const waypoints = this.$store.state.location.gpx.map(
|
||||
item => Object.assign({}, item, { timestamp: new Date(item.timestamp) }),
|
||||
);
|
||||
const waypoints = [];
|
||||
this.$store.state.location.gpx.forEach((item) => {
|
||||
const waypoint = Object.assign({}, item, { timestamp: new Date(item.timestamp) });
|
||||
if (waypoint.elevation === null || waypoint.elevation === undefined) {
|
||||
delete waypoint.elevation;
|
||||
}
|
||||
waypoints.push(waypoint);
|
||||
});
|
||||
const gpx = createGPX(waypoints, {
|
||||
activityName,
|
||||
creator: `Cycl'Assist v${VERSION}`,
|
||||
|
Loading…
Reference in New Issue
Block a user