Maps SDK for Web
tt.services.incidentDetailsV5
Provides detailed information about traffic incidents in the requested area using the TomTom Traffic API - Traffic Incidents Details. This is a new version of the incidentDetails method with simpler options and a more readable response object.
The current road situation is updated every minute.
Response
The fields that appear in the response depend on the value of the fields
request parameter.
The response is extended with getTrackingId()
method, which returns the Tracking-ID
associated with the request.
Constructor
tt.services.incidentDetailsV5(options, [additionalOptions])
Example
tt.services.incidentDetailsV5({
key: '<Your API key>',
boundingBox: '4.8854592519716675,52.36934334773164,4.897883244144765,52.37496348620152'
}).then(function(response) {
console.log(response);
});
Parameters
Name | Description |
---|---|
options
Object default:None |
Options object. |
additionalOptions
Object default:None |
Additional options to be passed to the service. |
additionalOptions.abortSignal
Object default:None |
Signal created with abortController. Use AbortController to cancel requests in progress. Example
|
options.boundingBox
Maps.LngLatBounds | Number[] | Object[] | String default:None |
Bounding box area in one of the supported formats. The bounding box is a limited area within the search results. Maximum area of bounding box is 10000km2. This option is able to convert a number of popular formats into the bounding box. The supported formats are listed below:
|
options.fields
String default:'{ incidents { type, geometry { type, coordinates }, properties { iconCategory } } }' |
The fields to be included in the response, nested as in the response schema.
In order to obtain all data, it is necessary to place the whole object in the query.
|
options.key
String default:None |
A valid API Key for the requested service. Key is required to make use of the given service. It can be issued in the Developer Portal. |
options.language
String default:'en-GB' |
Language code that decides in which language the results should be returned. The ISO 639-1 code for the output language.
|
options.protocol
"http" | "https" default:"https" |
The protocol type to be used in the calls. Represents the type of protocol used to perform a service call. |
options.t
String default:None |
A valid, not older than two minutes, traffic model ID. The Traffic Model ID is the reference value for the state of traffic at a particular time. It is updated every minute, and is valid for two minutes before it times out. If not provided the current traffic model ID is used. |
options.trackingId
String default:uuid |
Sets value of "Tracking-ID" header. Specifies an identifier for the request. If not set by the user, UUID is generated for each call.
|