This commit is contained in:
Pieter Vander Vennet 2024-12-12 01:55:25 +01:00
parent fe2a6ca065
commit 83a918477f

View file

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