diff options
Diffstat (limited to 'src/Api/api.ts')
-rw-r--r-- | src/Api/api.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Api/api.ts b/src/Api/api.ts index 4c83252..1fd9435 100644 --- a/src/Api/api.ts +++ b/src/Api/api.ts @@ -153,11 +153,11 @@ const pointToTileId = (x: number, y: number, params: TileParameters): string => return params.zoom + "_" + x + "_" + y + "_" + params.level + "_8_100"; } -const getZoomByRegion = (width: number, region: Region): number => { +export const getZoomByRegion = (width: number, region: Region): number => { return Math.ceil(Math.log2(360 * ((width / 256) / region.longitudeDelta))) + 1 } -const getDataZoomForMapZoom = (zoom: number): number => { +export const getDataZoomForMapZoom = (zoom: number): number => { if (zoom > 21) { zoom = 21; } @@ -223,9 +223,9 @@ const getEntities = (tileKeys: string[], params: RequestParams): Promise<GetEnti "body": JSON.stringify({ tileKeys, v: params.v }), "method": "POST", }) - return timeout(10000, promise.then(r => { + return timeout(30000, promise.then(async r => { if (r.status != 200) { - return { result: { map: {} } } + throw Error(r.statusText) } return r.json() })) |