I'm using the view hitTest function to determine which feature is selected. But it seems like there are some issues with the hitTest for a dynamic updating layer.
Reproduce steps:
- A FeatureLayer displaying 40 graphics. Each 100ms a mocked update will be processed by ApplyEdits.
- HitTest function with hitResults[ => The first result will be used for the content and location of the popup.
Why we're using hitTest:
We're creating a custom web element for displaying a popup instead of displaying the default popupTemplate. (should be created each time an asset changes)
=> A wrong popup is displayed when clicking a feature/graphic.


Codepen
https://codepen.io/michaelk95/pen/abKoGxz?editors=1000
Thanks