mapbox / mapbox/mapbox-gl-draw

Disable click callback on polygons

Open
#1,024 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged feature
Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
8d 9h
Merged PRs (30d)
5

Description

After drawing a polygon, wondering if there is a way to disable (and later enable) event listener for polygon click? The reason being that I'm developing a map that has a lot of layers/features and they can overlap with the draw. I hope to disable draw interactions when user is intended to play with other features. Thanks!

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 reviewing the existing draw interaction and polygon click event handling, along with any related API documentation or tests. Determine how draw interactions are currently enabled and disabled, then define the expected behavior for toggling polygon click handling before and after interaction with other map features.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.