Type Alias 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;
}
Properties
OptionalbeforeId
OptionalcolorRamp
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
A geojson Feature collection or a URL to a geojson or the UUID of a MapTiler Cloud dataset.
Optionalintensity
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.
OptionallayerId
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.
Optionalmaxzoom
Zoom level after which it no longer show.
Default: 22
Optionalminzoom
Zoom level at which it starts to show.
Default: 0
Optionalopacity
The opacity can be a fixed value or zoom-driven. Default: fades-in 0.25z after minzoom and fade-out 0.25z before maxzoom
Optionalproperty
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.
Optionalradius
The radius (in screenspace) can be:
- a fixed number that will be constant across zoom level
- of type
ZoomNumberValuesto be ramped accoding to zoom level (.zoomCompensationwill then be ignored) - of type
PropertyValuesto be driven by the value of a property. If so, the option.propertymust be provided and will still be resized according to zoom level, unless the option.zoomCompensationis set tofalse.
Default:
OptionalsourceId
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.
Optionalweight
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)
OptionalzoomCompensation
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
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.