Fix a bug with tracking position, https://framagit.org/phyks/cyclassist/issues/11
This commit is contained in:
parent
c7a326bd94
commit
35851802d0
@ -104,7 +104,7 @@ export default {
|
|||||||
this.showCompass();
|
this.showCompass();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
positionLatLng: (newPositionLatLng) => {
|
positionLatLng(newPositionLatLng) {
|
||||||
if (!this.map) {
|
if (!this.map) {
|
||||||
// Map should have been created
|
// Map should have been created
|
||||||
return;
|
return;
|
||||||
@ -122,7 +122,7 @@ export default {
|
|||||||
this.isProgrammaticMove = true;
|
this.isProgrammaticMove = true;
|
||||||
this.map.once('moveend', () => { this.isProgrammaticMove = false; });
|
this.map.once('moveend', () => { this.isProgrammaticMove = false; });
|
||||||
}
|
}
|
||||||
this.map.setView(this.positionLatLng, this.zoom);
|
this.map.setView(newPositionLatLng, this.zoom);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -21,7 +21,7 @@ export function mockLocation() {
|
|||||||
const LNG_MIN = 2.281279;
|
const LNG_MIN = 2.281279;
|
||||||
const LAT_MAX = 48.886123;
|
const LAT_MAX = 48.886123;
|
||||||
const LNG_MAX = 2.392742;
|
const LNG_MAX = 2.392742;
|
||||||
return {
|
const newLocation = {
|
||||||
coords: {
|
coords: {
|
||||||
accuracy: 10, // In meters
|
accuracy: 10, // In meters
|
||||||
latitude: (Math.random() * (LAT_MAX - LAT_MIN)) + LAT_MIN,
|
latitude: (Math.random() * (LAT_MAX - LAT_MIN)) + LAT_MIN,
|
||||||
@ -29,6 +29,8 @@ export function mockLocation() {
|
|||||||
heading: null, // 20 * (Math.PI / 180),
|
heading: null, // 20 * (Math.PI / 180),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
console.log('New mock location: ', newLocation);
|
||||||
|
return newLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function storageAvailable(type) {
|
export function storageAvailable(type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user