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...

    Type Alias FeatureLabelConfig<F>

    FeatureLabelConfig: LabelConfig & {
        title?:
            | ((feature: F) => string)
            | DataDrivenPropertyValueSpecification<string>;
    }

    A LabelConfig that also sets what the label says, for the labels a module writes beside the features it shows.

    Type Parameters

    • F

      The feature the title function receives.

    Type Declaration

    • Optionaltitle?: ((feature: F) => string) | DataDrivenPropertyValueSpecification<string>

      Text content for the label.

      A function is called once per feature when it is shown, and its result is drawn as given. A MapLibre expression is evaluated per feature by the layer, over the properties the feature is drawn with, and replaces the module's whole label text.

      // Function
      title: (feature) => feature.properties.poi?.name || 'Unknown'

      // MapLibre expression
      title: ['get', 'title']