I want Googles autocomplete suggestion to only list lodgings and locations. I've mostly been trying to get the lodging type to work however no suggestions ever appear.
When I remove ac_options from the autoComplete variable everything works fine but ofcourse none of the suggestions are narrowed down by a specific type.
var ac_options = {
types: ['lodging']
};
var input = document.getElementById(this.options.autoCompleteInputId);
var autocomplete = new google.maps.places.Autocomplete(input, ac_options);
//bind to input field
autocomplete.bindTo('bounds', this.gmap);
I don't think lodging is valid option, as per following link...
https://developers.google.com/maps/documentation/javascript/places#places_autocomplete
You should try following instead...
https://developers.google.com/maps/documentation/javascript/examples/places-queryprediction
in place of "pizza near" in example use "lodging"...:)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With