Get Latitude And Longitude From A Specific City Android
How could I select latitude and longitude for a specific city ? Actually, how could I get the city itself with its longitude and latitude. For example, I make an EditText where I d
Solution 1:
So you have basically asked 2 questions
1. Getting lat long from city name
Try this URL:
http://maps.google.com/maps/api/geocode/json?address=mumbai&sensor=false
The above URL returns the data in JSON format which then you can parse to get the corresponding lat long values.
2. Getting city name from lat long
Try this URL:
http://maps.googleapis.com/maps/api/geocode/json?latlng=44.4647452,7.3553838
Simply replace the lat long values in this URL. You can parse the JSON received to get the city name from this.
Post a Comment for "Get Latitude And Longitude From A Specific City Android"