public class UniqueValueRendererDefinition : RendererDefinition
Public Class UniqueValueRendererDefinition Inherits RendererDefinition
public class UniqueValueRendererDefinition : RendererDefinition
Public Class UniqueValueRendererDefinition Inherits RendererDefinition
await QueuedTask.Run(() => { var fields = new List<string> { "Type" }; //field to be used to retrieve unique values CIMPointSymbol pointSym = SymbolFactory.Instance.ConstructPointSymbol( ColorFactory.Instance.GreenRGB, 16.0, SimpleMarkerStyle.Pushpin); //constructing a point symbol as a template symbol CIMSymbolReference symbolPointTemplate = pointSym.MakeSymbolReference(); //constructing renderer definition for unique value renderer UniqueValueRendererDefinition uniqueValueRendererDef = new UniqueValueRendererDefinition(fields, symbolPointTemplate); //creating a unique value renderer var flyr = MapView.Active.GetSelectedLayers()[0] as FeatureLayer; CIMUniqueValueRenderer uniqueValueRenderer = flyr.CreateRenderer(uniqueValueRendererDef) as CIMUniqueValueRenderer; //setting the renderer to the feature layer flyr.SetRenderer(uniqueValueRenderer); });
var uvrDef = new UniqueValueRendererDefinition() { ValueFields = new List<string> { "ACTYPE" }, SymbolTemplate = SymbolFactory.Instance.ConstructPointSymbol( ColorFactory.Instance.RedRGB, 10, SimpleMarkerStyle.Hexagon) .MakeSymbolReference(), ValuesLimit = 5 }; //Note: CreateRenderer can only create value classes based on //the current events it has received streamLayer.SetRenderer(streamLayer.CreateRenderer(uvrDef));
System.Object
ArcGIS.Desktop.Mapping.LayerDrawingDefinition
ArcGIS.Desktop.Mapping.RendererDefinition
ArcGIS.Desktop.Mapping.UniqueValueRendererDefinition
Target Platforms: Windows 11, Windows 10