mapbox / mapbox/mapbox-gl-draw

Add Custom Controls Icons on the existing toolbar

Open
#1,108 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi there! On current mapbox-gl-draw version with a custom control set-up, it is not straightforward to add to the mapbox-draw toolbar a button/icon that, when selected, triggers the drawMode change corresponding to that custom control.

I was able to setup a drawRectangle control with some help from miller [here](https://github.com/mapbox/mapbox-gl-draw/pull/1097) , and can set the `defaultMode: 'draw_rectangle',` to use it when map loads. But adding a custom button that calls my custom draw control can't be done right away.

Note: hiding the existing toolbar and adding a custom one like [mentioned here](https://github.com/mapbox/mapbox-gl-draw/issues/874) seems to be the way to go at the moment

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 custom drawRectangle setup in PR #1097 and the custom-toolbar workaround described in issue #874. Determine how an added control should trigger its corresponding draw mode; done means a custom control can be represented in the existing toolbar without requiring a separate toolbar.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.