[Vuejs]-Location predictions and .getPlace() using Google Maps loader for Place Autocomplete not working in Vue

0👍

Everything was correct, the error was in the options object. Instead of type: cities, it should have been type: address (at least for my purposes). Using @googlemaps/js-api-loader worked great and is a superior solution to adding the script tag in index.html. For reference to those that follow, one can also just use an anonymous function as seen in the docs, autocomplete docs example. Also, be cautious of typos. It is very easy to type ‘AutoComplete’ instead of how it should be, ‘Autocomplete’. The docs for the api loader are very sparse, I’m still not sure if there is a callback field. other than that, this example should get you going.

Leave a comment