Themes(onwheels): statistics now don't show too much items, fix #2366

This commit is contained in:
Pieter Vander Vennet 2025-04-07 03:29:27 +02:00
parent 7b7c747fd6
commit 5adf43a335
2 changed files with 8 additions and 22 deletions

View file

@ -25,22 +25,8 @@ export default class GeoIndexedStore implements FeatureSource {
*/
public GetFeaturesWithin(bbox: BBox): Feature[] {
const bboxFeature = bbox.asGeojsonCached()
return this.features.data.filter((f) => {
if (f.geometry.type === "Point") {
return bbox.contains(<[number, number]>f.geometry.coordinates)
}
if (f.geometry.type === "LineString") {
const intersection = GeoOperations.intersect(
BBox.get(f).asGeojsonCached(),
bboxFeature
)
return intersection !== undefined
}
if (f.geometry.type === "Polygon" || f.geometry.type === "MultiPolygon") {
return GeoOperations.intersect(f, bboxFeature) !== undefined
}
return GeoOperations.intersect(f, bboxFeature) !== undefined
})
return this.features.data.filter((f) =>
GeoOperations.completelyWithin(f, bboxFeature))
}
}