Category Filter
Allow users to toggle features on and off based on different categories.
Last updated
Was this helpful?
Allow users to toggle features on and off based on different categories.
Last updated
Was this helpful?
The Category Filter creates a toggleable list of Categories that you have associated with your Locations, Lines, and Polygons added to the current map. These are presented in a list, and include parent and child relationships. Users can toggle checkboxes on or off, thereby adding and removing different features from the map. You can initialize features as on or off depending what you require.
Categories will also display hierarchically if you have child categories.
Any feature that has a child category should also have its hierarchical parent categories, otherwise the layout may not work properly.
Select if categories will show colors, icons, or nothing beside them. These colors and icons can be defined in the Categories section of the Wordpress plugin (inside Maps > Categories).
Pick whether your categories will be toggled with switches or checkboxes.
Display the number of features included in a given category in parentheses.
This applies to cases in which features may have more than one category or filterable property. Filters are exclusive when any of the properties or categories being turned off means the feature disappears. Inclusive means that all of the properties or categories must be turned off before the feature disappears.
Child categories will function independently of whether or not their parent category is turned on. For this, you'll want to make sure that your child categories don't have the parent category clicked on (or, use inclusive filtering).
Choose whether you want parent categories to show checkboxes or only be used for visual structural organization of their child categories.
Set whether categories should be on or off when the map first loads.
Allows you to have the categories appear, both parents and children, in whatever order you want.
Adds a button to reset all categories to their original loaded state.
Use properties from your geographic data (imported or added onto posts), or ACF data, to create additional filters.
First, you'll need to make sure your features actually have the data. You can see properties from geographic data in any given feature under "Custom Properties", and ACF fields will show up in the appropriate post types.
Next, you'll use some special syntax to tell the Category Filter which properties to include under which headers. The syntax looks like this:
If you are using a Custom Property, enter the property name only (no acf_ required) and then the label you want to show for that property heading, separated by a colon.
Unlike the Advanced Popup, you don't need to get the field ID from ACF, and you don't need to use curly braces. Just enter the "name" of the ACF field, or the name of the property. This feature will run into problems if you have a property and an ACF field with the same name, though.
If you've added these correctly, they will now show up alongside your categories in the Category Filter, and will integrate completely with the Inclusive and Exclusive filtering.
The category filter will render into a div of your choosing on the page, instead of appearing directly as a control on the map. This can free up space in the appearance of your map.
Makes a neater appearance by having categories render in dropdown expandable rows.