I;'ve got a Google Map with locations on it and want to be able to filter these based on several criteria. I now have both checkboxes and also a drop down selection and when I change on of these the map updates but does not take into account previous filters. This was at any time only 1 filter is basically active, how can I change this so that you can tick multiple filters and only the locations who conform to all filters are shown?
It feels like this is such a simple thing to solve, I’ve tried to find the answer here and via google but don’t know the correct search terms to find the solution.
Thanks for your reply, could you point me in the right direction to solve this?
I have a map with locations and they have specific features. There are 2 checkboxes for 2 specific features of the locations and 1 drop down to selected between 2 unique features.
When 1 tick checkbox one it shows only the locations that have that feature, but when I then tick checkbox 2 it just looks at which locations have that feature, not taking into account whether the first checkbox is ticked or not and I can’t figure out how to do that…
This doesn’t then even begin to incorporate the drop down list but once I understand these basic filters I think the rest (drop down and other filters) should be easy to add.
I’m not sure what your config is, could you share some screenshots?
Assuming the data type you’re trying to display is Locations, the data source in your map should be Search for Locations, with constraints related to the User’s choices in your dropdown and checkboxes. The way I’m saving those choices is through workflows.
Create fields in your User data type related to the Locations’ fields you want to use to filter locations on your map (I’ll call those fields SearchDropdown (of type text), SearchCheckbox1 (yes/no), SearchCheckbox2 (yes/no))
Create the following workflows:
When dropdown value is changed: make changes to User → SearchDropdown = This dropdown’s value
When checkbox1’s value is changed and this checkbox is checked: make changes to User → SearchCheckbox1 = Yes
When checkbox1’s value is changed and this checkbox is unchecked: make changes to User → SearchCheckbox1 = No
Do the same for Checkbox2
In your Locations data type, you should then have fields that relate to the dropdown and checkboxes’ values (I’ll call those fields FilterDropdown, FilterCheckbox1, FilterCheckbox2). Set your data source to Search for Locations in your map, with the following constraints:
FilterDropdown = Current User’s SearchDrodpdown
FilterCheckbox1 = Current User’s SearchCheckbox1
FilterCheckbox2 = Current User’s SearchCheckbox2
Don’t forget to tick the checkbox “ignore empty constraints” as well.
I’m for now focusing on getting checkboxes to work and have the following setup:
The layout, 2 checkboxes and underneath it a map, by default I want all possible locations visible as markers when the page loads, this works, then I want to check the “food” one and only locations that offer food should show up, then when I check “Showers” I want to only have locations which have both food and showers.