Skip to main content

HeatmapPointStorage Class

The data adapter that stores manually added heatmap points.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

Declaration

public class HeatmapPointStorage :
    IHeatmapPointSource

Example

This example shows how to create a heatmap layer for the Map Control.

using DevExpress.XtraMap;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Windows.Forms;

namespace HeatMapSample {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e) {

            ChoroplethColorizer colorizer = new ChoroplethColorizer();
            colorizer.RangeStops.AddRange(new double[] { 0.1, 0.2, 0.7, 1 });
            colorizer.ColorItems.Add(new ColorizerColorItem(Color.FromArgb(50, 128, 255, 0)));
            colorizer.ColorItems.Add(new ColorizerColorItem(Color.FromArgb(255, 255, 255, 0)));
            colorizer.ColorItems.Add(new ColorizerColorItem(Color.FromArgb(255, 234, 72, 58)));
            colorizer.ColorItems.Add(new ColorizerColorItem(Color.FromArgb(255, 162, 36, 25)));
            colorizer.ApproximateColors = true;

            HeatmapPointStorage pointStorage = new HeatmapPointStorage();
            pointStorage.Points.AddRange(new List<HeatmapPoint> {
                new HeatmapPoint(new GeoPoint(23.5309, -0.4211), 1),
                new HeatmapPoint(new GeoPoint(32.3248, 21.0537), 0.5),
                new HeatmapPoint(new GeoPoint(14.1503, 16.3626), 1),
                new HeatmapPoint(new GeoPoint(7.2144,  34.2711), 1),
                new HeatmapPoint(new GeoPoint(-4.5456, 10.1143), 0.5)
            });

            HeatmapProvider provider = new HeatmapProvider();
            provider.PointSource = pointStorage;
            provider.Algorithm = new HeatmapDensityBasedAlgorithm { PointRadius = 50 };
            provider.Colorizer = colorizer;

            ImageLayer heatmapLayer = new ImageLayer();
            heatmapLayer.DataProvider = provider;
            mapControl1.Layers.Add(heatmapLayer);
        }
    }
}

Implements

Inheritance

Object
HeatmapPointStorage
See Also