Improve typing
This commit is contained in:
parent
922cebf9d1
commit
adaff94dbd
1 changed files with 5 additions and 4 deletions
|
@ -45,15 +45,16 @@ export class BBox {
|
|||
])
|
||||
}
|
||||
|
||||
static get(feature): BBox {
|
||||
if (feature.bbox?.overlapsWith === undefined) {
|
||||
static get(feature: Feature): BBox {
|
||||
const f = <any>feature
|
||||
if (f.bbox?.overlapsWith === undefined) {
|
||||
const turfBbox: number[] = turf.bbox(feature)
|
||||
feature.bbox = new BBox([
|
||||
f["bbox"] = new BBox([
|
||||
[turfBbox[0], turfBbox[1]],
|
||||
[turfBbox[2], turfBbox[3]],
|
||||
])
|
||||
}
|
||||
return feature.bbox
|
||||
return f["bbox"]
|
||||
}
|
||||
|
||||
static bboxAroundAll(bboxes: BBox[]): BBox {
|
||||
|
|
Loading…
Reference in a new issue