Hide speed badge when setting map center manually

This commit is contained in:
Lucas Verney 2018-10-21 23:42:36 +02:00
parent 8a52c94fbb
commit 93b0ec340e
2 changed files with 10 additions and 12 deletions

View File

@ -15,6 +15,8 @@
</template>
<script>
import { DEFAULT_ZOOM } from '@/constants';
import AddressInput from '@/components/AddressInput.vue';
export default {
@ -23,17 +25,14 @@ export default {
},
methods: {
onManualLocationPicker(value) {
this.$store.dispatch(
'setCurrentPosition',
{
coords: {
latitude: value.latlng.lat,
longitude: value.latlng.lng,
speed: null,
},
timestamp: new Date().getTime(),
this.$router.push({
name: 'SharedMap',
params: {
lat: value.latlng.lat,
lng: value.latlng.lng,
zoom: DEFAULT_ZOOM,
},
);
});
},
},
props: {

View File

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