

Public Class HeatMapRendererDefinition Inherits RendererDefinition
public class HeatMapRendererDefinition : RendererDefinition
Once you define a heat map renderer, you can call a FeatureLayer's CreateRenderer and SetRenderer methods to create and assign a renderer to a point feature layer.
Only applicable for point feature layers.
{
string colorBrewerSchemesName = "ArcGIS Colors";
//Get the style project item that contains the color ramps
//Refer to the Initialize region for an example of how to get a style item
//and the color ramp from it.
//Note: Run within a QueuedTask
//defining a heatmap renderer that uses values from Population field as the weights
HeatMapRendererDefinition heatMapDef = new HeatMapRendererDefinition()
{
Radius = 20,
WeightField = "Population",
ColorRamp = colorRamp,
RendereringQuality = 8,
UpperLabel = "High Density",
LowerLabel = "Low Density"
};
CIMHeatMapRenderer heatMapRndr = featureLayer.CreateRenderer(heatMapDef) as CIMHeatMapRenderer;
featureLayer.SetRenderer(heatMapRndr);
}
/// <summary> /// Renders a point feature layer using a continuous color gradient to represent density of points. ///  /// </summary> { //Check feature layer name //Code works with the U.S. Cities feature layer available with the ArcGIS Pro SDK Sample data var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(f => f.Name == "U.S. Cities"); if (featureLayer == null) { MessageBox.Show("This renderer works with the U.S. Cities feature layer available with the ArcGIS Pro SDK Sample data", "Data missing"); } //defining a heatmap renderer that uses values from Population field as the weights HeatMapRendererDefinition heatMapDef = new HeatMapRendererDefinition() { Radius = 20, WeightField = "NumericField", ColorRamp = colorRamp, RendereringQuality = 8, UpperLabel = "High Density", LowerLabel = "Low Density" }; //Note: Run within QueuedTask CIMHeatMapRenderer heatMapRndr = (CIMHeatMapRenderer)featureLayer.CreateRenderer(heatMapDef); featureLayer.SetRenderer(heatMapRndr); }
System.Object
ArcGIS.Desktop.Mapping.LayerDrawingDefinition
ArcGIS.Desktop.Mapping.RendererDefinition
ArcGIS.Desktop.Mapping.HeatMapRendererDefinition
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)