diff --git a/packages/web/package.json b/packages/web/package.json index 7084359..7c1ed13 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -26,6 +26,7 @@ "react-ga4": "^2.1.0", "react-icons": "^4.10.1", "react-leaflet": "^4.2.1", + "react-leaflet-cluster": "^2.1.0", "react-resizable": "^3.0.5", "react-resizable-panels": "^0.0.53", "react-router-dom": "^6.11.2", diff --git a/packages/web/src/components/Home/Home.jsx b/packages/web/src/components/Home/Home.jsx index c0b55e3..2e16a7b 100644 --- a/packages/web/src/components/Home/Home.jsx +++ b/packages/web/src/components/Home/Home.jsx @@ -726,8 +726,7 @@ export default function Home() { left={10} bottom={10} > - - + 0 ? results : data; - const allMarkers = markersData.filter(filterItemCallback).map((item) => { - return ( + const allMarkers = useMemo(() => { + return markersData.filter(filterItemCallback).map((item) => ( - ); - }); + )); + }, [markersData, filterItemCallback, onOpen, setItemData, setFocusLocation]); // moves map when focusLocation state changes function MapFocusLocation({ location }) { @@ -353,8 +354,11 @@ export default function Map({ {!isEdit && ( )} - {!isEdit} - {!isEdit && allMarkers} + {!isEdit && ( + + {allMarkers} + + )} {isEdit && } {showDonut && focusLocation && ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6148c5a..21527e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,6 +164,9 @@ importers: react-leaflet: specifier: ^4.2.1 version: 4.2.1(leaflet@1.9.4)(react-dom@18.2.0)(react@18.2.0) + react-leaflet-cluster: + specifier: ^2.1.0 + version: 2.1.0(leaflet@1.9.4)(react-dom@18.2.0)(react-leaflet@4.2.1)(react@18.2.0) react-resizable: specifier: ^3.0.5 version: 3.0.5(react-dom@18.2.0)(react@18.2.0) @@ -9441,6 +9444,14 @@ packages: readable-stream: 2.3.8 dev: true + /leaflet.markercluster@1.5.3(leaflet@1.9.4): + resolution: {integrity: sha512-vPTw/Bndq7eQHjLBVlWpnGeLa3t+3zGiuM7fJwCkiMFq+nmRuG3RI3f7f4N4TDX7T4NpbAXpR2+NTRSEGfCSeA==} + peerDependencies: + leaflet: ^1.3.1 + dependencies: + leaflet: 1.9.4 + dev: false + /leaflet@1.9.4: resolution: {integrity: sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==} dev: false @@ -10559,6 +10570,21 @@ packages: /react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + /react-leaflet-cluster@2.1.0(leaflet@1.9.4)(react-dom@18.2.0)(react-leaflet@4.2.1)(react@18.2.0): + resolution: {integrity: sha512-16X7XQpRThQFC4PH4OpXHimGg19ouWmjxjtpxOeBKpvERSvIRqTx7fvhTwkEPNMFTQ8zTfddz6fRTUmUEQul7g==} + peerDependencies: + leaflet: ^1.8.0 + react: ^18.0.0 + react-dom: ^18.0.0 + react-leaflet: ^4.0.0 + dependencies: + leaflet: 1.9.4 + leaflet.markercluster: 1.5.3(leaflet@1.9.4) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-leaflet: 4.2.1(leaflet@1.9.4)(react-dom@18.2.0)(react@18.2.0) + dev: false + /react-leaflet@4.2.1(leaflet@1.9.4)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-p9chkvhcKrWn/H/1FFeVSqLdReGwn2qmiobOQGO3BifX+/vV/39qhY8dGqbdcPh1e6jxh/QHriLXr7a4eLFK4Q==} peerDependencies: