mapbox / mapbox/mapbox-gl-draw
heatmap and mouseenter event prevent shape drag and drop
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
**mapbox-gl-js version**: 0.41.0
**mapbox-gl-draw version**: 1.04
### Steps to Trigger Behavior
1. Have a regular layer and a heatmap (tested with circles/heatmap combo)
2. Have a mouseenter event on the regular layer
Ready to use example (add your token on line 16) : https://plnkr.co/edit/UPhJ3D0SHNhSl9BdB9SJ?p=preview
### Expected Behavior
User should still be able to move/modify the drawn shape.
### Actual Behavior
Creating a shape over/close to the heatmap layer is only partially working (feature is created but animation is not shown). Moving the drawn shape is impossible as long as the mouse is in the vicinity of the heatmap. When moving the drawn shape outside of the heatmap layer, the actual behavior is the expected one, as the shape can be manipulated freely.
Any other combination than the one shown in the example seems to be fine. If the mouseenter event is disabled, or if the heatmap is not added, everything works as it should. Layer order seems to have no impact on the behavior.
The zone around the heatmap layer where the draw interface freezes seems to change following the zoom level (up close, the freeze occurs almost only over the heatmap, while it expands when zoomed out). My guess would be that this is related to the way the heatmap is drawn (which would explain why the "dead zone" varies with the zoom level), but I have no idea why this is triggered only when there is a mouseenter event.
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 with the ready-to-use Plunker example and reproduce the issue using mapbox-gl-js 0.41.0 and mapbox-gl-draw 1.04. Investigate the interaction between the heatmap, the regular layer's mouseenter event, and shape dragging; done means drawn shapes can be created, animated, moved, and modified near the heatmap.
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