Skip to content
import UtilityNetwork from "@arcgis/core/networks/UtilityNetwork.js";
Inheritance:
UtilityNetworkNetworkAccessor
Since
ArcGIS Maps SDK 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 WebMap.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
Examples
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

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
PropertyTypeClass
dataElement
inherited
datasetName
readonly inherited
declaredClass
readonly inherited
string[]
featureServiceUrl
readonly inherited
fullExtent
inherited
gdbVersion
inherited
historicMoment
inherited
id
inherited
layerId
readonly inherited
layerUrl
inherited
loaded
readonly inherited
loadError
readonly inherited
loadStatus
readonly inherited
"not-loaded" | "loading" | "failed" | "loaded"
loadWarnings
readonly inherited
any[]
networkServiceUrl
readonly inherited
owner
readonly inherited
parsedUrl
readonly inherited
schemaGeneration
readonly inherited
sourceJSON
inherited
any
spatialReference
inherited
title
inherited
type
readonly
"utility"

associationsTable

readonly Property
Type
FeatureLayer | null | undefined

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

inherited Property
Type
NetworkDataElementJSON | null | undefined
Inherited from: Network

The full network definition, accessible only when the network is loaded.

datasetName

readonlyinherited Property
Type
string | null
Inherited from: Network

The physical dataset name of the network as defined in the backend database. Accessible only when the network is loaded.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

domainNetworkNames

readonly Property
Type
string[]

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

See also

featureServiceUrl

readonlyinherited Property
Type
string
Inherited from: Network

Returns the root feature service url which this network is part of.

Example
`https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/FeatureServer/`

fullExtent

autocast inherited Property
Type
Extent | null | undefined
Inherited from: Network

The full extent of the network, defined from the service territory used to create the network.

gdbVersion

inherited Property
Type
string | null | undefined
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

readonly Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 4.34
beta

Returns true if the utility network data element includes a telecom domain network.

See also

historicMoment

autocast inherited Property
Type
Date | null | undefined
Inherited from: Network

The historic moment to query. If historicMoment is not specified, the query will apply to the current features.

id

inherited Property
Type
string
Inherited from: Network

Random unique id (UUID) to identify a network as defined in the webmap spec. Generated during sharing of the webmap.

layerId

readonlyinherited Property
Type
number
Inherited from: Network

The layer id of the network.

layerUrl

inherited Property
Type
string
Inherited from: Network

The full url to the network layer id as defined in the webmap spec. e.g. https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/FeatureServer/17 (where 17 is the layer id of the network)

loaded

readonlyinherited Property
Type
boolean
Inherited from: Network

Indicates whether the network instance has loaded. When true, all the properties of the object can be accessed.

Default value
false

loadError

readonlyinherited Property
Type
EsriError | null | undefined
Inherited from: LoadableMixin

The Error object returned if an error occurred while loading.

loadStatus

readonlyinherited Property
Type
"not-loaded" | "loading" | "failed" | "loaded"
Inherited from: LoadableMixin

Represents the status of a load() operation.

ValueDescription
not-loadedThe object's resources have not loaded.
loadingThe object's resources are currently loading.
loadedThe object's resources have loaded without errors.
failedThe object's resources failed to load. See loadError for more details.
Default value
"not-loaded"

loadWarnings

readonlyinherited Property
Type
any[]
Inherited from: LoadableMixin

A list of warnings which occurred while loading.

networkServiceUrl

readonlyinherited Property
Type
string
Inherited from: Network

Returns the url of network server.

Example
`https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/UtilityNetworkServer/`

networkSystemLayers

readonly Property
Type
NetworkSystemLayers

Contains the url and IDs of the utility network rules, subnetworks, and dirty areas tables or layers.

Examples
// 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}`);
}
});
// 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}`);
}
});

owner

readonlyinherited Property
Type
string | null
Inherited from: Network

The portal user owner of the network. This portal user can perform administrative actions against the network.

parsedUrl

readonlyinherited Property
Type
UrlObject
Inherited from: Network

Converts url to a url object

schemaGeneration

readonlyinherited Property
Type
number | null
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.

See also

serviceTerritoryFeatureLayerId

readonly Property
Type
number | null

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

autocast Property
Type
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.

sourceJSON

inherited Property
Type
any
Inherited from: Network

spatialReference

autocast inherited Property
Type
SpatialReference
Inherited from: Network

The spatial reference of the network, defined at the creation of the network, usually from the service territory class.

terminalConfigurations

readonly Property
Type
TerminalConfiguration[]

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

title

inherited Property
Type
string
Inherited from: Network

The name of the network as defined in the webmap spec. Represents the layer name of the network layer defined while sharing the webmap.

