/ frontend / containers / Map / MapController.tsx
MapController.tsx
 1  import {useMap} from 'react-leaflet';
 2  import useMapStore from '../../stores/useMapStore';
 3  
 4  const MapController = () => {
 5    const map = useMap();
 6    const {setMap, map: storedMap} = useMapStore();
 7    map.scrollWheelZoom.disable();
 8  
 9    if (storedMap !== map) {
10      setMap(map);
11    }
12  
13    return <></>;
14  };
15  
16  export default MapController;