jshimko / meteor-geocomplete

Geocoding and Places Autocomplete Plugin
http://ubilabs.github.com/geocomplete/
44 stars 4 forks source link

Types option not working ? #6

Closed teknologist closed 9 years ago

teknologist commented 9 years ago

Hi,

As long as I don't specify types in options everything is fine. It uses the default ['geocode'] setting which outputs cities.

I want to search for food related places so I set
var options = { types: ["bakery","bar","cafe","food","restaurant","meal_takeaway","meal_delivery"] };

And then initialize my input with: $("#restaurantname").geocomplete(options);

It doesn't work and silently fails. no error in console or server logs whatsoever.

Could you please provide any help ?

Is this normal ?

teknologist commented 9 years ago

Found it!

Autocomplete only supports types from Table 3. https://developers.google.com/places/documentation/supported_types

Would be worth mentioning in the README....

jshimko commented 9 years ago

You beat me to it! After a half hour of screwing around, just found the same thing. :)

Updating the README now. Thanks!

jshimko commented 9 years ago

For what it's worth, you still have the Google Maps API loaded (via dburles:google-maps), so you could do a places search outside of the autocomplete context with the types you want.

teknologist commented 9 years ago

@jshimko Yep! Saw that but I like the autocomplete provided by Google. I'll see in the future if I have some time do my own places search autocomplete using Google Places API (searchText instead of bundled autocomplete), the thing is I am not sure what tool it is going to take on API quotas...

xpluscal commented 9 years ago

Speaking of types. Is there a way to access the "types" returned in the results? Thanks.