Skip to content

Commit

Permalink
Upgrade to maplibre 4
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Feb 28, 2024
1 parent 176c662 commit 47bb945
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 63 deletions.
112 changes: 65 additions & 47 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"vite-tsconfig-paths": "^4.2.0"
},
"dependencies": {
"@maptiler/geocoding-control": "^1.2.1",
"@maptiler/geocoding-control": "^1.2.2",
"@turf/area": "^6.5.0",
"@turf/bbox": "^6.5.0",
"@turf/boolean-contains": "^6.5.0",
Expand All @@ -50,11 +50,11 @@
"govuk-svelte": "github:acteng/govuk-svelte",
"humanize-string": "^3.0.0",
"js-cookie": "^3.0.5",
"maplibre-gl": "^3.5.1",
"maplibre-gl": "^4.0.2",
"read-excel-file": "^5.7.1",
"route-snapper": "^0.3.0",
"svelte": "^4.2.10",
"svelte-maplibre": "^0.7.7",
"svelte-maplibre": "^0.8.1",
"uuid": "^9.0.1"
}
}
22 changes: 9 additions & 13 deletions src/lib/browse/layers/points/CriticalIssues.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,15 @@
}
}
function clickCluster(e: CustomEvent<LayerClickInfo>) {
($map.getSource(source) as GeoJSONSource).getClusterExpansionZoom(
e.detail.features[0].properties!.cluster_id,
(err, zoom) => {
if (!err) {
$map.easeTo({
// @ts-ignore We know this is a point
center: e.detail.features[0].geometry.coordinates,
zoom: zoom as number,
});
}
},
);
async function clickCluster(e: CustomEvent<LayerClickInfo>) {
let zoom = await (
$map.getSource(source) as GeoJSONSource
).getClusterExpansionZoom(e.detail.features[0].properties!.cluster_id);
$map.easeTo({
// @ts-ignore We know this is a point
center: e.detail.features[0].geometry.coordinates,
zoom,
});
}
</script>

Expand Down

0 comments on commit 47bb945

Please sign in to comment.