How to get address location from latitude and longitude in Google Map.?

So, I have latitude and longitude like 44.4647452 and 7.3553838 . I need to get the address: Milan, Italy, st. Kennedy 89.

How can i do this?

+63
javascript php google-maps
Oct 22 '13 at 7:25
source share
3 answers

Just pass the latitude, longitude and your Google API key to the next line of the request, you will get a json array, from there you will get your city.

https://maps.googleapis.com/maps/api/geocode/json?latlng=44.4647452,7.3553838&key=YOUR_API_KEY

Note. Make sure there are no spaces between the latitude and longitude values ​​when passing in the latlng parameter.

Click here to get an API key.

+136
Oct 22 '13 at 7:28
source share
— -

What you are looking for is reverse geocoding. Take a look here for this example. https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse

+16
Oct 22 '13 at 7:28
source share

You have to make one ajax call to get the desired result, in which case you can use the Google API to get the same

 http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true/false 

Create this url type and replace lat long with the one you want. make a call and answer in JSON, parse JSON and you will get the full address to street level

+7
Oct 22 '13 at 7:28
source share



All Articles