diff --git a/package-lock.json b/package-lock.json index 66feb02..0d94f9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,6 @@ "@capacitor/status-bar": "4.0.1", "@ionic/react": "^6.0.0", "@ionic/react-router": "^6.0.0", - "@reduxjs/toolkit": "^1.8.5", "@testing-library/jest-dom": "^5.11.9", "@testing-library/react": "^11.2.5", "@testing-library/user-event": "^12.6.3", @@ -31,11 +30,11 @@ "@types/react-router": "^5.1.11", "@types/react-router-dom": "^5.1.7", "cordova-plugin-geolocation": "^4.1.0", + "gpx-parser-builder": "^1.0.2", "ionicons": "^6.0.3", - "pigeon-maps": "^0.21.0", + "lodash": "^4.17.21", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-redux": "^8.0.2", "react-router": "^6.3.0", "react-router-dom": "^6.3.0", "react-scripts": "^5.0.0", @@ -55,7 +54,8 @@ "workbox-streams": "^5.1.4" }, "devDependencies": { - "@capacitor/cli": "4.1.0" + "@capacitor/cli": "4.1.0", + "@types/lodash": "^4.14.184" } }, "node_modules/@adobe/css-tools": { @@ -3157,29 +3157,6 @@ "prettier": ">=2.3" } }, - "node_modules/@reduxjs/toolkit": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.8.5.tgz", - "integrity": "sha512-f4D5EXO7A7Xq35T0zRbWq5kJQyXzzscnHKmjnu2+37B3rwHU6mX9PYlbfXdnxcY6P/7zfmjhgan0Z+yuOfeBmA==", - "dependencies": { - "immer": "^9.0.7", - "redux": "^4.1.2", - "redux-thunk": "^2.4.1", - "reselect": "^4.1.5" - }, - "peerDependencies": { - "react": "^16.9.0 || ^17.0.0 || ^18", - "react-redux": "^7.2.1 || ^8.0.2" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-redux": { - "optional": true - } - } - }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -4040,15 +4017,6 @@ "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" }, - "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", - "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", - "dependencies": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "node_modules/@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -4139,6 +4107,12 @@ "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, + "node_modules/@types/lodash": { + "version": "4.14.184", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.184.tgz", + "integrity": "sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q==", + "dev": true + }, "node_modules/@types/mime": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", @@ -4292,11 +4266,6 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==" }, - "node_modules/@types/use-sync-external-store": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", - "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==" - }, "node_modules/@types/ws": { "version": "8.5.3", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", @@ -4305,6 +4274,14 @@ "@types/node": "*" } }, + "node_modules/@types/xml2js": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.11.tgz", + "integrity": "sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yargs": { "version": "16.0.4", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", @@ -9089,6 +9066,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gpx-parser-builder": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/gpx-parser-builder/-/gpx-parser-builder-1.0.2.tgz", + "integrity": "sha512-zCTGKANSytYLIicVYUUFTYhz3mbDEtIemWZvC3Vb0j8DhwPMbDSCIl9blMClxSLrr7gGbwLAk1nhj3Z41oC5sw==", + "dependencies": { + "isomorphic-xml2js": "~0.1" + } + }, "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", @@ -9249,19 +9234,6 @@ "@babel/runtime": "^7.7.6" } }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -10008,6 +9980,15 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, + "node_modules/isomorphic-xml2js": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/isomorphic-xml2js/-/isomorphic-xml2js-0.1.3.tgz", + "integrity": "sha512-dIkT2U9ritKVWF/HfHfGwm5tTnlMnknYsv7l12oJlQQgOV2CNV65pX+FHy6HFL9YP8q0JcrlNQAFRJIN2agUmQ==", + "dependencies": { + "@types/xml2js": "^0.4.2", + "xml2js": "^0.4.19" + } + }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -12599,14 +12580,6 @@ "node": ">=0.10.0" } }, - "node_modules/pigeon-maps": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/pigeon-maps/-/pigeon-maps-0.21.0.tgz", - "integrity": "sha512-p3GaGday5nmufHVGZW/36LnSXfYVh6qfzYisqcC87nqFr0eXIKkqQcDuPP9g4F1OXL1JeJe4x6JEnAE9HB+zWQ==", - "peerDependencies": { - "react": "*" - } - }, "node_modules/pirates": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", @@ -14275,49 +14248,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, - "node_modules/react-redux": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.2.tgz", - "integrity": "sha512-nBwiscMw3NoP59NFCXFf02f8xdo+vSHT/uZ1ldDwF7XaTpzm+Phk97VT4urYBl5TYAPNVaFm12UHAEyzkpNzRA==", - "dependencies": { - "@babel/runtime": "^7.12.1", - "@types/hoist-non-react-statics": "^3.3.1", - "@types/use-sync-external-store": "^0.0.3", - "hoist-non-react-statics": "^3.3.2", - "react-is": "^18.0.0", - "use-sync-external-store": "^1.0.0" - }, - "peerDependencies": { - "@types/react": "^16.8 || ^17.0 || ^18.0", - "@types/react-dom": "^16.8 || ^17.0 || ^18.0", - "react": "^16.8 || ^17.0 || ^18.0", - "react-dom": "^16.8 || ^17.0 || ^18.0", - "react-native": ">=0.59", - "redux": "^4" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - }, - "redux": { - "optional": true - } - } - }, - "node_modules/react-redux/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" - }, "node_modules/react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -14630,22 +14560,6 @@ "node": ">=8" } }, - "node_modules/redux": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.0.tgz", - "integrity": "sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA==", - "dependencies": { - "@babel/runtime": "^7.9.2" - } - }, - "node_modules/redux-thunk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.1.tgz", - "integrity": "sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q==", - "peerDependencies": { - "redux": "^4" - } - }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -15037,11 +14951,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "node_modules/reselect": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.6.tgz", - "integrity": "sha512-ZovIuXqto7elwnxyXbBtCPo9YFEr3uJqj2rRbcOOog1bmu2Ag85M4hixSwFWyaBMKXNgvPaJ9OSu9SkBPIeJHQ==" - }, "node_modules/resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -15307,8 +15216,7 @@ "node_modules/sax": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz", - "integrity": "sha512-5f3k2PbGGp+YtKJjOItpg3P99IMD84E4HOvcfleTb5joCHNXYLsR9yWFPOYGgaeMPDubQILTCMdsFb2OMeOjtg==", - "dev": true + "integrity": "sha512-5f3k2PbGGp+YtKJjOItpg3P99IMD84E4HOvcfleTb5joCHNXYLsR9yWFPOYGgaeMPDubQILTCMdsFb2OMeOjtg==" }, "node_modules/saxes": { "version": "5.0.1", @@ -16904,14 +16812,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -17993,7 +17893,6 @@ "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", - "dev": true, "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -18006,7 +17905,6 @@ "version": "11.0.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", - "dev": true, "engines": { "node": ">=4.0" } @@ -20223,17 +20121,6 @@ "prettier": ">=2.3" } }, - "@reduxjs/toolkit": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.8.5.tgz", - "integrity": "sha512-f4D5EXO7A7Xq35T0zRbWq5kJQyXzzscnHKmjnu2+37B3rwHU6mX9PYlbfXdnxcY6P/7zfmjhgan0Z+yuOfeBmA==", - "requires": { - "immer": "^9.0.7", - "redux": "^4.1.2", - "redux-thunk": "^2.4.1", - "reselect": "^4.1.5" - } - }, "@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -20883,15 +20770,6 @@ "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" }, - "@types/hoist-non-react-statics": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", - "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", - "requires": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -20978,6 +20856,12 @@ "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, + "@types/lodash": { + "version": "4.14.184", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.184.tgz", + "integrity": "sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q==", + "dev": true + }, "@types/mime": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", @@ -21131,11 +21015,6 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==" }, - "@types/use-sync-external-store": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", - "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==" - }, "@types/ws": { "version": "8.5.3", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", @@ -21144,6 +21023,14 @@ "@types/node": "*" } }, + "@types/xml2js": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.11.tgz", + "integrity": "sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==", + "requires": { + "@types/node": "*" + } + }, "@types/yargs": { "version": "16.0.4", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", @@ -24628,6 +24515,14 @@ "slash": "^3.0.0" } }, + "gpx-parser-builder": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/gpx-parser-builder/-/gpx-parser-builder-1.0.2.tgz", + "integrity": "sha512-zCTGKANSytYLIicVYUUFTYhz3mbDEtIemWZvC3Vb0j8DhwPMbDSCIl9blMClxSLrr7gGbwLAk1nhj3Z41oC5sw==", + "requires": { + "isomorphic-xml2js": "~0.1" + } + }, "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", @@ -24740,21 +24635,6 @@ "@babel/runtime": "^7.7.6" } }, - "hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "requires": { - "react-is": "^16.7.0" - }, - "dependencies": { - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - } - } - }, "hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -25273,6 +25153,15 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, + "isomorphic-xml2js": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/isomorphic-xml2js/-/isomorphic-xml2js-0.1.3.tgz", + "integrity": "sha512-dIkT2U9ritKVWF/HfHfGwm5tTnlMnknYsv7l12oJlQQgOV2CNV65pX+FHy6HFL9YP8q0JcrlNQAFRJIN2agUmQ==", + "requires": { + "@types/xml2js": "^0.4.2", + "xml2js": "^0.4.19" + } + }, "istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -27212,12 +27101,6 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" }, - "pigeon-maps": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/pigeon-maps/-/pigeon-maps-0.21.0.tgz", - "integrity": "sha512-p3GaGday5nmufHVGZW/36LnSXfYVh6qfzYisqcC87nqFr0eXIKkqQcDuPP9g4F1OXL1JeJe4x6JEnAE9HB+zWQ==", - "requires": {} - }, "pirates": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", @@ -28247,26 +28130,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, - "react-redux": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.2.tgz", - "integrity": "sha512-nBwiscMw3NoP59NFCXFf02f8xdo+vSHT/uZ1ldDwF7XaTpzm+Phk97VT4urYBl5TYAPNVaFm12UHAEyzkpNzRA==", - "requires": { - "@babel/runtime": "^7.12.1", - "@types/hoist-non-react-statics": "^3.3.1", - "@types/use-sync-external-store": "^0.0.3", - "hoist-non-react-statics": "^3.3.2", - "react-is": "^18.0.0", - "use-sync-external-store": "^1.0.0" - }, - "dependencies": { - "react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" - } - } - }, "react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -28509,20 +28372,6 @@ "strip-indent": "^3.0.0" } }, - "redux": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.0.tgz", - "integrity": "sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA==", - "requires": { - "@babel/runtime": "^7.9.2" - } - }, - "redux-thunk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.1.tgz", - "integrity": "sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q==", - "requires": {} - }, "regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -28826,11 +28675,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "reselect": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.6.tgz", - "integrity": "sha512-ZovIuXqto7elwnxyXbBtCPo9YFEr3uJqj2rRbcOOog1bmu2Ag85M4hixSwFWyaBMKXNgvPaJ9OSu9SkBPIeJHQ==" - }, "resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -28993,8 +28837,7 @@ "sax": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz", - "integrity": "sha512-5f3k2PbGGp+YtKJjOItpg3P99IMD84E4HOvcfleTb5joCHNXYLsR9yWFPOYGgaeMPDubQILTCMdsFb2OMeOjtg==", - "dev": true + "integrity": "sha512-5f3k2PbGGp+YtKJjOItpg3P99IMD84E4HOvcfleTb5joCHNXYLsR9yWFPOYGgaeMPDubQILTCMdsFb2OMeOjtg==" }, "saxes": { "version": "5.0.1", @@ -30195,12 +30038,6 @@ "requires-port": "^1.0.0" } }, - "use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", - "requires": {} - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -31096,7 +30933,6 @@ "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", - "dev": true, "requires": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -31105,8 +30941,7 @@ "xmlbuilder": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", - "dev": true + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" } } }, diff --git a/package.json b/package.json index d145140..9559e8e 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "@capacitor/status-bar": "4.0.1", "@ionic/react": "^6.0.0", "@ionic/react-router": "^6.0.0", - "@reduxjs/toolkit": "^1.8.5", "@testing-library/jest-dom": "^5.11.9", "@testing-library/react": "^11.2.5", "@testing-library/user-event": "^12.6.3", @@ -26,11 +25,11 @@ "@types/react-router": "^5.1.11", "@types/react-router-dom": "^5.1.7", "cordova-plugin-geolocation": "^4.1.0", + "gpx-parser-builder": "^1.0.2", "ionicons": "^6.0.3", - "pigeon-maps": "^0.21.0", + "lodash": "^4.17.21", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-redux": "^8.0.2", "react-router": "^6.3.0", "react-router-dom": "^6.3.0", "react-scripts": "^5.0.0", @@ -74,7 +73,8 @@ ] }, "devDependencies": { - "@capacitor/cli": "4.1.0" + "@capacitor/cli": "4.1.0", + "@types/lodash": "^4.14.184" }, "description": "An Ionic project" } diff --git a/public/assets/tracks/week-end_daily_2022-08-26.gpx b/public/assets/tracks/week-end_daily_2022-08-26.gpx new file mode 100644 index 0000000..812b520 --- /dev/null +++ b/public/assets/tracks/week-end_daily_2022-08-26.gpx @@ -0,0 +1,3598 @@ + + + + + week-end + 4 devices + + + Gisèle et Éric (vélo) + + + + 58.90 + 10 + + 0.000 + 12.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 38.91 + 12 + + 0.000 + 6.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 73.73 + 5 + + 12.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 78.41 + 5 + + 24.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 67.92 + 4 + + 1.50 + 95.00 + PhoneTrack/0.1.0 + + + + + 64.46 + 5 + + 4.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 62.69 + 8 + + 0.000 + 3.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 64.41 + 6 + + 0.000 + 4.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 57.83 + 6 + + 6.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 63.74 + 6 + + 8.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 62.88 + 5 + + 0.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 57.60 + 4 + + 0.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 54.72 + 5 + + 1.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 69.14 + 5 + + 4.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 66.69 + 6 + + 6.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 70.48 + 6 + + 0.000 + 4.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 74.62 + 7 + + 0.000 + 4.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 59.88 + 6 + + 12.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 64.28 + 7 + + 8.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 61.01 + 10 + + 4.132 + 148.790 + 6.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 59.42 + 27 + + 4.157 + 135.710 + 4.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 49.23 + 9 + + 3.855 + 121.580 + 16.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 62.10 + 10 + + 3.791 + 133.320 + 8.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 59.29 + 10 + + 4.596 + 126.040 + 12.00 + 95.00 + PhoneTrack/0.1.0 + + + + + 62.08 + 11 + + 4.156 + 136.620 + 16.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 64.16 + 11 + + 4.345 + 128.070 + 16.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 56.59 + 12 + + 2.373 + 146.700 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 64.64 + 11 + + 3.970 + 140.540 + 12.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 53.05 + 12 + + 3.618 + 164.260 + 4.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 60.98 + 10 + + 3.394 + 166.770 + 12.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 55.22 + 10 + + 3.627 + 161.240 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 61.68 + 11 + + 4.799 + 167.480 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 58.44 + 12 + + 4.015 + 179.470 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 60.99 + 11 + + 2.642 + 89.270 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 63.04 + 10 + + 4.606 + 126.130 + 16.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 56.88 + 12 + + 5.271 + 105.970 + 6.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 53.48 + 12 + + 4.978 + 156.380 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 52.17 + 12 + + 4.897 + 175.320 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 61.91 + 12 + + 4.556 + 174.140 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 55.38 + 11 + + 4.681 + 150.350 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 58.55 + 11 + + 5.063 + 143.430 + 16.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 54.47 + 9 + + 5.308 + 146.850 + 16.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 59.93 + 12 + + 5.073 + 134.010 + 12.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 55.14 + 12 + + 4.387 + 75.850 + 12.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 57.17 + 10 + + 4.913 + 83.830 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 54.21 + 10 + + 6.026 + 82.340 + 4.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 61.55 + 12 + + 6.702 + 84.300 + 6.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 50.94 + 12 + + 6.199 + 160.010 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 50.40 + 11 + + 5.676 + 162.640 + 6.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 58.76 + 12 + + 3.655 + 159.770 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 54.72 + 10 + + 2.901 + 151.950 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 53.45 + 10 + + 5.016 + 78.600 + 6.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 47.12 + 9 + + 5.520 + 116.510 + 12.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 48.20 + 12 + + 4.912 + 134.020 + 12.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 56.16 + 10 + + 5.417 + 133.520 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 48.25 + 9 + + 0.000 + 12.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 52.99 + 11 + + 2.193 + 154.800 + 8.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 51.17 + 10 + + 3.735 + 190.750 + 24.00 + 94.00 + PhoneTrack/0.1.0 + + + + + 51.96 + 12 + + 5.735 + 145.370 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 53.50 + 10 + + 5.837 + 164.720 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 58.35 + 10 + + 5.678 + 146.810 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 58.21 + 10 + + 2.645 + 157.770 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 52.01 + 11 + + 0.000 + 12.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 66.54 + 10 + + 0.000 + 12.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 61.73 + 12 + + 5.885 + 322.670 + 4.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 53.85 + 10 + + 4.950 + 243.080 + 12.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 54.79 + 10 + + 5.625 + 249.400 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 59.51 + 10 + + 5.438 + 248.930 + 6.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 52.08 + 10 + + 5.366 + 248.220 + 6.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 52.99 + 12 + + 5.705 + 251.150 + 16.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 47.33 + 10 + + 5.077 + 250.540 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 54.41 + 12 + + 4.531 + 245.400 + 12.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 51.06 + 11 + + 5.415 + 253.980 + 12.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 47.28 + 10 + + 5.406 + 253.740 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 42.71 + 12 + + 5.476 + 252.290 + 6.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 49.36 + 12 + + 4.939 + 258.240 + 6.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 52.75 + 10 + + 3.383 + 251.990 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 49.69 + 10 + + 5.273 + 249.410 + 6.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 54.87 + 10 + + 5.861 + 248.560 + 24.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 48.61 + 11 + + 6.020 + 246.970 + 4.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 49.61 + 10 + + 5.884 + 250.610 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 48.24 + 11 + + 6.067 + 250.210 + 6.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 54.75 + 10 + + 5.953 + 249.180 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 53.75 + 11 + + 5.688 + 250.160 + 16.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 51.27 + 11 + + 6.533 + 250.050 + 12.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 52.26 + 10 + + 6.321 + 249.590 + 16.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 46.61 + 12 + + 5.787 + 247.790 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 53.44 + 12 + + 6.109 + 252.000 + 4.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 50.82 + 10 + + 5.948 + 249.230 + 8.00 + 93.00 + PhoneTrack/0.1.0 + + + + + 52.78 + 10 + + 5.779 + 251.420 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 58.88 + 11 + + 0.000 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 56.83 + 12 + + 0.000 + 6.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 51.62 + 11 + + 0.000 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 50.77 + 10 + + 5.607 + 256.960 + 12.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 51.45 + 9 + + 5.595 + 254.140 + 16.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 53.03 + 12 + + 5.471 + 249.830 + 12.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 47.93 + 12 + + 5.559 + 251.550 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 52.26 + 10 + + 5.576 + 252.540 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 51.02 + 11 + + 5.192 + 252.400 + 16.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 49.13 + 12 + + 5.443 + 251.670 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 50.59 + 10 + + 5.195 + 251.250 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 52.44 + 11 + + 4.871 + 253.500 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 51.21 + 10 + + 4.978 + 253.930 + 12.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 49.28 + 9 + + 5.030 + 250.080 + 12.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 58.45 + 12 + + 5.300 + 252.660 + 6.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 56.85 + 11 + + 5.113 + 254.940 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 52.97 + 11 + + 5.366 + 253.720 + 12.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 53.74 + 10 + + 4.693 + 242.760 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 47.82 + 12 + + 2.537 + 199.790 + 12.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 50.22 + 12 + + 4.502 + 126.440 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 55.45 + 10 + + 7.005 + 127.940 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 53.10 + 10 + + 7.236 + 126.120 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 53.40 + 10 + + 7.228 + 126.060 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 55.45 + 11 + + 5.283 + 137.950 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 56.45 + 10 + + 5.988 + 126.480 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 55.04 + 10 + + 5.977 + 126.970 + 12.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 53.08 + 12 + + 4.715 + 104.910 + 6.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 59.08 + 10 + + 4.660 + 74.720 + 8.00 + 92.00 + PhoneTrack/0.1.0 + + + + + 56.89 + 23 + + 3.549 + 94.260 + 4.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 53.85 + 10 + + 0.000 + 24.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 52.53 + 10 + + 1.817 + 167.020 + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 55.43 + 10 + + 0.000 + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 70.27 + 11 + + 1.204 + 117.830 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 58.00 + 10 + + 0.000 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 50.92 + 8 + + 1.421 + 315.080 + 16.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 61.15 + 10 + + 1.623 + 305.230 + 8.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 65.62 + 12 + + 0.000 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 58.07 + 11 + + 0.000 + 8.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 52.79 + 10 + + 0.000 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 44.95 + 11 + + 0.000 + 24.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 54.24 + 10 + + 0.000 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 68.09 + 10 + + 0.000 + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 61.17 + 27 + + 0.000 + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 70.14 + 12 + + 0.000 + 16.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 46.33 + 12 + + 0.000 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 58.97 + 12 + + 0.000 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 61.13 + 11 + + 0.000 + 8.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 47.65 + 10 + + 0.000 + 16.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 58.41 + 6 + + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 59.43 + 6 + + 3.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 55.21 + 6 + + 16.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 56.43 + 4 + + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 63.35 + 5 + + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 55.45 + 18 + + 3.411 + 125.040 + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 59.16 + 6 + + 24.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 56.45 + 6 + + 24.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 52.05 + 6 + + 24.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 65.00 + 6 + + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 62.18 + 6 + + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 69.51 + 5 + + 8.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 59.27 + 6 + + 16.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 66.06 + 10 + + 0.000 + 6.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 59.85 + 10 + + 0.000 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 66.97 + 11 + + 0.000 + 12.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 69.17 + 12 + + 0.000 + 8.00 + 91.00 + PhoneTrack/0.1.0 + + + + + 60.83 + 10 + + 0.000 + 12.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 57.68 + 7 + + 6.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 56.65 + 6 + + 3.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 67.41 + 6 + + 12.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 57.77 + 6 + + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 63.86 + 11 + + 1.239 + 250.170 + 12.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 52.92 + 12 + + 0.000 + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 58.07 + 10 + + 0.000 + 12.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 57.05 + 7 + + 4.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 63.57 + 12 + + 0.000 + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 60.52 + 7 + + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 63.14 + 7 + + 12.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 59.46 + 12 + + 0.000 + 16.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 52.61 + 12 + + 0.000 + 6.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 58.07 + 10 + + 0.000 + 6.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 69.69 + 12 + + 0.000 + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 54.72 + 9 + + 0.000 + 24.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 60.46 + 7 + + 16.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 66.27 + 10 + + 2.902 + 81.700 + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 61.89 + 10 + + 3.573 + 67.200 + 6.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 77.59 + 7 + + 24.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 80.09 + 6 + + 24.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 61.20 + 7 + + 6.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 62.18 + 7 + + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 58.53 + 7 + + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 49.59 + 7 + + 24.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 44.47 + 7 + + 12.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 64.54 + 7 + + 6.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 61.32 + 6 + + 16.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 66.58 + 5 + + 24.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 60.97 + 11 + + 4.408 + 310.760 + 12.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 57.95 + 10 + + 4.058 + 301.480 + 16.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 57.64 + 9 + + 4.074 + 32.780 + 8.00 + 90.00 + PhoneTrack/0.1.0 + + + + + 54.23 + 11 + + 3.577 + 56.810 + 16.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 53.81 + 9 + + 4.478 + 271.680 + 24.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 59.21 + 11 + + 2.646 + 238.770 + 12.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 53.92 + 11 + + 4.249 + 300.990 + 12.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 52.75 + 9 + + 4.661 + 313.070 + 12.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 76.58 + 12 + + 4.704 + 305.170 + 8.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 47.88 + 12 + + 4.179 + 303.220 + 6.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 51.20 + 10 + + 4.524 + 306.240 + 16.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 57.21 + 12 + + 4.558 + 304.760 + 8.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 53.19 + 10 + + 4.481 + 308.410 + 6.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 52.09 + 11 + + 5.107 + 305.920 + 4.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 60.22 + 9 + + 4.850 + 311.410 + 8.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 53.45 + 10 + + 4.632 + 304.700 + 4.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 60.29 + 9 + + 0.000 + 12.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 66.98 + 12 + + 0.000 + 6.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 58.88 + 9 + + 0.000 + 12.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 66.44 + 12 + + 0.000 + 6.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 50.00 + 12 + + 0.000 + 6.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 53.78 + 11 + + 0.000 + 6.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 57.74 + 10 + + 0.000 + 6.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 58.87 + 11 + + 0.000 + 4.00 + 89.00 + PhoneTrack/0.1.0 + + + + + 54.59 + 10 + + 0.000 + 12.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 55.39 + 10 + + 0.000 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 65.89 + 12 + + 0.000 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 75.27 + 12 + + 0.000 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 56.28 + 9 + + 0.000 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 57.80 + 10 + + 0.000 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 59.47 + 10 + + 0.000 + 12.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 58.98 + 10 + + 0.000 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 56.61 + 12 + + 0.000 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 54.86 + 9 + + 0.000 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 66.15 + 12 + + 1.429 + 283.650 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 59.22 + 9 + + 6.460 + 305.930 + 12.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 50.75 + 9 + + 6.414 + 289.410 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 50.76 + 10 + + 5.926 + 281.740 + 4.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 48.79 + 11 + + 4.552 + 280.230 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 54.63 + 11 + + 6.003 + 269.390 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 51.36 + 10 + + 6.284 + 268.620 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 51.19 + 12 + + 6.085 + 269.180 + 16.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 50.68 + 11 + + 6.138 + 279.760 + 4.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 50.13 + 10 + + 6.367 + 301.960 + 12.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 52.43 + 12 + + 6.372 + 316.650 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 51.59 + 10 + + 6.729 + 322.700 + 12.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 54.42 + 10 + + 6.245 + 336.440 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 46.70 + 10 + + 5.966 + 317.170 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 48.04 + 11 + + 5.986 + 317.950 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 50.73 + 12 + + 6.237 + 317.970 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 51.39 + 11 + + 5.704 + 320.140 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 58.20 + 10 + + 6.113 + 327.720 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 49.80 + 11 + + 6.363 + 349.050 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 55.71 + 11 + + 6.510 + 355.910 + 4.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 56.30 + 11 + + 6.440 + 355.310 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 48.61 + 12 + + 6.672 + 356.840 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 52.62 + 10 + + 6.587 + 1.050 + 6.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 52.13 + 11 + + 6.686 + 6.370 + 8.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 49.17 + 12 + + 6.555 + 11.440 + 4.00 + 88.00 + PhoneTrack/0.1.0 + + + + + 49.71 + 10 + + 6.394 + 75.130 + 8.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 56.80 + 10 + + 6.297 + 74.750 + 4.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 54.14 + 10 + + 2.443 + 63.410 + 4.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 55.24 + 10 + + 3.322 + 142.480 + 4.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 53.69 + 9 + + 2.082 + 67.960 + 12.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 44.41 + 12 + + 4.077 + 29.130 + 6.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 50.60 + 12 + + 2.736 + 342.660 + 4.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 46.20 + 12 + + 3.997 + 345.810 + 8.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 52.13 + 11 + + 4.308 + 358.490 + 8.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 51.63 + 10 + + 2.590 + 80.370 + 4.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 50.71 + 10 + + 3.959 + 44.620 + 6.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 49.48 + 10 + + 3.377 + 13.570 + 6.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 55.07 + 9 + + 4.434 + 311.000 + 24.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 56.80 + 10 + + 3.451 + 358.500 + 6.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 56.07 + 9 + + 4.347 + 46.920 + 12.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 56.15 + 10 + + 0.000 + 12.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 48.41 + 7 + + 12.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 50.98 + 7 + + 8.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 50.12 + 6 + + 24.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 49.61 + 7 + + 12.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 58.09 + 6 + + 16.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 56.47 + 7 + + 12.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 55.08 + 10 + + 3.402 + 59.750 + 8.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 54.95 + 11 + + 4.228 + 63.400 + 8.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 56.36 + 12 + + 4.312 + 68.930 + 6.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 49.66 + 12 + + 2.666 + 114.530 + 6.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 58.76 + 11 + + 3.973 + 63.410 + 6.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 55.40 + 12 + + 4.878 + 68.040 + 16.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 61.20 + 10 + + 3.052 + 19.670 + 12.00 + 87.00 + PhoneTrack/0.1.0 + + + + + 54.96 + 11 + + 5.342 + 343.550 + 4.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 63.45 + 12 + + 4.871 + 347.900 + 4.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 56.03 + 10 + + 3.983 + 339.790 + 12.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 56.77 + 10 + + 3.765 + 98.980 + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 53.63 + 11 + + 3.076 + 141.230 + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 53.88 + 7 + + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 54.01 + 8 + + 24.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 56.17 + 8 + + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 57.82 + 8 + + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 53.49 + 8 + + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 52.72 + 8 + + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 53.10 + 7 + + 8.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 70.46 + 6 + + 24.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 66.56 + 10 + + 0.000 + 16.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 71.34 + 10 + + 2.371 + 44.060 + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 69.05 + 9 + + 3.847 + 51.090 + 16.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 66.52 + 9 + + 4.732 + 53.760 + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 62.62 + 12 + + 6.747 + 21.290 + 8.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 63.01 + 9 + + 6.028 + 62.390 + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 60.97 + 11 + + 6.778 + 81.480 + 4.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 57.27 + 11 + + 6.537 + 67.640 + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 63.15 + 10 + + 7.914 + 67.650 + 4.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 63.60 + 12 + + 6.368 + 87.440 + 8.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 61.01 + 9 + + 4.124 + 52.500 + 24.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 65.22 + 10 + + 4.523 + 59.460 + 4.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 66.91 + 9 + + 5.003 + 41.700 + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 64.93 + 11 + + 5.103 + 61.120 + 4.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 59.82 + 12 + + 3.962 + 56.840 + 4.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 62.50 + 12 + + 3.696 + 53.970 + 12.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 60.86 + 9 + + 4.948 + 59.610 + 16.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 55.46 + 12 + + 6.955 + 106.020 + 6.00 + 86.00 + PhoneTrack/0.1.0 + + + + + 60.83 + 9 + + 8.418 + 83.900 + 8.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 59.70 + 12 + + 3.901 + 330.180 + 12.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 81.22 + 12 + + 0.000 + 6.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 63.54 + 10 + + 0.000 + 24.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 61.32 + 8 + + 8.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 63.49 + 12 + + 0.000 + 24.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 63.91 + 10 + + 0.000 + 12.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 69.39 + 12 + + 0.000 + 8.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 75.16 + 17 + + 0.000 + 16.00 + 85.00 + PhoneTrack/0.1.0 + + + + + 63.46 + 10 + + 0.000 + 6.00 + 85.00 + PhoneTrack/0.1.0 + + + + + \ No newline at end of file diff --git a/public/index.html b/public/index.html index e5d555a..4ecb692 100644 --- a/public/index.html +++ b/public/index.html @@ -16,23 +16,19 @@ - + - - - -
- diff --git a/src/App.tsx b/src/App.tsx index 031b122..91eebdc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,15 +16,12 @@ import '@ionic/react/css/text-transformation.css'; import '@ionic/react/css/flex-utils.css'; import '@ionic/react/css/display.css'; -import { Provider } from 'react-redux'; - /* Theme variables */ import './theme/variables.css'; /* Components */ -import LiveMap from './components/live-map'; -import store from './store/index'; +import Map from './components/map'; import React from 'react'; setupIonicReact(); @@ -32,9 +29,7 @@ setupIonicReact(); const App: React.FC = () => ( - - - + ); diff --git a/src/components/gpx-figure.tsx b/src/components/gpx-figure.tsx new file mode 100644 index 0000000..ba12aaa --- /dev/null +++ b/src/components/gpx-figure.tsx @@ -0,0 +1,55 @@ +import React from 'react'; + +import { PigeonProps, Point } from 'pigeon-maps'; +import GPX from 'gpx-parser-builder'; +import { round } from 'lodash'; + +const GPXFigure: React.FC = (props: PigeonProps) => { + const gpx = GPX.parse(localStorage.getItem('gpx')); + + const dirtyLatLngToPixel = (point: Point) => { + if (props.mapState === undefined) { + return undefined; + } + const latRange = props.mapState.bounds.ne[0] - props.mapState.bounds.sw[0]; + const lonRange = props.mapState.bounds.ne[1] - props.mapState.bounds.sw[1]; + const x = round( + ((point[0] - props.mapState.bounds.sw[0]) * props.mapState.width) / + lonRange + ); + const y = round( + ((point[1] - props.mapState.bounds.sw[1]) * props.mapState.height) / + latRange + ); + return [x, props.mapState.height - y]; + }; + + const trkToPolyline = (gpxData: any) => { + const latLongs: string[] = gpxData.trk[0].trkseg[0].trkpt.map( + (trkpt: any) => { + if (props.latLngToPixel === undefined) { + return ''; + } + const point: Point = [trkpt.$.lat, trkpt.$.lon]; + const pixelPoint = dirtyLatLngToPixel(point); + if (pixelPoint === undefined) { + return ''; + } + return pixelPoint.join(' '); + } + ); + console.log('latLongs: ' + latLongs); + return latLongs.join(' '); + }; + + return ( + + ); +}; + +export default GPXFigure; diff --git a/src/components/gpx-overlay.tsx b/src/components/gpx-overlay.tsx index b638297..0c8bfb0 100644 --- a/src/components/gpx-overlay.tsx +++ b/src/components/gpx-overlay.tsx @@ -1,52 +1,23 @@ -import { Overlay, MapState, Point } from 'pigeon-maps'; import React from 'react'; -import { useSelector } from 'react-redux'; -const GPXOverlay: React.FC<{ - mapState: any; - latLngToPixel: any; -}> = (props: { - mapState: MapState; - latLngToPixel: - | (( - latLng: Point, - center?: Point | undefined, - zoom?: number | undefined - ) => Point) - | undefined; -}) => { - const track = useSelector((state: { gpx: { current: any; }; }) => state.gpx.current.trk[0]); - const trkToPolyline = (trk: any) => { - const latLongs: string[] = trk.trkseg[0].trkpt.map((trkpt: any) => { - if (props.latLngToPixel === undefined) { - return ''; - } - const point: Point = [trkpt['$'].lat, trkpt['$'].lon]; - const pixelPoint = props.latLngToPixel(point); - if (pixelPoint === undefined) { - return ''; - } - return pixelPoint.join(' '); - }); - console.log('latLongs: ' + latLongs); - return latLongs.join(' '); - }; +import { Overlay, PigeonProps } from 'pigeon-maps'; +import GPXFigure from './gpx-figure'; + +const GPXOverlay: React.FC = (props: PigeonProps) => { return ( - - {props.mapState.width > 0 && ( + + {props.mapState && props.mapState.width > 0 && ( - + )} diff --git a/src/components/live-map.tsx b/src/components/live-map.tsx deleted file mode 100644 index 857750d..0000000 --- a/src/components/live-map.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import react, { useState } from 'react'; -import { Map, Marker, ZoomControl } from 'pigeon-maps'; -import { useDispatch } from 'react-redux'; - -import { gpxActions } from '../store/gpx'; -import GPXOverlay from './gpx-overlay'; -import { registerBackgroundGeolocation } from '../lib/geolocation'; - -const LiveMap: react.FC = () => { - const initialCenter: [number, number] = [43.57154, 3.94351]; - const initialZoom: number = 15; - const [initialized, setInitialized] = useState(false); - const [center, setCenter] = useState(initialCenter); - const [position, setPosition] = useState(initialCenter); - const [zoom, setZoom] = useState(initialZoom); - - const dispatch = useDispatch(); - - if (!initialized) { - dispatch( - gpxActions.clearGPX({ - trkKey: 'current', - }) - ); - dispatch( - gpxActions.appendTrkpt({ - trkKey: 'current', - trkpt: { - $: { - lat: 43.57154, - lon: 3.94351, - }, - }, - }) - ); - dispatch( - gpxActions.appendTrkpt({ - trkKey: 'current', - trkpt: { - $: { - lat: 43.56922, - lon: 3.94228, - }, - }, - }) - ); - registerBackgroundGeolocation(dispatch); - setInitialized(true); - } - - return ( - { - setCenter(center); - setZoom(zoom); - }} - animate={true} - > - - - - - ); -}; - -export default LiveMap; diff --git a/src/components/map.tsx b/src/components/map.tsx new file mode 100644 index 0000000..5d73f09 --- /dev/null +++ b/src/components/map.tsx @@ -0,0 +1,83 @@ +import _, { round } from 'lodash'; +import react, { useState, useEffect } from 'react'; + +import GPXOverlay from './gpx-overlay'; +import Tile from './tile'; + +import '../theme/map.css'; + +export const tileSize = 256; + +// cf https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#ECMAScript_(JavaScript/ActionScript,_etc.) + +const lon2tile = (lon: number, zoom: number) => { + const real = ((lon + 180) / 360) * Math.pow(2, zoom); + const floor = Math.floor(real); + return [floor, real - floor]; +}; +const lat2tile = (lat: number, zoom: number) => { + const real = + ((1 - + Math.log( + Math.tan((lat * Math.PI) / 180) + 1 / Math.cos((lat * Math.PI) / 180) + ) / + Math.PI) / + 2) * + Math.pow(2, zoom); + const floor = Math.floor(real); + return [floor, real - floor]; + }; + +const Map: react.FC = () => { + const initialCenter: [number, number] = [43.57029965, 3.94242897]; + const initialZoom: number = 15; + const [center, setCenter] = useState(initialCenter); + const [zoom, setZoom] = useState(initialZoom); + + const [dimensions, setDimensions] = useState({ + height: window.innerHeight, + width: window.innerWidth, + }); + + useEffect(() => { + const handleResize = () => { + setDimensions({ + height: window.innerHeight, + width: window.innerWidth, + }); + }; + window.addEventListener('resize', handleResize); + }); + + const nbTilesY = _.ceil(dimensions.height / tileSize) + 2; + const nbTilesX = _.ceil(dimensions.width / tileSize) + 2; + const [tileCenterY, deltaY] = lat2tile(center[0], zoom); + const [tileCenterX, deltaX] = lon2tile(center[1], zoom); + const firstTileY = tileCenterY - _.ceil(nbTilesY / 2); + const firstTileX = tileCenterX - _.ceil(nbTilesX / 2); + + + + return ( +
+ {_.range(nbTilesY).map((iy) => ( +
+ {_.range(nbTilesX).map((ix) => ( + + ))} +
+ ))} +
+ ); +}; + +export default Map; diff --git a/src/components/tile.tsx b/src/components/tile.tsx new file mode 100644 index 0000000..d0701be --- /dev/null +++ b/src/components/tile.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { tileSize } from './map'; + +const tileProvider = (zoom: number, x: number, y: number) => + 'https://tile.openstreetmap.org/' + zoom + '/' + x + '/' + y + '.png'; + +const Tile: React.FC<{ + ix: number; + iy: number; + x: number; + y: number; + deltaX: number; + deltaY: number; + zoom: number; +}> = (props: { + ix: number; + iy: number; + x: number; + y: number; + deltaX: number; + deltaY: number; + zoom: number; +}) => { + const style = { + width: tileSize + 'px', + height: tileSize + 'px', + transform: + 'translate3d(' + + (props.ix - props.deltaX -1) * tileSize + + 'px, ' + + (props.iy - props.deltaY -1) * tileSize + + 'px, 0px)', + }; + return ; +}; + +export default Tile; diff --git a/src/declarations/gpx-parser-builder.d.ts b/src/declarations/gpx-parser-builder.d.ts new file mode 100644 index 0000000..8e9dbe3 --- /dev/null +++ b/src/declarations/gpx-parser-builder.d.ts @@ -0,0 +1 @@ +declare module 'gpx-parser-builder' \ No newline at end of file diff --git a/src/lib/geolocation.ts b/src/lib/geolocation.ts deleted file mode 100644 index 2b679e0..0000000 --- a/src/lib/geolocation.ts +++ /dev/null @@ -1,104 +0,0 @@ - - -import { BackgroundGeolocationPlugin } from '@capacitor-community/background-geolocation'; -import { registerPlugin } from '@capacitor/core'; -import { gpxActions } from '../store/gpx'; - - -export const registerBackgroundGeolocation = (dispatch: (arg0: any) => void) => { - const BackgroundGeolocation = registerPlugin( - 'BackgroundGeolocation' - ); - console.log('com.dyomedea.dyomedea LOG', ' - Adding the watcher'); - BackgroundGeolocation.addWatcher( - { - // If the "backgroundMessage" option is defined, the watcher will - // provide location updates whether the app is in the background or the - // foreground. If it is not defined, location updates are only - // guaranteed in the foreground. This is true on both platforms. - - // On Android, a notification must be shown to continue receiving - // location updates in the background. This option specifies the text of - // that notification. - backgroundMessage: 'Cancel to prevent battery drain.', - - // The title of the notification mentioned above. Defaults to "Using - // your location". - backgroundTitle: 'Tracking You.', - - // Whether permissions should be requested from the user automatically, - // if they are not already granted. Defaults to "true". - requestPermissions: true, - - // If "true", stale locations may be delivered while the device - // obtains a GPS fix. You are responsible for checking the "time" - // property. If "false", locations are guaranteed to be up to date. - // Defaults to "false". - stale: false, - - // The minimum number of metres between subsequent locations. Defaults - // to 0. - distanceFilter: 1, - }, - function callback(location, error) { - console.log('com.dyomedea.dyomedea LOG', ' - Callback'); - if (error) { - if (error.code === 'NOT_AUTHORIZED') { - if ( - window.confirm( - 'This app needs your location, ' + - 'but does not have permission.\n\n' + - 'Open settings now?' - ) - ) { - // It can be useful to direct the user to their device's - // settings when location permissions have been denied. The - // plugin provides the 'openSettings' method to do exactly - // this. - BackgroundGeolocation.openSettings(); - } - } - return console.error( - 'com.dyomedea.dyomedea LOG', - ' - error: ', - error - ); - } - console.log(location); - if (location !== undefined) { - //setCenter([location.latitude, location.longitude]); - //setPosition([location.latitude, location.longitude]); - dispatch( - gpxActions.appendTrkpt({ - trkKey: 'current', - trkpt: { - $: { - lat: location.latitude, - lon: location.longitude, - }, - }, - }) - ); - } - - return console.log( - 'com.dyomedea.dyomedea LOG', - ' - location: ', - location - ); - } - ) - .then(function after_the_watcher_has_been_added(watcher_id) { - // When a watcher is no longer needed, it should be removed by calling - // 'removeWatcher' with an object containing its ID. - console.log('com.dyomedea.dyomedea LOG', ' - Watcher added'); - /*BackgroundGeolocation.removeWatcher({ - id: watcher_id, - }); */ - }) - .catch((reason) => { - console.error('com.dyomedea.dyomedea LOG', ' - reason: ', reason); - }); - - }; - diff --git a/src/lib/gpx.ts b/src/lib/gpx.ts new file mode 100644 index 0000000..d380aea --- /dev/null +++ b/src/lib/gpx.ts @@ -0,0 +1,26 @@ +import _ from 'lodash'; + +const initialState: any = { + current: { + $: {}, + trk: [ + { + trkseg: [{ trkpt: [] }], + }, + ], + }, +}; + +export const appendTrkpt = (gpx:any , trkpt:any) => { + var updatedGpx = _.cloneDeep(gpx); + updatedGpx.trk[0].trkseg[0].trkpt.push(trkpt); + return updatedGpx; +}; + +export const clearTrkpt = (gpx:any) => { + var updatedGpx = _.cloneDeep(gpx); + updatedGpx.trk[0]=[]; + return updatedGpx; +}; + + diff --git a/src/store/gpx.ts b/src/store/gpx.ts deleted file mode 100644 index eaacab5..0000000 --- a/src/store/gpx.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { createSlice } from '@reduxjs/toolkit'; - -const initialState: any = { - current: { - $: {}, - trk: [ - { - trkseg: [{ trkpt: [] }], - }, - ], - }, -}; - -const slice = createSlice({ - name: 'gpx', - initialState: initialState, - reducers: { - appendTrkpt(state, action) { - state[action.payload.trkKey].trk[0].trkseg[0].trkpt.push( - action.payload.trkpt - ); - }, - clearGPX(state, action) { - state[action.payload.trkKey] = initialState.current; - }, - }, -}); - -export const gpxActions = slice.actions; - -export default slice.reducer; diff --git a/src/store/index.ts b/src/store/index.ts deleted file mode 100644 index 7e2beb6..0000000 --- a/src/store/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { configureStore } from '@reduxjs/toolkit'; - -import gpxReducer from './gpx'; - -const store = configureStore({ - reducer: { gpx: gpxReducer }, -}); - -export default store; diff --git a/src/theme/map.css b/src/theme/map.css new file mode 100644 index 0000000..099fdc9 --- /dev/null +++ b/src/theme/map.css @@ -0,0 +1,9 @@ +.tiles { + position: absolute; +} + +.tiles img { + max-width: none; + position: absolute; +} +