mapbox / mapbox/mapbox-gl-draw
How to add draw on drawed feature?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
Hello mapbox-gl-draw team. How can I add a layer to draw object? I've tried this:
```
let ftr = {
type: 'Feature',
geometry: {
type: 'Polygon',
coordinates: layer.coordinates[0],
},
properties: []
};
let featureIds = this.draw.add(ftr as Feature);
```
but it throws an error: `ERROR TypeError: Cannot read properties of undefined (reading 'get')`. What's the problem?
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 reproducing the reported this.draw.add(ftr as Feature) call in mapbox-gl-draw with the shown Polygon feature and inspect the undefined get error. The issue does not name a source file or test; done means identifying the cause and documenting or correcting the supported way to add a layer or feature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100