TomTom Maps for JavaScript
    Preparing search index...

    Function getStyleColor

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

      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');