mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-08-10 04:30:36 +02:00
Add zoom to agent fly to location
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user