Hello everyone,
I am trying to develop a web application with Utility Network with ArcGIS Javascript SDK (4.27). I have prepared a Web Application with Utility Network widget and now I am trying to add the validate network topology widget. I have added the widget in this application but it does not allow me to validate the network topology.
The error/warning is that "A utility Network wasn't provided. the widget must be initialized with a utiltity network". However, I have already checked and it does have utility NEtwork. I am also able to perform tracing in UN Tracing widget.
In this application, I have used Web Map with UN feature service in it. The feature layer is shared from ArcGIS PRO (via Publish Web Layer).
QUESTIONS:
It would be of great help. Thanks a lot in advance.
Best Regards
Shlesha
Hello Shlesha,
Here's a link to a sample app showing how to use the Validate Network Topology widget using ArcGIS Maps SDK for JavaScript 4.27 (Credentials to access the app can be found inline).
https://codepen.io/lmontero_esri/pen/poQwwPP
Even if your map already has a Utility Network, you need to explicitly set it in the widget's "utilityNetwork" property as shown below
// Initialize the custom widget and set its properties using the constructor
const vntWidget = new UtilityNetworkValidateTopology({
view: myView,
utilityNetwork: myUtilityNetwork
});
To answer your questions:
1. To use the Validate Network Topology widget, you need to add the dirty areas layer as a FeatureLayer (The sample app shows how to do it. Hint: Look for the "addDirtyAreasLayer" function). Here's a link to the SDK documentation showing how to create a featureLayer from a feature service URL.
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#construc...
2. Here's a great answer I found in a page created by the Technical Support team (originally posted here)
"A map service does not expose the editing capability and provides read-only access to feature and attribute content, while a feature service contains the information from feature layers that can be edited if editing is enabled. Clients can query and edit the feature geometry and attributes of a feature service."
On the SDK side of things, the layer you choose dictates which capabilities will be available. Here's a link to a document showing info on data storage and capabilities for some layer classes.
https://developers.arcgis.com/javascript/latest/layers/
I hope you find this information useful.
Kind Regards,
Leo
Hi Leo,
Thank you so much for the reply. I could access the script for the Validate Network Topology Widget. I have tried to add the widget according to the sample code. Unfortunately the error still exists. Even though the dirty area layer and also the utility Network Area is added on the Map, the widget is not able to recognise the Utility Network.
Best Regards
Shlesha
Hello Shlesha,
Can you provide me with a copy of your code or at least a code snippet showing how your UtilityNetworkValidateTopology widget is being initialized so I can take a look at it?
Kind Regards,
Leo
Hi Leo,
Loading the Utility Network.
Function to add Dirty Area Layer in the Code.
Initializing the UN Validate Topology Widget.
Best Regards
Shlesha
Hello Shlesha,
I was wondering, do you get the same error message while working with Maps SDK for JavaScript 4.28, 4.29?
Also, do you know what version of ArcGIS Enterprise was your Utility Network published to?
Finally, can you create a pen I could use to plug my own data in to see if I can reproduce this behavior on my end?
Kind Regards,
Leo