ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureLayer Class / SetPreviousObservationsCount Method
The number of maximum previous observations to display for each track.
Example

In This Topic
    SetPreviousObservationsCount Method
    In This Topic
    Specifies the maximum number of previous observations to be displayed for each track.
    Syntax
    Public Sub SetPreviousObservationsCount( _
       ByVal previousObservationsCount As Integer _
    ) 
    public void SetPreviousObservationsCount( 
       int previousObservationsCount
    )

    Parameters

    previousObservationsCount
    The number of maximum previous observations to display for each track.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    This feature layer does not support tracks.
    Remarks
    Non-track aware layers will throw a System.InvalidOperationException
    Example
    Make Track Lines and Previous Observations Visible
    {
      //The layer must be track aware and spatial for these settings
      //to have an effect
    
      if (streamLayer.TrackType != TrackType.Spatial)
      {
        // not track aware and spatial
      }
    
      // Note: call within QueuedTask.Run()
      {
        //Note: Setting PreviousObservationsCount larger than the 
        //"SetExpirationMaxCount()" has no effect
        streamLayer.SetPreviousObservationsCount(6);
        if (!streamLayer.AreTrackLinesVisible)
          streamLayer.SetTrackLinesVisibility(true);
        if (!streamLayer.ArePreviousObservationsVisible)
          streamLayer.SetPreviousObservationsVisibility(true);
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also