This is the documentation of version 0.61.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 a palette
    const fill: GeometryFillConfig = { palette: 'blues', 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?: ColorPaletteOptions;
    }
    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
    

    Named palette the features take their fill colours from, one per feature in turn (see colorPaletteIDs). On dark map styles its colours are adapted to stay legible.

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