On this page

Type Alias RasterLayerSpecification

type RasterLayerSpecification = {
    filter?: FilterSpecification;
    id: string;
    layout?: { visibility?: VisibilitySpecification };
    maxzoom?: number;
    metadata?: unknown;
    minzoom?: number;
    paint?: {
        "raster-brightness-max"?: PropertyValueSpecification<number>;
        "raster-brightness-max-transition"?: TransitionSpecification;
        "raster-brightness-min"?: PropertyValueSpecification<number>;
        "raster-brightness-min-transition"?: TransitionSpecification;
        "raster-contrast"?: PropertyValueSpecification<number>;
        "raster-contrast-transition"?: TransitionSpecification;
        "raster-fade-duration"?: PropertyValueSpecification<number>;
        "raster-hue-rotate"?: PropertyValueSpecification<number>;
        "raster-hue-rotate-transition"?: TransitionSpecification;
        "raster-opacity"?: PropertyValueSpecification<number>;
        "raster-opacity-transition"?: TransitionSpecification;
        "raster-resampling"?: PropertyValueSpecification<"linear" | "nearest">;
        "raster-saturation"?: PropertyValueSpecification<number>;
        "raster-saturation-transition"?: TransitionSpecification;
        resampling?: PropertyValueSpecification<"linear" | "nearest">;
    };
    source: string;
    "source-layer"?: string;
    type: "raster";
}
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?: { visibility?: VisibilitySpecification }

Layout properties for the layer.

Type Declaration

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?: {
    "raster-brightness-max"?: PropertyValueSpecification<number>;
    "raster-brightness-max-transition"?: TransitionSpecification;
    "raster-brightness-min"?: PropertyValueSpecification<number>;
    "raster-brightness-min-transition"?: TransitionSpecification;
    "raster-contrast"?: PropertyValueSpecification<number>;
    "raster-contrast-transition"?: TransitionSpecification;
    "raster-fade-duration"?: PropertyValueSpecification<number>;
    "raster-hue-rotate"?: PropertyValueSpecification<number>;
    "raster-hue-rotate-transition"?: TransitionSpecification;
    "raster-opacity"?: PropertyValueSpecification<number>;
    "raster-opacity-transition"?: TransitionSpecification;
    "raster-resampling"?: PropertyValueSpecification<"linear" | "nearest">;
    "raster-saturation"?: PropertyValueSpecification<number>;
    "raster-saturation-transition"?: TransitionSpecification;
    resampling?: PropertyValueSpecification<"linear" | "nearest">;
}

Default paint properties for this layer.

Type Declaration

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: "raster"
Was this helpful?
SDK JS
Reference
RasterLayerSpecification