UtilityNetwork

AMD: require(["esri/networks/UtilityNetwork"], (UtilityNetwork) => { /* code goes here */ });
ESM: import UtilityNetwork from "@arcgis/core/networks/UtilityNetwork";
Class: esri/networks/UtilityNetwork
Inheritance: UtilityNetwork Network Accessor
Since: ArcGIS API for JavaScript 4.20

This class contains metadata about the utility network dataset retrieved from a WebMap. To access the full properties, users need to call webmap's load() method. Certain properties are available without calling load such as id and title. In 4.20, this object can only be retrieved from a webmap which has a utility network layer.

See also:
Example:
require([
  "esri/WebMap",
  "esri/views/MapView",
  "esri/config"
], (WebMap, MapView, esriConfig) => {
  let utilityNetwork;

  // set the hostname to the portal instance
  esriConfig.portalUrl = "https://myHostName.domain.com/arcgis";

  const webMap = new WebMap({
    portalItem: {
      id: "webmapID"
    }
  });

  const mapView = new MapView({
    map: webMap
  });

  webMap.when(async () => {
    // check if webMap contains utility networks
    if (webMap.utilityNetworks.length > 0) {
      // assign the utility network at index 0
      utilityNetwork = webMap.utilityNetworks.getItemAt(0);

      // trigger the loading of the UtilityNetwork instance
      await utilityNetwork.load();
    }
  });
});

Constructors

new UtilityNetwork(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Name Type Summary Class
String[]more details

Returns all the domain networks in the utility network.

more detailsUtilityNetwork
Numbermore details

The layer id of the service containing the utility network rules table.

more detailsUtilityNetwork
Stringmore details

The service url containing the utility network rules table.

more detailsUtilityNetwork
Numbermore details

The layer id of the service territory class used to define the extent of the utility network.

more detailsUtilityNetwork
NamedTraceConfiguration[]more details

This property returns the list of trace configurations shared on the webmap.

more detailsUtilityNetwork
Numbermore details

The layer id of the service containing the utility network's Subnetworks table.

more detailsUtilityNetwork
Stringmore details

The service url containing the utility network's Subnetworks table.

more detailsUtilityNetwork
TerminalConfiguration[]more details

Returns all the terminal configurations on the utility network.

more detailsUtilityNetwork
Stringmore details

The type of the dataset.

more detailsUtilityNetwork

Property Details

domainNetworkNames String[]readonly

Returns all the domain networks in the utility network. Domain networks contain the network features through which your delivered resource flows.

See also:
rulesTableId Numberreadonly

The layer id of the service containing the utility network rules table.

See also:
rulesTableUrl Stringreadonly

The service url containing the utility network rules table.

See also:
serviceTerritoryFeatureLayerId Numberreadonly

The layer id of the service territory class used to define the extent of the utility network. Value is null when a service territory layer is not published to the feature service.

sharedNamedTraceConfigurations NamedTraceConfiguration[]

This property returns the list of trace configurations shared on the webmap. It is empty when no trace configurations are shared on the webmap. This property can be used without fully loading the utility network, but only the globalId and the title will be available.

subnetworksTableId Numberreadonly

The layer id of the service containing the utility network's Subnetworks table. The Subnetworks table contains the information about all the existing and deleted subnetworks in a utility network.

See also:
subnetworksTableUrl Stringreadonly

The service url containing the utility network's Subnetworks table.

See also:
terminalConfigurations TerminalConfiguration[]readonly

Returns all the terminal configurations on the utility network. Terminal configurations defines how many terminals a device has and how those terminals are setup. Must load the utility network to access this.

See also:
type Stringreadonly

The type of the dataset. Returns utility if the object represents a utility network.

For UtilityNetwork the type is always "utility".

Default Value:"utility"

Method Overview

Name Return Type Summary Class
TerminalConfigurationmore details

All devices features have terminal configurations (default single terminal).

more detailsUtilityNetwork
String[]more details

Takes the name of a domain network and returns an array with the names of its tiers.

more detailsUtilityNetwork
Promisemore details

Triggers the loading of the UtilityNetwork instance.

more detailsUtilityNetwork

Method Details

getTerminalConfiguration(feature){TerminalConfiguration}

All devices features have terminal configurations (default single terminal). Users can use this method to retrieve the assigned terminal configuration of a given feature. This method takes a graphic/feature, uses the ASSETGROUP and ASSETTYPE fields along side the network source to find out the assigned terminal configuration. If either ASSETGROUP, ASSETTYPE or layer are not populated a null is returned. Returns null if terminal configuration object couldn't be found.

Parameter:
feature Graphic

The graphic feature to get the terminal configuration from. Must belong to a device layer, and have ASSETGROUP and ASSETTYPE fields populated.

Returns:
Type Description
TerminalConfiguration The terminal configuration object. Most devices have a single terminal configuration unless configured otherwise.
getTierNames(domainNetworkName){String[]}

Takes the name of a domain network and returns an array with the names of its tiers. A domain network can have one or several tiers. A tier is a subgrouping of a domain network that represents the logical hierarchy of subnetworks.

Parameter:
domainNetworkName String

The name of the domain network.

Returns:
Type Description
String[] Returns an array of tier names.
See also:
load(){Promise}

Triggers the loading of the UtilityNetwork instance.

Fully loads the utility network definition and all the shared named trace configurations.

Returns:
Type Description
Promise Resolves when the UtilityNetwork is loaded.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.