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();
|
||||
},
|
||||
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);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user