Multiple filters on google maps

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.

@niekvandermeer do you have to use :filtered? Can’t you just use constraints?

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.

Any help would be greatly appreciated.

Hey @niekvandermeer

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.

  1. 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))

  2. 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
  1. 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.

Here is an example of one of my use case:
map-use-case

Let me know if that works for you

Thanks so much for your reply!

I’ve worked on it but still can’t get it to work.

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.

Then I have these workflows:


And this data for the user (the toggle-webcam is not in use)

And for the filters in Locations:

And then I have the following constraints on the map:

What happens now is that the page loads, shows all locations and when I click either of the toggles all markers disappear from the map.

@niekvandermeer

That seems to be the right config, are you sure you have created some dummy Locations data with filtertoggle-food or filtertoggle-shower set to yes?

What happens when you uncheck both toggles back to « unchecked »? Do the values appear in the RG again?

I had indeed made a mistake with that, so that’s now working. Thank you so much for your help and patience :slight_smile:

Awesome! Glad I could be of help

This topic was automatically closed after 70 days. New replies are no longer allowed.