Last active
August 29, 2015 13:59
-
-
Save sir4ju1/10921467 to your computer and use it in GitHub Desktop.
get location name using reverse geocoding by lattitude and longitude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var latlng = '40.714224,-73.961452'; | |
var url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng='+latlng+'&sensor=false'; | |
$.get(url, function(result, response) { | |
if(result.status === 'OK' && result.results.length > 0) { | |
var res = result.results[0]; | |
console.log(res.formatted_address); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment