Make sure an initial GPS-fix is passed along as well

This commit is contained in:
Pieter Vander Vennet 2022-12-23 14:22:52 +01:00
parent 4de76136de
commit dff270fc13

View file

@ -117,19 +117,14 @@ export default class GeoLocationHandler {
private CopyGeolocationIntoMapstate() {
const state = this._state
this.geolocationState.currentGPSLocation.addCallback((location) => {
this.geolocationState.currentGPSLocation.addCallbackAndRunD((location) => {
const feature = {
type: "Feature",
properties: <GeoLocationPointProperties>{
id: "gps",
"user:location": "yes",
date: new Date().toISOString(),
latitude: location.latitude,
longitude: location.longitude,
speed: location.speed,
accuracy: location.accuracy,
heading: location.heading,
altitude: location.altitude,
...location,
},
geometry: {
type: "Point",