Update NPM deps and export GPX with more details

This commit is contained in:
Lucas Verney 2018-08-09 23:46:01 +02:00
parent 2cce5e9dba
commit 072eec69c8
3 changed files with 61 additions and 36 deletions

View File

@ -16,7 +16,7 @@
"dependencies": { "dependencies": {
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"file-saver": "^1.3.8", "file-saver": "^1.3.8",
"gps-to-gpx": "^1.3.0", "gps-to-gpx": "^1.4.0",
"howler": "^2.0.14", "howler": "^2.0.14",
"isomorphic-fetch": "^2.2.1", "isomorphic-fetch": "^2.2.1",
"leaflet": "^1.3.1", "leaflet": "^1.3.1",
@ -30,7 +30,7 @@
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vue2-leaflet": "^1.0.2", "vue2-leaflet": "^1.0.2",
"vue2-leaflet-tracksymbol": "^1.0.10", "vue2-leaflet-tracksymbol": "^1.0.10",
"vuetify": "^1.1.0", "vuetify": "^1.1.10",
"vuex": "^3.0.1" "vuex": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {
@ -56,17 +56,17 @@
"image-webpack-loader": "^4.3.1", "image-webpack-loader": "^4.3.1",
"mini-css-extract-plugin": "^0.4.1", "mini-css-extract-plugin": "^0.4.1",
"optimize-css-assets-webpack-plugin": "^5.0.0", "optimize-css-assets-webpack-plugin": "^5.0.0",
"portfinder": "^1.0.15", "portfinder": "^1.0.16",
"postcss-import": "^12.0.0", "postcss-import": "^12.0.0",
"postcss-loader": "^2.0.8", "postcss-loader": "^3.0.0",
"postcss-url": "^7.2.1", "postcss-url": "^8.0.0",
"stylus": "^0.54.5", "stylus": "^0.54.5",
"stylus-loader": "^3.0.2", "stylus-loader": "^3.0.2",
"svg-url-loader": "^2.3.2", "svg-url-loader": "^2.3.2",
"svg2png": "^4.1.1", "svg2png": "^4.1.1",
"uglifyjs-webpack-plugin": "^1.1.1", "uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^1.0.1", "url-loader": "^1.0.1",
"vue-loader": "^15.2.6", "vue-loader": "^15.3.0",
"vue-style-loader": "^4.1.1", "vue-style-loader": "^4.1.1",
"vue-template-compiler": "^2.5.2", "vue-template-compiler": "^2.5.2",
"webpack": "^4.16.5", "webpack": "^4.16.5",

View File

@ -98,22 +98,35 @@ export default {
methods: { methods: {
exportGPX() { exportGPX() {
const activityName = this.$t('misc.activityName'); const activityName = this.$t('misc.activityName');
const courseKey = 'heading';
const eleKey = 'elevation';
const hdopKey = 'hdop';
const speedKey = 'speed';
const vdopKey = 'vdop';
const waypoints = []; const waypoints = [];
this.$store.state.location.gpx.forEach((item) => { this.$store.state.location.gpx.forEach((item) => {
const waypoint = Object.assign({}, item, { timestamp: new Date(item.timestamp) }); const waypoint = Object.assign({}, item, { timestamp: new Date(item.timestamp) });
if (waypoint.elevation === null || waypoint.elevation === undefined) { [courseKey, eleKey, hdopKey, speedKey, vdopKey].forEach((key) => {
delete waypoint.elevation; if (waypoint[key] === null || waypoint[key] === undefined) {
} delete waypoint.elevation;
}
});
waypoints.push(waypoint); waypoints.push(waypoint);
}); });
const gpx = createGPX(waypoints, { const gpx = createGPX(waypoints, {
activityName, activityName,
creator: `Cycl'Assist v${VERSION}`, creator: `Cycl'Assist v${VERSION}`,
eleKey: 'elevation', courseKey,
eleKey,
hdopKey,
latKey: 'latitude', latKey: 'latitude',
lonKey: 'longitude', lonKey: 'longitude',
speedKey,
startTime: waypoints[0].timestamp, startTime: waypoints[0].timestamp,
timeKey: 'timestamp', timeKey: 'timestamp',
vdopKey,
}); });
FileSaver.saveAs( FileSaver.saveAs(
new Blob([gpx], { type: 'application/gpx+xml;charset=utf-8' }), new Blob([gpx], { type: 'application/gpx+xml;charset=utf-8' }),

View File

@ -273,6 +273,10 @@ acorn@^5.0.0, acorn@^5.0.3, acorn@^5.3.0, acorn@^5.6.0, acorn@^5.6.2:
version "5.7.1" version "5.7.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8"
ajv-errors@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.0.tgz#ecf021fa108fd17dfb5e6b383f2dd233e31ffc59"
ajv-keywords@^3.0.0, ajv-keywords@^3.1.0: ajv-keywords@^3.0.0, ajv-keywords@^3.1.0:
version "3.2.0" version "3.2.0"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a"
@ -3824,9 +3828,9 @@ got@^7.0.0:
url-parse-lax "^1.0.0" url-parse-lax "^1.0.0"
url-to-options "^1.0.1" url-to-options "^1.0.1"
gps-to-gpx@^1.3.0: gps-to-gpx@^1.4.0:
version "1.3.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/gps-to-gpx/-/gps-to-gpx-1.3.0.tgz#6b422a15073c6aced31e45c77712d6727822d39d" resolved "https://registry.yarnpkg.com/gps-to-gpx/-/gps-to-gpx-1.4.0.tgz#9cf4e5ae630189e0058dd01897111a55168009bc"
dependencies: dependencies:
babel-runtime "6.18.0" babel-runtime "6.18.0"
loose-envify "1.3.0" loose-envify "1.3.0"
@ -5437,11 +5441,11 @@ mime@1.4.1:
version "1.4.1" version "1.4.1"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
mime@^1.3.4, mime@^1.4.1: mime@^1.3.4:
version "1.6.0" version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
mime@^2.0.3, mime@^2.1.0: mime@^2.0.3, mime@^2.1.0, mime@^2.3.1:
version "2.3.1" version "2.3.1"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369"
@ -6286,9 +6290,9 @@ pngquant-bin@^4.0.0:
execa "^0.10.0" execa "^0.10.0"
logalot "^2.0.0" logalot "^2.0.0"
portfinder@^1.0.15: portfinder@^1.0.16:
version "1.0.15" version "1.0.16"
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.15.tgz#28990f8a1d2794a5709010b25d9f6d90fcc2fa14" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.16.tgz#a6a68be9c352bc66c1a4c17a261f661f3facaf52"
dependencies: dependencies:
async "^1.5.2" async "^1.5.2"
debug "^2.2.0" debug "^2.2.0"
@ -6372,14 +6376,14 @@ postcss-load-config@^2.0.0:
cosmiconfig "^4.0.0" cosmiconfig "^4.0.0"
import-cwd "^2.0.0" import-cwd "^2.0.0"
postcss-loader@^2.0.8: postcss-loader@^3.0.0:
version "2.1.6" version "3.0.0"
resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-2.1.6.tgz#1d7dd7b17c6ba234b9bed5af13e0bea40a42d740" resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-3.0.0.tgz#6b97943e47c72d845fa9e03f273773d4e8dd6c2d"
dependencies: dependencies:
loader-utils "^1.1.0" loader-utils "^1.1.0"
postcss "^6.0.0" postcss "^7.0.0"
postcss-load-config "^2.0.0" postcss-load-config "^2.0.0"
schema-utils "^0.4.0" schema-utils "^1.0.0"
postcss-merge-longhand@^4.0.0: postcss-merge-longhand@^4.0.0:
version "4.0.4" version "4.0.4"
@ -6593,14 +6597,14 @@ postcss-unique-selectors@^4.0.0:
postcss "^6.0.0" postcss "^6.0.0"
uniqs "^2.0.0" uniqs "^2.0.0"
postcss-url@^7.2.1: postcss-url@^8.0.0:
version "7.3.2" version "8.0.0"
resolved "https://registry.yarnpkg.com/postcss-url/-/postcss-url-7.3.2.tgz#5fea273807fb84b38c461c3c9a9e8abd235f7120" resolved "https://registry.yarnpkg.com/postcss-url/-/postcss-url-8.0.0.tgz#7b10059bd12929cdbb1971c60f61a0e5af86b4ca"
dependencies: dependencies:
mime "^1.4.1" mime "^2.3.1"
minimatch "^3.0.4" minimatch "^3.0.4"
mkdirp "^0.5.0" mkdirp "^0.5.0"
postcss "^6.0.1" postcss "^7.0.2"
xxhashjs "^0.2.1" xxhashjs "^0.2.1"
postcss-value-parser@^3.0.0, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0: postcss-value-parser@^3.0.0, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0:
@ -6623,7 +6627,7 @@ postcss@^6.0.1:
source-map "^0.6.1" source-map "^0.6.1"
supports-color "^5.4.0" supports-color "^5.4.0"
postcss@^7.0.1, postcss@^7.0.2: postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.2:
version "7.0.2" version "7.0.2"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.2.tgz#7b5a109de356804e27f95a960bef0e4d5bc9bb18" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.2.tgz#7b5a109de356804e27f95a960bef0e4d5bc9bb18"
dependencies: dependencies:
@ -7202,13 +7206,21 @@ sax@>=0.6.0, sax@^1.2.4, sax@~1.2.4:
version "1.2.4" version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
schema-utils@^0.4.0, schema-utils@^0.4.3, schema-utils@^0.4.4, schema-utils@^0.4.5: schema-utils@^0.4.3, schema-utils@^0.4.4, schema-utils@^0.4.5:
version "0.4.5" version "0.4.5"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.5.tgz#21836f0608aac17b78f9e3e24daff14a5ca13a3e" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.5.tgz#21836f0608aac17b78f9e3e24daff14a5ca13a3e"
dependencies: dependencies:
ajv "^6.1.0" ajv "^6.1.0"
ajv-keywords "^3.1.0" ajv-keywords "^3.1.0"
schema-utils@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
dependencies:
ajv "^6.1.0"
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"
seek-bzip@^1.0.3, seek-bzip@^1.0.5: seek-bzip@^1.0.3, seek-bzip@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc"
@ -8372,9 +8384,9 @@ vue-i18n@^8.0.0:
version "8.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-8.0.0.tgz#ae0c6e05ec8e36151bcf5f47c7b538c8af6d0282" resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-8.0.0.tgz#ae0c6e05ec8e36151bcf5f47c7b538c8af6d0282"
vue-loader@^15.2.6: vue-loader@^15.3.0:
version "15.2.6" version "15.3.0"
resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.2.6.tgz#4ad4e56a0ca1fd89ebc4220f9e3bd4723097b397" resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.3.0.tgz#b474d10a4e93d934a78c147fc3e314b370e9fc54"
dependencies: dependencies:
"@vue/component-compiler-utils" "^2.0.0" "@vue/component-compiler-utils" "^2.0.0"
hash-sum "^1.0.2" hash-sum "^1.0.2"
@ -8428,9 +8440,9 @@ vue@^2.5.2:
version "2.5.17" version "2.5.17"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.17.tgz#0f8789ad718be68ca1872629832ed533589c6ada" resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.17.tgz#0f8789ad718be68ca1872629832ed533589c6ada"
vuetify@^1.1.0: vuetify@^1.1.10:
version "1.1.9" version "1.1.10"
resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-1.1.9.tgz#3eb497cc89d318ee6865bbebd081f5830f83f8ba" resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-1.1.10.tgz#4a5c890f242e1cf84e318ccdf265a58928de76bb"
vuex@^3.0.1: vuex@^3.0.1:
version "3.0.1" version "3.0.1"