Maps SDK for Web

Class L.TomTomTrafficFlowLayer

This is an extension to Leaflet allowing to display TomTom traffic flow layer. It is based on the raster L.TileLayer implementation. The possible options are described below.



Name Description Required Type/Values Default
options It accepts all the options that Leaflet's TileLayer allows. The additional options, which are TomTom specific, are described below. No Object None The traffic flow style to be displayed. It should be set to one of the following values:
  • "absolute" makes the colours of the road segments reflect a measured absolute speed.
  • "relative" returns a speed relative to the free-flow traffic information, highlighting areas of congestion.
  • "relative-delay" displays relative speeds only in places where they are different from the free-flow speed (no green segments shown).
No "absolute" | "relative" | "relative-delay" "absolute"
options.opacity The traffic flow layer's opacity, set by default to 70%. A floating point value between 0 and 1 have to be used, where 1 means no transparency. No Number 0.7
options.noRefresh Disables periodic updates of traffic flow layer. No Boolean None
options.refresh The traffic flow information changes and needs to be updated periodically. By default, it is refreshed every 3 minutes. This parameter's value represents the time in milliseconds between each update interval. The value must be 30000 or greater. No Number 180000


name: String

Default: "trafficFlow"

Name of traffic flow layer. It can be used to differentiate layers.