@itwin/rpcinterface-full-stack-tests 5.1.0-dev.47 → 5.1.0-dev.51
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/lib/dist/bundled-tests.js +548 -31
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +14 -14
|
@@ -57722,22 +57722,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
57722
57722
|
var RealityDataProvider;
|
|
57723
57723
|
(function (RealityDataProvider) {
|
|
57724
57724
|
/**
|
|
57725
|
-
* This is the legacy mode where the access to the 3d tiles is
|
|
57726
|
-
* It was
|
|
57727
|
-
* You should use other
|
|
57725
|
+
* This is the legacy mode where the access to the 3d tiles is hardcoded in ContextRealityModelProps.tilesetUrl property.
|
|
57726
|
+
* It was used to support RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles
|
|
57727
|
+
* You should use other modes when possible
|
|
57728
57728
|
* @see [[RealityDataSource.createKeyFromUrl]] that will try to detect provider from an URL
|
|
57729
57729
|
*/
|
|
57730
57730
|
RealityDataProvider["TilesetUrl"] = "TilesetUrl";
|
|
57731
57731
|
/**
|
|
57732
|
-
* This is the legacy mode where the access to the 3d tiles is
|
|
57733
|
-
* It was
|
|
57734
|
-
* You should use other
|
|
57732
|
+
* This is the legacy mode where the access to the 3d tiles is hardcoded in ContextRealityModelProps.OrbitGtBlob property.
|
|
57733
|
+
* It was used to support OrbitPointCloud (OPC) from other server than ContextShare
|
|
57734
|
+
* You should use other modes when possible
|
|
57735
57735
|
* @see [[RealityDataSource.createKeyFromOrbitGtBlobProps]] that will try to detect provider from an URL
|
|
57736
57736
|
*/
|
|
57737
57737
|
RealityDataProvider["OrbitGtBlob"] = "OrbitGtBlob";
|
|
57738
57738
|
/**
|
|
57739
|
-
* Will provide access url from realityDataId and iTwinId on contextShare for 3dTile storage format or
|
|
57740
|
-
* This provider
|
|
57739
|
+
* Will provide access url from realityDataId and iTwinId on contextShare for 3dTile storage format or OPC storage format
|
|
57740
|
+
* This provider supports all types of 3dTile storage format and OrbitPointCloud: RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles, OPC
|
|
57741
57741
|
* @see [[RealityDataFormat]].
|
|
57742
57742
|
*/
|
|
57743
57743
|
RealityDataProvider["ContextShare"] = "ContextShare";
|
|
@@ -72977,6 +72977,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72977
72977
|
/* harmony export */ LineBreakRun: () => (/* binding */ LineBreakRun),
|
|
72978
72978
|
/* harmony export */ Paragraph: () => (/* binding */ Paragraph),
|
|
72979
72979
|
/* harmony export */ Run: () => (/* binding */ Run),
|
|
72980
|
+
/* harmony export */ TabRun: () => (/* binding */ TabRun),
|
|
72980
72981
|
/* harmony export */ TextBlock: () => (/* binding */ TextBlock),
|
|
72981
72982
|
/* harmony export */ TextBlockComponent: () => (/* binding */ TextBlockComponent),
|
|
72982
72983
|
/* harmony export */ TextRun: () => (/* binding */ TextRun)
|
|
@@ -73035,6 +73036,14 @@ class TextBlockComponent {
|
|
|
73035
73036
|
get overridesStyle() {
|
|
73036
73037
|
return Object.keys(this.styleOverrides).length > 0;
|
|
73037
73038
|
}
|
|
73039
|
+
/**
|
|
73040
|
+
* Returns true if the string representation of this component consists only of whitespace characters.
|
|
73041
|
+
* Useful for checking if the component is visually empty (producing no graphics) or contains only spaces, tabs, or line breaks.
|
|
73042
|
+
*/
|
|
73043
|
+
get isWhitespace() {
|
|
73044
|
+
return /^\s*$/g.test(this.stringify());
|
|
73045
|
+
}
|
|
73046
|
+
;
|
|
73038
73047
|
/** Convert this component to its JSON representation. */
|
|
73039
73048
|
toJSON() {
|
|
73040
73049
|
return {
|
|
@@ -73072,6 +73081,7 @@ var Run;
|
|
|
73072
73081
|
switch (props.type) {
|
|
73073
73082
|
case "text": return TextRun.create(props);
|
|
73074
73083
|
case "fraction": return FractionRun.create(props);
|
|
73084
|
+
case "tab": return TabRun.create(props);
|
|
73075
73085
|
case "linebreak": return LineBreakRun.create(props);
|
|
73076
73086
|
}
|
|
73077
73087
|
}
|
|
@@ -73182,6 +73192,40 @@ class LineBreakRun extends TextBlockComponent {
|
|
|
73182
73192
|
return other instanceof LineBreakRun && super.equals(other);
|
|
73183
73193
|
}
|
|
73184
73194
|
}
|
|
73195
|
+
/** A [[TabRun]] is used to shift the next tab stop.
|
|
73196
|
+
* @note Only left-justified tabs are supported at this tab.
|
|
73197
|
+
* @beta
|
|
73198
|
+
*/
|
|
73199
|
+
class TabRun extends TextBlockComponent {
|
|
73200
|
+
/** Discriminator field for the [[Run]] union. */
|
|
73201
|
+
type = "tab";
|
|
73202
|
+
toJSON() {
|
|
73203
|
+
return {
|
|
73204
|
+
...super.toJSON(),
|
|
73205
|
+
type: "tab",
|
|
73206
|
+
};
|
|
73207
|
+
}
|
|
73208
|
+
clone() {
|
|
73209
|
+
return new TabRun(this.toJSON());
|
|
73210
|
+
}
|
|
73211
|
+
static create(props) {
|
|
73212
|
+
return new TabRun(props);
|
|
73213
|
+
}
|
|
73214
|
+
/**
|
|
73215
|
+
* Converts a [[TabRun]] to its string representation.
|
|
73216
|
+
* If the `tabsAsSpaces` option is provided, returns a string of spaces of the specified length.
|
|
73217
|
+
* Otherwise, returns a tab character ("\t").
|
|
73218
|
+
*/
|
|
73219
|
+
stringify(options) {
|
|
73220
|
+
if (options?.tabsAsSpaces) {
|
|
73221
|
+
return " ".repeat(options.tabsAsSpaces);
|
|
73222
|
+
}
|
|
73223
|
+
return "\t";
|
|
73224
|
+
}
|
|
73225
|
+
equals(other) {
|
|
73226
|
+
return other instanceof TabRun && super.equals(other);
|
|
73227
|
+
}
|
|
73228
|
+
}
|
|
73185
73229
|
/** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.
|
|
73186
73230
|
* @beta
|
|
73187
73231
|
*/
|
|
@@ -73406,7 +73450,7 @@ class TextStyleSettings {
|
|
|
73406
73450
|
*/
|
|
73407
73451
|
fontName;
|
|
73408
73452
|
/** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.
|
|
73409
|
-
* For example, the height and offset from baseline of a subscript [[TextRun]] are
|
|
73453
|
+
* For example, the height and offset from baseline of a subscript [[TextRun]] are computed as lineHeight * [[subScriptScale]] and
|
|
73410
73454
|
* lineHeight * [[subScriptOffsetFactor]], respectively.
|
|
73411
73455
|
*/
|
|
73412
73456
|
lineHeight;
|
|
@@ -73444,6 +73488,10 @@ class TextStyleSettings {
|
|
|
73444
73488
|
superScriptScale;
|
|
73445
73489
|
/** Multiplier used to compute the width of each glyph, relative to [[lineHeight]]. */
|
|
73446
73490
|
widthFactor;
|
|
73491
|
+
/** The size (in meters) used to calculate the tab stops in a run.
|
|
73492
|
+
* These are equally spaced from the left edge of the TextBlock. Default is 4 meters.
|
|
73493
|
+
*/
|
|
73494
|
+
tabInterval;
|
|
73447
73495
|
/** A fully-populated JSON representation of the default settings. */
|
|
73448
73496
|
static defaultProps = {
|
|
73449
73497
|
color: "subcategory",
|
|
@@ -73460,6 +73508,7 @@ class TextStyleSettings {
|
|
|
73460
73508
|
superScriptOffsetFactor: 0.5,
|
|
73461
73509
|
superScriptScale: 2 / 3,
|
|
73462
73510
|
widthFactor: 1,
|
|
73511
|
+
tabInterval: 4,
|
|
73463
73512
|
};
|
|
73464
73513
|
/** Settings initialized to all default values. */
|
|
73465
73514
|
static defaults = new TextStyleSettings({});
|
|
@@ -73481,6 +73530,7 @@ class TextStyleSettings {
|
|
|
73481
73530
|
this.superScriptOffsetFactor = props.superScriptOffsetFactor ?? defaults.superScriptOffsetFactor;
|
|
73482
73531
|
this.superScriptScale = props.superScriptScale ?? defaults.superScriptScale;
|
|
73483
73532
|
this.widthFactor = props.widthFactor ?? defaults.widthFactor;
|
|
73533
|
+
this.tabInterval = props.tabInterval ?? defaults.tabInterval;
|
|
73484
73534
|
}
|
|
73485
73535
|
/** Create a copy of these settings, modified according to the properties defined by `alteredProps`. */
|
|
73486
73536
|
clone(alteredProps) {
|
|
@@ -73499,7 +73549,8 @@ class TextStyleSettings {
|
|
|
73499
73549
|
&& this.isBold === other.isBold && this.isItalic === other.isItalic && this.isUnderlined === other.isUnderlined
|
|
73500
73550
|
&& this.stackedFractionType === other.stackedFractionType && this.stackedFractionScale === other.stackedFractionScale
|
|
73501
73551
|
&& this.subScriptOffsetFactor === other.subScriptOffsetFactor && this.subScriptScale === other.subScriptScale
|
|
73502
|
-
&& this.superScriptOffsetFactor === other.superScriptOffsetFactor && this.superScriptScale === other.superScriptScale
|
|
73552
|
+
&& this.superScriptOffsetFactor === other.superScriptOffsetFactor && this.superScriptScale === other.superScriptScale
|
|
73553
|
+
&& this.tabInterval === other.tabInterval;
|
|
73503
73554
|
}
|
|
73504
73555
|
}
|
|
73505
73556
|
Object.freeze(TextStyleSettings.defaultProps);
|
|
@@ -73855,6 +73906,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
73855
73906
|
/* harmony export */ SubCategoryAppearance: () => (/* reexport safe */ _SubCategoryAppearance__WEBPACK_IMPORTED_MODULE_107__.SubCategoryAppearance),
|
|
73856
73907
|
/* harmony export */ SubCategoryOverride: () => (/* reexport safe */ _SubCategoryOverride__WEBPACK_IMPORTED_MODULE_108__.SubCategoryOverride),
|
|
73857
73908
|
/* harmony export */ SyncMode: () => (/* reexport safe */ _BriefcaseTypes__WEBPACK_IMPORTED_MODULE_12__.SyncMode),
|
|
73909
|
+
/* harmony export */ TabRun: () => (/* reexport safe */ _annotation_TextBlock__WEBPACK_IMPORTED_MODULE_3__.TabRun),
|
|
73858
73910
|
/* harmony export */ TerrainHeightOriginMode: () => (/* reexport safe */ _TerrainSettings__WEBPACK_IMPORTED_MODULE_110__.TerrainHeightOriginMode),
|
|
73859
73911
|
/* harmony export */ TerrainSettings: () => (/* reexport safe */ _TerrainSettings__WEBPACK_IMPORTED_MODULE_110__.TerrainSettings),
|
|
73860
73912
|
/* harmony export */ TestRpcManager: () => (/* reexport safe */ _rpc_TestRpcManager__WEBPACK_IMPORTED_MODULE_140__.TestRpcManager),
|
|
@@ -95467,12 +95519,14 @@ class EntityClass extends _Class__WEBPACK_IMPORTED_MODULE_4__.ECClass {
|
|
|
95467
95519
|
const mixinSchemaItemKey = this.schema.getSchemaItemKey(name);
|
|
95468
95520
|
if (!mixinSchemaItemKey)
|
|
95469
95521
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin ("${name}") that cannot be found.`);
|
|
95470
|
-
this._mixins.
|
|
95471
|
-
|
|
95472
|
-
|
|
95473
|
-
|
|
95474
|
-
|
|
95475
|
-
|
|
95522
|
+
if (!this._mixins.find((value) => mixinSchemaItemKey.matchesFullName(value.fullName))) {
|
|
95523
|
+
this._mixins.push(new _DelayedPromise__WEBPACK_IMPORTED_MODULE_0__.DelayedPromiseWithProps(mixinSchemaItemKey, async () => {
|
|
95524
|
+
const mixin = await this.schema.lookupItem(mixinSchemaItemKey, _Mixin__WEBPACK_IMPORTED_MODULE_5__.Mixin);
|
|
95525
|
+
if (undefined === mixin)
|
|
95526
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin ("${name}") that cannot be found.`);
|
|
95527
|
+
return mixin;
|
|
95528
|
+
}));
|
|
95529
|
+
}
|
|
95476
95530
|
}
|
|
95477
95531
|
}
|
|
95478
95532
|
}
|
|
@@ -113374,7 +113428,7 @@ class IModelApp {
|
|
|
113374
113428
|
/** The [[TerrainProviderRegistry]] for this session. */
|
|
113375
113429
|
static get terrainProviderRegistry() { return this._terrainProviderRegistry; }
|
|
113376
113430
|
/** The [[RealityDataSourceProviderRegistry]] for this session.
|
|
113377
|
-
* @
|
|
113431
|
+
* @beta
|
|
113378
113432
|
*/
|
|
113379
113433
|
static get realityDataSourceProviders() { return this._realityDataSourceProviders; }
|
|
113380
113434
|
/** The [[RenderSystem]] for this session. */
|
|
@@ -117474,9 +117528,11 @@ class PlanarClipMaskState {
|
|
|
117474
117528
|
"use strict";
|
|
117475
117529
|
__webpack_require__.r(__webpack_exports__);
|
|
117476
117530
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
117531
|
+
/* harmony export */ Google3dTilesProvider: () => (/* binding */ Google3dTilesProvider),
|
|
117477
117532
|
/* harmony export */ RealityDataError: () => (/* binding */ RealityDataError),
|
|
117478
117533
|
/* harmony export */ RealityDataSource: () => (/* binding */ RealityDataSource),
|
|
117479
|
-
/* harmony export */ RealityDataSourceProviderRegistry: () => (/* binding */ RealityDataSourceProviderRegistry)
|
|
117534
|
+
/* harmony export */ RealityDataSourceProviderRegistry: () => (/* binding */ RealityDataSourceProviderRegistry),
|
|
117535
|
+
/* harmony export */ getGoogle3dTilesUrl: () => (/* binding */ getGoogle3dTilesUrl)
|
|
117480
117536
|
/* harmony export */ });
|
|
117481
117537
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
117482
117538
|
/* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
@@ -117485,7 +117541,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
117485
117541
|
/* harmony import */ var _RealityDataSourceTilesetUrlImpl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RealityDataSourceTilesetUrlImpl */ "../../core/frontend/lib/esm/RealityDataSourceTilesetUrlImpl.js");
|
|
117486
117542
|
/* harmony import */ var _RealityDataSourceContextShareImpl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RealityDataSourceContextShareImpl */ "../../core/frontend/lib/esm/RealityDataSourceContextShareImpl.js");
|
|
117487
117543
|
/* harmony import */ var _RealityDataSourceCesiumIonAssetImpl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./RealityDataSourceCesiumIonAssetImpl */ "../../core/frontend/lib/esm/RealityDataSourceCesiumIonAssetImpl.js");
|
|
117488
|
-
/* harmony import */ var
|
|
117544
|
+
/* harmony import */ var _internal_RealityDataSourceGoogle3dTilesImpl__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./internal/RealityDataSourceGoogle3dTilesImpl */ "../../core/frontend/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.js");
|
|
117545
|
+
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
117546
|
+
/* harmony import */ var _internal_GoogleMapsDecorator__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./internal/GoogleMapsDecorator */ "../../core/frontend/lib/esm/internal/GoogleMapsDecorator.js");
|
|
117489
117547
|
/*---------------------------------------------------------------------------------------------
|
|
117490
117548
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
117491
117549
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -117501,6 +117559,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
117501
117559
|
|
|
117502
117560
|
|
|
117503
117561
|
|
|
117562
|
+
|
|
117563
|
+
|
|
117504
117564
|
const loggerCategory = _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.FrontendLoggerCategory.RealityData;
|
|
117505
117565
|
/**
|
|
117506
117566
|
* Reality Data Operation error
|
|
@@ -117598,7 +117658,7 @@ var RealityDataSource;
|
|
|
117598
117658
|
* @alpha
|
|
117599
117659
|
*/
|
|
117600
117660
|
async function fromKey(key, iTwinId) {
|
|
117601
|
-
const provider =
|
|
117661
|
+
const provider = _IModelApp__WEBPACK_IMPORTED_MODULE_8__.IModelApp.realityDataSourceProviders.find(key.provider);
|
|
117602
117662
|
if (!provider) {
|
|
117603
117663
|
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(loggerCategory, `RealityDataSourceProvider "${key.provider}" is not registered`);
|
|
117604
117664
|
return undefined;
|
|
@@ -117609,8 +117669,8 @@ var RealityDataSource;
|
|
|
117609
117669
|
})(RealityDataSource || (RealityDataSource = {}));
|
|
117610
117670
|
/** A registry of [[RealityDataSourceProvider]]s identified by their unique names. The registry can be accessed via [[IModelApp.realityDataSourceProviders]].
|
|
117611
117671
|
* It includes a handful of built-in providers for sources like Cesium ION, ContextShare, OrbitGT, and arbitrary public-accessible URLs.
|
|
117612
|
-
* Any number of additional providers can be registered. They should typically be registered just after [[
|
|
117613
|
-
* @
|
|
117672
|
+
* Any number of additional providers can be registered. They should typically be registered just after [[IModelApp.startup]].
|
|
117673
|
+
* @beta
|
|
117614
117674
|
*/
|
|
117615
117675
|
class RealityDataSourceProviderRegistry {
|
|
117616
117676
|
_providers = new Map();
|
|
@@ -117639,6 +117699,78 @@ class RealityDataSourceProviderRegistry {
|
|
|
117639
117699
|
return this._providers.get(name);
|
|
117640
117700
|
}
|
|
117641
117701
|
}
|
|
117702
|
+
/**
|
|
117703
|
+
* Will provide Google Photorealistic 3D Tiles (in 3dTile format).
|
|
117704
|
+
* A valid API key or getAuthToken fuction must be supplied when creating this provider.
|
|
117705
|
+
* To use this provider, you must register it with [[IModelApp.realityDataSourceProviders]].
|
|
117706
|
+
* Example usage:
|
|
117707
|
+
* ```ts
|
|
117708
|
+
* [[include:GooglePhotorealistic3dTiles_providerApiKey]]
|
|
117709
|
+
* ```
|
|
117710
|
+
* @see [Google Photorealistic 3D Tiles]($docs/learning/frontend/GooglePhotorealistic3dTiles.md)
|
|
117711
|
+
* @beta
|
|
117712
|
+
*/
|
|
117713
|
+
class Google3dTilesProvider {
|
|
117714
|
+
/** Google Map Tiles API Key used to access Google 3D Tiles. */
|
|
117715
|
+
_apiKey;
|
|
117716
|
+
/** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the "Bearer" prefix. */
|
|
117717
|
+
_getAuthToken;
|
|
117718
|
+
/** Decorator for Google Maps logos. */
|
|
117719
|
+
_decorator;
|
|
117720
|
+
/** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */
|
|
117721
|
+
useCachedDecorations = true;
|
|
117722
|
+
async createRealityDataSource(key, iTwinId) {
|
|
117723
|
+
if (!this._apiKey && !this._getAuthToken) {
|
|
117724
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(loggerCategory, "Either an API key or getAuthToken function are required to create a Google3dTilesProvider.");
|
|
117725
|
+
return undefined;
|
|
117726
|
+
}
|
|
117727
|
+
return _internal_RealityDataSourceGoogle3dTilesImpl__WEBPACK_IMPORTED_MODULE_7__.RealityDataSourceGoogle3dTilesImpl.createFromKey(key, iTwinId, this._apiKey, this._getAuthToken);
|
|
117728
|
+
}
|
|
117729
|
+
constructor(options) {
|
|
117730
|
+
this._apiKey = options.apiKey;
|
|
117731
|
+
this._getAuthToken = options.getAuthToken;
|
|
117732
|
+
this._decorator = new _internal_GoogleMapsDecorator__WEBPACK_IMPORTED_MODULE_9__.GoogleMapsDecorator(options.showCreditsOnScreen ?? true);
|
|
117733
|
+
}
|
|
117734
|
+
/**
|
|
117735
|
+
* Initialize the Google 3D Tiles reality data source provider by activating its decorator, which consists of loading the correct Google Maps logo.
|
|
117736
|
+
* @returns `true` if the decorator was successfully activated, otherwise `false`.
|
|
117737
|
+
*/
|
|
117738
|
+
async initialize() {
|
|
117739
|
+
const isActivated = await this._decorator.activate("satellite");
|
|
117740
|
+
if (!isActivated) {
|
|
117741
|
+
const msg = "Failed to activate decorator";
|
|
117742
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(loggerCategory, msg);
|
|
117743
|
+
throw new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.ERROR, msg);
|
|
117744
|
+
}
|
|
117745
|
+
return isActivated;
|
|
117746
|
+
}
|
|
117747
|
+
decorate(_context) {
|
|
117748
|
+
this._decorator.decorate(_context);
|
|
117749
|
+
}
|
|
117750
|
+
async addAttributions(cards, vp) {
|
|
117751
|
+
const copyrightMap = (0,_internal_GoogleMapsDecorator__WEBPACK_IMPORTED_MODULE_9__.getCopyrights)(vp);
|
|
117752
|
+
// Only add another logo card if the tiles have copyright
|
|
117753
|
+
if (copyrightMap.size > 0) {
|
|
117754
|
+
// Order by most occurances to least
|
|
117755
|
+
// See https://developers.google.com/maps/documentation/tile/create-renderer#display-attributions
|
|
117756
|
+
const sortedCopyrights = [...copyrightMap.entries()].sort((a, b) => b[1] - a[1]);
|
|
117757
|
+
let copyrightMsg = "Data provided by:<br><ul>";
|
|
117758
|
+
copyrightMsg += sortedCopyrights.map(([key]) => `<li>${key}</li>`).join("");
|
|
117759
|
+
copyrightMsg += "</ul>";
|
|
117760
|
+
cards.appendChild(_IModelApp__WEBPACK_IMPORTED_MODULE_8__.IModelApp.makeLogoCard({
|
|
117761
|
+
iconSrc: `${_IModelApp__WEBPACK_IMPORTED_MODULE_8__.IModelApp.publicPath}images/google_on_white_hdpi.png`,
|
|
117762
|
+
heading: "Google Photorealistic 3D Tiles",
|
|
117763
|
+
notice: copyrightMsg
|
|
117764
|
+
}));
|
|
117765
|
+
}
|
|
117766
|
+
}
|
|
117767
|
+
}
|
|
117768
|
+
/** Returns the URL used for retrieving Google Photorealistic 3D Tiles.
|
|
117769
|
+
* @beta
|
|
117770
|
+
*/
|
|
117771
|
+
function getGoogle3dTilesUrl() {
|
|
117772
|
+
return "https://tile.googleapis.com/v1/3dtiles/root.json";
|
|
117773
|
+
}
|
|
117642
117774
|
|
|
117643
117775
|
|
|
117644
117776
|
/***/ }),
|
|
@@ -118145,7 +118277,7 @@ class RealityDataSourceTilesetUrlImpl {
|
|
|
118145
118277
|
// otherwise the full path to root document is given.
|
|
118146
118278
|
// The base URL contains the base URL from which tile relative path are constructed.
|
|
118147
118279
|
// The tile's path root will need to be reinserted for child tiles to return a 200
|
|
118148
|
-
// If the original url includes search paramaters, they are stored in _searchParams to be reinserted into child tile requests.
|
|
118280
|
+
// If the original root tileset url includes search paramaters, they are stored in _searchParams to be reinserted into child tile requests.
|
|
118149
118281
|
setBaseUrl(url) {
|
|
118150
118282
|
const urlParts = url.split("/");
|
|
118151
118283
|
const newUrl = new URL(url);
|
|
@@ -136765,6 +136897,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
136765
136897
|
/* harmony export */ GlobeAnimator: () => (/* reexport safe */ _GlobeAnimator__WEBPACK_IMPORTED_MODULE_28__.GlobeAnimator),
|
|
136766
136898
|
/* harmony export */ GltfDataType: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__.GltfDataType),
|
|
136767
136899
|
/* harmony export */ GltfReader: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__.GltfReader),
|
|
136900
|
+
/* harmony export */ Google3dTilesProvider: () => (/* reexport safe */ _RealityDataSource__WEBPACK_IMPORTED_MODULE_121__.Google3dTilesProvider),
|
|
136901
|
+
/* harmony export */ GoogleMapsDecorator: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__.GoogleMapsDecorator),
|
|
136768
136902
|
/* harmony export */ GraphicAssembler: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_10__.GraphicAssembler),
|
|
136769
136903
|
/* harmony export */ GraphicBranch: () => (/* reexport safe */ _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_82__.GraphicBranch),
|
|
136770
136904
|
/* harmony export */ GraphicBuilder: () => (/* reexport safe */ _render_GraphicBuilder__WEBPACK_IMPORTED_MODULE_83__.GraphicBuilder),
|
|
@@ -136813,6 +136947,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
136813
136947
|
/* harmony export */ LocateOptions: () => (/* reexport safe */ _ElementLocateManager__WEBPACK_IMPORTED_MODULE_17__.LocateOptions),
|
|
136814
136948
|
/* harmony export */ LocateResponse: () => (/* reexport safe */ _ElementLocateManager__WEBPACK_IMPORTED_MODULE_17__.LocateResponse),
|
|
136815
136949
|
/* harmony export */ LockedStates: () => (/* reexport safe */ _AccuDraw__WEBPACK_IMPORTED_MODULE_0__.LockedStates),
|
|
136950
|
+
/* harmony export */ LogoDecoration: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__.LogoDecoration),
|
|
136816
136951
|
/* harmony export */ LookAndMoveTool: () => (/* reexport safe */ _tools_ViewTool__WEBPACK_IMPORTED_MODULE_114__.LookAndMoveTool),
|
|
136817
136952
|
/* harmony export */ LookViewTool: () => (/* reexport safe */ _tools_ViewTool__WEBPACK_IMPORTED_MODULE_114__.LookViewTool),
|
|
136818
136953
|
/* harmony export */ ManipulatorToolEvent: () => (/* reexport safe */ _tools_ToolAdmin__WEBPACK_IMPORTED_MODULE_112__.ManipulatorToolEvent),
|
|
@@ -137048,6 +137183,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
137048
137183
|
/* harmony export */ getCesiumAssetUrl: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_99__.getCesiumAssetUrl),
|
|
137049
137184
|
/* harmony export */ getCompressedJpegFromCanvas: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_10__.getCompressedJpegFromCanvas),
|
|
137050
137185
|
/* harmony export */ getFrustumPlaneIntersectionDepthRange: () => (/* reexport safe */ _BackgroundMapGeometry__WEBPACK_IMPORTED_MODULE_116__.getFrustumPlaneIntersectionDepthRange),
|
|
137186
|
+
/* harmony export */ getGoogle3dTilesUrl: () => (/* reexport safe */ _RealityDataSource__WEBPACK_IMPORTED_MODULE_121__.getGoogle3dTilesUrl),
|
|
137051
137187
|
/* harmony export */ getImageSourceFormatForMimeType: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_10__.getImageSourceFormatForMimeType),
|
|
137052
137188
|
/* harmony export */ getImageSourceMimeType: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_10__.getImageSourceMimeType),
|
|
137053
137189
|
/* harmony export */ getQuantityTypeKey: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.getQuantityTypeKey),
|
|
@@ -138061,6 +138197,366 @@ class RemoteExtensionProvider {
|
|
|
138061
138197
|
}
|
|
138062
138198
|
|
|
138063
138199
|
|
|
138200
|
+
/***/ }),
|
|
138201
|
+
|
|
138202
|
+
/***/ "../../core/frontend/lib/esm/internal/GoogleMapsDecorator.js":
|
|
138203
|
+
/*!*******************************************************************!*\
|
|
138204
|
+
!*** ../../core/frontend/lib/esm/internal/GoogleMapsDecorator.js ***!
|
|
138205
|
+
\*******************************************************************/
|
|
138206
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
138207
|
+
|
|
138208
|
+
"use strict";
|
|
138209
|
+
__webpack_require__.r(__webpack_exports__);
|
|
138210
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
138211
|
+
/* harmony export */ GoogleMapsDecorator: () => (/* binding */ GoogleMapsDecorator),
|
|
138212
|
+
/* harmony export */ LogoDecoration: () => (/* binding */ LogoDecoration),
|
|
138213
|
+
/* harmony export */ getCopyrights: () => (/* binding */ getCopyrights)
|
|
138214
|
+
/* harmony export */ });
|
|
138215
|
+
/* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
|
|
138216
|
+
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
138217
|
+
/* harmony import */ var _Sprites__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Sprites */ "../../core/frontend/lib/esm/Sprites.js");
|
|
138218
|
+
/*---------------------------------------------------------------------------------------------
|
|
138219
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
138220
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
138221
|
+
*--------------------------------------------------------------------------------------------*/
|
|
138222
|
+
|
|
138223
|
+
|
|
138224
|
+
|
|
138225
|
+
/** A simple decorator that shows the logo at a given screen position.
|
|
138226
|
+
* @internal
|
|
138227
|
+
*/
|
|
138228
|
+
class LogoDecoration {
|
|
138229
|
+
_sprite;
|
|
138230
|
+
/** The current position of the logo in view coordinates. */
|
|
138231
|
+
position = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Point3d();
|
|
138232
|
+
_offset;
|
|
138233
|
+
set offset(offset) {
|
|
138234
|
+
this._offset = offset;
|
|
138235
|
+
}
|
|
138236
|
+
/** The logo offset in view coordinates.*/
|
|
138237
|
+
get offset() {
|
|
138238
|
+
return this._offset;
|
|
138239
|
+
}
|
|
138240
|
+
/** Move the logo to the lower left corner of the screen. */
|
|
138241
|
+
moveToLowerLeftCorner(context) {
|
|
138242
|
+
if (!this._sprite || !this._sprite.isLoaded)
|
|
138243
|
+
return false;
|
|
138244
|
+
this.position.x = this._offset?.x ?? 0;
|
|
138245
|
+
this.position.y = context.viewport.parentDiv.clientHeight - this._sprite.size.y;
|
|
138246
|
+
if (this._offset?.y)
|
|
138247
|
+
this.position.y -= this._offset.y;
|
|
138248
|
+
return true;
|
|
138249
|
+
}
|
|
138250
|
+
/* TODO: Add other move methods as needed */
|
|
138251
|
+
/** Indicate if the logo is loaded and ready to be drawn. */
|
|
138252
|
+
get isLoaded() { return this._sprite?.isLoaded ?? false; }
|
|
138253
|
+
async activate(sprite) {
|
|
138254
|
+
this._sprite = sprite;
|
|
138255
|
+
return new Promise((resolve, _reject) => {
|
|
138256
|
+
sprite.loadPromise.then(() => {
|
|
138257
|
+
resolve(true);
|
|
138258
|
+
}).catch(() => {
|
|
138259
|
+
resolve(false);
|
|
138260
|
+
});
|
|
138261
|
+
});
|
|
138262
|
+
}
|
|
138263
|
+
/** Draw this sprite onto the supplied canvas.
|
|
138264
|
+
* @see [[CanvasDecoration.drawDecoration]]
|
|
138265
|
+
*/
|
|
138266
|
+
drawDecoration(ctx) {
|
|
138267
|
+
if (this.isLoaded) {
|
|
138268
|
+
// Draw image with an origin at the top left corner
|
|
138269
|
+
ctx.drawImage(this._sprite.image, 0, 0);
|
|
138270
|
+
}
|
|
138271
|
+
}
|
|
138272
|
+
decorate(context) {
|
|
138273
|
+
context.addCanvasDecoration(this);
|
|
138274
|
+
}
|
|
138275
|
+
}
|
|
138276
|
+
/** A decorator that adds the Google Maps logo to the lower left corner of the screen.
|
|
138277
|
+
* @internal
|
|
138278
|
+
*/
|
|
138279
|
+
class GoogleMapsDecorator {
|
|
138280
|
+
logo = new LogoDecoration();
|
|
138281
|
+
_showCreditsOnScreen;
|
|
138282
|
+
/** Create a new GoogleMapsDecorator.
|
|
138283
|
+
* @param showCreditsOnScreen If true, the data attributions/copyrights from the Google Photorealistic 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed.
|
|
138284
|
+
*/
|
|
138285
|
+
constructor(showCreditsOnScreen) {
|
|
138286
|
+
this._showCreditsOnScreen = showCreditsOnScreen;
|
|
138287
|
+
}
|
|
138288
|
+
/** Activate the logo based on the given map type. */
|
|
138289
|
+
async activate(mapType) {
|
|
138290
|
+
// Pick the logo that is the most visible on the background map
|
|
138291
|
+
const imageName = mapType === "roadmap" ?
|
|
138292
|
+
"google_on_white" :
|
|
138293
|
+
"google_on_non_white";
|
|
138294
|
+
// We need to move the logo right after the 'i.js' button
|
|
138295
|
+
this.logo.offset = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Point3d(45, 10);
|
|
138296
|
+
return this.logo.activate(_Sprites__WEBPACK_IMPORTED_MODULE_2__.IconSprites.getSpriteFromUrl(`${_IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.publicPath}images/${imageName}.png`));
|
|
138297
|
+
}
|
|
138298
|
+
;
|
|
138299
|
+
/** Decorate implementation */
|
|
138300
|
+
decorate = (context) => {
|
|
138301
|
+
if (!this.logo.isLoaded)
|
|
138302
|
+
return;
|
|
138303
|
+
this.logo.moveToLowerLeftCorner(context);
|
|
138304
|
+
this.logo.decorate(context);
|
|
138305
|
+
if (!this._showCreditsOnScreen)
|
|
138306
|
+
return;
|
|
138307
|
+
// Get data attribution (copyright) text
|
|
138308
|
+
const copyrightMap = getCopyrights(context.viewport);
|
|
138309
|
+
// Order by most occurances to least
|
|
138310
|
+
// See https://developers.google.com/maps/documentation/tile/create-renderer#display-attributions
|
|
138311
|
+
const sortedCopyrights = [...copyrightMap.entries()].sort((a, b) => b[1] - a[1]);
|
|
138312
|
+
const copyrightText = sortedCopyrights.map(([key]) => ` • ${key}`).join("");
|
|
138313
|
+
// Create and add element, offset to leave space for i.js and Google logos
|
|
138314
|
+
const elem = document.createElement("div");
|
|
138315
|
+
elem.innerHTML = copyrightText;
|
|
138316
|
+
elem.style.color = "white";
|
|
138317
|
+
elem.style.fontSize = "11px";
|
|
138318
|
+
elem.style.textWrap = "wrap";
|
|
138319
|
+
elem.style.position = "absolute";
|
|
138320
|
+
elem.style.bottom = "10px";
|
|
138321
|
+
elem.style.left = "107px";
|
|
138322
|
+
context.addHtmlDecoration(elem);
|
|
138323
|
+
};
|
|
138324
|
+
}
|
|
138325
|
+
/** Get copyrights from tiles currently in the viewport.
|
|
138326
|
+
* @internal
|
|
138327
|
+
*/
|
|
138328
|
+
function getCopyrights(vp) {
|
|
138329
|
+
const tiles = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.tileAdmin.getTilesForUser(vp)?.selected;
|
|
138330
|
+
const copyrightMap = new Map();
|
|
138331
|
+
if (tiles) {
|
|
138332
|
+
for (const tile of tiles) {
|
|
138333
|
+
if (tile.copyright) {
|
|
138334
|
+
for (const copyright of tile.copyright.split(";")) {
|
|
138335
|
+
const currentCount = copyrightMap.get(copyright);
|
|
138336
|
+
copyrightMap.set(copyright, currentCount ? currentCount + 1 : 1);
|
|
138337
|
+
}
|
|
138338
|
+
}
|
|
138339
|
+
}
|
|
138340
|
+
}
|
|
138341
|
+
return copyrightMap;
|
|
138342
|
+
}
|
|
138343
|
+
|
|
138344
|
+
|
|
138345
|
+
/***/ }),
|
|
138346
|
+
|
|
138347
|
+
/***/ "../../core/frontend/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.js":
|
|
138348
|
+
/*!**********************************************************************************!*\
|
|
138349
|
+
!*** ../../core/frontend/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.js ***!
|
|
138350
|
+
\**********************************************************************************/
|
|
138351
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
138352
|
+
|
|
138353
|
+
"use strict";
|
|
138354
|
+
__webpack_require__.r(__webpack_exports__);
|
|
138355
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
138356
|
+
/* harmony export */ RealityDataSourceGoogle3dTilesImpl: () => (/* binding */ RealityDataSourceGoogle3dTilesImpl)
|
|
138357
|
+
/* harmony export */ });
|
|
138358
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
138359
|
+
/* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
138360
|
+
/* harmony import */ var _request_Request__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../request/Request */ "../../core/frontend/lib/esm/request/Request.js");
|
|
138361
|
+
/* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
|
|
138362
|
+
/*---------------------------------------------------------------------------------------------
|
|
138363
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
138364
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
138365
|
+
*--------------------------------------------------------------------------------------------*/
|
|
138366
|
+
/** @packageDocumentation
|
|
138367
|
+
* @module Tiles
|
|
138368
|
+
*/
|
|
138369
|
+
|
|
138370
|
+
|
|
138371
|
+
|
|
138372
|
+
|
|
138373
|
+
/** This class provides access to the reality data provider services.
|
|
138374
|
+
* It encapsulates access to a reality data from the Google Photorealistic 3D Tiles service.
|
|
138375
|
+
* A valid Google 3D Tiles authentication key must be configured for this provider to work (provide the key in the [[RealityDataSourceGoogle3dTilesImpl.createFromKey]] method).
|
|
138376
|
+
* @internal
|
|
138377
|
+
*/
|
|
138378
|
+
class RealityDataSourceGoogle3dTilesImpl {
|
|
138379
|
+
key;
|
|
138380
|
+
/** The URL that supplies the 3d tiles for displaying the Google 3D Tiles tileset. */
|
|
138381
|
+
_tilesetUrl;
|
|
138382
|
+
/** Base URL of the Google 3D Tiles tileset. Does not include trailing subdirectories. */
|
|
138383
|
+
_baseUrl = "";
|
|
138384
|
+
/** Search parameters that must be passed down to child tile requests. */
|
|
138385
|
+
_searchParams;
|
|
138386
|
+
/** Google Map Tiles API Key used to access Google 3D Tiles. */
|
|
138387
|
+
_apiKey;
|
|
138388
|
+
/** Function that returns an OAuth token for authenticating with GP3sDT. This token is expected to not contain the "Bearer" prefix. */
|
|
138389
|
+
_getAuthToken;
|
|
138390
|
+
/** This is necessary for Google 3D Tiles tilesets! This tells the iTwin.js tiling system to use the geometric error specified in the tileset rather than any of our own. */
|
|
138391
|
+
usesGeometricError = true;
|
|
138392
|
+
maximumScreenSpaceError = 16;
|
|
138393
|
+
/** Construct a new reality data source.
|
|
138394
|
+
* @param props JSON representation of the reality data source
|
|
138395
|
+
*/
|
|
138396
|
+
constructor(props, apiKey, _getAuthToken) {
|
|
138397
|
+
this.key = props.sourceKey;
|
|
138398
|
+
this._tilesetUrl = this.key.id;
|
|
138399
|
+
this._apiKey = apiKey;
|
|
138400
|
+
this._getAuthToken = _getAuthToken;
|
|
138401
|
+
}
|
|
138402
|
+
/**
|
|
138403
|
+
* Create an instance of this class from a source key and iTwin context.
|
|
138404
|
+
*/
|
|
138405
|
+
static async createFromKey(sourceKey, _iTwinId, apiKey, _getAuthToken) {
|
|
138406
|
+
return new RealityDataSourceGoogle3dTilesImpl({ sourceKey }, apiKey, _getAuthToken);
|
|
138407
|
+
}
|
|
138408
|
+
get isContextShare() {
|
|
138409
|
+
return false;
|
|
138410
|
+
}
|
|
138411
|
+
/**
|
|
138412
|
+
* Returns Reality Data if available
|
|
138413
|
+
*/
|
|
138414
|
+
get realityData() {
|
|
138415
|
+
return undefined;
|
|
138416
|
+
}
|
|
138417
|
+
get realityDataId() {
|
|
138418
|
+
return undefined;
|
|
138419
|
+
}
|
|
138420
|
+
/**
|
|
138421
|
+
* Returns Reality Data type if available
|
|
138422
|
+
*/
|
|
138423
|
+
get realityDataType() {
|
|
138424
|
+
return undefined;
|
|
138425
|
+
}
|
|
138426
|
+
getTilesetUrl() {
|
|
138427
|
+
return this._tilesetUrl;
|
|
138428
|
+
}
|
|
138429
|
+
/** Return the URL of the Google 3D Tiles tileset with its API key included. */
|
|
138430
|
+
getTilesetUrlWithKey() {
|
|
138431
|
+
const google3dTilesKey = this._apiKey;
|
|
138432
|
+
if (this._getAuthToken) {
|
|
138433
|
+
// If we have a getAuthToken function, no need to append API key to the URL
|
|
138434
|
+
return this._tilesetUrl;
|
|
138435
|
+
}
|
|
138436
|
+
else {
|
|
138437
|
+
return `${this._tilesetUrl}?key=${google3dTilesKey}`;
|
|
138438
|
+
}
|
|
138439
|
+
}
|
|
138440
|
+
setBaseUrl(url) {
|
|
138441
|
+
const urlParts = url.split("/");
|
|
138442
|
+
const newUrl = new URL(url);
|
|
138443
|
+
this._searchParams = newUrl.searchParams;
|
|
138444
|
+
urlParts.pop();
|
|
138445
|
+
if (urlParts.length === 0) {
|
|
138446
|
+
this._baseUrl = "";
|
|
138447
|
+
}
|
|
138448
|
+
else {
|
|
138449
|
+
this._baseUrl = newUrl.origin;
|
|
138450
|
+
}
|
|
138451
|
+
}
|
|
138452
|
+
/**
|
|
138453
|
+
* This method returns the URL to access the actual 3d tiles from the service provider.
|
|
138454
|
+
* @returns string containing the URL to reality data.
|
|
138455
|
+
*/
|
|
138456
|
+
async getServiceUrl(_iTwinId) {
|
|
138457
|
+
return this._tilesetUrl;
|
|
138458
|
+
}
|
|
138459
|
+
async getRootDocument(_iTwinId) {
|
|
138460
|
+
const url = this.getTilesetUrlWithKey();
|
|
138461
|
+
if (!url)
|
|
138462
|
+
throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.ERROR, "Unable to get service url");
|
|
138463
|
+
this.setBaseUrl(url);
|
|
138464
|
+
let authToken;
|
|
138465
|
+
if (this._getAuthToken) {
|
|
138466
|
+
authToken = await this._getAuthToken();
|
|
138467
|
+
}
|
|
138468
|
+
return (0,_request_Request__WEBPACK_IMPORTED_MODULE_2__.request)(url, "json", authToken ? {
|
|
138469
|
+
headers: {
|
|
138470
|
+
authorization: `Bearer ${authToken}`
|
|
138471
|
+
}
|
|
138472
|
+
} : undefined);
|
|
138473
|
+
}
|
|
138474
|
+
/** Returns the tile URL relative to the base URL.
|
|
138475
|
+
* If the tile path is a relative URL, the base URL is prepended to it.
|
|
138476
|
+
* For both absolute and relative tile path URLs, the search parameters are checked. If the search params are empty, the base URL's search params are appended to the tile path.
|
|
138477
|
+
*/
|
|
138478
|
+
getTileUrl(tilePath) {
|
|
138479
|
+
// this._baseUrl does not include the trailing subdirectories.
|
|
138480
|
+
// This is not an issue because the tile path always starts with the appropriate subdirectories.
|
|
138481
|
+
// We also do not need to worry about the tile path starting with a slash.
|
|
138482
|
+
// This happens in these tiles at the second .json level, but the URL API will handle that for us.
|
|
138483
|
+
const url = new URL(tilePath, this._baseUrl);
|
|
138484
|
+
// If tile is a reference to a tileset, iterate over tileset url's search params and store them in this._searchParams so we can pass them down to children
|
|
138485
|
+
if (this.getTileContentType(url.toString()) === "tileset" && url.searchParams.size !== 0) {
|
|
138486
|
+
for (const [key, value] of url.searchParams.entries()) {
|
|
138487
|
+
this._searchParams?.append(key, value);
|
|
138488
|
+
}
|
|
138489
|
+
}
|
|
138490
|
+
if (this._searchParams === undefined || this._searchParams.size === 0) {
|
|
138491
|
+
return url.toString();
|
|
138492
|
+
}
|
|
138493
|
+
// Append all stored search params to url's existing ones
|
|
138494
|
+
const newUrl = new URL(url.toString());
|
|
138495
|
+
for (const [key, value] of this._searchParams.entries()) {
|
|
138496
|
+
if (!url.searchParams.has(key)) {
|
|
138497
|
+
// Only append the search param if it does not already exist in the url
|
|
138498
|
+
newUrl.searchParams.append(key, value);
|
|
138499
|
+
}
|
|
138500
|
+
}
|
|
138501
|
+
return newUrl.toString();
|
|
138502
|
+
}
|
|
138503
|
+
/**
|
|
138504
|
+
* Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
|
|
138505
|
+
*/
|
|
138506
|
+
async getTileContent(name) {
|
|
138507
|
+
let authToken;
|
|
138508
|
+
if (this._getAuthToken) {
|
|
138509
|
+
authToken = await this._getAuthToken();
|
|
138510
|
+
}
|
|
138511
|
+
return (0,_request_Request__WEBPACK_IMPORTED_MODULE_2__.request)(this.getTileUrl(name), "arraybuffer", authToken ? {
|
|
138512
|
+
headers: {
|
|
138513
|
+
authorization: `Bearer ${authToken}`
|
|
138514
|
+
}
|
|
138515
|
+
} : undefined);
|
|
138516
|
+
}
|
|
138517
|
+
/**
|
|
138518
|
+
* Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.
|
|
138519
|
+
*/
|
|
138520
|
+
async getTileJson(name) {
|
|
138521
|
+
let authToken;
|
|
138522
|
+
if (this._getAuthToken) {
|
|
138523
|
+
authToken = await this._getAuthToken();
|
|
138524
|
+
}
|
|
138525
|
+
return (0,_request_Request__WEBPACK_IMPORTED_MODULE_2__.request)(this.getTileUrl(name), "json", authToken ? {
|
|
138526
|
+
headers: {
|
|
138527
|
+
authorization: `Bearer ${authToken}`
|
|
138528
|
+
}
|
|
138529
|
+
} : undefined);
|
|
138530
|
+
}
|
|
138531
|
+
getTileContentType(url) {
|
|
138532
|
+
return new URL(url, "https://localhost/").pathname.toLowerCase().endsWith("json") ? "tileset" : "tile";
|
|
138533
|
+
}
|
|
138534
|
+
/**
|
|
138535
|
+
* Gets spatial location and extents of this reality data source
|
|
138536
|
+
* @returns spatial location and extents
|
|
138537
|
+
* @internal
|
|
138538
|
+
*/
|
|
138539
|
+
async getSpatialLocationAndExtents() {
|
|
138540
|
+
let spatialLocation;
|
|
138541
|
+
if (this.key.format === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataFormat.ThreeDTile) {
|
|
138542
|
+
const rootDocument = await this.getRootDocument(undefined);
|
|
138543
|
+
spatialLocation = _tile_internal__WEBPACK_IMPORTED_MODULE_3__.ThreeDTileFormatInterpreter.getSpatialLocationAndExtents(rootDocument);
|
|
138544
|
+
}
|
|
138545
|
+
return spatialLocation;
|
|
138546
|
+
}
|
|
138547
|
+
/**
|
|
138548
|
+
* Gets information to identify the product and engine that create this reality data
|
|
138549
|
+
* Will return undefined if cannot be resolved
|
|
138550
|
+
* @returns information to identify the product and engine that create this reality data
|
|
138551
|
+
* @alpha
|
|
138552
|
+
*/
|
|
138553
|
+
async getPublisherProductInfo() {
|
|
138554
|
+
let publisherInfo;
|
|
138555
|
+
return publisherInfo;
|
|
138556
|
+
}
|
|
138557
|
+
}
|
|
138558
|
+
|
|
138559
|
+
|
|
138064
138560
|
/***/ }),
|
|
138065
138561
|
|
|
138066
138562
|
/***/ "../../core/frontend/lib/esm/internal/cross-package.js":
|
|
@@ -138082,11 +138578,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
138082
138578
|
/* harmony export */ FeatureGraphicsRenderer: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.FeatureGraphicsRenderer),
|
|
138083
138579
|
/* harmony export */ GltfDataType: () => (/* reexport safe */ _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_2__.GltfDataType),
|
|
138084
138580
|
/* harmony export */ GltfReader: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.GltfReader),
|
|
138085
|
-
/* harmony export */
|
|
138581
|
+
/* harmony export */ GoogleMapsDecorator: () => (/* reexport safe */ _GoogleMapsDecorator__WEBPACK_IMPORTED_MODULE_9__.GoogleMapsDecorator),
|
|
138582
|
+
/* harmony export */ IModelTileTree: () => (/* reexport safe */ _tile_IModelTileTree__WEBPACK_IMPORTED_MODULE_10__.IModelTileTree),
|
|
138086
138583
|
/* harmony export */ ImageryMapTileTree: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.ImageryMapTileTree),
|
|
138087
138584
|
/* harmony export */ ImdlReader: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.ImdlReader),
|
|
138088
138585
|
/* harmony export */ LayerTileTreeHandler: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.LayerTileTreeHandler),
|
|
138089
138586
|
/* harmony export */ LayerTileTreeReferenceHandler: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.LayerTileTreeReferenceHandler),
|
|
138587
|
+
/* harmony export */ LogoDecoration: () => (/* reexport safe */ _GoogleMapsDecorator__WEBPACK_IMPORTED_MODULE_9__.LogoDecoration),
|
|
138090
138588
|
/* harmony export */ MapTileTreeReference: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.MapTileTreeReference),
|
|
138091
138589
|
/* harmony export */ OnScreenTarget: () => (/* reexport safe */ _render_webgl_Target__WEBPACK_IMPORTED_MODULE_3__.OnScreenTarget),
|
|
138092
138590
|
/* harmony export */ PerformanceMetrics: () => (/* reexport safe */ _render_webgl_PerformanceMetrics__WEBPACK_IMPORTED_MODULE_4__.PerformanceMetrics),
|
|
@@ -138114,7 +138612,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
138114
138612
|
/* harmony import */ var _render_AnimationBranchState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./render/AnimationBranchState */ "../../core/frontend/lib/esm/internal/render/AnimationBranchState.js");
|
|
138115
138613
|
/* harmony import */ var _render_RenderTargetDebugControl__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./render/RenderTargetDebugControl */ "../../core/frontend/lib/esm/internal/render/RenderTargetDebugControl.js");
|
|
138116
138614
|
/* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
|
|
138117
|
-
/* harmony import */ var
|
|
138615
|
+
/* harmony import */ var _GoogleMapsDecorator__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./GoogleMapsDecorator */ "../../core/frontend/lib/esm/internal/GoogleMapsDecorator.js");
|
|
138616
|
+
/* harmony import */ var _tile_IModelTileTree__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./tile/IModelTileTree */ "../../core/frontend/lib/esm/internal/tile/IModelTileTree.js");
|
|
138118
138617
|
/*---------------------------------------------------------------------------------------------
|
|
138119
138618
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
138120
138619
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -138132,6 +138631,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
138132
138631
|
|
|
138133
138632
|
// Used by frontend-tiles, map-layers-formats, frontend-dev-tools
|
|
138134
138633
|
|
|
138634
|
+
|
|
138135
138635
|
// Used by display-test-app which currently builds using both ESModules and CommonJS.
|
|
138136
138636
|
// Remove once CommonJS is dropped.
|
|
138137
138637
|
|
|
@@ -175011,7 +175511,7 @@ class RealityModelTileTreeProps {
|
|
|
175011
175511
|
this.maximumScreenSpaceError = json.asset.extras?.maximumScreenSpaceError;
|
|
175012
175512
|
}
|
|
175013
175513
|
else if (rdSource.usesGeometricError) {
|
|
175014
|
-
this.maximumScreenSpaceError = rdSource.maximumScreenSpaceError ??
|
|
175514
|
+
this.maximumScreenSpaceError = rdSource.maximumScreenSpaceError ?? 16;
|
|
175015
175515
|
}
|
|
175016
175516
|
}
|
|
175017
175517
|
}
|
|
@@ -175443,6 +175943,7 @@ class RealityTreeReference extends RealityModelTileTree.Reference {
|
|
|
175443
175943
|
_rdSourceKey;
|
|
175444
175944
|
_produceGeometry;
|
|
175445
175945
|
_modelId;
|
|
175946
|
+
useCachedDecorations;
|
|
175446
175947
|
constructor(props) {
|
|
175447
175948
|
super(props);
|
|
175448
175949
|
this._produceGeometry = props.produceGeometry;
|
|
@@ -175459,6 +175960,8 @@ class RealityTreeReference extends RealityModelTileTree.Reference {
|
|
|
175459
175960
|
modelId = realityTreeSupplier.findCompatibleContextRealityModelId(treeId, this._source);
|
|
175460
175961
|
}
|
|
175461
175962
|
this._modelId = modelId ?? props.iModel.transientIds.getNext();
|
|
175963
|
+
const provider = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.realityDataSourceProviders.find(this._rdSourceKey.provider);
|
|
175964
|
+
this.useCachedDecorations = provider?.useCachedDecorations;
|
|
175462
175965
|
}
|
|
175463
175966
|
get modelId() { return this._modelId; }
|
|
175464
175967
|
createTreeId(modelId) {
|
|
@@ -175587,9 +176090,17 @@ class RealityTreeReference extends RealityModelTileTree.Reference {
|
|
|
175587
176090
|
cards.appendChild(_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.makeLogoCard({ heading: "OpenStreetMap", notice: `©<a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> ${_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap:OpenStreetMapContributors")}` }));
|
|
175588
176091
|
}
|
|
175589
176092
|
}
|
|
175590
|
-
async addAttributions(cards) {
|
|
175591
|
-
|
|
175592
|
-
|
|
176093
|
+
async addAttributions(cards, vp) {
|
|
176094
|
+
const provider = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.realityDataSourceProviders.find(this._rdSourceKey.provider);
|
|
176095
|
+
if (provider?.addAttributions) {
|
|
176096
|
+
await provider.addAttributions(cards, vp);
|
|
176097
|
+
}
|
|
176098
|
+
}
|
|
176099
|
+
decorate(_context) {
|
|
176100
|
+
const provider = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.realityDataSourceProviders.find(this._rdSourceKey.provider);
|
|
176101
|
+
if (provider?.decorate) {
|
|
176102
|
+
provider.decorate(_context);
|
|
176103
|
+
}
|
|
175593
176104
|
}
|
|
175594
176105
|
}
|
|
175595
176106
|
|
|
@@ -184853,6 +185364,7 @@ class GltfReader {
|
|
|
184853
185364
|
isLeaf,
|
|
184854
185365
|
contentRange,
|
|
184855
185366
|
range,
|
|
185367
|
+
copyright: this._glTF.asset?.copyright,
|
|
184856
185368
|
containsPointCloud: this._containsPointCloud,
|
|
184857
185369
|
template: (0,_internal_render_GraphicTemplateImpl__WEBPACK_IMPORTED_MODULE_13__.createGraphicTemplate)({
|
|
184858
185370
|
nodes: templateNodes,
|
|
@@ -186595,6 +187107,8 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
|
|
|
186595
187107
|
_reprojectedGraphic;
|
|
186596
187108
|
_geometricError;
|
|
186597
187109
|
/** @internal */
|
|
187110
|
+
_copyright;
|
|
187111
|
+
/** @internal */
|
|
186598
187112
|
constructor(props, tree) {
|
|
186599
187113
|
super(props, tree);
|
|
186600
187114
|
this.transformToRoot = props.transformToRoot;
|
|
@@ -186617,6 +187131,7 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
|
|
|
186617
187131
|
setContent(content) {
|
|
186618
187132
|
super.setContent(content);
|
|
186619
187133
|
this._geometry = content.geometry;
|
|
187134
|
+
this._copyright = content.copyright;
|
|
186620
187135
|
}
|
|
186621
187136
|
/** @internal */
|
|
186622
187137
|
freeMemory() {
|
|
@@ -186645,6 +187160,8 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
|
|
|
186645
187160
|
*/
|
|
186646
187161
|
get geometry() { return this._geometry; }
|
|
186647
187162
|
/** @internal */
|
|
187163
|
+
get copyright() { return this._copyright; }
|
|
187164
|
+
/** @internal */
|
|
186648
187165
|
get isDisplayable() {
|
|
186649
187166
|
if (this.noContentButTerminateOnSelection)
|
|
186650
187167
|
return false;
|
|
@@ -330742,7 +331259,7 @@ class TestContext {
|
|
|
330742
331259
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
330743
331260
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
330744
331261
|
await core_frontend_1.NoRenderApp.startup({
|
|
330745
|
-
applicationVersion: "5.1.0-dev.
|
|
331262
|
+
applicationVersion: "5.1.0-dev.51",
|
|
330746
331263
|
applicationId: this.settings.gprid,
|
|
330747
331264
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
330748
331265
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -355829,7 +356346,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
355829
356346
|
/***/ ((module) => {
|
|
355830
356347
|
|
|
355831
356348
|
"use strict";
|
|
355832
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.
|
|
356349
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.51","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
355833
356350
|
|
|
355834
356351
|
/***/ }),
|
|
355835
356352
|
|