▾
import "@arcgis/map-components/components/arcgis-selection-list";- Inheritance
- ArcgisSelectionList→
HTMLElement
- Since
- ArcGIS Maps SDK for JavaScript 5.2
The Selection List component displays selected features in a hierarchical list organized by group and layer. It is intended for applications that need to present the current selection and support browsing, filtering, and interaction with selected features.
The component can be used with the Map or Scene component and reflects selections made through a selection manager, including the view, the Selection Toolbar, or the selection manager API.
Demo
Properties
| Property | Attribute | Type |
|---|---|---|
| readonly | | |
| | ||
| readonly | | |
| auto-destroy-disabled | ||
| readonly | | |
| disabled | ||
| display-mode | "feature" | "group" | "layer" | |
| readonly | | |
| filter-text | ||
| hide-chip | ||
| hide-chip-close-button | ||
| hide-filter | ||
| hide-filter-notice | ||
| hide-header | ||
| hide-item-close-actions | ||
| hide-item-count | ||
| hide-item-icons | ||
| hide-item-menus | ||
| hide-layer-filter | ||
| hide-menu | ||
| hide-zoom-to-button | ||
| highlight-on-hover-disabled | ||
| icon | ||
| label | ||
| | ||
| readonly | | |
| | ||
| | ||
| readonly | | |
| max-visible-feature-count-per-layer | ||
| menu-scale | Action["scale"] | |
| reference-element | ||
| | ||
| readonly | | "disabled" | "error" | "loading" | "ready" |
| | ||
| readonly | | |
| readonly | | |
| readonly | | |
| visual-scale | Action["scale"] |
activeLayerItem
Reference to a single layer item being displayed in the list, if the layer property is set and that layer has selected features.
afterListItemSelect
- Type
- ListItemSelectCallback | undefined
An optional function that runs when a user selects a feature, layer, or group item in the selection list itself. It does not run when a feature becomes selected through the arcgis-selection-toolbar, map click, or selection manager API.
allLayerItems
- Type
- ParentItem[]
autoDestroyDisabled
- Type
- boolean
If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy() method when you are done to prevent memory leaks.
- Attribute
- auto-destroy-disabled
- Default value
- false
- Example
- <arcgis-selection-list auto-destroy-disabled></arcgis-selection-list>selectionListElement.autoDestroyDisabled = true;
disabled
- Type
- boolean
When true, the component is visually de-emphasized and does not accept user interaction.
- Attribute
- disabled
- Default value
- false
displayMode
- Type
- "feature" | "group" | "layer"
Controls how the list is displayed. If this value is set to "group", the list displays feature and layer items nested under
their associated layer and group items. If this value is set to "layer", the list displays feature items nested under
their associated layer item, while excluding group items. If this value is set to "feature" the list only displays
feature items, while excluding group and layer items.
- Attribute
- display-mode
- Default value
- "group"
effectiveSelectionManager
- Type
- null | undefined | SelectionManager
Reference to the selection manager being represented by the component.
hideChip
- Type
- boolean
Indicates whether the selection count chip should be hidden. The chip shows the total
count of selected features and a close button for clearing the selection.
- Attribute
- hide-chip
- Default value
- false
hideChipCloseButton
- Type
- boolean
Indicates whether the 'close' button on the selection count chip should be hidden. The 'close' button allows users to clear the current selection.
- Attribute
- hide-chip-close-button
- Default value
- false
hideFilter
- Type
- boolean
Indicates that the filter should be hidden.
- Attribute
- hide-filter
- Default value
- false
hideFilterNotice
- Type
- boolean
Indicates that the filter notice should be hidden.
- Attribute
- hide-filter-notice
- Default value
- false
hideHeader
- Type
- boolean
Indicates that the header should be hidden.
- Attribute
- hide-header
- Default value
- false
hideItemCloseActions
- Type
- boolean
Indicates that the close actions for individual list items should be hidden.
- Attribute
- hide-item-close-actions
- Default value
- false
hideItemCount
- Type
- boolean
Indicates that the count for individual list items should be hidden.
- Attribute
- hide-item-count
- Default value
- false
hideItemIcons
- Type
- boolean
Indicates that the icons for individual list items should be hidden.
- Attribute
- hide-item-icons
- Default value
- false
hideItemMenus
- Type
- boolean
Indicates that the menus for individual list items should be hidden.
- Attribute
- hide-item-menus
- Default value
- false
hideLayerFilter
- Type
- boolean
Indicates that the layer filter should be hidden.
- Attribute
- hide-layer-filter
- Default value
- false
hideMenu
- Type
- boolean
Indicates that the primary menu should be hidden.
- Attribute
- hide-menu
- Default value
- false
hideZoomToButton
- Type
- boolean
Indicates that the 'zoom to' button should be hidden.
- Attribute
- hide-zoom-to-button
- Default value
- false
highlightOnHoverDisabled
- Type
- boolean
Property controlling whether corresponding features on the view should not be highlighted when hovering over the associated list item. Only applies to list items representing individual features.
- Attribute
- highlight-on-hover-disabled
- Default value
- false
layer
- Type
- SelectableLayer | null | undefined
Setting this property causes the list to only display features from this layer. If there are no selected features from this layer, the full list will appear. This value also reflects when a layer is selected from the layer dropdown.
layerItems
- Type
- LayerItem[]
Items representing individual layers with an active selection.
listItemActionConfigurations
- Type
- ListItemActionConfiguration[] | undefined
Used to display additional dropdown items in the dropdown associated with each list item.
maxVisibleFeatureCountExceeded
- Type
- boolean
Indicates the list is only showing a subset of selected feature items due to the selection being greater than the current value of the maxVisibleFeatureCountPerLayer property. This value also accounts for any active filters.
- Default value
- false
maxVisibleFeatureCountPerLayer
- Type
- number
Maximum number of selected feature items displayed per layer. Does not limit or restrict the selection itself.
- Attribute
- max-visible-feature-count-per-layer
referenceElement
- Type
- ArcgisReferenceElement | string | undefined
By assigning the id attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.
- Attribute
- reference-element
selectionManager
- Type
- SelectionManager | null | undefined
A reference to a custom selection manager to use instead of the view's default selection manager.
state
- Type
- "disabled" | "error" | "loading" | "ready"
Reflects the component's current state. Possible values are:
"disabled": The component is not interactive."error": The component has encountered an error."loading": The component is in a loading state."ready": The component is ready for interaction.
view
- Type
- SelectableViewUnion | null | undefined
The view associated with the component.
Note: The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this
viewproperty which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-selection-list component will be associated with a map or scene component rather than using theviewproperty.
visibleFeatureCount
- Type
- number
Total number of visible feature items in the list.
visibleFeatureItems
- Type
- FeatureItem[]
Visible feature items in the list, accounting for maxVisibleFeatureCountPerLayer. Excludes feature items hidden by the filter.
visibleLayerCount
- Type
- number
Count for total number of visible layer items in the list, excluding group layer items.
Methods
| Method | Signature |
|---|---|
| clear(): Promise<void> | |
| collapseAll(): Promise<void> | |
| inherited | componentOnReady(): Promise<this> |
| deselectItem(item: ListItem): Promise<void> | |
| destroy(): Promise<void> | |
| expandAll(): Promise<void> | |
| findLayerItem(layer: SelectableLayer): Promise<LayerItem | null | undefined> | |
| findParentItem(layer: SelectableLayer): Promise<null | undefined | ParentItem> | |
| goToItem(item: ListItem): Promise<void> | |
| removeFromSelection(params: {
layer: SelectableLayer;
selection: SelectionIdentifier[];
}): Promise<void> | |
| replace(params: {
layer: SelectableLayer;
selection: SelectionIdentifier[];
}): Promise<void> | |
| selectItem(item: ListItem): Promise<void> |
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
- Example
- const arcgisSelectionList = document.createElement("arcgis-selection-list");document.body.append(arcgisSelectionList);await arcgisSelectionList.componentOnReady();console.log("arcgis-selection-list is ready to go!");
findParentItem
- Signature
-
findParentItem (layer: SelectableLayer): Promise<null | undefined | ParentItem>
Utility method for finding the corresponding parent item for a given layer.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| layer | The layer for which to find the corresponding parent item. | |
- Returns
- Promise<null | undefined | ParentItem>
The parent item associated with the provided layer.
removeFromSelection
- Signature
-
removeFromSelection (params: { layer: SelectableLayer; selection: SelectionIdentifier[]; }): Promise<void>
Removes specific features from the selection, based on the provided layer and object IDs.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | {
layer: SelectableLayer;
selection: SelectionIdentifier[];
} | An object containing the layer and selection to remove. | |
replace
- Signature
-
replace (params: { layer: SelectableLayer; selection: SelectionIdentifier[]; }): Promise<void>
Replaces an active selection, based on the provided layer and object IDs.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | {
layer: SelectableLayer;
selection: SelectionIdentifier[];
} | An object containing the layer and selection to replace. | |
Events
| Name | Type |
|---|---|
| CustomEvent<{ name: "state"; }> | |
arcgisClear
arcgisClear: CustomEvent<void> Fires when the active selection is cleared via the close button on the selection count chip. This event does not fire when the selection is cleared programmatically, or when the selection is cleared by a different component. For more information about selection changes, use the selection-change event emitted by the associated selection manager.
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "state"; }> Emitted when the value of a property is changed. Use this to listen to changes to properties.
arcgisReady
arcgisReady: CustomEvent<void> Emitted when the component associated with a map or scene view is ready for user interaction.