@itwin/core-common 5.5.0-dev.9 → 5.6.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"IModel.js","sourceRoot":"","sources":["../../src/IModel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAc,IAAI,EAAc,YAAY,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtJ,OAAO,EACE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAkB,QAAQ,EAC9H,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAsB,MAAM,sCAAsC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAyM5C;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACvB,wCAAwC;IACxB,MAAM,CAAU;IAChC,4CAA4C;IAC5B,WAAW,CAAqB;IAChD,wFAAwF;IACxE,kBAAkB,CAAgB;IAClD,8HAA8H;IAC9G,OAAO,CAAY;IACnC,8HAA8H;IAC9G,OAAO,CAAY;IACnC,mFAAmF;IAClE,UAAU,GAAc,SAAS,CAAC,cAAc,EAAE,CAAC;IAEpE,uFAAuF;IAChF,YAAY,KAAgB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAE5D,2FAA2F;IAC3F,YAAY,KAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAC,QAAQ,CAA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,EAAE,MAAgB,IAAa,OAAO,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAErJ;;;;;OAKG;IACI,6BAA6B,CAAC,OAAe,EAAE,MAAqB,IAAkB,OAAO,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhL;;;;;;OAMG;IACI,6BAA6B,CAAC,YAA0B,EAAE,MAAgB,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { assert, BeEvent, expectDefined, GeoServiceStatus, GuidString, Id64, Id64String, IModelStatus, Mutable, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, AxisIndex, AxisOrder, Constant, Geometry, Matrix3d, Point3d, Range3d, Range3dProps, Transform, TransformProps, Vector3d, XYAndZ, XYZProps,\r\n YawPitchRollAngles, YawPitchRollProps,\r\n} from \"@itwin/core-geometry\";\r\nimport { ChangesetIdWithIndex } from \"./ChangesetProps\";\r\nimport { Cartographic, CartographicProps } from \"./geometry/Cartographic\";\r\nimport { GeographicCRS, GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\r\nimport { AxisAlignedBox3d } from \"./geometry/Placement\";\r\nimport { IModelError } from \"./IModelError\";\r\nimport { ThumbnailProps } from \"./Thumbnail\";\r\n\r\n/** The properties to open a connection to an iModel for RPC operations.\r\n * @public\r\n */\r\nexport interface IModelRpcOpenProps {\r\n /** The iTwin in which the iModel exists - must be defined for briefcases that are synchronized with iModelHub. */\r\n readonly iTwinId?: GuidString;\r\n /** Guid of the iModel. */\r\n readonly iModelId?: GuidString;\r\n\r\n /** Id of the last Changeset that was applied to the iModel - must be defined for briefcases that are synchronized with iModelHub.\r\n * @note Changeset Ids are string hash values based on the content and parent.\r\n */\r\n readonly changeset?: ChangesetIdWithIndex;\r\n}\r\n\r\n/** The properties that identify an opened iModel for RPC operations.\r\n * @public\r\n */\r\nexport interface IModelRpcProps extends IModelRpcOpenProps {\r\n /** Unique key used for identifying the iModel between the frontend and the backend */\r\n readonly key: string;\r\n}\r\n\r\n/** Properties that position an iModel on the earth via [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\r\n * The origin is specified as an ECEF coordinate. The cartographicOrigin property contains the latitude, longitude and elevation above the WGS84 ellipsoid\r\n * of the origin property. This cartographicOrigin is offered as a convenient pre-calculated value representing the location of the ECEF origin.\r\n * The 3D coordinate system this class represents is positioned at specified origin and the axis positioned according to\r\n * the other properties.\r\n * If transform property is defined then it will not be computed from other properties.\r\n * If the xVector and yVector properties are defined (and transform is not defined) then they take precedence over the YawPitchRoll orientation property. The xVector and yVector\r\n * represent the direction and scale of the X and Y axes. The Z axis is always perpendicular (according to the right hand rule) to these X-Y axes.\r\n * The scaling in the Z direction is always unity. The scale of the X and Y axes is represented by the size of the vector length.\r\n * If the xVector and yVector are not present then the YawPitchRoll properties indicates the angles for all tree axes. Scaling in that case\r\n * is unity in all three directions.\r\n * Note that the present class is intended to represent geolocated 3D coordinate systems that are normally tangent to the WGS84 ellipsoid\r\n * possibly offset in altitude by the terrain elevation above the ellipsoid but other general 3D coordinate systems\r\n * can be defined.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface EcefLocationProps {\r\n /** The Origin of an iModel on the earth in ECEF coordinates */\r\n readonly origin: XYZProps;\r\n /** The [orientation](https://en.wikipedia.org/wiki/Geographic_coordinate_conversion) of an iModel on the earth. */\r\n readonly orientation: YawPitchRollProps;\r\n /** Optional position on the earth used to establish the ECEF coordinates. */\r\n readonly cartographicOrigin?: CartographicProps;\r\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n readonly xVector?: XYZProps;\r\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n readonly yVector?: XYZProps;\r\n /** Optional potentially non-rigid transform defining the ECEF location.\r\n * @note If this property is supplied, the other properties are ignored.\r\n */\r\n readonly transform?: TransformProps;\r\n}\r\n\r\n/** Properties of the [Root Subject]($docs/bis/guide/references/glossary#subject-root).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface RootSubjectProps {\r\n /** The name of the root subject. */\r\n readonly name: string;\r\n /** Description of the root subject (optional). */\r\n readonly description?: string;\r\n}\r\n\r\n/** Properties of an iModel that are always held in memory whenever one is opened, both on the frontend and on the backend .\r\n * @public\r\n */\r\nexport interface IModelProps {\r\n /** The name and description of the root subject of this iModel */\r\n readonly rootSubject: RootSubjectProps;\r\n /** The volume of the entire project, in spatial coordinates */\r\n readonly projectExtents?: Range3dProps;\r\n /** An offset to be applied to all spatial coordinates. This is normally used to transform spatial coordinates into the Cartesian coordinate system of a Geographic Coordinate System. */\r\n readonly globalOrigin?: XYZProps;\r\n /** The location of the iModel in Earth Centered Earth Fixed coordinates. iModel units are always meters */\r\n readonly ecefLocation?: EcefLocationProps;\r\n /** The Geographic Coordinate Reference System indicating the projection and datum used. */\r\n readonly geographicCoordinateSystem?: GeographicCRSProps;\r\n /** The name of the iModel. */\r\n readonly name?: string;\r\n}\r\n\r\n/** The properties returned by the backend when creating a new [[IModelConnection]] from the frontend, either with Rpc or with Ipc.\r\n * These properties describe the iModel held on the backend for thew newly formed connection and are used to construct a new\r\n * [[IModelConnection]] instance on the frontend to access it.\r\n * @public\r\n */\r\nexport type IModelConnectionProps = IModelProps & IModelRpcProps;\r\n\r\n/** The properties that can be supplied when creating a *new* iModel.\r\n * @public\r\n */\r\nexport interface CreateIModelProps extends IModelProps {\r\n /** The GUID of new iModel. If not present, a GUID will be generated. */\r\n readonly guid?: GuidString;\r\n /** Client name for new iModel */\r\n readonly client?: string;\r\n /** Thumbnail for new iModel\r\n * @alpha\r\n */\r\n readonly thumbnail?: ThumbnailProps;\r\n}\r\n\r\n/**\r\n * Sqlite options.\r\n * @public\r\n */\r\nexport interface OpenSqliteArgs {\r\n /**\r\n * Specify timeout after which SQLite stop retrying to acquire lock to database file and throw SQLITE_BUSY error.\r\n * Timeout is specified in milliseconds.\r\n * For more information https://www.sqlite.org/c3ref/busy_timeout.html.\r\n * */\r\n readonly busyTimeout?: number;\r\n}\r\n\r\n/**\r\n * A key used to identify an opened [IModelDb]($backend) between the frontend and backend for Rpc and Ipc communications.\r\n * Keys must be unique - that is there can never be two IModelDbs opened with the same key at any given time.\r\n * If no key is supplied in a call to open an IModelDb, one is generated and returned.\r\n * It is only necessary to supply a key if you have some reason to assign a specific value to identify an IModelDb.\r\n * If you don't supply the key, you must use the returned value for Rpc and Ipc communications.\r\n * @public\r\n */\r\nexport interface OpenDbKey {\r\n readonly key?: string;\r\n}\r\n\r\n/** @beta TODO documentation */\r\nexport interface CloudContainerUri {\r\n readonly uriParams: string;\r\n}\r\n\r\n/** Options to open a [SnapshotDb]($backend).\r\n * @public\r\n */\r\nexport interface SnapshotOpenOptions extends OpenDbKey {\r\n /**\r\n * The \"base\" name that can be used for creating temporary files related to this Db.\r\n * The string should be a name related to the current Db filename using some known pattern so that all files named \"baseName*\" can be deleted externally during cleanup.\r\n * It must be the name of a file (that may or may not exist) in a writable directory.\r\n * If not present, the baseName will default to the database's file name (including the path).\r\n * @internal\r\n */\r\n readonly tempFileBase?: string;\r\n}\r\n\r\n/** Options to open a [StandaloneDb]($backend) via [StandaloneDb.openFile]($backend) from the backend,\r\n * or [BriefcaseConnection.openStandalone]($frontend) from the frontend.\r\n * @public\r\n */\r\nexport type StandaloneOpenOptions = OpenDbKey;\r\n\r\n/** Options that can be supplied when creating snapshot iModels.\r\n * @public\r\n */\r\nexport interface CreateSnapshotIModelProps {\r\n /** If true, then create SQLite views for Model, Element, ElementAspect, and Relationship classes.\r\n * These database views can often be useful for interoperability workflows.\r\n */\r\n readonly createClassViews?: boolean;\r\n}\r\n\r\n/** The options that can be specified when creating an *empty* snapshot iModel.\r\n * @see [SnapshotDb.createEmpty]($backend)\r\n * @public\r\n */\r\nexport type CreateEmptySnapshotIModelProps = CreateIModelProps & CreateSnapshotIModelProps;\r\n\r\n/** Options that can be supplied when creating standalone iModels.\r\n * @public\r\n */\r\nexport interface CreateStandaloneIModelProps {\r\n /** If present, file will allow local editing, but cannot be used to create changesets */\r\n readonly allowEdit?: string;\r\n}\r\n\r\n/** The options that can be specified when creating an *empty* standalone iModel.\r\n * @see [StandaloneDb.createEmpty]($backend)\r\n * @public\r\n */\r\nexport type CreateEmptyStandaloneIModelProps = CreateIModelProps & CreateStandaloneIModelProps;\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FilePropertyProps {\r\n readonly namespace: string;\r\n readonly name: string;\r\n id?: number | string;\r\n subId?: number | string;\r\n}\r\n\r\n/** The position and orientation of an iModel on the earth in [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\r\n * @note This is an immutable type - all of its properties are frozen.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n * @public\r\n */\r\nexport class EcefLocation implements EcefLocationProps {\r\n /** The origin of the ECEF transform. */\r\n public readonly origin: Point3d;\r\n /** The orientation of the ECEF transform */\r\n public readonly orientation: YawPitchRollAngles;\r\n /** Optional position on the earth used to establish the ECEF origin and orientation. */\r\n public readonly cartographicOrigin?: Cartographic;\r\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n public readonly xVector?: Vector3d;\r\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n public readonly yVector?: Vector3d;\r\n /** The transform from iModel Spatial coordinates to ECEF from this EcefLocation */\r\n private readonly _transform: Transform = Transform.createIdentity();\r\n\r\n /** Get the transform from iModel Spatial coordinates to ECEF from this EcefLocation */\r\n public getTransform(): Transform { return this._transform; }\r\n\r\n /** Construct a new EcefLocation. Once constructed, it is frozen and cannot be modified. */\r\n constructor(props: EcefLocationProps) {\r\n this.origin = Point3d.fromJSON(props.origin).freeze();\r\n this.orientation = YawPitchRollAngles.fromJSON(props.orientation).freeze();\r\n if (props.cartographicOrigin)\r\n this.cartographicOrigin = Cartographic.fromRadians({ longitude: props.cartographicOrigin.longitude, latitude: props.cartographicOrigin.latitude, height: props.cartographicOrigin.height }).freeze();\r\n if (props.xVector && props.yVector) {\r\n this.xVector = Vector3d.fromJSON(props.xVector).freeze();\r\n this.yVector = Vector3d.fromJSON(props.yVector).freeze();\r\n }\r\n if (props.transform) {\r\n this._transform.setFromJSON(props.transform);\r\n this._transform.freeze();\r\n } else {\r\n let matrix;\r\n if (this.xVector && this.yVector) {\r\n const zVector = this.xVector.crossProduct(this.yVector);\r\n if (zVector.normalizeInPlace())\r\n matrix = Matrix3d.createColumns(this.xVector, this.yVector, zVector);\r\n }\r\n if (!matrix)\r\n matrix = this.orientation.toMatrix3d();\r\n\r\n this._transform = Transform.createOriginAndMatrix(this.origin, matrix);\r\n this._transform.freeze();\r\n }\r\n }\r\n\r\n /** Returns true if this EcefLocation is not located at the center of the Earth.\r\n * @alpha are locations very close to the center considered valid? What are the specific criteria?\r\n */\r\n public get isValid(): boolean {\r\n return !this.origin.isZero;\r\n }\r\n\r\n /** Construct ECEF Location from cartographic origin with optional known point and angle. */\r\n public static createFromCartographicOrigin(origin: Cartographic, point?: Point3d, angle?: Angle) {\r\n const ecefOrigin = origin.toEcef();\r\n const deltaRadians = 10 / Constant.earthRadiusWGS84.polar;\r\n const northCarto = Cartographic.fromRadians({ longitude: origin.longitude, latitude: origin.latitude + deltaRadians, height: origin.height });\r\n const eastCarto = Cartographic.fromRadians({ longitude: origin.longitude + deltaRadians, latitude: origin.latitude, height: origin.height });\r\n const ecefNorth = northCarto.toEcef();\r\n const ecefEast = eastCarto.toEcef();\r\n const xVector = expectDefined(Vector3d.createStartEnd(ecefOrigin, ecefEast).normalize());\r\n const yVector = expectDefined(Vector3d.createStartEnd(ecefOrigin, ecefNorth).normalize());\r\n const matrix = expectDefined(Matrix3d.createRigidFromColumns(xVector, yVector, AxisOrder.XYZ));\r\n if (angle !== undefined) {\r\n const north = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, angle);\r\n matrix.multiplyMatrixMatrix(north, matrix);\r\n }\r\n if (point !== undefined) {\r\n const delta = matrix.multiplyVector(Vector3d.create(-point.x, -point.y, -point.z));\r\n ecefOrigin.addInPlace(delta);\r\n }\r\n\r\n return new EcefLocation({ origin: ecefOrigin, orientation: expectDefined(YawPitchRollAngles.createFromMatrix3d(matrix)), cartographicOrigin: origin });\r\n }\r\n\r\n /** Construct ECEF Location from transform with optional position on the earth used to establish the ECEF origin and orientation. */\r\n public static createFromTransform(transform: Transform): EcefLocation {\r\n const ecefOrigin = transform.getOrigin();\r\n const angleFromInput = YawPitchRollAngles.createDegrees(0, 0, 0);\r\n const locationOrientationFromInputT = YawPitchRollAngles.createFromMatrix3d(transform.getMatrix(), angleFromInput);\r\n const transformProps = transform.toJSON();\r\n\r\n return new EcefLocation({ origin: ecefOrigin, orientation: locationOrientationFromInputT ?? angleFromInput, transform: transformProps });\r\n }\r\n\r\n /** Get the location center of the earth in the iModel coordinate system. */\r\n public get earthCenter(): Point3d {\r\n const matrix = this.orientation.toMatrix3d();\r\n return Point3d.createFrom(matrix.multiplyTransposeXYZ(-this.origin.x, -this.origin.y, -this.origin.z));\r\n }\r\n\r\n /** Return true if this location is equivalent to another location within a small tolerance. */\r\n public isAlmostEqual(other: EcefLocation): boolean {\r\n if (!this.origin.isAlmostEqual(other.origin) || !this.orientation.isAlmostEqual(other.orientation))\r\n return false;\r\n\r\n if ((this.xVector === undefined) !== (other.xVector === undefined) || (this.yVector === undefined) !== (other.yVector === undefined))\r\n return false;\r\n\r\n if (this.xVector !== undefined && other.xVector !== undefined && !this.xVector.isAlmostEqual(other.xVector))\r\n return false;\r\n\r\n if (this.yVector !== undefined && other.yVector !== undefined && !this.yVector.isAlmostEqual(other.yVector))\r\n return false;\r\n\r\n if (!this.getTransform().isAlmostEqual(other.getTransform()))\r\n return false;\r\n\r\n const thisCarto = this.cartographicOrigin;\r\n const otherCarto = other.cartographicOrigin;\r\n if (undefined === thisCarto || undefined === otherCarto)\r\n return undefined === thisCarto && undefined === otherCarto;\r\n\r\n return thisCarto.equalsEpsilon(otherCarto, Geometry.smallMetricDistance);\r\n }\r\n\r\n public toJSON(): EcefLocationProps {\r\n const props: Mutable<EcefLocationProps> = {\r\n origin: this.origin.toJSON(),\r\n orientation: this.orientation.toJSON(),\r\n transform: this.getTransform().toJSON(),\r\n };\r\n\r\n if (this.cartographicOrigin)\r\n props.cartographicOrigin = this.cartographicOrigin.toJSON();\r\n\r\n if (this.xVector)\r\n props.xVector = this.xVector.toJSON();\r\n\r\n if (this.yVector)\r\n props.yVector = this.yVector.toJSON();\r\n\r\n return props;\r\n }\r\n}\r\n\r\n/** Represents an iModel in JavaScript.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n * @public\r\n */\r\nexport abstract class IModel implements IModelProps {\r\n private _projectExtents?: AxisAlignedBox3d;\r\n private _name?: string;\r\n private _rootSubject?: RootSubjectProps;\r\n private _globalOrigin?: Point3d;\r\n private _ecefLocation?: EcefLocation;\r\n private _geographicCoordinateSystem?: GeographicCRS;\r\n private _iModelId?: GuidString;\r\n private _changeset: ChangesetIdWithIndex;\r\n\r\n /** The Id of the repository model. */\r\n public static readonly repositoryModelId: Id64String = \"0x1\";\r\n /** The Id of the root subject element. */\r\n public static readonly rootSubjectId: Id64String = \"0x1\";\r\n /** The Id of the dictionary model. */\r\n public static readonly dictionaryId: Id64String = \"0x10\";\r\n\r\n /** Event raised after [[name]] changes. */\r\n public readonly onNameChanged = new BeEvent<(previousName: string) => void>();\r\n /** Event raised after [[rootSubject]] changes. */\r\n public readonly onRootSubjectChanged = new BeEvent<(previousSubject: RootSubjectProps) => void>();\r\n /** Event raised after [[projectExtents]] changes. */\r\n public readonly onProjectExtentsChanged = new BeEvent<(previousExtents: AxisAlignedBox3d) => void>();\r\n /** Event raised after [[globalOrigin]] changes. */\r\n public readonly onGlobalOriginChanged = new BeEvent<(previousOrigin: Point3d) => void>();\r\n /** Event raised after [[ecefLocation]] changes. */\r\n public readonly onEcefLocationChanged = new BeEvent<(previousLocation: EcefLocation | undefined) => void>();\r\n /** Event raised after [[geographicCoordinateSystem]] changes. */\r\n public readonly onGeographicCoordinateSystemChanged = new BeEvent<(previousGCS: GeographicCRS | undefined) => void>();\r\n /** Event raised after [[changeset]] changes. */\r\n public readonly onChangesetChanged = new BeEvent<(previousChangeset: ChangesetIdWithIndex) => void>();\r\n\r\n /** Name of the iModel */\r\n public get name(): string {\r\n assert(this._name !== undefined);\r\n return this._name;\r\n }\r\n public set name(name: string) {\r\n if (name !== this._name) {\r\n const old = this._name;\r\n this._name = name;\r\n if (undefined !== old)\r\n this.onNameChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** The name and description of the root subject of this iModel */\r\n public get rootSubject(): RootSubjectProps {\r\n assert(this._rootSubject !== undefined);\r\n return this._rootSubject;\r\n }\r\n public set rootSubject(subject: RootSubjectProps) {\r\n if (undefined === this._rootSubject || this._rootSubject.name !== subject.name || this._rootSubject.description !== subject.description) {\r\n const old = this._rootSubject;\r\n this._rootSubject = subject;\r\n if (old)\r\n this.onRootSubjectChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** Returns `true` if this is a snapshot iModel. */\r\n public abstract get isSnapshot(): boolean;\r\n /** Returns `true` if this is a briefcase copy of an iModel that is synchronized with iModelHub. */\r\n public abstract get isBriefcase(): boolean;\r\n\r\n public abstract get isOpen(): boolean;\r\n\r\n /**\r\n * The volume, in spatial coordinates, inside which the entire project is contained.\r\n * @note The object returned from this method is frozen. You *must* make a copy before you do anything that might attempt to modify it.\r\n */\r\n public get projectExtents() {\r\n assert(undefined !== this._projectExtents);\r\n return this._projectExtents;\r\n }\r\n public set projectExtents(extents: AxisAlignedBox3d) {\r\n // Don't allow any axis of the project extents to be less than 1 meter.\r\n const projectExtents = extents.clone();\r\n projectExtents.ensureMinLengths(1.0);\r\n if (!this._projectExtents || !this._projectExtents.isAlmostEqual(projectExtents)) {\r\n const old = this._projectExtents;\r\n projectExtents.freeze();\r\n this._projectExtents = projectExtents;\r\n if (old)\r\n this.onProjectExtentsChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** An offset to be applied to all spatial coordinates. */\r\n public get globalOrigin(): Point3d {\r\n assert(this._globalOrigin !== undefined);\r\n return this._globalOrigin;\r\n }\r\n public set globalOrigin(org: Point3d) {\r\n if (!this._globalOrigin || !this._globalOrigin.isAlmostEqual(org)) {\r\n const old = this._globalOrigin;\r\n org.freeze();\r\n this._globalOrigin = org;\r\n if (old)\r\n this.onGlobalOriginChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** The [EcefLocation]($docs/learning/glossary#ecefLocation) of the iModel in Earth Centered Earth Fixed coordinates.\r\n * If the iModel property geographicCoordinateSystem is not defined then the ecefLocation provides a geolocation by defining a\r\n * 3D coordinate system relative to the Earth model WGS84. Refer to additional documentation for details. If the geographicCoordinateSystem\r\n * property is defined then the ecefLocation must be used with care. When the geographicCoordinateSystem is defined it indicates the\r\n * iModel cartesian space is the result of a cartographic projection. This implies a flattening of the Earth surface process that\r\n * results in scale, angular or area distortion. The ecefLocation is then an approximation calculated at the center of the project extent.\r\n * If the project is more than 2 kilometer in size, the ecefLocation may represent a poor approximation of the effective\r\n * cartographic projection used and a linear transformation should then be calculated at the exact origin of the data\r\n * it must position.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n */\r\n public get ecefLocation(): EcefLocation | undefined {\r\n return this._ecefLocation;\r\n }\r\n public set ecefLocation(ecefLocation: EcefLocation | undefined) {\r\n const old = this._ecefLocation;\r\n if (!old && !ecefLocation)\r\n return;\r\n else if (old && ecefLocation && old.isAlmostEqual(ecefLocation))\r\n return;\r\n\r\n this._ecefLocation = ecefLocation;\r\n this.onEcefLocationChanged.raiseEvent(old);\r\n }\r\n\r\n /** Set the [EcefLocation]($docs/learning/glossary#ecefLocation) for this iModel. */\r\n public setEcefLocation(ecef: EcefLocationProps): void {\r\n this.ecefLocation = new EcefLocation(ecef);\r\n }\r\n\r\n /** The geographic coordinate reference system of the iModel. */\r\n public get geographicCoordinateSystem(): GeographicCRS | undefined {\r\n return this._geographicCoordinateSystem;\r\n }\r\n public set geographicCoordinateSystem(geoCRS: GeographicCRS | undefined) {\r\n const old = this._geographicCoordinateSystem;\r\n if (!old && !geoCRS)\r\n return;\r\n else if (old && geoCRS && old.equals(geoCRS))\r\n return;\r\n\r\n this._geographicCoordinateSystem = geoCRS;\r\n this.onGeographicCoordinateSystemChanged.raiseEvent(old);\r\n }\r\n\r\n /** Sets the geographic coordinate reference system from GeographicCRSProps. */\r\n public setGeographicCoordinateSystem(geoCRS: GeographicCRSProps) {\r\n this.geographicCoordinateSystem = new GeographicCRS(geoCRS);\r\n }\r\n\r\n /** @internal */\r\n public getConnectionProps(): IModelConnectionProps {\r\n return {\r\n name: this.name,\r\n rootSubject: this.rootSubject,\r\n projectExtents: this.projectExtents.toJSON(),\r\n globalOrigin: this.globalOrigin.toJSON(),\r\n ecefLocation: this.ecefLocation,\r\n geographicCoordinateSystem: this.geographicCoordinateSystem?.toJSON(),\r\n ...this._getRpcProps(),\r\n };\r\n }\r\n\r\n /** Convert this iModel to a JSON representation. */\r\n public toJSON(): IModelConnectionProps {\r\n return this.getConnectionProps();\r\n }\r\n\r\n /** A key used to identify this iModel in RPC calls from frontend to backend.\r\n * @internal\r\n */\r\n protected _fileKey: string;\r\n /** Get the key that was used to open this iModel. This is the value used for Rpc and Ipc communications. */\r\n public get key(): string { return this._fileKey; }\r\n\r\n /** @internal */\r\n protected _iTwinId?: GuidString;\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public get iTwinId(): GuidString | undefined { return this._iTwinId; }\r\n\r\n /** The Guid that identifies this iModel. */\r\n public get iModelId(): GuidString | undefined { return this._iModelId; }\r\n\r\n /** @public */\r\n public get changeset(): ChangesetIdWithIndex {\r\n return { ...this._changeset };\r\n }\r\n public set changeset(changeset: ChangesetIdWithIndex) {\r\n const prev = this._changeset;\r\n if (prev.id !== changeset.id || prev.index !== changeset.index) {\r\n this._changeset = { id: changeset.id, index: changeset.index };\r\n this.onChangesetChanged.raiseEvent(prev);\r\n }\r\n }\r\n\r\n protected _openMode = OpenMode.Readonly;\r\n /** The [[OpenMode]] used for this IModel. */\r\n public get openMode(): OpenMode { return this._openMode; }\r\n\r\n /** Return a token for RPC operations.\r\n * @throws IModelError if the iModel is not open.\r\n */\r\n public getRpcProps(): IModelRpcProps {\r\n if (!this.isOpen)\r\n throw new IModelError(IModelStatus.BadRequest, \"IModel is not open for rpc\");\r\n\r\n return this._getRpcProps();\r\n }\r\n\r\n /** Returns the iModel's RPC properties.\r\n * @note It is an error to attempt to use these properties as a token for RPC operations if the iModel is not open.\r\n * @internal\r\n */\r\n protected _getRpcProps(): IModelRpcProps {\r\n return {\r\n key: this._fileKey,\r\n iTwinId: this.iTwinId,\r\n iModelId: this.iModelId,\r\n changeset: this.changeset,\r\n };\r\n }\r\n\r\n /** @internal */\r\n protected constructor(tokenProps?: IModelRpcProps) {\r\n this._changeset = tokenProps?.changeset ?? { id: \"\", index: 0 };\r\n this._fileKey = \"\";\r\n if (tokenProps) {\r\n this._fileKey = tokenProps.key;\r\n this._iTwinId = tokenProps.iTwinId;\r\n this._iModelId = tokenProps.iModelId;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected initialize(name: string, props: IModelProps) {\r\n this.name = name;\r\n this.rootSubject = props.rootSubject;\r\n this.projectExtents = Range3d.fromJSON(props.projectExtents);\r\n this.globalOrigin = Point3d.fromJSON(props.globalOrigin);\r\n\r\n const ecefLocation = props.ecefLocation ? new EcefLocation(props.ecefLocation) : undefined;\r\n this.ecefLocation = ecefLocation?.isValid ? ecefLocation : undefined;\r\n\r\n this.geographicCoordinateSystem = props.geographicCoordinateSystem ? new GeographicCRS(props.geographicCoordinateSystem) : undefined;\r\n }\r\n\r\n /** Get the default subCategoryId for the supplied categoryId */\r\n public static getDefaultSubCategoryId(categoryId: Id64String): Id64String {\r\n return Id64.isValid(categoryId) ? Id64.fromLocalAndBriefcaseIds(Id64.getLocalId(categoryId) + 1, Id64.getBriefcaseId(categoryId)) : Id64.invalid;\r\n }\r\n\r\n /** True if this iModel has an [EcefLocation]($docs/learning/glossary#ecefLocation). */\r\n public get isGeoLocated() { return undefined !== this._ecefLocation; }\r\n\r\n /** Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its [[IModel.ecefLocation]].\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public getEcefTransform(): Transform {\r\n if (undefined === this._ecefLocation)\r\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\r\n return this._ecefLocation.getTransform();\r\n }\r\n\r\n /** Convert a point in this iModel's Spatial coordinates to an ECEF point using its [[IModel.ecefLocation]].\r\n * @param spatial A point in the iModel's spatial coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Point3d in ECEF coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public spatialToEcef(spatial: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyPoint3d(spatial, result); }\r\n\r\n /** Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its [[ecefLocation]].\r\n * @param ecef A point in ECEF coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Point3d in this iModel's spatial coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\r\n */\r\n public ecefToSpatial(ecef: XYAndZ, result?: Point3d): Point3d { return expectDefined(this.getEcefTransform().multiplyInversePoint3d(ecef, result)); }\r\n\r\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using its [[IModel.ecefLocation]].\r\n * @param spatial A point in the iModel's spatial coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Cartographic location\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public spatialToCartographicFromEcef(spatial: XYAndZ, result?: Cartographic): Cartographic { return expectDefined(Cartographic.fromEcef(this.spatialToEcef(spatial), result)); }\r\n\r\n /** Convert a [[Cartographic]] to a point in this iModel's Spatial coordinates using its [[IModel.ecefLocation]].\r\n * @param cartographic A cartographic location\r\n * @param result If defined, use this for output\r\n * @returns A point in this iModel's spatial coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\r\n */\r\n public cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d) { return this.ecefToSpatial(cartographic.toEcef(result), result); }\r\n}\r\n"]}
1
+ {"version":3,"file":"IModel.js","sourceRoot":"","sources":["../../src/IModel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAc,IAAI,EAAc,YAAY,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtJ,OAAO,EACE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAkB,QAAQ,EAC9H,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAsB,MAAM,sCAAsC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAmN5C;;;;GAIG;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,CAAC,OAAO,CAAC;IACnJ,CAAC;IAED,uFAAuF;IACvF,IAAW,YAAY,KAAK,OAAO,SAAS,KAAK,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAEtE;;OAEG;IACI,gBAAgB;QACrB,IAAI,SAAS,KAAK,IAAI,CAAC,aAAa;YAClC,MAAM,IAAI,WAAW,CAAC,gBAAgB,CAAC,aAAa,EAAE,0BAA0B,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,OAAe,EAAE,MAAgB,IAAa,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAErI;;;;;;OAMG;IACI,aAAa,CAAC,IAAY,EAAE,MAAgB,IAAa,OAAO,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAErJ;;;;;OAKG;IACI,6BAA6B,CAAC,OAAe,EAAE,MAAqB,IAAkB,OAAO,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhL;;;;;;OAMG;IACI,6BAA6B,CAAC,YAA0B,EAAE,MAAgB,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { assert, BeEvent, expectDefined, GeoServiceStatus, GuidString, Id64, Id64String, IModelStatus, Mutable, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, AxisIndex, AxisOrder, Constant, Geometry, Matrix3d, Point3d, Range3d, Range3dProps, Transform, TransformProps, Vector3d, XYAndZ, XYZProps,\r\n YawPitchRollAngles, YawPitchRollProps,\r\n} from \"@itwin/core-geometry\";\r\nimport { ChangesetIdWithIndex } from \"./ChangesetProps\";\r\nimport { Cartographic, CartographicProps } from \"./geometry/Cartographic\";\r\nimport { GeographicCRS, GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\r\nimport { AxisAlignedBox3d } from \"./geometry/Placement\";\r\nimport { IModelError } from \"./IModelError\";\r\nimport { ThumbnailProps } from \"./Thumbnail\";\r\n\r\n/** The properties to open a connection to an iModel for RPC operations.\r\n * @public\r\n */\r\nexport interface IModelRpcOpenProps {\r\n /** The iTwin in which the iModel exists - must be defined for briefcases that are synchronized with iModelHub. */\r\n readonly iTwinId?: GuidString;\r\n /** Guid of the iModel. */\r\n readonly iModelId?: GuidString;\r\n\r\n /** Id of the last Changeset that was applied to the iModel - must be defined for briefcases that are synchronized with iModelHub.\r\n * @note Changeset Ids are string hash values based on the content and parent.\r\n */\r\n readonly changeset?: ChangesetIdWithIndex;\r\n}\r\n\r\n/** The properties that identify an opened iModel for RPC operations.\r\n * @public\r\n */\r\nexport interface IModelRpcProps extends IModelRpcOpenProps {\r\n /** Unique key used for identifying the iModel between the frontend and the backend */\r\n readonly key: string;\r\n}\r\n\r\n/** Properties that position an iModel on the earth via [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\r\n * The origin is specified as an ECEF coordinate. The cartographicOrigin property contains the latitude, longitude and elevation above the WGS84 ellipsoid\r\n * of the origin property. This cartographicOrigin is offered as a convenient pre-calculated value representing the location of the ECEF origin.\r\n * The 3D coordinate system this class represents is positioned at specified origin and the axis positioned according to\r\n * the other properties.\r\n * If transform property is defined then it will not be computed from other properties.\r\n * If the xVector and yVector properties are defined (and transform is not defined) then they take precedence over the YawPitchRoll orientation property. The xVector and yVector\r\n * represent the direction and scale of the X and Y axes. The Z axis is always perpendicular (according to the right hand rule) to these X-Y axes.\r\n * The scaling in the Z direction is always unity. The scale of the X and Y axes is represented by the size of the vector length.\r\n * If the xVector and yVector are not present then the YawPitchRoll properties indicates the angles for all tree axes. Scaling in that case\r\n * is unity in all three directions.\r\n * Note that the present class is intended to represent geolocated 3D coordinate systems that are normally tangent to the WGS84 ellipsoid\r\n * possibly offset in altitude by the terrain elevation above the ellipsoid but other general 3D coordinate systems\r\n * can be defined.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface EcefLocationProps {\r\n /** The Origin of an iModel on the earth in ECEF coordinates */\r\n readonly origin: XYZProps;\r\n /** The [orientation](https://en.wikipedia.org/wiki/Geographic_coordinate_conversion) of an iModel on the earth. */\r\n readonly orientation: YawPitchRollProps;\r\n /** Optional position on the earth used to establish the ECEF coordinates. */\r\n readonly cartographicOrigin?: CartographicProps;\r\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n readonly xVector?: XYZProps;\r\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n readonly yVector?: XYZProps;\r\n /** Optional potentially non-rigid transform defining the ECEF location.\r\n * @note If this property is supplied, the other properties are ignored.\r\n */\r\n readonly transform?: TransformProps;\r\n}\r\n\r\n/** Properties of the [Root Subject]($docs/bis/guide/references/glossary#subject-root).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface RootSubjectProps {\r\n /** The name of the root subject. */\r\n readonly name: string;\r\n /** Description of the root subject (optional). */\r\n readonly description?: string;\r\n}\r\n\r\n/** Properties of an iModel that are always held in memory whenever one is opened, both on the frontend and on the backend .\r\n * @public\r\n */\r\nexport interface IModelProps {\r\n /** The name and description of the root subject of this iModel */\r\n readonly rootSubject: RootSubjectProps;\r\n /** The volume of the entire project, in spatial coordinates */\r\n readonly projectExtents?: Range3dProps;\r\n /** An offset to be applied to all spatial coordinates. This is normally used to transform spatial coordinates into the Cartesian coordinate system of a Geographic Coordinate System. */\r\n readonly globalOrigin?: XYZProps;\r\n /** The location of the iModel in Earth Centered Earth Fixed coordinates. iModel units are always meters */\r\n readonly ecefLocation?: EcefLocationProps;\r\n /** The Geographic Coordinate Reference System indicating the projection and datum used. */\r\n readonly geographicCoordinateSystem?: GeographicCRSProps;\r\n /** The name of the iModel. */\r\n readonly name?: string;\r\n}\r\n\r\n/** The properties returned by the backend when creating a new [[IModelConnection]] from the frontend, either with Rpc or with Ipc.\r\n * These properties describe the iModel held on the backend for thew newly formed connection and are used to construct a new\r\n * [[IModelConnection]] instance on the frontend to access it.\r\n * @public\r\n */\r\nexport type IModelConnectionProps = IModelProps & IModelRpcProps;\r\n\r\n/** The properties that can be supplied when creating a *new* iModel.\r\n * @public\r\n */\r\nexport interface CreateIModelProps extends IModelProps {\r\n /** The GUID of new iModel. If not present, a GUID will be generated. */\r\n readonly guid?: GuidString;\r\n /** Client name for new iModel */\r\n readonly client?: string;\r\n /** Thumbnail for new iModel\r\n * @alpha\r\n */\r\n readonly thumbnail?: ThumbnailProps;\r\n}\r\n\r\n/**\r\n * Sqlite options.\r\n * @public\r\n */\r\nexport interface OpenSqliteArgs {\r\n /**\r\n * Specify timeout after which SQLite stop retrying to acquire lock to database file and throw SQLITE_BUSY error.\r\n * Timeout is specified in milliseconds.\r\n * For more information https://www.sqlite.org/c3ref/busy_timeout.html.\r\n * */\r\n readonly busyTimeout?: number;\r\n}\r\n\r\n/**\r\n * A key used to identify an opened [IModelDb]($backend) between the frontend and backend for Rpc and Ipc communications.\r\n * Keys must be unique - that is there can never be two IModelDbs opened with the same key at any given time.\r\n * If no key is supplied in a call to open an IModelDb, one is generated and returned.\r\n * It is only necessary to supply a key if you have some reason to assign a specific value to identify an IModelDb.\r\n * If you don't supply the key, you must use the returned value for Rpc and Ipc communications.\r\n * @public\r\n */\r\nexport interface OpenDbKey {\r\n readonly key?: string;\r\n}\r\n\r\n/** @beta TODO documentation */\r\nexport interface CloudContainerUri {\r\n readonly uriParams: string;\r\n}\r\n\r\n/** Options to open a [SnapshotDb]($backend).\r\n * @public\r\n */\r\nexport interface SnapshotOpenOptions extends OpenDbKey {\r\n /**\r\n * The \"base\" name that can be used for creating temporary files related to this Db.\r\n * The string should be a name related to the current Db filename using some known pattern so that all files named \"baseName*\" can be deleted externally during cleanup.\r\n * It must be the name of a file (that may or may not exist) in a writable directory.\r\n * If not present, the baseName will default to the database's file name (including the path).\r\n * @internal\r\n */\r\n readonly tempFileBase?: string;\r\n}\r\n\r\n/** Options to open a [StandaloneDb]($backend) via [StandaloneDb.openFile]($backend) from the backend,\r\n * or [BriefcaseConnection.openStandalone]($frontend) from the frontend.\r\n * @public\r\n */\r\nexport type StandaloneOpenOptions = OpenDbKey;\r\n\r\n/** Options that can be supplied when creating snapshot iModels.\r\n * @public\r\n */\r\nexport interface CreateSnapshotIModelProps {\r\n /** If true, then create SQLite views for Model, Element, ElementAspect, and Relationship classes.\r\n * These database views can often be useful for interoperability workflows.\r\n */\r\n readonly createClassViews?: boolean;\r\n}\r\n\r\n/** The options that can be specified when creating an *empty* snapshot iModel.\r\n * @see [SnapshotDb.createEmpty]($backend)\r\n * @public\r\n */\r\nexport type CreateEmptySnapshotIModelProps = CreateIModelProps & CreateSnapshotIModelProps;\r\n\r\n/** Options that can be supplied when creating standalone iModels.\r\n * @public\r\n */\r\nexport interface CreateStandaloneIModelProps {\r\n /** If present, file will allow local editing, but cannot be used to create changesets.\r\n * @note This flag is a string for historical reasons. When specified, it will always be set to the required\r\n * internal value `{ \"txns\": true }` regardless of the string content provided. This behavior ensures backwards\r\n * compatibility while allowing users to enable transaction support.\r\n * @note Consider using [[enableTransactions]] instead, which provides a cleaner boolean interface.\r\n * @deprecated in 5.5. Use [[enableTransactions]] instead.\r\n */\r\n readonly allowEdit?: string;\r\n /** If true, enables transactions in the standalone iModel, allowing local editing. The iModel cannot be used to create changesets.\r\n * This is the preferred way to enable editing. If both this and [[allowEdit]] are specified, either being truthy will enable transactions.\r\n */\r\n readonly enableTransactions?: boolean;\r\n}\r\n\r\n/** The options that can be specified when creating an *empty* standalone iModel.\r\n * @see [StandaloneDb.createEmpty]($backend)\r\n * @public\r\n */\r\nexport type CreateEmptyStandaloneIModelProps = CreateIModelProps & CreateStandaloneIModelProps;\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FilePropertyProps {\r\n readonly namespace: string;\r\n readonly name: string;\r\n id?: number | string;\r\n subId?: number | string;\r\n}\r\n\r\n/** The position and orientation of an iModel on the earth in [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\r\n * @note This is an immutable type - all of its properties are frozen.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n * @public\r\n */\r\nexport class EcefLocation implements EcefLocationProps {\r\n /** The origin of the ECEF transform. */\r\n public readonly origin: Point3d;\r\n /** The orientation of the ECEF transform */\r\n public readonly orientation: YawPitchRollAngles;\r\n /** Optional position on the earth used to establish the ECEF origin and orientation. */\r\n public readonly cartographicOrigin?: Cartographic;\r\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n public readonly xVector?: Vector3d;\r\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n public readonly yVector?: Vector3d;\r\n /** The transform from iModel Spatial coordinates to ECEF from this EcefLocation */\r\n private readonly _transform: Transform = Transform.createIdentity();\r\n\r\n /** Get the transform from iModel Spatial coordinates to ECEF from this EcefLocation */\r\n public getTransform(): Transform { return this._transform; }\r\n\r\n /** Construct a new EcefLocation. Once constructed, it is frozen and cannot be modified. */\r\n constructor(props: EcefLocationProps) {\r\n this.origin = Point3d.fromJSON(props.origin).freeze();\r\n this.orientation = YawPitchRollAngles.fromJSON(props.orientation).freeze();\r\n if (props.cartographicOrigin)\r\n this.cartographicOrigin = Cartographic.fromRadians({ longitude: props.cartographicOrigin.longitude, latitude: props.cartographicOrigin.latitude, height: props.cartographicOrigin.height }).freeze();\r\n if (props.xVector && props.yVector) {\r\n this.xVector = Vector3d.fromJSON(props.xVector).freeze();\r\n this.yVector = Vector3d.fromJSON(props.yVector).freeze();\r\n }\r\n if (props.transform) {\r\n this._transform.setFromJSON(props.transform);\r\n this._transform.freeze();\r\n } else {\r\n let matrix;\r\n if (this.xVector && this.yVector) {\r\n const zVector = this.xVector.crossProduct(this.yVector);\r\n if (zVector.normalizeInPlace())\r\n matrix = Matrix3d.createColumns(this.xVector, this.yVector, zVector);\r\n }\r\n if (!matrix)\r\n matrix = this.orientation.toMatrix3d();\r\n\r\n this._transform = Transform.createOriginAndMatrix(this.origin, matrix);\r\n this._transform.freeze();\r\n }\r\n }\r\n\r\n /** Returns true if this EcefLocation is not located at the center of the Earth.\r\n * @alpha are locations very close to the center considered valid? What are the specific criteria?\r\n */\r\n public get isValid(): boolean {\r\n return !this.origin.isZero;\r\n }\r\n\r\n /** Construct ECEF Location from cartographic origin with optional known point and angle. */\r\n public static createFromCartographicOrigin(origin: Cartographic, point?: Point3d, angle?: Angle) {\r\n const ecefOrigin = origin.toEcef();\r\n const deltaRadians = 10 / Constant.earthRadiusWGS84.polar;\r\n const northCarto = Cartographic.fromRadians({ longitude: origin.longitude, latitude: origin.latitude + deltaRadians, height: origin.height });\r\n const eastCarto = Cartographic.fromRadians({ longitude: origin.longitude + deltaRadians, latitude: origin.latitude, height: origin.height });\r\n const ecefNorth = northCarto.toEcef();\r\n const ecefEast = eastCarto.toEcef();\r\n const xVector = expectDefined(Vector3d.createStartEnd(ecefOrigin, ecefEast).normalize());\r\n const yVector = expectDefined(Vector3d.createStartEnd(ecefOrigin, ecefNorth).normalize());\r\n const matrix = expectDefined(Matrix3d.createRigidFromColumns(xVector, yVector, AxisOrder.XYZ));\r\n if (angle !== undefined) {\r\n const north = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, angle);\r\n matrix.multiplyMatrixMatrix(north, matrix);\r\n }\r\n if (point !== undefined) {\r\n const delta = matrix.multiplyVector(Vector3d.create(-point.x, -point.y, -point.z));\r\n ecefOrigin.addInPlace(delta);\r\n }\r\n\r\n return new EcefLocation({ origin: ecefOrigin, orientation: expectDefined(YawPitchRollAngles.createFromMatrix3d(matrix)), cartographicOrigin: origin });\r\n }\r\n\r\n /** Construct ECEF Location from transform with optional position on the earth used to establish the ECEF origin and orientation. */\r\n public static createFromTransform(transform: Transform): EcefLocation {\r\n const ecefOrigin = transform.getOrigin();\r\n const angleFromInput = YawPitchRollAngles.createDegrees(0, 0, 0);\r\n const locationOrientationFromInputT = YawPitchRollAngles.createFromMatrix3d(transform.getMatrix(), angleFromInput);\r\n const transformProps = transform.toJSON();\r\n\r\n return new EcefLocation({ origin: ecefOrigin, orientation: locationOrientationFromInputT ?? angleFromInput, transform: transformProps });\r\n }\r\n\r\n /** Get the location center of the earth in the iModel coordinate system. */\r\n public get earthCenter(): Point3d {\r\n const matrix = this.orientation.toMatrix3d();\r\n return Point3d.createFrom(matrix.multiplyTransposeXYZ(-this.origin.x, -this.origin.y, -this.origin.z));\r\n }\r\n\r\n /** Return true if this location is equivalent to another location within a small tolerance. */\r\n public isAlmostEqual(other: EcefLocation): boolean {\r\n if (!this.origin.isAlmostEqual(other.origin) || !this.orientation.isAlmostEqual(other.orientation))\r\n return false;\r\n\r\n if ((this.xVector === undefined) !== (other.xVector === undefined) || (this.yVector === undefined) !== (other.yVector === undefined))\r\n return false;\r\n\r\n if (this.xVector !== undefined && other.xVector !== undefined && !this.xVector.isAlmostEqual(other.xVector))\r\n return false;\r\n\r\n if (this.yVector !== undefined && other.yVector !== undefined && !this.yVector.isAlmostEqual(other.yVector))\r\n return false;\r\n\r\n if (!this.getTransform().isAlmostEqual(other.getTransform()))\r\n return false;\r\n\r\n const thisCarto = this.cartographicOrigin;\r\n const otherCarto = other.cartographicOrigin;\r\n if (undefined === thisCarto || undefined === otherCarto)\r\n return undefined === thisCarto && undefined === otherCarto;\r\n\r\n return thisCarto.equalsEpsilon(otherCarto, Geometry.smallMetricDistance);\r\n }\r\n\r\n public toJSON(): EcefLocationProps {\r\n const props: Mutable<EcefLocationProps> = {\r\n origin: this.origin.toJSON(),\r\n orientation: this.orientation.toJSON(),\r\n transform: this.getTransform().toJSON(),\r\n };\r\n\r\n if (this.cartographicOrigin)\r\n props.cartographicOrigin = this.cartographicOrigin.toJSON();\r\n\r\n if (this.xVector)\r\n props.xVector = this.xVector.toJSON();\r\n\r\n if (this.yVector)\r\n props.yVector = this.yVector.toJSON();\r\n\r\n return props;\r\n }\r\n}\r\n\r\n/** Represents an iModel in JavaScript.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n * @public\r\n */\r\nexport abstract class IModel implements IModelProps {\r\n private _projectExtents?: AxisAlignedBox3d;\r\n private _name?: string;\r\n private _rootSubject?: RootSubjectProps;\r\n private _globalOrigin?: Point3d;\r\n private _ecefLocation?: EcefLocation;\r\n private _geographicCoordinateSystem?: GeographicCRS;\r\n private _iModelId?: GuidString;\r\n private _changeset: ChangesetIdWithIndex;\r\n\r\n /** The Id of the repository model. */\r\n public static readonly repositoryModelId: Id64String = \"0x1\";\r\n /** The Id of the root subject element. */\r\n public static readonly rootSubjectId: Id64String = \"0x1\";\r\n /** The Id of the dictionary model. */\r\n public static readonly dictionaryId: Id64String = \"0x10\";\r\n\r\n /** Event raised after [[name]] changes. */\r\n public readonly onNameChanged = new BeEvent<(previousName: string) => void>();\r\n /** Event raised after [[rootSubject]] changes. */\r\n public readonly onRootSubjectChanged = new BeEvent<(previousSubject: RootSubjectProps) => void>();\r\n /** Event raised after [[projectExtents]] changes. */\r\n public readonly onProjectExtentsChanged = new BeEvent<(previousExtents: AxisAlignedBox3d) => void>();\r\n /** Event raised after [[globalOrigin]] changes. */\r\n public readonly onGlobalOriginChanged = new BeEvent<(previousOrigin: Point3d) => void>();\r\n /** Event raised after [[ecefLocation]] changes. */\r\n public readonly onEcefLocationChanged = new BeEvent<(previousLocation: EcefLocation | undefined) => void>();\r\n /** Event raised after [[geographicCoordinateSystem]] changes. */\r\n public readonly onGeographicCoordinateSystemChanged = new BeEvent<(previousGCS: GeographicCRS | undefined) => void>();\r\n /** Event raised after [[changeset]] changes. */\r\n public readonly onChangesetChanged = new BeEvent<(previousChangeset: ChangesetIdWithIndex) => void>();\r\n\r\n /** Name of the iModel */\r\n public get name(): string {\r\n assert(this._name !== undefined);\r\n return this._name;\r\n }\r\n public set name(name: string) {\r\n if (name !== this._name) {\r\n const old = this._name;\r\n this._name = name;\r\n if (undefined !== old)\r\n this.onNameChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** The name and description of the root subject of this iModel */\r\n public get rootSubject(): RootSubjectProps {\r\n assert(this._rootSubject !== undefined);\r\n return this._rootSubject;\r\n }\r\n public set rootSubject(subject: RootSubjectProps) {\r\n if (undefined === this._rootSubject || this._rootSubject.name !== subject.name || this._rootSubject.description !== subject.description) {\r\n const old = this._rootSubject;\r\n this._rootSubject = subject;\r\n if (old)\r\n this.onRootSubjectChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** Returns `true` if this is a snapshot iModel. */\r\n public abstract get isSnapshot(): boolean;\r\n /** Returns `true` if this is a briefcase copy of an iModel that is synchronized with iModelHub. */\r\n public abstract get isBriefcase(): boolean;\r\n\r\n public abstract get isOpen(): boolean;\r\n\r\n /**\r\n * The volume, in spatial coordinates, inside which the entire project is contained.\r\n * @note The object returned from this method is frozen. You *must* make a copy before you do anything that might attempt to modify it.\r\n */\r\n public get projectExtents() {\r\n assert(undefined !== this._projectExtents);\r\n return this._projectExtents;\r\n }\r\n public set projectExtents(extents: AxisAlignedBox3d) {\r\n // Don't allow any axis of the project extents to be less than 1 meter.\r\n const projectExtents = extents.clone();\r\n projectExtents.ensureMinLengths(1.0);\r\n if (!this._projectExtents || !this._projectExtents.isAlmostEqual(projectExtents)) {\r\n const old = this._projectExtents;\r\n projectExtents.freeze();\r\n this._projectExtents = projectExtents;\r\n if (old)\r\n this.onProjectExtentsChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** An offset to be applied to all spatial coordinates. */\r\n public get globalOrigin(): Point3d {\r\n assert(this._globalOrigin !== undefined);\r\n return this._globalOrigin;\r\n }\r\n public set globalOrigin(org: Point3d) {\r\n if (!this._globalOrigin || !this._globalOrigin.isAlmostEqual(org)) {\r\n const old = this._globalOrigin;\r\n org.freeze();\r\n this._globalOrigin = org;\r\n if (old)\r\n this.onGlobalOriginChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** The [EcefLocation]($docs/learning/glossary#ecefLocation) of the iModel in Earth Centered Earth Fixed coordinates.\r\n * If the iModel property geographicCoordinateSystem is not defined then the ecefLocation provides a geolocation by defining a\r\n * 3D coordinate system relative to the Earth model WGS84. Refer to additional documentation for details. If the geographicCoordinateSystem\r\n * property is defined then the ecefLocation must be used with care. When the geographicCoordinateSystem is defined it indicates the\r\n * iModel cartesian space is the result of a cartographic projection. This implies a flattening of the Earth surface process that\r\n * results in scale, angular or area distortion. The ecefLocation is then an approximation calculated at the center of the project extent.\r\n * If the project is more than 2 kilometer in size, the ecefLocation may represent a poor approximation of the effective\r\n * cartographic projection used and a linear transformation should then be calculated at the exact origin of the data\r\n * it must position.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n */\r\n public get ecefLocation(): EcefLocation | undefined {\r\n return this._ecefLocation;\r\n }\r\n public set ecefLocation(ecefLocation: EcefLocation | undefined) {\r\n const old = this._ecefLocation;\r\n if (!old && !ecefLocation)\r\n return;\r\n else if (old && ecefLocation && old.isAlmostEqual(ecefLocation))\r\n return;\r\n\r\n this._ecefLocation = ecefLocation;\r\n this.onEcefLocationChanged.raiseEvent(old);\r\n }\r\n\r\n /** Set the [EcefLocation]($docs/learning/glossary#ecefLocation) for this iModel. */\r\n public setEcefLocation(ecef: EcefLocationProps): void {\r\n this.ecefLocation = new EcefLocation(ecef);\r\n }\r\n\r\n /** The geographic coordinate reference system of the iModel. */\r\n public get geographicCoordinateSystem(): GeographicCRS | undefined {\r\n return this._geographicCoordinateSystem;\r\n }\r\n public set geographicCoordinateSystem(geoCRS: GeographicCRS | undefined) {\r\n const old = this._geographicCoordinateSystem;\r\n if (!old && !geoCRS)\r\n return;\r\n else if (old && geoCRS && old.equals(geoCRS))\r\n return;\r\n\r\n this._geographicCoordinateSystem = geoCRS;\r\n this.onGeographicCoordinateSystemChanged.raiseEvent(old);\r\n }\r\n\r\n /** Sets the geographic coordinate reference system from GeographicCRSProps. */\r\n public setGeographicCoordinateSystem(geoCRS: GeographicCRSProps) {\r\n this.geographicCoordinateSystem = new GeographicCRS(geoCRS);\r\n }\r\n\r\n /** @internal */\r\n public getConnectionProps(): IModelConnectionProps {\r\n return {\r\n name: this.name,\r\n rootSubject: this.rootSubject,\r\n projectExtents: this.projectExtents.toJSON(),\r\n globalOrigin: this.globalOrigin.toJSON(),\r\n ecefLocation: this.ecefLocation,\r\n geographicCoordinateSystem: this.geographicCoordinateSystem?.toJSON(),\r\n ...this._getRpcProps(),\r\n };\r\n }\r\n\r\n /** Convert this iModel to a JSON representation. */\r\n public toJSON(): IModelConnectionProps {\r\n return this.getConnectionProps();\r\n }\r\n\r\n /** A key used to identify this iModel in RPC calls from frontend to backend.\r\n * @internal\r\n */\r\n protected _fileKey: string;\r\n /** Get the key that was used to open this iModel. This is the value used for Rpc and Ipc communications. */\r\n public get key(): string { return this._fileKey; }\r\n\r\n /** @internal */\r\n protected _iTwinId?: GuidString;\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public get iTwinId(): GuidString | undefined { return this._iTwinId; }\r\n\r\n /** The Guid that identifies this iModel. */\r\n public get iModelId(): GuidString | undefined { return this._iModelId; }\r\n\r\n /** @public */\r\n public get changeset(): ChangesetIdWithIndex {\r\n return { ...this._changeset };\r\n }\r\n public set changeset(changeset: ChangesetIdWithIndex) {\r\n const prev = this._changeset;\r\n if (prev.id !== changeset.id || prev.index !== changeset.index) {\r\n this._changeset = { id: changeset.id, index: changeset.index };\r\n this.onChangesetChanged.raiseEvent(prev);\r\n }\r\n }\r\n\r\n protected _openMode = OpenMode.Readonly;\r\n /** The [[OpenMode]] used for this IModel. */\r\n public get openMode(): OpenMode { return this._openMode; }\r\n\r\n /** Return a token for RPC operations.\r\n * @throws IModelError if the iModel is not open.\r\n */\r\n public getRpcProps(): IModelRpcProps {\r\n if (!this.isOpen)\r\n throw new IModelError(IModelStatus.BadRequest, \"IModel is not open for rpc\");\r\n\r\n return this._getRpcProps();\r\n }\r\n\r\n /** Returns the iModel's RPC properties.\r\n * @note It is an error to attempt to use these properties as a token for RPC operations if the iModel is not open.\r\n * @internal\r\n */\r\n protected _getRpcProps(): IModelRpcProps {\r\n return {\r\n key: this._fileKey,\r\n iTwinId: this.iTwinId,\r\n iModelId: this.iModelId,\r\n changeset: this.changeset,\r\n };\r\n }\r\n\r\n /** @internal */\r\n protected constructor(tokenProps?: IModelRpcProps) {\r\n this._changeset = tokenProps?.changeset ?? { id: \"\", index: 0 };\r\n this._fileKey = \"\";\r\n if (tokenProps) {\r\n this._fileKey = tokenProps.key;\r\n this._iTwinId = tokenProps.iTwinId;\r\n this._iModelId = tokenProps.iModelId;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected initialize(name: string, props: IModelProps) {\r\n this.name = name;\r\n this.rootSubject = props.rootSubject;\r\n this.projectExtents = Range3d.fromJSON(props.projectExtents);\r\n this.globalOrigin = Point3d.fromJSON(props.globalOrigin);\r\n\r\n const ecefLocation = props.ecefLocation ? new EcefLocation(props.ecefLocation) : undefined;\r\n this.ecefLocation = ecefLocation?.isValid ? ecefLocation : undefined;\r\n\r\n this.geographicCoordinateSystem = props.geographicCoordinateSystem ? new GeographicCRS(props.geographicCoordinateSystem) : undefined;\r\n }\r\n\r\n /** Get the default subCategoryId for the supplied categoryId */\r\n public static getDefaultSubCategoryId(categoryId: Id64String): Id64String {\r\n return Id64.isValid(categoryId) ? Id64.fromLocalAndBriefcaseIds(Id64.getLocalId(categoryId) + 1, Id64.getBriefcaseId(categoryId)) : Id64.invalid;\r\n }\r\n\r\n /** True if this iModel has an [EcefLocation]($docs/learning/glossary#ecefLocation). */\r\n public get isGeoLocated() { return undefined !== this._ecefLocation; }\r\n\r\n /** Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its [[IModel.ecefLocation]].\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public getEcefTransform(): Transform {\r\n if (undefined === this._ecefLocation)\r\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\r\n return this._ecefLocation.getTransform();\r\n }\r\n\r\n /** Convert a point in this iModel's Spatial coordinates to an ECEF point using its [[IModel.ecefLocation]].\r\n * @param spatial A point in the iModel's spatial coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Point3d in ECEF coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public spatialToEcef(spatial: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyPoint3d(spatial, result); }\r\n\r\n /** Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its [[ecefLocation]].\r\n * @param ecef A point in ECEF coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Point3d in this iModel's spatial coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\r\n */\r\n public ecefToSpatial(ecef: XYAndZ, result?: Point3d): Point3d { return expectDefined(this.getEcefTransform().multiplyInversePoint3d(ecef, result)); }\r\n\r\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using its [[IModel.ecefLocation]].\r\n * @param spatial A point in the iModel's spatial coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Cartographic location\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public spatialToCartographicFromEcef(spatial: XYAndZ, result?: Cartographic): Cartographic { return expectDefined(Cartographic.fromEcef(this.spatialToEcef(spatial), result)); }\r\n\r\n /** Convert a [[Cartographic]] to a point in this iModel's Spatial coordinates using its [[IModel.ecefLocation]].\r\n * @param cartographic A cartographic location\r\n * @param result If defined, use this for output\r\n * @returns A point in this iModel's spatial coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\r\n */\r\n public cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d) { return this.ecefToSpatial(cartographic.toEcef(result), result); }\r\n}\r\n"]}
@@ -169,7 +169,7 @@ export interface MapLayerKey {
169
169
  value: string;
170
170
  }
