This is the documentation of version 1.0.0-rc.0. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias TrafficSectionProps

    TrafficSectionProps: SectionProps & {
        categories: TrafficIncidentCategory[];
        delayInSeconds?: number;
        effectiveSpeedInKmh?: number;
        eventId?: string;
        magnitudeOfDelay: DelayMagnitude;
        tec: TrafficIncidentTEC;
    }

    A route section affected by a traffic incident.

    It is a portion of the route with traffic delays due to congestion, accidents, construction or other incidents.

    Type Declaration

    • categories: TrafficIncidentCategory[]

      The categories of the incident, based on its tec cause codes, or on its icon category when it has none.

    • OptionaldelayInSeconds?: number

      The extra time in seconds this incident causes compared to free-flow conditions.

      It is present when the delay can be calculated.

    • OptionaleffectiveSpeedInKmh?: number

      The actual average speed through this incident in km/h, when speed information is available.

      A lower speed means worse congestion.

    • OptionaleventId?: string

      The identifier of the traffic incident behind this section.

      It is the join key back to the full incident. To get the whole record, pass it to the traffic incident details service rather than re-deriving it from the section's geometry.

    • magnitudeOfDelay: DelayMagnitude

      The severity of the delay this incident causes.

    • tec: TrafficIncidentTEC

      The internationally standardized TPEG2-TEC codes that classify the incident.

    const trafficSection: TrafficSectionProps = {
    id: 'traffic-1',
    startPointIndex: 50,
    endPointIndex: 75,
    simpleCategory: 'jam',
    magnitudeOfDelay: 'moderate',
    delayInSeconds: 420, // 7 minutes
    effectiveSpeedInKmh: 25,
    tec: { effectCode: 1, causes: [{ mainCauseCode: 101 }] }
    };