@itwin/core-common
Version:
iTwin.js components common to frontend and backend
63 lines • 3.21 kB
TypeScript
/** @packageDocumentation
* @module MapLayers
*/
import { DeprecatedBackgroundMapProps } from "./BackgroundMapSettings";
import { ColorDef, ColorDefProps } from "./ColorDef";
import { BaseMapLayerProps, BaseMapLayerSettings, MapLayerProps, MapLayerSettings } from "./MapLayerSettings";
/** JSON representation of a [[BaseLayerSettings]].
* @public
*/
export type BaseLayerProps = BaseMapLayerProps | ColorDefProps;
/** The JSON representation of the map imagery. Map imagery include the specification for the base layer (which was originally
* represented by [[BackgroundMapProps.providerName]] && [[BackgroundMapProps.providerData]]) and additional map layers.
* In earlier versions only a background map was supported as specified by the providerName and mapType members of [[BackgroundMapSettings]] object.
* In order to provide backward compatibility the original [[BackgroundMapSettings]] are synchronized with the [[MapImagerySettings]] base layer as long as
* the settings are compatible.
* The non-base map layers may represent image layers generated by tile servers or model layers that are generated by 2d projection of model geometry, typically from a model
* that is generated from two dimensional GIS data.
* @public
*/
export interface MapImageryProps {
backgroundBase?: BaseLayerProps;
backgroundLayers?: MapLayerProps[];
overlayLayers?: MapLayerProps[];
}
/** The base layer for a [[MapImagerySettings]].
* @see [[MapImagerySettings.backgroundBase]].
* @public
*/
export type BaseLayerSettings = BaseMapLayerSettings | ColorDef;
/** @public */
export declare namespace BaseLayerSettings {
/** Create a base layer from its JSON representation. */
function fromJSON(props: BaseLayerProps): BaseLayerSettings;
}
/** Provides access to the map imagery settings (Base and layers).
* In earlier versions only a background map was supported as specified by the providerName and mapType members of [[BackgroundMapSettings]] object.
* In order to provide backward compatibility the original [[BackgroundMapSettings]] are synchronized with the [[MapImagerySettings]] base layer as long as
* the settings are compatible.
* @public
*/
export declare class MapImagerySettings {
private _backgroundBase;
private _backgroundLayers;
private _overlayLayers;
private constructor();
/** The settings for the base layer.
* @note If changing the base provider it is currently necessary to also update the background map settings.
*/
get backgroundBase(): BaseLayerSettings;
set backgroundBase(base: BaseLayerSettings);
get backgroundLayers(): MapLayerSettings[];
get overlayLayers(): MapLayerSettings[];
/** Return base transparency as a number between 0 and 1.
* @internal
*/
get baseTransparency(): number;
/** Construct from JSON, performing validation and applying default values for undefined fields. */
static fromJSON(imageryJson?: MapImageryProps): MapImagerySettings;
/** @internal */
static createFromJSON(imageryJson?: MapImageryProps, mapProps?: DeprecatedBackgroundMapProps): MapImagerySettings;
toJSON(): MapImageryProps;
}
//# sourceMappingURL=MapImagerySettings.d.ts.map