Reputation: 1180
I'm using java sdk Geocoding Google Api, to fetch Geocoding information using address.
When I use google maps UI, and enter "1 rue de Paris" I get multiple results in different cities and was expecting the sdk to return more than 1 result also but it's only returning 1.
My code:
GeocodingResult[] results = GeocodingApi.geocode(context, "1 rue de Paris").await()
results
contains only 1 element.
what did I miss?
Upvotes: 1
Views: 510
Reputation: 5691
When you say "google maps UI", are you talking about the Place Autocomplete list of place suggestions you get when you type in this address in Google Maps?
If so, note that what you're using is Geocoding API, not Places API. Geocoding is meant to be used for converting addresses into coordinates and vice-versa, and often returns only 1 place.
If you want to get a list of places, use the Autocomplete service:
Hope this helps!
Upvotes: 1