Listener attached to the line layer with the added line width not working correctly.
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**: ^2.10.0
**browser**: Brave v1.45.127
### Steps to Trigger Behavior
https://codepen.io/gmand/pen/RwJxvbx
Open the console and try to hover near the first marker (dotted lines in the pic). You will see in the console output "hover" .

### Expected Behavior
It should trigger the listener event only when you hovering on the actual line, no matter what width is added. The line should not go passed the marker points
### Actual Behavior
The line width seems to acts as a padding. If you set the width to 40, it should only add this width to 2 directions. Seems like the rendering is correct but the way the listener is attached is wrong.
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 CodePen reproduction and inspect the line-layer hover listener behavior around the first marker. Compare the listener's hit area with the rendered line at different widths; done means hover triggers only on the actual line and the added width does not extend beyond the marker points.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100