On this page

Type Alias HeatmapLayerOptions

type HeatmapLayerOptions = {
    beforeId?: string;
    colorRamp?: ColorRamp;
    data: FeatureCollection | string;
    intensity?: number | ZoomNumberValues;
    layerId?: string;
    maxzoom?: number;
    minzoom?: number;
    opacity?: number | ZoomNumberValues;
    property?: string;
    radius?: number | ZoomNumberValues | PropertyValues;
    sourceId?: string;
    weight?: PropertyValues | number;
    zoomCompensation?: boolean;
}
Index

Properties

beforeId?: string

The ID of an existing layer to insert the new layer before, resulting in the new layer appearing visually beneath the existing layer. If this argument is not specified, the layer will be appended to the end of the layers array and appear visually above all other layers.

colorRamp?: ColorRamp

The ColorRamp instance to use for visualization. The color ramp is expected to be defined in the range [0, 1] or else will be forced to this range. Default: ColorRampCollection.TURBO

data: FeatureCollection | string

A geojson Feature collection or a URL to a geojson or the UUID of a MapTiler Cloud dataset.

intensity?: number | ZoomNumberValues

The intensity is zoom-dependent. By default, the intensity is going to be scaled by zoom to preserve a natural aspect or the data distribution.

layerId?: string

ID to give to the layer. If not provided, an auto-generated ID of the for "maptiler-layer-xxxxxx" will be auto-generated, with "xxxxxx" being a random string.

maxzoom?: number

Zoom level after which it no longer show. Default: 22

minzoom?: number

Zoom level at which it starts to show. Default: 0

opacity?: number | ZoomNumberValues

The opacity can be a fixed value or zoom-driven. Default: fades-in 0.25z after minzoom and fade-out 0.25z before maxzoom

property?: string

Use a property to apply a weight to each data point. Using a property requires also using the options .propertyValueWeight or otherwise will be ignored. Default: none, the points will all have a weight of 1.

radius?: number | ZoomNumberValues | PropertyValues

The radius (in screenspace) can be:

  • a fixed number that will be constant across zoom level
  • of type ZoomNumberValues to be ramped accoding to zoom level (.zoomCompensation will then be ignored)
  • of type PropertyValues to be driven by the value of a property. If so, the option .property must be provided and will still be resized according to zoom level, unless the option .zoomCompensation is set to false.

Default:

sourceId?: string

ID to give to the geojson source. If not provided, an auto-generated ID of the for "maptiler-source-xxxxxx" will be auto-generated, with "xxxxxx" being a random string.

weight?: PropertyValues | number

The weight to give to each data point. If of type PropertyValueWeights, then the options .property must also be provided. If used a number, all data points will be weighted by the same number (which is of little interest)

zoomCompensation?: boolean

If the radius is driven by a property, then it will also scale by zoomming if .zoomCompensation is true. If false, the radius will not adapt according to the zoom level. Default: true

Was this helpful?
SDK JS
Reference
HeatmapLayerOptions