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

    Type Alias TrafficIncidentDetailsModuleConfig

    TrafficIncidentDetailsModuleConfig: MapModuleCommonConfig & {
        beforeLayerConfig?: BeforeLayerConfig;
        highlight?: false | IncidentHighlightConfig;
        layers?: TrafficIncidentDetailsLayersConfig;
        line?: IncidentLineConfig;
        visible?: boolean;
    }

    Configuration for TrafficIncidentDetailsModule.

    Type Declaration

    • OptionalbeforeLayerConfig?: BeforeLayerConfig

      The map-style layer to position incident layers before. Pass 'top' to pin them above every other layer. Defaults to 'lowestLabel', which keeps incidents below map labels (roads, places, POIs) so labels stay readable. The routing module and the flat area analytics layers use the same default.

    • Optionalhighlight?: false | IncidentHighlightConfig

      How the incidents TrafficIncidentDetailsModule.setFocus marks are drawn, a hovered or clicked incident too, and how the rest fade while a focus is set.

      • Omitted (or undefined) - The SDK default highlight, an outline beneath the stripe (black on light map styles, white on dark) and a 1.6× width pop.
      • false - No highlight. setFocus(ids) still writes MapLibre feature-state.focused, and user events eventState, so you can drive your own styling (extra layers, sidebar overlays, …) off those states.
      • { outline?: { color? }, line?: { widthFactor? }, unfocusedOpacityFactor? } - Overrides individual fields of the default highlight. unfocusedOpacityFactor fades every incident outside the focus set.
    • Optionallayers?: TrafficIncidentDetailsLayersConfig

      MapLibre overrides for the incident lines and markers. A layer hidden through its entry's layout.visibility stays hidden while the module is shown.

    • Optionalline?: IncidentLineConfig

      The incident lines: every incident's outline and stripe.

    • Optionalvisible?: boolean

      Whether the incident layers are shown. Defaults to true. show() never flips this flag. If false, the module loads data but keeps layers hidden until you call setVisible(true).