mapbox / mapbox/mapbox-gl-draw

Feature Request: add draw.contextmenu listener

Open
#927 0 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature mouse-specific ui
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.