Skip to content

HeatmapStyle

Namespace: ThinkGeo.Core

Draws point features as a heatmap: each point spreads a Gaussian of heat over HeatmapStyle.Radius, the heat adds up where points crowd, and the summed density is coloured through HeatmapStyle.ColorStops.

public class HeatmapStyle : Style

Inheritance object → Style → HeatmapStyle

Remarks:

This is the heatmap MapLibre GL draws, and the one a HeatmapStyleLayer draws on the GPU map: the properties are the style spec's heatmap-radius, heatmap-weight, heatmap-intensity, heatmap-opacity and heatmap-color, with the same defaults, so the same values draw the same picture on either map.

Properties

Radius

Gets or sets how far each point's heat reaches: screen pixels by default, as heatmap-radius, or a ground distance when HeatmapStyle.RadiusUnit is set. The default is 30.

public float Radius { get; set; }

Property Value

float

RadiusUnit

Gets or sets the unit of HeatmapStyle.Radius. Null, the default, is screen pixels: the heat keeps its size on screen at every zoom, as on a web map. A distance unit makes the radius a ground distance - the heat covers the same area on the ground and grows and shrinks with the map, for a service radius or a coverage area.

public Nullable<DistanceUnit> RadiusUnit { get; set; }

Property Value

Nullable<DistanceUnit>

Weight

Gets or sets how much heat one point adds, as heatmap-weight. The default is 1. With HeatmapStyle.WeightColumnName set, each point's column value is multiplied by this.

public float Weight { get; set; }

Property Value

float

WeightColumnName

Gets or sets the column each point's weight is read from; empty, the default, gives every point the same weight. A value that is missing or not a number adds no heat.

public string WeightColumnName { get; set; }

Property Value

string

Intensity

Gets or sets a multiplier on the summed density, as heatmap-intensity. The default is 1; raise it to reach the hot end of HeatmapStyle.ColorStops with fewer points.

public float Intensity { get; set; }

Property Value

float

Opacity

Gets or sets the opacity of the whole heatmap, 0 to 1, as heatmap-opacity. The default is 1.

public float Opacity { get; set; }

Property Value

float

ColorStops

Gets the colour ramp over the density, 0 to 1, as heatmap-color: MapLibre's default, clear through blue, cyan, lime and yellow to red. Clear it and add stops of your own to recolour; colour and alpha both blend between stops.

public Collection<ColorStop> ColorStops { get; }

Property Value

Collection<ColorStop>

Name

This property gets and set the name of the style.

public string Name { get; set; }

Property Value

string
This property gets the name of the style.

Remarks:

This name is not used by the system; it is only for the developer. However, it can be used if you generate your own legend.

IsActive

This property gets and sets the active status of the style.

public bool IsActive { get; set; }

Property Value

bool
This property gets the active status of the style.

Remarks:

If the style is not active then it will not draw.

RequiredColumnNames

This property gets the collection of fields that are required for the style.

public Collection<string> RequiredColumnNames { get; }

Property Value

Collection<string>

Remarks:

This property gets the collection of fields that are required for the style. These are in addition to any other columns you specify in styles that inherit from this one. For example, if you have use a ValueStyle and it requires a column name for the value comparison, then that column does not need to be in this collection. You only use the RequiredColumnNames for columns you need beyond those required by specific inherited styles.

Filters

Gets the list of SQL-style filters applied to this style.

public Collection<string> Filters { get; }

Property Value

Collection<string>

LabelDisplayMode

Gets the current label display mode that determines whether labels, shapes, or both are rendered.

public LabelDisplayMode LabelDisplayMode { get; }

Property Value

LabelDisplayMode

Constructors

HeatmapStyle()

public HeatmapStyle()

Methods

DrawCore(IEnumerable<Feature>, GeoCanvas, Collection<SimpleCandidate>, Collection<SimpleCandidate>)

protected void DrawCore(IEnumerable<Feature> features, GeoCanvas canvas, Collection<SimpleCandidate> labelsInThisLayer, Collection<SimpleCandidate> labelsInAllLayers)

Parameters

features IEnumerable<Feature>

canvas GeoCanvas

labelsInThisLayer Collection<SimpleCandidate>

labelsInAllLayers Collection<SimpleCandidate>

Returns

void

GetRequiredColumnNamesCore()

protected Collection<string> GetRequiredColumnNamesCore()

Returns

Collection<string>