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

    Type Alias TrafficIncidentsModuleConfig

    TrafficIncidentsModuleConfig: MapModuleCommonConfig & {
        colors?: TrafficIncidentColors;
        filters?: TrafficIncidentsFilters;
        icons?: IncidentIconsConfig;
        opacityFactor?: number;
        timeValidity?: TrafficIncidentTimeValidity[];
        visible?: boolean;
        widthFactor?: number;
    }

    Configuration for traffic incidents module.

    Type Declaration

    • Optionalcolors?: TrafficIncidentColors

      The colours of the incident lines, per delay magnitude.

    • Optionalfilters?: TrafficIncidentsFilters

      Which incidents are shown, by category, severity, delay and road type, for lines and icons alike.

    • Optionalicons?: IncidentIconsConfig

      Configuration specific to the incident icons.

    • OptionalopacityFactor?: number

      Opacity multiplier for the incident lines and their outlines, from 0 to 1, where 1 is the style's own. The incident icons stay opaque.

      1
      
    • OptionaltimeValidity?: TrafficIncidentTimeValidity[]

      Which incidents the tiles bring, by when they occur: present ones are under way, future ones are planned, such as scheduled roadworks.

      Unlike filters, this changes the tile request, so a change reloads the incident tiles. Unset or empty, only the present incidents come.

      // Planned incidents only
      timeValidity: ['future']
      ['present']
      
    • Optionalvisible?: boolean

      Whether the traffic incident layers are visible, icons included.

      false
      
    • OptionalwidthFactor?: number

      Width multiplier for the incident lines, where 1 is the style's own.

      1
      

    One set of filters narrows both the incident lines and their icons. icons only decides whether the icons are shown.