From 7f9923de14344e529abf5157432c387db8f3a1cd Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 28 Jul 2025 20:27:42 +0200 Subject: [PATCH] Fix: restore capability to add new points --- .../UserMapFeatureswitchState.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Models/ThemeViewState/UserMapFeatureswitchState.ts b/src/Models/ThemeViewState/UserMapFeatureswitchState.ts index 53d662427..cb9223d35 100644 --- a/src/Models/ThemeViewState/UserMapFeatureswitchState.ts +++ b/src/Models/ThemeViewState/UserMapFeatureswitchState.ts @@ -255,4 +255,30 @@ export class UserMapFeatureswitchState extends WithUserRelatedState { } ) } + + /** + * Shows the current GPS-location marker on the given map. + * This is used to show the location on _other_ maps, e.g. on the map to add a new feature. + * + * This is _NOT_ to be used on the main map! + * + * Note: this method is _incorrectly_ marked as not used + */ + // @ts-ignore + public showCurrentLocationOn(map: Store) { + const id = "gps_location" + const layer = this.theme.getLayer(id) + if (layer === undefined) { + return + } + if (map === this.map) { + throw "Invalid use of showCurrentLocationOn" + } + const features = this.geolocation.currentUserLocation + return new ShowDataLayer(map, { + features, + layer, + metaTags: this.userRelatedState.preferencesAsTags, + }) + } }