Skip to content

Instantly share code, notes, and snippets.

@key
Created January 21, 2012 02:16
Show Gist options
  • Save key/1650808 to your computer and use it in GitHub Desktop.
Save key/1650808 to your computer and use it in GitHub Desktop.
How to use Google Maps API geocoder
var address = "Shinagawa station"
var geocoder = new google.maps.Geocoder();
geocoder.geocode({'address': address}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var location = results[0].geometry.location;
} else {
alert("Unable to find address: " + status);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment