slimkrazy / python-google-places

Simple wrapper around the new 'experimental' Google Places API
MIT License
461 stars 167 forks source link

types list is deprecated by Google Place API for a long now. #111

Open SBillion opened 6 years ago

SBillion commented 6 years ago

Don't make types required when using rankby='distance' if type is present. Use all builtin to check multiple variable to None Modify documentaiton on nearbysearch method.

danielsp3000 commented 6 years ago

There is a bug with this modification. Try this

lat_lng = {'lat': 45.522217, 'lng': 9.214968}
query_result = google_places.nearby_search(
        lat_lng=lat_lng, radius=30, rankby='distance', types=[types.TYPE_RESTAURANT])

this returns only restaurants, while if we use

`lat_lng = {'lat': 45.522217, 'lng': 9.214968}
query_result = google_places.nearby_search(
        lat_lng=lat_lng, radius=30, rankby='distance', **type**=[types.TYPE_RESTAURANT])`

it returns also a clothing store.