On this page

Type Alias FillLayerSpecification

type FillLayerSpecification = {
    filter?: FilterSpecification;
    id: string;
    layout?: {
        "fill-sort-key"?: DataDrivenPropertyValueSpecification<number>;
        visibility?: VisibilitySpecification;
    };
    maxzoom?: number;
    metadata?: unknown;
    minzoom?: number;
    paint?: {
        "fill-antialias"?: PropertyValueSpecification<boolean>;
        "fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
        "fill-color-transition"?: TransitionSpecification;
        "fill-layer-opacity"?: PropertyValueSpecification<number>;
        "fill-layer-opacity-transition"?: TransitionSpecification;
        "fill-opacity"?: DataDrivenPropertyValueSpecification<number>;
        "fill-opacity-transition"?: TransitionSpecification;
        "fill-outline-color"?: DataDrivenPropertyValueSpecification<
            ColorSpecification,
        >;
        "fill-outline-color-transition"?: TransitionSpecification;
        "fill-pattern"?: DataDrivenPropertyValueSpecification<
            ResolvedImageSpecification,
        >;
        "fill-pattern-transition"?: TransitionSpecification;
        "fill-translate"?: PropertyValueSpecification<[number, number]>;
        "fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
        "fill-translate-transition"?: TransitionSpecification;
    };
    source: string;
    "source-layer"?: string;
    type: "fill";
}
Index

Properties

A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The feature-state expression is not supported in filter expressions.

id: string

Unique layer name.

layout?: {
    "fill-sort-key"?: DataDrivenPropertyValueSpecification<number>;
    visibility?: VisibilitySpecification;
}

Layout properties for the layer.

Type Declaration

  • Optionalfill-sort-key?: DataDrivenPropertyValueSpecification<number>

    Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

  • Optionalvisibility?: VisibilitySpecification

    Whether this layer is displayed.

    "visible"
    
maxzoom?: number

The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.

metadata?: unknown

Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.

{"source:comment": "Hydrology FCCODE 460 - Narrow wash"}
minzoom?: number

The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.

paint?: {
    "fill-antialias"?: PropertyValueSpecification<boolean>;
    "fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
    "fill-color-transition"?: TransitionSpecification;
    "fill-layer-opacity"?: PropertyValueSpecification<number>;
    "fill-layer-opacity-transition"?: TransitionSpecification;
    "fill-opacity"?: DataDrivenPropertyValueSpecification<number>;
    "fill-opacity-transition"?: TransitionSpecification;
    "fill-outline-color"?: DataDrivenPropertyValueSpecification<
        ColorSpecification,
    >;
    "fill-outline-color-transition"?: TransitionSpecification;
    "fill-pattern"?: DataDrivenPropertyValueSpecification<
        ResolvedImageSpecification,
    >;
    "fill-pattern-transition"?: TransitionSpecification;
    "fill-translate"?: PropertyValueSpecification<[number, number]>;
    "fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
    "fill-translate-transition"?: TransitionSpecification;
}

Default paint properties for this layer.

Type Declaration

  • Optionalfill-antialias?: PropertyValueSpecification<boolean>

    Whether or not the fill should be antialiased.

    true
    
  • Optionalfill-color?: DataDrivenPropertyValueSpecification<ColorSpecification>

    The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used. When used with an SDF fill pattern, this serves as the foreground color of the pattern.

    "#000000"
    
  • Optionalfill-color-transition?: TransitionSpecification
  • Optionalfill-layer-opacity?: PropertyValueSpecification<number>

    Opacity applied to the layer as a whole. Unlike fill-opacity and alpha values in fill-color, which are applied per feature and accumulate where fills overlap, fill-layer-opacity is applied once so overlapping fills appear as a single surface at the given opacity. When both fill-opacity and fill-layer-opacity are set, the per-feature, overlap accumulation is preserved, then fill-layer-opacity composites the result. This property affects only the layer it is set on and cannot be used to composite multiple layers together or control how this layer blends with layers above or below it.

    fill-opacity vs. fill-layer-opacity

    1
    
  • Optionalfill-layer-opacity-transition?: TransitionSpecification
  • Optionalfill-opacity?: DataDrivenPropertyValueSpecification<number>

    The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1px stroke around the fill, if the stroke is used.

    1
    
  • Optionalfill-opacity-transition?: TransitionSpecification
  • Optionalfill-outline-color?: DataDrivenPropertyValueSpecification<ColorSpecification>

    The outline color of the fill. Matches the value of fill-color if unspecified.

  • Optionalfill-outline-color-transition?: TransitionSpecification
  • Optionalfill-pattern?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>

    Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

  • Optionalfill-pattern-transition?: TransitionSpecification
  • Optionalfill-translate?: PropertyValueSpecification<[number, number]>

    The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.

    [0, 0]
    
  • Optionalfill-translate-anchor?: PropertyValueSpecification<"map" | "viewport">

    Controls the frame of reference for fill-translate.

    "map"
    
  • Optionalfill-translate-transition?: TransitionSpecification
source: string

Name of a source description to be used for this layer. Required for all layer types except background.

"source-layer"?: string

Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.

type: "fill"
Was this helpful?
SDK JS
Reference
FillLayerSpecification