type

readonly Property
Type
"utility"

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

Default value
"utility"

Methods

MethodSignatureClass
fromPortalItem
inherited static
fromPortalItem(params: NetworkFromPortalItemParameters): Promise<UtilityNetwork | null | undefined>
canAddAssociation(association: Association): Promise<boolean>
cancelLoad
inherited
cancelLoad(): this
generateAddAssociations(associations: Association[]): ServiceEdits
generateCombineNetworkElements(networkElements: NetworkElement[]): ServiceEdits
generateDeleteAssociations(associations: Association[]): ServiceEdits
generateDivideNetworkElements(networkElement: NetworkElement, numUnits: number[]): ServiceEdits
getCircuitManager(telecomDomainNetworkName: string): Promise<CircuitManager | null>
getLayerIdBySourceId(sourceId: number): number | null | undefined
getObjectIdsFromElements(elements: NetworkElement[]): LayerInfo[]
getSourceIdByLayerId(layerId: number): number | null | undefined
getTerminalById(terminalId?: number): Terminal | null | undefined
getTerminalConfiguration(feature: Graphic): TerminalConfiguration | null | undefined
getTierNames(domainNetworkName: string): string[]
getUnitIdentifierManager(): Promise<UnitIdentifierManager | null>
isFulfilled
inherited
isFulfilled(): boolean
isRejected
inherited
isRejected(): boolean
isResolved
inherited
isResolved(): boolean
isUtilityLayer(layer: Layer | SubtypeSublayer): boolean
load(options?: AbortOptions | null | undefined): Promise<this>
loadAssociationsTable(): Promise<FeatureLayer>
loadSubnetworksTable(): Promise<FeatureLayer>
queryAssociations(props: QueryAssociationsProperties, options?: RequestOptions): Promise<Association[]>
queryNamedTraceConfigurations(query: QueryNamedTraceConfigurationsParametersProperties, options?: RequestOptions | null | undefined): Promise<NamedTraceConfiguration[]>
submitTopologyValidationJob(props: ValidateTopologyProperties, options?: RequestOptions | null | undefined): Promise<TopologyValidationJobInfo | null | undefined>
submitTraceJob(props: TraceProperties): Promise<TraceJobInfo>
synthesizeAssociationGeometries(props: SynthesizeAssociationGeometriesProperties): Promise<AssociationGeometriesResult>
trace(props: TraceProperties): Promise<TraceResult>
validateTopology
inherited
validateTopology(props: ValidateTopologyProperties, options?: RequestOptions | null | undefined): Promise<ValidateNetworkTopologyResult>
when
inherited
when<TResult1 = this, TResult2 = never>(onFulfilled?: OnFulfilledCallback<this, TResult1> | null | undefined, onRejected?: OnRejectedCallback<TResult2> | null | undefined): Promise<TResult1 | TResult2>

fromPortalItem

inheritedstatic Method
Signature
fromPortalItem (params: NetworkFromPortalItemParameters): Promise<UtilityNetwork | null | undefined>
Inherited from: Network

Creates a new network instance from an ArcGIS Online or ArcGIS Enterprise portal item.

Known Limitations

This method does not populate the UtilityNetwork.sharedNamedTraceConfigurations for a UtilityNetwork instance.

Parameters
ParameterTypeDescriptionRequired
params

The parameters for loading the portal item.

Returns
Promise<UtilityNetwork | null | undefined>

Returns a promise which resolves to the new utility network instance.

Example
// Create a utility network from a specified portal item that contains a utility network feature service
const item = new PortalItem({
id: "77c7ae75eb3e4e08a7ad98cb37fefe88",
});
const utilityNetwork = await UtilityNetwork.fromPortalItem(item);
await utilityNetwork.load();
console.log("utilityNetwork loaded? ", utilityNetwork.loadStatus);

canAddAssociation

Method
Signature
canAddAssociation (association: Association): Promise<boolean>
Since
ArcGIS Maps SDK for JavaScript 4.29

Returns true if the given Association is valid.

Parameters
ParameterTypeDescriptionRequired
association

Association that needs to be validated.

Returns
Promise<boolean>

Returns true if given Association is valid.

Example
const 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);

cancelLoad

inherited Method
Signature
cancelLoad (): this
Inherited from: LoadableMixin

Cancels a load() operation if it is already in progress.

Returns
this

generateAddAssociations

Method
Signature
generateAddAssociations (associations: Association[]): ServiceEdits
Since
ArcGIS Maps SDK for JavaScript 4.29

Returns ServiceEdits which are used to add an Association via the applyEdits method 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.

