Experimentalconst workflow = createEditSketchWorkflow({ source, sketchTools: terraDrawSketchToolCapabilities() });
const handle = bindTerraDrawSketch(draw, { model: workflow });
handle.setTool("polygon"); // draw.setMode("polygon") + workflow arming
// ... user draws; workflow.snapshot().sketch.geometry now tracks terra-draw
handle.undo(); // workflow history, mirrored back into terra-draw
await workflow.submit(); // edit-session applyEdits path, unchanged
Bind a terra-draw instance to an EditSketchWorkflowModel (REQ-001).
Every terra-draw
finishevent (freshly drawn features and select-mode edits: dragged features, dragged/inserted/deleted coordinates) maps the finishing mode to an EditSketchTool and applies the feature geometry throughmodel.setSketchGeometry, so workflow undo/redo and validation cover terra-draw edits. Deleting the tracked feature stages anullgeometry through the same undoable path.The caller owns the terra-draw instance lifecycle (
start/stop); the binding only attaches listeners and detaches them inremove().