@arcgis/core/networks/Network
Class defining high level properties that describes utility networks and trace networks.
- See also
Property Overview
| Name | Type | Summary | Class |
|---|---|---|---|
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 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 | ||
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. | Network | ||
The portal user owner of the network. | Network | ||
Converts url to a url object | Network | ||
The schema version of the network. | Network | ||
| Network | |||
The spatial reference of the network, defined at the creation of the network, usually from the service territory class. | Network | ||
The name of the network as defined in the webmap spec. | Network | ||
The type of the dataset. | Network |
Property Details
-
dataElement
PropertydataElement NetworkDataElementJSON |null |undefined -
The full network definition, accessible only when the network is loaded.
-
The physical dataset name of the network as defined in the backend database. Accessible only when the network is loaded.
-
featureServiceUrl
PropertyfeatureServiceUrl Stringreadonly -
Returns the root feature service url which this network is part of.
Example`https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/FeatureServer/`
-
The full extent of the network, defined from the service territory used to create the network.
-
The version of the geodatabase of the feature service data. Read the Overview of versioning topic for more details about this capability.
-
The historic moment to query. If historicMoment is not specified, the query will apply to the current features.
-
id
Propertyid String -
Random unique id (UUID) to identify a network as defined in the webmap spec. Generated during sharing of the webmap.
-
layerId
PropertylayerId Numberreadonly -
The layer id of the network.
-
layerUrl
PropertylayerUrl String -
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)
-
The Error object returned if an error occurred while loading.
- Default Value:null
-
loadStatus
PropertyloadStatus Stringreadonly -
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"
-
A list of warnings which occurred while loading.
-
loaded
Propertyloaded Booleanreadonly -
Indicates whether the network instance has loaded. When
true, all the properties of the object can be accessed.- Default Value:false
-
networkServiceUrl
PropertynetworkServiceUrl Stringreadonly -
Returns the url of network server.
Example`https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/UtilityNetworkServer/`
-
networkSystemLayers
PropertynetworkSystemLayers NetworkSystemLayers |null |undefinedreadonly -
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}`); } });
-
The portal user owner of the network. This portal user can perform administrative actions against the network.
-
parsedUrl
PropertyparsedUrl Objectreadonly -
Converts url to a url object
-
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.
-
sourceJSON
PropertysourceJSON Object -
-
spatialReference
PropertyspatialReference SpatialReferenceautocast -
The spatial reference of the network, defined at the creation of the network, usually from the service territory class.
-
title
Propertytitle String -
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
Propertytype Stringreadonly -
The type of the dataset. Returns "utility" if the object represents a utility network or "trace" in case the network is a trace network.
Possible Values:"utility" |"trace"
- 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 | ||
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 | ||
Promise<UtilityNetwork> | Creates a new network instance from an ArcGIS Online or ArcGIS Enterprise portal item. | Network | |
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 | ||
Returns true if a named group of handles exist. | Accessor | ||
| Network | ||
| Network | ||
| Network | ||
Promise | Loads the resources referenced by this class. | Network | |
Promise | Triggers the loading of the network instance. | Network | |
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. | Network | ||
Converts an instance of this class to its ArcGIS portal JSON representation. | Network | ||
Promise<ValidateNetworkTopologyResult> | Whenever the network is edited or modified, the network and its features become out of date in the network topology. | Network | |
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.
-
Cancels a load() operation if it is already in progress.
-
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
-
fromPortalItem
MethodfromPortalItem(params){Promise<UtilityNetwork>}static -
Creates a new network instance from an ArcGIS Online or ArcGIS Enterprise portal item.
Known Limitations This method does not populate the sharedNamedTraceConfigurations for a UtilityNetwork instance.
Parametersparams ObjectThe parameters for loading the portal item.
SpecificationportalItem PortalItemThe object representing an ArcGIS Online or ArcGIS Enterprise portal item from which to load the network.
ReturnsType Description Promise<UtilityNetwork> 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);
-
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
-
Groups network elements by their layerId. Returns a list containing the objectIds within each layer.
Parameterelements NetworkElement[]Array of network elements.
Returns
-
Returns the layer ID for a given network source ID.
ParameterlayerId NumberThe id of the layer.
Returns
-
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
MethodisFulfilled(){Boolean} -
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).
-
Loads the resources referenced by this class. This method automatically executes for a View and all of the resources it references in Map if the view is constructed with a map instance.
This method must be called by the developer when accessing a resource that will not be loaded in a View.
The
load()method only triggers the loading of the resource the first time it is called. The subsequent calls return the same promise.It's possible to provide a
signalto stop being interested into aLoadableinstance load status. When the signal is aborted, the instance does not stop its loading process, only cancelLoad can abort it.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 resources have loaded.
-
Triggers the loading of the network instance.
Fully loads the network definition and all related objects (e.g. trace configurations)
ReturnsType Description Promise Resolves when the Network is loaded.
-
queryNamedTraceConfigurations
MethodqueryNamedTraceConfigurations(query, options){Promise<NamedTraceConfiguration[]>}Since: 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(props, options){Promise<(TopologyValidationJobInfo|null|undefined)>}Since: ArcGIS Maps SDK for JavaScript 4.26Network since 4.31, 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 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.
Parametersprops ValidateTopologyPropsThe parameters that are used to validate the network topology.
options RequestOptions|nulloptionalThe 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 network.submitTopologyValidationJob({ validateArea: extent, validationType: "rebuild", validationSet: [ { sourceId: 4134325151, globalIds: ["{7865BAA6-ED9C-4346-9F72-894A49E10C73}"] } ] });
-
toJSON
MethodtoJSON(){Object} -
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.
-
validateTopology
MethodvalidateTopology(props, options){Promise<ValidateNetworkTopologyResult>}Since: ArcGIS Maps SDK for JavaScript 4.26Network since 4.31, 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 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.
Parametersprops ValidateTopologyPropsThe parameters that are used to validate the network topology.
options RequestOptions|nulloptionalThe 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 network.validateTopology({ validateArea: extent });
-
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
-
DomainNetworkJSON
Type DefinitionDomainNetworkJSON ObjectSince: ArcGIS Maps SDK for JavaScript 4.34Network since 4.31, DomainNetworkJSON added at 4.34. -
Describes a domain network in a utility network data element.
- Properties
-
domainNetworkName String
The name of the domain network.
isStructureNetwork BooleanIndicates if this domain network is a structure network.
isTelecomNetwork BooleanIndicates if this domain network is a telecom domain network.
An array of network source objects that represent the sources of junction features.
- Specification
-
layerId Number
The layer ID of the junction source.
sourceId NumberThe source ID of the junction source.
utilityNetworkFeatureClassUsageType StringThe usage type of the junction source.
An array of asset groups defined for the junction source.
- Properties
-
assetGroupCode Number
The unique code for the asset group.
optionalassetGroupName StringThe name of the asset group.
An array of asset types associated with the asset group.
- Specification
-
assetTypeCode Number
The unique code for the asset type.
optionalassetTypeName StringThe name of the asset type.
optionalisTerminalConfigurationSupported BooleanIndicates if terminal configurations are supported for the asset type.
optionalterminalConfigurationId NumberThe terminal configuration ID associated with the asset type, if applicable.
optionalconnectivityPolicy StringThe connectivity policy applied to the asset type.
Supported properties for the junction source.
An array of network source objects that represent the sources of edge features.
- Specification
-
layerId Number
The layer ID of the edge source.
sourceId NumberThe source ID of the edge source.
utilityNetworkFeatureClassUsageType StringThe usage type of the edge source.
An array of asset groups defined for the edge source.
- Properties
-
assetGroupCode Number
The unique code for the asset group.
optionalassetGroupName StringThe name of the asset group.
An array of asset types associated with the asset group.
- Specification
-
assetTypeCode Number
The unique code for the asset type.
optionalassetTypeName StringThe name of the asset type.
optionalisTerminalConfigurationSupported BooleanIndicates if terminal configurations are supported for the asset type.
optionalterminalConfigurationId NumberThe terminal configuration ID associated with the asset type, if applicable.
optionalconnectivityPolicy StringThe connectivity policy applied to the asset type.
Supported properties for the edge source.
optional An array of tier definitions used to organize the network into hierarchical levels. Null if no tiers are defined, e.g., a telecom domain network.
- Specification
-
name String
The name of the tier.
optional The layer ID of the subnetwork layer. Null if no subnetwork layer is defined, e.g., a telecom domain network.
optional An array of circuit source objects for telecom networks.
optional Circuit properties for telecom networks.
optional An array of objects to describe color schemes in a telecom domain network.
optional An array of objects describing divide policies for a telecom domain network.
optional An array of objects describing combine policies.
optionaltraceConfiguration UNTraceConfiguration|nullA UNTraceConfiguration object that defines the trace configuration for the domain network. This configuration includes parameters specific to utility networks.
-
LayerInfo
Type DefinitionLayerInfo ObjectSince: ArcGIS Maps SDK for JavaScript 4.31Network since 4.31, LayerInfo added at 4.31. -
Contains layerUrl, objectIds, and outFields.
-
NetworkDataElementJSON
Type DefinitionNetworkDataElementJSON ObjectSince: ArcGIS Maps SDK for JavaScript 4.33Network since 4.31, NetworkDataElementJSON added at 4.33. -
Contains the full network definition.
- Properties
-
domainNetworks DomainNetworkJSON[]
An array of domain networks included in the utility network.
userIdentity StringThe user identity associated with the network definition.
name StringThe name of the utility network.
schemaGeneration NumberThe schema generation version number of the utility network.
An array of terminal configuration objects available in the network.
- Specification
-
terminalConfigurationId Number
The Id that uniquely identifies the terminal configuration.
serviceTerritoryFeatureLayerId NumberThe layer Id of the feature layer representing service territories within the network.
-
Since: ArcGIS Maps SDK for JavaScript 4.27Network since 4.31, ValidateTopologyProps added at 4.27. -
ValidateTopologyProps represents the parameters for validating a network topology.
- Properties
-
validateArea Extent
Specifies the envelope of the area to validate. This property is required.
optionalvalidationSet ValidationSetItemJSON[]Specifies the set of features and objects to validate.
optionalvalidationType StringSpecifies the validation to perform.
Possible Values:"normal"|"rebuild"|"force-rebuild"
Exampleconst validationResult = await network.validateTopology({ validateArea: extent, gdbVersion: "sde.DEFAULT", validationType: "rebuild", validationSet: [ { sourceId: 4134325151, globalIds: ["{7865BAA6-ED9C-4346-9F72-894A49E10C73}"] } ] });