diff --git a/Logic/Leaflet/Basemap.ts b/Logic/Leaflet/Basemap.ts index a1b09c9..e1139e7 100644 --- a/Logic/Leaflet/Basemap.ts +++ b/Logic/Leaflet/Basemap.ts @@ -42,6 +42,11 @@ export class Basemap { layers: [this._previousLayer], }); + L.control.scale( + { + position: 'topright', + } + ).addTo(this.map) // Users are not allowed to zoom to the 'copies' on the left and the right, stuff goes wrong then // We give a bit of leeway for people on the edges diff --git a/Logic/Leaflet/GeoLocationHandler.ts b/Logic/Leaflet/GeoLocationHandler.ts index d201fdf..d91b2bd 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); @@ -102,7 +110,12 @@ export class GeoLocationHandler extends UIElement { return ""; } if (State.state.currentGPSLocation.data !== undefined) { - map.flyTo(State.state.currentGPSLocation.data.latlng, 18); + State.state.bm.map.flyTo( + State.state.currentGPSLocation.data.latlng, 16, + { + duration: 0.25, + } + ); } diff --git a/index.html b/index.html index 3751ce6..d74743a 100644 --- a/index.html +++ b/index.html @@ -65,7 +65,6 @@
-