TrafficIncidentIdentifier no request at all

I am trying to get the information about accidents/road work on my static map. I thought this could be done by adding the TrafficIncidentIdentifer tier. But until now, I have no data on my map.


	var MMMap = new{
			key: 'key',
			container: 'map',
			center: new tt.LngLat(a very crowded metropolitan area, with enough accidents and contruction),
			zoom: 11,
			style: 'tomtom://vector/1/basic-night',
			interactive: false,
                        keyboard: false

Request for the traffic incidents on my map:

		MMMap.addTier(new tt.TrafficIncidentTier({
			key: 'key',
			incidentDetails: true,
			incidentTiles: true

Am I misinterpreting this function? Or do I need another function to show the traffic incident/road work icons on my map? The trafficflowtilestier works like a charm this way.

On the dashboard the counter for traffic incidents doesn’t go up. A test with an API call and changing the test key with my key on the bottom of the pages, does increase the traffic incident counter on my dashboard. My key works and should work.

Register on map load event and call addTier inside callback. Like this:
map.once('load', () => { map.addTier(options)})


Thanks! That did the trick.
I don’t if I’ve overlooked it on the API documentation, but it is also written there.

Second issue fixed. The object name must be map not MMMap, or any other name.

1 Like