Render GPX and route overlays once the Mapbox style has loaded (#1036)

The GPX and route geojson effects ran before the map 'load' event had
attached their sources, so on the first paint they hit the early return
and never re-ran. Add mapReady to their dependencies so they fire again
the moment the sources exist.
This commit is contained in:
Maurice
2026-05-31 22:35:58 +02:00
parent 48098ef5ec
commit 8691814330
+2 -2
View File
@@ -447,7 +447,7 @@ export function MapViewGL({
geometry: { type: 'LineString' as const, coordinates: seg.map(([lat, lng]) => [lng, lat]) },
}))
src.setData({ type: 'FeatureCollection', features })
}, [route])
}, [route, mapReady])
// Travel times now live in the day sidebar (per-segment connectors), not on the map.
@@ -470,7 +470,7 @@ export function MapViewGL({
} catch { return [] }
})
src.setData({ type: 'FeatureCollection', features })
}, [places])
}, [places, mapReady])
// Reservation overlay — mirrors the Leaflet ReservationOverlay: great-
// circle arcs for flights/cruises, straight lines for trains/cars,