Mouse events not working right on circle layers with sub-properties
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: v1.9.0
browser: Chrome
Steps to Trigger Behavior
- Create a GeoJSON point feature that has sub-properties of properties (f.properties.subProperty)
- Create a circle layer with an expression that uses the sub-property for the radius.
- Add mouse enter/leave events that change the mouse cursor.
- Hover over the circle. You will find that the mouse events only work when really close to the center of the circle.
Link to Demonstration
https://jsbin.com/zahogipeqo/edit?html,output
Expected Behavior
Mouse events should work as soon as the mouse hits the edge of the circle.
Actual Behavior
The mouse events only work when really close to the center of the circle.
Additional information
I initially noticed this when using a a linear expression, but after simplifying this to simplifying grabbing the sub-property value and using it for the radius, I saw the same issue.
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 with the linked JSBin reproduction and verify the circle layer's sub-property radius together with the mouse enter/leave handlers in Chrome. Compare the observed hit area with the rendered circle edge; done means the handlers respond across the full circle, not only near its center.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100