@itwin/ecschema-rpcinterface-tests 4.0.0-dev.73 → 4.0.0-dev.76

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.
94489
94465
  */
94490
- resetMapLayer(index, isOverlay) { this._mapTiledGraphicsProvider?.resetMapLayer(index, isOverlay); }
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
94478
+ */
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) {
@@ -150202,14 +150191,13 @@ __webpack_require__.r(__webpack_exports__);
150202
150191
 
150203
150192
 
150204
150193
  const loggerCategory = "ArcGISFeatureProvider";
150205
- /** @beta */
150206
150194
  /** Class representing a map-layer format.
150207
150195
  * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].
150208
150196
  * When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.
150209
150197
  * The MapLayerFormat object can later be used to validate a source, or create a provider.
150210
150198
  *
150211
- * Subclasses should override formatId and [[MapLayerFormat.createImageryProvider]].
150212
- * @beta
150199
+ * Subclasses should override formatId and [[MapLayerFormat.createImageryProvider]].
150200
+ * @public
150213
150201
  */
150214
150202
  class MapLayerFormat {
150215
150203
  /** Register the current format in the [[MapLayerFormatRegistry]].
@@ -150228,7 +150216,9 @@ class MapLayerFormat {
150228
150216
  return undefined;
150229
150217
  }
150230
150218
  }
150231
- /** @beta */
150219
+ /** A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].
150220
+ * @public
150221
+ */
150232
150222
  class MapLayerFormatRegistry {
150233
150223
  constructor(opts) {
150234
150224
  this._formats = new Map();
@@ -150236,11 +150226,12 @@ class MapLayerFormatRegistry {
150236
150226
  _internal__WEBPACK_IMPORTED_MODULE_2__.internalMapLayerImageryFormats.forEach((format) => this.register(format));
150237
150227
  }
150238
150228
  isRegistered(formatId) { return this._formats.get(formatId) !== undefined; }
150239
- register(formatClass, accessClient) {
150229
+ register(formatClass) {
150240
150230
  if (formatClass.formatId.length === 0)
150241
150231
  return; // must be an abstract class, ignore it
150242
- this._formats.set(formatClass.formatId, { type: formatClass, accessClient });
150232
+ this._formats.set(formatClass.formatId, { type: formatClass });
150243
150233
  }
150234
+ /** @beta */
150244
150235
  setAccessClient(formatId, accessClient) {
150245
150236
  const entry = this._formats.get(formatId);
150246
150237
  if (entry !== undefined) {
@@ -150249,6 +150240,7 @@ class MapLayerFormatRegistry {
150249
150240
  }
150250
150241
  return false;
150251
150242
  }
150243
+ /** @beta */
150252
150244
  getAccessClient(formatId) {
150253
150245
  if (formatId.length === 0)
150254
150246
  return undefined;
@@ -150267,7 +150259,9 @@ class MapLayerFormatRegistry {
150267
150259
  }
150268
150260
  return format.createMapLayerTree(layerSettings, layerIndex, iModel);
150269
150261
  }
150270
- /** @internal */
150262
+ /** Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.
150263
+ * @internal
150264
+ */
150271
150265
  createImageryProvider(layerSettings) {
150272
150266
  const entry = this._formats.get(layerSettings.formatId);
150273
150267
  const format = entry?.type;
@@ -150497,26 +150491,33 @@ __webpack_require__.r(__webpack_exports__);
150497
150491
  const tileImageSize = 256, untiledImageSize = 256;
150498
150492
  const earthRadius = 6378137;
150499
150493
  const doDebugToolTips = false;
150500
- /** @beta */
150494
+ /** The status of the map layer imagery provider that lets you know if authentication is needed to request tiles.
150495
+ * @public
150496
+ */
150501
150497
  var MapLayerImageryProviderStatus;
150502
150498
  (function (MapLayerImageryProviderStatus) {
150503
150499
  MapLayerImageryProviderStatus[MapLayerImageryProviderStatus["Valid"] = 0] = "Valid";
150504
150500
  MapLayerImageryProviderStatus[MapLayerImageryProviderStatus["RequireAuth"] = 1] = "RequireAuth";
150505
150501
  })(MapLayerImageryProviderStatus || (MapLayerImageryProviderStatus = {}));
150506
- /** Base class for map layer imagery providers.
150507
- * @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
150508
150505
  */
150509
150506
  class MapLayerImageryProvider {
150507
+ /** @internal */
150510
150508
  get status() { return this._status; }
150511
150509
  resetStatus() { this.setStatus(MapLayerImageryProviderStatus.Valid); }
150510
+ /** @internal */
150512
150511
  get tileSize() { return this._usesCachedTiles ? tileImageSize : untiledImageSize; }
150512
+ /** @internal */
150513
150513
  get maximumScreenSize() { return 2 * this.tileSize; }
150514
150514
  get minimumZoomLevel() { return this.defaultMinimumZoomLevel; }
150515
150515
  get maximumZoomLevel() { return this.defaultMaximumZoomLevel; }
150516
+ /** @internal */
150516
150517
  get usesCachedTiles() { return this._usesCachedTiles; }
150517
150518
  get mutualExclusiveSubLayer() { return false; }
150519
+ /** @internal */
150518
150520
  get useGeographicTilingScheme() { return false; }
150519
- get hasSuccessfullyFetchedTile() { return this._hasSuccessfullyFetchedTile; }
150520
150521
  /** @internal */
150521
150522
  get _filterByCartoRange() { return true; }
150522
150523
  constructor(_settings, _usesCachedTiles) {
@@ -150538,6 +150539,7 @@ class MapLayerImageryProvider {
150538
150539
  this._mercatorTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.WebMercatorTilingScheme();
150539
150540
  this._geographicTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.GeographicTilingScheme(2, 1, true);
150540
150541
  }
150542
+ /** @internal */
150541
150543
  async initialize() {
150542
150544
  this.loadTile(0, 0, this.defaultMaximumZoomLevel).then((tileData) => {
150543
150545
  if (tileData !== undefined)
@@ -150547,15 +150549,20 @@ class MapLayerImageryProvider {
150547
150549
  get tilingScheme() { return this.useGeographicTilingScheme ? this._geographicTilingScheme : this._mercatorTilingScheme; }
150548
150550
  /** @internal */
150549
150551
  addLogoCards(_cards, _viewport) { }
150552
+ /** @internal */
150550
150553
  get transparentBackgroundString() { return this._settings.transparentBackground ? "true" : "false"; }
150554
+ /** @internal */
150551
150555
  async _areChildrenAvailable(_tile) { return true; }
150556
+ /** @internal */
150552
150557
  getPotentialChildIds(tile) {
150553
150558
  const childLevel = tile.quadId.level + 1;
150554
150559
  return tile.quadId.getChildIds(this.tilingScheme.getNumberOfXChildrenAtLevel(childLevel), this.tilingScheme.getNumberOfYChildrenAtLevel(childLevel));
150555
150560
  }
150561
+ /** @internal */
150556
150562
  _generateChildIds(tile, resolveChildren) {
150557
150563
  resolveChildren(this.getPotentialChildIds(tile));
150558
150564
  }
150565
+ /** @internal */
150559
150566
  generateChildIds(tile, resolveChildren) {
150560
150567
  if (tile.depth >= this.maximumZoomLevel || (undefined !== this.cartoRange && this._filterByCartoRange && !this.cartoRange.intersectsRange(tile.rectangle))) {
150561
150568
  tile.setLeaf();
@@ -150563,12 +150570,14 @@ class MapLayerImageryProvider {
150563
150570
  }
150564
150571
  this._generateChildIds(tile, resolveChildren);
150565
150572
  }
150573
+ /** @internal */
150566
150574
  async getToolTip(strings, quadId, _carto, tree) {
150567
150575
  if (doDebugToolTips) {
150568
150576
  const range = quadId.getLatLongRangeDegrees(tree.tilingScheme);
150569
150577
  strings.push(`QuadId: ${quadId.debugString}, Lat: ${range.low.x} - ${range.high.x} Long: ${range.low.y} - ${range.high.y}`);
150570
150578
  }
150571
150579
  }
150580
+ /** @internal */
150572
150581
  async getFeatureInfo(featureInfos, _quadId, _carto, _tree) {
150573
150582
  // default implementation; simply return an empty feature info
150574
150583
  featureInfos.push({ layerName: this._settings.name });
@@ -150598,7 +150607,8 @@ class MapLayerImageryProvider {
150598
150607
  }
150599
150608
  /** Change the status of this provider.
150600
150609
  * Sub-classes should override 'onStatusUpdated' instead of this method.
150601
- * @internal */
150610
+ * @internal
150611
+ */
150602
150612
  setStatus(status) {
150603
150613
  if (this._status !== status) {
150604
150614
  this.onStatusUpdated(status);
@@ -150608,9 +150618,8 @@ class MapLayerImageryProvider {
150608
150618
  }
150609
150619
  /** Method called whenever the status changes, giving the opportunity to sub-classes to have a custom behavior.
150610
150620
  * @internal
150611
- * */
150612
- onStatusUpdated(_newStatus) {
150613
- }
150621
+ */
150622
+ onStatusUpdated(_newStatus) { }
150614
150623
  /** @internal */
150615
150624
  setRequestAuthorization(headers) {
150616
150625
  if (this._settings.userName && this._settings.password) {
@@ -150626,6 +150635,7 @@ class MapLayerImageryProvider {
150626
150635
  }
150627
150636
  return fetch(url, { method: "GET", headers });
150628
150637
  }
150638
+ /** Returns a map layer tile at the specified settings. */
150629
150639
  async loadTile(row, column, zoomLevel) {
150630
150640
  try {
150631
150641
  const tileUrl = await this.constructUrl(row, column, zoomLevel);
@@ -150780,8 +150790,7 @@ __webpack_require__.r(__webpack_exports__);
150780
150790
 
150781
150791
 
150782
150792
 
150783
- /**
150784
- * Values for return codes from [[MapLayerSource.validateSource]]
150793
+ /** Values for return codes from [[MapLayerSource.validateSource]]
150785
150794
  * @public
150786
150795
  */
150787
150796
  var MapLayerSourceStatus;
@@ -150801,7 +150810,7 @@ var MapLayerSourceStatus;
150801
150810
  /** Map-layer coordinate system is not supported */
150802
150811
  MapLayerSourceStatus[MapLayerSourceStatus["InvalidCoordinateSystem"] = 6] = "InvalidCoordinateSystem";
150803
150812
  })(MapLayerSourceStatus || (MapLayerSourceStatus = {}));
150804
- /** 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.
150805
150814
  * @public
150806
150815
  */
150807
150816
  class MapLayerSource {
@@ -150850,7 +150859,7 @@ class MapLayerSource {
150850
150859
  }
150851
150860
  }
150852
150861
  /** A collection of [[MapLayerSource]] objects.
150853
- * @internal
150862
+ * @beta
150854
150863
  */
150855
150864
  class MapLayerSources {
150856
150865
  constructor(_sources) {
@@ -153157,12 +153166,12 @@ class MapTiledGraphicsProvider {
153157
153166
  this._detachFromDisplayStyle.length = 0;
153158
153167
  }
153159
153168
  /** @internal */
153160
- getMapLayerImageryProvider(index, isOverlay) {
153161
- 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);
153162
153171
  return imageryTreeRef?.imageryProvider;
153163
153172
  }
153164
- resetMapLayer(index, isOverlay) {
153165
- 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);
153166
153175
  imageryTreeRef?.resetTreeOwner();
153167
153176
  }
153168
153177
  /** Return a list of map-layers indexes matching a given MapTile tree Id and a layer imagery tree id.
@@ -158077,8 +158086,7 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
158077
158086
  ids.add(id);
158078
158087
  try {
158079
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}))`;
158080
- // eslint-disable-next-line deprecation/deprecation
158081
- 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 })) {
158082
158090
  ids.add(row.parentId);
158083
158091
  ids.add(row.id);
158084
158092
  }
@@ -284295,7 +284303,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
284295
284303
  /***/ ((module) => {
284296
284304
 
284297
284305
  "use strict";
284298
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.73","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.73","@itwin/core-bentley":"workspace:^4.0.0-dev.73","@itwin/core-common":"workspace:^4.0.0-dev.73","@itwin/core-geometry":"workspace:^4.0.0-dev.73","@itwin/core-orbitgt":"workspace:^4.0.0-dev.73","@itwin/core-quantity":"workspace:^4.0.0-dev.73"},"//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.76","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.76","@itwin/core-bentley":"workspace:^4.0.0-dev.76","@itwin/core-common":"workspace:^4.0.0-dev.76","@itwin/core-geometry":"workspace:^4.0.0-dev.76","@itwin/core-orbitgt":"workspace:^4.0.0-dev.76","@itwin/core-quantity":"workspace:^4.0.0-dev.76"},"//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"}}]}}');
284299
284307
 
284300
284308
  /***/ })
284301
284309