L.EventForwarder Demo
Unhandled events are forwarded to the next in the stack.
What is happening:
-
The BLUE polygon is a CANVAS layer which would usually mask all
those below it, however because it is not handling/intercepting events
L.eventForwarder
is passing them to the next in the stack.
-
The GREEN polygon is a SVG layer,
which exists in the DOM and only masks the red layer where the polygon covers it.
-
The RED polygon is a CANVAS layer which has a click event
handler, and receives all events forwarded from BLUE that don't hit GREEN.