The current implementation of mouseenter and mouseleave events in mapbox-gl are a little buggy:
- a
mouseenterevent is generated on a layer X even if layer Y is above layer X on the enter region. - a
mouseleaveevent is generated on a layer Y if layer Y is above layer X and the mouse is moved when in a region that belongs to both X and Y. - the bubble effect found commonly in the DOM is not respected (
stopPropagationfor instance).
This plugin attempt to correct those misbehaviors but does not implement stopImmediatePropagation.
For more info, see the documentation API