Parameters
ParameterTypeDescriptionRequired
associations

Association used to generate the ServiceEdits object.

Returns
ServiceEdits

Returns ServiceEdits which are used to add an Association via the applyEdits method on the FeatureService class.

Example
const 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

Method
Signature
generateCombineNetworkElements (networkElements: NetworkElement[]): ServiceEdits
Since
ArcGIS Maps SDK for JavaScript 4.34
beta

Returns ServiceEdits to combine network elements in a telecom domain network via the applyEdits method 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.

Parameters
ParameterTypeDescriptionRequired
networkElements

The network elements to combine in a telecom domain network.

Returns
ServiceEdits

ServiceEdits for combining network elements in a telecom domain network.

Example
const 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

Method
Signature
generateDeleteAssociations (associations: Association[]): ServiceEdits
Since
ArcGIS Maps SDK for JavaScript 4.29

Returns ServiceEdits which are used to delete an Association via the applyEdits method on the FeatureService class.

Parameters
ParameterTypeDescriptionRequired
associations

Association used to generate the ServiceEdits object.

Returns
ServiceEdits

Returns ServiceEdits which are used to delete an Association via the applyEdits method on the FeatureService class.

Example
const 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

Method
Signature
generateDivideNetworkElements (networkElement: NetworkElement, numUnits: number[]): ServiceEdits
Since
ArcGIS Maps SDK for JavaScript 4.34
beta

Returns ServiceEdits to divide a grouped network element in a telecom domain network into two or more grouped elements via the applyEdits method on the FeatureService class.

Parameters
ParameterTypeDescriptionRequired
networkElement

The grouped network element in a telecom domain network to divide into two or more grouped elements.

numUnits
number[]

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].

Returns
ServiceEdits

ServiceEdits for dividing a network element in a telecom domain network.

Example
const networkElement = new NetworkElement({
globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}",
networkSourceId: 20,
});
const serviceEdits = utilityNetwork.generateDivideNetworkElements(networkElement, [2, 3, 4]);
await featureService.applyEdits([serviceEdits]);

getCircuitManager

Method
Signature
getCircuitManager (telecomDomainNetworkName: string): Promise<CircuitManager | null>
Since
ArcGIS Maps SDK for JavaScript 4.34
beta

Returns a CircuitManager for the utility network's telecom domain network, if one exists.

Parameters
ParameterTypeDescriptionRequired
telecomDomainNetworkName

The name of the telecom domain network to return a CircuitManager for.

Returns
Promise<CircuitManager | null>

Resolves to a CircuitManager for the utility network's telecom domain network, or null if no such domain network exists.

getLayerIdBySourceId

inherited Method
Signature
getLayerIdBySourceId (sourceId: number): number | null | undefined
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.

Parameters
ParameterTypeDescriptionRequired
sourceId

The id of the source.

Returns
number | null | undefined

The layer id.

getObjectIdsFromElements

inherited Method
Signature
getObjectIdsFromElements (elements: NetworkElement[]): LayerInfo[]
Inherited from: Network

Groups network elements by their layerId. Returns a list containing the objectIds within each layer.

Parameters
ParameterTypeDescriptionRequired
elements

Array of network elements.

Returns
LayerInfo[]

Array of objects containing layerId and objectIds.

getSourceIdByLayerId

inherited Method
Signature
getSourceIdByLayerId (layerId: number): number | null | undefined
Inherited from: Network

Returns the layer ID for a given network source ID.

Parameters
ParameterTypeDescriptionRequired
layerId

The id of the layer.

Returns
number | null | undefined

The source corresponding network source ID, if one exists.

getTerminalById

Method
Signature
getTerminalById (terminalId?: number): Terminal | null | undefined
Since
ArcGIS Maps SDK for JavaScript 4.34

Given a terminalId, returns the corresponding Terminal instance.

Parameters
ParameterTypeDescriptionRequired
terminalId

The terminalId used to retrieve the corresponding Terminal.

Returns
Terminal | null | undefined

An instance of Terminal that matches the specified terminalId, or null if no match is found.

getTerminalConfiguration

Method
Signature
getTerminalConfiguration (feature: Graphic): 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 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.

Parameters
ParameterTypeDescriptionRequired
feature

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

Returns
TerminalConfiguration | null | undefined

The terminal configuration object. Most devices have a single terminal configuration unless configured otherwise.

getTierNames

Method
Signature
getTierNames (domainNetworkName: string): 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.

See also
Parameters
ParameterTypeDescriptionRequired
domainNetworkName

The name of the domain network.

Returns
string[]

Returns an array of tier names.

getUnitIdentifierManager

