How to reverse geocoding
I am working on a开发者_如何学运维 web project and it that i know how to display google map using coordinates as follows
<img src="http://maps.googleapis.com/maps/api/staticmap?
center=15.999989,80.000099&zoom=14&size=600x600&sensor=true" />
but how i can perform reverse geocoding to get the location of that coordinates?
Let me google that for you: http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding
You make a JavaScript request to the following URL: http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false
and you will receive a JSON resonse with a list of possible locations. You then look through that list and decide wich of the locations is the one that you need (maybe you need the exact address with street number, but maybe in other cases the city's name will suffice).
精彩评论