Traffic incidents playground

Show live and planned traffic incidents, narrow them by severity, and click one for its delay and history.

View on GitHub
SDK 1.0.0-rc.7

Bring in the planned roadworks and closures next to the ones under way, narrow them by severity, and click one to read its delay and report history.

  • TrafficIncidentsModule.get with { visible: true } draws the incidents the map style already carries.
  • timeValidity swaps the tiles the module asks for, so planned incidents land in the same layers, popup and filters as live ones.
  • filters takes a magnitudes clause, so narrowing severity filters drawn layers rather than sending a second request.
  • setLanguage translates the incident descriptions along with the map labels.
  • events.on('click', …) yields a typed TrafficIncidentsModuleFeature for the popup.

Related examples