feat([2fd88f42]): add marker clustering to points view
This commit is contained in:
37
heatmap-tool/frontend/package-lock.json
generated
37
heatmap-tool/frontend/package-lock.json
generated
@@ -14,11 +14,13 @@
|
|||||||
"react": "^19.2.0",
|
"react": "^19.2.0",
|
||||||
"react-dom": "^19.2.0",
|
"react-dom": "^19.2.0",
|
||||||
"react-leaflet": "^5.0.0",
|
"react-leaflet": "^5.0.0",
|
||||||
|
"react-leaflet-cluster": "^4.0.0",
|
||||||
"react-leaflet-heatmap-layer-v3": "^3.0.3-beta-1"
|
"react-leaflet-heatmap-layer-v3": "^3.0.3-beta-1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.39.1",
|
"@eslint/js": "^9.39.1",
|
||||||
"@types/leaflet": "^1.9.21",
|
"@types/leaflet": "^1.9.21",
|
||||||
|
"@types/leaflet.markercluster": "^1.5.6",
|
||||||
"@types/node": "^24.10.1",
|
"@types/node": "^24.10.1",
|
||||||
"@types/react": "^19.2.5",
|
"@types/react": "^19.2.5",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
@@ -1459,6 +1461,16 @@
|
|||||||
"@types/geojson": "*"
|
"@types/geojson": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/leaflet.markercluster": {
|
||||||
|
"version": "1.5.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/leaflet.markercluster/-/leaflet.markercluster-1.5.6.tgz",
|
||||||
|
"integrity": "sha512-I7hZjO2+isVXGYWzKxBp8PsCzAYCJBc29qBdFpquOCkS7zFDqUsUvkEOyQHedsk/Cy5tocQzf+Ndorm5W9YKTQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/leaflet": "^1.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "24.10.10",
|
"version": "24.10.10",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.10.tgz",
|
||||||
@@ -2855,6 +2867,15 @@
|
|||||||
"resolved": "https://registry.npmjs.org/leaflet.heat/-/leaflet.heat-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/leaflet.heat/-/leaflet.heat-0.2.0.tgz",
|
||||||
"integrity": "sha512-Cd5PbAA/rX3X3XKxfDoUGi9qp78FyhWYurFg3nsfhntcM/MCNK08pRkf4iEenO1KNqwVPKCmkyktjW3UD+h9bQ=="
|
"integrity": "sha512-Cd5PbAA/rX3X3XKxfDoUGi9qp78FyhWYurFg3nsfhntcM/MCNK08pRkf4iEenO1KNqwVPKCmkyktjW3UD+h9bQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/leaflet.markercluster": {
|
||||||
|
"version": "1.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/leaflet.markercluster/-/leaflet.markercluster-1.5.3.tgz",
|
||||||
|
"integrity": "sha512-vPTw/Bndq7eQHjLBVlWpnGeLa3t+3zGiuM7fJwCkiMFq+nmRuG3RI3f7f4N4TDX7T4NpbAXpR2+NTRSEGfCSeA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"leaflet": "^1.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/levn": {
|
"node_modules/levn": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
|
||||||
@@ -3178,6 +3199,22 @@
|
|||||||
"react-dom": "^19.0.0"
|
"react-dom": "^19.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-leaflet-cluster": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-leaflet-cluster/-/react-leaflet-cluster-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-Lu75+KOu2ruGyAx8LoCQvlHuw+3CLLJQGEoSk01ymsDN/YnCiRV6ChkpsvaruVyYBPzUHwiskFw4Jo7WHj5qNw==",
|
||||||
|
"license": "SEE LICENSE IN <LICENSE>",
|
||||||
|
"dependencies": {
|
||||||
|
"leaflet.markercluster": "^1.5.3"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@react-leaflet/core": "^3.0.0",
|
||||||
|
"leaflet": "^1.9.0",
|
||||||
|
"react": "^19.0.0",
|
||||||
|
"react-dom": "^19.0.0",
|
||||||
|
"react-leaflet": "^5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-leaflet-heatmap-layer-v3": {
|
"node_modules/react-leaflet-heatmap-layer-v3": {
|
||||||
"version": "3.0.3-beta-1",
|
"version": "3.0.3-beta-1",
|
||||||
"resolved": "https://registry.npmjs.org/react-leaflet-heatmap-layer-v3/-/react-leaflet-heatmap-layer-v3-3.0.3-beta-1.tgz",
|
"resolved": "https://registry.npmjs.org/react-leaflet-heatmap-layer-v3/-/react-leaflet-heatmap-layer-v3-3.0.3-beta-1.tgz",
|
||||||
|
|||||||
@@ -16,11 +16,13 @@
|
|||||||
"react": "^19.2.0",
|
"react": "^19.2.0",
|
||||||
"react-dom": "^19.2.0",
|
"react-dom": "^19.2.0",
|
||||||
"react-leaflet": "^5.0.0",
|
"react-leaflet": "^5.0.0",
|
||||||
|
"react-leaflet-cluster": "^4.0.0",
|
||||||
"react-leaflet-heatmap-layer-v3": "^3.0.3-beta-1"
|
"react-leaflet-heatmap-layer-v3": "^3.0.3-beta-1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.39.1",
|
"@eslint/js": "^9.39.1",
|
||||||
"@types/leaflet": "^1.9.21",
|
"@types/leaflet": "^1.9.21",
|
||||||
|
"@types/leaflet.markercluster": "^1.5.6",
|
||||||
"@types/node": "^24.10.1",
|
"@types/node": "^24.10.1",
|
||||||
"@types/react": "^19.2.5",
|
"@types/react": "^19.2.5",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
|
import 'react-leaflet-cluster/dist/assets/MarkerCluster.css';
|
||||||
|
import 'react-leaflet-cluster/dist/assets/MarkerCluster.Default.css';
|
||||||
import FileUpload from './components/FileUpload';
|
import FileUpload from './components/FileUpload';
|
||||||
import FilterPanel from './components/FilterPanel';
|
import FilterPanel from './components/FilterPanel';
|
||||||
import MapDisplay from './components/MapDisplay';
|
import MapDisplay from './components/MapDisplay';
|
||||||
|
|||||||
@@ -28,8 +28,16 @@ const MapDisplay: React.FC<MapDisplayProps> = ({ heatmapData, radiusMultiplier,
|
|||||||
return '#66bd63'; // Green
|
return '#66bd63'; // Green
|
||||||
};
|
};
|
||||||
|
|
||||||
|
import MarkerClusterGroup from 'react-leaflet-cluster';
|
||||||
|
|
||||||
|
// ... (imports and interface definitions)
|
||||||
|
|
||||||
|
const MapDisplay: React.FC<MapDisplayProps> = ({ heatmapData, radiusMultiplier, viewMode }) => {
|
||||||
|
// ... (helper functions and state)
|
||||||
|
|
||||||
const renderPoints = () => (
|
const renderPoints = () => (
|
||||||
heatmapData.map((point, idx) => (
|
<MarkerClusterGroup>
|
||||||
|
{heatmapData.map((point, idx) => (
|
||||||
<CircleMarker
|
<CircleMarker
|
||||||
key={idx}
|
key={idx}
|
||||||
center={[point.lat, point.lon]}
|
center={[point.lat, point.lon]}
|
||||||
@@ -50,9 +58,14 @@ const MapDisplay: React.FC<MapDisplayProps> = ({ heatmapData, radiusMultiplier,
|
|||||||
))}
|
))}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</CircleMarker>
|
</CircleMarker>
|
||||||
))
|
))}
|
||||||
|
</MarkerClusterGroup>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ... (rest of the component)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const renderHeatmap = () => (
|
const renderHeatmap = () => (
|
||||||
<HeatmapLayer
|
<HeatmapLayer
|
||||||
points={heatmapData}
|
points={heatmapData}
|
||||||
|
|||||||
Reference in New Issue
Block a user