All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

HeatmapProvider.PointSource Property

Gets or sets the heatmap provider’s point source.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v21.1.dll

Declaration

[DefaultValue(null)]
public IHeatmapPointSource PointSource { get; set; }

Property Value

Type Default Description
IHeatmapPointSource

null

An object of the class that implements the IHeatmapPointSource interface and represents a point source.

Remarks

You can use the following objects to set the PointSource property:

Example

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

using DevExpress.XtraMap;
using System;
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) {

            ImageLayer bingLayer = new ImageLayer();
            bingLayer.DataProvider = new BingMapDataProvider { BingKey = "Your Bing Maps key here." };
            mapControl1.Layers.Add(bingLayer);

            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;

            HeatmapDataSourceAdapter adapter = new HeatmapDataSourceAdapter();
            adapter.Mappings.XCoordinate = "glon"; // The data source field name that provides x-coordinates.
            adapter.Mappings.YCoordinate = "glat"; // The data source field name that provides y-coordinates.
            adapter.DataSource = LoadData("../../Data/Earthquakes.xml", "Row");

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

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

            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);
        }
        DataTable LoadData(string filePath, string tableName) {
            DataSet xmlDataSet = new DataSet("XML DataSet");
            xmlDataSet.ReadXml(filePath);
            return xmlDataSet.Tables[tableName];
        }
    }
}
See Also