diff --git a/frontend/src/views/map/page.jsx b/frontend/src/views/map/page.jsx index c1be06d..8786ca5 100644 --- a/frontend/src/views/map/page.jsx +++ b/frontend/src/views/map/page.jsx @@ -125,6 +125,23 @@ const FlightsLayer = ({ flightsData, updateInterval = 5000 }) => { return null; }; +const InitialBounds = ({ setBoundries }) => { + const map = useMap(); + + useEffect(() => { + // Wait for map to be ready, then set initial bounds + map.whenReady(() => { + const bounds = map.getBounds(); + setBoundries({ + southWest: bounds.getSouthWest(), + northEast: bounds.getNorthEast(), + }); + }); + }, [map, setBoundries]); + + return null; +}; + const createPlaneIcon = (heading = 0) => { const html = `
+