Skip to content

Commit

Permalink
chore(web): upgrade to maplibre 4 (#7132)
Browse files Browse the repository at this point in the history
upgrade to maplibre 4
  • Loading branch information
danieldietzler committed Feb 16, 2024
1 parent 0ca7adc commit bbf7a54
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 39 deletions.
72 changes: 45 additions & 27 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"luxon": "^3.2.1",
"socket.io-client": "^4.6.1",
"svelte-local-storage-store": "^0.6.0",
"svelte-maplibre": "^0.7.0",
"svelte-maplibre": "^0.8.0",
"thumbhash": "^0.1.1"
}
}
15 changes: 4 additions & 11 deletions web/src/lib/components/shared-components/map/map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,15 @@
dispatch('selected', [assetId]);
}
function handleClusterClick(clusterId: number, map: Map | null) {
async function handleClusterClick(clusterId: number, map: Map | null) {
if (!map) {
return;
}
const mapSource = map?.getSource('geojson') as GeoJSONSource;
mapSource.getClusterLeaves(clusterId, 10_000, 0, (error, leaves) => {
if (error) {
return;
}
if (leaves) {
const ids = leaves.map((leaf) => leaf.properties?.id);
dispatch('selected', ids);
}
});
const leaves = await mapSource.getClusterLeaves(clusterId, 10_000, 0);
const ids = leaves.map((leaf) => leaf.properties?.id);
dispatch('selected', ids);
}
function handleMapClick(event: maplibregl.MapMouseEvent) {
Expand Down

0 comments on commit bbf7a54

Please sign in to comment.