Maps SDK for Web
Class L.TomTomTrafficLayer
Tile layer for Leaflet that shows styled traffic tubes using Traffic API from TomTom.
Constructor
L.TomTomTrafficLayer([options], [options.key] API key that can be obtained from [TomTom's developer portal])
Parameters
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 |
options.style | The traffic layer style to use | No | "s1" | "s2" | "s3" | "night" | "night" |
options.opacity | The traffic incidents layer's opacity set by default to 80%.
A floating point value between 0 and 1 have to be used, where 1 means no transparency.
|
No | Number | 0.8 |
options.noRefresh | Disables periodic updates of traffic layers. | No | Boolean | None |
options.refresh | The traffic incidents information changes and needs to be updated periodically. By default, it is refreshed every 30 seconds. This parameter's value represents the time in milliseconds between each update interval. The value must be 30000 or greater. | No | Number | 30000 |
[options.key] API key that can be obtained from [TomTom's developer portal] | (https://developer.tomtom.com). This is a key for the traffic services. | Yes | String | None |