";
}
if (this._isActive.data) {
@@ -94,17 +90,17 @@ export class GeoLocationHandler extends UIElement {
private StartGeolocating() {
const self = this;
-
+ const map = State.state.bm.map;
if (self._permission.data === "denied") {
return "";
}
- if (self.currentLocation.data !== undefined) {
- self._map.map.flyTo(self.currentLocation.data.latlng, 18);
+ if (State.state.currentGPSLocation.data !== undefined) {
+ map.flyTo(State.state.currentGPSLocation.data.latlng, 18);
}
console.log("Searching location using GPS")
- self._map.map.findAccuratePosition({
+ map.findAccuratePosition({
maxWait: 10000, // defaults to 10000
desiredAccuracy: 50 // defaults to 20
});
@@ -113,13 +109,13 @@ export class GeoLocationHandler extends UIElement {
if (!self._isActive.data) {
self._isActive.setData(true);
Helpers.DoEvery(60000, () => {
-
- if(document.visibilityState !== "visible"){
+
+ if (document.visibilityState !== "visible") {
console.log("Not starting gps: document not visible")
return;
}
-
- self._map.map.findAccuratePosition({
+
+ map.findAccuratePosition({
maxWait: 10000, // defaults to 10000
desiredAccuracy: 50 // defaults to 20
});
diff --git a/Logic/Leaflet/StrayClickHandler.ts b/Logic/Leaflet/StrayClickHandler.ts
index 2ba97193f2..fefc1817d5 100644
--- a/Logic/Leaflet/StrayClickHandler.ts
+++ b/Logic/Leaflet/StrayClickHandler.ts
@@ -2,29 +2,23 @@ import {Basemap} from "./Basemap";
import L from "leaflet";
import {UIEventSource} from "../../UI/UIEventSource";
import {UIElement} from "../../UI/UIElement";
+import {State} from "../../State";
/**
* The stray-click-hanlders adds a marker to the map if no feature was clicked.
* Shows the given uiToShow-element in the messagebox
*/
export class StrayClickHandler {
- private _basemap: Basemap;
private _lastMarker;
- private _fullScreenMessage: UIEventSource