Select to view content in your preferred language

Setting the default tool for the sketch widget

220
1
11-02-2023 03:27 AM
Flookfinders
New Contributor II

In my app I am hiding and showing the sketch widget depending on what the user is trying to do at the time. I am also showing and hiding the create tools depending on if they are required or not for the current action.  This is all working fine, but when the user wants to create a new map object and I display the widget with the required create tool the default tool selected is the "Select" tool, which means the user has to select the required create tool before they can proceed. Is there a way that I can show the sketch widget with the required create tool selected, thus meaning the user does not have to select the create tool first?

1 Reply
JohnReiser
New Contributor III

Pseudocode:

const skt = new Sketch({ ...your_options })
skt.visible = true
skt._activeCreateTool("point") // activate the point tool

Keep in mind that functions prefixed with an underscore typically mean that the developer intended it to be private, so assume that the functionality may change.

Hope this helps!

0 Kudos