I am trying to have a simple map and:
- Allow the user to draw a point, line, or polygon. Although just 1.
- I then need to buffer this feature
- I then need to capture its geometry so I can send that as a parameter to a GP Tool
I looked at this widget https://developers.arcgis.com/javascript/latest/sample-code/sketch-geometries/ but could not figure out how to limit it to one geometry in the graphics layer. I assume that I could just remove all features every time the user clicks the map. Or someway to disable the widget after each feature creation in the map (Then deleting all features next time the widget is used?)
I am not sure the widget is the way to go and looking for some thoughts or examples for this.
The widget stores geometry in the graphics layer so If I could control the layer to only have 1 feature at a time I could query the graphics layer for its geometry....
Thoughts?