@itwin/core-common 4.3.0-dev.8 → 4.4.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.
- package/CHANGELOG.md +40 -1
- package/lib/cjs/ClipStyle.d.ts +63 -1
- package/lib/cjs/ClipStyle.d.ts.map +1 -1
- package/lib/cjs/ClipStyle.js +75 -11
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +15 -0
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +8 -9
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/MapLayerSettings.d.ts +25 -0
- package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
- package/lib/cjs/MapLayerSettings.js +27 -0
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/ThematicDisplay.d.ts +27 -0
- package/lib/cjs/ThematicDisplay.d.ts.map +1 -1
- package/lib/cjs/ThematicDisplay.js +51 -18
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +3 -0
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/ClipStyle.d.ts +63 -1
- package/lib/esm/ClipStyle.d.ts.map +1 -1
- package/lib/esm/ClipStyle.js +74 -10
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts +15 -0
- package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
- package/lib/esm/ConcurrentQuery.js +7 -8
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/MapLayerSettings.d.ts +25 -0
- package/lib/esm/MapLayerSettings.d.ts.map +1 -1
- package/lib/esm/MapLayerSettings.js +27 -0
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/ThematicDisplay.d.ts +27 -0
- package/lib/esm/ThematicDisplay.d.ts.map +1 -1
- package/lib/esm/ThematicDisplay.js +50 -17
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +3 -0
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/package.json +6 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAuH;AACvH,wDAAwD;AACxD,yCAAmC;AAEnC;;;;;;GAMG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACxB;;OAEG;IACH,qFAAqB,CAAA;IACrB;;OAEG;IACH,yFAAuB,CAAA;IACvB;;OAEG;IACH,+EAAkB,CAAA;AACpB,CAAC,EAbW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAazB;AA4GD,cAAc;AACd,MAAa,mBAAmB;IAC9B,YAA2B,WAAyB,EAAE;QAA3B,aAAQ,GAAR,QAAQ,CAAmB;IAAI,CAAC;IACpD,UAAU,KAAmB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D;;;;;OAKG;IACI,WAAW,CAAC,GAAW;QAC5B,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,GAAG,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;OAIG;IACI,eAAe,CAAC,GAAW;QAChC,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,GAAG,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;OAIG;IACI,QAAQ,CAAC,GAAe;QAC7B,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,GAAG,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;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,6DAAW,CAAA;IACX,6DAAW,CAAA;IACX,iEAAa,CAAA;IACb,2DAAW,CAAA;IACX,qGAAsC,CAAA;IACtC,6FAAkC,CAAA;IAClC,uGAAuC,CAAA;IACvC,mGAAqC,CAAA;IACrC,+FAAmC,CAAA;IACnC,+FAAmC,CAAA;AACrC,CAAC,EAbW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAa3B;AAED,gBAAgB;AAChB,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,6DAAc,CAAA;IACd,uDAAW,CAAA;AACb,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AA0CD,cAAc;AACd,MAAa,YAAa,SAAQ,2BAAY;IAC5C,YAAmC,QAAa,EAAkB,OAAa,EAAE,EAAa;QAC5F,KAAK,CAAC,EAAE,IAAI,uBAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAD5C,aAAQ,GAAR,QAAQ,CAAK;QAAkB,YAAO,GAAP,OAAO,CAAM;IAE/E,CAAC;IACM,MAAM,CAAC,YAAY,CAAC,QAAa,EAAE,OAAa;QACrD,IAAK,QAAQ,CAAC,MAAiB,IAAK,gBAAgB,CAAC,KAAgB,EAAE;YACrE,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SAC3C;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,EAAE;YAC/C,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,uBAAQ,CAAC,mBAAmB,CAAC,CAAC;SACzE;IACH,CAAC;CACF;AAZD,oCAYC","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\nimport { BentleyError, CompressedId64Set, DbResult, Id64, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { Base64 } from \"js-base64\";\r\n\r\n/**\r\n * Specifies the format of the rows returned by the `query` and `restartQuery` methods of\r\n * [IModelConnection]($frontend), [IModelDb]($backend), and [ECDb]($backend).\r\n *\r\n * @public\r\n * @extensions\r\n */\r\nexport enum QueryRowFormat {\r\n /** Each row is an object in which each non-null column value can be accessed by its name as defined in the ECSql.\r\n * Null values are omitted.\r\n */\r\n UseECSqlPropertyNames,\r\n /** Each row is an array of values accessed by an index corresponding to the property's position in the ECSql SELECT statement.\r\n * Null values are included if they are followed by a non-null column, but trailing null values at the end of the array are omitted.\r\n */\r\n UseECSqlPropertyIndexes,\r\n /** Each row is an object in which each non-null column value can be accessed by a [remapped property name]($docs/learning/ECSqlRowFormat.md).\r\n * This format is backwards-compatible with the format produced by iTwin.js 2.x. Null values are omitted.\r\n */\r\n UseJsPropertyNames,\r\n}\r\n\r\n/**\r\n * Specify limit or range of rows to return\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryLimit {\r\n /** Number of rows to return */\r\n count?: number;\r\n /** Offset from which to return rows */\r\n offset?: number;\r\n}\r\n\r\n/** @public */\r\nexport interface QueryPropertyMetaData {\r\n className: string;\r\n generated: boolean;\r\n index: number;\r\n jsonName: string;\r\n name: string;\r\n extendType: string;\r\n typeName: string;\r\n}\r\n\r\n/** @beta */\r\nexport interface DbRuntimeStats {\r\n cpuTime: number;\r\n totalTime: number;\r\n timeLimit: number;\r\n memLimit: number;\r\n memUsed: number;\r\n}\r\n\r\n/**\r\n * Quota hint for the query.\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryQuota {\r\n /** Max time allowed in seconds. This is hint and may not be honoured but help in prioritize request */\r\n time?: number;\r\n /** Max memory allowed in bytes. This is hint and may not be honoured but help in prioritize request */\r\n memory?: number;\r\n}\r\n\r\n/**\r\n * Config for all request made to concurrent query engine.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BaseReaderOptions {\r\n /** Determine priority of this query default to 0, used as hint and can be overriden by backend. */\r\n priority?: number;\r\n /** If specified cancel last query (if any) with same restart token and queue the new query */\r\n restartToken?: string;\r\n /** For editing apps this can be set to true and all query will run on primary connection\r\n * his may cause slow queries execution but the most recent data changes will be visitable via query\r\n */\r\n usePrimaryConn?: boolean;\r\n /** Restrict time or memory for query but use as hint and may be changed base on backend settings */\r\n quota?: QueryQuota;\r\n /**\r\n * @internal\r\n * Allow query to be be deferred by milliseconds specified. This parameter is ignore by default unless\r\n * concurrent query is configure to honour it.\r\n */\r\n delay?: number;\r\n}\r\n\r\n/**\r\n * ECSql query config\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryOptions extends BaseReaderOptions {\r\n /**\r\n * default to false. It abbreviate blobs to single bytes. This help cases where wildcard is\r\n * used in select clause. Use BlobReader api to read individual blob specially if its of large size.\r\n * */\r\n abbreviateBlobs?: boolean;\r\n /**\r\n * default to false. It will suppress error and will not log it. Useful in cases where we expect query\r\n * can fail.\r\n */\r\n suppressLogErrors?: boolean;\r\n /** This is used internally. If true it query will return meta data about query. */\r\n includeMetaData?: boolean;\r\n /** Limit range of rows returned by query*/\r\n limit?: QueryLimit;\r\n /**\r\n * Convert ECClassId, SourceECClassId, TargetECClassId and RelClassId to respective name.\r\n * When true, XXXXClassId property will be returned as className.\r\n * */\r\n convertClassIdsToClassNames?: boolean;\r\n /**\r\n * Determine row format.\r\n */\r\n rowFormat?: QueryRowFormat;\r\n}\r\n/** @beta */\r\nexport type BlobRange = QueryLimit;\r\n\r\n/** @beta */\r\nexport interface BlobOptions extends BaseReaderOptions {\r\n range?: BlobRange;\r\n}\r\n\r\n/** @public */\r\nexport class QueryOptionsBuilder {\r\n public constructor(private _options: QueryOptions = {}) { }\r\n public getOptions(): QueryOptions { return this._options; }\r\n /**\r\n * @internal\r\n * Allow to set priority of query. Query will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\r\n * @param val integer value which can be negative as well. By default its zero.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setPriority(val: number) {\r\n this._options.priority = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set restart token. If restart token is set then any other query(s) in queue with same token is cancelled if its not already executed.\r\n * @param val A string token identifying a use case in which previous query with same token is cancelled.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setRestartToken(val: string) {\r\n this._options.restartToken = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set quota restriction for query. Its a hint and may be overriden or ignored by concurrent query manager.\r\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setQuota(val: QueryQuota) {\r\n this._options.quota = val;\r\n return this;\r\n }\r\n /**\r\n * Force a query to be executed synchronously against primary connection. This option is ignored if provided by frontend.\r\n * @param val A boolean value to force use primary connection on main thread to execute query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setUsePrimaryConnection(val: boolean) {\r\n this._options.usePrimaryConn = val;\r\n return this;\r\n }\r\n /**\r\n * By default all blobs are abbreviated to save memory and network bandwidth. If set to false, all blob data will be returned by query as is.\r\n * Use @type BlobReader to access blob data more efficiently.\r\n * @param val A boolean value, if set to false will return complete blob type property data. This could cost time and network bandwidth.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setAbbreviateBlobs(val: boolean) {\r\n this._options.abbreviateBlobs = val;\r\n return this;\r\n }\r\n /**\r\n * When query fail to prepare it will log error. This setting will suppress log errors in case where query come from user typing it and its expected to fail often.\r\n * @param val A boolean value, if set to true, any error logging will be suppressed.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setSuppressLogErrors(val: boolean) {\r\n this._options.suppressLogErrors = val;\r\n return this;\r\n }\r\n /**\r\n * If set ECClassId, SourceECClassId and TargetECClassId system properties will return qualified name of class instead of a @typedef Id64String.\r\n * @param val A boolean value.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setConvertClassIdsToNames(val: boolean) {\r\n this._options.convertClassIdsToClassNames = val;\r\n return this;\r\n }\r\n /**\r\n * Specify limit for query. Limit determine number of rows and offset in result-set.\r\n * @param val Specify count and offset from within the result-set of a ECSQL query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setLimit(val: QueryLimit) {\r\n this._options.limit = val;\r\n return this;\r\n }\r\n /**\r\n * Specify row format returned by concurrent query manager.\r\n * @param val @enum QueryRowFormat specifying format for result.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setRowFormat(val: QueryRowFormat) {\r\n this._options.rowFormat = val;\r\n return this;\r\n }\r\n /**\r\n * @internal\r\n * Defers execution of query in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\r\n * @param val Number of milliseconds.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setDelay(val: number) {\r\n this._options.delay = val;\r\n return this;\r\n }\r\n}\r\n/** @beta */\r\nexport class BlobOptionsBuilder {\r\n public constructor(private _options: BlobOptions = {}) { }\r\n public getOptions(): BlobOptions { return this._options; }\r\n /**\r\n * @internal\r\n * Allow to set priority of blob request. Blob request will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\r\n * @param val integer value which can be negative as well. By default its zero.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setPriority(val: number) {\r\n this._options.priority = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set restart token. If restart token is set then any other blob request in queue with same token is cancelled if its not already executed.\r\n * @param val A string token identifying a use case in which previous blob request with same token is cancelled.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setRestartToken(val: string) {\r\n this._options.restartToken = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set quota restriction for blob request. Its a hint and may be overriden or ignored by concurrent query manager.\r\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setQuota(val: QueryQuota) {\r\n this._options.quota = val;\r\n return this;\r\n }\r\n /**\r\n * Force a blob request to be executed synchronously against primary connection. This option is ignored if provided by frontend.\r\n * @param val A boolean value to force use primary connection on main thread to execute blob request.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setUsePrimaryConnection(val: boolean) {\r\n this._options.usePrimaryConn = val;\r\n return this;\r\n }\r\n /**\r\n * Specify range with in the blob that need to be returned.\r\n * @param val Specify offset and count of bytes that need to be returned.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setRange(val: BlobRange) {\r\n this._options.range = val;\r\n return this;\r\n }\r\n /**\r\n * @internal\r\n * Defers execution of blob request in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\r\n * @param val Number of milliseconds.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setDelay(val: number) {\r\n this._options.delay = val;\r\n return this;\r\n }\r\n}\r\n\r\n/** @internal */\r\nenum QueryParamType {\r\n Boolean = 0,\r\n Double = 1,\r\n Id = 2,\r\n IdSet = 3,\r\n Integer = 4,\r\n Long = 5,\r\n Null = 6,\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n Point2d = 7,\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n Point3d = 8,\r\n String = 9,\r\n Blob = 10,\r\n Struct = 11,\r\n}\r\n\r\n/**\r\n * Bind values to an ECSQL query.\r\n *\r\n * All binding class methods accept an `indexOrName` parameter as a `string | number` type and a value to bind to it.\r\n * A binding must be mapped either by a positional index or a string/name. See the examples below.\r\n *\r\n * @example\r\n * Parameter By Index:\r\n * ```sql\r\n * SELECT a, v FROM test.Foo WHERE a=? AND b=?\r\n * ```\r\n * The first `?` is index 1 and the second `?` is index 2. The parameter index starts with 1 and not 0.\r\n *\r\n * @example\r\n * Parameter By Name:\r\n * ```sql\r\n * SELECT a, v FROM test.Foo WHERE a=:name_a AND b=:name_b\r\n * ```\r\n * Using \"name_a\" as the `indexOrName` will bind the provided value to `name_a` in the query. And the same goes for\r\n * using \"name_b\" and the `name_b` binding respectively.\r\n *\r\n * @see\r\n * - [ECSQL Parameters]($docs/learning/ECSQL.md#ecsql-parameters)\r\n * - [ECSQL Parameter Types]($docs/learning/ECSQLParameterTypes)\r\n * - [ECSQL Code Examples]($docs/learning/backend/ECSQLCodeExamples#parameter-bindings)\r\n *\r\n * @public\r\n */\r\nexport class QueryBinder {\r\n private _args = {};\r\n private verify(indexOrName: string | number) {\r\n if (typeof indexOrName === \"number\") {\r\n if (indexOrName < 1)\r\n throw new Error(\"expect index to be >= 1\");\r\n }\r\n if (typeof indexOrName === \"string\") {\r\n if (!/^[a-zA-Z_]+\\w*$/i.test(indexOrName)) {\r\n throw new Error(\"expect named parameter to meet identifier specification\");\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Bind boolean value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Boolean value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindBoolean(indexOrName: string | number, val: boolean) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true,\r\n value: {\r\n type: QueryParamType.Boolean,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind blob value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Blob value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindBlob(indexOrName: string | number, val: Uint8Array) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n const base64 = Base64.fromUint8Array(val);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Blob,\r\n value: base64,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind double value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Double value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindDouble(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Double,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @typedef Id64String value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @typedef Id64String value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindId(indexOrName: string | number, val: Id64String) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Id,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type OrderedId64Iterable to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type OrderedId64Iterable value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindIdSet(indexOrName: string | number, val: OrderedId64Iterable) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n OrderedId64Iterable.uniqueIterator(val);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.IdSet,\r\n value: CompressedId64Set.sortAndCompress(OrderedId64Iterable.uniqueIterator(val)),\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind integer to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Integer value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindInt(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Integer,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind struct to ECSQL statement. Struct specified as object.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val struct value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindStruct(indexOrName: string | number, val: object) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Struct,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind long to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Long value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindLong(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Long,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind string to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val String value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindString(indexOrName: string | number, val: string) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.String,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind null to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindNull(indexOrName: string | number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Null,\r\n value: null,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type Point2d to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type Point2d value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindPoint2d(indexOrName: string | number, val: Point2d) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Point2d,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type Point3d to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type Point3d value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindPoint3d(indexOrName: string | number, val: Point3d) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Point3d,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n private static bind(params: QueryBinder, nameOrId: string | number, val: any) {\r\n if (typeof val === \"boolean\") {\r\n params.bindBoolean(nameOrId, val);\r\n } else if (typeof val === \"number\") {\r\n params.bindDouble(nameOrId, val);\r\n } else if (typeof val === \"string\") {\r\n params.bindString(nameOrId, val);\r\n } else if (val instanceof Uint8Array) {\r\n params.bindBlob(nameOrId, val);\r\n } else if (val instanceof Point2d) {\r\n params.bindPoint2d(nameOrId, val);\r\n } else if (val instanceof Point3d) {\r\n params.bindPoint3d(nameOrId, val);\r\n } else if (val instanceof Array && val.length > 0 && typeof val[0] === \"string\" && Id64.isValidId64(val[0])) {\r\n params.bindIdSet(nameOrId, val);\r\n } else if (typeof val === \"object\" && !Array.isArray(val)) {\r\n params.bindStruct(nameOrId, val);\r\n } else if (typeof val === \"undefined\" || val === null) {\r\n params.bindNull(nameOrId);\r\n } else {\r\n throw new Error(\"unsupported type\");\r\n }\r\n }\r\n\r\n /**\r\n * Allow bulk bind either parameters by index as value array or by parameter names as object.\r\n * @param args if array of values is provided then array index is used as index. If object is provided then object property name is used as parameter name of reach value.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public static from(args: any[] | object | undefined): QueryBinder {\r\n const params = new QueryBinder();\r\n if (typeof args === \"undefined\")\r\n return params;\r\n\r\n if (Array.isArray(args)) {\r\n let i = 1;\r\n for (const val of args) {\r\n this.bind(params, i++, val);\r\n }\r\n } else {\r\n for (const prop of Object.getOwnPropertyNames(args)) {\r\n this.bind(params, prop, (args as any)[prop]);\r\n }\r\n }\r\n return params;\r\n }\r\n\r\n public serialize(): object {\r\n return this._args;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport enum DbRequestKind {\r\n BlobIO = 0,\r\n ECSql = 1\r\n}\r\n\r\n/** @internal */\r\nexport enum DbResponseKind {\r\n BlobIO = DbRequestKind.BlobIO,\r\n ECSql = DbRequestKind.ECSql,\r\n NoResult = 2\r\n}\r\n\r\n/** @internal */\r\nexport enum DbResponseStatus {\r\n Done = 1, /* query ran to completion. */\r\n Cancel = 2, /* Requested by user.*/\r\n Partial = 3, /* query was running but ran out of quota.*/\r\n Timeout = 4, /* query time quota expired while it was in queue.*/\r\n QueueFull = 5, /* could not submit the query as queue was full.*/\r\n Error = 100, /* generic error*/\r\n Error_ECSql_PreparedFailed = Error + 1, /* ecsql prepared failed*/\r\n Error_ECSql_StepFailed = Error + 2, /* ecsql step failed*/\r\n Error_ECSql_RowToJsonFailed = Error + 3, /* ecsql failed to serialized row to json.*/\r\n Error_ECSql_BindingFailed = Error + 4, /* ecsql binding failed.*/\r\n Error_BlobIO_OpenFailed = Error + 5, /* class or property or instance specified was not found or property as not of type blob.*/\r\n Error_BlobIO_OutOfRange = Error + 6, /* range specified is invalid based on size of blob.*/\r\n}\r\n\r\n/** @internal */\r\nexport enum DbValueFormat {\r\n ECSqlNames = 0,\r\n JsNames = 1\r\n}\r\n\r\n/** @internal */\r\nexport interface DbRequest extends BaseReaderOptions {\r\n kind?: DbRequestKind;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryRequest extends DbRequest, QueryOptions {\r\n valueFormat?: DbValueFormat;\r\n query: string;\r\n args?: object;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbBlobRequest extends DbRequest, BlobOptions {\r\n className: string;\r\n accessString: string;\r\n instanceId: Id64String;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbResponse {\r\n stats: DbRuntimeStats;\r\n status: DbResponseStatus;\r\n kind: DbResponseKind;\r\n error?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryResponse extends DbResponse {\r\n meta: QueryPropertyMetaData[];\r\n data: any[];\r\n rowCount: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbBlobResponse extends DbResponse {\r\n data?: Uint8Array;\r\n rawBlobSize: number;\r\n}\r\n\r\n/** @public */\r\nexport class DbQueryError extends BentleyError {\r\n public constructor(public readonly response: any, public readonly request?: any, rc?: DbResult) {\r\n super(rc ?? DbResult.BE_SQLITE_ERROR, response.error, { response, request });\r\n }\r\n public static throwIfError(response: any, request?: any) {\r\n if ((response.status as number) >= (DbResponseStatus.Error as number)) {\r\n throw new DbQueryError(response, request);\r\n }\r\n if (response.status === DbResponseStatus.Cancel) {\r\n throw new DbQueryError(response, request, DbResult.BE_SQLITE_INTERRUPT);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface DbRequestExecutor<TRequest extends DbRequest, TResponse extends DbResponse> {\r\n execute(request: TRequest): Promise<TResponse>;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryConfig {\r\n globalQuota?: QueryQuota;\r\n ignoreDelay?: boolean;\r\n ignorePriority?: boolean;\r\n requestQueueSize?: number;\r\n workerThreads?: number;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/Conc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a,KAAb,qBAAa,QAGxB;AA0CD,cAAc;AACd,MAAa,YAAa,SAAQ,2BAAY;IAC5C,YAAmC,QAAa,EAAkB,OAAa,EAAE,EAAa;QAC5F,KAAK,CAAC,EAAE,IAAI,uBAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAD5C,aAAQ,GAAR,QAAQ,CAAK;QAAkB,YAAO,GAAP,OAAO,CAAM;IAE/E,CAAC;IACM,MAAM,CAAC,YAAY,CAAC,QAAa,EAAE,OAAa;QACrD,IAAK,QAAQ,CAAC,MAAiB,IAAK,gBAAgB,CAAC,KAAgB,EAAE;YACrE,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SAC3C;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,EAAE;YAC/C,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,uBAAQ,CAAC,mBAAmB,CAAC,CAAC;SACzE;IACH,CAAC;CACF;AAZD,oCAYC","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\nimport { BentleyError, CompressedId64Set, DbResult, Id64, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { Base64 } from \"js-base64\";\r\n\r\n/**\r\n * Specifies the format of the rows returned by the `query` and `restartQuery` methods of\r\n * [IModelConnection]($frontend), [IModelDb]($backend), and [ECDb]($backend).\r\n *\r\n * @public\r\n * @extensions\r\n */\r\nexport enum QueryRowFormat {\r\n /** Each row is an object in which each non-null column value can be accessed by its name as defined in the ECSql.\r\n * Null values are omitted.\r\n */\r\n UseECSqlPropertyNames,\r\n /** Each row is an array of values accessed by an index corresponding to the property's position in the ECSql SELECT statement.\r\n * Null values are included if they are followed by a non-null column, but trailing null values at the end of the array are omitted.\r\n */\r\n UseECSqlPropertyIndexes,\r\n /** Each row is an object in which each non-null column value can be accessed by a [remapped property name]($docs/learning/ECSqlRowFormat.md).\r\n * This format is backwards-compatible with the format produced by iTwin.js 2.x. Null values are omitted.\r\n */\r\n UseJsPropertyNames,\r\n}\r\n\r\n/**\r\n * Specify limit or range of rows to return\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryLimit {\r\n /** Number of rows to return */\r\n count?: number;\r\n /** Offset from which to return rows */\r\n offset?: number;\r\n}\r\n\r\n/** @public */\r\nexport interface QueryPropertyMetaData {\r\n className: string;\r\n generated: boolean;\r\n index: number;\r\n jsonName: string;\r\n name: string;\r\n extendType: string;\r\n typeName: string;\r\n}\r\n\r\n/** @beta */\r\nexport interface DbRuntimeStats {\r\n cpuTime: number;\r\n totalTime: number;\r\n timeLimit: number;\r\n memLimit: number;\r\n memUsed: number;\r\n}\r\n\r\n/**\r\n * Quota hint for the query.\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryQuota {\r\n /** Max time allowed in seconds. This is hint and may not be honoured but help in prioritize request */\r\n time?: number;\r\n /** Max memory allowed in bytes. This is hint and may not be honoured but help in prioritize request */\r\n memory?: number;\r\n}\r\n\r\n/**\r\n * Config for all request made to concurrent query engine.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BaseReaderOptions {\r\n /** Determine priority of this query default to 0, used as hint and can be overriden by backend. */\r\n priority?: number;\r\n /** If specified cancel last query (if any) with same restart token and queue the new query */\r\n restartToken?: string;\r\n /** For editing apps this can be set to true and all query will run on primary connection\r\n * his may cause slow queries execution but the most recent data changes will be visitable via query\r\n */\r\n usePrimaryConn?: boolean;\r\n /** Restrict time or memory for query but use as hint and may be changed base on backend settings */\r\n quota?: QueryQuota;\r\n /**\r\n * @internal\r\n * Allow query to be be deferred by milliseconds specified. This parameter is ignore by default unless\r\n * concurrent query is configure to honour it.\r\n */\r\n delay?: number;\r\n}\r\n\r\n/**\r\n * ECSql query config\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryOptions extends BaseReaderOptions {\r\n /**\r\n * default to false. It abbreviate blobs to single bytes. This help cases where wildcard is\r\n * used in select clause. Use BlobReader api to read individual blob specially if its of large size.\r\n * */\r\n abbreviateBlobs?: boolean;\r\n /**\r\n * default to false. It will suppress error and will not log it. Useful in cases where we expect query\r\n * can fail.\r\n */\r\n suppressLogErrors?: boolean;\r\n /** This is used internally. If true it query will return meta data about query. */\r\n includeMetaData?: boolean;\r\n /** Limit range of rows returned by query*/\r\n limit?: QueryLimit;\r\n /**\r\n * Convert ECClassId, SourceECClassId, TargetECClassId and RelClassId to respective name.\r\n * When true, XXXXClassId property will be returned as className.\r\n * */\r\n convertClassIdsToClassNames?: boolean;\r\n /**\r\n * Determine row format.\r\n */\r\n rowFormat?: QueryRowFormat;\r\n}\r\n/** @beta */\r\nexport type BlobRange = QueryLimit;\r\n\r\n/** @beta */\r\nexport interface BlobOptions extends BaseReaderOptions {\r\n range?: BlobRange;\r\n}\r\n\r\n/** @public */\r\nexport class QueryOptionsBuilder {\r\n public constructor(private _options: QueryOptions = {}) { }\r\n public getOptions(): QueryOptions { return this._options; }\r\n /**\r\n * @internal\r\n * Allow to set priority of query. Query will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\r\n * @param val integer value which can be negative as well. By default its zero.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setPriority(val: number) {\r\n this._options.priority = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set restart token. If restart token is set then any other query(s) in queue with same token is cancelled if its not already executed.\r\n * @param val A string token identifying a use case in which previous query with same token is cancelled.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setRestartToken(val: string) {\r\n this._options.restartToken = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set quota restriction for query. Its a hint and may be overriden or ignored by concurrent query manager.\r\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setQuota(val: QueryQuota) {\r\n this._options.quota = val;\r\n return this;\r\n }\r\n /**\r\n * Force a query to be executed synchronously against primary connection. This option is ignored if provided by frontend.\r\n * @param val A boolean value to force use primary connection on main thread to execute query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setUsePrimaryConnection(val: boolean) {\r\n this._options.usePrimaryConn = val;\r\n return this;\r\n }\r\n /**\r\n * By default all blobs are abbreviated to save memory and network bandwidth. If set to false, all blob data will be returned by query as is.\r\n * Use @type BlobReader to access blob data more efficiently.\r\n * @param val A boolean value, if set to false will return complete blob type property data. This could cost time and network bandwidth.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setAbbreviateBlobs(val: boolean) {\r\n this._options.abbreviateBlobs = val;\r\n return this;\r\n }\r\n /**\r\n * When query fail to prepare it will log error. This setting will suppress log errors in case where query come from user typing it and its expected to fail often.\r\n * @param val A boolean value, if set to true, any error logging will be suppressed.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setSuppressLogErrors(val: boolean) {\r\n this._options.suppressLogErrors = val;\r\n return this;\r\n }\r\n /**\r\n * If set ECClassId, SourceECClassId and TargetECClassId system properties will return qualified name of class instead of a @typedef Id64String.\r\n * @param val A boolean value.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setConvertClassIdsToNames(val: boolean) {\r\n this._options.convertClassIdsToClassNames = val;\r\n return this;\r\n }\r\n /**\r\n * Specify limit for query. Limit determine number of rows and offset in result-set.\r\n * @param val Specify count and offset from within the result-set of a ECSQL query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setLimit(val: QueryLimit) {\r\n this._options.limit = val;\r\n return this;\r\n }\r\n /**\r\n * Specify row format returned by concurrent query manager.\r\n * @param val @enum QueryRowFormat specifying format for result.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setRowFormat(val: QueryRowFormat) {\r\n this._options.rowFormat = val;\r\n return this;\r\n }\r\n /**\r\n * @internal\r\n * Defers execution of query in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\r\n * @param val Number of milliseconds.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setDelay(val: number) {\r\n this._options.delay = val;\r\n return this;\r\n }\r\n}\r\n/** @beta */\r\nexport class BlobOptionsBuilder {\r\n public constructor(private _options: BlobOptions = {}) { }\r\n public getOptions(): BlobOptions { return this._options; }\r\n /**\r\n * @internal\r\n * Allow to set priority of blob request. Blob request will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\r\n * @param val integer value which can be negative as well. By default its zero.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setPriority(val: number) {\r\n this._options.priority = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set restart token. If restart token is set then any other blob request in queue with same token is cancelled if its not already executed.\r\n * @param val A string token identifying a use case in which previous blob request with same token is cancelled.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setRestartToken(val: string) {\r\n this._options.restartToken = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set quota restriction for blob request. Its a hint and may be overriden or ignored by concurrent query manager.\r\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setQuota(val: QueryQuota) {\r\n this._options.quota = val;\r\n return this;\r\n }\r\n /**\r\n * Force a blob request to be executed synchronously against primary connection. This option is ignored if provided by frontend.\r\n * @param val A boolean value to force use primary connection on main thread to execute blob request.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setUsePrimaryConnection(val: boolean) {\r\n this._options.usePrimaryConn = val;\r\n return this;\r\n }\r\n /**\r\n * Specify range with in the blob that need to be returned.\r\n * @param val Specify offset and count of bytes that need to be returned.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setRange(val: BlobRange) {\r\n this._options.range = val;\r\n return this;\r\n }\r\n /**\r\n * @internal\r\n * Defers execution of blob request in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\r\n * @param val Number of milliseconds.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setDelay(val: number) {\r\n this._options.delay = val;\r\n return this;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport enum QueryParamType {\r\n Boolean = 0,\r\n Double = 1,\r\n Id = 2,\r\n IdSet = 3,\r\n Integer = 4,\r\n Long = 5,\r\n Null = 6,\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n Point2d = 7,\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n Point3d = 8,\r\n String = 9,\r\n Blob = 10,\r\n Struct = 11,\r\n}\r\n\r\n/**\r\n * Bind values to an ECSQL query.\r\n *\r\n * All binding class methods accept an `indexOrName` parameter as a `string | number` type and a value to bind to it.\r\n * A binding must be mapped either by a positional index or a string/name. See the examples below.\r\n *\r\n * @example\r\n * Parameter By Index:\r\n * ```sql\r\n * SELECT a, v FROM test.Foo WHERE a=? AND b=?\r\n * ```\r\n * The first `?` is index 1 and the second `?` is index 2. The parameter index starts with 1 and not 0.\r\n *\r\n * @example\r\n * Parameter By Name:\r\n * ```sql\r\n * SELECT a, v FROM test.Foo WHERE a=:name_a AND b=:name_b\r\n * ```\r\n * Using \"name_a\" as the `indexOrName` will bind the provided value to `name_a` in the query. And the same goes for\r\n * using \"name_b\" and the `name_b` binding respectively.\r\n *\r\n * @see\r\n * - [ECSQL Parameters]($docs/learning/ECSQL.md#ecsql-parameters)\r\n * - [ECSQL Parameter Types]($docs/learning/ECSQLParameterTypes)\r\n * - [ECSQL Code Examples]($docs/learning/backend/ECSQLCodeExamples#parameter-bindings)\r\n *\r\n * @public\r\n */\r\nexport class QueryBinder {\r\n private _args = {};\r\n private verify(indexOrName: string | number) {\r\n if (typeof indexOrName === \"number\") {\r\n if (indexOrName < 1)\r\n throw new Error(\"expect index to be >= 1\");\r\n return;\r\n }\r\n if (!/^[a-zA-Z_]+\\w*$/i.test(indexOrName)) {\r\n throw new Error(\"expect named parameter to meet identifier specification\");\r\n }\r\n }\r\n\r\n /**\r\n * Bind boolean value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Boolean value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindBoolean(indexOrName: string | number, val: boolean) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true,\r\n value: {\r\n type: QueryParamType.Boolean,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind blob value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Blob value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindBlob(indexOrName: string | number, val: Uint8Array) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n const base64 = Base64.fromUint8Array(val);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Blob,\r\n value: base64,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind double value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Double value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindDouble(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Double,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @typedef Id64String value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @typedef Id64String value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindId(indexOrName: string | number, val: Id64String) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Id,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type OrderedId64Iterable to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type OrderedId64Iterable value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindIdSet(indexOrName: string | number, val: OrderedId64Iterable) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n OrderedId64Iterable.uniqueIterator(val);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.IdSet,\r\n value: CompressedId64Set.sortAndCompress(OrderedId64Iterable.uniqueIterator(val)),\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind integer to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Integer value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindInt(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Integer,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind struct to ECSQL statement. Struct specified as object.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val struct value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindStruct(indexOrName: string | number, val: object) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Struct,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind long to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Long value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindLong(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Long,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind string to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val String value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindString(indexOrName: string | number, val: string) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.String,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind null to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindNull(indexOrName: string | number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Null,\r\n value: null,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type Point2d to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type Point2d value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindPoint2d(indexOrName: string | number, val: Point2d) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Point2d,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type Point3d to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type Point3d value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindPoint3d(indexOrName: string | number, val: Point3d) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Point3d,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n private static bind(params: QueryBinder, nameOrId: string | number, val: any) {\r\n if (typeof val === \"boolean\") {\r\n params.bindBoolean(nameOrId, val);\r\n } else if (typeof val === \"number\") {\r\n params.bindDouble(nameOrId, val);\r\n } else if (typeof val === \"string\") {\r\n params.bindString(nameOrId, val);\r\n } else if (val instanceof Uint8Array) {\r\n params.bindBlob(nameOrId, val);\r\n } else if (val instanceof Point2d) {\r\n params.bindPoint2d(nameOrId, val);\r\n } else if (val instanceof Point3d) {\r\n params.bindPoint3d(nameOrId, val);\r\n } else if (val instanceof Array && val.length > 0 && typeof val[0] === \"string\" && Id64.isValidId64(val[0])) {\r\n params.bindIdSet(nameOrId, val);\r\n } else if (typeof val === \"undefined\" || val === null) {\r\n params.bindNull(nameOrId);\r\n } else if (typeof val === \"object\" && !Array.isArray(val)) {\r\n params.bindStruct(nameOrId, val);\r\n } else {\r\n throw new Error(\"unsupported type\");\r\n }\r\n }\r\n\r\n /**\r\n * Allow bulk bind either parameters by index as value array or by parameter names as object.\r\n * @param args if array of values is provided then array index is used as index. If object is provided then object property name is used as parameter name of reach value.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public static from(args: any[] | object | undefined): QueryBinder {\r\n const params = new QueryBinder();\r\n if (typeof args === \"undefined\")\r\n return params;\r\n\r\n if (Array.isArray(args)) {\r\n let i = 1;\r\n for (const val of args) {\r\n this.bind(params, i++, val);\r\n }\r\n } else {\r\n for (const prop of Object.getOwnPropertyNames(args)) {\r\n this.bind(params, prop, (args as any)[prop]);\r\n }\r\n }\r\n return params;\r\n }\r\n\r\n public serialize(): object {\r\n return this._args;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport enum DbRequestKind {\r\n BlobIO = 0,\r\n ECSql = 1\r\n}\r\n\r\n/** @internal */\r\nexport enum DbResponseKind {\r\n BlobIO = DbRequestKind.BlobIO,\r\n ECSql = DbRequestKind.ECSql,\r\n NoResult = 2\r\n}\r\n\r\n/** @internal */\r\nexport enum DbResponseStatus {\r\n Done = 1, /* query ran to completion. */\r\n Cancel = 2, /* Requested by user.*/\r\n Partial = 3, /* query was running but ran out of quota.*/\r\n Timeout = 4, /* query time quota expired while it was in queue.*/\r\n QueueFull = 5, /* could not submit the query as queue was full.*/\r\n Error = 100, /* generic error*/\r\n Error_ECSql_PreparedFailed = Error + 1, /* ecsql prepared failed*/\r\n Error_ECSql_StepFailed = Error + 2, /* ecsql step failed*/\r\n Error_ECSql_RowToJsonFailed = Error + 3, /* ecsql failed to serialized row to json.*/\r\n Error_ECSql_BindingFailed = Error + 4, /* ecsql binding failed.*/\r\n Error_BlobIO_OpenFailed = Error + 5, /* class or property or instance specified was not found or property as not of type blob.*/\r\n Error_BlobIO_OutOfRange = Error + 6, /* range specified is invalid based on size of blob.*/\r\n}\r\n\r\n/** @internal */\r\nexport enum DbValueFormat {\r\n ECSqlNames = 0,\r\n JsNames = 1\r\n}\r\n\r\n/** @internal */\r\nexport interface DbRequest extends BaseReaderOptions {\r\n kind?: DbRequestKind;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryRequest extends DbRequest, QueryOptions {\r\n valueFormat?: DbValueFormat;\r\n query: string;\r\n args?: object;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbBlobRequest extends DbRequest, BlobOptions {\r\n className: string;\r\n accessString: string;\r\n instanceId: Id64String;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbResponse {\r\n stats: DbRuntimeStats;\r\n status: DbResponseStatus;\r\n kind: DbResponseKind;\r\n error?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryResponse extends DbResponse {\r\n meta: QueryPropertyMetaData[];\r\n data: any[];\r\n rowCount: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbBlobResponse extends DbResponse {\r\n data?: Uint8Array;\r\n rawBlobSize: number;\r\n}\r\n\r\n/** @public */\r\nexport class DbQueryError extends BentleyError {\r\n public constructor(public readonly response: any, public readonly request?: any, rc?: DbResult) {\r\n super(rc ?? DbResult.BE_SQLITE_ERROR, response.error, { response, request });\r\n }\r\n public static throwIfError(response: any, request?: any) {\r\n if ((response.status as number) >= (DbResponseStatus.Error as number)) {\r\n throw new DbQueryError(response, request);\r\n }\r\n if (response.status === DbResponseStatus.Cancel) {\r\n throw new DbQueryError(response, request, DbResult.BE_SQLITE_INTERRUPT);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface DbRequestExecutor<TRequest extends DbRequest, TResponse extends DbResponse> {\r\n execute(request: TRequest): Promise<TResponse>;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryConfig {\r\n globalQuota?: QueryQuota;\r\n ignoreDelay?: boolean;\r\n ignorePriority?: boolean;\r\n requestQueueSize?: number;\r\n workerThreads?: number;\r\n}\r\n"]}
|
|
@@ -101,6 +101,12 @@ export interface ImageMapLayerProps extends CommonMapLayerProps {
|
|
|
101
101
|
accessKey?: MapLayerKey;
|
|
102
102
|
/** @internal */
|
|
103
103
|
modelId?: never;
|
|
104
|
+
/** List of query parameters that will get appended to the source.
|
|
105
|
+
* @beta
|
|
106
|
+
*/
|
|
107
|
+
queryParams?: {
|
|
108
|
+
[key: string]: string;
|
|
109
|
+
};
|
|
104
110
|
}
|
|
105
111
|
/** JSON representation of a [[ModelMapLayerSettings]].
|
|
106
112
|
* @see [[MapImagerySettings]].
|
|
@@ -173,6 +179,19 @@ export declare class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
173
179
|
userName?: string;
|
|
174
180
|
password?: string;
|
|
175
181
|
accessKey?: MapLayerKey;
|
|
182
|
+
/** List of query parameters to append to the settings URL and persisted as part of the JSON representation.
|
|
183
|
+
* @note Sensitive information like user credentials should be provided in [[unsavedQueryParams]] to ensure it is never persisted.
|
|
184
|
+
* @beta
|
|
185
|
+
*/
|
|
186
|
+
savedQueryParams?: {
|
|
187
|
+
[key: string]: string;
|
|
188
|
+
};
|
|
189
|
+
/** List of query parameters that will get appended to the settings URL that should *not* be be persisted part of the JSON representation.
|
|
190
|
+
* @beta
|
|
191
|
+
*/
|
|
192
|
+
unsavedQueryParams?: {
|
|
193
|
+
[key: string]: string;
|
|
194
|
+
};
|
|
176
195
|
readonly subLayers: MapSubLayerSettings[];
|
|
177
196
|
get source(): string;
|
|
178
197
|
/** @internal */
|
|
@@ -201,6 +220,12 @@ export declare class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
201
220
|
/** @internal */
|
|
202
221
|
protected static mapTypeName(type: BackgroundMapType): "Aerial Imagery" | "Aerial Imagery with labels" | "Streets";
|
|
203
222
|
setCredentials(userName?: string, password?: string): void;
|
|
223
|
+
/** Collect all query parameters
|
|
224
|
+
* @beta
|
|
225
|
+
*/
|
|
226
|
+
collectQueryParams(): {
|
|
227
|
+
[key: string]: string;
|
|
228
|
+
};
|
|
204
229
|
}
|
|
205
230
|
/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
|
|
206
231
|
* Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettings.d.ts","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapLayerSettings.d.ts","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,iBAAiB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AmC;IACnB,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,oBAAoB;IAUrF,wDAAwD;WAC1C,YAAY,CAAC,QAAQ,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,oBAAoB;IA2D3I,gBAAgB;WACF,sBAAsB,CAAC,KAAK,EAAE,4BAA4B,GAAG,oBAAoB;IAI/F,aAAa;IACN,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,oBAAoB;CAGhF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable deprecation/deprecation */
|
|
2
3
|
/*---------------------------------------------------------------------------------------------
|
|
3
4
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
5
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -136,6 +137,9 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
136
137
|
this.formatId = props.formatId;
|
|
137
138
|
this.url = props.url;
|
|
138
139
|
this.accessKey = props.accessKey;
|
|
140
|
+
if (props.queryParams) {
|
|
141
|
+
this.savedQueryParams = { ...props.queryParams };
|
|
142
|
+
}
|
|
139
143
|
this.subLayers = [];
|
|
140
144
|
if (!props.subLayers)
|
|
141
145
|
return;
|
|
@@ -155,6 +159,8 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
155
159
|
props.formatId = this.formatId;
|
|
156
160
|
if (this.subLayers.length > 0)
|
|
157
161
|
props.subLayers = this.subLayers.map((x) => x.toJSON());
|
|
162
|
+
if (this.savedQueryParams)
|
|
163
|
+
props.queryParams = { ...this.savedQueryParams };
|
|
158
164
|
return props;
|
|
159
165
|
}
|
|
160
166
|
/** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
|
|
@@ -167,6 +173,10 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
167
173
|
clone.userName = this.userName;
|
|
168
174
|
clone.password = this.password;
|
|
169
175
|
clone.accessKey = this.accessKey;
|
|
176
|
+
if (this.unsavedQueryParams)
|
|
177
|
+
clone.unsavedQueryParams = { ...this.unsavedQueryParams };
|
|
178
|
+
if (this.savedQueryParams)
|
|
179
|
+
clone.savedQueryParams = { ...this.savedQueryParams };
|
|
170
180
|
return clone;
|
|
171
181
|
}
|
|
172
182
|
/** @internal */
|
|
@@ -176,6 +186,12 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
176
186
|
props.url = changedProps.url ?? this.url;
|
|
177
187
|
props.accessKey = changedProps.accessKey ?? this.accessKey;
|
|
178
188
|
props.subLayers = changedProps.subLayers ?? this.subLayers;
|
|
189
|
+
if (changedProps.queryParams) {
|
|
190
|
+
props.queryParams = { ...changedProps.queryParams };
|
|
191
|
+
}
|
|
192
|
+
else if (this.savedQueryParams) {
|
|
193
|
+
props.queryParams = { ...this.savedQueryParams };
|
|
194
|
+
}
|
|
179
195
|
return props;
|
|
180
196
|
}
|
|
181
197
|
/** @internal */
|
|
@@ -244,6 +260,17 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
244
260
|
this.userName = userName;
|
|
245
261
|
this.password = password;
|
|
246
262
|
}
|
|
263
|
+
/** Collect all query parameters
|
|
264
|
+
* @beta
|
|
265
|
+
*/
|
|
266
|
+
collectQueryParams() {
|
|
267
|
+
let queryParams = {};
|
|
268
|
+
if (this.savedQueryParams)
|
|
269
|
+
queryParams = { ...this.savedQueryParams };
|
|
270
|
+
if (this.unsavedQueryParams)
|
|
271
|
+
queryParams = { ...queryParams, ...this.unsavedQueryParams };
|
|
272
|
+
return queryParams;
|
|
273
|
+
}
|
|
247
274
|
}
|
|
248
275
|
exports.ImageMapLayerSettings = ImageMapLayerSettings;
|
|
249
276
|
/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
|
|
@@ -1 +1 @@
|
|
|
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E,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF;AAzHD,oDAyHC","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/** 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 /** 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 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\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\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 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 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 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 clone.accessKey = this.accessKey;\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\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\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 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) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\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);\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 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 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,4CAA4C;AAC5C;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AACzD,mEAA+G;AA2B/G;;;;;;;GAOG;AACH,MAAa,mBAAmB;IAc9B,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;QAC9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AAA,qBAAM,EAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;QAC/B,IAAA,qBAAM,EAAC,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,6CAAqB,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;AAzHD,oDAyHC","sourcesContent":["/* eslint-disable deprecation/deprecation */\r\n/*---------------------------------------------------------------------------------------------\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/** 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 /** 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 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}\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\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 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 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 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 clone.accessKey = this.accessKey;\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 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 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) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\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);\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 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 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"]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { Point3d, Range1d, Range1dProps, Vector3d, XYZProps } from "@itwin/core-geometry";
|
|
5
5
|
import { ColorDef, ColorDefProps } from "./ColorDef";
|
|
6
6
|
import { Gradient } from "./Gradient";
|
|
7
|
+
import { TextureTransparency } from "./TextureProps";
|
|
7
8
|
/** A thematic gradient mode used to generate and apply a thematic effect to a scene.
|
|
8
9
|
* @see [[ThematicGradientSettings.mode]]
|
|
9
10
|
* @public
|
|
@@ -19,6 +20,23 @@ export declare enum ThematicGradientMode {
|
|
|
19
20
|
/** Apply isolines to the scene to achieve an effect similar to a contour map. Can only be used with [[ThematicDisplayMode.Height]]. */
|
|
20
21
|
IsoLines = 3
|
|
21
22
|
}
|
|
23
|
+
/** Describes how transparency is computed when applying a thematic gradient to a surface.
|
|
24
|
+
* Each [[Gradient.KeyColor]] in [[ThematicGradientSettings.customKeys]] has a transparency value.
|
|
25
|
+
* Each surface to which the gradient is applied has its own transparency.
|
|
26
|
+
* The transparency mode determines how these two values are combined to compute the final transparency.
|
|
27
|
+
* @see [[ThematicGradientSettings.transparencyMode]].
|
|
28
|
+
* @public
|
|
29
|
+
* @extensions
|
|
30
|
+
*/
|
|
31
|
+
export declare enum ThematicGradientTransparencyMode {
|
|
32
|
+
/** Ignore the gradient's transparency, applying only the surface's own transparency. */
|
|
33
|
+
SurfaceOnly = 0,
|
|
34
|
+
/** The final transparency is computed from the product of the surface and gradient alpha channels.
|
|
35
|
+
* (Alpha is the inverse of transparency, where `alpha = (255 - transparency) / 255`).
|
|
36
|
+
* If the gradient color is opaque, this produces the same result as [[SurfaceOnly]].
|
|
37
|
+
*/
|
|
38
|
+
MultiplySurfaceAndGradient = 1
|
|
39
|
+
}
|
|
22
40
|
/** A color scheme used to generate the colors of a thematic gradient within an applied range.
|
|
23
41
|
* @see [[ThematicGradientSettings.colorScheme]]
|
|
24
42
|
* @see [[ThematicDisplay.range]]
|
|
@@ -58,6 +76,8 @@ export interface ThematicGradientSettingsProps {
|
|
|
58
76
|
customKeys?: Gradient.KeyColorProps[];
|
|
59
77
|
/** See [[ThematicGradientSettings.colorMix]]. */
|
|
60
78
|
colorMix?: number;
|
|
79
|
+
/** See [[ThematicGradientSettings.transparencyMode]]. */
|
|
80
|
+
transparencyMode?: ThematicGradientTransparencyMode;
|
|
61
81
|
}
|
|
62
82
|
/** Thematic settings specific to creating a color gradient used by [[ThematicDisplay]].
|
|
63
83
|
* @public
|
|
@@ -79,11 +99,18 @@ export declare class ThematicGradientSettings {
|
|
|
79
99
|
/** The percentage to mix in the original color with the thematic display gradient color (0-1).
|
|
80
100
|
* Applies to background map terrain and point clouds only. Defaults to 0. */
|
|
81
101
|
readonly colorMix: number;
|
|
102
|
+
/** Specifies how the transparency is computed. Defaults to [[ThematicGradientTransparencyMode.SurfaceOnly]].
|
|
103
|
+
* @note This property is ignored for gradients applied using an [[AnalysisStyle]] via [[AnalysisStyleThematic]] - in that case, only the color and
|
|
104
|
+
* transparency of the thematic gradient are applied.
|
|
105
|
+
*/
|
|
106
|
+
readonly transparencyMode: ThematicGradientTransparencyMode;
|
|
82
107
|
static get margin(): number;
|
|
83
108
|
static get contentRange(): number;
|
|
84
109
|
static get contentMax(): number;
|
|
85
110
|
static readonly defaults: ThematicGradientSettings;
|
|
86
111
|
private static _defaultCustomKeys;
|
|
112
|
+
/** @alpha */
|
|
113
|
+
get textureTransparency(): TextureTransparency;
|
|
87
114
|
equals(other: ThematicGradientSettings): boolean;
|
|
88
115
|
/** Compares two sets of thematic gradient settings.
|
|
89
116
|
* @param lhs First set of thematic gradient settings to compare
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThematicDisplay.d.ts","sourceRoot":"","sources":["../../src/ThematicDisplay.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ThematicDisplay.d.ts","sourceRoot":"","sources":["../../src/ThematicDisplay.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;GAIG;AACH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