The Maps API provides a means of retrieving and displaying traffic data on the map for major urban areas around the globe.
Showing Traffic Flow on the Map
The example below uses the traffic component in the Maps API to show a map of a part of Berlin indicating the traffic conditions. Roads where traffic flows freely are marked in green, roads where congestion is moderate are in orange, while those that are congested are shown in red.
The API provides access to map tiles with traffic information through the HERE Traffic API. It automatically adds the flow layer to the default layer collection (accessed through the method createDefaultLayers() on the H.service.Platform instance). The application user can switch the traffic flow information display on and off for the available map types via the MapSettingsControl.
The code below adds the flow layer available in the default layer collection to the map.