I am struggling with this “prefer results around” option…
I am trying to limit results to a specific country (France in my case) but when I enter “France” in “Prefer results around” no matter the value of the radius (I’ve tried different values including 0) I always get results from countries located thousands of miles/km from France including Canada, Vietnam etc.
Is that feature really working ? What am I doing wrong ? Does anyone know of a workaround to limit the searchbox results to a given country, region or city ?
It worked for me by entering a Post Code of some place in my city and it recognised and autocompleted the city and the country in the “Prefer results around” field
Good for you… or was it luck?
I’ve tried that for France using your 100m radius value…and many other values but got no difference at all >> still showing results from all around the world
Hi, did you actually manage to get it to work properly?
Apparently we’ve all tried that to no avail… would appreciate further details / specifics from your working use case to help us see the light
Just found how we can make this work!
First: The “Results around” only receives address, not text. Will not work if you put “Arbitrary text”, and put a static value like “10001 New York”.
What you have to do, instead is:
Create one hided element, property or custom state with datatype = geo address.
Manually populate your thing 1 with your static address (India, EUA, New York…)
Use your thing 1 as “results around” in your main search for address
Thanks @caiokaspary ! This is what I was missing, you’ve made my day
I was typing or refering to a city / country name in [Prefer results around] field and it just didn’t seem to work… now I refer to a geographic-address-type custom state and it works like a charm!
I guess the documentation for this searchbox could be improved… or there could be a control that should prevent using anything else than a geographic address type in that field to avoid any misunderstanding.
I’m speculating but you should also be able to specify a latitude and longitude. Bubble likely converts your entered location into a latitude and longitude to send the request. Again, worth a shot if anyone’s struggling. Nearby Search | Places API | Google for Developers
location
The point around which to retrieve place information. This must be specified as latitude,longitude.
radius
Defines the distance (in meters) within which to return place results. You may bias results to a specified circle by passing a location and a radius parameter. Doing so instructs the Places service to prefer showing results within that circle; results outside of the defined area may still be displayed.The radius will automatically be clamped to a maximum value depending on the type of search and other parameters.
Autocomplete: 50,000 meters
Nearby Search:
with keyword or name: 50,000 meters
without keyword or name
Up to 50,000 meters, adjusted dynamically based on area density, independent of rankby parameter.
When using rankby=distance, the radius parameter will not be accepted, and will result in an INVALID_REQUEST.