▾
import Item from "@arcgis/core/layerList/Item.js";const Item = await $arcgis.import("@arcgis/core/layerList/Item.js");- Inheritance
- Item→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 5.2
Represents the state of one entry in a layer-list workflow.
An item can represent a layer, a track-info part, or a video telemetry-display element. It exposes associated layer and layer-view state, supports nested child items, and stores action and panel state for consumer UIs.
To hide a layer entry based on layer configuration, set Layer.listMode
to hide on the corresponding layer.
- See also
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | The properties used to configure the item. | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| readonly | ConnectedLayerView["connectionStatus"] | null | undefined | |
| | ||
| readonly inherited | ||
| readonly | | |
| | ||
| | ||
| readonly | | |
| | ||
| readonly | | |
| | ||
| | ||
| | ||
| | ||
| | ||
| readonly | | |
| | ||
| readonly | | |
| | ||
| readonly inherited | ||
| readonly | | |
| | ||
| readonly | | |
| | ||
| readonly | | |
| readonly | |
actionsExpanded
- Type
- boolean
Indicates whether the item's action sections are expanded in a consumer UI.
- Default value
- false
actionsSections
- Type
- Collection<Collection<Action>>
A collection of action sections that can be triggered on the item. Each section is rendered as a separate group by consumer UIs.
checkPublishStatusEnabled
- Type
- boolean
Enables publish-status checks used by publishing. When enabled, the item observes the associated layer's publishing status.
- Default value
- false
children
- Type
- Collection<Item>
The child items belonging to this item. Children can represent nested layers, track-info parts, or telemetry-display elements.
childrenSortable
- Type
- boolean
Indicates whether the item's child layers can be sorted or moved within their parent collection. This does not affect track-info or telemetry-display children.
- Default value
- true
- Example
- // disables the children of a parent list item from being sortedlistItem.childrenSortable = false;
connectionStatus
- Type
- ConnectedLayerView["connectionStatus"] | null | undefined
The connection status of the associated StreamLayer when its layer view exposes StreamLayerView.connectionStatus. This status takes precedence over updating for stream layers.
content
- Type
- ItemContent
Identifies the content represented by this item: a layer, a track-info part, or a telemetry-display element.
expanded
- Type
- boolean
Indicates whether this item's details are expanded in a consumer UI.
- Default value
- false
hidden
- Type
- boolean
Indicates whether consumer UIs should hide this item.
This is an alternative to Layer.listMode, which hides a layer based on layer configuration.
- Default value
- false
incompatible
- Type
- boolean
Indicates whether the associated layer view does not support the current view's spatial reference.
- Default value
- false
layer
- Type
- Layer | Sublayer | SubtypeSublayer | SubtypeGroupLayer | null
The layer represented by this item.
layerView
- Type
- LayerView | SpatiallyReferencedLayerView | ConnectedLayerView | null | undefined
listItemCreatedFunction
- Type
- ItemModifier | null | undefined
A function called when the item is created. Use the callback to customize supported item properties or add actions and panel state.
listModeDisabled
- Type
- boolean
Indicates whether to ignore the Layer.listMode property of child layers.
When true, child inclusion is controlled externally instead of by each child's listMode value.
- See also
- Default value
- false
publishing
- Type
- boolean
Indicates whether layer is being published.
The value is false when the layer is not publishing or
checkPublishStatusEnabled is false.
- Default value
- false
sortable
- Type
- boolean
Indicates whether this item can be sorted or moved within its parent collection. Items that represent track-info or telemetry-display content are not sortable.
- Default value
- true
- Example
- // disables the list item from being sortedlistItem.sortable = false;
state
- Type
- State
The overall state of this item for consumer UIs.
Returns disabled when the item has no layer, is hidden, or is incompatible with the view;
loading while the layer or layer view is updating; and ready otherwise.
uid
- Type
- string
- Since
- ArcGIS Maps SDK for JavaScript 4.33
An automatically generated unique identifier assigned to the instance. The unique id is generated each time the application is loaded.
updating
- Type
- boolean
Indicates whether the layer or its layer view is updating, for example while data is being fetched. Publishing and stream connection status take precedence over the layer's updating state.
- Default value
- false
view
- Type
- MapViewOrSceneView | null | undefined
The map or scene view that provides context for this item and its layer view.
visibilityMode
- Type
- ItemVisibilityMode
Specifies how visibility is managed for this item's child layers.
visible
- Type
- boolean
Indicates whether this item is visible. For layer items, this controls the associated layer. For track-info and telemetry-display items, it controls the represented display element.
- Default value
- true
visibleAtCurrentScale
- Type
- boolean
Indicates whether the associated layer is visible at the current view scale.
- Default value
- true
visibleAtCurrentTimeExtent
- Type
- boolean
Indicates whether the associated layer is visible at the current time extent.
- Default value
- true
Methods
| Method | Signature | Class |
|---|---|---|
| clone(): Item | | |
| toggleVisibility(value?: boolean): boolean | |
toggleVisibility
- Signature
-
toggleVisibility (value?: boolean): boolean
Sets or toggles the visibility of the represented content. For layer items, this updates the associated layer. For track-info and telemetry-display items, it updates the represented display element.
If value is provided, visibility is set to that value.
Otherwise, visibility is inverted.