jrd / mapbox-gl-mouse-over-event

Mapbox GL Mouse over event fix plugin

Home Page:https://jrd.github.io/mapbox-gl-mouse-over-event/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mapbox GL Mouse over event fix plugin

The current implementation of mouseenter and mouseleave events in mapbox-gl are a little buggy:

  • a mouseenter event is generated on a layer X even if layer Y is above layer X on the enter region.
  • a mouseleave event 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 (stopPropagation for instance).

This plugin attempt to correct those misbehaviors but does not implement stopImmediatePropagation.

For more info, see the documentation API

About

Mapbox GL Mouse over event fix plugin

https://jrd.github.io/mapbox-gl-mouse-over-event/

License:MIT License


Languages

Language:JavaScript 100.0%