Map POI filters

Filter POI categories with show/hide modes

View on GitHub
SDK 1.0.0-rc.7

The toggles and the mode dropdown decide which POI categories the base map keeps drawing, either hiding the checked ones or showing only those. Click a POI to hide it, and Reset brings it back.

  • POIsModule.get hands back a controller over the POI layers the style already ships, so nothing is added to the map.
  • filters.categories, given to updateConfig, takes one ValuesFilter, a mode and a list of values, instead of hand-written layer filter expressions.
  • Group ids such as FOOD_DRINKS_GROUP stand in for a whole family of FilterablePOICategory values, so leaf categories never need listing.
  • filters.ids hides the POIs you clicked by their id, and holds beside the categories filter. Both go in every updateConfig call, since it replaces filters whole.

Related examples