ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureLayer Class / TrackType Property
Example

In This Topic
    TrackType Property
    In This Topic
    Gets the nature of the tracking data present in this feature layer.
    Syntax
    public TrackType TrackType {get;}
    Public ReadOnly Property TrackType As TrackType
    Example
    Determine the Stream Layer type
    //spatial or non-spatial?
    if (streamLayer.TrackType == TrackType.AttributeOnly)
    {
      //this is a non-spatial stream layer
    }
    else
    {
      //this must be a spatial stream layer
    }
    Get The Track Type
    var trackType = streamLayer.TrackType;
    switch(trackType)
    {
      //TODO deal with tracktype
      case TrackType.None:
      case TrackType.AttributeOnly:
      case TrackType.Spatial:
        break;
    }
    Set Various Stream Layer properties via the CIM
    //The layer must be track aware and spatial
    if (streamLayer.TrackType != TrackType.Spatial)
      return;
    //Must be on QueuedTask
    //get the CIM Definition
    var def = streamLayer.GetDefinition() as CIMFeatureLayer;
    //set the number of previous observations, 
    def.PreviousObservationsCount = (int)streamLayer.GetExpirationMaxCount() - 1;
    //set show previous observations and track lines to true
    def.ShowPreviousObservations = true;
    def.ShowTracks = true;
    //commit the changes
    streamLayer.SetDefinition(def);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also