forked from MapComplete/MapComplete
Fix: restore capability to add new points
This commit is contained in:
parent
790cbd9cfc
commit
7f9923de14
1 changed files with 26 additions and 0 deletions
|
@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue