Do not zoom to GPS location if an element is selected

This commit is contained in:
Pieter Vander Vennet 2021-11-15 16:57:04 +01:00
parent b5693304f2
commit b883cd87d0
2 changed files with 6 additions and 4 deletions

View file

@ -70,6 +70,7 @@ export default class GeoLocationHandler extends VariableUiElement {
constructor( constructor(
state: { state: {
selectedElement: UIEventSource<any>;
currentUserLocation: FeatureSource, currentUserLocation: FeatureSource,
leafletMap: UIEventSource<any>, leafletMap: UIEventSource<any>,
layoutToUse: LayoutConfig, layoutToUse: LayoutConfig,
@ -183,7 +184,8 @@ export default class GeoLocationHandler extends VariableUiElement {
const latLonGiven = QueryParameters.wasInitialized("lat") && QueryParameters.wasInitialized("lon") 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 => { isLocked.addCallbackAndRunD(isLocked => {
if (isLocked) { if (isLocked) {

View file

@ -470,8 +470,8 @@
] ]
} }
}, },
"level", "level",
"description" "description"
], ],
"filter": [ "filter": [
{ {
@ -582,4 +582,4 @@
] ]
} }
] ]
} }