Select to view content in your preferred language

Legend infos include "Track Lines" and "Previous Observations" even if showsTrackLine is false

151
2
a week ago
t-schaal
Emerging Contributor

Hello everyone,

we discovered that the legend infos for a DynamicEntityLayer always include the 2 entries "Track Lines" and "Previous Observations" even though track lines is not activated on the layer. Is this correct? Shouldn't these 2 legend infos only be included if tracking is active?

What we do:

let legendInfos = try await layer.legendInfos

-> for DynamicEntityLayers this always includes the 2 legend infos ("Track Lines" and "Previous Observations") even if tracking is not active:

let isTrackingActive = (layer as? DynamicEntityLayer)?.trackDisplayProperties.showsTrackLine

-> isTrackingActive is false in our case

 

0 Kudos
2 Replies
JaysenGomez
Esri Contributor

Thank you for reaching out. `legendInfos` currently lists “Track Lines” and “Previous Observations” based on the configured renderers, even when `showsTrackLine` / `showsPreviousObservations` are set to false. We've logged this and will consider fixing this behavior in a future release.  As a workaround, you can clear the renderers to remove those entries:

if let del = layer as? DynamicEntityLayer {
    let tdp = del.trackDisplayProperties    
    // Stop drawing
    tdp.showsTrackLine = false
    tdp.showsPreviousObservations = false    
    // Remove the legend sources
    tdp.trackLineRenderer = nil
    tdp.previousObservationRenderer = nil
}

 

t-schaal
Emerging Contributor

Thanks a lot for the workaround 👍

0 Kudos