react-native-google-autocomplete icon indicating copy to clipboard operation
react-native-google-autocomplete copied to clipboard

Location or radius does not work

Open georgeMorales opened this issue 6 years ago • 18 comments

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" >

georgeMorales avatar Jul 03 '19 20:07 georgeMorales

@JorgeMoralesLopez Can you try version 0.1.6 :)

EQuimper avatar Jul 04 '19 11:07 EQuimper

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!

georgeMorales avatar Jul 04 '19 11:07 georgeMorales

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

EQuimper avatar Jul 04 '19 11:07 EQuimper

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.

georgeMorales avatar Jul 04 '19 12:07 georgeMorales

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

EQuimper avatar Jul 04 '19 12:07 EQuimper

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

georgeMorales avatar Jul 04 '19 14:07 georgeMorales

No problem my mistake

EQuimper avatar Jul 04 '19 15:07 EQuimper

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.

georgeMorales avatar Jul 08 '19 10:07 georgeMorales

@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.

EQuimper avatar Jul 08 '19 10:07 EQuimper

@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!

georgeMorales avatar Jul 09 '19 09:07 georgeMorales

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

EQuimper avatar Jul 09 '19 11:07 EQuimper

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

georgeMorales avatar Sep 14 '19 18:09 georgeMorales

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.

JackJBlundell avatar Sep 15 '20 12:09 JackJBlundell

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

EQuimper avatar Sep 15 '20 13:09 EQuimper

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.

georgeMorales avatar Oct 08 '20 10:10 georgeMorales

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

JackJBlundell avatar Nov 05 '20 19:11 JackJBlundell

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

kkosheev avatar Dec 07 '20 03:12 kkosheev

I have changed to another API, sorry.

Get Outlook for iOShttps://aka.ms/o0ukef


From: fuzexjj [email protected] Sent: Monday, December 7, 2020 3:50:46 AM To: AppAndFlow/react-native-google-autocomplete [email protected] Cc: Jack Blundell [email protected]; Comment [email protected] Subject: Re: [AppAndFlow/react-native-google-autocomplete] Location or radius does not work (#22)

External email to Cardiff University - Take care when replying/opening attachments or links. Nid ebost mewnol o Brifysgol Caerdydd yw hwn - Cymerwch ofal wrth ateb/agor atodiadau neu dolenni.

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAppAndFlow%2Freact-native-google-autocomplete%2Fissues%2F22%23issuecomment-739646332&data=04%7C01%7Cblundelljj%40cardiff.ac.uk%7C7986c6f6076a43d5510d08d89a634877%7Cbdb74b3095684856bdbf06759778fcbc%7C1%7C0%7C637429098493352468%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yiRqGimV7pS3rvCywhOZljx0NOAC8R6sHfuTSQghf68%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMCWGWUFWCQYFDFGKWOSOX3STRGJNANCNFSM4H5JHWGQ&data=04%7C01%7Cblundelljj%40cardiff.ac.uk%7C7986c6f6076a43d5510d08d89a634877%7Cbdb74b3095684856bdbf06759778fcbc%7C1%7C0%7C637429098493362458%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ecqylaLFfUH2nxV1z9CJaUbXJWlYNBQNJGaTaiptG9o%3D&reserved=0.

JackJBlundell avatar Dec 07 '20 03:12 JackJBlundell