Maps SDK for Web

Class L.TomTomTrafficWithIncidentsLayer

This layer groups functionality of traffic layer and traffic incidents In most situations you will want to use these layers together and refresh them at the same time, so we are providing this layer to make your work easier.

If you use this layer there will be only one timer and it will issue only one request to check if traffic data is up to date. If you create layers on your own, each layer will have it's own timer and will check for data freshness on its own. You can specify how ofter the data should be refreshed.

Constructor

L.TomTomTrafficWithIncidentsLayer([options])

Parameters
Name Description Required Type/Values Default
options It accepts all the options that Leaflet's LayerGroup class allows. The additional options, which are TomTom specific, are described below. No Object None
options.traffic Options which will be used for traffic and traffic incidents layers. Please refer to the docs to check what options you can use. No Object | Boolean None
options.refresh The traffic and 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

Properties

name: String

Default: "vectorTrafficWithIncidents"

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

name: String

Default: "trafficWithIncidents"

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