mapbox / mapbox/mapbox-gl-draw
Patching original modes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
Recently I have created two libraries to patch the original modes. In order to allow using them both standalone or together, I came up with this pattern:
```
let modes = MapboxDraw.modes;
modes = MapboxDrawGeodesic.enable(modes);
modes = MapboxDrawWaypoint.enable(modes);
const draw = new MapboxDraw({ modes });
```
https://github.com/zakjan/mapbox-gl-draw-geodesic/blob/master/src/modes/index.js
https://github.com/zakjan/mapbox-gl-draw-waypoint/blob/master/src/modes/index.js
What are your thoughts about it? Is it worth to come up with an official better way to patch the original modes?
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
Review the proposed enable(modes) pattern in the linked mapbox-gl-draw-geodesic and mapbox-gl-draw-waypoint mode files, then compare it with the MapboxDraw.modes API. Determine whether an official mode-patching mechanism is needed and define its intended behavior before proposing implementation work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100