TomTom Maps for JavaScript
    Preparing search index...

    Type Alias GeometryLineLabelConfig

    Line label configuration for geometries.

    When set, a symbol layer is added to the geometry source, placing labels along the polygon border lines

    // Defaults
    const lineLabelConfig: GeometryLineLabelConfig = {};

    // Custom appearance for dark fills
    const lineLabelConfig: GeometryLineLabelConfig = {
    minZoom: 10,
    textColor: '#FFFFFF',
    textHaloColor: '#000000',
    textSize: 13
    };
    type GeometryLineLabelConfig = {
        minZoom?: number;
        symbolSpacing?: number;
        textColor?: DataDrivenPropertyValueSpecification<string>;
        textHaloColor?: DataDrivenPropertyValueSpecification<string>;
        textHaloWidth?: DataDrivenPropertyValueSpecification<number>;
        textOffset?: DataDrivenPropertyValueSpecification<[number, number]>;
        textOpacity?: DataDrivenPropertyValueSpecification<number>;
        textSize?: DataDrivenPropertyValueSpecification<number>;
    }
    Index

    Properties

    minZoom?: number

    Minimum zoom level at which border labels are visible.

    3
    
    symbolSpacing?: number

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

    200
    
    symbolSpacing: 350
    
    textColor?: DataDrivenPropertyValueSpecification<string>

    Color of the border label text.

    '#333333'
    
    textColor: '#FFFFFF'
    textColor: ['get', 'labelColor']
    textHaloColor?: DataDrivenPropertyValueSpecification<string>

    Color of the halo drawn around the border label text.

    The halo improves legibility against complex or dark backgrounds.

    '#FFFFFF'
    
    textHaloColor: '#000000'
    
    textHaloWidth?: DataDrivenPropertyValueSpecification<number>

    Width of the halo drawn around the border label text, in pixels.

    2
    
    textHaloWidth: 3
    
    textOffset?: DataDrivenPropertyValueSpecification<[number, number]>

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

    [0, 1]
    
    textOffset: [0, 1]  // Default: 1em above the line
    
    textOpacity?: DataDrivenPropertyValueSpecification<number>

    Opacity of the border label text.

    1
    
    textOpacity: 0.8
    
    textSize?: DataDrivenPropertyValueSpecification<number>

    Font size of the border labels in pixels.

    15
    
    textSize: 13
    // Data-driven
    textSize: ['interpolate', ['linear'], ['zoom'], 8, 12, 14, 16]