Query rendered features accuracy decreases when terrain is present
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
mapbox-gl-js version
3.17.0
Browser and version
Chrome 142.0.7444.176
Expected behavior
The queryRenderedFeatures function should return the features that the cursor is over.
Actual behavior
The queryRenderedFeatures function doesn't always return the features that the cursor is over.
Link to the demonstration
https://jsbin.com/cayofanaca/edit?html,output
Steps to trigger the unexpected behavior
I understand that this is not always the case and sometimes queryRenderedFeatures does work correctly when terrain is enabled. Quite possible it might be due to the camera angles and zoom level I am using, when there is no bearing it seems to work better.
There is a video below of the issue I am having in the example I linked above.
https://github.com/user-attachments/assets/433c9d1b-4a7b-4943-a0c6-ce0923a07bb1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the JSBin demonstration with mapbox-gl-js 3.17.0 and compare queryRenderedFeatures results against the cursor position with terrain enabled. Exercise the camera angles, bearing, and zoom levels described in the issue; done means features under the cursor are returned consistently in the reproduced terrain cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100