From e82db5b6db13ad74b7168393e1f792bc88cd3a07 Mon Sep 17 00:00:00 2001 From: orangecoding Date: Sat, 13 Jun 2026 13:21:49 +0200 Subject: [PATCH] removing annoying map animation --- ui/src/views/listings/Map.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/src/views/listings/Map.jsx b/ui/src/views/listings/Map.jsx index 8e5f867..3e7a684 100644 --- a/ui/src/views/listings/Map.jsx +++ b/ui/src/views/listings/Map.jsx @@ -189,6 +189,10 @@ export default function MapView() { useEffect(() => { if (!map.current) return; + // Use duration: 0 so the map jumps straight to the target view instead of + // animating from the zoomed-out initial state. This effect re-runs whenever + // listings/filters change, and the fly/zoom animation was distracting on + // every refresh. if (homeAddress?.coords) { if (distanceFilter > 0) { const bounds = getBoundsFromCenter([homeAddress.coords.lng, homeAddress.coords.lat], distanceFilter); @@ -196,13 +200,13 @@ export default function MapView() { map.current.fitBounds(bounds, { padding: 20, maxZoom: 15, - duration: 1000, + duration: 0, }); } else { map.current.flyTo({ center: [homeAddress.coords.lng, homeAddress.coords.lat], zoom: 12, - duration: 1000, + duration: 0, }); } } else { @@ -216,7 +220,7 @@ export default function MapView() { map.current.fitBounds(bounds, { padding: 50, maxZoom: 15, - duration: 1000, + duration: 0, }); } }