Auto-fill locations by housing type and location

I want the Googles auto-complete offer to only display a list of places and locations. I basically tried to get the type of housing to work, but no suggestions came up.

When I remove ac_options from the autoComplete variable, everything works fine, but of course, none of the sentences are narrowed 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); 
+6
source share
1 answer

I do not think that accommodation is an acceptable option, according to the following link ...

https://developers.google.com/maps/documentation/javascript/places#places_autocomplete

Instead, you should try ...

https://developers.google.com/maps/documentation/javascript/examples/places-queryprediction

instead of "pizza nearby" in the example, use "housing" ... :)

+5
source

All Articles