google-maps-loader
google-maps-loader copied to clipboard
country autocomplete
from google APIS doc
const autocomplete = new google.maps.places.Autocomplete(input);
// Set initial restrict to the greater list of countries.
autocomplete.setComponentRestrictions({
country: ["us", "pr", "vi", "gu", "mp"],
});
when I try this it gives me undefined for the places the Error
Uncaught (in promise) TypeError: Cannot read property 'Autocomplete' of undefined
at GoogleMapsScriptLoader
Hello, did you include the places library?
const loader = new Loader('my-api-key', {
libraries: ['places'],
});