UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

75 lines (72 loc) 5.4 kB
import type Collection from "../../core/Collection.js"; import type ListItem from "../LayerList/ListItem.js"; import type { EventedAccessor } from "../../core/Evented.js"; import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js"; import type { BasemapLayerListState } from "./types.js"; import type { LayerListViewModelEvents } from "../LayerList/LayerListViewModel.js"; import type { Action, ListItemModifier } from "../LayerList/types.js"; export interface BasemapLayerListViewModelProperties extends Partial<Pick<BasemapLayerListViewModel, "baseListItemCreatedFunction" | "basemapTitle" | "checkPublishStatusEnabled" | "listModeDisabled" | "referenceListItemCreatedFunction" | "view">> {} export interface BasemapLayerListViewModelEvents extends LayerListViewModelEvents {} /** * Provides logic for the [BasemapLayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list/). * * @since 4.13 * @see [BasemapLayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/) widget * @see [Basemap Layer List component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list/) * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern) */ export default class BasemapLayerListViewModel extends EventedAccessor { constructor(properties?: BasemapLayerListViewModelProperties); /** A collection of [ListItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/ListItem/)s representing the [Basemap.baseLayers](https://developers.arcgis.com/javascript/latest/references/core/Basemap/#baseLayers). */ get baseItems(): Collection<ListItem>; /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/ListItem/). * Each list item can be modified * according to its modifiable properties. Actions can be added to list items * using the [ListItem.actionsSections](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/ListItem/#actionsSections). */ accessor baseListItemCreatedFunction: ListItemModifier | null | undefined; /** The current basemap's title. */ accessor basemapTitle: string | null | undefined; /** * Whether to provide an indication if a layer is being published in the * [BasemapLayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/). * When a layer is publishing, a rotating square will appear to the right of the * list item title. The list item * [ListItem.publishing](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/ListItem/#publishing) property * will be `false` if `checkPublishStatusEnabled` is `false`. * * @default false * @since 4.25 */ accessor checkPublishStatusEnabled: boolean; /** * Specifies whether to ignore the [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode) property of the layers to display all layers. * A common use case for `listModeDisabled` is when you want to use the [BasemapLayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/) to manage and configure a layer's `listMode` value. * * @default false * @since 4.30 * @see [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode) */ accessor listModeDisabled: boolean; /** A collection of [ListItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/ListItem/)s representing the [Basemap.referenceLayers](https://developers.arcgis.com/javascript/latest/references/core/Basemap/#referenceLayers). */ get referenceItems(): Collection<ListItem>; /** Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/ListItem/) representing reference layers. */ accessor referenceListItemCreatedFunction: ListItemModifier | null | undefined; /** * The view model's state. * * @default "disabled" */ get state(): BasemapLayerListState; /** A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). Set this to link the widget to a specific view. */ accessor view: MapViewOrSceneView | null | undefined; /** * Triggers the [BasemapLayerList.@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/#event-trigger-action) event and executes * the given [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or [action toggle](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/). * * @param action - The action to execute. * @param item - An item associated with the action. */ triggerAction(action: Action, item: ListItem): void; }