Skip to main content

Live Traffic

The Live Traffic feature overlays real-time traffic flow conditions on the Cesium globe using TomTom Traffic API tiles.

Enabling Traffic

In the sidebar under Live Observation → Live Traffic, click Show Live Traffic to toggle the overlay on or off.

A second button, Traffic View, provides an alternative traffic visualization layer.

How It Works

Traffic data is displayed as an imagery layer of map tiles. Each tile encodes traffic conditions as a color gradient:

ColorMeaning
GreenFree flow — traffic moving at normal speed
Yellow/OrangeSlow — some congestion
RedCongested — heavy traffic

The color legend is shown in the sidebar when the layer is active.

Auto-Refresh

Traffic tiles refresh automatically every 10 seconds while the layer is active. Each refresh fetches new tiles with an updated ts (timestamp) parameter to prevent browser caching:

GET /tomtom-traffic?z={zoom}&x={tileX}&y={tileY}&ts={Date.now()}

The server proxies this to TomTom's API using TOMTOM_API_KEY.

Compatibility Note

Live Traffic is not compatible with 3D Tileset mode. If the Google Photorealistic 3D Tiles are active when traffic is enabled, the 3D tileset is automatically removed. It will need to be re-enabled manually after disabling traffic.

Data Source

Traffic tile data is sourced from the TomTom Traffic Flow API (absolute flow, raster tiles, version 4).

The tile URL format:

https://api.tomtom.com/traffic/map/4/tile/flow/absolute/{z}/{x}/{y}.png?key={apiKey}&ts={timestamp}

Requests are proxied through the GeoLens server to protect the API key from being exposed in the browser.

Troubleshooting

ProblemCauseSolution
Traffic layer shows no tilesTOMTOM_API_KEY not set or rate-limitedCheck server environment variables
Tiles appear but are outdatedRefresh interval pausedToggle the layer off and back on
Layer disappears after enabling 3D TilesetKnown incompatibilityRe-enable traffic after disabling 3D tiles