@itwin/core-common
Version:
iTwin.js components common to frontend and backend
95 lines • 5.36 kB
TypeScript
/** @packageDocumentation
* @module DisplayStyles
*/
import { BackgroundMapProps } from "./BackgroundMapSettings";
/** JSON representation of the settings of the terrain applied to background map display by a [[DisplayStyle]].
* @see [[DisplayStyleSettingsProps]]
* @see [[BackgroundMapProps]]
* @public
* @extensions
*/
export interface TerrainProps {
/** Identifies the [TerrainProvider]($frontend) that will supply terrain meshes.
* If omitted, it defaults to "CesiumWorldTerrain".
*/
providerName?: string;
/** Identifies the specific terrain data source to be supplied by the [TerrainProvider]($frontend) identified by [[providerName]],
* for those providers that support multiple data sources.
* For example, the "CesiumWorldTerrain" provider uses this field to store a [[CesiumTerrainAssetId]].
* Default value: an empty string.
*/
dataSource?: string;
/** A value greater than one will cause terrain height to be exaggerated/scaled.false (or 1.0) indicate no exaggeration. Default value: 1.0 */
exaggeration?: number;
/** Applying lighting can help to visualize subtle terrain variation. Default value: true */
applyLighting?: boolean;
/** Origin value - height of the IModel origin at the project center as defined by heightOriginMode. Default value: 0.0 */
heightOrigin?: number;
/** Determines how/if the heightOrigin is applied to the terrain height. Default value: Geodetic */
heightOriginMode?: TerrainHeightOriginMode;
/** If true, the terrain will not be locatable. Otherwise, [[BackgroundMapProps.nonLocatable]] will determine whether terrain is locatable.
* @internal use [[BackgroundMapProps.nonLocatable]]. Retained for backwards compatibility only.
*/
nonLocatable?: boolean;
}
/** Correction modes for terrain height
* @see [[TerrainProps]]
* @public
* @extensions
*/
export declare enum TerrainHeightOriginMode {
/** Height value indicates the geodetic height of the IModel origin (also referred to as ellipsoidal or GPS height) */
Geodetic = 0,
/** Height value indicates the geoidal height of the IModel origin (commonly referred to as sea level). */
Geoid = 1,
/** Height value indicates the height of the IModel origin relative to ground level at project center. */
Ground = 2
}
/** Normalized version of [[TerrainProps]] for which provider has been validated and default values of all members are used.
* @public
*/
export declare class TerrainSettings {
private _nonLocatable;
/** Identifies the [TerrainProvider]($frontend) that will supply terrain meshes.
* Defaults to "CesiumWorldTerrain".
*/
readonly providerName: string;
/** Identifies the specific terrain data source to be supplied by the [TerrainProvider]($frontend) identified by [[providerName]],
* for those providers that support multiple data sources.
* For example, the "CesiumWorldTerrain" provider uses this field to store a [[CesiumTerrainAssetId]].
* Default value: an empty string.
*/
readonly dataSource: string;
/** A value greater than one will cause terrain height to be exaggerated/scaled. 1.0 indicates no exaggeration. Default value: 1.0 */
readonly exaggeration: number;
/** Applying lighting can help to visualize subtle terrain variations. Default value: false */
readonly applyLighting: boolean;
/** Origin value - height of the IModel origin at the project center as defined by heightOriginMode. Default value 0.0 */
readonly heightOrigin: number;
/** Determines how/if the heightOrigin is applied to the terrain height. Default value: Geodetic */
readonly heightOriginMode: TerrainHeightOriginMode;
/** Optionally overrides [[BackgroundMapSettings.locatable]]. For backwards compatibility only.
* @see [[TerrainProps.nonLocatable]].
* @internal
*/
get nonLocatable(): true | undefined;
/** @deprecated in 4.5.0 - will not be removed until after 2026-06-13. Use the overload that takes [[TerrainProps]]. */
constructor(providerName?: string, exaggeration?: number, applyLighting?: boolean, heightOrigin?: number, heightOriginMode?: TerrainHeightOriginMode);
constructor(props?: TerrainProps);
static fromJSON(json?: TerrainProps): TerrainSettings;
/** Create settings that obtain terrain from a [Cesium ION asset](https://cesium.com/platform/cesium-ion/content/) such as
* one of those defined by [[CesiumTerrainAssetId]].
* @note You must ensure your Cesium ION account has access to the specified asset.
*/
static fromCesiumIonAsset(assetId?: string, options?: Omit<TerrainProps, "providerName" | "dataSource">): TerrainSettings;
toJSON(): TerrainProps;
equals(other: TerrainSettings): boolean;
/** Returns true if these settings are equivalent to the supplied JSON settings. */
equalsJSON(json?: BackgroundMapProps): boolean;
/** Create a copy of this TerrainSettings, optionally modifying some of its properties.
* @param changedProps JSON representation of the properties to change.
* @returns A TerrainSettings with all of its properties set to match those of`this`, except those explicitly defined in `changedProps`.
*/
clone(changedProps?: TerrainProps): TerrainSettings;
}
//# sourceMappingURL=TerrainSettings.d.ts.map