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

    Function getStyleColor

    • The colour a style colour knob is at on the map: the one its module was given, one the loaded style derives from a set map colour, or the loaded style's own — whether or not that module exists.

      Parameters

      Returns string | undefined

      The colour, or undefined where the style draws it with an expression no single colour stands for, or has no layer for it.

      const slow = getStyleColor(map, 'traffic.flow.colors.slow');
      const water = getStyleColor(map, 'colors.water');