From 9e951791750c9d0829a8bf202225808264deec5c Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 26 Mar 2026 10:08:24 +0100 Subject: [PATCH] fix: auto-zoom to street level when first GPS point arrives When the map starts zoomed out (level 5), snap to zoom 16 on the first real GPS position instead of keeping the overview level. --- .../[active=fitnessActive]/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/fitness/[workout=fitnessWorkout]/[active=fitnessActive]/+page.svelte b/src/routes/fitness/[workout=fitnessWorkout]/[active=fitnessActive]/+page.svelte index c7ae8bb..678c603 100644 --- a/src/routes/fitness/[workout=fitnessWorkout]/[active=fitnessActive]/+page.svelte +++ b/src/routes/fitness/[workout=fitnessWorkout]/[active=fitnessActive]/+page.svelte @@ -229,8 +229,8 @@ const ll = [pt.lat, pt.lng]; liveMarker.setLatLng(ll); liveMarker.setStyle({ opacity: 1, fillOpacity: 1 }); - const zoom = liveMap.getZoom() || 16; - liveMap.setView(ll, zoom); + const zoom = liveMap.getZoom(); + liveMap.setView(ll, zoom < 14 ? 16 : zoom); } });