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
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-UtilityNetworkTraceViewModel.html#addResultAreaToMapso 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-UtilityNetworkTraceViewModel.html#traceResultsconsole.log(utilityNetworkTrace.viewModel.traceResults)
Or if you want to watch when it changes
https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.htmlreactiveUtils.watch( () => utilityNetworkTrace.viewModel.traceResults.length, () => { //your code });
Hi ,
How can i export the trace result using javascript .
Thank You , I got the area . Any idea how i can get the atributes print in the console or export the atributes from the trace result ?
In your UtilityNetworkTrace constructor, make sure you have enableResultArea defined and set to TRUE. The you will see the result area toggle, at which point, if you toggle, it fires the callback. See images below.
Yes . a polygon result area is drawn in the map , Only the function is not getting trigger .
@NarendranathMandal can you confirm that a polygon result area is drawn in the map after a trace is run and you toggle on the result area?Also in your function, you need a parameter since the event emits a graphic.function getResult(graphic) {console.log(graphic)}
@NarendranathMandal Many people are out of the office this week, we'll get back to you with a resolution or more questions next week.
Also refer to related post: Utility Network Trace Result - Esri Community
I have included that show properties in UtilityNetworkTrace. But still I am not getting the graphics results in the console.
@NarendranathMandal , right now the result graphics are only created when they are shown in the view, see #resultAreaProperties
Could that be the reason you are not getting the results in the console?
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.