Better handling of the case when heading is zero

This commit is contained in:
Lucas Verney 2018-07-09 11:56:15 +02:00
parent 9d4842b44c
commit 6c5d62ad69

View File

@ -138,7 +138,7 @@ export default {
} }
} }
this.latLng = [position.coords.latitude, position.coords.longitude]; this.latLng = [position.coords.latitude, position.coords.longitude];
this.heading = position.coords.heading ? position.coords.heading : null; this.heading = Object.prototype.hasOwnProperty.call(position.coords, 'heading') ? position.coords.heading : null;
this.accuracy = position.coords.accuracy ? position.coords.accuracy : null; this.accuracy = position.coords.accuracy ? position.coords.accuracy : null;
}, },
setNoSleep() { setNoSleep() {