Map traffic config playground

Swap traffic presets, from flow only to icon-less incidents, and fine-tune flow and incidents one setting at a time

View on GitHub
SDK 1.0.0-rc.7

One dropdown repaints the traffic picture, from flow only to icon-less incidents, and the controls under it follow each preset or change one setting, a road or incident filter included.

  • TrafficIncidentsModule.get and TrafficFlowModule.get bind to the traffic layers the map style already carries.
  • applyConfig takes a whole TrafficFlowModuleConfig or TrafficIncidentsModuleConfig, so a preset swap is two calls, and config-change tells the controls.
  • trafficFlowKnobCatalogue and trafficIncidentsKnobCatalogue give each setting’s kind, options and default, so the controls are generated.
  • setKnob sets one by its id and keeps the rest, so a filter’s mode and its values add up with no config merging.

Related examples