diff --git a/src/Logic/Actors/GeoLocationHandler.ts b/src/Logic/Actors/GeoLocationHandler.ts index 9d32dead4a..de3fbd465b 100644 --- a/src/Logic/Actors/GeoLocationHandler.ts +++ b/src/Logic/Actors/GeoLocationHandler.ts @@ -95,7 +95,7 @@ export default class GeoLocationHandler { if (!this.geolocationState.allowMoving.data) { // Jup, the map is locked to the bound location: move automatically - self.MoveMapToCurrentLocation() + self.MoveMapToCurrentLocation(0) return } }) @@ -113,7 +113,7 @@ export default class GeoLocationHandler { * - The GPS-location iss NULL-island * @constructor */ - public MoveMapToCurrentLocation() { + public MoveMapToCurrentLocation(zoomToAtLeast: number = 14 ) { const newLocation = this.geolocationState.currentGPSLocation.data const mapLocation = this.mapProperties.location // We got a new location. @@ -143,7 +143,7 @@ export default class GeoLocationHandler { lat: newLocation.latitude, }) const zoom = this.mapProperties.zoom - zoom.setData(Math.min(Math.max(zoom.data, 14), 18)) + zoom.setData(Math.min(Math.max(zoom.data, zoomToAtLeast), 18)) this.mapHasMoved.setData(new Date()) this.geolocationState.requestMoment.setData(undefined) diff --git a/src/Logic/State/GeoLocationState.ts b/src/Logic/State/GeoLocationState.ts index dd49b2b557..f0525de5fe 100644 --- a/src/Logic/State/GeoLocationState.ts +++ b/src/Logic/State/GeoLocationState.ts @@ -30,7 +30,7 @@ export class GeoLocationState { */ public readonly requestMoment: UIEventSource = new UIEventSource(undefined) /** - * If true: the map will center (and re-center) to this location + * If true: the map will center (and re-center) to the current GPS-location */ public readonly allowMoving: UIEventSource = new UIEventSource(true)