Sure, at a really high level all you need to do is create a new rectangle graphic and then zoom to it with the view.goTo() method. I created a codepen ( https://codepen.io/sagewall/pen/dyqZVwd ) that shows one approach of doing this with the sketch widget. It would be a bit more work, but you could create your own button and use the SketchViewModel to draw the rectangle. Creating your own button would give you more control over the styling of your button.
I may be misinterpreting your question, but if you hold down the shift key, then click down and hold the button on your mouse, you should be able to draw a rectangle and when you release the button you will be zoomed to that extent.
@Sage_Wall Thanks a lot, i missed this part in documentation ❤️
Is there any other way to click e.g. on button and after draw rectangle and zoom?
Is there any other way to click e.g. on button and after draw rectangle and zoom?
Sure, at a really high level all you need to do is create a new rectangle graphic and then zoom to it with the view.goTo() method. I created a codepen ( https://codepen.io/sagewall/pen/dyqZVwd ) that shows one approach of doing this with the sketch widget. It would be a bit more work, but you could create your own button and use the SketchViewModel to draw the rectangle. Creating your own button would give you more control over the styling of your button.
Thank you very much @Sage_Wall , now i will make some changes for myself 😉