Forum Academy Marketplace Showcase Pricing Features

[New Feature] Geographic search box improvements

Hi @dan1 … I have the same situation as you and the same thing is happening to me. Try adding “formatted address” to the “Limit results around” as in the screenshot below:

searchbox

This solved the problem of displaying the results, but the results are not narrowed down by the set radius. So that is, even if I set my radius to 100 meters, the search box will display results in other countries.

1 Like

@leonidas.petrou4 - thanks for the suggestion. Seeing the same thing on my end. (Current geographic position’s formatted address yields results, but does not actually apply the radius). Pre-defined addresses (ex. current place’s address) does not yield results.

I’m thinking there’s still something amiss here. Eager to hear from any others if they have their own Google Maps API keys and are able to implement successfully.

@petter, @NigelG, @keith? Any luck?

1 Like

This may be similar to the recent problem with Google Timezone API. Bubble was only signing calls when using Bubble’s key. It was oddly broken when using one’s own key.

There’s some sort of bug here. @Jici built demo projects that show this in another thread. I think it’s busted at the moment and Bubble needs to look at it.

4 Likes

@dan1
Haven’t had a chance to test this with my own keys, but did a quick test with Bubble’s keys, and the geographical constraint doesn’t seem to apply. It shows results from all over the world.

1 Like

Location restriction works well for me using Bubble’s API key, but not using my own Google API key (which returns results from across the world).

Interestingly, adding “formatted address” actually breaks the restriction for me (ie restriction only works without it).

1 Like

We have updated search results behavior to be more consistent with and without key.

Regarding the radius constraints not applying in some cases, we ran multiple tests and the issue appears to be Google API overriding constraints.

Thanks Neerja. I think there’s some problem when your users are using their own domain.

Using my own domain, it’s still not working for me (using location restriction I get autocomplete results when I don’t input my Google API key into Bubble, but I get no results when I do input it).

However, when I remove my own domain it works fine.

Any chance of a fix?

@george111 Adding your own domain should not impact results. And with the latest fix, you should be able to see the same results with and without key. Try without a custom domain but with key and if you see results, then try with domain and check console for errors.

Thanks - this is helpful.

On my own domain I’m getting this error in the console: “This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console” - however the Google key is definitely enabled (and unrestricted to any particular domain).

Have you seen this problem before? Any tips?

Aha I think I’ve spotted the problem. My key was enabled for “Maps” but not for “Places”. Have now enabled and things seem to be working fine. Thanks for your help :slight_smile:

1 Like

@george111, yes, you’re on the right path. Since others may encounter the same, sharing my walkthroughs on Google Maps APIs here.

  • If you’re setting up your Google Maps projects (er, API key(s)) for the first time. watch this one.
  • If you need to enable additional Google Maps APIs on a project (er, API key(s)) that has already been set up, watch this one.

Can you find a way to make the chosen address from the search box to show the place name only, rather than the whole address?

2 Likes

@aphz88, I just discovered that you can extract an address to all the separate parts of the address.

1 Like

@mike_verbruggen, one of my favorite (somewhat hidden) features! @aphz88, the video below provides a bit more context if you want to explore further.

2 Likes

Thank you for this, but I am looking for a way to get the place name, so for instance the current functioning means that someone can search for Googleplex or Google Campus in the searchbox and the result is 1600 Amphitheatre Pkwy, Mountain View, CA 94043. While Bubble gives you the various options that you demonstrate in the video, it doesn’t give the option to extract the place name, which would be Google Campus or Googleplex.

I think my users would prefer just having the place name. Wrigley Field looks a lot cleaner than 1060 W Addison St, Chicago, IL 60613.

But you bring up an interesting point to save it as an address. Would it be possible to use an additional plugin to then look up the saved address and find the place name? I haven’t found a cheap or free plugin that would do this though.

Looks like the easiest way to do that is just grab “name” from your own call to Google Places:

https://developers.google.com/places/web-service/details

(If “name” isn’t something returned by Bubble’s implementation of Google Places API… NOTE: I do not use Bubble’s implementation of Google Places, nor do I use my own implementation of Google Places API. It’s just that their docs seem pretty clear on what can be returned. I use plenty of Google geocoding service, etc.)

1 Like

Is the Google Places API expensive?

Google’s documentation covers this. Is your Google broken?

https://developers.google.com/places/web-service/usage-and-billing

2 Likes

Hello,

I read the docs, but is it easy to extract the name value of the SearchBox easy ? I don’t find the solution…

Thank you so much if you have any idea !

Charles

1 Like

Still having the same issue March 2021. When you add the formatted as address it doesn’t work. So I’ve created an invisible text field that takes the result and then formats it as address. Having other issues though, outside the scope of this thread.