import type Basemap from "../Basemap.js"; import type LocalBasemapsSource from "./LocalBasemapsSource.js"; import type PortalBasemapsSource from "./PortalBasemapsSource.js"; import type BasemapItem from "./support/BasemapItem.js"; import type Collection from "../core/Collection.js"; import type Portal from "../portal/Portal.js"; import type { BasemapProperties } from "../Basemap.js"; import type { LocalBasemapsSourceProperties } from "./LocalBasemapsSource.js"; import type { PortalBasemapsSourceProperties } from "./PortalBasemapsSource.js"; import type { BasemapCompatibilityFunction } from "./types.js"; import type { ReadonlyArrayOrCollection } from "../core/Collection.js"; import type { Loadable, LoadableMixinProperties } from "../core/Loadable.js"; import type { AbortOptions } from "../core/promiseUtils.js"; import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js"; /** @since 5.2 */ export interface BasemapGalleryModelProperties extends LoadableMixinProperties, Partial> { /** * The map's [Map.basemap](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap). * * @since 5.2 */ activeBasemap?: BasemapProperties | string | null; /** * Function used to determine whether a basemap is compatible with the current view. * This is mostly needed for SceneView. * * @since 5.2 */ compatibilityFunction?: BasemapCompatibilityFunction | null; /** * The source for basemaps that the gallery will display. * This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of [Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/)s, or * a [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/) instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/). * * @since 5.2 */ source?: Portal | LocalBasemapsSourceProperties | ReadonlyArrayOrCollection | PortalBasemapsSourceProperties; } /** * Provides the logic for displaying and selecting a collection of basemaps. * * @since 5.2 * @see [LocalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/LocalBasemapsSource/) * @see [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/) */ export default class BasemapGalleryModel extends Loadable { /** @since 5.2 */ constructor(properties?: BasemapGalleryModelProperties); /** * The map's [Map.basemap](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap). * * @since 5.2 */ get activeBasemap(): Basemap | null; set activeBasemap(value: BasemapProperties | string | null | undefined); /** * The current index of the active [Map.basemap](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap). * * @since 5.2 */ get activeBasemapIndex(): number; /** * Function used to determine whether a basemap is compatible with the current view. * This is mostly needed for SceneView. * * @since 5.2 */ get compatibilityFunction(): BasemapCompatibilityFunction; set compatibilityFunction(value: BasemapCompatibilityFunction | null | undefined); /** * A collection of items representing basemaps. * * @since 5.2 */ get items(): Collection; /** * Indicates whether any basemap item in the collection is loading. * * @default false * @since 5.2 */ get loading(): boolean; /** * Indicates whether the projection engine is loading resources required to change the active basemap. * * @default false * @internal * @since 5.2 */ get projectionEngineLoading(): boolean; /** * The source for basemaps that the gallery will display. * This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of [Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/)s, or * a [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/) instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/). * * @since 5.2 */ get source(): LocalBasemapsSource | PortalBasemapsSource; set source(value: Portal | LocalBasemapsSourceProperties | ReadonlyArrayOrCollection | PortalBasemapsSourceProperties); /** * The view from which the Basemap Gallery will operate. This view provides access to the active * [Map.basemap](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap) through the view's [View.map](https://developers.arcgis.com/javascript/latest/references/core/views/View/#map) property. * * @since 5.2 */ accessor view: MapViewOrSceneView | null | undefined; /** * A convenience function to check basemap equality. * * @param basemap1 - The basemap to compare against `basemap2`. * @param basemap2 - The basemap to compare against `basemap1`. * @returns Returns `true` if both basemaps are equal, `false` otherwise. * @since 5.2 */ basemapEquals(basemap1: Basemap | null | undefined, basemap2: Basemap | null | undefined): boolean; /** * Destroys the basemap collection. * * @since 5.2 */ destroy(): void; /** * Loads the current basemap source. * * @returns A promise that resolves with this collection when the source has loaded. * @since 5.2 */ load(): Promise; /** * Loads the current basemap source. * * Unlike [load()](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/BasemapGalleryModel/#load), this method can be called again after the source changes. * * @param options - Options for aborting the load. * @returns A promise that resolves with this collection when the source has loaded. * @internal * @since 5.2 */ loadSource(options?: AbortOptions | null | undefined): Promise; /** * Refreshes the collection of basemap items. * * @since 5.2 */ refresh(): void; }