Hello! In my application, I ask a user to input a location they would like to search. Here’s the problem:
Currently, I’m not seeing a way to only show cities in the search box - this means someone can search “Colorado”, and have no results show up, even though there could be results in Breckenridge, Boulder, etc.
The option needs to exist to either limit the type of geographic locations that show in the search box (“Only Cities”, “Only Canada”), or to expand how results are showing with a parent-child relationship (Search “United States”, show everything in the United States)
Similar concerns have been raised in these questions, but no answers:
Any insight from how others have solved this problem?
Agreed! I’m really surprised there hasn’t been a prior thread on this where it gets addressed. @executiveadvertising , have you found a workaround solution?
Hey @callen.hedglen! There isn’t currently a way to add filters to the searchbox element when searching for Geographic Places. However, Bubble’s searchbox element uses the Google Places API, and you can use an input element and a repeating group underneath to achieve a similar UI:
To set this up, you can install the Bubble’s Google Places API plugin and obtain a Google Places API key from Google. I’m not 100% sure how you would only display Cities, but to start, I think the type of Google Places search would be a Nearby Search:
The searchbox on the page below would contain the State where the User lives, and the repeating group would automatically display Google Places within X miles (radius) of the Searchbox location.