diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 95ed68a..be4f968 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -436,6 +436,7 @@ export default function Dashboard() { const [flyToLocation, setFlyToLocation] = useState<{ lat: number; lng: number; + zoom?: number; ts: number; } | null>(null); @@ -504,8 +505,8 @@ export default function Dashboard() { // Agent fly_to handler (sar_focus_aoi etc.) — wired here now that // setFlyToLocation is in scope. show_image is routed through // useAgentActions at the top of Dashboard. - useAgentActions(handleMapRightClick, ({ lat, lng }) => { - setFlyToLocation({ lat, lng, ts: Date.now() }); + useAgentActions(handleMapRightClick, ({ lat, lng, zoom }) => { + setFlyToLocation({ lat, lng, zoom, ts: Date.now() }); }, secondaryBootReady); // Eavesdrop Mode State diff --git a/frontend/src/components/MaplibreViewer.tsx b/frontend/src/components/MaplibreViewer.tsx index 0db53fc..6e0e77e 100644 --- a/frontend/src/components/MaplibreViewer.tsx +++ b/frontend/src/components/MaplibreViewer.tsx @@ -752,9 +752,12 @@ const MaplibreViewer = ({ useEffect(() => { if (flyToLocation && mapRef.current) { + // Agent moves (sar_focus_aoi) carry their own zoom: a world-view revert + // asks for ~2, a tight AOI for ~9. Ignoring it pinned every move at 8, + // which turned "show the whole world" into a patch of empty ocean. mapRef.current.flyTo({ center: [flyToLocation.lng, flyToLocation.lat], - zoom: 8, + zoom: flyToLocation.zoom ?? 8, duration: 1500, }); }