Skip to content

Instantly share code, notes, and snippets.

@jon-kim
Last active December 20, 2021 10:54
Show Gist options
  • Save jon-kim/0f3ab7d88699077382dd28b70ea88326 to your computer and use it in GitHub Desktop.
Save jon-kim/0f3ab7d88699077382dd28b70ea88326 to your computer and use it in GitHub Desktop.
Auto Complete Location using Google Map API
<!DOCTYPE html>
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
</head>
<body>
<label for="locationTextField">Location</label>
<input id="locationTextField" type="text" size="50">
<script>
function init() {
var input = document.getElementById('locationTextField');
var autocomplete = new google.maps.places.Autocomplete(input);
}
google.maps.event.addDomListener(window, 'load', init);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment