Skip to content

I found a hit detection bug with WebglPointsLayer #16368

Open
@BowenZhang347

Description

@BowenZhang347

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions