Last active
August 29, 2015 14:13
-
-
Save basselin/d17c89cf51aad76dbca2 to your computer and use it in GitHub Desktop.
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 gMapsApi = window.google.maps; | |
var map = new gMapsApi.Map(/*...*/); | |
var geocoder = new gMapsApi.Geocoder(); | |
geocoder.geocode({ address:$('[name="q"]').val() }, function(results, status) { | |
if(status == gMapsApi.GeocoderStatus.OK) { | |
map.setCenter(results[0].geometry.location); | |
} 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