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

    Type Alias GeometryLineLabelConfig

    GeometryLineLabelConfig: GeometryLabelConfig & {
        minZoom?: number;
        offset?: DataDrivenPropertyValueSpecification<[number, number]>;
        symbolSpacing?: number;
    }

    Labels placed along the polygon border lines: the center label's fields, plus where along the border they repeat.

    When set, the border labels are drawn, including when set after the module is created.

    Type Declaration

    • OptionalminZoom?: number

      Minimum zoom level at which border labels are visible.

      3
      
    • Optionaloffset?: DataDrivenPropertyValueSpecification<[number, number]>

      Offset of the border label from the line, in ems [x, y].

      [0, 1]
      
      offset: [0, 1]  // Default: 1em above the line
      
    • OptionalsymbolSpacing?: number

      Distance between repeated labels along the border line, in pixels.

      200
      

    Defaults for the unset fields:

    • text the feature's title, minZoom 3, size 15, haloWidth 2, symbolSpacing 200, opacity 1, offset [0, 1], bold font.
    • color and haloColor are theme-adaptive: '#333333' text with a '#FFFFFF' halo on light map styles, the reverse on dark.
    // Defaults
    const lineLabel: GeometryLineLabelConfig = {};

    // Custom text and appearance for dark fills
    const lineLabel: GeometryLineLabelConfig = {
    text: ['get', 'name'],
    minZoom: 10,
    color: '#FFFFFF',
    haloColor: '#000000',
    size: 13
    };