How to remove 'New measurement' button after taking measurements?

08-23-2021 12:38 PM
New Contributor II

Hi, I'm using the Measurement widget in 2D and I would like this 'New measurement' button to go away after I have done my measurements in the widget. I do not a delete button in the widget and I have to close ( make it go from a '+' symbol to pointer) it by hitting the esc button on my keyboard or clicking on the measure widget again.

I was hoping .destroy() at the last would do this but it doesn't .

        case null:
          if (activeWidget) {
            activeWidget = null;

Can I add a button to go out of the widget and also close this blue tab with it?


0 Kudos
1 Reply
Occasional Contributor

You can use css to hide the button in the interface:



.esri-distance-measurement-2d__clear-button {
    display: none;



If you want a button to clear measurements and reset the widget, you can create a button in your interface and use some JS like:


clearButton.addEventListener("click", function () {


where measurement is the name of your Measurement object.
0 Kudos