Question: is it possible to add a feature and go directly into 'live' edit mode?
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!
Interested in this too.
Interested in this too.
Here's another variation of the same basic problem (direct_select allows line movement):
-
Create a line_string in code.
-
User clicks on the line.
-
Try to go immediately to direct_select:
map.on('draw.selectionchange', (e) => { draw.changeMode('direct_select', { featureId: features[0].id }); console.log ("draw.selectionchange: ", draw.getMode()); // direct_select } -
At this point the line can be dragged by the mouse, even though this capability should be disabled.
-
If a vertex is dragged, suddenly the problem disappears and the line itself can no longer be dragged.
So it looks like changeMode("direct_select") fails to set some internal state which is only set when a vertex is selected.
From looking at the code and description, I'm guessing this would be fixed by pull request https://github.com/mapbox/mapbox-gl-draw/pull/901
Interested in this too.
Interested in this too.