Skip to content

Commit

Permalink
Debug distribution of counts a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Oct 4, 2023
1 parent 25cc27e commit 6a5388e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions viewer/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,23 @@
let id = feature.properties.way;
window.open(`http://openstreetmap.org/way/${id}`, "_blank");
}
$: if (map) {
map.on("moveend", () => {
let counts = [];
// TODO To be paranoid, dedupe by feature ID;
for (let f of map.queryRenderedFeatures(null, {
layers: ["input-layer"],
})) {
counts.push(f.properties.count);
}
let min = Math.min(...counts);
let max = Math.max(...counts);
let count = counts.length;
// TODO Displaying a histogram could be helpful, at least to debug
console.log({ min, max, count });
});
}
</script>

<Layout>
Expand Down

0 comments on commit 6a5388e

Please sign in to comment.