From d7d7952111ebbba5bff9e4a15ab3198b6fdedad2 Mon Sep 17 00:00:00 2001 From: Christian Neumann Date: Fri, 20 Nov 2020 11:29:57 +0100 Subject: [PATCH] Wait for loading of AccuratePosition script. --- Logic/Leaflet/GeoLocationHandler.ts | 8 ++++++++ index.html | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Logic/Leaflet/GeoLocationHandler.ts b/Logic/Leaflet/GeoLocationHandler.ts index e94b23e..8950e31 100644 --- a/Logic/Leaflet/GeoLocationHandler.ts +++ b/Logic/Leaflet/GeoLocationHandler.ts @@ -17,6 +17,14 @@ export class GeoLocationHandler extends UIElement { constructor() { super(undefined); this._hasLocation = State.state.currentGPSLocation.map((location) => location !== undefined); + var self = this; + import("../../vendor/Leaflet.AccuratePosition.js").then(() => { + self.init(); + }) + } + + + public init() { this.ListenTo(this._hasLocation); this.ListenTo(this._isActive); this.ListenTo(this._permission); diff --git a/index.html b/index.html index 3751ce6..d74743a 100644 --- a/index.html +++ b/index.html @@ -65,7 +65,6 @@
-