Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radius lookup bug #20

Open
modernrockstar opened this issue Jan 22, 2018 · 2 comments
Open

Radius lookup bug #20

modernrockstar opened this issue Jan 22, 2018 · 2 comments

Comments

@modernrockstar
Copy link

When using the radius lookup, it will return all the available zip codes for non-existent zip lookups.

For example '00000' or an invalid value an alpha-numeric string.

${this.state.userZipcode} = '000000'
${this.state.searchRadius} = '10'

const nearbyZipcodes = zipcodes.radius(${this.state.userZipcode}, ${this.state.searchRadius}); //returns 44K results

@SunilHirole
Copy link

SunilHirole commented Apr 2, 2018

@modernrockstar You can use lookup method to check whether zipcode exists or not.
For example
let isZipcodeExist = zipcodes.lookup(92084);

This method returns object like this. From this we can easily check whether zipcode exist or not
{zip: "92084", latitude: 33.2131, longitude: -117.2243, city: "Vista", state: "CA","country:"US"}

This is just a workaround.

@ChuckJonas
Copy link

This also happens if you pass an actual Zipcode object in (instead of the #####). Extra confusing in typescript because the method signature specifics passing in the object instead of a string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants