1

I need to get the latitude and longitude for a string which consists of areaname,cityname,statename and countryname using google maps api v3... How is it posssible ?

Ree
  • 141
  • 1
  • 4
  • 15
  • possible duplicate of http://stackoverflow.com/questions/4478316/how-to-convert-location-name-to-location-coordinates/6124099 – Colin Pickard Apr 05 '13 at 09:13
  • @Colin Pickard its not duplicate .... what u pointed out is how to convert latlng to city name ? ... am asking reverse of that !!! i need city name to latlng – Ree Apr 05 '13 at 09:35
  • Yeah, I updated my answer and comment when I realised I had read your question the wrong way round - it should be correct now. cityname to latlong is called **geocoding** and latlong to cityname is called **reverse geocoding**. – Colin Pickard Apr 05 '13 at 09:40

1 Answers1

3

This is called Geocoding.

Here's an example request. You need to separate the 4 sections of your location by commas:

http://maps.googleapis.com/maps/api/geocode/json?address=Kemp+Town,+Brighton,%20East%20Sussex,+UK&sensor=true
Colin Pickard
  • 45,724
  • 13
  • 98
  • 148
  • How to send variables in this api ? how to store the values ? will it return a json object ? – Ree Apr 05 '13 at 09:51