mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Listener attached to the line layer with the added line width not working correctly.

Open SourceCipher opened this issue 3 years ago • 0 comments

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" .

image

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.

SourceCipher avatar Nov 21 '22 09:11 SourceCipher