UNPKG

@arcgis/core

Version:

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

41 lines (38 loc) 3.47 kB
import type Accessor from "../../core/Accessor.js"; import type Collection from "../../core/Collection.js"; import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js"; import type { AttributionItem } from "../types.js"; export interface AttributionViewModelProperties extends Partial<Pick<AttributionViewModel, "view">> {} export type AttributionViewModelState = "disabled" | "ready" | "loading"; /** * Provides the logic for the [Attribution](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attribution/) widget. * Displays attribution text for the layers in a map. * The text displayed for the layers is either a list of data providers or * sources as defined in the layer's custom attribution data, or the copyright text. * The attribution is automatically updated based on layer visibility and map extent. * * > [!WARNING] * > * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content. * > For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation. * > For information, see the [Terms of Use documentation](https://developers.arcgis.com/documentation/terms-of-use/). * * @deprecated since version 5.0. Attribution is handled automatically by the [Map](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/) and [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/) components, with properties for extracting attribution items, hiding the attribution, as well as setting dark and light mode for the attribution. * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern) * @since 4.0 * @see [Attribution](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attribution/) - Deprecated since 5.0. As of 5.0, attribution is handled automatically by the [Map](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/), [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/), and [Link Chart](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-link-chart/) components, with properties for extracting attribution items, hiding the attribution, as well as setting dark and light mode for the attribution. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/). * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern) */ export default class AttributionViewModel extends Accessor { constructor(properties?: AttributionViewModelProperties); /** A collection of [AttributionItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/types/#AttributionItem)s. */ get items(): Collection<AttributionItem>; /** * The view model's state. * * @default "disabled" */ get state(): AttributionViewModelState; /** The view from which the view model will operate. */ accessor view: MapViewOrSceneView | null | undefined; }