Select to view content in your preferred language

Utility Network Trace results

1539
11
11-20-2023 04:03 AM
NarendranathMandal
Emerging Contributor

When running the Utility network trace widget, the results will be added as graphics.

How to get the graphics results data in the console ? 

I tried to trigger the events which is documented in the api documentation  add-result-area. But the event is not working.

Here my code is below

utilityNetworkTrace.on('add-result-area', getResult)
 
function getResult() {}
 
Reference URL
 
 
0 Kudos
11 Replies
NarendranathMandal
Emerging Contributor

Hi ,

How can i export the trace result using javascript .

0 Kudos
PrevinWong1
Esri Contributor

Hi,

If you are calling methods on the widget directly in your code, make sure you call https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkTrace-Utili...
so that your watching on the emit will get fired.

You can also access or watch the resultArea property to get results of the trace as well at any time after a trace is run.
https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkTrace-Utili...
console.log(utilityNetworkTrace.viewModel.traceResults)

Or if you want to watch when it changes

https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html
reactiveUtils.watch( () => utilityNetworkTrace.viewModel.traceResults.length, () => { //your code });

0 Kudos