Skip to content
import CircuitSection from "@arcgis/core/networks/support/CircuitSection.js";
Inheritance:
CircuitSectionAccessor
Since
ArcGIS Maps SDK for JavaScript 4.34
beta

Represents a circuit section in a telecom domain network.

Creating a CircuitSection

CircuitSections may be created in one of three ways: with start location and stop location, with a subcircuit, or with neither.

Keep in mind that sectionId must always be specified when instantiating a CircuitSection, and the following may be optionally specified: attributes, globalId, and sectionType (defaults to physical).

Read More

With start and stop location

If created with start and stop locations, the section does not consume a subcircuit.

const startLocation = new CircuitLocation({
sourceId: 20,
globalId: "{728C3E4A-DA4B-4766-9CA5-AF19B9E3F89C}",
firstUnit: 1,
lastUnit: 1,
});
const stopLocation = new CircuitLocation({
sourceId: 20,
globalId: "{0E3D7C20-E74D-482F-AE40-4319BCF0EA74}",
firstUnit: 1,
lastUnit: 1,
});
const section = new CircuitSection({
sectionId: 1,
sectionType: "physical",
startLocation,
stopLocation,
});

With a subcircuit

If created with a Subcircuit, the section does consume a subcircuit.

const section = new CircuitSection({
sectionId: 1,
sectionType: "physical",
subcircuit: new Subcircuit({
name: "SUBCIRCUITVALUE1",
state: "available",
}),
});

As an empty section

To create an empty circuit section:

const section = new CircuitSection({ sectionId: 1 });
See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
circuitSectionProperties
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.

attributes

Property
Type
Record<string, any> | null | undefined

User-defined attributes on the circuit section.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

globalId

Property
Type
string | null | undefined

The global ID of the circuit section.

path

readonly Property
Type
CircuitPath | null | undefined

The path between the circuit's start and stop locations. This property is null unless the circuit section is returned by a circuit trace on a sectioned circuit.

role

readonly Property
Type
CircuitSectionRoleType

The role of the section in the consuming circuit. This is a system-maintained field derived from the SectionOrder field in the Circuit table.

Default value
"start-and-end"

sectionId

Property
Type
number

The unique identifier of the circuit section within a circuit. This property is used to define section order in a circuit.

sectionType

Property
Type
CircuitType

Indicates the type of the circuit section. A virtual circuit section does not require traversability between its start and stop locations.

Default value
"physical"

startLocation

autocast Property
Type
CircuitLocation | null | undefined

The start location associated with the circuit section. This property is null if the circuit section consumes a subcircuit.

stopLocation

autocast Property
Type
CircuitLocation | null | undefined

The stop location associated with the circuit section. This property is null if the circuit section consumes a subcircuit.

subcircuit

autocast Property
Type
Subcircuit | null | undefined

The subcircuit being consumed by the circuit section.

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
emit
inherited
emit<Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
getAttribute<T = any>(name: string): T
hasEventListener
inherited
hasEventListener<Type extends EventNames<this>>(type: Type): boolean
on
inherited
on<Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
setAttribute(name: string, newValue: any): void
setStartStopLocations(startLocation: CircuitLocation, stopLocation: CircuitLocation): void
setSubcircuit(subcircuit: Subcircuit): void
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

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 json parameter 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.

Parameters
ParameterTypeDescriptionRequired
json
any

A 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
any

Returns a new instance of this class.

emit

inherited Method
Signature
emit <Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Emits an event on the instance. This method should only be used when creating subclasses of this class.

Parameters
ParameterTypeDescriptionRequired
type
Type

The name of the event.

event
this["@eventTypes"][Type]

The event payload.

Returns
boolean

true if a listener was notified

getAttribute

Method
Signature
getAttribute <T = any>(name: string): T
Type parameters
<T = any>

Returns the value of the specified user-defined attribute.

Parameters
ParameterTypeDescriptionRequired
name

The name of the attribute.

Returns
T

Returns the value of the attribute specified by name.

hasEventListener

inherited Method
Signature
hasEventListener <Type extends EventNames<this>>(type: Type): boolean
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Indicates whether there is an event listener on the instance that matches the provided event name.

Parameters
ParameterTypeDescriptionRequired
type
Type

The name of the event.

Returns
boolean

Returns true if the class supports the input event.

on

inherited Method
Signature
on <Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Registers an event handler on the instance. Call this method to hook an event with a listener.

Parameters
ParameterTypeDescriptionRequired
type
Type

An event or an array of events to listen for.

listener
EventedCallback<this["@eventTypes"][Type]>

The function to call when the event fires.

Returns
ResourceHandle

Returns an event handler with a remove() method that should be called to stop listening for the event(s).

PropertyTypeDescription
removeFunctionWhen called, removes the listener from the event.
Example
view.on("click", function(event){
// event is the event handle returned after the event fires.
console.log(event.mapPoint);
});

setAttribute

Method
Signature
setAttribute (name: string, newValue: any): void

Sets a new value for the specified user-defined attribute.

Parameters
ParameterTypeDescriptionRequired
name

The name of the attribute to set.

newValue
any

The new value to set on the named attribute.

Returns
void

setStartStopLocations

Method
Signature
setStartStopLocations (startLocation: CircuitLocation, stopLocation: CircuitLocation): void

Sets the start and stop locations of the circuit section. This method sets the section's subcircuit to null.

Parameters
ParameterTypeDescriptionRequired
startLocation

The start location of the circuit section.

stopLocation

The stop location of the circuit section.

Returns
void

setSubcircuit

Method
Signature
setSubcircuit (subcircuit: Subcircuit): void

Sets the subcircuit for the circuit section to consume. This method sets the section's startLocation and stopLocation to null.

Parameters
ParameterTypeDescriptionRequired
subcircuit

The subcircuit that the section will consume.

Returns
void

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.

Type definitions

CommonProperties

Type definition
Supertypes
Pick<CircuitSection‚ "sectionId"> ‚  Partial<Pick<CircuitSection, "attributes" | "globalId" | "sectionType">>

EmptySectionProperties

Type definition
Supertypes
CommonProperties

startLocation

Property
Type
null | undefined

stopLocation

Property
Type
null | undefined

subcircuit

Property
Type
null | undefined

SectionWithLocationsProperties

Type definition
Supertypes
CommonProperties

startLocation

Property
Type
CircuitLocation

stopLocation

Property
Type
CircuitLocation

subcircuit

Property
Type
null | undefined

SectionWithSubcircuitProperties

Type definition
Supertypes
CommonProperties

startLocation

Property
Type
null | undefined

stopLocation

Property
Type
null | undefined

subcircuit

Property
Type
Subcircuit