Method
Signature
getUnitIdentifierManager (): Promise<UnitIdentifierManager | null>
Since
ArcGIS Maps SDK for JavaScript 4.34
beta

Returns a UnitIdentifierManager for the utility network's telecom domain networks, if any exist.

Returns
Promise<UnitIdentifierManager | null>

Resolves to a UnitIdentifierManager for the utility network's telecom domain networks, or null if no such domain network exists.

isFulfilled

inherited Method
Signature
isFulfilled (): boolean
Inherited from: EsriPromiseMixin

isFulfilled() may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled, true will be returned.

Returns
boolean

Indicates whether creating an instance of the class has been fulfilled (either resolved or rejected).

isRejected

inherited Method
Signature
isRejected (): boolean
Inherited from: EsriPromiseMixin

isRejected() may be used to verify if creating an instance of the class is rejected. If it is rejected, true will be returned.

Returns
boolean

Indicates whether creating an instance of the class has been rejected.

isResolved

inherited Method
Signature
isResolved (): boolean
Inherited from: EsriPromiseMixin

isResolved() may be used to verify if creating an instance of the class is resolved. If it is resolved, true will be returned.

Returns
boolean

Indicates whether creating an instance of the class has been resolved.

isUtilityLayer

Method
Signature
isUtilityLayer (layer: Layer | SubtypeSublayer): boolean
Since
ArcGIS Maps SDK for JavaScript 4.32

Returns a boolean indicating if the layer is a utility layer belonging to the network.

Parameters
ParameterTypeDescriptionRequired
layer

The layer to check if it is a utility layer.

Returns
boolean

value indicating membership of the layer in the utility network.

load

Method
Signature
load (options?: AbortOptions | null | undefined): Promise<this>

Triggers the loading of the UtilityNetwork instance.

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

Parameters
ParameterTypeDescriptionRequired
options

Additional options.

Returns
Promise<this>

Resolves when the UtilityNetwork is loaded.

loadAssociationsTable

Method
Signature
loadAssociationsTable (): Promise<FeatureLayer>
Since
ArcGIS Maps SDK for JavaScript 4.32

Loads the Utility Network's associations table.

Returns
Promise<FeatureLayer>

Resolves to a loaded instance of FeatureLayer representing the associations table.

loadSubnetworksTable

Method
Signature
loadSubnetworksTable (): Promise<FeatureLayer>
Since
ArcGIS Maps SDK for JavaScript 4.34

Loads the Utility Network's subnetworks table.

Returns
Promise<FeatureLayer>

Resolves to a loaded instance of FeatureLayer representing the subnetworks table.

queryAssociations

Method
Signature
queryAssociations (props: QueryAssociationsProperties, options?: RequestOptions): Promise<Association[]>
Since
ArcGIS Maps SDK for JavaScript 4.28

Returns all associations filtered by the QueryAssociationsParameters in a utility network. The gdbVersion and moment properties of the props parameter will be hydrated from this UtilityNetwork.

Parameters
ParameterTypeDescriptionRequired
props

Props consists of returnDeletes, elements, and types.

options

An object with the following properties.

Returns
Promise<Association[]>

When resolved, the list of returned Associations from the query.

queryNamedTraceConfigurations

inherited Method
Signature
queryNamedTraceConfigurations (query: QueryNamedTraceConfigurationsParametersProperties, options?: RequestOptions | null | undefined): Promise<NamedTraceConfiguration[]>
Inherited from: Network
Since
ArcGIS Maps SDK for JavaScript 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.

Parameters
ParameterTypeDescriptionRequired
query

The query parameters that are used to determine which named trace configurations will be returned.

options

The request options specified by the user in the data request. See RequestOptions for available properties.

Returns
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);

submitTopologyValidationJob

inherited Method
Signature
submitTopologyValidationJob (props: ValidateTopologyProperties, options?: RequestOptions | null | undefined): Promise<TopologyValidationJobInfo | null | undefined>
Inherited from: Network
Since
ArcGIS Maps SDK for JavaScript 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 and up-to-date content between the 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.

Parameters
ParameterTypeDescriptionRequired
props

The parameters that are used to validate the network topology.

options

The request options specified by the user in the data request. See RequestOptions for available properties.

Returns
Promise<TopologyValidationJobInfo | null | undefined>

Resolves with the results returned from validating network topology.

Example
const extent = new Extent({
xmin: 470789.0888,
ymin: 3597733.2051,
xmax: 531454.2759999996,
ymax: 3639864.802100001,
spatialReference: { wkid: 26911, latestWkid: 26911 }
});
const validationResult = await network.submitTopologyValidationJob({
validateArea: extent,
validationType: "rebuild",
validationSet: [
{
sourceId: 4134325151,
globalIds: ["{7865BAA6-ED9C-4346-9F72-894A49E10C73}"]
}
]
});

