mapbox / mapbox/mapbox-gl-draw
Add Custom Controls Icons on the existing toolbar
Nobody has claimed this yet.
- 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
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 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