diff --git a/src/components/home/RangeMap.tsx b/src/components/home/RangeMap.tsx index a545488fbb60..dbbbce3292e4 100644 --- a/src/components/home/RangeMap.tsx +++ b/src/components/home/RangeMap.tsx @@ -45,6 +45,16 @@ const RangeMap = React.forwardRef( }; }, [handleMove, map]); + useEffect(() => { + const bounds = circleRef.current?.getBounds(); + bounds && + map?.fitBounds(bounds, { + // Disable animation to prevent not fitting to the latest bounds when called multiple times quickly + // See: Glitchy behavior when animating fitBounds multiple times https://github.com/Leaflet/Leaflet/issues/3249 + animate: false, + }); + }, [map, range]); + return (