#16368·openlayers

I found a hit detection bug with WebglPointsLayer

Author: BowenZhang347Created Nov 15, 2024Updated Sep 4, 2026
Labelsbug

Describe the bug I have a WebglPointsLayer, which clears its source and inserts 10,000 features every 2 seconds. I observed that the forEachFeatureAtPixel method hit detection works fine at the beginning, but problems occur after running for a while. When the mouse selects a feature, the hit is not the feature I selected. I noticed that at this point, the ol_uid of each newly added feature reaches 8 digits in length. The forEachFeatureAtCoordinate method of WebGLPoints has code related to ol_uid. I suspect that this phenomenon might be related to ol_uid. Of course this is just my guess, I hope someone can answer my question.

To Reproduce Steps to reproduce the behavior:

  1. Create a WebglPointsLayer
  2. Every 2 scondes, clear its source and inserts 10,000 features.
  3. See error actually

Expected behavior Hit detection works fine. need