I am using Sketch widget to reduce overhead on some items and it mostly works (mostly).
This is how i set it up:
let sketch = new Sketch({
availableCreateTools: ["point", "polyline", "polygon"],
layer: this.graphicsLayer,
view: this.view,
creationMode: "single",
defaultUpdateOptions: {
enableRotation: false,
enableScaling: false,
enableZ: false,
toggleToolOnClick: false,
},
visibleElements: {
settingsMenu: false,
selectionTools: {
"lasso-selection": false,
"rectangle-selection": false
}
}
});
This results in me being able to create polygons which is great.
Question is how do i attach listeners to these shapes, so that on click it triggers a specific function/code?