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

    Type Alias GeometryFillConfig

    Fill configuration for geometry styling — the interior color and opacity.

    // Solid color with opacity
    const fill: GeometryFillConfig = { color: '#FF5733', opacity: 0.3 };

    // One colour per feature, in turn, from your own palette
    const fill: GeometryFillConfig = { palette: ['#1d3f8a', '#e63312', '#f5d000'], opacity: 0.25 };

    // Data-driven color based on properties
    const fill: GeometryFillConfig = {
    color: ['match', ['get', 'type'], 'residential', '#FFEB3B', 'commercial', '#2196F3', '#E0E0E0'],
    opacity: 0.4,
    };
    type GeometryFillConfig = {
        color?: string | ExpressionSpecification;
        opacity?: DataDrivenPropertyValueSpecification<number>;
        palette?: string[];
    }
    Index
    color?: string | ExpressionSpecification

    Fill color: a CSS colour string ('#FF5733') or a MapLibre expression for data-driven styling (e.g. ['get', 'color']).

    Overrides palette and the top-level GeometriesModuleConfig.color, for the fill and the border; the full order is on the latter.

    opacity?: DataDrivenPropertyValueSpecification<number>

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

    0.15
    
    palette?: string[]

    CSS colours the features are filled with, one per feature in turn, starting over after the last. An empty list counts as unset.

    Overrides the top-level GeometriesModuleConfig.color, for the fill and the border; the full order is on the latter. To follow a map theme, pass its colours — e.g. [colors.accent, colors.vegetation, colors.water] from the map-theme plugin's deriveMapColors.