It’s been a while, and it took me a while to get Google Maps Places to return only zip codes, so I’ll share a little code snippet so that you can fix it within a quick search!
const autocomplete = new google.maps.places.Autocomplete(deliveryCheck, {
types: ['postal_code'],
fields: ['address_components'],
componentRestrictions: { country: "us" }
});
Leave a Reply