From dff270fc13d732409a3ba91773d6ecd27c805230 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 23 Dec 2022 14:22:52 +0100 Subject: [PATCH] Make sure an initial GPS-fix is passed along as well --- Logic/Actors/GeoLocationHandler.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Logic/Actors/GeoLocationHandler.ts b/Logic/Actors/GeoLocationHandler.ts index ebb5175ae9..2237dff6fb 100644 --- a/Logic/Actors/GeoLocationHandler.ts +++ b/Logic/Actors/GeoLocationHandler.ts @@ -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: { 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",