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

Location or radius does not work #22

Open
georgeMorales opened this issue Jul 3, 2019 · 18 comments
Open

Location or radius does not work #22

georgeMorales opened this issue Jul 3, 2019 · 18 comments
Labels
bug Something isn't working

Comments

@georgeMorales
Copy link

georgeMorales commented Jul 3, 2019

Location or radius does not work... @EQuimper, could you tell me what I'm doing wrong?
<GoogleAutoComplete apiKey={API_KEY} debounce={500} minLength={3} language="es" queryTypes="establishment" location="37.1848024, -5.7753099" radius="35000" components="country:es" >

@EQuimper
Copy link
Member

EQuimper commented Jul 4, 2019

@JorgeMoralesLopez Can you try version 0.1.6 :)

@georgeMorales
Copy link
Author

I have tried in all possible ways, radius = {20000} the console throws at me Warning: Failed prop type: Invalid prop radius of type number supplied to GoogleAutoComplete, expected string, I do not know how to put location location = "37.1848024, -5.7753099", or location = {{lat: 37.1848024, lng: -5.7753099}}
I have the version "^ 0.1.5" installed, I will try the one you tell me.
Thank you!

@EQuimper
Copy link
Member

EQuimper commented Jul 4, 2019

yes this one also take the version as a string. So you can do radius="35000"

@georgeMorales
Copy link
Author

I have installed version 0.1.6 and location does not work. Do not have any examples with radius and location working? He already tried it.

@EQuimper
Copy link
Member

EQuimper commented Jul 4, 2019

@JorgeMoralesLopez the version 0.1.6 was just a fix for radius. I'm currently working on the location right now

@EQuimper EQuimper added the bug Something isn't working label Jul 4, 2019
@georgeMorales
Copy link
Author

Ok, I did not understand well ... Thanks!

@EQuimper
Copy link
Member

EQuimper commented Jul 4, 2019

No problem my mistake

@georgeMorales
Copy link
Author

Please, when it is fixed, let me know, and if it is going to cost you a lot of time also to be able to look for another alternative. It is a feature that I need urgently.

@EQuimper
Copy link
Member

EQuimper commented Jul 8, 2019

@JorgeMoralesLopez Can you try version 0.1.7

I add props call latitude lat: number longitude lng: number if one is pass both are need.

@georgeMorales
Copy link
Author

@EQuimper, now if the location works. But the radius does not work, it appears in the list very distant establishments.
Radius tried it as a string and as a number.
I appreciate your effort!

@EQuimper
Copy link
Member

EQuimper commented Jul 9, 2019

Can you give me a picture of the response you get and the props you pass if possible. So location work just the radius ?

@georgeMorales
Copy link
Author

georgeMorales commented Sep 14, 2019

Sorry I didn't see this last message, summer is a crazy thing ...
Thank you!
Only the first result enters the range, radius ... The others do not.
It is true that the first is the closest.
Other...
If I put queryTypes = "establishment" and in the search engine I put a street, shouldn't streets go out if not establishments just not?
screenShot_radius

@JackJBlundell
Copy link

Hi there, this is an issue I am also facing.

When passing the prop radius, I am able to see inside of the react-native-google-autocomplete/dist/GoogleAutoComplete.js that the radius is being passed (And can be logged to the console).
However this makes no difference, i get a list of global addresses, using version 0.1.6 currently.

@EQuimper
Copy link
Member

I will check for the issue. Maybe google did change something with their api. Will check that

@georgeMorales
Copy link
Author

Yes, the radio feature doesn't work because searches for very far places appear by putting radius = "50000" for example. If this could be fixed it would be great.

@JackJBlundell
Copy link

Has this been fixed? Sorry to be a pain this is a vital part of the API though

@kkosheev
Copy link
Contributor

kkosheev commented Dec 7, 2020

According to the Places API:

Location restrict
You may also restrict results to the region defined by location and a radius parameter, by adding the "strictbounds" parameter. This instructs the Place Autocomplete service to return only results within that region.

Otherwise, you would get only prefered result by location and radius but not restricted by the area.

I will try to make PR

@JackJBlundell
Copy link

JackJBlundell commented Dec 7, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants