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:
https://community.esri.com/t5/arcgis-api-for-javascript/possible-events-for-new-measurement-widgets-4-10/m-p/278961
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); }, []);
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.