Back to Devexpress

HeatmapPointStorage.Points Property

wpf-devexpress-dot-xpf-dot-map-dot-heatmappointstorage.md

latest4.8 KB
Original Source

HeatmapPointStorage.Points Property

Returns a collection of points used to plot a heatmap.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public HeatmapPointCollection Points { get; }
vb
Public ReadOnly Property Points As HeatmapPointCollection

Property Value

TypeDescription
HeatmapPointCollection

A collection of HeatmapPoint objects.

|

Example

This example shows how to use a HeatmapPointStorage object to create a heatmap layer.

Markup:

xaml
<dxm:MapControl>
    <dxm:ImageLayer>
        <dxm:HeatmapProvider>
            <dxm:HeatmapProvider.PointSource>
                <dxm:HeatmapPointStorage x:Name="storage"/>
            </dxm:HeatmapProvider.PointSource>
            <dxm:HeatmapProvider.Algorithm>
                <dxm:HeatmapDensityBasedAlgorithm PointRadius="50"/>
            </dxm:HeatmapProvider.Algorithm>
            <dxm:HeatmapProvider.Colorizer>
                <dxm:ChoroplethColorizer RangeStops="0.1, 0.2, 0.7, 1.0" 
                                         ApproximateColors="True">
                    <dxm:ChoroplethColorizer.Colors>
                        <Color A="50" R="128" G="255" B="0"/>
                        <Color A="255" R="255" G="255" B="0"/>
                        <Color A="255" R="234" G="72" B="58"/>
                        <Color A="255" R="162" G="36" B="25"/>
                    </dxm:ChoroplethColorizer.Colors>
                </dxm:ChoroplethColorizer>
            </dxm:HeatmapProvider.Colorizer>
        </dxm:HeatmapProvider>
    </dxm:ImageLayer>
</dxm:MapControl>

Code-Behind:

csharp
using System.Windows;
using DevExpress.Xpf.Map;
namespace HeatmapPointStorage {
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            storage.Points.Add(new HeatmapPoint(new GeoPoint(23.5309, -0.4211), 1));
            storage.Points.Add(new HeatmapPoint(new GeoPoint(32.3248, 21.0537), 0.5));
            storage.Points.Add(new HeatmapPoint(new GeoPoint(14.1503, 16.3626), 1));
            storage.Points.Add(new HeatmapPoint(new GeoPoint(7.2144, 34.2711), 1));
            storage.Points.Add(new HeatmapPoint(new GeoPoint(-4.5456, 10.1143), 0.5));
        }
    }
}
vb
Imports System.Windows
Imports DevExpress.Xpf.Map
Namespace HeatmapPointStorage
    Public Partial Class MainWindow
        Inherits Window
        Public Sub New()
            InitializeComponent()
            storage.Points.Add(New HeatmapPoint(New GeoPoint(23.5309, -0.4211), 1))
            storage.Points.Add(New HeatmapPoint(New GeoPoint(32.3248, 21.0537), 0.5))
            storage.Points.Add(New HeatmapPoint(New GeoPoint(14.1503, 16.3626), 1))
            storage.Points.Add(New HeatmapPoint(New GeoPoint(7.2144, 34.2711), 1))
            storage.Points.Add(New HeatmapPoint(New GeoPoint(-4.5456, 10.1143), 0.5))
        End Sub
    End Class
End Namespace

You can also create heatmap points in XAML:

xaml
<dxm:HeatmapProvider.PointSource>
    <dxm:HeatmapPointStorage>
        <dxm:HeatmapPointStorage.Points>
            <dxm:HeatmapPoint Value="0.5">
                <dxm:HeatmapPoint.Location>
                    <dxm:GeoPoint Latitude="32.3248" Longitude="21.0537"/>
                </dxm:HeatmapPoint.Location>
            </dxm:HeatmapPoint>
            <!-- Other heatmap points. -->
        </dxm:HeatmapPointStorage.Points>
    </dxm:HeatmapPointStorage>
</dxm:HeatmapProvider.PointSource>

See Also

HeatmapPointStorage Class

HeatmapPointStorage Members

DevExpress.Xpf.Map Namespace