import BasemapLayerListViewModel from "@arcgis/core/widgets/BasemapLayerList/BasemapLayerListViewModel.js";const BasemapLayerListViewModel = await $arcgis.import("@arcgis/core/widgets/BasemapLayerList/BasemapLayerListViewModel.js");- Inheritance:
- BasemapLayerListViewModel→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.13
Provides logic for the BasemapLayerList widget and component.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
baseItems readonly | | |
| | ||
| | ||
| | ||
declaredClass readonly inherited | ||
| | ||
referenceItems readonly | | |
| | ||
state readonly | | |
| |
baseItems
- Type
- Collection<ListItem>
A collection of ListItems representing the Basemap.baseLayers.
baseListItemCreatedFunction
- Type
- ListItemModifier | null | undefined
Specifies a function that accesses each ListItem. Each list item can be modified according to its modifiable properties. Actions can be added to list items using the ListItem.actionsSections.
checkPublishStatusEnabled
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.25
Whether to provide an indication if a layer is being published in the
BasemapLayerList.
When a layer is publishing, a rotating square will appear to the right of the
list item title. The list item
ListItem.publishing property
will be false if checkPublishStatusEnabled is false.
- Default value
- false
listModeDisabled
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.30
Specifies whether to ignore the Layer.listMode property of the layers to display all layers.
A common use case for listModeDisabled is when you want to use the BasemapLayerList to manage and configure a layer's listMode value.
- See also
- Default value
- false
referenceItems
- Type
- Collection<ListItem>
A collection of ListItems representing the Basemap.referenceLayers.
referenceListItemCreatedFunction
- Type
- ListItemModifier | null | undefined
Specifies a function that accesses each ListItem representing reference layers.
view
- Type
- MapViewOrSceneView | null | undefined
Methods
| Method | Signature | Class |
|---|---|---|
emit inherited | emit<Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean | |
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 | |
triggerAction(action: Action, item: ListItem): void | |
emit
- Signature
-
emit <Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
- Type parameters
- <Type extends EventNames<this>>
Emits an event on the instance. This method should only be used when creating subclasses of this class.
hasEventListener
- Signature
-
hasEventListener <Type extends EventNames<this>>(type: Type): boolean
- Type parameters
- <Type extends EventNames<this>>
Indicates whether there is an event listener on the instance that matches the provided event name.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | Type | The name of the event. | |
- Returns
- boolean
Returns true if the class supports the input event.
on
- Signature
-
on <Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
- Type parameters
- <Type extends EventNames<this>>
Registers an event handler on the instance. Call this method to hook an event with a listener.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| 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).Property Type Description remove Function When 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);}); triggerAction
- Signature
-
triggerAction (action: Action, item: ListItem): void
Triggers the BasemapLayerList.@trigger-action event and executes the given action or action toggle.