mapbox / mapbox/mapbox-gl-draw
Feature Request: add draw.contextmenu listener
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**: 1.5.0
**mapbox-gl-draw version**: 1.1.2
Currently mapbox-gl-draw doesn't seem to differentiate between left and right clicks when clicking on a draw object, as both events result in a draw.selectionchange event being fired.
As the base mapbox-gl library offers the ability to listen for contextmenu (right-click) events, it might be helpful to add extend this behavior to the draw library as well, allowing devs to define different behaviors depending on the type of click event (e.g. deleting a draw object on right-click).
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 examining mapbox-gl-draw's existing event handling for draw objects and the selectionchange event, then compare it with mapbox-gl's contextmenu listener behavior. Done means right-clicks can be distinguished from left-clicks and developers can define separate behavior, such as deleting a draw object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100