chore(web): upgrade to maplibre 4 (#7132)

upgrade to maplibre 4
This commit is contained in:
Daniel Dietzler 2024-02-16 14:55:13 +01:00 committed by GitHub
parent 0ca7adcdbf
commit bbf7a54c65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 50 additions and 39 deletions

View file

@ -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) {