Gets whether this Feature Layer supports track related functionality.
Find all Stream Layers that are Track Aware
var trackAwareLayers = MapView.Active.Map.GetLayersAsFlattenedList()
.OfType<StreamLayer>().Where(sl => sl.IsTrackAware)?.ToList();
Get the Track Id Field
if (streamLayer.IsTrackAware)
{
var trackField = streamLayer.TrackIdFieldName;
//TODO use the field name
}
Set the Maximum Count of Previous Observations to be Stored in Memory
//Must be on QueuedTask
//Set Expiration Method and Max Expiration Count
if (streamLayer.GetExpirationMethod() != FeatureExpirationMethod.MaximumFeatureCount)
streamLayer.SetExpirationMethod(FeatureExpirationMethod.MaximumFeatureCount);
streamLayer.SetExpirationMaxCount(15);
//FYI
if (streamLayer.IsTrackAware)
{
//MaxCount is per track! otherwise for the entire layer
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.