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
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
}
Thanks a lot for the workaround 👍