mapbox / mapbox/mapbox-gl-draw
How to get layer or layer id after drawing successfully?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
I want to get the layers or layers' ids after drawing successfully, and then do some layers' processing by mabox-gl api. How to do that? At present,mapbox-gl "map.getStyle().layers" api can return all layers, at the same time, mapbox-gl-draw "get()" and "getAll()" can provide features, so I have a idea, do some loops by using these three apis. But is there a performance issue with this solution?
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 mapbox-gl-draw get() and getAll() APIs alongside mapbox-gl's map.getStyle().layers API. The issue does not name a file or test; done would be a documented, supported answer explaining how to obtain drawn layer information and whether combining these APIs has performance implications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100