Created
May 8, 2020 17:12
-
-
Save iamcanadian1973/496d1a34610b16a0624239e0568f29f2 to your computer and use it in GitHub Desktop.
GEO Code address
This file contains 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 geocoder = new google.maps.Geocoder(); | |
var address = '90001'; | |
geocoder.geocode({'address': address}, function(results, status) { | |
if (status === 'OK') { | |
var latitude = results[0].geometry.location.lat(); | |
var longitude = results[0].geometry.location.lng(); | |
console.log(latitude + ',' + longitude); | |
} else { | |
console.log('Geocode was not successful for the following reason: ' + status); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment