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

    Type Alias TrafficIncidentDetailsModuleConfig

    TrafficIncidentDetailsModuleConfig: MapModuleCommonConfig & {
        beforeLayerConfig?: BeforeLayerConfig;
        focus?: false | IncidentFocusStyle;
        layers?: TrafficIncidentDetailsLayersConfig;
        visible?: boolean;
    }

    Configuration for TrafficIncidentDetailsModule.

    Type Declaration

    • OptionalbeforeLayerConfig?: BeforeLayerConfig

      Position incident layers before this map-style layer. 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 same default the routing module and the flat area analytics layers use.

    • Optionalfocus?: false | IncidentFocusStyle

      Visual treatment for TrafficIncidentDetailsModule.setFocus, which a hovered or clicked incident draws too.

      • Omit (or undefined) — use the SDK default treatment: an outline beneath the focused stripe (black on light map styles, white on dark) and a 1.6× width pop.
      • false — disable the visual treatment. setFocus(ids) still writes MapLibre feature-state.focused, and user events eventState, so callers can drive their own styling (extra layers, sidebar overlays, …) off those states.
      • { outlineColor?, widthFactor? } — override individual fields of the default treatment.
    • 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.

    • 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 setVisible(true) is called.