This is the documentation of version 0.64.0. Go to the latest version, 1.0.0-rc.5.

Traffic

The SDK draws traffic in five ways, each owned by one module. The playground below switches flow and incidents between presets:

You need… Use Data
Live speed on every road TrafficFlowModule the style's flow tiles
Live incidents across the map, filtered TrafficIncidentsModule the style's incident tiles
Exactly the incidents you fetched, with focus TrafficIncidentDetailsModule a trafficIncidentDetails response
The incidents on one route RoutingModule the route's traffic sections
Historical speed and congestion over a region TrafficAreaAnalyticsModule a trafficAreaAnalytics response

The flow and incident tiles are style parts, hidden until a module shows them.

Traffic incidents

TrafficIncidentsModule shows the live incidents of the whole map — accidents, closures, roadworks, weather — as lines and category icons, filtered by category, severity, delay and road type. No request is needed.

Traffic flow

TrafficFlowModule colours every road by its speed relative to free flow, from free-flowing to stationary, with closed roads outlined.

Traffic flow as data

Orbis flow is vector tiles only: TrafficFlowModule.getRenderedFeatures() over the current viewport is the only way to read it. What the flow data can and cannot tell you lists what each segment carries; historical speed and congestion over an area come from Traffic Area Analytics.

Traffic incident details

TrafficIncidentDetailsModule draws the incidents a trafficIncidentDetails call returned — no more, no less — and highlights a subset with setFocus. Use it when your app needs the typed incidents too, for a list, a popup or a route.

Traffic along routes

RoutingModule draws the incidents of a calculated route as its traffic sections, in the incident colours.

Traffic area analytics

TrafficAreaAnalyticsModule draws a region's historical traffic as hexagon or square grids, flat or extruded, or as a heatmap, coloured by congestion, speed, travel time or network length.

Related guides and examples