Measurement vertex update event not working

944
4
05-20-2021 05:18 AM
nidaaktan
New Contributor II
 Hi,
I can catch the vertex-add event like this but vertex-update event not working.I can't run the function that i set vertex-update event.
 
 measurement.watch('viewModel.state'async (state=> {
        if (state === 'ready' || state === 'measuring') {
           measurement.activeWidget.viewModel.tool._draw.activeAction.on('vertex-update', updateGraphic);
           measurement.activeWidget.viewModel.tool._draw.activeAction.on('vertex-add'addGraphic);
        }
      });
 
Does anyone know how i can do it?
 
Thanks
0 Kudos
4 Replies
Noah-Sager
Esri Regular Contributor

Hi @nidaaktan, overall, what are you trying to accomplish? I would not recommend using undocumented or private properties as they are not supported and could change anytime.

0 Kudos
nidaaktan
New Contributor II

I try to change vertex according to the coordinates i have created when measurement update is active but measure widget doesn't have events like 'measure-update'. 

How can i do it?

Thanks

@Noah-Sager 

0 Kudos
Noah-Sager
Esri Regular Contributor

Ok, this sounds like a snapping scenario. Are you trying to update the vertex coordinates to a specific feature? If so, we are working on this functionality for a future release. It's also worth noting that for very precise measurements, the GeometryEngine would be a good choice.

nidaaktan
New Contributor II

Yes it is snap scenario, thanks for reply. I'll research how to use the GeometryEngine.

0 Kudos