TomTom Maps for JavaScript
    Preparing search index...

    Type Alias GeometryLineConfig

    Line/border configuration for geometries — the outline color, opacity, width, an escape hatch for any other line property, and (optionally) where the border layer sits in the map's layer stack.

    The curated color / opacity / width fields cover the common cases; the layer escape hatch accepts a partial MapLibre LineLayerSpecification for anything else (line-gap-width, line-cap, line-join, …). The curated fields take precedence over the same paint property set via layer.

    // Curated fields
    const line: GeometryLineConfig = { color: '#333333', width: 2, opacity: 0.8 };

    // Data-driven border
    const line: GeometryLineConfig = {
    color: ['get', 'borderColor'],
    width: ['case', ['get', 'selected'], 4, 2],
    };
    type GeometryLineConfig = {
        beforeLayerConfig?: BeforeLayerConfig;
        color?: DataDrivenPropertyValueSpecification<string>;
        layer?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
        opacity?: DataDrivenPropertyValueSpecification<number>;
        width?: DataDrivenPropertyValueSpecification<number>;
    }
    Index

    Properties

    beforeLayerConfig?: BeforeLayerConfig

    Layer positioning for the border/outline layer only.

    Overrides the top-level GeometriesModuleConfig.beforeLayerConfig for the border. Pair with GeometryFillConfig.beforeLayerConfig to split the fill and border across the layer stack (e.g. fill below roads, border on top).

    color?: DataDrivenPropertyValueSpecification<string>

    Border/outline color: a hex string or a MapLibre expression (e.g. ['get', 'borderColor']).

    '#0A3653'
    
    layer?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>

    Escape hatch for full control over the border (outline) line layer.

    Accepts a partial MapLibre LineLayerSpecification (without id/source) that is merged onto the outline layer: top-level fields first, then layout and paint are merged per property so base defaults survive. Use this to set any line property the curated fields above don't cover (e.g. line-gap-width, line-cap, line-join, line-pattern).

    The curated fields (color, opacity, width) take precedence over the same paint properties set here.

    line: {
    color: '#00A65E',
    layer: { paint: { 'line-gap-width': 3 }, layout: { 'line-cap': 'round' } },
    }
    opacity?: DataDrivenPropertyValueSpecification<number>

    Border opacity, 0 (transparent) to 1 (opaque). Also accepts a MapLibre expression.

    1
    
    width?: DataDrivenPropertyValueSpecification<number>

    Border width in pixels. Also accepts a MapLibre expression (e.g. ['case', ['get', 'selected'], 4, 2]).

    2