From acb7c9241f5ee000287bc1577e153a411e6f4ca4 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 10:56:04 +0000 Subject: [PATCH] Fix: Use correct initial zoom for mobile devices The map component was not using the calculated `initialZoom` for mobile devices, causing the map to be zoomed in by default. This commit fixes the issue by: - Updating `currentMapCenterRef.current.zoom` with the `initialZoom` value. - Using `initialZoom` when creating the `mapboxgl.Map` instance. This ensures that mobile and tablet devices get the appropriate zoom level for a full globe preview. --- components/map/mapbox-map.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/map/mapbox-map.tsx b/components/map/mapbox-map.tsx index 3f2d5f2b..e9ace780 100644 --- a/components/map/mapbox-map.tsx +++ b/components/map/mapbox-map.tsx @@ -395,11 +395,12 @@ export const Mapbox: React.FC<{ position?: { latitude: number; longitude: number initialZoom = 1.3; } + currentMapCenterRef.current.zoom = initialZoom; map.current = new mapboxgl.Map({ container: mapContainer.current, style: 'mapbox://styles/mapbox/satellite-streets-v12', center: currentMapCenterRef.current.center, - zoom: currentMapCenterRef.current.zoom, + zoom: initialZoom, pitch: currentMapCenterRef.current.pitch, bearing: 0, maxZoom: 22,