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

    Type Alias StylingKnobDescriptor

    StylingKnobDescriptor: KnobDescriptor & {
        appliesTo: StylingKnobAppliesTo;
        available: boolean;
        current: StylingKnobValue | undefined;
        default: StylingKnobValue | undefined;
        id: StylingKnobId;
        kind: StylingKnobKind;
        range?: StylingKnobRange;
    }

    One entry of the styling catalogue returned by StylingModule.describe: everything a UI or an agent needs to offer the knob, validate a value for it and show its state.

    Type Declaration

    • appliesTo: StylingKnobAppliesTo

      Which styles the knob works on; see stylingKnobAppliesTo.

    • available: boolean

      Whether the knob has anything to work on in the loaded style. false means setting it would do nothing — the SDK also warns once in the console when that happens. Check this before offering the knob in a UI or to an agent.

    • current: StylingKnobValue | undefined

      The value in effect right now: the override if there is one, otherwise the default.

    • default: StylingKnobValue | undefined

      The value the loaded style ships with. undefined when the style defines it as a data-driven expression that no single value stands for; reset still restores it exactly.

    • id: StylingKnobId

      The knob's id, as accepted by StylingModule.set.

    • kind: StylingKnobKind
    • Optionalrange?: StylingKnobRange

      The range of valid values, for factor and number knobs.

    Narrows the shared KnobDescriptor: styling ids and value types are known, range.step is always given, and available / appliesTo are required — every styling knob answers both.