diff --git a/src/components/Map.vue b/src/components/Map.vue index 58df4e8..6946bcb 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -104,7 +104,7 @@ export default { this.showCompass(); }, watch: { - positionLatLng: (newPositionLatLng) => { + positionLatLng(newPositionLatLng) { if (!this.map) { // Map should have been created return; @@ -122,7 +122,7 @@ export default { this.isProgrammaticMove = true; this.map.once('moveend', () => { this.isProgrammaticMove = false; }); } - this.map.setView(this.positionLatLng, this.zoom); + this.map.setView(newPositionLatLng, this.zoom); } }, }, diff --git a/src/tools/index.js b/src/tools/index.js index d9d9efe..963491a 100644 --- a/src/tools/index.js +++ b/src/tools/index.js @@ -21,7 +21,7 @@ export function mockLocation() { const LNG_MIN = 2.281279; const LAT_MAX = 48.886123; const LNG_MAX = 2.392742; - return { + const newLocation = { coords: { accuracy: 10, // In meters latitude: (Math.random() * (LAT_MAX - LAT_MIN)) + LAT_MIN, @@ -29,6 +29,8 @@ export function mockLocation() { heading: null, // 20 * (Math.PI / 180), }, }; + console.log('New mock location: ', newLocation); + return newLocation; } export function storageAvailable(type) {