简体   繁体   中英

Getting the Suggestions from the Current Location when working with Google Places API

I'm working with Google Places API which gives the auto suggestions from the keyword mentioned in AutoCompleteTextView . Its working fine.

But when i enter some keyword(some text in the AutoCompleteTextView) it was giving the places according to the Current Location . but i need the places from the United States

Using the following Url to get the places

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=?&types=geocode&sensor=false&AIzaSyAIjrt28Os8Eyp0rVQbdkKNXNi5YrGx0AE

Example

  • "New" text entered
  • Giving the places near to my CurrentLocation..(Places near current location)
  • Expected Places from the UnitedStates.. (NewYork, NewBerlin, NewLenox)

Please can i get any luck

Thank you

Refering to this article you can pass a location and a radius as parameter to your query which should be a solution to your problem. As location you could pass the middle of the United States and a radius that fits to all borders.

Taking this similar question into consideration this seems to be impossible other than the way I described it.

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