Select to view content in your preferred language

Client-side feature layer label visual bug?

236
3
03-08-2025 01:44 AM
JonathanDawe_BAS
Occasional Contributor

I'm using a client-side feature layer to display distance rings around a moving asset. These rings update whenever the asset's position changes by modifying their geometry using an applyEdits call. The rings have labels positioned above the lines, with settings to prevent duplicate labels from appearing.

However, I've noticed some strange behaviour that I can't seem to fix.

  1. When zooming in and out, the labels and lines sometimes appear doubled, as if both the old and new versions are being drawn at the same time. Initially, I thought this was due to the rendering process temporarily displaying both before cleaning up the old one. But it still happens occasionally, even when the data isn’t actively updating.

  2. Without extra logic to remove duplicates, I sometimes see duplicate rings, which I suspect is due to a race condition during updates.

For relatively frequent updates (e.g., every 5 seconds), should I continue using a feature layer, or would another approach be better? Is this label ghosting expected behaviour?

 

 

0 Kudos
3 Replies
JonathanDawe_BAS
Occasional Contributor

Just to add, I have added a layer.refresh() call after the apply edits call and it does seem to have subtly improved the behaviour. Why would this help? 

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

Would you mind copying and pasting a featurelayer constructor and one of the geometries? This would make it easier to reproduce the behavior you are describing. Thanks

0 Kudos
JonathanDawe_BAS
Occasional Contributor

hi @UndralBatsukh  - I've created a codepen sample here. I think the issue is related to computation load. I can only recreate the issue in the sample if I throttle the cpu performance in the developer console.  I can only assume that the artifact is because of some visual lag? 

0 Kudos