@itwin/ecschema-rpcinterface-tests 4.0.0-dev.72 → 4.0.0-dev.75

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.
@@ -77967,8 +77967,6 @@ __webpack_require__.r(__webpack_exports__);
77967
77967
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
77968
77968
  /* harmony import */ var _PlanarClipMaskState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PlanarClipMaskState */ "../../core/frontend/lib/esm/PlanarClipMaskState.js");
77969
77969
  /* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
77970
- /* harmony import */ var _ViewGlobalLocation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ViewGlobalLocation */ "../../core/frontend/lib/esm/ViewGlobalLocation.js");
77971
- /* harmony import */ var _ModelState__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ModelState */ "../../core/frontend/lib/esm/ModelState.js");
77972
77970
  /*---------------------------------------------------------------------------------------------
77973
77971
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
77974
77972
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -77986,8 +77984,6 @@ __webpack_require__.r(__webpack_exports__);
77986
77984
 
77987
77985
 
77988
77986
 
77989
-
77990
-
77991
77987
  /** @internal */
77992
77988
  class TerrainDisplayOverrides {
77993
77989
  }
@@ -78116,10 +78112,6 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78116
78112
  this.settings.mapImagery.backgroundBase = base;
78117
78113
  this._synchBackgroundMapImagery();
78118
78114
  }
78119
- /** @internal */
78120
- get backgroundMapLayers() { return this.settings.mapImagery.backgroundLayers; }
78121
- /** @internal */
78122
- get overlayMapLayers() { return this.settings.mapImagery.overlayLayers; }
78123
78115
  /** The settings controlling how a background map is displayed within a view.
78124
78116
  * @see [[ViewFlags.backgroundMap]] for toggling display of the map on or off.
78125
78117
  */
@@ -78282,29 +78274,25 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78282
78274
  model.appearanceOverrides = options.appearanceOverrides;
78283
78275
  return true;
78284
78276
  }
78285
- /**
78286
- * Return if a context reality model is attached.
78277
+ /** Return if a context reality model is attached.
78287
78278
  * @see [[ContextRealityModelProps]].
78288
- * */
78279
+ */
78289
78280
  hasAttachedRealityModel(name, url) {
78290
78281
  return undefined !== this.settings.contextRealityModels.models.find((x) => x.matchesNameAndUrl(name, url));
78291
78282
  }
78292
78283
  /** @internal */
78293
- getMapLayers(isOverlay) { return isOverlay ? this.overlayMapLayers : this.backgroundMapLayers; }
78294
- /**
78295
- * Attach a map layer to display style.
78284
+ getMapLayers(isOverlay) { return isOverlay ? this.settings.mapImagery.overlayLayers : this.settings.mapImagery.backgroundLayers; }
78285
+ /** Attach a map layer to display style.
78296
78286
  * @param Settings representing the map layer.
78297
- * @param isOverlay true if layer is overlay, otherwise layer is background. Defaults to false.
78298
- * @param index where the layer should be inserted. Defaults to -1, appended to end.
78287
+ * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be attached.
78299
78288
  * @public
78300
- *
78301
78289
  */
78302
78290
  attachMapLayer(options) {
78303
78291
  const layerSettings = options.settings.clone({});
78304
78292
  if (undefined === layerSettings)
78305
78293
  return;
78306
- const isOverlay = options.isOverlay ?? false;
78307
- const insertIndex = options.insertIndex ?? -1;
78294
+ const isOverlay = options.mapLayerIndex.isOverlay;
78295
+ const insertIndex = options.mapLayerIndex.index;
78308
78296
  const layers = this.getMapLayers(isOverlay);
78309
78297
  if (insertIndex < 0 || insertIndex > (layers.length - 1)) {
78310
78298
  this.getMapLayers(isOverlay).push(layerSettings);
@@ -78314,12 +78302,15 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78314
78302
  }
78315
78303
  this._synchBackgroundMapImagery();
78316
78304
  }
78317
- /** @internal */
78305
+ /**
78306
+ * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be attached.
78307
+ * @internal
78308
+ */
78318
78309
  attachMapLayerProps(options) {
78319
78310
  const settings = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MapLayerSettings.fromJSON(options.props);
78320
78311
  if (undefined === settings)
78321
78312
  return;
78322
- this.attachMapLayer({ settings, isOverlay: options.isOverlay, insertIndex: options.insertIndex });
78313
+ this.attachMapLayer({ settings, mapLayerIndex: options.mapLayerIndex });
78323
78314
  }
78324
78315
  /** @internal */
