mapbox / mapbox/mapbox-gl-leaflet
In interactive mode, Mapbox fires spurious mousemove events on drag/pan
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 546
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
If you enable interactive mode (by setting the interactive option to true), Mapbox's mousemove event will fire while panning the map, with event lngLat locations that don't reflect the actual cursor position. This does not happen when using Leaflet events, though those apply to the entire map and are thus not well suited to layer-specific functionality.
Currently, to work around this, I set a flag when Leaflet fires a movestart event (and unset it on moveend), and ignore all Mapbox events while the flag is set. Ideally the library would handle this properly to ensure that spurious events are not fired...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing interactive mode and the Mapbox mousemove handling, then compare it with the Leaflet movestart and moveend events described in the report. Reproduce a drag or pan with interactive enabled and verify that layer-specific mousemove events are not emitted with cursor locations that do not match the actual cursor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100