Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PhoneSites autocomplete example
<script async
window.initMap= function(){
const input = document.querySelector('input[name="address"]');
const options = {
componentRestrictions: { country: "us" },
fields: ["address_components", "geometry", "icon", "name"],
types: ["establishment"],
const autocomplete = new google.maps.places.Autocomplete(input, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment