mapbox / mapbox/mapbox-gl-draw
Start using the Feature State API
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
Currently, GL Draw does not utilize the Feature State API. Starting to use [feature state](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#setfeaturestate) would result in several benefits, such as:
* Reduced flickering, which is currently caused by moving between "hot" and "cold" layers.
* The ability to add hover effects to drawn features (as demonstrated in [this example](https://docs.mapbox.com/mapbox-gl-js/example/hover-styles/)).
* Reduced CPU usage, since `queryRenderedFeatures` would not need to be run for every mouse move.
* A potential way to pass `userProperties` to midpoints and vertices (see https://github.com/mapbox/mapbox-gl-draw/pull/964 for additional related discussion).
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 reading the Feature State API documentation and the linked hover-styles example, then inspect how GL Draw currently handles hot and cold layers, mouse movement, midpoints, and vertices. Done should include adopting feature state in GL Draw while addressing the listed flickering, hover, CPU, and userProperties goals.
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