forked from MapComplete/MapComplete
Fix: don't use deprecated bbox format anymore
This commit is contained in:
parent
46a8845f29
commit
a59e4ab2ab
1 changed files with 7 additions and 1 deletions
|
@ -78,6 +78,9 @@ export class BBox {
|
||||||
*/
|
*/
|
||||||
static get(feature: Feature): BBox {
|
static get(feature: Feature): BBox {
|
||||||
const f = feature
|
const f = feature
|
||||||
|
if (f.bbox?.["minLat"] !== undefined) {
|
||||||
|
delete f.bbox
|
||||||
|
}
|
||||||
if (!f.bbox) {
|
if (!f.bbox) {
|
||||||
f.bbox = <[number, number, number, number]>bbox(f)
|
f.bbox = <[number, number, number, number]>bbox(f)
|
||||||
}
|
}
|
||||||
|
@ -288,8 +291,11 @@ export class BBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expands the BBOx so that it contains complete tiles for the given zoomlevel
|
* Expands the BBox until it contains complete tiles for the given zoomlevel
|
||||||
* @param zoomlevel
|
* @param zoomlevel
|
||||||
|
* const bbox = new BBox([3.7140459, 51.071849, 3.7140459, 51.071849])
|
||||||
|
* const expanded = bbox.expandToTileBounds(15)
|
||||||
|
* !isNaN(expanded.minLat) // => true
|
||||||
*/
|
*/
|
||||||
expandToTileBounds(zoomlevel: number): BBox {
|
expandToTileBounds(zoomlevel: number): BBox {
|
||||||
if (zoomlevel === undefined) {
|
if (zoomlevel === undefined) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue