mapbox / mapbox/mapbox-gl-draw
Question: is it possible to add a feature and go directly into 'live' edit mode?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
I can use the control just fine and pass in geoJson but I would like to not have the user need to double click to get into the 'active' draw mode. Not sure how to describe this but the mode where (using default styling), the lines are dashed and you have movable vertices.
RIght now when I load my geoJson into the draw control, I get a featureId and then I use that to do drawControl.changeMode('direct_select', { featureId: featureId }) but this shows the mode where my feature is not rendered using the orange dotted lines. I still have to double click to engage that mode...
Thank you!
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 tracing the drawControl.changeMode('direct_select', { featureId }) entry point and compare it with the double-click path that activates the dashed-line editing state. Confirm whether direct_select can enter that state directly; done means a loaded GeoJSON feature shows movable vertices and the active styling without a second user action.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100