fishfrymap
fishfrymap copied to clipboard
Venue Type Filter
Ask: new filter by venue type.
Some out-loud thinking:
- A fish fry can have one or more of the existing kinds of “feature” filters (alcohol, pierogies, etc.), but can only be one type of venue
- Whereas the existing feature filters are used to narrow down fish fries from the entire list, a venue type filter, in a way, would determine what is in list in the first place.
- Feature filters are inclusive. Checking on one or more means only those fish fries that include those features are shown
- I’m seeing venue type as a second set of “inclusive” filters, but the venue types are pre-checked. If you don’t want to include a certain type of venue on the map, you turn them off
- This approach could also accommodate keeping a certain type of venue off by default if desired (e.g., restaurants, something that has been discussed in the past).
- The "verified for
" filter is additive to these
Thinking in terms of the “query”:
- Show me all the fish fries for all types of venues (i.e., the initial map view)
- No feature filters are checked, all venue types are checked.
-
venue_type in <list of all venue types>
- Show me only fish fries everywhere except restaurants
- No feature filters are checked, one venue type is unchecked.
-
(venue_type in <list of all venue types that excludes restaurants>)
- I’m interested in only fish fries with homemade pierogies, doesn’t matter what kind of venue
- One feature filter is checked, all venue types are checked.
-
(pierogies = True) AND (venue_type in <list of all venue types>)
- I’m interested in only fish fries with homemade pierogies at lunch, doesn’t matter what kind of venue
- Two feature filters are checked, all venue types are unchecked.
-
(pierogies = True AND lunch = True) AND (venue_type in <list of all venue types>)
- I’m interested in only fish fries with homemade pierogies at fire halls
- One feature filters is checked, all venue types are unchecked.
-
(pierogies = True) AND (venue_type = fire hall)
A lot of the work to implement this will happen somewhere in this function:
https://github.com/CodeForPittsburgh/fishfrymap/blob/150884bc920791f39ef0c2d02f8f84e3d6169ce2/src/js/app.js#L762
The template change hereabouts:
https://github.com/CodeForPittsburgh/fishfrymap/blob/150884bc920791f39ef0c2d02f8f84e3d6169ce2/index.html#L286
Also see this issue regarding improving the filter logic: https://github.com/CodeForPittsburgh/fishfrymap/issues/20