From 4e3f408d5393bf6cb04109aa98279aa6e42479a0 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 3 Nov 2021 00:55:38 +0100 Subject: [PATCH] Change geolocation behaviour: will not zoom out anymore --- Logic/Actors/GeoLocationHandler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Logic/Actors/GeoLocationHandler.ts b/Logic/Actors/GeoLocationHandler.ts index 5927b73cb..6e3c7bd75 100644 --- a/Logic/Actors/GeoLocationHandler.ts +++ b/Logic/Actors/GeoLocationHandler.ts @@ -273,7 +273,9 @@ export default class GeoLocationHandler extends VariableUiElement { location ); } else { - this._leafletMap.data.setView([location.latitude, location.longitude], targetZoom); + const currentZoom = this._leafletMap.data.getZoom() + + this._leafletMap.data.setView([location.latitude, location.longitude], Math.max(targetZoom ?? 0, currentZoom)); } }