Fix: restore capability to add new points

This commit is contained in:
Pieter Vander Vennet 2025-07-28 20:27:42 +02:00
parent 790cbd9cfc
commit 7f9923de14

View file

@ -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<MlMap>) {
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,
})
}
} }