forked from MapComplete/MapComplete
Fix: fix #2309
This commit is contained in:
parent
fe2a6ca065
commit
83a918477f
1 changed files with 4 additions and 5 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue