I'm using Google's Geocoder API to reverse geocode the current nearby location. When I was looking for a place in my country, somehow I will be redirected to another location with the same name in another country?
Is it possible to get the location of nearby places first before directing me to other place?
You may restrict the search to a specific country via the componentRestrictions
-property.
Example:
{'address': 'Philadelphia',componentRestrictions:{country:'de'}}
...instead of Philadelphia in the US the geocoder will return a small village in Germany with the name "Philadelphia"
https://maps.googleapis.com/maps/api/geocode/json?address=Philadelphia&components=country:de