From b883cd87d0aeddf76cceba2fee8d8c605720f32e Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 15 Nov 2021 16:57:04 +0100 Subject: [PATCH] Do not zoom to GPS location if an element is selected --- Logic/Actors/GeoLocationHandler.ts | 4 +++- assets/layers/toilet/toilet.json | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Logic/Actors/GeoLocationHandler.ts b/Logic/Actors/GeoLocationHandler.ts index 4d6561391..2d1166e51 100644 --- a/Logic/Actors/GeoLocationHandler.ts +++ b/Logic/Actors/GeoLocationHandler.ts @@ -70,6 +70,7 @@ export default class GeoLocationHandler extends VariableUiElement { constructor( state: { + selectedElement: UIEventSource; currentUserLocation: FeatureSource, leafletMap: UIEventSource, layoutToUse: LayoutConfig, @@ -183,7 +184,8 @@ export default class GeoLocationHandler extends VariableUiElement { const latLonGiven = QueryParameters.wasInitialized("lat") && QueryParameters.wasInitialized("lon") - this.init(false, !latLonGiven && state.featureSwitchGeolocation.data); + const doAutoZoomToLocation = !latLonGiven && state.featureSwitchGeolocation.data && state.selectedElement.data !== undefined + this.init(false, doAutoZoomToLocation); isLocked.addCallbackAndRunD(isLocked => { if (isLocked) { diff --git a/assets/layers/toilet/toilet.json b/assets/layers/toilet/toilet.json index b6b280bf3..76e7c5ec6 100644 --- a/assets/layers/toilet/toilet.json +++ b/assets/layers/toilet/toilet.json @@ -470,8 +470,8 @@ ] } }, -"level", -"description" + "level", + "description" ], "filter": [ { @@ -582,4 +582,4 @@ ] } ] -} +} \ No newline at end of file