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 SectionDisplayConfig<T>

    SectionDisplayConfig: Pick<SectionKnobs, SectionKnobOf<T>>

    Appearance of one route section type.

    Type Parameters

    The semantic tier for sections. It lets you draw, recolour, resize or mute any section type the module draws without writing a MapLibre layer spec. DrawnSectionType lists the types, and layers.sections takes 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 },
    unpaved: { visible: true, color: '#8B5A2B', opacity: 0.8 },
    // Restyle three that are drawn already:
    lowEmissionZone: { color: '#1B7A43' },
    tunnel: { color: '#402060', style: 'halo' },
    tollRoad: { icon: { image: 'poi-toll_plaza', placement: 'along' } },
    // And drop one:
    traffic: { visible: false },
    },
    };