Hi,
I'm trying to find the 'measure-start', 'measure-end' events that the new measurement widgets can have.
For example;
measurement.on('measure-start', function (event) {
console.log(event);
});
But It doesn't work that way.
The 4.x Measure widget doesn't have events. Take a look at this post:
How would you then read out the current measurement distance/area from the tool? My case is that using "distance" we need to display the value somewhere else in the UI.
I was hoping for something along the lines of
useEffect(() => {
const measureTool = new Measurement({ linearUnit: 'metric', areaUnit: 'metric' });
measureTool.on('measurement-update', (event: { distance: number }) => {
console.log(event.distance);
});
setMeasurement(measureTool);
}, []);