I'm using the Google Maps/Places javascript API for autocompletion of locations in an input box. I'm trying to restrict the types of places that are being returned by the autocompletion. I'm very new to coffeescript (and coding in general), but since I have the code snippet here I wanted to see if anyone can see anything in this code that might be causing the call to Google to not consider the place "types" filter. Note that "restaurants" was just used as a test (an unsuccessful one).
I've read through several other questions on here, amongst them: How can I restrict the Google Maps Places Library's Autocomplete to suggestions of only one city's places? How to limit google autocomplete results to City and Country only
Unfortunately, it looks like the syntax I'm using is correct, which is why I'm asking this question because no matter which "type" I use the autocompletion results do not change.
Thanks for any help.
# autocomplete callback
autocomplete_options = {
types: ['restaurants'] # geocode, establishment, (regions), (cities)
}
autocomplete = new google.maps.places.Autocomplete(document.getElementById 'locationSearchField', autocomplete_options)
google.maps.event.addListener autocomplete, 'place_changed', ->
place = autocomplete.getPlace()