Google Places API - about to give up!


So I had the basic functionality of my app totally working using the Bubble Google Places plugin, however, I need some types of information for places that aren’t available with the bubble plugin.

Basically, what I need to happen is for a user to select a “trip” that they’ve already created, which has a location associated with it (an “address” such as “New York, NY”).

When the user selects this “trip” and enters a keyword into the search box, the map will do a nearby search for that area.

Then, the user can select a marker, and add that place to their “trip”.

The problem is that with the Google Places API, at least two different calls need to be made. First, a call needs to be made to do a nearby search, which will return a “place id”. The problem is that this call requires a “location” which is a latitude/ longitude. I can’t figure out how to convert the “address” that the user enters into coordinates.

The second call is made to retrieve the place details, using the place id.

Does anyone have any experience with this or any ideas on how this can be done? I think that it might require a call with the Geocoding API, but I can’t figure out how to link it all together.

Another possibility that I thought of was to somehow use Bubble’s plugin to search for and select the place, and then the Places API to retrieve all of the details.

Thank you so much!

Don’t give up :slight_smile:

This is definitely possible, will dig out the page where I did pretty much exactly this, pull back the details from Google Place.

You can get to Lat/Long by putting the address in a field with the type of Geographic address, and the doing a addressfield’s : Lattitude or :Longitude

But you can also do it by using the PlaceId.

Yes @NigelG is right. Just keep trying and you will get it. Also if you looking for place details then use my plugin “Google Maps API” you should be able to do most of the things you need without having to go through the trial and error phase.

Let me know if you need help.

I’ve done this. Did you put the key into the GET directly? That worked for me.
Since the API returns the lat/lang, you can convert them to an address within bubble.