Do not zoom to GPS location if an element is selected
This commit is contained in:
parent
b5693304f2
commit
b883cd87d0
2 changed files with 6 additions and 4 deletions
|
@ -70,6 +70,7 @@ export default class GeoLocationHandler extends VariableUiElement {
|
|||
|
||||
constructor(
|
||||
state: {
|
||||
selectedElement: UIEventSource<any>;
|
||||
currentUserLocation: FeatureSource,
|
||||
leafletMap: UIEventSource<any>,
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue