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(
|
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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue