Skip to content

Commit

Permalink
Update Mapbox GL
Browse files Browse the repository at this point in the history
  • Loading branch information
urschrei committed Apr 17, 2024
1 parent b2adab6 commit 3ec45ce
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 16 deletions.
18 changes: 18 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,24 @@ function updateId(id) {
window.history.replaceState({}, '', `${path}?${params.toString()}${hash}`);
}

// Because features come from tiled vector data,
// feature geometries may be split
// or duplicated across tile boundaries.
// As a result, features may appear
// multiple times in query results.
function getUniqueFeatures(features, comparatorProperty) {
const uniqueIds = new Set();
const uniqueFeatures = [];
for (const feature of features) {
const id = feature.properties[comparatorProperty];
if (!uniqueIds.has(id)) {
uniqueIds.add(id);
uniqueFeatures.push(feature);
}
}
return uniqueFeatures;
}

function makeActive(division) {
const ed = divisions[0];
const lea = divisions[1];
Expand Down
55 changes: 47 additions & 8 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"dependencies": {
"@mapbox/mapbox-gl-geocoder": "^5.0.2",
"bootstrap": "^5.3.2",
"mapbox-gl": "^3.1.2"
"mapbox-gl": "^3.3.0"
}
}
Loading

0 comments on commit 3ec45ce

Please sign in to comment.