submitTraceJob

Method
Signature
submitTraceJob (props: TraceProperties): Promise<TraceJobInfo>
Since
ArcGIS Maps SDK for JavaScript 4.27

The submitTraceJob method takes a set of parameters, executes the asynchronous trace on the backend, and returns trace results. The gdbVersion and moment properties of the props parameter will be hydrated from this UtilityNetwork.

The path and circuit trace types are reserved for future use.

Parameters
ParameterTypeDescriptionRequired
props

Props consists of namedTraceConfigurationGlobalId, traceLocations, outSpatialReference, traceConfiguration, resultTypes, and traceType.

Returns
Promise<TraceJobInfo>

Returns a Promise of TraceJobInfo.

synthesizeAssociationGeometries

Method
Signature
synthesizeAssociationGeometries (props: SynthesizeAssociationGeometriesProperties): Promise<AssociationGeometriesResult>
Since
ArcGIS Maps SDK for JavaScript 4.28

Given an extent, returns all associations within this extent and their synthesized geometries. The gdbVersion and moment properties of the props parameter will be hydrated from this UtilityNetwork.

Parameters
ParameterTypeDescriptionRequired
props

Props consists of extent, returnAttachmentAssociations, returnConnectivityAssociations, returnContainmentAssociations, maxGeometryCount, and outSpatialReference.

Returns
Promise<AssociationGeometriesResult>

When resolved, returns the association geometries result.

trace

Method
Signature
trace (props: TraceProperties): Promise<TraceResult>
Since
ArcGIS Maps SDK for JavaScript 4.27

The trace method takes a set of parameters, executes the trace on the backend, and returns trace results. The gdbVersion and moment properties of the props parameter will be hydrated from this UtilityNetwork.

The path and circuit trace types are reserved for future use.

Parameters
ParameterTypeDescriptionRequired
props

Props consists of namedTraceConfigurationGlobalId, traceLocations, outSpatialReference, traceConfiguration, resultTypes, and traceType.

Returns
Promise<TraceResult>

Returns a Promise of TraceResult.

validateTopology

inherited Method
Signature
validateTopology (props: ValidateTopologyProperties, options?: RequestOptions | null | undefined): Promise<ValidateNetworkTopologyResult>
Inherited from: Network
Since
ArcGIS Maps SDK for JavaScript 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 and up-to-date content between the 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.

Parameters
ParameterTypeDescriptionRequired
props

The parameters that are used to validate the network topology.

options

The request options specified by the user in the data request. See RequestOptions for available properties.

Returns
Promise<ValidateNetworkTopologyResult>

Resolves with the results returned from validating network topology.

Example
const extent = new Extent({
xmin: 470789.0888,
ymin: 3597733.2051,
xmax: 531454.2759999996,
ymax: 3639864.802100001,
spatialReference: { wkid: 26911, latestWkid: 26911 }
});
const result = await network.validateTopology({
validateArea: extent
});

when

inherited Method
Signature
when <TResult1 = this, TResult2 = never>(onFulfilled?: OnFulfilledCallback<this, TResult1> | null | undefined, onRejected?: OnRejectedCallback<TResult2> | null | undefined): Promise<TResult1 | TResult2>
Type parameters
<TResult1 = this, TResult2 = never>
Inherited from: EsriPromiseMixin

when() may be leveraged once an instance of the class is created. This method takes two input parameters: an onFulfilled function and an onRejected function. The onFulfilled executes when the instance of the class loads. The onRejected executes if the instance of the class fails to load.

Parameters
ParameterTypeDescriptionRequired
onFulfilled

The function to call when the promise resolves.

onRejected

The function to execute when the promise fails.

Returns
Promise<TResult1 | TResult2>

Returns a new promise for the result of onFulfilled that 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

SynthesizeAssociationGeometriesProperties

Type definition
Supertypes
Pick<SynthesizeAssociationGeometriesParametersProperties‚ "returnAttachmentAssociations" | "returnConnectivityAssociations" | "returnContainmentAssociations" | "extent" | "maxGeometryCount" | "outSpatialReference">

TraceProperties

Type definition
Supertypes
Pick<TraceParametersProperties‚ "namedTraceConfigurationGlobalId" | "traceLocations" | "outSpatialReference" | "traceConfiguration" | "resultTypes" | "traceType">

QueryAssociationsProperties

Type definition
Supertypes
Pick<QueryAssociationsParametersProperties‚ "returnDeletes" | "elements" | "types">