Skip to content
Discussion options

You must be logged in to vote

Thought like the same but actually events do not pass through. I have

<svg> with pointer-events: none, so no pass through necessary or happens
<circle> with pointer-events: auto; event forwarding needed to allow zoom, pan,.. while on element

I fixed my code, the missing thing was

buttons: ev.buttons,

Thanks for your immediate reply.

attachment:

Why Mouse Events Don’t Automatically Pass Through Your SVG to the Map

When you place an SVG element on top of a MapLibre (or Mapbox GL) map, the mouse events (clicks, drags, etc.) are blocked by the SVG and don’t reach the map underneath. This happens due to:

  1. Event Bubbling & Default Behavior

    • By default, mouse events fire on the topmost element

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by snuup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants