import UtilityNetwork from "@arcgis/core/networks/UtilityNetwork.js";
const UtilityNetwork = await $arcgis.import("@arcgis/core/networks/UtilityNetwork.js");
@arcgis/core/networks/UtilityNetwork
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.
const [WebMap, MapView, esriConfig] = await $arcgis.import([
"@arcgis/core/WebMap.js",
"@arcgis/core/views/MapView.js",
"@arcgis/core/config.js"
]);
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.at(0);
// trigger the loading of the UtilityNetwork instance
await utilityNetwork.load();
}
});
// Instantiating a UtilityNetwork instance using layerUrl
const utilityNetwork = new UtilityNetwork({layerUrl: "https://hostName.com/server/rest/services/Test/FeatureServer/17"});
await utilityNetwork.load();
Constructors
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
| Name | Type | Summary | Class |
|---|---|---|---|
The associations table is used to store associations between network features. | UtilityNetwork | ||
The full network definition, accessible only when the network is loaded. | Network | ||
The physical dataset name of the network as defined in the backend database. | Network | ||
The name of the class. | Accessor | ||
Returns all the domain networks in the utility network. | UtilityNetwork | ||
Returns the root feature service url which this network is part of. | Network | ||
The full extent of the network, defined from the service territory used to create the network. | Network | ||
The version of the geodatabase of the feature service data. | Network | ||
Returns true if the utility network data element includes a telecom domain network. | UtilityNetwork | ||
The historic moment to query. | Network | ||
Random unique id (UUID) to identify a network as defined in the webmap spec. | Network | ||
The layer id of the network. | Network | ||
The full url to the network layer id as defined in the webmap spec. | Network | ||
The Error object returned if an error occurred while loading. | Network | ||
Represents the status of a load operation. | Network | ||
A list of warnings which occurred while loading. | Network | ||
Indicates whether the network instance has loaded. | Network | ||
Returns the url of network server. | Network | ||
Contains the url and IDs of the utility network rules, subnetworks, and dirty areas tables or layers. | UtilityNetwork | ||
The portal user owner of the network. | Network | ||
Converts url to a url object | Network | ||
The schema version of the network. | Network | ||
The layer id of the service territory class used to define the extent of the utility network. | UtilityNetwork | ||
This property returns the list of trace configurations shared on the webmap. | UtilityNetwork | ||
| Network | |||
The spatial reference of the network, defined at the creation of the network, usually from the service territory class. | Network | ||
Returns all the terminal configurations on the utility network. | UtilityNetwork | ||
The name of the network as defined in the webmap spec. | Network | ||
The type of the dataset. | UtilityNetwork |
Property Details
-
associationsTable
PropertyassociationsTable FeatureLayer |null |undefinedreadonly -
The associations table is used to store associations between network features. Associations are used to define relationships between network features, such as containment or connectivity.
-
dataElement
InheritedPropertydataElement NetworkDataElementJSON |null |undefinedInherited from Network -
The full network definition, accessible only when the network is loaded.
-
Inherited from Network
-
The physical dataset name of the network as defined in the backend database. Accessible only when the network is loaded.
-
Returns all the domain networks in the utility network. Domain networks contain the network features through which your delivered resource flows.
- See also
-
Inherited from Network
-
The full extent of the network, defined from the service territory used to create the network.
-
Inherited from Network
-
The version of the geodatabase of the feature service data. Read the Overview of versioning topic for more details about this capability.
-
hasTelecomNetwork
PropertyhasTelecomNetwork BooleanreadonlySince: ArcGIS Maps SDK for JavaScript 4.34UtilityNetwork since 4.29, hasTelecomNetwork added at 4.34. beta -
Returns true if the utility network data element includes a telecom domain network.
- See also
-
Inherited from Network
-
The historic moment to query. If historicMoment is not specified, the query will apply to the current features.
-
Inherited from Network
-
The Error object returned if an error occurred while loading.
- Default Value:null
-
loadStatus
InheritedPropertyloadStatus StringreadonlyInherited from Network -
Represents the status of a load operation.
Value Description not-loaded The object's resources have not loaded. loading The object's resources are currently loading. loaded The object's resources have loaded without errors. failed The object's resources failed to load. See loadError for more details. Possible Values:"not-loaded" |"loading" |"failed" |"loaded"
- Default Value:"not-loaded"
-
Inherited from Network
-
A list of warnings which occurred while loading.
-
networkSystemLayers
PropertynetworkSystemLayers NetworkSystemLayersreadonly -
Contains the url and IDs of the utility network rules, subnetworks, and dirty areas tables or layers.
Example// Print out the dirty areas layer url in the utility network view.when(async () => { // Check if the webmap contains utility networks if(webmap?.utilityNetworks?.length > 0) { // Assigns the utility network at index 0 utilityNetwork = webmap.utilityNetworks.at(0); // Load the utility network await utilityNetwork.load(); // Print the dirty areas layer url and id console.log(`Dirty areas layer id: ${utilityNetwork.networkSystemLayers.dirtyAreasLayerId}`); console.log(`Dirty areas layer url: ${utilityNetwork.networkSystemLayers.dirtyAreasLayerUrl}`); } });
-
Inherited from Network
-
The portal user owner of the network. This portal user can perform administrative actions against the network.
-
Inherited from Network
-
The schema version of the network. Each version of the network introduces new features and capabilities. e.g. A utility network created with ArcGIS Pro 2.8 will have a schema generation version 5. While a UN created with ArcGIS Pro 2.6 will be version 4.
-
The layer id of the service territory class used to define the extent of the utility network. Value is
nullwhen a service territory layer is not published to the feature service.
-
sharedNamedTraceConfigurations
PropertysharedNamedTraceConfigurations 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
globalIdand thetitlewill be available.
-
spatialReference
InheritedPropertyspatialReference SpatialReferenceautocastInherited from Network -
The spatial reference of the network, defined at the creation of the network, usually from the service territory class.
-
terminalConfigurations
PropertyterminalConfigurations 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
Propertytype Stringreadonly -
The type of the dataset. Returns
utilityif the object represents a utility network.For UtilityNetwork the type is always "utility".
- Default Value:"utility"
Method Overview
| Name | Return Type | Summary | Class |
|---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
Promise<Boolean> | Returns | UtilityNetwork | |
Cancels a load() operation if it is already in progress. | Network | ||
Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. | Network | ||
Returns ServiceEdits which are used to add an Association via the | UtilityNetwork | ||
Returns ServiceEdits to combine network elements in a telecom domain network via the | UtilityNetwork | ||
Returns ServiceEdits which are used to delete an Association via the | UtilityNetwork | ||
Returns ServiceEdits to divide a grouped network element in a telecom domain network into two or more grouped elements via the | UtilityNetwork | ||
Returns a CircuitManager for the utility network's telecom domain network, if one exists. | UtilityNetwork | ||
The network consists of sources (classes) and each source has a unique Id. | Network | ||
Groups network elements by their layerId. | Network | ||
Returns the layer ID for a given network source ID. | Network | ||
Given a terminalId, returns the corresponding Terminal instance. | UtilityNetwork | ||
All devices features have terminal configurations (default single terminal). | UtilityNetwork | ||
Takes the name of a domain network and returns an array with the names of its tiers. | UtilityNetwork | ||
Returns a UnitIdentifierManager for the utility network's telecom domain networks, if any exist. | UtilityNetwork | ||
Returns true if a named group of handles exist. | Accessor | ||
| Network | ||
| Network | ||
| Network | ||
Returns a boolean indicating if the layer is a utility layer belonging to the network. | UtilityNetwork | ||
Promise | Triggers the loading of the UtilityNetwork instance. | UtilityNetwork | |
Promise<FeatureLayer> | Loads the Utility Network's associations table. | UtilityNetwork | |
Promise<FeatureLayer> | Loads the Utility Network's subnetworks table. | UtilityNetwork | |
Promise<Association[]> | Returns all associations filtered by the QueryAssociationsParameters in a utility network. | UtilityNetwork | |
Promise<NamedTraceConfiguration[]> | Named trace configurations allow you to add and store complex traces in a network that can be shared across an organization through web maps and consumed by web and field applications. | Network | |
Removes a group of handles owned by the object. | Accessor | ||
Whenever the network is edited or modified, the network and its features become out of date in the network topology. | UtilityNetwork | ||
Promise<TraceJobInfo> | The submitTraceJob method takes a set of parameters, executes the asynchronous trace on the backend, and returns trace results. | UtilityNetwork | |
Promise<AssociationGeometriesResult> | Given an extent, returns all associations within this extent and their synthesized geometries. | UtilityNetwork | |
Converts an instance of this class to its ArcGIS portal JSON representation. | Network | ||
Promise<TraceResult> | The trace method takes a set of parameters, executes the trace on the backend, and returns trace results. | UtilityNetwork | |
Promise<ValidateNetworkTopologyResult> | Whenever the network is edited or modified, the network and its features become out of date in the network topology. | UtilityNetwork | |
Promise |
| Network |
Method Details
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, addHandles added at 4.25. -
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
canAddAssociation
MethodcanAddAssociation(association){Promise<Boolean>}Since: ArcGIS Maps SDK for JavaScript 4.29UtilityNetwork since 4.29, canAddAssociation added at 4.29. -
Returns
trueif the given Association is valid.Parameterassociation AssociationAssociation that needs to be validated.
ReturnsType Description Promise<Boolean> - Returns true if given Association is valid.
Exampleconst association = new Association({ globalId: "{88355CB3-B011-4715-BB90-047B8C7ABF48}", fromNetworkElement: new NetworkElement({ globalId: "{09B7A0F9-811D-4CCF-95A9-D1995D44C631}", networkSourceId: 8, terminalId: 1, assetGroupCode: 1, assetTypeCode: 1, }), toNetworkElement: new NetworkElement({ globalId: "{86DD4700-4D1B-4872-93CD-68783F7996B6}", networkSourceId: 10, terminalId: 1, assetGroupCode: 2, assetTypeCode: 2, }), associationType: "attachment", }); const isValidAssociation = await utilityNetwork.canAddAssociation(association);
-
Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input
jsonparameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameterjson ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
Returns
-
generateAddAssociations
MethodgenerateAddAssociations(associations){ServiceEdits}Since: ArcGIS Maps SDK for JavaScript 4.29UtilityNetwork since 4.29, generateAddAssociations added at 4.29. -
Returns ServiceEdits which are used to add an Association via the
applyEditsmethod on the FeatureService class.Note: it is advisable to load the associations layer before calling this method, which can be done by calling the loadAssociationsTable method. Loading the associations table ensures that the attributes of the resulting associations use the correctly-cased field names. If the associations table is not loaded, the field names will be in lowercase. Note: Use -1 if terminalId is null.
Parameterassociations Association[]Associationused to generate the ServiceEdits object.ReturnsType Description ServiceEdits Returns ServiceEditswhich are used to add an Association via theapplyEditsmethod on the FeatureService class.Exampleconst association = new Association({ globalId: "{88355CB3-B011-4715-BB90-047B8C7ABF48}", fromNetworkElement: new NetworkElement({ globalId: "{09B7A0F9-811D-4CCF-95A9-D1995D44C631}", networkSourceId: 8, terminalId: 1, assetGroupCode: 1, assetTypeCode: 1, }), toNetworkElement: new NetworkElement({ globalId: "{86DD4700-4D1B-4872-93CD-68783F7996B6}", networkSourceId: 10, terminalId: 1, assetGroupCode: 2, assetTypeCode: 2, }), associationType: "attachment", }); const isValidAssociation = await utilityNetwork.canAddAssociation(association); const generatedAssociations = utilityNetwork.generateAddAssociation([association]); const featureService = new FeatureService({ url: "https://hostName.com/server/rest/services/Test/FeatureServer" }); featureService.applyEdits([generatedAssociations], { gdbVersion: "unadmin.testVersion", globalIdUsed: false, honorSequenceOfEdits: false usePreviousEditMoment: false, returnServiceEditsInSourceSR: true, })
-
generateCombineNetworkElements
MethodgenerateCombineNetworkElements(networkElements){ServiceEdits}Since: ArcGIS Maps SDK for JavaScript 4.34UtilityNetwork since 4.29, generateCombineNetworkElements added at 4.34. beta -
Returns ServiceEdits to combine network elements in a telecom domain network via the
applyEditsmethod on the FeatureService class.The objects being combined must have consecutive unit IDs, exist in the same table and unit container, and have the same attribute values.
ParameternetworkElements NetworkElement[]The network elements to combine in a telecom domain network.
ReturnsType Description ServiceEdits ServiceEditsfor combining network elements in a telecom domain network.Exampleconst networkElementA = new NetworkElement({ globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}", networkSourceId: 20, }); const networkElementB = new NetworkElement({ globalId: "{74100804-E229-49b8-8CDC-9B5D3EF03EDA}", networkSourceId: 20, }); const networkElementC = new NetworkElement({ globalId: "{39B856DC-AFE4-4c02-B433-A9361ACD91CF}", networkSourceId: 20, }); const serviceEdits = utilityNetwork.generateCombineNetworkElements([ networkElementA, networkElementB, networkElementC, ]); await featureService.applyEdits([serviceEdits]);
-
generateDeleteAssociations
MethodgenerateDeleteAssociations(associations){ServiceEdits}Since: ArcGIS Maps SDK for JavaScript 4.29UtilityNetwork since 4.29, generateDeleteAssociations added at 4.29. -
Returns ServiceEdits which are used to delete an Association via the
applyEditsmethod on the FeatureService class.Parameterassociations Association[]Associationused to generate the ServiceEdits object.ReturnsType Description ServiceEdits Returns ServiceEditswhich are used to delete an Association via theapplyEditsmethod on the FeatureService class.Exampleconst association = new Association({ globalId: "{323FF251-A5FC-4665-97A3-D78615C3DD21}", }); const generatedDeleteAssociations = utilityNetwork.generateDeleteAssociations([association]); const featureService = new FeatureService({ url: "https://hostName.com/server/rest/services/Test/FeatureServer" }); featureService.applyEdits([generatedDeleteAssociations], { gdbVersion: "unadmin.testVersion", globalIdUsed: true, //globalIdUsed must be true when deleting associations with this workflow honorSequenceOfEdits: false usePreviousEditMoment: false, returnServiceEditsInSourceSR: true, })
-
generateDivideNetworkElements
MethodgenerateDivideNetworkElements(networkElement, numUnits){ServiceEdits}Since: ArcGIS Maps SDK for JavaScript 4.34UtilityNetwork since 4.29, generateDivideNetworkElements added at 4.34. beta -
Returns ServiceEdits to divide a grouped network element in a telecom domain network into two or more grouped elements via the
applyEditsmethod on the FeatureService class.ParametersnetworkElement NetworkElementThe grouped network element in a telecom domain network to divide into two or more grouped elements.
Describes how the unit identifiers of the grouped object should be divided. Each number in this array describes the number of units to assign an object resulting from the division. E.g., to divide one object with 6 units into an object with 5 units and another object with 1 unit, specify [5, 1].
ReturnsType Description ServiceEdits ServiceEditsfor dividing a network element in a telecom domain network.Exampleconst networkElement = new NetworkElement({ globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}", networkSourceId: 20, }); const serviceEdits = utilityNetwork.generateDivideNetworkElements(networkElement, [2, 3, 4]); await featureService.applyEdits([serviceEdits]);
-
getCircuitManager
MethodgetCircuitManager(telecomDomainNetworkName){Promise<(CircuitManager|null|undefined)>}Since: ArcGIS Maps SDK for JavaScript 4.34UtilityNetwork since 4.29, getCircuitManager added at 4.34. beta -
Returns a CircuitManager for the utility network's telecom domain network, if one exists.
ParametertelecomDomainNetworkName StringThe name of the telecom domain network to return a
CircuitManagerfor.ReturnsType Description Promise<(CircuitManager|null|undefined)> Resolves to a CircuitManager for the utility network's telecom domain network, or null if no such domain network exists.
-
Inherited from Network
-
The network consists of sources (classes) and each source has a unique Id. These source Ids are used to perform traversal in the network topology. The trace end points are not aware of layers and only returns sources of results. This method returns the layerId for given a source Id. Used as a helper method to process trace results.
ParametersourceId NumberThe id of the source.
Returns
-
Inherited from Network
-
Groups network elements by their layerId. Returns a list containing the objectIds within each layer.
Parameterelements NetworkElement[]Array of network elements.
Returns
-
Since: ArcGIS Maps SDK for JavaScript 4.34UtilityNetwork since 4.29, getTerminalById added at 4.34. -
Given a terminalId, returns the corresponding Terminal instance.
ParameterterminalId NumberoptionalThe terminalId used to retrieve the corresponding Terminal.
Returns
-
getTerminalConfiguration
MethodgetTerminalConfiguration(feature){TerminalConfiguration |null |undefined} -
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
ASSETGROUPandASSETTYPEfields along side the network source to find out the assigned terminal configuration. If eitherASSETGROUP,ASSETTYPEorlayerare not populated anullis returned. Returnsnullif terminal configuration object couldn't be found.Parameterfeature GraphicThe graphic feature to get the terminal configuration from. Must belong to a device layer, and have
ASSETGROUPandASSETTYPEfields populated.ReturnsType Description TerminalConfiguration | null | undefined The terminal configuration object. Most devices have a single terminal configuration unless configured otherwise.
-
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.
ParameterdomainNetworkName StringThe name of the domain network.
Returns
-
getUnitIdentifierManager
MethodgetUnitIdentifierManager(){Promise<(UnitIdentifierManager|null|undefined)>}Since: ArcGIS Maps SDK for JavaScript 4.34UtilityNetwork since 4.29, getUnitIdentifierManager added at 4.34. beta -
Returns a UnitIdentifierManager for the utility network's telecom domain networks, if any exist.
ReturnsType Description Promise<(UnitIdentifierManager|null|undefined)> Resolves to a UnitIdentifierManager for the utility network's telecom domain networks, or null if no such domain network exists.
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}Inherited from AccessorSince: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, hasHandles added at 4.25. -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns trueif a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
isFulfilled
InheritedMethodisFulfilled(){Boolean}Inherited from Network -
isFulfilled()may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled,truewill be returned.ReturnsType Description Boolean Indicates whether creating an instance of the class has been fulfilled (either resolved or rejected).
-
isRejected
InheritedMethodisRejected(){Boolean}Inherited from Network -
isRejected()may be used to verify if creating an instance of the class is rejected. If it is rejected,truewill be returned.ReturnsType Description Boolean Indicates whether creating an instance of the class has been rejected.
-
isResolved
InheritedMethodisResolved(){Boolean}Inherited from Network -
isResolved()may be used to verify if creating an instance of the class is resolved. If it is resolved,truewill be returned.ReturnsType Description Boolean Indicates whether creating an instance of the class has been resolved.
-
isUtilityLayer
MethodisUtilityLayer(layer){Boolean}Since: ArcGIS Maps SDK for JavaScript 4.32UtilityNetwork since 4.29, isUtilityLayer added at 4.32. -
Returns a boolean indicating if the layer is a utility layer belonging to the network.
Parameterlayer Layer|SubtypeSublayerThe layer to check if it is a utility layer.
ReturnsType Description Boolean value indicating membership of the layer in the utility network.
-
Triggers the loading of the UtilityNetwork instance.
Fully loads the utility network definition and all the shared named trace configurations.
Parametersoptional Additional options.
Specificationsignal AbortSignal|null|undefinedoptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortErrorwhen an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.ReturnsType Description Promise Resolves when the UtilityNetwork is loaded.
-
loadAssociationsTable
MethodloadAssociationsTable(){Promise<FeatureLayer>}Since: ArcGIS Maps SDK for JavaScript 4.32UtilityNetwork since 4.29, loadAssociationsTable added at 4.32. -
Loads the Utility Network's associations table.
ReturnsType Description Promise<FeatureLayer> Resolves to a loaded instance of FeatureLayer representing the associations table.
-
loadSubnetworksTable
MethodloadSubnetworksTable(){Promise<FeatureLayer>}Since: ArcGIS Maps SDK for JavaScript 4.34UtilityNetwork since 4.29, loadSubnetworksTable added at 4.34. -
Loads the Utility Network's subnetworks table.
ReturnsType Description Promise<FeatureLayer> Resolves to a loaded instance of FeatureLayer representing the subnetworks table.
-
queryAssociations
MethodqueryAssociations(props, options){Promise<Association[]>}Since: ArcGIS Maps SDK for JavaScript 4.28UtilityNetwork since 4.29, queryAssociations added at 4.28. -
Returns all associations filtered by the QueryAssociationsParameters in a utility network. The
gdbVersionandmomentproperties of thepropsparameter will be hydrated from this UtilityNetwork.Parametersprops ObjectProps consists of returnDeletes, elements, and types.
SpecificationreturnDeletes BooleanoptionalIf
true, the response includes associations that have been deleted.elements NetworkElement[]optionalThe network elements for which the associations are queried.
optional The association types to query. Junction-edge connectivity associations are used to establish a relationship between a point feature or junction object and an edge object.
Junction-edge from connectivityJunction-edge midspan connectivityJunction-edge to connectivity
These association types enable connectivity to be established between nonspatial junction and edge objects and provide an additional method to model connectivity between noncoincident point features using an edge object.
Possible Values
Value Description connectivity Allows modeling the connectivity between two features that are not coincident or between spatial features and nonspatial junction and edge objects. junction-junction-connectivity Allows modeling the connectivity between two features that are not coincident or between spatial features and nonspatial junction and edge objects. attachment Allows the modeling of supporting structures and attachments in a network. containment Allows a dense collection of features to be represented by a single feature. junction-edge-from-connectivity Junction edge from connectivity. junction-edge-midspan-connectivity Junction edge midspan connectivity. junction-edge-to-connectivity Junction edge to connectivity. The "connectivity" type has been deprecated since version 4.29. Please use "junction-junction-connectivity" instead.
options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignal|null|undefinedoptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortErrorwhen an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.ReturnsType Description Promise<Association[]> When resolved, the list of returned Associations from the query.
-
queryNamedTraceConfigurations
InheritedMethodqueryNamedTraceConfigurations(query, options){Promise<NamedTraceConfiguration[]>}Inherited from NetworkSince: ArcGIS Maps SDK for JavaScript 4.25Network since 4.31, queryNamedTraceConfigurations added at 4.25. -
Named trace configurations allow you to add and store complex traces in a network that can be shared across an organization through web maps and consumed by web and field applications. This method returns a list of NamedTraceConfiguration objects that meet specific search conditions. Used to find existing named trace configurations in a utility network.
Parametersquery ObjectoptionalThe query parameters that are used to determine which named trace configurations will be returned.
Specificationoptional An array of the named trace configuration creators to be queried.
optional An array of named trace configuration globalIds (UUID) to be queried.
optional An array of named trace configuration names to be queried.
optional An array of named trace configuration user tags to be queried.
options RequestOptions|nulloptionalThe request options specified by the user in the data request. See RequestOptions for available properties.
ReturnsType Description Promise<NamedTraceConfiguration[]> Resolves with an array of named trace configurations filtered based on the query parameters. Examples// Initialize the query object with global IDs of the named trace configurations to query. const query = { globalIds: ["5dbb5a13-ab2f-452d-bfcb-6f98154ccb9d", "cf568e46-f200-486c-adb1-d008a3da0ed1"], } // Query the utility network named trace configurations // and filter the results by the query object. const namedTraceConfigurations = await utilityNetwork.queryNamedTraceConfigurations(query); // Print the named trace configurations to the console. console.log(namedTraceConfigurations)// Calling this method without parameters returns all named trace configurations in the utility network. const namedTraceConfigurations = await utilityNetwork.queryNamedTraceConfigurations({}); // Print all the named trace configurations to the console. console.log(namedTraceConfigurations);
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, removeHandles added at 4.25. -
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
-
submitTopologyValidationJob
MethodsubmitTopologyValidationJob(parameters, options){Promise<(TopologyValidationJobInfo|null|undefined)>}Since: ArcGIS Maps SDK for JavaScript 4.26UtilityNetwork since 4.29, submitTopologyValidationJob added at 4.26. -
Whenever the network is edited or modified, the network and its features become out of date in the network topology. Validating the network topology maintains consistency between feature editing space and network topology space. Validating a network topology may include all or a subset of the dirty areas layer present in the network.
Parametersparameters ValidateTopologyPropsThe parameters that are used to validate the network topology.
options RequestOptionsoptionalThe request options specified by the user in the data request. See RequestOptions for available properties.
ReturnsType Description Promise<(TopologyValidationJobInfo|null|undefined)> Resolves with the results returned from validating network topology. Exampleconst extent = new Extent({ xmin: 470789.0888, ymin: 3597733.2051, xmax: 531454.2759999996, ymax: 3639864.802100001, spatialReference: { wkid: 26911, latestWkid: 26911 } }); const validationResult = await utilityNetwork.submitTopologyValidationJob({ validateArea: extent, validationType: "rebuild", validationSet: [ { sourceId: 4134325151, globalIds: ["{7865BAA6-ED9C-4346-9F72-894A49E10C73}"] } ] });
-
submitTraceJob
MethodsubmitTraceJob(props){Promise<TraceJobInfo>}Since: ArcGIS Maps SDK for JavaScript 4.27UtilityNetwork since 4.29, submitTraceJob added at 4.27. -
The submitTraceJob method takes a set of parameters, executes the asynchronous trace on the backend, and returns trace results. The
gdbVersionandmomentproperties of thepropsparameter will be hydrated from this UtilityNetwork.The
pathandcircuittrace types are reserved for future use.ParametersSpecificationprops ObjectProps consists of namedTraceConfigurationGlobalId, traceLocations, outSpatialReference, traceConfiguration, resultTypes, and traceType.
SpecificationnamedTraceConfigurationGlobalId StringoptionalThe globalId (UUID) of the named trace configuration persisted in the network.
traceLocations TraceLocation[]optionalThe list of starting points and barriers that will define where the trace starts and stops. This parameter can be optional (defaults to empty array) if minStartingPoints in
NamedTraceConfigurationis set tonone.outSpatialReference SpatialReferenceoptionalThe spatial reference that should be used to project the aggregated geometries returned by the trace (if applicable).
traceConfiguration UNTraceConfigurationoptionalDefines the properties of a trace.
resultTypes ResultTypeJSON[]optionalParameter specifying the types of results to return after running a trace.
optional The traceType defined in this trace configuration.
Possible Values:"connected"|"upstream"|"downstream"|"shortest-path"|"subnetwork"|"subnetwork-controller"|"loops"|"isolation"|"path"|"circuit"
ReturnsType Description Promise<TraceJobInfo> Returns a Promise of TraceJobInfo.
-
synthesizeAssociationGeometries
MethodsynthesizeAssociationGeometries(props){Promise<AssociationGeometriesResult>}Since: ArcGIS Maps SDK for JavaScript 4.28UtilityNetwork since 4.29, synthesizeAssociationGeometries added at 4.28. -
Given an extent, returns all associations within this extent and their synthesized geometries. The
gdbVersionandmomentproperties of thepropsparameter will be hydrated from this UtilityNetwork.ParametersSpecificationprops ObjectProps consists of extent, returnAttachmentAssociations, returnConnectivityAssociations, returnContainmentAssociations, maxGeometryCount, and outSpatialReference.
Specificationextent ExtentThe extent within which to synthesize association geometries.
returnAttachmentAssociations BooleanoptionalIf
true, attachment associations will be included in the results.returnConnectivityAssociations BooleanoptionalIf
true, connectivity associations will be included in the results.returnContainmentAssociations BooleanoptionalIf
true, containment associations will be included in the results.maxGeometryCount NumberoptionalThe maximum number of association geometries to synthesize and return.
ReturnsType Description Promise<AssociationGeometriesResult> When resolved, returns the association geometries result.
-
toJSON
InheritedMethodtoJSON(){Object}Inherited from Network -
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
ReturnsType Description Object The ArcGIS portal JSON representation of an instance of this class.
-
trace
Methodtrace(props){Promise<TraceResult>}Since: ArcGIS Maps SDK for JavaScript 4.27UtilityNetwork since 4.29, trace added at 4.27. -
The trace method takes a set of parameters, executes the trace on the backend, and returns trace results. The
gdbVersionandmomentproperties of thepropsparameter will be hydrated from this UtilityNetwork.The
pathandcircuittrace types are reserved for future use.ParametersSpecificationprops ObjectProps consists of namedTraceConfigurationGlobalId, traceLocations, outSpatialReference, traceConfiguration, resultTypes, and traceType.
SpecificationnamedTraceConfigurationGlobalId StringoptionalThe globalId (UUID) of the named trace configuration persisted in the network.
traceLocations TraceLocation[]optionalThe list of starting points and barriers that will define where the trace starts and stops. This parameter can be optional (defaults to empty array) if minStartingPoints in
NamedTraceConfigurationis set tonone.outSpatialReference SpatialReferenceoptionalThe spatial reference that should be used to project the aggregated geometries returned by the trace (if applicable).
traceConfiguration UNTraceConfigurationoptionalDefines the properties of a trace.
resultTypes ResultTypeJSON[]optionalParameter specifying the types of results to return after running a trace.
optional The traceType defined in this trace configuration.
Possible Values:"connected"|"upstream"|"downstream"|"shortest-path"|"subnetwork"|"subnetwork-controller"|"loops"|"isolation"|"path"|"circuit"
ReturnsType Description Promise<TraceResult> Returns a Promise of TraceResult.
-
validateTopology
MethodvalidateTopology(parameters, options){Promise<ValidateNetworkTopologyResult>}Since: ArcGIS Maps SDK for JavaScript 4.26UtilityNetwork since 4.29, validateTopology added at 4.26. -
Whenever the network is edited or modified, the network and its features become out of date in the network topology. Validating the network topology maintains consistency between feature editing space and network topology space. Validating a network topology may include all or a subset of the dirty areas present in the network.
Parametersparameters ValidateTopologyPropsThe parameters that are used to validate the network topology.
options RequestOptionsoptionalThe request options specified by the user in the data request. See RequestOptions for available properties.
ReturnsType Description Promise<ValidateNetworkTopologyResult> Resolves with the results returned from validating network topology. Exampleconst extent = new Extent({ xmin: 470789.0888, ymin: 3597733.2051, xmax: 531454.2759999996, ymax: 3639864.802100001, spatialReference: { wkid: 26911, latestWkid: 26911 } }); const result = await utilityNetwork.validateTopology({ validateArea: extent });
-
Inherited from Network
-
when()may be leveraged once an instance of the class is created. This method takes two input parameters: aonFulfilledfunction and anonRejectedfunction. TheonFulfilledexecutes when the instance of the class loads. TheonRejectedexecutes if the instance of the class fails to load.ParametersReturnsType Description Promise Returns a new promise for the result of onFulfilledthat may be used to chain additional functions.Example// Although this example uses MapView, any class instance that is a promise may use when() in the same way let view = new MapView(); view.when(function(){ // This function will execute once the promise is resolved }, function(error){ // This function will execute if the promise is rejected due to an error });
Type Definitions
-
ServiceEdits
Type DefinitionServiceEdits ObjectSince: ArcGIS Maps SDK for JavaScript 4.29UtilityNetwork since 4.29, ServiceEdits added at 4.29. -
Results returned from the generateAddAssociations, generateDeleteAssociations, generateCombineNetworkElements, and generateDivideNetworkElements.
- Properties
-
id Number
The layerId of the feature layer.
optionalidentifierFields ObjectIdentifier for globalId and objectId.
optionaladdFeatures Graphic[]|Collection<Graphic>Features to add.
optionalupdateFeatures Graphic[]|Collection<Graphic>Features to update.
optionaldeleteFeatures Graphic[]|Collection<Graphic>|FeatureIdentifier[]Features to delete.
optionaldeleteAssociations DeleteAssociationEdit[]Association deletion edits (foreign-key or traditional).
optionalcombineGroupedObjects CombineGroupedObjectsEdit[]Combine grouped object edits.
optionaldivideGroupedObjects DivideGroupedObjectsEdit[]Divide grouped object edits.