On this page

Type Alias HeatmapLayerSpecification

type HeatmapLayerSpecification = {
    filter?: FilterSpecification;
    id: string;
    layout?: { visibility?: VisibilitySpecification };
    maxzoom?: number;
    metadata?: unknown;
    minzoom?: number;
    paint?: {
        "heatmap-color"?: ExpressionSpecification;
        "heatmap-intensity"?: PropertyValueSpecification<number>;
        "heatmap-intensity-transition"?: TransitionSpecification;
        "heatmap-opacity"?: PropertyValueSpecification<number>;
        "heatmap-opacity-transition"?: TransitionSpecification;
        "heatmap-radius"?: DataDrivenPropertyValueSpecification<number>;
        "heatmap-radius-transition"?: TransitionSpecification;
        "heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
    };
    source: string;
    "source-layer"?: string;
    type: "heatmap";
}
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?: {
    "heatmap-color"?: ExpressionSpecification;
    "heatmap-intensity"?: PropertyValueSpecification<number>;
    "heatmap-intensity-transition"?: TransitionSpecification;
    "heatmap-opacity"?: PropertyValueSpecification<number>;
    "heatmap-opacity-transition"?: TransitionSpecification;
    "heatmap-radius"?: DataDrivenPropertyValueSpecification<number>;
    "heatmap-radius-transition"?: TransitionSpecification;
    "heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
}

Default paint properties for this layer.

Type Declaration

  • Optionalheatmap-color?: ExpressionSpecification

    Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses ["heatmap-density"] as input.

    [
        "interpolate",
        ["linear"],
        ["heatmap-density"],
        0,
        "rgba(0, 0, 255, 0)",
        0.1,
        "royalblue",
        0.3,
        "cyan",
        0.5,
        "lime",
        0.7,
        "yellow",
        1,
        "red"
    ]
    
  • Optionalheatmap-intensity?: PropertyValueSpecification<number>

    Similar to heatmap-weight but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.

    1
    
  • Optionalheatmap-intensity-transition?: TransitionSpecification
  • Optionalheatmap-opacity?: PropertyValueSpecification<number>

    The global opacity at which the heatmap layer will be drawn.

    1
    
  • Optionalheatmap-opacity-transition?: TransitionSpecification
  • Optionalheatmap-radius?: DataDrivenPropertyValueSpecification<number>

    Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.

    30
    
  • Optionalheatmap-radius-transition?: TransitionSpecification
  • Optionalheatmap-weight?: DataDrivenPropertyValueSpecification<number>

    A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.

    1
    
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: "heatmap"
Was this helpful?
SDK JS
Reference
HeatmapLayerSpecification