ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureRendererTarget Enumeration
Example Example

In This Topic
    FeatureRendererTarget Enumeration
    In This Topic
    Specifies a valid list of renderer objects that can exist on a FeatureLayer.
    Syntax
    Members
    MemberDescription
    DefaultThe default renderer.
    PreviousObservationsThe Previous Observations renderer.
    TrackLinesThe Track Lines renderer.
    Example
    Setting a unique value renderer for previous observations
    //The layer must be track aware and spatial
    if (streamLayer.TrackType != TrackType.Spatial)
      return;
    //Must be on QueuedTask!
    //Define unique value classes same as we do for current observations
    //or use "CreateRenderer(...)" to assign them automatically
    CIMUniqueValueClass uvcB727Prev = new CIMUniqueValueClass()
    {
      Values = new CIMUniqueValue[] { new CIMUniqueValue() {
        FieldValues = new string[] { "B727" } } },
      Visible = true,
      Label = "Boeing 727",
      Symbol = SymbolFactory.Instance.ConstructPointSymbol(
        CIMColor.CreateRGBColor(255, 0, 0), 4, SimpleMarkerStyle.Hexagon)
        .MakeSymbolReference()
    };
    
    CIMUniqueValueClass uvcD9Prev = new CIMUniqueValueClass()
    {
      Values = new CIMUniqueValue[] { new CIMUniqueValue() {
        FieldValues = new string[] { "DC9" } } },
      Visible = true,
      Label = "DC 9",
      Symbol = SymbolFactory.Instance.ConstructPointSymbol(
        CIMColor.CreateRGBColor(0, 255, 0), 4, SimpleMarkerStyle.Hexagon)
        .MakeSymbolReference()
    };
    
    CIMUniqueValueGroup uvGrpPrev = new CIMUniqueValueGroup()
    {
      Classes = new CIMUniqueValueClass[] { uvcB727Prev, uvcD9Prev }
    };
    
    var UVrndrPrev = new CIMUniqueValueRenderer()
    {
      Fields = new string[] { "ACTYPE" },
      Groups = new CIMUniqueValueGroup[] { uvGrpPrev },
      UseDefaultSymbol = true,
      DefaultLabel = "Others",
      DefaultSymbol = SymbolFactory.Instance.ConstructPointSymbol(
        CIMColor.CreateRGBColor(185, 185, 185), 4, SimpleMarkerStyle.Hexagon)
        .MakeSymbolReference()
    };
            
    streamLayer.SetRenderer(UVrndr, FeatureRendererTarget.PreviousObservations);
    Setting a simple renderer to draw track lines
    //The layer must be track aware and spatial
    if (streamLayer.TrackType != TrackType.Spatial)
      return;
    //Must be on QueuedTask!
    //Note: only a simple renderer with solid line symbol is supported for track 
    //line renderer
    var trackRenderer = new SimpleRendererDefinition()
    {
      SymbolTemplate = SymbolFactory.Instance.ConstructLineSymbol(
          ColorFactory.Instance.BlueRGB, 2, SimpleLineStyle.Solid)
            .MakeSymbolReference()
    };
    streamLayer.SetRenderer(
         streamLayer.CreateRenderer(trackRenderer), 
           FeatureRendererTarget.TrackLines);
    
    Retrieve the previous observation renderer
    //The layer must be track aware and spatial
    if (streamLayer.TrackType != TrackType.Spatial)
      return;
    //Must be on QueuedTask!
    var prev_renderer = streamLayer.GetRenderer(
        FeatureRendererTarget.PreviousObservations);
    
    Retrieve the track lines renderer
    //The layer must be track aware and spatial
    if (streamLayer.TrackType != TrackType.Spatial)
      return;
    //Must be on QueuedTask!
    var track_renderer = streamLayer.GetRenderer(
        FeatureRendererTarget.TrackLines);
    
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Desktop.Mapping.FeatureRendererTarget

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also