I need a function to get an nearest address or city from coordinates(lat,long) using google map api reverse geocoding and php… Please give some sample code
I need a function to get an nearest address or city from coordinates(lat,long) using
Share
You need to use the getLocations method on the GClientGeocoder object in the Google Maps API
EDIT: Ok. You are doing this stuff server side. This means you need to use the HTTP Geocoding service. To do this you will need to make an HTTP request using the URL format described in the linked article. You can parse the HTTP response and pull out the address:
N.B. The Google Maps terms of service explicitly states that geocoding data without putting the results on a Google Map is prohibited.