171
171
  /** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
172
- * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.
172
+ * This class is extended by [[ImageMapLayerSettings]] and [[ModelMapLayerSettings]] to create the settings for image and model based layers.
173
173
  * One or more map layers may be included within [[MapImagerySettings]] object.
174
174
  * @see [[MapImagerySettings]]
175
175
  * @public
@@ -93,7 +93,7 @@ export var ModelMapLayerDrapeTarget;
93
93
  ModelMapLayerDrapeTarget[ModelMapLayerDrapeTarget["IModel"] = 4] = "IModel";
94
94
  })(ModelMapLayerDrapeTarget || (ModelMapLayerDrapeTarget = {}));
95
95
  /** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
96
- * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.
96
+ * This class is extended by [[ImageMapLayerSettings]] and [[ModelMapLayerSettings]] to create the settings for image and model based layers.
97
97
  * One or more map layers may be included within [[MapImagerySettings]] object.
98
98
  * @see [[MapImagerySettings]]
99
99
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerSettings.js","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CA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C,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** The current set of supported map layer formats.\r\n * In order to be displayed, a corresponding format must have been registered in the [MapLayerFormatRegistry]($frontend)\r\n * @public\r\n */\r\nexport type ImageryMapLayerFormatId = \"ArcGIS\" | \"BingMaps\" | \"MapboxImagery\" | \"TileURL\" | \"WMS\" | \"WMTS\";\r\n\r\n/** @public */\r\nexport type SubLayerId = string | number;\r\n\r\n/**\r\n * Type for map layer provider array property.\r\n * @beta\r\n */\r\nexport type MapLayerProviderArrayProperty = number[] | string[] | boolean[];\r\n\r\n/**\r\n * Type for map layer provider properties.\r\n * @beta\r\n */\r\nexport interface MapLayerProviderProperties { [key: string]: number | string | boolean | MapLayerProviderArrayProperty };\r\n\r\n/** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]].\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * @see [[MapLayerProps]]\r\n * @public\r\n */\r\nexport interface MapSubLayerProps {\r\n name: string;\r\n title?: string;\r\n visible?: boolean;\r\n id?: SubLayerId;\r\n parent?: SubLayerId;\r\n children?: SubLayerId[];\r\n}\r\n\r\n/** Normalized representation of a [[MapSubLayerProps]] for which values\r\n * have been validated and default values have been applied where explicit values not defined.\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * This class can represent a hierarchy, in this case a sub layer is visible only if all its ancestors are also visible.\r\n * @see [[MapLayerSettings]]\r\n * @public\r\n */\r\nexport class MapSubLayerSettings {\r\n /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */\r\n public readonly name: string;\r\n /** Title. */\r\n public readonly title?: string;\r\n /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */\r\n public readonly visible: boolean;\r\n /** A unique string or number that may be used to identify the sub layer (ArcGIS) */\r\n public readonly id: SubLayerId;\r\n /** One or more sublayer children */\r\n public readonly children?: SubLayerId[];\r\n /** sublayer parent. */\r\n public readonly parent?: SubLayerId;\r\n\r\n constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]) {\r\n this.name = name;\r\n this.title = title;\r\n this.visible = visible !== undefined && visible;\r\n this.id = (id === undefined) ? this.name : id;\r\n this.parent = parent;\r\n this.children = children;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapSubLayerProps): MapSubLayerSettings {\r\n return new MapSubLayerSettings(json.name, json.title, json.visible, (json.id === json.name) ? undefined : json.id, json.parent, json.children);\r\n }\r\n\r\n public toJSON(): MapSubLayerProps {\r\n const props: MapSubLayerProps = { name: this.name, visible: this.visible };\r\n\r\n if (undefined !== this.id && this.id !== this.name)\r\n props.id = this.id;\r\n\r\n if (undefined !== this.title)\r\n props.title = this.title;\r\n\r\n if (this.children)\r\n props.children = [...this.children];\r\n\r\n if (undefined !== this.parent)\r\n props.parent = this.parent;\r\n\r\n return props;\r\n }\r\n\r\n /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */\r\n public clone(changedProps: Partial<MapSubLayerProps>): MapSubLayerSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n id: undefined !== changedProps.id ? changedProps.id : this.id,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n parent: undefined !== changedProps.parent ? changedProps.parent : this.parent,\r\n children: undefined !== changedProps.children ? changedProps.children.slice() : this.children?.slice(),\r\n title: undefined !== changedProps.title ? changedProps.title : this.title,\r\n };\r\n return MapSubLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapSubLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible;\r\n }\r\n\r\n /** return true if this sublayer is named. */\r\n public get isNamed(): boolean { return this.name.length > 0; }\r\n\r\n /** return true if this sublayer is a leaf (has no children) */\r\n public get isLeaf(): boolean { return this.children === undefined || this.children.length === 0; }\r\n\r\n /** return true if this sublayer is an unnamed group */\r\n public get isUnnamedGroup(): boolean { return !this.isLeaf && !this.isNamed; }\r\n\r\n /** return a string representing this sublayer id (converting to string if underlying id is number) */\r\n public get idString(): string { return (typeof this.id === \"number\") ? this.id.toString(10) : this.id; }\r\n}\r\n\r\n/** JSON representation of properties common to both [[ImageMapLayerProps]] and [[ModelMapLayerProps]].\r\n * @see [[MapImageryProps]]\r\n * @public\r\n */\r\nexport interface CommonMapLayerProps {\r\n /** Controls visibility of layer. Defaults to 'true'. */\r\n visible?: boolean;\r\n\r\n /** A user-friendly name for the layer. */\r\n name: string;\r\n\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,\r\n * or false to indicate the transparency should not be overridden.\r\n * Default value: 0.\r\n */\r\n\r\n transparency?: number;\r\n /** True to indicate background is transparent.\r\n * Default: true.\r\n */\r\n transparentBackground?: boolean;\r\n}\r\n\r\n/** JSON representation of an [[ImageMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @see [[ImageryMapLayerFormatId]].\r\n * @public\r\n */\r\nexport interface ImageMapLayerProps extends CommonMapLayerProps {\r\n /** URL */\r\n url: string;\r\n /** Identifies the map layers source.*/\r\n formatId: string;\r\n /** Source layers. If undefined all layers are displayed. */\r\n subLayers?: MapSubLayerProps[];\r\n /** Access Key for the Layer, like a subscription key or access token.\r\n * ###TODO This does not belong in the props object. It should never be persisted.\r\n */\r\n /** @internal */\r\n accessKey?: MapLayerKey;\r\n\r\n /** @internal */\r\n modelId?: never;\r\n\r\n /** List of query parameters that will get appended to the source.\r\n * @beta\r\n */\r\n queryParams?: { [key: string]: string };\r\n\r\n /** Properties specific to the map layer provider.\r\n * @beta\r\n */\r\n properties?: MapLayerProviderProperties;\r\n\r\n}\r\n\r\n/** The target onto which to drape a model map layer.\r\n * @beta\r\n */\r\nexport enum ModelMapLayerDrapeTarget {\r\n /** Drape only onto the globe. */\r\n Globe = 1 << 0,\r\n /** Drape only onto all attached reality data. */\r\n RealityData = 1 << 1,\r\n /** Drape only onto all models within the iModel. */\r\n IModel = 1 << 2,\r\n}\r\n\r\n/** JSON representation of a [[ModelMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport interface ModelMapLayerProps extends CommonMapLayerProps {\r\n /** The Id of the [GeometricModel]($backend) containing the geometry to be drawn by the layer. */\r\n modelId: Id64String;\r\n /** Specifies the target onto which to drape this model map layer. Defaults to [ModelMapLayerDrapeTarget.Globe]($common).\r\n * @beta\r\n */\r\n drapeTarget?: ModelMapLayerDrapeTarget;\r\n /** @internal */\r\n url?: never;\r\n /** @internal */\r\n formatId?: never;\r\n /** @internal */\r\n subLayers?: never;\r\n /** @internal */\r\n accessKey?: never;\r\n}\r\n\r\n/** JSON representation of a [[MapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;\r\n\r\n/**\r\n * stores key-value pair to be added to all requests made involving map layer.\r\n * @public\r\n */\r\nexport interface MapLayerKey {\r\n key: string;\r\n value: string;\r\n}\r\n\r\n/** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @public\r\n */\r\nexport abstract class MapLayerSettings {\r\n public readonly visible: boolean;\r\n\r\n public readonly name: string;\r\n public readonly transparency: number;\r\n public readonly transparentBackground: boolean;\r\n public abstract get allSubLayersInvisible(): boolean;\r\n public abstract clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;\r\n public abstract toJSON(): MapLayerProps;\r\n\r\n /** @internal */\r\n protected constructor(name: string, visible = true, transparency: number = 0, transparentBackground = true) {\r\n this.name = name;\r\n this.visible = visible;\r\n this.transparentBackground = transparentBackground;\r\n this.transparency = transparency;\r\n }\r\n\r\n /** Create a map layer settings from its JSON representation. */\r\n public static fromJSON(props: MapLayerProps): MapLayerSettings {\r\n return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n protected _toJSON(): CommonMapLayerProps {\r\n const props: CommonMapLayerProps = {\r\n name: this.name,\r\n visible: this.visible,\r\n };\r\n\r\n if (0 !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.transparentBackground === false)\r\n props.transparentBackground = this.transparentBackground;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n protected cloneProps(changedProps: Partial<MapLayerProps>): CommonMapLayerProps {\r\n return {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,\r\n transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;\r\n }\r\n\r\n /** Return a unique string identifying the layers source... The URL for image layer or modelID for model layer */\r\n public abstract get source(): string;\r\n\r\n /** @internal */\r\n public matchesNameAndSource(name: string, source: string): boolean {\r\n return this.name === name && this.source === source;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ModelMapLayerSettings]] for model based map layer settings.\r\n * @public\r\n */\r\nexport class ImageMapLayerSettings extends MapLayerSettings {\r\n public readonly formatId: string;\r\n public readonly url: string;\r\n public userName?: string;\r\n public password?: string;\r\n public accessKey?: MapLayerKey;\r\n\r\n /** List of query parameters to append to the settings URL and persisted as part of the JSON representation.\r\n * @note Sensitive information like user credentials should be provided in [[unsavedQueryParams]] to ensure it is never persisted.\r\n * @beta\r\n */\r\n public savedQueryParams?: { [key: string]: string };\r\n\r\n /** List of query parameters that will get appended to the settings URL that should *not* be be persisted part of the JSON representation.\r\n * @beta\r\n */\r\n public unsavedQueryParams?: { [key: string]: string };\r\n\r\n /** Properties specific to the map layer provider.\r\n * @beta\r\n */\r\n public readonly properties?: MapLayerProviderProperties;\r\n\r\n public readonly subLayers: MapSubLayerSettings[];\r\n public override get source(): string { return this.url; }\r\n\r\n /** @internal */\r\n protected constructor(props: ImageMapLayerProps) {\r\n const transparentBackground = props.transparentBackground ?? true;\r\n super(props.name, props.visible, props.transparency, transparentBackground);\r\n\r\n this.formatId = props.formatId;\r\n this.url = props.url;\r\n this.accessKey = props.accessKey;\r\n if (props.queryParams) {\r\n this.savedQueryParams = {...props.queryParams};\r\n }\r\n\r\n if (props.properties) {\r\n this.properties = {...props.properties}\r\n }\r\n\r\n this.subLayers = [];\r\n if (!props.subLayers)\r\n return;\r\n\r\n for (const subLayerProps of props.subLayers) {\r\n const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);\r\n if (subLayer)\r\n this.subLayers.push(subLayer);\r\n }\r\n }\r\n\r\n public static override fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings {\r\n return new this(props);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ImageMapLayerProps {\r\n const props = super._toJSON() as ImageMapLayerProps;\r\n props.url = this.url;\r\n props.formatId = this.formatId;\r\n\r\n if (this.subLayers.length > 0)\r\n props.subLayers = this.subLayers.map((x) => x.toJSON());\r\n\r\n if (this.savedQueryParams)\r\n props.queryParams = {...this.savedQueryParams};\r\n\r\n if (this.properties) {\r\n props.properties = structuredClone(this.properties);\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerSettings {\r\n const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n // Clone members not part of MapLayerProps\r\n clone.userName = this.userName;\r\n clone.password = this.password;\r\n if (this.unsavedQueryParams)\r\n clone.unsavedQueryParams = {...this.unsavedQueryParams};\r\n if (this.savedQueryParams)\r\n clone.savedQueryParams = {...this.savedQueryParams};\r\n\r\n return clone;\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ImageMapLayerProps;\r\n\r\n props.formatId = changedProps.formatId ?? this.formatId;\r\n props.url = changedProps.url ?? this.url;\r\n props.accessKey = changedProps.accessKey ?? this.accessKey;\r\n props.subLayers = changedProps.subLayers ?? this.subLayers;\r\n if (changedProps.queryParams) {\r\n props.queryParams = {...changedProps.queryParams};\r\n } else if (this.savedQueryParams) {\r\n props.queryParams = {...this.savedQueryParams};\r\n }\r\n\r\n if (changedProps.properties) {\r\n props.properties = {...changedProps.properties}\r\n } else if (this.properties) {\r\n props.properties = {...this.properties}\r\n }\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (! (other instanceof ImageMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < this.subLayers.length; i++)\r\n if (!this.subLayers[i].displayMatches(other.subLayers[i]))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Return a sublayer matching id -- or undefined if not found */\r\n public subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined {\r\n return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);\r\n }\r\n\r\n private hasInvisibleAncestors(subLayer?: MapSubLayerSettings): boolean {\r\n if (!subLayer || !subLayer.parent)\r\n return false;\r\n\r\n const parent = this.subLayerById(subLayer.parent);\r\n if (!parent)\r\n return false;\r\n\r\n // Visibility of named group has no impact on the visibility of children (only unnamed group does)\r\n // i.e For WMS, its should be possible to request a child layer when its parent is not visible (if the parent is also named)\r\n return (!parent.visible && !parent.isNamed) || this.hasInvisibleAncestors(parent);\r\n }\r\n\r\n /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */\r\n public isSubLayerVisible(subLayer: MapSubLayerSettings): boolean {\r\n if (!subLayer.visible)\r\n return false;\r\n\r\n return !this.hasInvisibleAncestors(subLayer);\r\n }\r\n\r\n /** Return true if all sublayers are invisible. */\r\n public get allSubLayersInvisible(): boolean {\r\n if (this.subLayers.length === 0)\r\n return false;\r\n\r\n return this.subLayers.every((subLayer) => (subLayer.isUnnamedGroup || !this.isSubLayerVisible(subLayer)));\r\n }\r\n\r\n /** Return the children for a sublayer */\r\n public getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined {\r\n if (!subLayer.children)\r\n return undefined;\r\n\r\n const children = new Array<MapSubLayerSettings>();\r\n subLayer.children.forEach((childId) => {\r\n const child = this.subLayerById(childId);\r\n if (child !== undefined)\r\n children.push(child);\r\n });\r\n\r\n return children;\r\n }\r\n\r\n /** @internal */\r\n protected static mapTypeName(type: BackgroundMapType) { // TBD.. Localization.\r\n switch (type) {\r\n case BackgroundMapType.Aerial:\r\n return \"Aerial Imagery\";\r\n default:\r\n case BackgroundMapType.Hybrid:\r\n return \"Aerial Imagery with labels\";\r\n case BackgroundMapType.Street:\r\n return \"Streets\";\r\n }\r\n }\r\n\r\n public setCredentials(userName?: string, password?: string) {\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n\r\n /** Collect all query parameters\r\n * @beta\r\n */\r\n public collectQueryParams() {\r\n let queryParams: {[key: string]: string} = {};\r\n if (this.savedQueryParams)\r\n queryParams = {...this.savedQueryParams};\r\n\r\n if (this.unsavedQueryParams)\r\n queryParams = {...queryParams, ...this.unsavedQueryParams};\r\n\r\n return queryParams;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ImageMapLayerSettings]] for image based map layer settings.\r\n * @public\r\n */\r\nexport class ModelMapLayerSettings extends MapLayerSettings {\r\n /** Specifies the target onto which to drape this model map layer. Defaults to [ModelMapLayerDrapeTarget.Globe]($common).\r\n * @beta\r\n */\r\n public readonly drapeTarget: ModelMapLayerDrapeTarget;\r\n public readonly modelId: Id64String;\r\n public override get source(): string { return this.modelId; }\r\n\r\n /** @internal */\r\n protected constructor(modelId: Id64String, name: string, visible = true,\r\n transparency: number = 0, transparentBackground = true, drapeTarget = ModelMapLayerDrapeTarget.Globe) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\r\n this.drapeTarget = drapeTarget;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static override fromJSON(json: ModelMapLayerProps): ModelMapLayerSettings {\r\n const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;\r\n return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground, json.drapeTarget);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ModelMapLayerProps {\r\n const props = super._toJSON() as ModelMapLayerProps;\r\n props.modelId = this.modelId;\r\n if (this.drapeTarget !== ModelMapLayerDrapeTarget.Globe)\r\n props.drapeTarget = this.drapeTarget;\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerSettings {\r\n return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ModelMapLayerProps;\r\n props.modelId = changedProps.modelId ?? this.modelId;\r\n props.drapeTarget = changedProps.drapeTarget ?? this.drapeTarget;\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n return this.modelId === other.modelId;\r\n }\r\n\r\n /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */\r\n public get allSubLayersInvisible(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[BaseMapLayerSettings]].\r\n * @public\r\n */\r\nexport interface BaseMapLayerProps extends ImageMapLayerProps {\r\n provider?: BackgroundMapProviderProps;\r\n}\r\n\r\n/** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].\r\n * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based\r\n * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).\r\n * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows\r\n * the imagery provider and/or type to be easily modified.\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @public\r\n */\r\nexport class BaseMapLayerSettings extends ImageMapLayerSettings {\r\n private _provider?: BackgroundMapProvider;\r\n\r\n /** The provider from which this base layer was configured, if any. */\r\n public get provider(): BackgroundMapProvider | undefined { return this._provider; }\r\n\r\n /** Create a base layer from its JSON representation.\r\n * TODO: This, MapLayerSettings.fromJSON, and MapSubLayerSettings.fromJSON should never return undefined.\r\n * That means they should not accept undefined for props and should define props such that it fully describes the\r\n * layer - e.g., url and name must be defined.\r\n */\r\n public static override fromJSON(props: BaseMapLayerProps): BaseMapLayerSettings {\r\n const settings = super.fromJSON(props);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n if (props.provider)\r\n settings._provider = BackgroundMapProvider.fromJSON(props.provider);\r\n\r\n return settings;\r\n }\r\n\r\n /** Convert this layer to its JSON representation. */\r\n public override toJSON(): BaseMapLayerProps {\r\n const props = super.toJSON() as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override cloneProps(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerProps {\r\n const props = super.cloneProps(changedProps) as BaseMapLayerProps;\r\n\r\n if (changedProps.provider)\r\n props.provider = changedProps.provider;\r\n else if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this layer. */\r\n public override clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings {\r\n const prevUrl = this.url;\r\n const clone = BaseMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n if (this.provider && prevUrl !== this.url)\r\n clone._provider = undefined;\r\n\r\n return clone;\r\n }\r\n\r\n /** Create a base layer from a BackgroundMapProvider. */\r\n public static fromProvider(provider: BackgroundMapProvider, options?: { invisible?: boolean, transparency?: number }): BaseMapLayerSettings {\r\n let formatId: string, url: string, name: string;\r\n switch (provider.name) {\r\n case \"BingProvider\":\r\n default:\r\n formatId = \"BingMaps\";\r\n\r\n let imagerySet;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n imagerySet = \"Road\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n imagerySet = \"Aerial\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n default:\r\n imagerySet = \"AerialWithLabels\";\r\n break;\r\n }\r\n\r\n name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;\r\n break;\r\n\r\n case \"MapBoxProvider\":\r\n formatId = \"MapboxImagery\";\r\n name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/\";\r\n break;\r\n }\r\n\r\n break;\r\n }\r\n\r\n const settings = super.fromJSON({\r\n name,\r\n formatId,\r\n url,\r\n transparentBackground: false,\r\n visible: !options?.invisible,\r\n transparency: options?.transparency,\r\n });\r\n\r\n assert(undefined !== settings);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n\r\n settings._provider = provider;\r\n return settings;\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BaseMapLayerSettings {\r\n return this.fromProvider(BackgroundMapProvider.fromBackgroundMapProps(props));\r\n }\r\n\r\n /** @alpha */\r\n public cloneWithProvider(provider: BackgroundMapProvider): BaseMapLayerSettings {\r\n return BaseMapLayerSettings.fromProvider(provider, { invisible: !this.visible, transparency: this.transparency });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"MapLayerSettings.js","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAA8B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAsBS,CAAC;AAiBzH;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IAC9B,mIAAmI;IACnH,IAAI,CAAS;IAC7B,aAAa;IACG,KAAK,CAAU;IAC/B,gIAAgI;IAChH,OAAO,CAAU;IACjC,oFAAoF;IACpE,EAAE,CAAa;IAC/B,oCAAoC;IACpB,QAAQ,CAAgB;IACxC,uBAAuB;IACP,MAAM,CAAc;IAEpC,YAAY,IAAY,EAAE,KAAc,EAAE,OAAiB,EAAE,EAAe,EAAE,MAAmB,EAAE,QAAuB;QACxH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC;QAChD,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,mGAAmG;IAC5F,MAAM,CAAC,QAAQ,CAAC,IAAsB;QAC3C,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE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QAAQ,YAAY,oBAAoB,CAAC,CAAC;QAEjD,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,KAAmC;QACtE,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,aAAa;IACN,iBAAiB,CAAC,QAA+B;QACtD,OAAO,oBAAoB,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** The current set of supported map layer formats.\r\n * In order to be displayed, a corresponding format must have been registered in the [MapLayerFormatRegistry]($frontend)\r\n * @public\r\n */\r\nexport type ImageryMapLayerFormatId = \"ArcGIS\" | \"BingMaps\" | \"MapboxImagery\" | \"TileURL\" | \"WMS\" | \"WMTS\";\r\n\r\n/** @public */\r\nexport type SubLayerId = string | number;\r\n\r\n/**\r\n * Type for map layer provider array property.\r\n * @beta\r\n */\r\nexport type MapLayerProviderArrayProperty = number[] | string[] | boolean[];\r\n\r\n/**\r\n * Type for map layer provider properties.\r\n * @beta\r\n */\r\nexport interface MapLayerProviderProperties { [key: string]: number | string | boolean | MapLayerProviderArrayProperty };\r\n\r\n/** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]].\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * @see [[MapLayerProps]]\r\n * @public\r\n */\r\nexport interface MapSubLayerProps {\r\n name: string;\r\n title?: string;\r\n visible?: boolean;\r\n id?: SubLayerId;\r\n parent?: SubLayerId;\r\n children?: SubLayerId[];\r\n}\r\n\r\n/** Normalized representation of a [[MapSubLayerProps]] for which values\r\n * have been validated and default values have been applied where explicit values not defined.\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * This class can represent a hierarchy, in this case a sub layer is visible only if all its ancestors are also visible.\r\n * @see [[MapLayerSettings]]\r\n * @public\r\n */\r\nexport class MapSubLayerSettings {\r\n /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */\r\n public readonly name: string;\r\n /** Title. */\r\n public readonly title?: string;\r\n /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */\r\n public readonly visible: boolean;\r\n /** A unique string or number that may be used to identify the sub layer (ArcGIS) */\r\n public readonly id: SubLayerId;\r\n /** One or more sublayer children */\r\n public readonly children?: SubLayerId[];\r\n /** sublayer parent. */\r\n public readonly parent?: SubLayerId;\r\n\r\n constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]) {\r\n this.name = name;\r\n this.title = title;\r\n this.visible = visible !== undefined && visible;\r\n this.id = (id === undefined) ? this.name : id;\r\n this.parent = parent;\r\n this.children = children;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapSubLayerProps): MapSubLayerSettings {\r\n return new MapSubLayerSettings(json.name, json.title, json.visible, (json.id === json.name) ? undefined : json.id, json.parent, json.children);\r\n }\r\n\r\n public toJSON(): MapSubLayerProps {\r\n const props: MapSubLayerProps = { name: this.name, visible: this.visible };\r\n\r\n if (undefined !== this.id && this.id !== this.name)\r\n props.id = this.id;\r\n\r\n if (undefined !== this.title)\r\n props.title = this.title;\r\n\r\n if (this.children)\r\n props.children = [...this.children];\r\n\r\n if (undefined !== this.parent)\r\n props.parent = this.parent;\r\n\r\n return props;\r\n }\r\n\r\n /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */\r\n public clone(changedProps: Partial<MapSubLayerProps>): MapSubLayerSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n id: undefined !== changedProps.id ? changedProps.id : this.id,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n parent: undefined !== changedProps.parent ? changedProps.parent : this.parent,\r\n children: undefined !== changedProps.children ? changedProps.children.slice() : this.children?.slice(),\r\n title: undefined !== changedProps.title ? changedProps.title : this.title,\r\n };\r\n return MapSubLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapSubLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible;\r\n }\r\n\r\n /** return true if this sublayer is named. */\r\n public get isNamed(): boolean { return this.name.length > 0; }\r\n\r\n /** return true if this sublayer is a leaf (has no children) */\r\n public get isLeaf(): boolean { return this.children === undefined || this.children.length === 0; }\r\n\r\n /** return true if this sublayer is an unnamed group */\r\n public get isUnnamedGroup(): boolean { return !this.isLeaf && !this.isNamed; }\r\n\r\n /** return a string representing this sublayer id (converting to string if underlying id is number) */\r\n public get idString(): string { return (typeof this.id === \"number\") ? this.id.toString(10) : this.id; }\r\n}\r\n\r\n/** JSON representation of properties common to both [[ImageMapLayerProps]] and [[ModelMapLayerProps]].\r\n * @see [[MapImageryProps]]\r\n * @public\r\n */\r\nexport interface CommonMapLayerProps {\r\n /** Controls visibility of layer. Defaults to 'true'. */\r\n visible?: boolean;\r\n\r\n /** A user-friendly name for the layer. */\r\n name: string;\r\n\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,\r\n * or false to indicate the transparency should not be overridden.\r\n * Default value: 0.\r\n */\r\n\r\n transparency?: number;\r\n /** True to indicate background is transparent.\r\n * Default: true.\r\n */\r\n transparentBackground?: boolean;\r\n}\r\n\r\n/** JSON representation of an [[ImageMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @see [[ImageryMapLayerFormatId]].\r\n * @public\r\n */\r\nexport interface ImageMapLayerProps extends CommonMapLayerProps {\r\n /** URL */\r\n url: string;\r\n /** Identifies the map layers source.*/\r\n formatId: string;\r\n /** Source layers. If undefined all layers are displayed. */\r\n subLayers?: MapSubLayerProps[];\r\n /** Access Key for the Layer, like a subscription key or access token.\r\n * ###TODO This does not belong in the props object. It should never be persisted.\r\n */\r\n /** @internal */\r\n accessKey?: MapLayerKey;\r\n\r\n /** @internal */\r\n modelId?: never;\r\n\r\n /** List of query parameters that will get appended to the source.\r\n * @beta\r\n */\r\n queryParams?: { [key: string]: string };\r\n\r\n /** Properties specific to the map layer provider.\r\n * @beta\r\n */\r\n properties?: MapLayerProviderProperties;\r\n\r\n}\r\n\r\n/** The target onto which to drape a model map layer.\r\n * @beta\r\n */\r\nexport enum ModelMapLayerDrapeTarget {\r\n /** Drape only onto the globe. */\r\n Globe = 1 << 0,\r\n /** Drape only onto all attached reality data. */\r\n RealityData = 1 << 1,\r\n /** Drape only onto all models within the iModel. */\r\n IModel = 1 << 2,\r\n}\r\n\r\n/** JSON representation of a [[ModelMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport interface ModelMapLayerProps extends CommonMapLayerProps {\r\n /** The Id of the [GeometricModel]($backend) containing the geometry to be drawn by the layer. */\r\n modelId: Id64String;\r\n /** Specifies the target onto which to drape this model map layer. Defaults to [ModelMapLayerDrapeTarget.Globe]($common).\r\n * @beta\r\n */\r\n drapeTarget?: ModelMapLayerDrapeTarget;\r\n /** @internal */\r\n url?: never;\r\n /** @internal */\r\n formatId?: never;\r\n /** @internal */\r\n subLayers?: never;\r\n /** @internal */\r\n accessKey?: never;\r\n}\r\n\r\n/** JSON representation of a [[MapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;\r\n\r\n/**\r\n * stores key-value pair to be added to all requests made involving map layer.\r\n * @public\r\n */\r\nexport interface MapLayerKey {\r\n key: string;\r\n value: string;\r\n}\r\n\r\n/** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * This class is extended by [[ImageMapLayerSettings]] and [[ModelMapLayerSettings]] to create the settings for image and model based layers.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @public\r\n */\r\nexport abstract class MapLayerSettings {\r\n public readonly visible: boolean;\r\n\r\n public readonly name: string;\r\n public readonly transparency: number;\r\n public readonly transparentBackground: boolean;\r\n public abstract get allSubLayersInvisible(): boolean;\r\n public abstract clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;\r\n public abstract toJSON(): MapLayerProps;\r\n\r\n /** @internal */\r\n protected constructor(name: string, visible = true, transparency: number = 0, transparentBackground = true) {\r\n this.name = name;\r\n this.visible = visible;\r\n this.transparentBackground = transparentBackground;\r\n this.transparency = transparency;\r\n }\r\n\r\n /** Create a map layer settings from its JSON representation. */\r\n public static fromJSON(props: MapLayerProps): MapLayerSettings {\r\n return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n protected _toJSON(): CommonMapLayerProps {\r\n const props: CommonMapLayerProps = {\r\n name: this.name,\r\n visible: this.visible,\r\n };\r\n\r\n if (0 !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.transparentBackground === false)\r\n props.transparentBackground = this.transparentBackground;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n protected cloneProps(changedProps: Partial<MapLayerProps>): CommonMapLayerProps {\r\n return {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,\r\n transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;\r\n }\r\n\r\n /** Return a unique string identifying the layers source... The URL for image layer or modelID for model layer */\r\n public abstract get source(): string;\r\n\r\n /** @internal */\r\n public matchesNameAndSource(name: string, source: string): boolean {\r\n return this.name === name && this.source === source;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ModelMapLayerSettings]] for model based map layer settings.\r\n * @public\r\n */\r\nexport class ImageMapLayerSettings extends MapLayerSettings {\r\n public readonly formatId: string;\r\n public readonly url: string;\r\n public userName?: string;\r\n public password?: string;\r\n public accessKey?: MapLayerKey;\r\n\r\n /** List of query parameters to append to the settings URL and persisted as part of the JSON representation.\r\n * @note Sensitive information like user credentials should be provided in [[unsavedQueryParams]] to ensure it is never persisted.\r\n * @beta\r\n */\r\n public savedQueryParams?: { [key: string]: string };\r\n\r\n /** List of query parameters that will get appended to the settings URL that should *not* be be persisted part of the JSON representation.\r\n * @beta\r\n */\r\n public unsavedQueryParams?: { [key: string]: string };\r\n\r\n /** Properties specific to the map layer provider.\r\n * @beta\r\n */\r\n public readonly properties?: MapLayerProviderProperties;\r\n\r\n public readonly subLayers: MapSubLayerSettings[];\r\n public override get source(): string { return this.url; }\r\n\r\n /** @internal */\r\n protected constructor(props: ImageMapLayerProps) {\r\n const transparentBackground = props.transparentBackground ?? true;\r\n super(props.name, props.visible, props.transparency, transparentBackground);\r\n\r\n this.formatId = props.formatId;\r\n this.url = props.url;\r\n this.accessKey = props.accessKey;\r\n if (props.queryParams) {\r\n this.savedQueryParams = {...props.queryParams};\r\n }\r\n\r\n if (props.properties) {\r\n this.properties = {...props.properties}\r\n }\r\n\r\n this.subLayers = [];\r\n if (!props.subLayers)\r\n return;\r\n\r\n for (const subLayerProps of props.subLayers) {\r\n const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);\r\n if (subLayer)\r\n this.subLayers.push(subLayer);\r\n }\r\n }\r\n\r\n public static override fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings {\r\n return new this(props);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ImageMapLayerProps {\r\n const props = super._toJSON() as ImageMapLayerProps;\r\n props.url = this.url;\r\n props.formatId = this.formatId;\r\n\r\n if (this.subLayers.length > 0)\r\n props.subLayers = this.subLayers.map((x) => x.toJSON());\r\n\r\n if (this.savedQueryParams)\r\n props.queryParams = {...this.savedQueryParams};\r\n\r\n if (this.properties) {\r\n props.properties = structuredClone(this.properties);\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerSettings {\r\n const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n // Clone members not part of MapLayerProps\r\n clone.userName = this.userName;\r\n clone.password = this.password;\r\n if (this.unsavedQueryParams)\r\n clone.unsavedQueryParams = {...this.unsavedQueryParams};\r\n if (this.savedQueryParams)\r\n clone.savedQueryParams = {...this.savedQueryParams};\r\n\r\n return clone;\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ImageMapLayerProps;\r\n\r\n props.formatId = changedProps.formatId ?? this.formatId;\r\n props.url = changedProps.url ?? this.url;\r\n props.accessKey = changedProps.accessKey ?? this.accessKey;\r\n props.subLayers = changedProps.subLayers ?? this.subLayers;\r\n if (changedProps.queryParams) {\r\n props.queryParams = {...changedProps.queryParams};\r\n } else if (this.savedQueryParams) {\r\n props.queryParams = {...this.savedQueryParams};\r\n }\r\n\r\n if (changedProps.properties) {\r\n props.properties = {...changedProps.properties}\r\n } else if (this.properties) {\r\n props.properties = {...this.properties}\r\n }\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (! (other instanceof ImageMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < this.subLayers.length; i++)\r\n if (!this.subLayers[i].displayMatches(other.subLayers[i]))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Return a sublayer matching id -- or undefined if not found */\r\n public subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined {\r\n return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);\r\n }\r\n\r\n private hasInvisibleAncestors(subLayer?: MapSubLayerSettings): boolean {\r\n if (!subLayer || !subLayer.parent)\r\n return false;\r\n\r\n const parent = this.subLayerById(subLayer.parent);\r\n if (!parent)\r\n return false;\r\n\r\n // Visibility of named group has no impact on the visibility of children (only unnamed group does)\r\n // i.e For WMS, its should be possible to request a child layer when its parent is not visible (if the parent is also named)\r\n return (!parent.visible && !parent.isNamed) || this.hasInvisibleAncestors(parent);\r\n }\r\n\r\n /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */\r\n public isSubLayerVisible(subLayer: MapSubLayerSettings): boolean {\r\n if (!subLayer.visible)\r\n return false;\r\n\r\n return !this.hasInvisibleAncestors(subLayer);\r\n }\r\n\r\n /** Return true if all sublayers are invisible. */\r\n public get allSubLayersInvisible(): boolean {\r\n if (this.subLayers.length === 0)\r\n return false;\r\n\r\n return this.subLayers.every((subLayer) => (subLayer.isUnnamedGroup || !this.isSubLayerVisible(subLayer)));\r\n }\r\n\r\n /** Return the children for a sublayer */\r\n public getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined {\r\n if (!subLayer.children)\r\n return undefined;\r\n\r\n const children = new Array<MapSubLayerSettings>();\r\n subLayer.children.forEach((childId) => {\r\n const child = this.subLayerById(childId);\r\n if (child !== undefined)\r\n children.push(child);\r\n });\r\n\r\n return children;\r\n }\r\n\r\n /** @internal */\r\n protected static mapTypeName(type: BackgroundMapType) { // TBD.. Localization.\r\n switch (type) {\r\n case BackgroundMapType.Aerial:\r\n return \"Aerial Imagery\";\r\n default:\r\n case BackgroundMapType.Hybrid:\r\n return \"Aerial Imagery with labels\";\r\n case BackgroundMapType.Street:\r\n return \"Streets\";\r\n }\r\n }\r\n\r\n public setCredentials(userName?: string, password?: string) {\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n\r\n /** Collect all query parameters\r\n * @beta\r\n */\r\n public collectQueryParams() {\r\n let queryParams: {[key: string]: string} = {};\r\n if (this.savedQueryParams)\r\n queryParams = {...this.savedQueryParams};\r\n\r\n if (this.unsavedQueryParams)\r\n queryParams = {...queryParams, ...this.unsavedQueryParams};\r\n\r\n return queryParams;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ImageMapLayerSettings]] for image based map layer settings.\r\n * @public\r\n */\r\nexport class ModelMapLayerSettings extends MapLayerSettings {\r\n /** Specifies the target onto which to drape this model map layer. Defaults to [ModelMapLayerDrapeTarget.Globe]($common).\r\n * @beta\r\n */\r\n public readonly drapeTarget: ModelMapLayerDrapeTarget;\r\n public readonly modelId: Id64String;\r\n public override get source(): string { return this.modelId; }\r\n\r\n /** @internal */\r\n protected constructor(modelId: Id64String, name: string, visible = true,\r\n transparency: number = 0, transparentBackground = true, drapeTarget = ModelMapLayerDrapeTarget.Globe) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\r\n this.drapeTarget = drapeTarget;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static override fromJSON(json: ModelMapLayerProps): ModelMapLayerSettings {\r\n const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;\r\n return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground, json.drapeTarget);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ModelMapLayerProps {\r\n const props = super._toJSON() as ModelMapLayerProps;\r\n props.modelId = this.modelId;\r\n if (this.drapeTarget !== ModelMapLayerDrapeTarget.Globe)\r\n props.drapeTarget = this.drapeTarget;\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerSettings {\r\n return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ModelMapLayerProps;\r\n props.modelId = changedProps.modelId ?? this.modelId;\r\n props.drapeTarget = changedProps.drapeTarget ?? this.drapeTarget;\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n return this.modelId === other.modelId;\r\n }\r\n\r\n /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */\r\n public get allSubLayersInvisible(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[BaseMapLayerSettings]].\r\n * @public\r\n */\r\nexport interface BaseMapLayerProps extends ImageMapLayerProps {\r\n provider?: BackgroundMapProviderProps;\r\n}\r\n\r\n/** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].\r\n * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based\r\n * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).\r\n * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows\r\n * the imagery provider and/or type to be easily modified.\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @public\r\n */\r\nexport class BaseMapLayerSettings extends ImageMapLayerSettings {\r\n private _provider?: BackgroundMapProvider;\r\n\r\n /** The provider from which this base layer was configured, if any. */\r\n public get provider(): BackgroundMapProvider | undefined { return this._provider; }\r\n\r\n /** Create a base layer from its JSON representation.\r\n * TODO: This, MapLayerSettings.fromJSON, and MapSubLayerSettings.fromJSON should never return undefined.\r\n * That means they should not accept undefined for props and should define props such that it fully describes the\r\n * layer - e.g., url and name must be defined.\r\n */\r\n public static override fromJSON(props: BaseMapLayerProps): BaseMapLayerSettings {\r\n const settings = super.fromJSON(props);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n if (props.provider)\r\n settings._provider = BackgroundMapProvider.fromJSON(props.provider);\r\n\r\n return settings;\r\n }\r\n\r\n /** Convert this layer to its JSON representation. */\r\n public override toJSON(): BaseMapLayerProps {\r\n const props = super.toJSON() as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override cloneProps(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerProps {\r\n const props = super.cloneProps(changedProps) as BaseMapLayerProps;\r\n\r\n if (changedProps.provider)\r\n props.provider = changedProps.provider;\r\n else if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this layer. */\r\n public override clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings {\r\n const prevUrl = this.url;\r\n const clone = BaseMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n if (this.provider && prevUrl !== this.url)\r\n clone._provider = undefined;\r\n\r\n return clone;\r\n }\r\n\r\n /** Create a base layer from a BackgroundMapProvider. */\r\n public static fromProvider(provider: BackgroundMapProvider, options?: { invisible?: boolean, transparency?: number }): BaseMapLayerSettings {\r\n let formatId: string, url: string, name: string;\r\n switch (provider.name) {\r\n case \"BingProvider\":\r\n default:\r\n formatId = \"BingMaps\";\r\n\r\n let imagerySet;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n imagerySet = \"Road\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n imagerySet = \"Aerial\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n default:\r\n imagerySet = \"AerialWithLabels\";\r\n break;\r\n }\r\n\r\n name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;\r\n break;\r\n\r\n case \"MapBoxProvider\":\r\n formatId = \"MapboxImagery\";\r\n name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/\";\r\n break;\r\n }\r\n\r\n break;\r\n }\r\n\r\n const settings = super.fromJSON({\r\n name,\r\n formatId,\r\n url,\r\n transparentBackground: false,\r\n visible: !options?.invisible,\r\n transparency: options?.transparency,\r\n });\r\n\r\n assert(undefined !== settings);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n\r\n settings._provider = provider;\r\n return settings;\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BaseMapLayerSettings {\r\n return this.fromProvider(BackgroundMapProvider.fromBackgroundMapProps(props));\r\n }\r\n\r\n /** @alpha */\r\n public cloneWithProvider(provider: BackgroundMapProvider): BaseMapLayerSettings {\r\n return BaseMapLayerSettings.fromProvider(provider, { invisible: !this.visible, transparency: this.transparency });\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,KAAK,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,KAAK,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EACyB,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAyB,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAA6C,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\r\nexport {\r\n type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\r\n} from \"./RenderMesh\";\r\nexport {\r\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\r\n} from \"./PackedFeatureTable\";\r\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\r\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\r\nexport { RenderTextureParams } from \"./RenderTextureParams\";\r\nexport { type FieldPrimitiveValue, type FieldValue, formatFieldValue, isKnownFieldPropertyType } from \"./annotations/FieldFormatter\";\r\n"]}
1
+ {"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EACyB,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAyB,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAA6C,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\r\nexport {\r\n type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\r\n} from \"./RenderMesh\";\r\nexport {\r\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\r\n} from \"./PackedFeatureTable\";\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\r\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\r\nexport { RenderTextureParams } from \"./RenderTextureParams\";\r\nexport { type FieldPrimitiveValue, type FieldValue, formatFieldValue, isKnownFieldPropertyType } from \"./annotations/FieldFormatter\";\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-common",
3
- "version": "5.5.0-dev.9",
3
+ "version": "5.6.0-dev.1",
4
4
  "description": "iTwin.js components common to frontend and backend",
5
5
  "main": "lib/cjs/core-common.js",
6
6
  "module": "lib/esm/core-common.js",
@@ -27,8 +27,8 @@
27
27
  "js-base64": "^3.6.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "@itwin/core-bentley": "5.5.0-dev.9",
31
- "@itwin/core-geometry": "5.5.0-dev.9"
30
+ "@itwin/core-bentley": "5.6.0-dev.1",
31
+ "@itwin/core-geometry": "5.6.0-dev.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@itwin/eslint-plugin": "5.2.2-dev.2",
@@ -42,9 +42,9 @@
42
42
  "rimraf": "^6.0.1",
43
43
  "typescript": "~5.6.2",
44
44
  "vitest": "^3.0.6",
45
- "@itwin/build-tools": "5.5.0-dev.9",
46
- "@itwin/core-geometry": "5.5.0-dev.9",
47
- "@itwin/core-bentley": "5.5.0-dev.9"
45
+ "@itwin/build-tools": "5.6.0-dev.1",
46
+ "@itwin/core-bentley": "5.6.0-dev.1",
47
+ "@itwin/core-geometry": "5.6.0-dev.1"
48
48
  },
49
49
  "nyc": {
50
50
  "extends": "./node_modules/@itwin/build-tools/.nycrc",