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

    Type Alias SectionDisplayConfig<T>

    SectionDisplayConfig: Pick<SectionKnobs, SectionKnobOf<T>>

    Appearance of one route section type.

    Type Parameters

    The semantic tier for sections: enough to draw, recolour, resize or mute any section type the module draws, without writing a MapLibre layer spec — see DrawnSectionType for the types, and layers.sections for anything these knobs cannot express.

    Which knobs a type takes is part of its type. traffic colours its line by magnitudeOfDelay and takes its icons from the incident data, so sections.traffic.color does not compile rather than compiling and drawing nothing. sectionSupportsKnob answers the same question at runtime, for a UI that builds its controls from the type.

    const config: RoutingModuleConfig = {
    sections: {
    // Opt in to two of the sections nothing draws by default:
    urban: { visible: true },
    lowEmissionZone: { visible: true, color: '#1B7A43', opacity: 0.8 },
    // Restyle two that are drawn already:
    tunnel: { color: '#402060', style: 'halo' },
    tollRoad: { icon: { image: 'poi-toll_plaza', placement: 'along' } },
    // And drop one:
    traffic: { visible: false },
    },
    };