watsonbox / ios_google_places_autocomplete

Google Places address entry for iOS (Swift)
MIT License
269 stars 72 forks source link

Using current location with google places autocomplete #13

Closed rosothefox closed 9 years ago

rosothefox commented 9 years ago

Hey! Thanks a lot for your contribution. I wanted to ask 2 things:

1) Is there a way I can insert an option called "use current location -

"? which shows the user current physical address as an element in the table before all other results? Of course the device would have to ask permission from the user to know his location

2) Is there a way the list of results received in the table could be organized by the ones that are closest to the current location of the user? (again, with location permission)

Looking forward to your reply, thanks again

watsonbox commented 9 years ago

No the library does not support these things, although I'm sure it could be modified to do so. You'd have to give some thought to the user experience for showing current location since it can take a while (10+ seconds) for the iDevice to receive a GPS fix.

The Google Autocomplete API does support 'location biasing' which uses location and radius parameters to increase the rank of closer results.

rosothefox commented 9 years ago

Thanks for the reply! Do you know where can I add the 'location biasing' settings in your library in order for that to work? like making the example use 'location biasing' when giving the result list?

Thanks again

watsonbox commented 9 years ago

Please see new location biasing facility.