UNPKG

@itwin/core-common

Version:

iTwin.js components common to frontend and backend

137 lines 7.45 kB
/** @packageDocumentation * @module DisplayStyles */ import { BackgroundMapType } from "./BackgroundMapProvider"; import { PlanarClipMaskProps, PlanarClipMaskSettings } from "./PlanarClipMask"; import { TerrainProps, TerrainSettings } from "./TerrainSettings"; /** Describes the projection of the background map * @see [[BackgroundMapProps]] * @see [[DisplayStyleSettingsProps]] * @public * @extensions */ export declare enum GlobeMode { /** Display Earth as 3d ellipsoid */ Ellipsoid = 0, /** Display Earth as plane. */ Plane = 1 } /** In-memory JSON representation of a [[BackgroundMapSettings]]. * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation. * @public * @extensions */ export interface BackgroundMapProps { /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */ groundBias?: number; /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. * Default value: false. */ transparency?: number | false; /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */ useDepthBuffer?: boolean; /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */ applyTerrain?: boolean; /** Properties associated with terrain display. */ terrainSettings?: TerrainProps; /** Globe Mode. Default value: GlobeMode.Ellipsoid */ globeMode?: GlobeMode; /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it * allows the user to select elements that are behind the map. */ nonLocatable?: boolean; /** A planar mask applied to the map geometry * @beta */ planarClipMask?: PlanarClipMaskProps; /** See [[DeprecatedBackgroundMapProps.providerName]]. */ providerName?: never; /** See [[DeprecatedBackgroundMapProps.providerData]]. */ providerData?: never; } /** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility. * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in * [[PersistentBackgroundMapProps]] because they remain part of the persistence format. * @public * @extensions */ export interface DeprecatedBackgroundMapProps { /** Identifies the source of the map tiles. Currently supported providers are "BingProvider" and "MapBoxProvider". * Default value: "BingProvider" * @deprecated in 3.6.0 - might be removed in next major version. Use MapImageryProps.backgroundBase. */ providerName?: string; /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used. * @deprecated in 3.6.0 - might be removed in next major version. Use MapImageryProps.backgroundBase */ providerData?: { /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */ mapType?: BackgroundMapType; }; } /** Persistent JSON representation of a [[BackgroundMapSettings]]. * @public * @extensions */ export type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps; /** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed. * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style. * @see [[MapImagerySettings]] to control the type of imagery applied to the background map. * @public */ export declare class BackgroundMapSettings { /** Retained strictly for persistence. */ private readonly _provider; /** Elevation in meters, relative to WGS84 Ellipsoid.. */ readonly groundBias: number; /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */ readonly transparency: number | false; /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */ readonly useDepthBuffer: boolean; /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */ readonly applyTerrain: boolean; /** Settings associated with terrain display. */ readonly terrainSettings: TerrainSettings; /** Globe display mode. */ readonly globeMode: GlobeMode; /** Planar Mask - used to mask the background map to avoid overlapping with other geometry * @beta */ readonly planarClipMask: PlanarClipMaskSettings; private readonly _locatable; /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it * allows the user to select elements that are behind the map. */ get locatable(): boolean; /** If transparency is overridden, the transparency to apply; otherwise, undefined. */ get transparencyOverride(): number | undefined; private constructor(); /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from * the iModel - otherwise, prefer [[fromJSON]]. */ static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings; /** Construct from JSON, performing validation and applying default values for undefined fields. * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel. */ static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings; /** Convert these settings to their in-memory JSON representation. * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel. */ toJSON(): BackgroundMapProps; /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to * the iModel - otherwise, prefer [[toJSON]]. */ toPersistentJSON(): PersistentBackgroundMapProps; /** Returns true if these settings are equivalent to the supplied JSON settings. */ equalsJSON(json?: BackgroundMapProps): boolean; /** Returns true if the persistent representation of these settings is equivalent to `json`. */ equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean; /** Returns true if these settings are equivalent to `other`. */ equals(other: BackgroundMapSettings): boolean; /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties. * @param changedProps JSON representation of the properties to change. * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`. */ clone(changedProps?: BackgroundMapProps): BackgroundMapSettings; } //# sourceMappingURL=BackgroundMapSettings.d.ts.map