fix: auto-zoom to street level when first GPS point arrives
All checks were successful
CI / update (push) Successful in 2m19s

When the map starts zoomed out (level 5), snap to zoom 16 on the first
real GPS position instead of keeping the overview level.
This commit is contained in:
2026-03-26 10:08:24 +01:00
parent c997e74806
commit 9e95179175

View File

@@ -229,8 +229,8 @@
const ll = [pt.lat, pt.lng]; const ll = [pt.lat, pt.lng];
liveMarker.setLatLng(ll); liveMarker.setLatLng(ll);
liveMarker.setStyle({ opacity: 1, fillOpacity: 1 }); liveMarker.setStyle({ opacity: 1, fillOpacity: 1 });
const zoom = liveMap.getZoom() || 16; const zoom = liveMap.getZoom();
liveMap.setView(ll, zoom); liveMap.setView(ll, zoom < 14 ? 16 : zoom);
} }
}); });