Chore: housekeeping

This commit is contained in:
Pieter Vander Vennet 2025-08-13 23:09:49 +02:00
parent 69ab755f29
commit 7acddc7281
8 changed files with 84 additions and 88 deletions

View file

@ -3,59 +3,47 @@ import { describe, it } from "vitest"
import StaticFeatureSource from "../../../src/Logic/FeatureSource/Sources/StaticFeatureSource"
import {
ClusterGrouping,
ClusteringFeatureSource
ClusteringFeatureSource,
} from "../../../src/Logic/FeatureSource/TiledFeatureSource/ClusteringFeatureSource"
import { UIEventSource } from "../../../src/Logic/UIEventSource"
import { expect } from "chai"
const points: FeatureCollection<Point> = {
"type": "FeatureCollection",
"features": [
type: "FeatureCollection",
features: [
{
"type": "Feature",
"properties": {name: "a"},
"geometry": {
"coordinates": [
9.759318139161195,
55.56552169756637
],
"type": "Point"
}
type: "Feature",
properties: { name: "a" },
geometry: {
coordinates: [9.759318139161195, 55.56552169756637],
type: "Point",
},
},
{
"type": "Feature",
"properties": {name: "b"},
"geometry": {
"coordinates": [
9.759768615515327,
55.56569930560951
],
"type": "Point"
}
type: "Feature",
properties: { name: "b" },
geometry: {
coordinates: [9.759768615515327, 55.56569930560951],
type: "Point",
},
},
{
"type": "Feature",
"properties": {name: "c"},
"geometry": {
"coordinates": [
9.75879327221594,
55.56569229478089
],
"type": "Point"
}
type: "Feature",
properties: { name: "c" },
geometry: {
coordinates: [9.75879327221594, 55.56569229478089],
type: "Point",
},
},
{
"type": "Feature",
"properties": {name: "d"},
"geometry": {
"coordinates": [
9.759380131319915,
55.56507066300628
],
"type": "Point"
}
}
]
type: "Feature",
properties: { name: "d" },
geometry: {
coordinates: [9.759380131319915, 55.56507066300628],
type: "Point",
},
},
],
}
describe("ClusteringFeatureSource", () => {
@ -65,7 +53,7 @@ describe("ClusteringFeatureSource", () => {
// On zoomlevel 19, all points are in a different tile
const clusteringSource = new ClusteringFeatureSource(source, zoom, "test", {
cutoff: 2,
dontClusterAboveZoom: 100
dontClusterAboveZoom: 100,
})
const allClusters = ClusterGrouping.singleton.features
expect(allClusters.data.length).to.eq(0)
@ -76,9 +64,5 @@ describe("ClusteringFeatureSource", () => {
expect(allClusters.data.length).to.eq(1)
expect(allClusters.data[0].properties["total_metric"]).to.eq("4")
expect(clusteringSource.features.data.length).to.eq(0)
})
})