@vertigis/viewer-spec
Version:
VertiGIS Viewer Specification
75 lines (74 loc) • 2.57 kB
TypeScript
import type { BasemapExtension } from "@vertigis/arcgis-extensions/mapping/BasemapExtension";
import type { Command } from "../Command.js";
import type { Event } from "../Event.js";
import { EventRegistry } from "../EventRegistry.js";
import type { Operation } from "../Operation.js";
import { OperationRegistry } from "../OperationRegistry.js";
import { CommandRegistry } from "./../CommandRegistry.js";
import type { BasemapsLike, MapsLike } from "./../common.js";
import type { MapEvent } from "./map.js";
export declare class BasemapCommands extends CommandRegistry {
protected readonly _prefix = "basemap";
/**
* Switch to a configured basemap.
*/
get set(): Command<SetBasemapArgs>;
}
export declare class BasemapOperations extends OperationRegistry {
protected readonly _prefix = "basemap";
/**
* Gets all configured basemaps.
*
* Having argument:
*
* - Multiple maps: the union of all basemap options from each
* - No maps: the union of all basemap options for every map in the
* application.
*/
get getAll(): Operation<MapsLike, BasemapExtension[]>;
/**
* Gets currently selected basemap for the given map. If more than one map
* is specified, only the first map is used.
*/
get getCurrent(): Operation<MapsLike, BasemapExtension>;
}
/**
* Argument used in case when we have only 1 map in the app or when the first
* active map should be used. Basemap extension ID or the basemap self. If more
* than one basemap is specified, only the first one is used.
*/
export type SetBasemapArg = string | BasemapsLike;
/**
* Argument used in case when we have more than 1 map in the app, and we need to
* pass the target map from outside (eg basemap picker in VertiGIS Studio Web).
*/
export interface SetBasemapWithTargetMapArg {
/**
* Basemap to be set.
*/
basemap: SetBasemapArg;
/**
* Target map.
*/
map: MapsLike;
}
/**
* Argument used when setting current basemap in the app.
*/
export type SetBasemapArgs = SetBasemapArg | SetBasemapWithTargetMapArg;
export declare class BasemapEvents extends EventRegistry {
protected readonly _prefix = "basemap";
/**
* Raised when the basemap is changed by any means. Mobile only.
*
* @mobileOnly
*/
get changed(): Event<MapEvent>;
/**
* Raised when the basemap is explicitly changed via the 'basemap.set'
* command or the 'layer-presets.apply' command. Mobile only.
*
* @mobileOnly
*/
get set(): Event<MapEvent>;
}