ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureLayer Class / SetPreviousObservationsVisibility Method
Indicates whether previous observations should be displayed.
Example

In This Topic
    SetPreviousObservationsVisibility Method
    In This Topic
    Specifies whether to display previous observations or not.
    Syntax
    public void SetPreviousObservationsVisibility( 
       bool previousObservationsVisible
    )
    Public Sub SetPreviousObservationsVisibility( _
       ByVal previousObservationsVisible As Boolean _
    ) 

    Parameters

    previousObservationsVisible
    Indicates whether previous observations should be displayed.
    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
    Check Previous Observation and Track Line Visibility
    //The layer must be track aware and spatial for these settings
    //to have an effect
    if (streamLayer.TrackType != TrackType.Spatial)
      return;
    //Must be on QueuedTask
    if (!streamLayer.AreTrackLinesVisible)
      streamLayer.SetTrackLinesVisibility(true);
    if (!streamLayer.ArePreviousObservationsVisible)
      streamLayer.SetPreviousObservationsVisibility(true);
    
    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)
      return;
    
    //Must be on QueuedTask
    
    //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, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also