This commit is contained in:
Pieter Vander Vennet 2024-12-12 01:54:36 +01:00
parent b47d0f8c6a
commit fe2a6ca065
2 changed files with 10 additions and 6 deletions

View file

@ -68,16 +68,17 @@ export class BBox {
*
*/
static get(feature: Feature): BBox {
const f = <any>feature
if (f.bbox?.overlapsWith === undefined) {
if (feature.bbox?.["overlapsWith"] === undefined) {
const [minX, minY, maxX, maxY]: number[] = turf.bbox(feature)
// Note: x is longitude
f["bbox"] = new BBox([
// @ts-ignore
feature["bbox"] = new BBox([
[minX, minY],
[maxX, maxY],
])
}
return f["bbox"]
// @ts-ignore
return feature["bbox"]
}
static bboxAroundAll(bboxes: BBox[]): BBox {