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: {
|
methods: {
|
||||||
exportGPX() {
|
exportGPX() {
|
||||||
const activityName = this.$t('misc.activityName');
|
const activityName = this.$t('misc.activityName');
|
||||||
const waypoints = this.$store.state.location.gpx.map(
|
const waypoints = [];
|
||||||
item => Object.assign({}, item, { timestamp: new Date(item.timestamp) }),
|
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, {
|
const gpx = createGPX(waypoints, {
|
||||||
activityName,
|
activityName,
|
||||||
creator: `Cycl'Assist v${VERSION}`,
|
creator: `Cycl'Assist v${VERSION}`,
|
||||||
|
Loading…
Reference in New Issue
Block a user