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

    Function validateKnobValue

    • Checks a value against a catalogue entry: its kind, its options, and its range as far as the range's bounds hold.

      Parameters

      • knob: KnobEntry<string>

        The knob's entry in its catalogue.

      • value: unknown

      Returns void

      A color must parse as a CSS colour. An image or text value need only be a string; whether the sprite has the image is known on a loaded map only.

      RangeError naming the knob and what it expects, for a value it does not take.

      const knob = trafficIncidentsKnobCatalogue.find(({ id }) => id === 'filters.any.0.magnitudes.values');
      validateKnobValue(knob, ['major', 'severe']); // RangeError: … 'severe' is not