Sorry, you need to enable JavaScript to visit this website.

Traffic layers

Traffic layers

Give your users the ability to see real time traffic in your mobile apps.

With Online Traffic Flow tiles your users will have information about congestion,
the speed of traffic on different road segments, and the difference between that speed and the
free-flow speed on the same road segments. You can find more information and details about
Online Traffic Flow tile parameters on
Online Vector Traffic Flow tiles or
Online Raster Traffic Flow tiles.

Online Traffic flow tiles

Traffic flow tiles are available in two formats: vector (.pbf) and raster (.png).
Vector tiles provide a possibility for visual customization and better visual experience.
Therefore, we recommend using the vector tiles for map and traffic display.
Raster tiles are especially suitable for low performance devices.

Vector traffic flow tiles are used by default for traffic flow in Maps SDK.
Vector traffic flow tiles are available from map zoom levels: 11 to 20.
Raster traffic flow tiles are available from map zoom levels: 0 to 18.
You can switch to raster traffic flow tiles by using the method:

tomtomMap.getUiSettings().turnOnRasterTrafficFlowTiles();

 

You can change back to vector traffic tiles by using the method:

tomtomMap.getUiSettings().turnOnVectorTrafficFlowTiles();

 

Traffic type and styles

Online Traffic tiles styles are represented in the SDK as Java data classes.
Online Traffic flow tiles style types are represented in the SDK as data classes.

The available vector traffic flow styles are listed below and can be set by method:

tomtomMap.getUiSettings().turnOnVectorTrafficFlowTiles(new TrafficFlowType.RelativeTrafficFlowStyle()); //default
tomtomMap.getUiSettings().turnOnVectorTrafficFlowTiles(new TrafficFlowType.AbsoluteTrafficFlowStyle());
tomtomMap.getUiSettings().turnOnVectorTrafficFlowTiles(new TrafficFlowType.RelativeDelayTrafficFlowStyle());

 

The available raster traffic flow styles are listed below and can be set by method:

tomtomMap.getUiSettings().turnOnRasterTrafficFlowTiles(new RelativeTrafficFlowStyle()); //default
tomtomMap.getUiSettings().turnOnRasterTrafficFlowTiles(new AbsoluteTrafficFlowStyle());
tomtomMap.getUiSettings().turnOnRasterTrafficFlowTiles(new RelativeDelayTrafficFlowStyle());
tomtomMap.getUiSettings().turnOnRasterTrafficFlowTiles(new ReducedSensitivityTrafficFlowStyle());

 

Sample use case: You want to visualize traffic information in your app so your users can adjust
their commute based on traffic information.

Use the code snippets below in your app to enable and visualize the vector traffic flow layer on
the map:

tomtomMap.getUiSettings().turnOnVectorTrafficFlowTiles();

 

You can turn off traffic flow by using the method:

tomtomMap.getUiSettings().turnOffTraffic();
tomtomMap.getUiSettings().turnOffTrafficFlowTiles();

 

Information about set style:

VectorTrafficFlowType style = tomtomMap.getUiSettings().getTrafficVectorFlowStyle();

 

Traffic incidents

Online Traffic incidents style types are represented in the SDK as a data class. The available
traffic incidents options are the following

tomtomMap.getUiSettings().turnOnRasterTrafficIncidents();

 

You can turn off traffic incidents by using the method:

tomtomMap.getUiSettings().turnOffTrafficIncidents();

 



image

Traffic vector flow layer on vector map.

image

Traffic raster flow shown on raster map.

image

Traffic raster incidents layer in sample app.

image

Traffic raster incidents and raster flow layer on raster map.

image

No traffic in sample app.