Skip to content

Commit 8d36b7d

Browse files
Throw exception if using not-yet-supported CRS with findFlyovers()
1 parent 9d7694e commit 8d36b7d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/layer/AbstractLayer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import area from '@turf/area';
99
import union from '@turf/union'; // @turf/union is missing types definitions, we supply them separately
1010

1111
import { Polygon, MultiPolygon } from '@turf/helpers';
12+
import { CRS_EPSG4326 } from 'src/crs';
1213

1314
export class AbstractLayer {
1415
public title: string | null = null;
@@ -60,6 +61,10 @@ export class AbstractLayer {
6061
throw new Error('Orbit time is needed for grouping tiles into flyovers.');
6162
}
6263

64+
if (bbox.crs !== CRS_EPSG4326) {
65+
throw new Error('Currently, only EPSG:4326 in findFlyovers');
66+
}
67+
6368
let tiles: Tile[] = [];
6469
for (let i = 0; i < maxFindTilesRequests; i++) {
6570
const { tiles: partialTiles, hasMore } = await this.findTiles(

0 commit comments

Comments
 (0)