Possible events for new Measurement widgets 4.10

421
1
Jump to solution
02-06-2019 08:31 AM
deleted-user-9_yPCHk-_Xlk
New Contributor II

I'm trying to find the possible events that the new measurement widgets can have.

DirectLineMeasurement3D | API Reference | ArcGIS API for JavaScript 4.10 

For example, I am trying to fire an event when measuring is finished.

Something like:

measureWidget.on('measure-end', function (event) {
console.log(event);
});

I can see in other widgets where it is easy to find a the possible events that a widget can fire, but not in either of the measurement widgets.

Thank you,

Clinton

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

You can check the tool property on the measurement widget view model. Currently this property isn't documented but we'll get it added to the doc. Active will be true when the tool is activated and is set to false when measurement is complete. 

     activeWidget.watch("viewModel.tool.active", function(active) {
            // false when measure is complete. 
     });‍‍‍

View solution in original post

1 Reply
KellyHutchins
Esri Frequent Contributor

You can check the tool property on the measurement widget view model. Currently this property isn't documented but we'll get it added to the doc. Active will be true when the tool is activated and is set to false when measurement is complete. 

     activeWidget.watch("viewModel.tool.active", function(active) {
            // false when measure is complete. 
     });‍‍‍