<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Utility network samples using JS API in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/utility-network-samples-using-js-api/m-p/1166160#M77064</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/551024"&gt;@KarthikAditya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for providing feedback on the documentation for the UtilityNetwork. I agree we are missing some sample code in this class. The code you need to load a utility network from a webmap is the following.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const webMap = new WebMap({
  portalItem: {
    portal: { 
      url: "MyPortalUrl" 
    },
    id: "MyWebmapId" 
  }
});

webMap.when(async function() {      
  // Check if webMap contains utility networks.
  if (webMap.utilityNetworks.length &amp;gt; 0 ) {
    // Assigns the utility network at index 0 to utilityNetwork.
    utilityNetwork = webMap.utilityNetworks.getItemAt(0);
  }
  // Trigger the loading of the UtilityNetwork instance.
  await utilityNetwork.load();
});
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We will add this sample code into the UtilityNetwork class. We are also working on providing a sample and some more detailed documentation on working with utility networks with the ArcGIS API for JavaScript. Thanks again for the feedback!&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2022 15:20:33 GMT</pubDate>
    <dc:creator>JoseBanuelos</dc:creator>
    <dc:date>2022-04-20T15:20:33Z</dc:date>
    <item>
      <title>Utility network samples using JS API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/utility-network-samples-using-js-api/m-p/1166038#M77061</link>
      <description>&lt;P&gt;The JS API reference related to utility networks are&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html#loaded" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;but do not have any examples. Can someone please share examples of how to get a utility network from a web map or point to a resource where they're available?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 11:17:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/utility-network-samples-using-js-api/m-p/1166038#M77061</guid>
      <dc:creator>KarthikAditya</dc:creator>
      <dc:date>2022-04-20T11:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Utility network samples using JS API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/utility-network-samples-using-js-api/m-p/1166160#M77064</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/551024"&gt;@KarthikAditya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for providing feedback on the documentation for the UtilityNetwork. I agree we are missing some sample code in this class. The code you need to load a utility network from a webmap is the following.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const webMap = new WebMap({
  portalItem: {
    portal: { 
      url: "MyPortalUrl" 
    },
    id: "MyWebmapId" 
  }
});

webMap.when(async function() {      
  // Check if webMap contains utility networks.
  if (webMap.utilityNetworks.length &amp;gt; 0 ) {
    // Assigns the utility network at index 0 to utilityNetwork.
    utilityNetwork = webMap.utilityNetworks.getItemAt(0);
  }
  // Trigger the loading of the UtilityNetwork instance.
  await utilityNetwork.load();
});
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We will add this sample code into the UtilityNetwork class. We are also working on providing a sample and some more detailed documentation on working with utility networks with the ArcGIS API for JavaScript. Thanks again for the feedback!&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 15:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/utility-network-samples-using-js-api/m-p/1166160#M77064</guid>
      <dc:creator>JoseBanuelos</dc:creator>
      <dc:date>2022-04-20T15:20:33Z</dc:date>
    </item>
  </channel>
</rss>

