[frontend]: Add scroll limits on map

This commit is contained in:
2025-03-11 14:14:31 +00:00
parent eae8724871
commit c430494b12

View File

@ -96,7 +96,15 @@ const MapComponent = ({ markers, clusteringEnabled }) => {
} }
return ( return (
<MapContainer center={mapCentre} zoom={7} minZoom={4} style={{ height: "100%", width: "100%" }}> <MapContainer
center={mapCentre}
zoom={7}
minZoom={4}
maxBounds={[[150, -50], [0, 50]]}
maxBoundsViscosity={0.3}
style={{ height: "100%", width: "100%" }}
>
<TileLayer <TileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'