forked from MapComplete/MapComplete
Themes(onwheels): statistics now don't show too much items, fix #2366
This commit is contained in:
parent
7b7c747fd6
commit
5adf43a335
2 changed files with 8 additions and 22 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue