BBox bounds can not be bigger then the entire world anymore, fixes performance issues

This commit is contained in:
Pieter Vander Vennet 2021-10-01 01:33:07 +02:00
parent 24f0089e57
commit c31a50b139

View file

@ -22,6 +22,13 @@ export class BBox {
this.minLon = Math.min(this.minLon, coordinate[0]);
this.minLat = Math.min(this.minLat, coordinate[1]);
}
this.maxLon = Math.min(this.maxLon, 180)
this.maxLat = Math.min(this.maxLat, 90)
this.minLon = Math.max(this.minLon, -180)
this.minLat = Math.max(this.minLat, -90)
this.check();
}