Picking is selecting the wrong feature

I have a sandcastle which demonstrates the problem.

If I click somewhere around the red square

image

what shows up is:

If I click most other places in that same green polygon, I get the correct answer which is:

Rotating the globe so that IDN is no longer beneath the CAN polygon results in the correct behavior because only a single polygon can be found at the click location.

There is a bug in the picking code which will return the furthest object found instead of the nearest.

Can this be confirmed? If so, is there anything I can do about it?

What I did just notice is that if I set clampToGround: false, then the picking works correctly.

However, it would be useful to me to be able to have picking work correctly with clampToGround: true.

Is this possible? Is there anything I can do to work around this bug with clampToGround: true?

Hi @eric-g-97477, I can verify that I see the same problem on my end.

I see you’ve already opened an issue for this. Thanks for the clear report!

Thank you for the verification.

I am hoping there can be a quick fix for this issue.