Back to Devexpress

HeatmapProvider Class

windowsforms-devexpress-dot-xtramap-d884698a.md

latest4.4 KB
Original Source

HeatmapProvider Class

Allows you to draw a heatmap on the Map Control surface.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public class HeatmapProvider :
    FullRequestedDataProvider,
    IHeatImageContextProvider,
    IFullRequestedContextProvider,
    IUnitConverterProvider,
    IColorizerProvider,
    ILegendDataProvider
vb
Public Class HeatmapProvider
    Inherits FullRequestedDataProvider
    Implements IHeatImageContextProvider,
               IFullRequestedContextProvider,
               IUnitConverterProvider,
               IColorizerProvider,
               ILegendDataProvider

Remarks

The following image shows a sample heatmap:

Run Demo: Heat Map

Follow the steps below to create a heatmap:

  • Begin with an ImageLayer object and add it to the MapControl.Layers collection.

  • Assign a HeatmapProvider object to the ImageLayer.DataProvider property.

  • Initialize the PointSource property to configure a source of heatmap points. Each heatmap point can be defined by its geo location and weight value (optional).

  • Specify an algorithm the Map Control should use to create a heatmap. Set the Algorithm property to a HeatmapDensityBasedAlgorithm object. At this time, this is the only available algorithm and it builds heatmaps based on point density. Additional algorithms will be implemented in future versions of this product.

Tip

The following help topic describes the algorithm used to color heatmap points: HeatmapPoint.Value.

Add a Legend

Use the code below to add a legend with a gradient scale.

csharp
ColorScaleLegend legend = new ColorScaleLegend();
legend.Header = "Seismic Density";
legend.EnableGradientScale = true;
legend.Layer = heatmapLayer;
legend.HeaderStyle.Font = new Font("Tahoma", 12F);
mapControl1.Legends.Add(legend);
vb
Dim legend As ColorScaleLegend = New ColorScaleLegend
legend.Header = "Seismic Density"
legend.EnableGradientScale = true
legend.Layer = heatmapLayer
legend.HeaderStyle.Font = New Font("Tahoma", 12!)
mapControl1.Legends.Add(legend)

Related API members

Inheritance

Object MapDisposableObject MapImageDataProviderBase DevExpress.XtraMap.FullRequestedDataProvider HeatmapProvider

See Also

HeatmapProvider Members

DevExpress.XtraMap Namespace