From d744fd3a42bedb64de7de1562b6f4ee31ba9d254 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 3 Apr 2024 01:01:38 +0200 Subject: [PATCH 1/4] Fix: add awaitAnimationFrame to fix non-working questions --- src/UI/Popup/TagRendering/Questionbox.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UI/Popup/TagRendering/Questionbox.svelte b/src/UI/Popup/TagRendering/Questionbox.svelte index e52fbbf8d..76be7c51e 100644 --- a/src/UI/Popup/TagRendering/Questionbox.svelte +++ b/src/UI/Popup/TagRendering/Questionbox.svelte @@ -71,13 +71,13 @@ let firstQuestion: UIEventSource = new UIEventSource(undefined) let allQuestionsToAsk : UIEventSource = new UIEventSource([]) - function calculateQuestions(){ + async function calculateQuestions(){ console.log("Applying questions to ask") const qta = questionsToAsk.data firstQuestion.setData(undefined) - firstQuestion.setData(qta[0]) - allQuestionsToAsk.setData([]) + await Utils.awaitAnimationFrame() + firstQuestion.setData(qta[0]) allQuestionsToAsk.setData(qta) } From 301398b7a452af10e1c39ba08a1221723019ac00 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 3 Apr 2024 13:41:32 +0200 Subject: [PATCH 2/4] Always use singlepage mode, see #1867 --- src/Logic/Osm/OsmConnection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Logic/Osm/OsmConnection.ts b/src/Logic/Osm/OsmConnection.ts index 97dd7c821..e22e25f3c 100644 --- a/src/Logic/Osm/OsmConnection.ts +++ b/src/Logic/Osm/OsmConnection.ts @@ -546,7 +546,7 @@ export class OsmConnection { redirect_uri: Utils.runningFromConsole ? "https://mapcomplete.org/land.html" : window.location.protocol + "//" + window.location.host + "/land.html", - singlepage: !standalone, + singlepage: true, auto: true }) } From 36663f97ade0cfa0db958add4b824fb1d16aa82e Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 3 Apr 2024 13:41:46 +0200 Subject: [PATCH 3/4] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 008974e53..711a682e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mapcomplete", - "version": "0.41.4", + "version": "0.41.5", "repository": "https://github.com/pietervdvn/MapComplete", "description": "A small website to edit OSM easily", "bugs": "https://github.com/pietervdvn/MapComplete/issues", From 183740d6c6a0c0df0ca9c979247755d485485913 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 3 Apr 2024 23:24:11 +0200 Subject: [PATCH 4/4] Don't zoom in automatically if the location is locked around the GPS-location --- src/Logic/Actors/GeoLocationHandler.ts | 6 +++--- src/Logic/State/GeoLocationState.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Logic/Actors/GeoLocationHandler.ts b/src/Logic/Actors/GeoLocationHandler.ts index 9d32dead4..de3fbd465 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 dd49b2b55..f0525de5f 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)