78325
78316
  hasAttachedMapLayer(name, source, isOverlay) {
@@ -78329,13 +78320,15 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78329
78320
  detachMapLayerByNameAndSource(name, source, isOverlay) {
78330
78321
  const index = this.findMapLayerIndexByNameAndSource(name, source, isOverlay);
78331
78322
  if (-1 !== index)
78332
- this.detachMapLayerByIndex(index, isOverlay);
78323
+ this.detachMapLayerByIndex({ index, isOverlay });
78333
78324
  }
78334
78325
  /** Detach map layer at index (-1 to remove all layers)
78326
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to detach.
78335
78327
  * @public
78336
78328
  */
78337
- detachMapLayerByIndex(index, isOverlay) {
78338
- const layers = this.getMapLayers(isOverlay);
78329
+ detachMapLayerByIndex(mapLayerIndex) {
78330
+ const layers = this.getMapLayers(mapLayerIndex.isOverlay);
78331
+ const index = mapLayerIndex.index;
78339
78332
  if (index < 0)
78340
78333
  layers.length = 0;
78341
78334
  else
@@ -78353,9 +78346,13 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78353
78346
  findMapLayerIndexByNameAndSource(name, source, isOverlay) {
78354
78347
  return this.getMapLayers(isOverlay).findIndex((layer) => layer.matchesNameAndSource(name, source));
78355
78348
  }
78356
- /** @public */
78357
- mapLayerAtIndex(index, isOverlay) {
78358
- const layers = this.getMapLayers(isOverlay);
78349
+ /** Return the map layer settings for a map layer at the provided index.
78350
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer.
78351
+ * @public
78352
+ */
78353
+ mapLayerAtIndex(mapLayerIndex) {
78354
+ const layers = this.getMapLayers(mapLayerIndex.isOverlay);
78355
+ const index = mapLayerIndex.index;
78359
78356
  return (index < 0 || index >= layers.length) ? undefined : layers[index];
78360
78357
  }
78361
78358
  /** Return map base transparency as a number between 0 and 1.
@@ -78378,8 +78375,7 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78378
78375
  }
78379
78376
  /** Modify a subset of a map layer settings.
78380
78377
  * @param props props JSON representation of the properties to change. Any properties not present will retain their current values.
78381
- * @param index where the layer should be inserted.
78382
- * @param isOverlay true if layer is overlay, otherwise layer is background.
78378
+ * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be inserted.
78383
78379
  *
78384
78380
  * Example that changes only the visibility of the first overlay map layer.
78385
78381
  * ``` ts
@@ -78387,16 +78383,21 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78387
78383
  * ```
78388
78384
  * @public
78389
78385
  */
78390
- changeMapLayerProps(props, index, isOverlay) {
78391
- const layers = this.getMapLayers(isOverlay);
78386
+ changeMapLayerProps(props, mapLayerIndex) {
78387
+ const index = mapLayerIndex.index;
78388
+ const layers = this.getMapLayers(mapLayerIndex.isOverlay);
78392
78389
  if (index < 0 || index >= layers.length)
78393
78390
  return;
78394
78391
  layers[index] = layers[index].clone(props);
78395
78392
  this._synchBackgroundMapImagery();
78396
78393
  }
78397
- /** @public */
78398
- changeMapLayerCredentials(index, isOverlay, userName, password) {
78399
- const layers = this.getMapLayers(isOverlay);
78394
+ /** Change the credentials for a map layer.
78395
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to change the credentials of.
78396
+ * @public
78397
+ */
78398
+ changeMapLayerCredentials(mapLayerIndex, userName, password) {
78399
+ const layers = this.getMapLayers(mapLayerIndex.isOverlay);
78400
+ const index = mapLayerIndex.index;
78400
78401
  if (index < 0 || index >= layers.length)
78401
78402
  return;
78402
78403
  const layer = layers[index];
@@ -78408,13 +78409,12 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78408
78409
  /** Modify a subset of a sub-layer settings.
78409
78410
  * @param props props JSON representation of the properties to change. Any properties not present will retain their current values.
78410
78411
  * @param subLayerId Id of the sub-layer that should be modified.
78411
- * @param layerIndex of the owning map layer.
78412
- * @param isOverlay true if the map layer is overlay, otherwise layer is background
78412
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer that contains the sub-layer to be modified.
78413
78413
  *
78414
78414
  * @public
78415
78415
  */
78416
- changeMapSubLayerProps(props, subLayerId, layerIndex, isOverlay) {
78417
- const mapLayerSettings = this.mapLayerAtIndex(layerIndex, isOverlay);
78416
+ changeMapSubLayerProps(props, subLayerId, mapLayerIndex) {
78417
+ const mapLayerSettings = this.mapLayerAtIndex(mapLayerIndex);
78418
78418
  if (undefined === mapLayerSettings)
78419
78419
  return;
78420
78420
  if (!(mapLayerSettings instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ImageMapLayerSettings)) {
@@ -78425,95 +78425,43 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78425
78425
  for (const subLayer of mapLayerSettings.subLayers) {
78426
78426
  subLayers.push((subLayerId === -1 || subLayer.id === subLayerId) ? subLayer.clone(props).toJSON() : subLayer.toJSON());
78427
78427
  }
78428
- this.changeMapLayerProps({ subLayers }, layerIndex, isOverlay);
78429
- }
78430
- /** Returns the cartographic range of map layer.
78431
- * @param layerIndex of the map layer.
78432
- * @param isOverlay true if the map layer is overlay, otherwise layer is background
78433
- *
78434
- * @internal
78435
- */
78436
- async getMapLayerRange(layerIndex, isOverlay) {
78437
- const mapLayerSettings = this.mapLayerAtIndex(layerIndex, isOverlay);
78438
- if (undefined === mapLayerSettings)
78439
- return undefined;
78440
- if (mapLayerSettings instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ModelMapLayerSettings) {
78441
- const ecefTransform = this.iModel.ecefLocation?.getTransform();
78442
- if (!ecefTransform)
78443
- return undefined;
78444
- const model = this.iModel.models.getLoaded(mapLayerSettings.modelId);
78445
- if (!model || !(model instanceof _ModelState__WEBPACK_IMPORTED_MODULE_11__.GeometricModelState))
78446
- return undefined;
78447
- const modelRange = await model.queryModelRange();
78448
- const cartoRange = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CartographicRange(modelRange, ecefTransform).getLongitudeLatitudeBoundingBox();
78449
- return _tile_internal__WEBPACK_IMPORTED_MODULE_9__.MapCartoRectangle.fromRadians(cartoRange.low.x, cartoRange.low.y, cartoRange.high.x, cartoRange.high.y);
78450
- }
78451
- if (!(mapLayerSettings instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ImageMapLayerSettings)) {
78452
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false);
78453
- return undefined;
78454
- }
78455
- const imageryProvider = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.mapLayerFormatRegistry.createImageryProvider(mapLayerSettings);
78456
- if (undefined === imageryProvider)
78457
- return undefined;
78458
- try {
78459
- await imageryProvider.initialize();
78460
- return imageryProvider.cartoRange;
78461
- }
78462
- catch (_error) {
78463
- return undefined;
78464
- }
78465
- return undefined;
78466
- }
78467
- /** change viewport to include range of map layer.
78468
- * @internal
78469
- */
78470
- async viewMapLayerRange(layerIndex, isOverlay, vp) {
78471
- const range = await this.getMapLayerRange(layerIndex, isOverlay);
78472
- if (!range)
78473
- return false;
78474
- if (range.xLength() > 1.5 * _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.piRadians)
78475
- (0,_ViewGlobalLocation__WEBPACK_IMPORTED_MODULE_10__.viewGlobalLocation)(vp, true, _ViewGlobalLocation__WEBPACK_IMPORTED_MODULE_10__.ViewGlobalLocationConstants.satelliteHeightAboveEarthInMeters, undefined, undefined);
78476
- else
78477
- (0,_ViewGlobalLocation__WEBPACK_IMPORTED_MODULE_10__.viewGlobalLocation)(vp, true, undefined, undefined, range.globalLocation);
78478
- return true;
78428
+ this.changeMapLayerProps({ subLayers }, mapLayerIndex);
78479
78429
  }
78480
78430
  /* @internal */
78481
78431
  _synchBackgroundMapImagery() {
78482
78432
  this.settings.synchMapImagery();
78483
78433
  }
78484
- /**
78485
- * Move map layer to top.
78486
- * @param index index of layer to move.
78487
- * @param isOverlay true if layer is overlay.
78434
+ /** Move map layer to top.
78435
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to move.
78488
78436
  * @public
78489
78437
  *
78490
78438
  */
78491
- moveMapLayerToTop(index, isOverlay) {
78492
- const layers = this.getMapLayers(isOverlay);
78439
+ moveMapLayerToTop(mapLayerIndex) {
78440
+ const layers = this.getMapLayers(mapLayerIndex.isOverlay);
78441
+ const index = mapLayerIndex.index;
78493
78442
  if (index >= 0 && index < layers.length - 1) {
78494
78443
  const layer = layers.splice(index, 1);
78495
78444
  layers.push(layer[0]);
78496
78445
  this._synchBackgroundMapImagery();
78497
78446
  }
78498
78447
  }
78499
- /**
78500
- * Move map layer to bottom.
78501
- * @param index index of layer to move.
78502
- * @param isOverlay true if layer is overlay.
78448
+ /** Move map layer to bottom.
78449
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to move.
78503
78450
  * @public
78504
78451
  */
78505
- moveMapLayerToBottom(index, isOverlay) {
78506
- const layers = this.getMapLayers(isOverlay);
78452
+ moveMapLayerToBottom(mapLayerIndex) {
78453
+ const layers = this.getMapLayers(mapLayerIndex.isOverlay);
78454
+ const index = mapLayerIndex.index;
78507
78455
  if (index > 0 && index < layers.length) {
78508
78456
  const layer = layers.splice(index, 1);
78509
78457
  layers.unshift(layer[0]);
78510
78458
  this._synchBackgroundMapImagery();
78511
78459
  }
78512
78460
  }
78513
- /**
78514
- * Reorder map layers
78461
+ /** Reorder map layers
78515
78462
  * @param fromIndex index of map layer to move
78516
78463
  * @param toIndex insert index. If equal to length of map array the map layer is moved to end of array.
78464
+ * @param isOverlay true if map-layer is part of the overlay map, otherwise it is part of the background map.
78517
78465
  * @public
78518
78466
  */
78519
78467
  moveMapLayerToIndex(fromIndex, toIndex, isOverlay) {
@@ -79107,8 +79055,7 @@ class DrawingViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_14__.ViewStat
79107
79055
  CAST(json_extract(jsonProperties, '$.displaySpatialView') as BOOLEAN) as displaySpatialView
79108
79056
  FROM bis.SectionDrawing
79109
79057
  WHERE ECInstanceId=${this.baseModelId}`;
79110
- // eslint-disable-next-line deprecation/deprecation
79111
- for await (const row of this.iModel.query(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
79058
+ for await (const row of this.iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
79112
79059
  spatialView = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.fromJSON(row.spatialView?.id);
79113
79060
  displaySpatialView = !!row.displaySpatialView;
79114
79061
  try {
@@ -82343,9 +82290,7 @@ __webpack_require__(/*! ./IModeljs-css */ "../../core/frontend/lib/esm/IModeljs-
82343
82290
  class IModelApp {
82344
82291
  // No instances of IModelApp may be created. All members are static and must be on the singleton object IModelApp.
82345
82292
  constructor() { }
82346
- /** The [[MapLayerProviderRegistry]] for this session.
82347
- * @internal
82348
- */
82293
+ /** The [[MapLayerFormatRegistry]] for this session. */
82349
82294
  static get mapLayerFormatRegistry() { return this._mapLayerFormatRegistry; }
82350
82295
  /** The [[TerrainProviderRegistry]] for this session. */
82351
82296
  static get terrainProviderRegistry() { return this._terrainProviderRegistry; }
@@ -83054,8 +82999,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
83054
82999
  * @deprecated in 3.7. Count the number of results using `count(*)` where the original query is a subquery instead. E.g., `SELECT count(*) FROM (<query-whose-rows-to-count>)`.
83055
83000
  */
83056
83001
  async queryRowCount(ecsql, params) {
83057
- // eslint-disable-next-line deprecation/deprecation
83058
- for await (const row of this.query(`select count(*) from (${ecsql})`, params)) {
83002
+ for await (const row of this.createQueryReader(`select count(*) from (${ecsql})`, params)) {
83059
83003
  return row[0];
83060
83004
  }
83061
83005
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.DbResult.BE_SQLITE_ERROR, "Failed to get row count");
@@ -83079,8 +83023,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
83079
83023
  * @deprecated in 3.7. Use [[createQueryReader]] instead. Pass in the restart token as part of the `config` argument; e.g., `{ restartToken: myToken }` or `new QueryOptionsBuilder().setRestartToken(myToken).getOptions()`.
83080
83024
  */
83081
83025
  async *restartQuery(token, ecsql, params, options) {
83082
- // eslint-disable-next-line deprecation/deprecation
83083
- for await (const row of this.query(ecsql, params, new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryOptionsBuilder(options).setRestartToken(token).getOptions())) {
83026
+ for await (const row of this.createQueryReader(ecsql, params, new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryOptionsBuilder(options).setRestartToken(token).getOptions())) {
83084
83027
  yield row;
83085
83028
  }
83086
83029
  }
@@ -83623,8 +83566,8 @@ class SnapshotConnection extends IModelConnection {
83623
83566
  break;
83624
83567
  }
83625
83568
  const placements = new Array();
83626
- // eslint-disable-next-line deprecation/deprecation
83627
- for await (const row of this._iModel.query(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
83569
+ for await (const queryRow of this._iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
83570
+ const row = queryRow.toRow();
83628
83571
  const origin = [row.x, row.y, row.z];
83629
83572
  const bbox = {
83630
83573
  low: { x: row.lx, y: row.ly, z: row.lz },
@@ -88022,8 +87965,7 @@ class SheetViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_14__.ViewState2
88022
87965
  async queryAttachmentIds() {
88023
87966
  const ecsql = `SELECT ECInstanceId as attachmentId FROM bis.ViewAttachment WHERE model.Id=${this.baseModelId}`;
88024
87967
  const ids = [];
88025
- // eslint-disable-next-line deprecation/deprecation
88026
- for await (const row of this.iModel.query(ecsql))
87968
+ for await (const row of this.iModel.createQueryReader(ecsql))
88027
87969
  ids.push(row[0]);
88028
87970
  return ids;
88029
87971
  }
@@ -90289,8 +90231,7 @@ class ViewCreator2d {
90289
90231
  */
90290
90232
  this._executeQuery = async (query) => {
90291
90233
  const rows = [];
90292
- // eslint-disable-next-line deprecation/deprecation
90293
- for await (const row of this._imodel.query(query, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames }))
90234
+ for await (const row of this._imodel.createQueryReader(query, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames }))
90294
90235
  rows.push(row.id);
90295
90236
  return rows;
90296
90237
  };
@@ -90378,8 +90319,7 @@ class ViewCreator2d {
90378
90319
  async _addSheetViewProps(modelId, props) {
90379
90320
  let width = 0;
90380
90321
  let height = 0;
90381
- // eslint-disable-next-line deprecation/deprecation
90382
- for await (const row of this._imodel.query(`SELECT Width, Height FROM bis.Sheet WHERE ECInstanceId = ?`, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryBinder.from([modelId]), { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
90322
+ for await (const row of this._imodel.createQueryReader(`SELECT Width, Height FROM bis.Sheet WHERE ECInstanceId = ?`, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryBinder.from([modelId]), { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
90383
90323
  width = row.width;
90384
90324
  height = row.height;
90385
90325
  break;
@@ -90507,8 +90447,7 @@ class ViewCreator3d {
90507
90447
  */
90508
90448
  this._executeQuery = async (query) => {
90509
90449
  const rows = [];
90510
- // eslint-disable-next-line deprecation/deprecation
90511
- for await (const row of this._imodel.query(query, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames }))
90450
+ for await (const row of this._imodel.createQueryReader(query, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames }))
90512
90451
  rows.push(row.id);
90513
90452
  return rows;
90514
90453
  };
@@ -94001,11 +93940,13 @@ __webpack_require__.r(__webpack_exports__);
94001
93940
  /* harmony import */ var _tools_EventController__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./tools/EventController */ "../../core/frontend/lib/esm/tools/EventController.js");
94002
93941
  /* harmony import */ var _tools_ToolSettings__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./tools/ToolSettings */ "../../core/frontend/lib/esm/tools/ToolSettings.js");
94003
93942
  /* harmony import */ var _ViewContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./ViewContext */ "../../core/frontend/lib/esm/ViewContext.js");
94004
- /* harmony import */ var _ViewingSpace__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./ViewingSpace */ "../../core/frontend/lib/esm/ViewingSpace.js");
94005
- /* harmony import */ var _ViewRect__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./ViewRect */ "../../core/frontend/lib/esm/ViewRect.js");
94006
- /* harmony import */ var _ViewStatus__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./ViewStatus */ "../../core/frontend/lib/esm/ViewStatus.js");
94007
- /* harmony import */ var _render_VisibleFeature__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./render/VisibleFeature */ "../../core/frontend/lib/esm/render/VisibleFeature.js");
94008
- /* harmony import */ var _FlashSettings__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./FlashSettings */ "../../core/frontend/lib/esm/FlashSettings.js");
93943
+ /* harmony import */ var _ViewGlobalLocation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./ViewGlobalLocation */ "../../core/frontend/lib/esm/ViewGlobalLocation.js");
93944
+ /* harmony import */ var _ViewingSpace__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./ViewingSpace */ "../../core/frontend/lib/esm/ViewingSpace.js");
93945
+ /* harmony import */ var _ViewRect__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./ViewRect */ "../../core/frontend/lib/esm/ViewRect.js");
93946
+ /* harmony import */ var _ViewStatus__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./ViewStatus */ "../../core/frontend/lib/esm/ViewStatus.js");
93947
+ /* harmony import */ var _render_VisibleFeature__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./render/VisibleFeature */ "../../core/frontend/lib/esm/render/VisibleFeature.js");
93948
+ /* harmony import */ var _FlashSettings__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./FlashSettings */ "../../core/frontend/lib/esm/FlashSettings.js");
93949
+ /* harmony import */ var _ModelState__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./ModelState */ "../../core/frontend/lib/esm/ModelState.js");
94009
93950
  /*---------------------------------------------------------------------------------------------
94010
93951
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
94011
93952
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -94041,6 +93982,8 @@ __webpack_require__.r(__webpack_exports__);
94041
93982
 
94042
93983
 
94043
93984
 
93985
+
93986
+
94044
93987
 
94045
93988
 
94046
93989
 
@@ -94460,34 +94403,80 @@ class Viewport {
94460
94403
  get overlayMap() { return this._mapTiledGraphicsProvider?.overlayMap; }
94461
94404
  /** @internal */
94462
94405
  get backgroundDrapeMap() { return this._mapTiledGraphicsProvider?.backgroundDrapeMap; }
94463
- /** @internal */
94464
- getMapLayerImageryProvider(index, isOverlay) { return this._mapTiledGraphicsProvider?.getMapLayerImageryProvider(index, isOverlay); }
94406
+ /** Return the imagery provider for the provided map-layer index.
94407
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer.
94408
+ * @beta
94409
+ */
94410
+ getMapLayerImageryProvider(mapLayerIndex) { return this._mapTiledGraphicsProvider?.getMapLayerImageryProvider(mapLayerIndex); }
94465
94411
  /** Return the map-layer scale range visibility for the provided map-layer index.
94466
- * @param index of the owning map layer.
94467
- * @param isOverlay true if the map layer is overlay, otherwise layer is background
94412
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer.
94468
94413
  * @see [[DisplayStyleState.mapLayerAtIndex]].
94469
94414
  * @beta
94470
- */
94471
- getMapLayerScaleRangeVisibility(index, isOverlay) {
94472
- const treeRef = (isOverlay ? this._mapTiledGraphicsProvider?.overlayMap : this._mapTiledGraphicsProvider?.backgroundMap);
94415
+ */
94416
+ getMapLayerScaleRangeVisibility(mapLayerIndex) {
94417
+ const treeRef = (mapLayerIndex.isOverlay ? this._mapTiledGraphicsProvider?.overlayMap : this._mapTiledGraphicsProvider?.backgroundMap);
94473
94418
  if (treeRef) {
94474
- return treeRef.getMapLayerScaleRangeVisibility(index);
94419
+ return treeRef.getMapLayerScaleRangeVisibility(mapLayerIndex.index);
94475
94420
  }
94476
94421
  return _tile_internal__WEBPACK_IMPORTED_MODULE_22__.MapTileTreeScaleRangeVisibility.Unknown;
94477
94422
  }
94478
94423
  /** Return a list of map-layers indexes matching a given MapTile tree Id and a layer imagery tree id.
94479
94424
  * Note: A imagery tree can be shared for multiple map-layers.
94480
94425
  * @internal
94481
- * */
94426
+ */
94482
94427
  getMapLayerIndexesFromIds(mapTreeId, layerTreeId) {
94483
94428
  if (this._mapTiledGraphicsProvider)
94484
94429
  return this._mapTiledGraphicsProvider?.getMapLayerIndexesFromIds(mapTreeId, layerTreeId);
94485
94430
  return [];
94486
94431
  }
94487
- /** @beta
94488
- * Fully reset a map-layer tile tree; by calling this, the map-layer will to go through initialize process again, and all previously fetched tile will be lost.
94432
+ /** Returns the cartographic range of a map layer.
94433
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer.
94434
+ */
94435
+ async getMapLayerRange(mapLayerIndex) {
94436
+ const mapLayerSettings = this.view.displayStyle.mapLayerAtIndex(mapLayerIndex);
94437
+ if (undefined === mapLayerSettings)
94438
+ return undefined;
94439
+ if (mapLayerSettings instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ModelMapLayerSettings) {
94440
+ const ecefTransform = this.iModel.ecefLocation?.getTransform();
94441
+ if (!ecefTransform)
94442
+ return undefined;
94443
+ const model = this.iModel.models.getLoaded(mapLayerSettings.modelId);
94444
+ if (!model || !(model instanceof _ModelState__WEBPACK_IMPORTED_MODULE_32__.GeometricModelState))
94445
+ return undefined;
94446
+ const modelRange = await model.queryModelRange();
94447
+ const cartoRange = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CartographicRange(modelRange, ecefTransform).getLongitudeLatitudeBoundingBox();
94448
+ return _tile_internal__WEBPACK_IMPORTED_MODULE_22__.MapCartoRectangle.fromRadians(cartoRange.low.x, cartoRange.low.y, cartoRange.high.x, cartoRange.high.y);
94449
+ }
94450
+ const imageryProvider = this.getMapLayerImageryProvider(mapLayerIndex);
94451
+ if (undefined === imageryProvider)
94452
+ return undefined;
94453
+ const tileTreeRef = mapLayerIndex.isOverlay ? this.overlayMap : this.backgroundMap;
94454
+ const imageryTreeRef = tileTreeRef?.getLayerImageryTreeRef(mapLayerIndex.index);
94455
+ if (imageryTreeRef?.treeOwner.loadStatus === _tile_internal__WEBPACK_IMPORTED_MODULE_22__.TileTreeLoadStatus.Loaded) {
94456
+ return imageryProvider.cartoRange;
94457
+ }
94458
+ else {
94459
+ return undefined;
94460
+ }
94461
+ }
94462
+ /** Changes viewport to include range of a map layer.
94463
+ * @param mapLayerIndex the [[MapLayerIndex]] of the map layer.
94464
+ * @param vp the viewport.
94465
+ */
94466
+ async viewMapLayerRange(mapLayerIndex, vp) {
94467
+ const range = await this.getMapLayerRange(mapLayerIndex);
94468
+ if (!range)
94469
+ return false;
94470
+ if (range.xLength() > 1.5 * _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.piRadians)
94471
+ (0,_ViewGlobalLocation__WEBPACK_IMPORTED_MODULE_26__.viewGlobalLocation)(vp, true, _ViewGlobalLocation__WEBPACK_IMPORTED_MODULE_26__.ViewGlobalLocationConstants.satelliteHeightAboveEarthInMeters, undefined, undefined);
94472
+ else
94473
+ (0,_ViewGlobalLocation__WEBPACK_IMPORTED_MODULE_26__.viewGlobalLocation)(vp, true, undefined, undefined, range.globalLocation);
94474
+ return true;
94475
+ }
94476
+ /** Fully reset a map-layer tile tree; by calling this, the map-layer will to go through initialize process again, and all previously fetched tile will be lost.
94477
+ * @beta
94489
94478
  */
94490
- resetMapLayer(index, isOverlay) { this._mapTiledGraphicsProvider?.resetMapLayer(index, isOverlay); }
94479
+ resetMapLayer(mapLayerIndex) { this._mapTiledGraphicsProvider?.resetMapLayer(mapLayerIndex); }
94491
94480
  /** Returns true if this Viewport is currently displaying the model with the specified Id. */
94492
94481
  viewsModel(modelId) { return this.view.viewsModel(modelId); }
94493
94482
  /** Attempt to change the 2d Model this Viewport is displaying, if its ViewState is a ViewState2d.
@@ -94737,9 +94726,9 @@ class Viewport {
94737
94726
  this._tiledGraphicsProviders = new Set();
94738
94727
  this._hilite = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Hilite.Settings();
94739
94728
  this._emphasis = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Hilite.Settings(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 0, 0, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Hilite.Silhouette.Thick);
94740
- this._flash = new _FlashSettings__WEBPACK_IMPORTED_MODULE_30__.FlashSettings();
94729
+ this._flash = new _FlashSettings__WEBPACK_IMPORTED_MODULE_31__.FlashSettings();
94741
94730
  /** @internal */
94742
- this._viewRange = new _ViewRect__WEBPACK_IMPORTED_MODULE_27__.ViewRect();
94731
+ this._viewRange = new _ViewRect__WEBPACK_IMPORTED_MODULE_28__.ViewRect();
94743
94732
  /** If this event has one or more listeners, collection of timing statistics related to rendering frames is enabled. Frame statistics will be received by the listeners whenever a frame is finished rendering.
94744
94733
  * @note The timing data collected using this event only collects the amount of time spent on the CPU. Due to performance considerations, time spent on the GPU is not collected. Therefore, these statistics are not a direct mapping to user experience.
94745
94734
  * @note In order to avoid interfering with the rendering loop, take care to avoid performing any intensive tasks in your event listeners.
@@ -95366,7 +95355,7 @@ class Viewport {
95366
95355
  turnCameraOn(lensAngle) {
95367
95356
  const view = this.view;
95368
95357
  if (!view.is3d() || !view.supportsCamera())
95369
- return _ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.InvalidViewport;
95358
+ return _ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.InvalidViewport;
95370
95359
  if (!lensAngle)
95371
95360
  lensAngle = view.camera.lens;
95372
95361
  _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Camera.validateLensAngle(lensAngle);
@@ -95394,7 +95383,7 @@ class Viewport {
95394
95383
  const frontDistance = view.minimumFrontDistance();
95395
95384
  status = view.lookAt({ eyePoint, targetPoint, upVector: view.getYVector(), lensAngle, frontDistance, backDistance });
95396
95385
  }
95397
- if (_ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success === status)
95386
+ if (_ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success === status)
95398
95387
  this.setupFromView();
95399
95388
  return status;
95400
95389
  }
@@ -95405,20 +95394,20 @@ class Viewport {
95405
95394
  }
95406
95395
  doSetupFromView(view) {
95407
95396
  if (this._inViewChangedEvent)
95408
- return _ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success; // ignore echos
95397
+ return _ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success; // ignore echos
95409
95398
  if (!this.isAspectRatioLocked)
95410
95399
  view.fixAspectRatio(this.viewRect.aspect);
95411
95400
  this.setView(view);
95412
- const viewSpace = _ViewingSpace__WEBPACK_IMPORTED_MODULE_26__.ViewingSpace.createFromViewport(this);
95401
+ const viewSpace = _ViewingSpace__WEBPACK_IMPORTED_MODULE_27__.ViewingSpace.createFromViewport(this);
95413
95402
  if (undefined === viewSpace)
95414
- return _ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.InvalidViewport;
95403
+ return _ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.InvalidViewport;
95415
95404
  this._viewingSpace = viewSpace;
95416
95405
  this.invalidateRenderPlan();
95417
95406
  this._controllerValid = true;
95418
95407
  this._inViewChangedEvent = true;
95419
95408
  this.onViewChanged.raiseEvent(this);
95420
95409
  this._inViewChangedEvent = false;
95421
- return _ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success;
95410
+ return _ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success;
95422
95411
  }
95423
95412
  /** Establish the parameters of this Viewport from the current information in its ViewState */
95424
95413
  setupFromView(pose) {
@@ -95538,7 +95527,7 @@ class Viewport {
95538
95527
  zoom(newCenter, factor, options) {
95539
95528
  const view = this.view;
95540
95529
  if (undefined === view)
95541
- return _ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.InvalidViewport;
95530
+ return _ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.InvalidViewport;
95542
95531
  if (view.is3d() && view.isCameraOn) {
95543
95532
  const eyePoint = view.getEyePoint().clone();
95544
95533
  const targetPoint = view.getTargetPoint();
@@ -95552,7 +95541,7 @@ class Viewport {
95552
95541
  transform.multiplyPoint3d(eyePoint, eyePoint);
95553
95542
  targetPoint.setFrom(eyePoint.plusScaled(zDir, zDir.dotProduct(eyePoint.vectorTo(targetPoint))));
95554
95543
  const status = view.lookAt({ eyePoint, targetPoint, upVector: view.getYVector(), lensAngle: view.camera.lens });
95555
- if (_ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success !== status)
95544
+ if (_ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success !== status)
95556
95545
  return status;
95557
95546
  }
95558
95547
  else {
@@ -95563,7 +95552,7 @@ class Viewport {
95563
95552
  const center = rot.multiplyVector(newCenter ? newCenter : view.getCenter());
95564
95553
  // fix for min/max delta
95565
95554
  const stat = view.adjustViewDelta(delta, center, rot, this.viewRect.aspect, options);
95566
- if (_ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success !== stat)
95555
+ if (_ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success !== stat)
95567
95556
  return stat;
95568
95557
  if (!view.allow3dManipulations())
95569
95558
  center.z = 0.0;
@@ -95571,7 +95560,7 @@ class Viewport {
95571
95560
  view.setExtents(delta);
95572
95561
  }
95573
95562
  this.synchWithView(options);
95574
- return _ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success;
95563
+ return _ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success;
95575
95564
  }
95576
95565
  /** See [[zoomToPlacements]]. */
95577
95566
  zoomToPlacementProps(placementProps, options) {
@@ -95610,7 +95599,7 @@ class Viewport {
95610
95599
  viewRange.extendArray(placement.getWorldCorners(frust).points, viewTransform);
95611
95600
  const ignoreError = {
95612
95601
  ...options,
95613
- onExtentsError: () => _ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success,
95602
+ onExtentsError: () => _ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success,
95614
95603
  };
95615
95604
  view.lookAtViewAlignedVolume(viewRange, this.viewRect.aspect, ignoreError);
95616
95605
  this.synchWithView(options);
@@ -95654,7 +95643,7 @@ class Viewport {
95654
95643
  setupViewFromFrustum(inFrustum) {
95655
95644
  const validSize = this.view.setupFromFrustum(inFrustum);
95656
95645
  // note: always call setupFromView, even if setupFromFrustum failed
95657
- return (_ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success === this.setupFromView() && _ViewStatus__WEBPACK_IMPORTED_MODULE_28__.ViewStatus.Success === validSize);
95646
+ return (_ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success === this.setupFromView() && _ViewStatus__WEBPACK_IMPORTED_MODULE_29__.ViewStatus.Success === validSize);
95658
95647
  }
95659
95648
  /** Compute the range of all geometry to be displayed in this viewport. */
95660
95649
  computeViewRange() {
@@ -96015,7 +96004,7 @@ class Viewport {
96015
96004
  * @note By default the image is returned with the coordinate (0,0) referring to the bottom-most pixel. Pass `true` for `flipVertically` to flip it along the x-axis.
96016
96005
  * @deprecated in 3.x. Use readImageBuffer.
96017
96006
  */
96018
- readImage(rect = new _ViewRect__WEBPACK_IMPORTED_MODULE_27__.ViewRect(1, 1, 0, 0), targetSize = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.createZero(), flipVertically = false) {
96007
+ readImage(rect = new _ViewRect__WEBPACK_IMPORTED_MODULE_28__.ViewRect(1, 1, 0, 0), targetSize = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.createZero(), flipVertically = false) {
96019
96008
  // eslint-disable-next-line deprecation/deprecation
96020
96009
  return this.target.readImage(rect, targetSize, flipVertically);
96021
96010
  }
@@ -96129,7 +96118,7 @@ class Viewport {
96129
96118
  * @note This function may be slow, especially if the features are being queried from screen pixels. Avoid calling it repeatedly in rapid succession.
96130
96119
  */
96131
96120
  queryVisibleFeatures(options, callback) {
96132
- return (0,_render_VisibleFeature__WEBPACK_IMPORTED_MODULE_29__.queryVisibleFeatures)(this, options, callback);
96121
+ return (0,_render_VisibleFeature__WEBPACK_IMPORTED_MODULE_30__.queryVisibleFeatures)(this, options, callback);
96133
96122
  }
96134
96123
  /** Record graphics memory consumed by this viewport. */
96135
96124
  collectStatistics(stats) {
@@ -142254,7 +142243,7 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
142254
142243
  super(props, tree);
142255
142244
  this._everDisplayed = false;
142256
142245
  this.transformToRoot = props.transformToRoot;
142257
- this.additiveRefinement = (undefined === props.additiveRefinement) ? this.realityParent?.additiveRefinement : props.additiveRefinement;
142246
+ this.additiveRefinement = props.additiveRefinement ?? this.realityParent?.additiveRefinement;
142258
142247
  this.noContentButTerminateOnSelection = props.noContentButTerminateOnSelection;
142259
142248
  this.rangeCorners = props.rangeCorners;
142260
142249
  this.region = props.region;
@@ -142369,21 +142358,31 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
142369
142358
  child.preloadRealityTilesAtDepth(depth, context, args);
142370
142359
  }
142371
142360
  }
142361
+ // Preload tiles that are protected:
142362
+ // * used tiles (where "used" may mean: selected/preloaded for display or content requested);
142363
+ // * parents and siblings of other protected tiles.
142372
142364
  /** @internal */
142373
- selectRealityChildren(context, args, traversalDetails) {
142374
- const childrenLoadStatus = this.loadChildren(); // NB: asynchronous
142375
- if (_internal__WEBPACK_IMPORTED_MODULE_5__.TileTreeLoadStatus.Loading === childrenLoadStatus) {
142376
- args.markChildrenLoading();
142377
- traversalDetails.childrenLoading = true;
142378
- return;
142365
+ preloadProtectedTiles(args, context) {
142366
+ const children = this.realityChildren;
142367
+ let hasProtectedChildren = false;
142368
+ if (children && !this.additiveRefinement) {
142369
+ for (const child of children) {
142370
+ hasProtectedChildren = child.preloadProtectedTiles(args, context) || hasProtectedChildren;
142371
+ }
142379
142372
  }
142380
- if (undefined !== this.realityChildren) {
142381
- const traversalChildren = this.realityRoot.getTraversalChildren(this.depth);
142382
- traversalChildren.initialize();
142383
- for (let i = 0; i < this.children.length; i++)
142384
- this.realityChildren[i].selectRealityTiles(context, args, traversalChildren.getChildDetail(i));
142385
- traversalChildren.combine(traversalDetails);
142373
+ if (children && hasProtectedChildren) {
142374
+ for (const child of children) {
142375
+ if (child.isDisplayable && !child.isLoaded)
142376
+ context.preload(child, args);
142377
+ }
142378
+ return true; // Parents of protected tiles are protected
142386
142379
  }
142380
+ // Special case of the root tile
142381
+ if (this === this.realityRoot.rootTile) {
142382
+ context.preload(this, args);
142383
+ return true;
142384
+ }
142385
+ return context.selected.find((tile) => tile === this) !== undefined;
142387
142386
  }
142388
142387
  /** @internal */
142389
142388
  addBoundingGraphic(builder, color) {
@@ -142420,55 +142419,157 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
142420
142419
  if (child.isReady && child.computeVisibilityFactor(args) > 0) {
142421
142420
  scratchLoadedChildren.push(child);
142422
142421
  }
142423
- else if (!child.getLoadedRealityChildren(args))
142422
+ else if (!child.getLoadedRealityChildren(args)) {
142424
142423
  return false;
142424
+ }
142425
142425
  }
142426
142426
  return true;
142427
142427
  }
142428
142428
  /** @internal */
142429
142429
  forceSelectRealityTile() { return false; }
142430
142430
  /** @internal */
142431
+ minimumVisibleFactor() {
142432
+ if (this.additiveRefinement)
142433
+ return 0.25;
142434
+ else
142435
+ return 0;
142436
+ }
142437
+ /** @internal */
142431
142438
  selectRealityTiles(context, args, traversalDetails) {
142432
142439
  const visibility = this.computeVisibilityFactor(args);
142433
- if (visibility < 0)
142440
+ const isNotVisible = visibility < 0;
142441
+ if (isNotVisible)
142434
142442
  return;
142443
+ // Force loading if loader requires this tile. (cesium terrain visibility).
142435
142444
  if (this.realityRoot.loader.forceTileLoad(this) && !this.isReady) {
142436
- context.selectOrQueue(this, args, traversalDetails); // Force loading if loader requires this tile. (cesium terrain visibility).
142445
+ context.selectOrQueue(this, args, traversalDetails);
142437
142446
  return;
142438
142447
  }
142448
+ // Force to return early without selecting
142439
142449
  if (visibility >= 1 && this.noContentButTerminateOnSelection)
142440
142450
  return;
142441
- if (this.isDisplayable && (visibility >= 1 || this._anyChildNotFound || this.forceSelectRealityTile() || context.selectionCountExceeded)) {
142442
- if (!this.isOccluded(args.viewingSpace)) {
142443
- context.selectOrQueue(this, args, traversalDetails);
142444
- if (!this.isReady) { // This tile is visible but not loaded - Use higher resolution children if present
142445
- if (this.getLoadedRealityChildren(args))
142446
- context.select(scratchLoadedChildren, args);
142447
- scratchLoadedChildren.length = 0;
142448
- }
142449
- }
142451
+ const shouldSelectThisTile = visibility >= 1 || this._anyChildNotFound || this.forceSelectRealityTile() || context.selectionCountExceeded;
142452
+ if (shouldSelectThisTile && this.isDisplayable) { // Select this tile
142453
+ // Return early if tile is totally occluded
142454
+ if (this.isOccluded(args.viewingSpace))
142455
+ return;
142456
+ // Attempt to select this tile. If not ready, queue it
142457
+ context.selectOrQueue(this, args, traversalDetails);
142458
+ // This tile is visible but not loaded - Use higher resolution children if present
142459
+ if (!this.isReady)
142460
+ this.selectRealityChildrenAsFallback(context, args, traversalDetails);
142450
142461
  }
142451
- else {
142462
+ else { // Select children instead of this tile
142463
+ // With additive refinement it is necessary to display this tile along with any displayed children
142452
142464
  if (this.additiveRefinement && this.isDisplayable && !this.useAdditiveRefinementStepchildren())
142453
- context.selectOrQueue(this, args, traversalDetails); // With additive refinement it is necessary to display this tile along with any displayed children.
142465
+ context.selectOrQueue(this, args, traversalDetails);
142454
142466
  this.selectRealityChildren(context, args, traversalDetails);
142455
- if (this.isReady && (traversalDetails.childrenLoading || 0 !== traversalDetails.queuedChildren.length)) {
142456
- const minimumVisibleFactor = .25; // If the tile has not yet been displayed in this viewport -- display only if it is within 25% of visible. Avoid overly tiles popping into view unexpectedly (terrain)
142457
- if (visibility > minimumVisibleFactor || this._everDisplayed)
142467
+ // Children are not ready: use this tile to avoid leaving a hole
142468
+ traversalDetails.shouldSelectParent = traversalDetails.shouldSelectParent || traversalDetails.queuedChildren.length !== 0;
142469
+ if (traversalDetails.shouldSelectParent) {
142470
+ // If the tile has not yet been displayed in this viewport -- display only if it is visible enough. Avoid overly tiles popping into view unexpectedly (terrain)
142471
+ if (visibility > this.minimumVisibleFactor() || this._everDisplayed) {
142458
142472
  context.selectOrQueue(this, args, traversalDetails);
142473
+ }
142459
142474
  }
142460
142475
  }
142461
142476
  }
142477
+ // Attempt to select the children of a tile in case they could be displayed while this tile is loading. This does not take into account visibility.
142478
+ /** @internal */
142479
+ selectRealityChildrenAsFallback(context, args, traversalDetails) {
142480
+ const childrenReady = this.getLoadedRealityChildren(args);
142481
+ if (childrenReady) {
142482
+ context.select(scratchLoadedChildren, args);
142483
+ traversalDetails.shouldSelectParent = false;
142484
+ }
142485
+ scratchLoadedChildren.length = 0;
142486
+ }
142487
+ // Recurse through children to select them normally
142488
+ /** @internal */
142489
+ selectRealityChildren(context, args, traversalDetails) {
142490
+ // Load children if not yet requested
142491
+ const childrenLoadStatus = this.loadChildren(); // NB: asynchronous
142492
+ // Children are not ready yet
142493
+ if (childrenLoadStatus === _internal__WEBPACK_IMPORTED_MODULE_5__.TileTreeLoadStatus.Loading) {
142494
+ args.markChildrenLoading();
142495
+ traversalDetails.shouldSelectParent = true;
142496
+ return;
142497
+ }
142498
+ if (this.realityChildren !== undefined) {
142499
+ // Attempt to select the children
142500
+ const traversalChildren = this.realityRoot.getTraversalChildren(this.depth);
142501
+ traversalChildren.initialize();
142502
+ for (let i = 0; i < this.children.length; i++)
142503
+ this.realityChildren[i].selectRealityTiles(context, args, traversalChildren.getChildDetail(i));
142504
+ traversalChildren.combine(traversalDetails);
142505
+ }
142506
+ }
142462
142507
  /** @internal */
142463
- purgeContents(olderThan) {
142464
- // Discard contents of tiles that have not been "used" recently, where "used" may mean: selected/preloaded for display or content requested.
142508
+ purgeContents(olderThan, useProtectedTiles) {
142509
+ const tilesToPurge = new Set();
142510
+ // Get the list of tiles to purge
142511
+ if (useProtectedTiles && !this.additiveRefinement)
142512
+ this.getTilesToPurge(olderThan, tilesToPurge);
142513
+ else
142514
+ this.getTilesToPurgeWithoutProtection(olderThan, tilesToPurge);
142515
+ // Discard contents of tiles that have been marked.
142465
142516
  // Note we do not discard the child Tile objects themselves.
142466
- if (this.usageMarker.isExpired(olderThan))
142467
- this.disposeContents();
142517
+ for (const tile of tilesToPurge)
142518
+ tile.disposeContents();
142519
+ }
142520
+ // Populate a set with tiles that should be disposed. Prevent some tiles to be disposed to avoid holes when moving.
142521
+ // Return true if the current tile is "protected".
142522
+ getTilesToPurge(olderThan, tilesToPurge) {
142468
142523
  const children = this.realityChildren;
142469
- if (children)
142470
- for (const child of children)
142471
- child.purgeContents(olderThan);
142524
+ // Protected tiles cannot be purged. They are:
142525
+ // * used tiles (where "used" may mean: selected/preloaded for display or content requested);
142526
+ // * parents and siblings of other protected tiles.
142527
+ let hasProtectedChildren = false;
142528
+ if (children) {
142529
+ for (const child of children) {
142530
+ hasProtectedChildren = child.getTilesToPurge(olderThan, tilesToPurge) || hasProtectedChildren;
142531
+ }
142532
+ if (hasProtectedChildren) {
142533
+ // Siblings of protected tiles are protected too. We need to remove them from it
142534
+ for (const child of children) {
142535
+ // Because the current tile can be invisible, relying on its children to display geometry,
142536
+ // we have to recurse in order to remove the first children that has geometry, otherwise,
142537
+ // some holes might appear
142538
+ child.removeFirstDisplayableChildrenFromSet(tilesToPurge);
142539
+ }
142540
+ return true; // Parents of protected tiles are protected
142541
+ }
142542
+ }
142543
+ const isInUse = this.usageMarker.getIsTileInUse();
142544
+ if (!isInUse && this.usageMarker.isTimestampExpired(olderThan)) {
142545
+ tilesToPurge.add(this);
142546
+ }
142547
+ return isInUse;
142548
+ }
142549
+ // Populate a set with tiles that should be disposed. Does not prevent some tiles to be disposed to avoid holes when moving.
142550
+ // This method is simpler and more fitting for devices that has a bigger memory constraint, such as mobiles.
142551
+ // However, it causes the apparition of holes by letting important tiles to be purged.
142552
+ getTilesToPurgeWithoutProtection(olderThan, tilesToPurge) {
142553
+ const children = this.realityChildren;
142554
+ if (children) {
142555
+ for (const child of children) {
142556
+ child.getTilesToPurgeWithoutProtection(olderThan, tilesToPurge);
142557
+ }
142558
+ }
142559
+ if (this.usageMarker.isExpired(olderThan))
142560
+ tilesToPurge.add(this);
142561
+ }
142562
+ removeFirstDisplayableChildrenFromSet(set) {
142563
+ if (set.size === 0)
142564
+ return;
142565
+ if (this.isDisplayable) {
142566
+ set.delete(this);
142567
+ return;
142568
+ }
142569
+ if (this.realityChildren !== undefined) {
142570
+ for (const child of this.realityChildren)
142571
+ child.removeFirstDisplayableChildrenFromSet(set);
142572
+ }
142472
142573
  }
142473
142574
  /** @internal */
142474
142575
  computeVisibilityFactor(args) {
@@ -142495,26 +142596,6 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
142495
142596
  return this.maximumSize / args.getPixelSize(this);
142496
142597
  }
142497
142598
  /** @internal */
142498
- preloadTilesInFrustum(args, context, preloadSizeModifier) {
142499
- const visibility = this.computeVisibilityFactor(args);
142500
- if (visibility < 0)
142501
- return;
142502
- if (visibility * preloadSizeModifier > 1) {
142503
- if (this.isDisplayable)
142504
- context.preload(this, args);
142505
- }
142506
- else {
142507
- const childrenLoadStatus = this.loadChildren(); // NB: asynchronous
142508
- if (_internal__WEBPACK_IMPORTED_MODULE_5__.TileTreeLoadStatus.Loading === childrenLoadStatus) {
142509
- args.markChildrenLoading();
142510
- }
142511
- else if (undefined !== this.realityChildren) {
142512
- for (const child of this.realityChildren)
142513
- child.preloadTilesInFrustum(args, context, preloadSizeModifier);
142514
- }
142515
- }
142516
- }
142517
- /** @internal */
142518
142599
  get _anyChildNotFound() {
142519
142600
  if (undefined !== this.children)
142520
142601
  for (const child of this.children)
@@ -142951,13 +143032,13 @@ __webpack_require__.r(__webpack_exports__);
142951
143032
  class TraversalDetails {
142952
143033
  constructor() {
142953
143034
  this.queuedChildren = new Array();
142954
- this.childrenLoading = false;
142955
143035
  this.childrenSelected = false;
143036
+ this.shouldSelectParent = false;
142956
143037
  }
142957
143038
  initialize() {
142958
143039
  this.queuedChildren.length = 0;
142959
- this.childrenLoading = false;
142960
143040
  this.childrenSelected = false;
143041
+ this.shouldSelectParent = false;
142961
143042
  }
142962
143043
  }
142963
143044
  /** @internal */
@@ -142976,11 +143057,11 @@ class TraversalChildrenDetails {
142976
143057
  }
142977
143058
  combine(parentDetails) {
142978
143059
  parentDetails.queuedChildren.length = 0;
142979
- parentDetails.childrenLoading = false;
142980
143060
  parentDetails.childrenSelected = false;
143061
+ parentDetails.shouldSelectParent = false;
142981
143062
  for (const child of this._childDetails) {
142982
- parentDetails.childrenLoading = parentDetails.childrenLoading || child.childrenLoading;
142983
143063
  parentDetails.childrenSelected = parentDetails.childrenSelected || child.childrenSelected;
143064
+ parentDetails.shouldSelectParent = parentDetails.shouldSelectParent || child.shouldSelectParent;
142984
143065
  for (const queuedChild of child.queuedChildren)
142985
143066
  parentDetails.queuedChildren.push(queuedChild);
142986
143067
  }
@@ -143000,14 +143081,15 @@ class TraversalSelectionContext {
143000
143081
  selectOrQueue(tile, args, traversalDetails) {
143001
143082
  tile.selectSecondaryTiles(args, this);
143002
143083
  tile.markUsed(args);
143084
+ traversalDetails.shouldSelectParent = true;
143003
143085
  if (tile.isReady) {
143004
143086
  args.markReady(tile);
143005
143087
  this.selected.push(tile);
143006
143088
  tile.markDisplayed();
143007
143089
  this.displayedDescendants.push((traversalDetails.childrenSelected) ? traversalDetails.queuedChildren.slice() : []);
143008
143090
  traversalDetails.queuedChildren.length = 0;
143009
- traversalDetails.childrenLoading = false;
143010
143091
  traversalDetails.childrenSelected = true;
143092
+ traversalDetails.shouldSelectParent = false;
143011
143093
  }
143012
143094
  else if (!tile.isNotFound) {
143013
143095
  traversalDetails.queuedChildren.push(tile);
@@ -143034,7 +143116,6 @@ class TraversalSelectionContext {
143034
143116
  }
143035
143117
  }
143036
143118
  }
143037
- const scratchFrustum = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Frustum();
143038
143119
  const scratchCarto = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Cartographic.createZero();
143039
143120
  const scratchPoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero(), scratchOrigin = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
143040
143121
  const scratchRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d.createNull();
@@ -143094,7 +143175,7 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
143094
143175
  /** @internal */
143095
143176
  prune() {
143096
143177
  const olderThan = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().minus(this.expirationTime);
143097
- this.rootTile.purgeContents(olderThan);
143178
+ this.rootTile.purgeContents(olderThan, !_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.ProcessDetector.isMobileBrowser);
143098
143179
  }
143099
143180
  /** @internal */
143100
143181
  draw(args) {
@@ -143281,7 +143362,7 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
143281
143362
  if (baseDepth > 0) // Maps may force loading of low level globe tiles.
143282
143363
  rootTile.preloadRealityTilesAtDepth(baseDepth, context, args);
143283
143364
  if (!freezeTiles)
143284
- this.preloadTilesForScene(args, context, undefined);
143365
+ rootTile.preloadProtectedTiles(args, context);
143285
143366
  }
143286
143367
  if (!freezeTiles)
143287
143368
  for (const tile of context.missing) {
@@ -143312,19 +143393,6 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
143312
143393
  return selected;
143313
143394
  }
143314
143395
  /** @internal */
143315
- preloadTilesForScene(args, context, frustumTransform) {
143316
- const preloadFrustum = args.viewingSpace.getPreloadFrustum(frustumTransform, scratchFrustum);
143317
- const preloadFrustumPlanes = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FrustumPlanes.fromFrustum(preloadFrustum);
143318
- const worldToNpc = preloadFrustum.toMap4d();
143319
- const preloadWorldToViewMap = args.viewingSpace.calcNpcToView().multiplyMapMap(worldToNpc);
143320
- const preloadArgs = new _internal__WEBPACK_IMPORTED_MODULE_6__.RealityTileDrawArgs(args, preloadWorldToViewMap, preloadFrustumPlanes);
143321
- if (context.preloadDebugBuilder) {
143322
- context.preloadDebugBuilder.setSymbology(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.blue, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.blue, 2, 0);
143323
- context.preloadDebugBuilder.addFrustum(preloadFrustum);
143324
- }
143325
- this.rootTile.preloadTilesInFrustum(preloadArgs, context, 2);
143326
- }
143327
- /** @internal */
143328
143396
  logTiles(label, tiles) {
143329
143397
  let depthString = "";
143330
143398
  let min = 10000, max = -10000;
@@ -146549,7 +146617,15 @@ class TileUsageMarker {
146549
146617
  }
146550
146618
  /** Returns true if this tile is currently in use by no [[TileUser]]s and its timestamp pre-dates `expirationTime`. */
146551
146619
  isExpired(expirationTime) {
146552
- return this._timePoint.before(expirationTime) && !_IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.tileAdmin.isTileInUse(this);
146620
+ return this.isTimestampExpired(expirationTime) && !this.getIsTileInUse();
146621
+ }
146622
+ /** Returns true if this tile is currently in use by any [[TileUser]]. */
146623
+ getIsTileInUse() {
146624
+ return _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.tileAdmin.isTileInUse(this);
146625
+ }
146626
+ /** Returns true if this tile's timestamp pre-dates `expirationTime`, without checking if it is in use. */
146627
+ isTimestampExpired(expirationTime) {
146628
+ return this._timePoint.before(expirationTime);
146553
146629
  }
146554
146630
  /** Updates the timestamp to the specified time and marks the tile as being in use by the specified [[TileUser]]. */
146555
146631
  mark(user, time) {
@@ -150115,14 +150191,13 @@ __webpack_require__.r(__webpack_exports__);
150115
150191
 
150116
150192
 
150117
150193
  const loggerCategory = "ArcGISFeatureProvider";
150118
- /** @beta */
150119
150194
  /** Class representing a map-layer format.
150120
150195
  * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].
150121
150196
  * When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.
150122
150197
  * The MapLayerFormat object can later be used to validate a source, or create a provider.
150123
150198
  *
150124
- * Subclasses should override formatId and [[MapLayerFormat.createImageryProvider]].
150125
- * @beta
150199
+ * Subclasses should override formatId and [[MapLayerFormat.createImageryProvider]].
150200
+ * @public
150126
150201
  */
150127
150202
  class MapLayerFormat {
150128
150203
  /** Register the current format in the [[MapLayerFormatRegistry]].
@@ -150141,7 +150216,9 @@ class MapLayerFormat {
150141
150216
  return undefined;
150142
150217
  }
150143
150218
  }
150144
- /** @beta */
150219
+ /** A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].
150220
+ * @public
150221
+ */
150145
150222
  class MapLayerFormatRegistry {
150146
150223
  constructor(opts) {
150147
150224
  this._formats = new Map();
@@ -150149,11 +150226,12 @@ class MapLayerFormatRegistry {
150149
150226
  _internal__WEBPACK_IMPORTED_MODULE_2__.internalMapLayerImageryFormats.forEach((format) => this.register(format));
150150
150227
  }
150151
150228
  isRegistered(formatId) { return this._formats.get(formatId) !== undefined; }
150152
- register(formatClass, accessClient) {
150229
+ register(formatClass) {
150153
150230
  if (formatClass.formatId.length === 0)
150154
150231
  return; // must be an abstract class, ignore it
150155
- this._formats.set(formatClass.formatId, { type: formatClass, accessClient });
150232
+ this._formats.set(formatClass.formatId, { type: formatClass });
150156
150233
  }
150234
+ /** @beta */
150157
150235
  setAccessClient(formatId, accessClient) {
150158
150236
  const entry = this._formats.get(formatId);
150159
150237
  if (entry !== undefined) {
@@ -150162,6 +150240,7 @@ class MapLayerFormatRegistry {
150162
150240
  }
150163
150241
  return false;
150164
150242
  }
150243
+ /** @beta */
150165
150244
  getAccessClient(formatId) {
150166
150245
  if (formatId.length === 0)
150167
150246
  return undefined;
@@ -150180,7 +150259,9 @@ class MapLayerFormatRegistry {
150180
150259
  }
150181
150260
  return format.createMapLayerTree(layerSettings, layerIndex, iModel);
150182
150261
  }
150183
- /** @internal */
150262
+ /** Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.
150263
+ * @internal
150264
+ */
150184
150265
  createImageryProvider(layerSettings) {
150185
150266
  const entry = this._formats.get(layerSettings.formatId);
150186
150267
  const format = entry?.type;
@@ -150410,26 +150491,33 @@ __webpack_require__.r(__webpack_exports__);
150410
150491
  const tileImageSize = 256, untiledImageSize = 256;
150411
150492
  const earthRadius = 6378137;
150412
150493
  const doDebugToolTips = false;
150413
- /** @beta */
150494
+ /** The status of the map layer imagery provider that lets you know if authentication is needed to request tiles.
150495
+ * @public
150496
+ */
150414
150497
  var MapLayerImageryProviderStatus;
150415
150498
  (function (MapLayerImageryProviderStatus) {
150416
150499
  MapLayerImageryProviderStatus[MapLayerImageryProviderStatus["Valid"] = 0] = "Valid";
150417
150500
  MapLayerImageryProviderStatus[MapLayerImageryProviderStatus["RequireAuth"] = 1] = "RequireAuth";
150418
150501
  })(MapLayerImageryProviderStatus || (MapLayerImageryProviderStatus = {}));
150419
- /** Base class for map layer imagery providers.
150420
- * @internal
150502
+ /** Abstract class for map layer imagery providers.
150503
+ * Map layer imagery providers request and provide tile images and other data. Each map layer from a separate source needs its own imagery provider object.
150504
+ * @beta
150421
150505
  */
150422
150506
  class MapLayerImageryProvider {
150507
+ /** @internal */
150423
150508
  get status() { return this._status; }
150424
150509
  resetStatus() { this.setStatus(MapLayerImageryProviderStatus.Valid); }
150510
+ /** @internal */
150425
150511
  get tileSize() { return this._usesCachedTiles ? tileImageSize : untiledImageSize; }
150512
+ /** @internal */
150426
150513
  get maximumScreenSize() { return 2 * this.tileSize; }
150427
150514
  get minimumZoomLevel() { return this.defaultMinimumZoomLevel; }
150428
150515
  get maximumZoomLevel() { return this.defaultMaximumZoomLevel; }
150516
+ /** @internal */
150429
150517
  get usesCachedTiles() { return this._usesCachedTiles; }
150430
150518
  get mutualExclusiveSubLayer() { return false; }
150519
+ /** @internal */
150431
150520
  get useGeographicTilingScheme() { return false; }
150432
- get hasSuccessfullyFetchedTile() { return this._hasSuccessfullyFetchedTile; }
150433
150521
  /** @internal */
150434
150522
  get _filterByCartoRange() { return true; }
150435
150523
  constructor(_settings, _usesCachedTiles) {
@@ -150451,6 +150539,7 @@ class MapLayerImageryProvider {
150451
150539
  this._mercatorTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.WebMercatorTilingScheme();
150452
150540
  this._geographicTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.GeographicTilingScheme(2, 1, true);
150453
150541
  }
150542
+ /** @internal */
150454
150543
  async initialize() {
150455
150544
  this.loadTile(0, 0, this.defaultMaximumZoomLevel).then((tileData) => {
150456
150545
  if (tileData !== undefined)
@@ -150460,15 +150549,20 @@ class MapLayerImageryProvider {
150460
150549
  get tilingScheme() { return this.useGeographicTilingScheme ? this._geographicTilingScheme : this._mercatorTilingScheme; }
150461
150550
  /** @internal */
150462
150551
  addLogoCards(_cards, _viewport) { }
150552
+ /** @internal */
150463
150553
  get transparentBackgroundString() { return this._settings.transparentBackground ? "true" : "false"; }
150554
+ /** @internal */
150464
150555
  async _areChildrenAvailable(_tile) { return true; }
150556
+ /** @internal */
150465
150557
  getPotentialChildIds(tile) {
150466
150558
  const childLevel = tile.quadId.level + 1;
150467
150559
  return tile.quadId.getChildIds(this.tilingScheme.getNumberOfXChildrenAtLevel(childLevel), this.tilingScheme.getNumberOfYChildrenAtLevel(childLevel));
150468
150560
  }
150561
+ /** @internal */
150469
150562
  _generateChildIds(tile, resolveChildren) {
150470
150563
  resolveChildren(this.getPotentialChildIds(tile));
150471
150564
  }
150565
+ /** @internal */
150472
150566
  generateChildIds(tile, resolveChildren) {
150473
150567
  if (tile.depth >= this.maximumZoomLevel || (undefined !== this.cartoRange && this._filterByCartoRange && !this.cartoRange.intersectsRange(tile.rectangle))) {
150474
150568
  tile.setLeaf();
@@ -150476,12 +150570,14 @@ class MapLayerImageryProvider {
150476
150570
  }
150477
150571
  this._generateChildIds(tile, resolveChildren);
150478
150572
  }
150573
+ /** @internal */
150479
150574
  async getToolTip(strings, quadId, _carto, tree) {
150480
150575
  if (doDebugToolTips) {
150481
150576
  const range = quadId.getLatLongRangeDegrees(tree.tilingScheme);
150482
150577
  strings.push(`QuadId: ${quadId.debugString}, Lat: ${range.low.x} - ${range.high.x} Long: ${range.low.y} - ${range.high.y}`);
150483
150578
  }
150484
150579
  }
150580
+ /** @internal */
150485
150581
  async getFeatureInfo(featureInfos, _quadId, _carto, _tree) {
150486
150582
  // default implementation; simply return an empty feature info
150487
150583
  featureInfos.push({ layerName: this._settings.name });
@@ -150511,7 +150607,8 @@ class MapLayerImageryProvider {
150511
150607
  }
150512
150608
  /** Change the status of this provider.
150513
150609
  * Sub-classes should override 'onStatusUpdated' instead of this method.
150514
- * @internal */
150610
+ * @internal
150611
+ */
150515
150612
  setStatus(status) {
150516
150613
  if (this._status !== status) {
150517
150614
  this.onStatusUpdated(status);
@@ -150521,9 +150618,8 @@ class MapLayerImageryProvider {
150521
150618
  }
150522
150619
  /** Method called whenever the status changes, giving the opportunity to sub-classes to have a custom behavior.
150523
150620
  * @internal
150524
- * */
150525
- onStatusUpdated(_newStatus) {
150526
- }
150621
+ */
150622
+ onStatusUpdated(_newStatus) { }
150527
150623
  /** @internal */
150528
150624
  setRequestAuthorization(headers) {
150529
150625
  if (this._settings.userName && this._settings.password) {
@@ -150539,6 +150635,7 @@ class MapLayerImageryProvider {
150539
150635
  }
150540
150636
  return fetch(url, { method: "GET", headers });
150541
150637
  }
150638
+ /** Returns a map layer tile at the specified settings. */
150542
150639
  async loadTile(row, column, zoomLevel) {
150543
150640
  try {
150544
150641
  const tileUrl = await this.constructUrl(row, column, zoomLevel);
@@ -150693,8 +150790,7 @@ __webpack_require__.r(__webpack_exports__);
150693
150790
 
150694
150791
 
150695
150792
 
150696
- /**
150697
- * Values for return codes from [[MapLayerSource.validateSource]]
150793
+ /** Values for return codes from [[MapLayerSource.validateSource]]
150698
150794
  * @public
150699
150795
  */
150700
150796
  var MapLayerSourceStatus;
@@ -150714,7 +150810,7 @@ var MapLayerSourceStatus;
150714
150810
  /** Map-layer coordinate system is not supported */
150715
150811
  MapLayerSourceStatus[MapLayerSourceStatus["InvalidCoordinateSystem"] = 6] = "InvalidCoordinateSystem";
150716
150812
  })(MapLayerSourceStatus || (MapLayerSourceStatus = {}));
150717
- /** A source for map layers. These may be catalogued for convenient use by users or applications.
150813
+ /** A source for map layers. These may be catalogued for convenient use by users or applications.
150718
150814
  * @public
150719
150815
  */
150720
150816
  class MapLayerSource {
@@ -150763,7 +150859,7 @@ class MapLayerSource {
150763
150859
  }
150764
150860
  }
150765
150861
  /** A collection of [[MapLayerSource]] objects.
150766
- * @internal
150862
+ * @beta
150767
150863
  */
150768
150864
  class MapLayerSources {
150769
150865
  constructor(_sources) {
@@ -151522,6 +151618,10 @@ class MapTile extends _internal__WEBPACK_IMPORTED_MODULE_7__.RealityTile {
151522
151618
  return parentHeightDepth > MapTile._maxParentHeightDepth;
151523
151619
  }
151524
151620
  /** @internal */
151621
+ minimumVisibleFactor() {
151622
+ return 0.25;
151623
+ }
151624
+ /** @internal */
151525
151625
  getDrapeTextures() {
151526
151626
  if (undefined === this._imageryTiles)
151527
151627
  return undefined;
@@ -153066,12 +153166,12 @@ class MapTiledGraphicsProvider {
153066
153166
  this._detachFromDisplayStyle.length = 0;
153067
153167
  }
153068
153168
  /** @internal */
153069
- getMapLayerImageryProvider(index, isOverlay) {
153070
- const imageryTreeRef = isOverlay ? this.overlayMap.getLayerImageryTreeRef(index) : this.backgroundMap.getLayerImageryTreeRef(index);
153169
+ getMapLayerImageryProvider(mapLayerIndex) {
153170
+ const imageryTreeRef = mapLayerIndex.isOverlay ? this.overlayMap.getLayerImageryTreeRef(mapLayerIndex.index) : this.backgroundMap.getLayerImageryTreeRef(mapLayerIndex.index);
153071
153171
  return imageryTreeRef?.imageryProvider;
153072
153172
  }
153073
- resetMapLayer(index, isOverlay) {
153074
- const imageryTreeRef = isOverlay ? this.overlayMap.getLayerImageryTreeRef(index) : this.backgroundMap.getLayerImageryTreeRef(index);
153173
+ resetMapLayer(mapLayerIndex) {
153174
+ const imageryTreeRef = mapLayerIndex.isOverlay ? this.overlayMap.getLayerImageryTreeRef(mapLayerIndex.index) : this.backgroundMap.getLayerImageryTreeRef(mapLayerIndex.index);
153075
153175
  imageryTreeRef?.resetTreeOwner();
153076
153176
  }
153077
153177
  /** Return a list of map-layers indexes matching a given MapTile tree Id and a layer imagery tree id.
@@ -157986,8 +158086,7 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
157986
158086
  ids.add(id);
157987
158087
  try {
157988
158088
  const ecsql = `SELECT ECInstanceId as id, Parent.Id as parentId FROM BisCore.GeometricElement WHERE Parent.Id IN (SELECT Parent.Id as parentId FROM BisCore.GeometricElement WHERE parent.Id != 0 AND ECInstanceId IN (${id}))`;
157989
- // eslint-disable-next-line deprecation/deprecation
157990
- for await (const row of this.iModel.query(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
158089
+ for await (const row of this.iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
157991
158090
  ids.add(row.parentId);
157992
158091
  ids.add(row.id);
157993
158092
  }
@@ -284204,7 +284303,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
284204
284303
  /***/ ((module) => {
284205
284304
 
284206
284305
  "use strict";
284207
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.72","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","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 ES2020 --outDir lib/esm","clean":"rimraf 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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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-eslintrc -c \\"./node_modules/@itwin/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/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:^4.0.0-dev.72","@itwin/core-bentley":"workspace:^4.0.0-dev.72","@itwin/core-common":"workspace:^4.0.0-dev.72","@itwin/core-geometry":"workspace:^4.0.0-dev.72","@itwin/core-orbitgt":"workspace:^4.0.0-dev.72","@itwin/core-quantity":"workspace:^4.0.0-dev.72"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.0-dev.33","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/semver":"7.3.10","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.36.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~5.0.2","webpack":"^5.76.0"},"//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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","semver":"^7.3.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
284306
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.75","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","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 ES2020 --outDir lib/esm","clean":"rimraf 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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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-eslintrc -c \\"./node_modules/@itwin/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/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:^4.0.0-dev.75","@itwin/core-bentley":"workspace:^4.0.0-dev.75","@itwin/core-common":"workspace:^4.0.0-dev.75","@itwin/core-geometry":"workspace:^4.0.0-dev.75","@itwin/core-orbitgt":"workspace:^4.0.0-dev.75","@itwin/core-quantity":"workspace:^4.0.0-dev.75"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.0-dev.33","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/semver":"7.3.10","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.36.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~5.0.2","webpack":"^5.76.0"},"//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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","semver":"^7.3.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
284208
284307
 
284209
284308
  /***/ })
284210
284309