Skip to content

Commit

Permalink
refactor: remove boundary.circle support
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Aug 20, 2021
1 parent 165129c commit c503ac8
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ type Rect = {
minLat: number
minLon: number
}
type Circle = {
centerPoint: number
radius: number
}
type Boundary = {
circle?: Circle
country: string
rect: Rect
}
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit c503ac8

Please sign in to comment.