Skip to content

Instantly share code, notes, and snippets.

@leocaseiro
Created June 13, 2014 02:40
Show Gist options
  • Save leocaseiro/5cbd8ea44e9f9612c292 to your computer and use it in GitHub Desktop.
Save leocaseiro/5cbd8ea44e9f9612c292 to your computer and use it in GitHub Desktop.
function codeAddress(address) {
geocoder = new google.maps.Geocoder();
geocoder.geocode({
'address': address
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var myOptions = {
zoom: 14,
center: results[0].geometry.location,
disableDoubleClickZoom: true, //not zoom
draggable: false //not drraggable
}
map = new google.maps.Map(document.getElementById("map-aid"), myOptions);
}
});
}
//usage:
codeAddress("REDFERN, NSW 2016")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment