Do not show speed badge when manually picking a location

This commit is contained in:
Lucas Verney 2018-10-18 20:05:48 +02:00
parent 1733f80773
commit 1ca9922b1b
2 changed files with 11 additions and 3 deletions

View File

@ -26,7 +26,11 @@ export default {
this.$store.dispatch( this.$store.dispatch(
'setCurrentPosition', 'setCurrentPosition',
{ {
coords: { latitude: value.latlng.lat, longitude: value.latlng.lng }, coords: {
latitude: value.latlng.lat,
longitude: value.latlng.lng,
speed: null,
},
timestamp: new Date().getTime(), timestamp: new Date().getTime(),
}, },
); );

View File

@ -98,10 +98,14 @@ export default {
return this.$store.getters.getLastLocation || {}; return this.$store.getters.getLastLocation || {};
}, },
currentSpeed() { currentSpeed() {
if (this.hasCenterProvidedByRoute || !this.currentLocation) { if (
this.hasCenterProvidedByRoute
|| !this.currentLocation
|| !this.currentLocation.speed
) {
return null; return null;
} }
return Math.round(this.currentLocation.speed || 0, 0); return Math.round(this.currentLocation.speed, 0);
}, },
error() { error() {
const errorCode = this.$store.state.location.error; const errorCode = this.$store.state.location.error;