AnsweredAssumed Answered

Button to activate zoombox tool

Question asked by chralf on Sep 16, 2019
Latest reply on Sep 17, 2019 by chralf

Our users like the built-in zoombox tool (rubberband zoom; hold shift and left mouse button to draw a rectangle) in ArcGIS JS 4.11, so we want to make the tool easier to find. What is the correct way to activate this tool via code, e.g., when clicking a button or dragging without holding shift? We also want to display the new map scale while drawing the zoombox.


I put together a small sample that shows what we want to accomplish; drawing a zoombox by holding the right mouse button and continuously printing the scale to the console. It works, but it's too much of a hack – there has to be a cleaner way to do this.


Sample: Right-mouse-button zoombox with scale output


Help greatly appreciated.