Change geolocation behaviour: will not zoom out anymore

This commit is contained in:
pietervdvn 2021-11-03 00:55:38 +01:00
parent 6e0f57f368
commit 4e3f408d53

View file

@ -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));
}
}