简体   繁体   中英

Android Google Place Picker autocomplete not showing nearby places

I use Google Place API in my app and I have a little issue with Place Picker autocomplete feature.

The autocomplete feature does not show nearby places, but places all around the world. For example when I search mcdonald it will show me McDonalds in the USA whereas I'm in France.

The interactive map with its list of nearby places are working great on the other hand, I can see nearby places. The issue is only with autocomplete feature.

I tried to set a LatLngBounds to the builder, but the result is the same. The interactive map is affected by the LatLngBounds but the autocomplete feature is not.

I don't know if it is the normal beahvior or not, the documentation on Place Picker is not really precise and does not mention that.

And I didn't see either in the doc if there is an option to disable autocomplete feature.

Do you guys have some recommandations for me ?

Add location and radius parameters, and try searching again, eg;

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Mcdonalds&key=API_KEY&location=48.992899,%202.522523&radius=100000

For more information https://developers.google.com/places/web-service/autocomplete

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM