From c503ac8c8c84db0e62158881ccf16eb1e9701af4 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Fri, 20 Aug 2021 15:23:34 +0200 Subject: [PATCH] refactor: remove boundary.circle support --- index.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/index.ts b/index.ts index 8389ab6..edf37b6 100644 --- a/index.ts +++ b/index.ts @@ -17,12 +17,7 @@ type Rect = { minLat: number minLon: number } -type Circle = { - centerPoint: number - radius: number -} type Boundary = { - circle?: Circle country: string rect: Rect } @@ -106,14 +101,6 @@ export function autocomplete({ query['boundary.rect.max_lat'] = boundary.rect.maxLat query['boundary.rect.max_lon'] = boundary.rect.maxLon } - /* Circle currently not supported in autocomplete - if (boundary.circle) { - const {lat, lon} = lonlat(boundary.circle.centerPoint) - query['boundary.circle.lat'] = lat - query['boundary.circle.lon'] = lon - query['boundary.circle.radius'] = boundary.circle.radius - } - */ } return run({ @@ -176,16 +163,6 @@ export function search({ query['boundary.rect.max_lat'] = boundary.rect.maxLat query['boundary.rect.max_lon'] = boundary.rect.maxLon } - if (boundary.circle) { - // The lonlat normalize method will not handle the single number - // centerPoint correctly. This output may be faulty - const { lat, lon }: LonLatOutput = normalize( - boundary.circle.centerPoint.toString() - ) - query['boundary.circle.lat'] = lat - query['boundary.circle.lon'] = lon - query['boundary.circle.radius'] = boundary.circle.radius - } } return run({ format, options, query, url })