I’m having trouble figuring out how to use the Google Places API.
I’m trying to create a search application, where the user inputs their city and then is presented a list of nearby locations of various types (ex. art_gallery, book_store, amusement_park, etc).
I would like to present the results in a repeating group.
Inside that repeating group i would like to display the Name of the place, a short description, and a photo. Something like this, but without the share and learn more button
I’m having trouble figuring out how to pass the Google Places data to each individual element. I’m not even sure if i’m setting up my repeating group correctly.
I’m still having trouble figuring out how to retrieve a list of google places inside a repeating group.
What i’m trying to do is as follows:
A user types a city in a search bar.
When the user clicks search.
I would like to do a Nearby Search Request for certain types of places (example: art_gallery, and aquariums), in and around the city that the user has entered.
Inside my repeating group i will have three visual elements. One visual element will display a Place Photo of the current cells google place. The second element will display the name of the current cells google “Place” (example - Pleiades Gallery). The third visual element will display a short description(summary information) of that “Place” (example - Pleiades Gallery is located in the heart of Chelsea, the vibrant and rapidly growing center of the visual arts in New York City - or whatever short description(summary information) Google Places API has stored in their database).
Example:
For example a user types in New York City in the search bar, then my application would do a nearby search for all the art_gallery(s), and aquariums in or near that city. It would return a list of specific google place types (art_gallery(s) and aquariums). In a repeating group, three elements will be displayed in each cell. One element will display the place photo, the second element will display the place name; and, the third element will display a short description(summary information) about the place.
If this is possible, would you be able to explain to me the step by step process on how to accomplish this.
I have updated that page, and it sort of works. But there are a couple of issues …
The type list in Bubble isn’t the full list in Google, so you don’t have gallery for example.
I am not sure that the Text Search is the right thing to be using here, it is more likely that the Places API you want is the Nearby search. The text search needs a query parameter (it is like a “Cafes Near Me” Google Search).
So you can sort of do what you want by doing a text search for “Gallery” (as I have done). But what you really want, I think, is for a Nearby search to be implemented as well.
Maybe am missing something, so over to @emmanuel ?
What i can see on the app is that you’re trying to get a photo of a google place, but it’s not something that is returned by Google (at least not with our current plugin). Adding Photo by hand after ‘current cell’s google place’ won’t solve that…
Generally speaking, if you see something red in the editor, that means there is something fishy going on.
Think there are a couple of issues. Will email if it isn’t clear.
Yes, description and photos are not returned in the current API, although it looks like the Photos might be available ?
The API that we are using here seems to be the “Text Search” one, but I think it would be very useful to also have the “Radar Search”. This may well be a feature request !
As it stands the Type list on the Text Search doesn’t have the complete list of possible types. So that is maybe a bug ?
If Google returns such data (can you check), can you email us at support and we’ll look into it. Adding more fields is probably easy, adding Radar search is a bigger project.
What do you mean by “As it stands the Type list on the Text Search doesn’t have the complete list of possible types. So that is maybe a bug ?”?