@itwin/ecschema-rpcinterface-tests 4.3.0-dev.33 → 4.3.0-dev.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/bundled-tests.js +340 -119
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_4_14_node_modules_loaders_gl_draco_d-aa4ff5.bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -37269,6 +37269,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
37269
37269
|
/* harmony export */ });
|
|
37270
37270
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
37271
37271
|
/* harmony import */ var _BackgroundMapProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BackgroundMapProvider */ "../../core/common/lib/esm/BackgroundMapProvider.js");
|
|
37272
|
+
/* eslint-disable deprecation/deprecation */
|
|
37272
37273
|
/*---------------------------------------------------------------------------------------------
|
|
37273
37274
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
37274
37275
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -37402,6 +37403,9 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
37402
37403
|
this.formatId = props.formatId;
|
|
37403
37404
|
this.url = props.url;
|
|
37404
37405
|
this.accessKey = props.accessKey;
|
|
37406
|
+
if (props.queryParams) {
|
|
37407
|
+
this.savedQueryParams = { ...props.queryParams };
|
|
37408
|
+
}
|
|
37405
37409
|
this.subLayers = [];
|
|
37406
37410
|
if (!props.subLayers)
|
|
37407
37411
|
return;
|
|
@@ -37421,6 +37425,8 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
37421
37425
|
props.formatId = this.formatId;
|
|
37422
37426
|
if (this.subLayers.length > 0)
|
|
37423
37427
|
props.subLayers = this.subLayers.map((x) => x.toJSON());
|
|
37428
|
+
if (this.savedQueryParams)
|
|
37429
|
+
props.queryParams = { ...this.savedQueryParams };
|
|
37424
37430
|
return props;
|
|
37425
37431
|
}
|
|
37426
37432
|
/** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
|
|
@@ -37433,6 +37439,10 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
37433
37439
|
clone.userName = this.userName;
|
|
37434
37440
|
clone.password = this.password;
|
|
37435
37441
|
clone.accessKey = this.accessKey;
|
|
37442
|
+
if (this.unsavedQueryParams)
|
|
37443
|
+
clone.unsavedQueryParams = { ...this.unsavedQueryParams };
|
|
37444
|
+
if (this.savedQueryParams)
|
|
37445
|
+
clone.savedQueryParams = { ...this.savedQueryParams };
|
|
37436
37446
|
return clone;
|
|
37437
37447
|
}
|
|
37438
37448
|
/** @internal */
|
|
@@ -37442,6 +37452,12 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
37442
37452
|
props.url = changedProps.url ?? this.url;
|
|
37443
37453
|
props.accessKey = changedProps.accessKey ?? this.accessKey;
|
|
37444
37454
|
props.subLayers = changedProps.subLayers ?? this.subLayers;
|
|
37455
|
+
if (changedProps.queryParams) {
|
|
37456
|
+
props.queryParams = { ...changedProps.queryParams };
|
|
37457
|
+
}
|
|
37458
|
+
else if (this.savedQueryParams) {
|
|
37459
|
+
props.queryParams = { ...this.savedQueryParams };
|
|
37460
|
+
}
|
|
37445
37461
|
return props;
|
|
37446
37462
|
}
|
|
37447
37463
|
/** @internal */
|
|
@@ -37510,6 +37526,17 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
37510
37526
|
this.userName = userName;
|
|
37511
37527
|
this.password = password;
|
|
37512
37528
|
}
|
|
37529
|
+
/** Collect all query parameters
|
|
37530
|
+
* @beta
|
|
37531
|
+
*/
|
|
37532
|
+
collectQueryParams() {
|
|
37533
|
+
let queryParams = {};
|
|
37534
|
+
if (this.savedQueryParams)
|
|
37535
|
+
queryParams = { ...this.savedQueryParams };
|
|
37536
|
+
if (this.unsavedQueryParams)
|
|
37537
|
+
queryParams = { ...queryParams, ...this.unsavedQueryParams };
|
|
37538
|
+
return queryParams;
|
|
37539
|
+
}
|
|
37513
37540
|
}
|
|
37514
37541
|
/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
|
|
37515
37542
|
* Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.
|
|
@@ -42579,12 +42606,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42579
42606
|
/* harmony export */ ThematicDisplaySensorSettings: () => (/* binding */ ThematicDisplaySensorSettings),
|
|
42580
42607
|
/* harmony export */ ThematicGradientColorScheme: () => (/* binding */ ThematicGradientColorScheme),
|
|
42581
42608
|
/* harmony export */ ThematicGradientMode: () => (/* binding */ ThematicGradientMode),
|
|
42582
|
-
/* harmony export */ ThematicGradientSettings: () => (/* binding */ ThematicGradientSettings)
|
|
42609
|
+
/* harmony export */ ThematicGradientSettings: () => (/* binding */ ThematicGradientSettings),
|
|
42610
|
+
/* harmony export */ ThematicGradientTransparencyMode: () => (/* binding */ ThematicGradientTransparencyMode)
|
|
42583
42611
|
/* harmony export */ });
|
|
42584
42612
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
42585
42613
|
/* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
|
|
42586
42614
|
/* harmony import */ var _ColorDef__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ColorDef */ "../../core/common/lib/esm/ColorDef.js");
|
|
42587
42615
|
/* harmony import */ var _Gradient__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Gradient */ "../../core/common/lib/esm/Gradient.js");
|
|
42616
|
+
/* harmony import */ var _TextureProps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TextureProps */ "../../core/common/lib/esm/TextureProps.js");
|
|
42588
42617
|
/*---------------------------------------------------------------------------------------------
|
|
42589
42618
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
42590
42619
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -42596,6 +42625,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42596
42625
|
|
|
42597
42626
|
|
|
42598
42627
|
|
|
42628
|
+
|
|
42599
42629
|
/** A thematic gradient mode used to generate and apply a thematic effect to a scene.
|
|
42600
42630
|
* @see [[ThematicGradientSettings.mode]]
|
|
42601
42631
|
* @public
|
|
@@ -42612,6 +42642,24 @@ var ThematicGradientMode;
|
|
|
42612
42642
|
/** Apply isolines to the scene to achieve an effect similar to a contour map. Can only be used with [[ThematicDisplayMode.Height]]. */
|
|
42613
42643
|
ThematicGradientMode[ThematicGradientMode["IsoLines"] = 3] = "IsoLines";
|
|
42614
42644
|
})(ThematicGradientMode || (ThematicGradientMode = {}));
|
|
42645
|
+
/** Describes how transparency is computed when applying a thematic gradient to a surface.
|
|
42646
|
+
* Each [[Gradient.KeyColor]] in [[ThematicGradientSettings.customKeys]] has a transparency value.
|
|
42647
|
+
* Each surface to which the gradient is applied has its own transparency.
|
|
42648
|
+
* The transparency mode determines how these two values are combined to compute the final transparency.
|
|
42649
|
+
* @see [[ThematicGradientSettings.transparencyMode]].
|
|
42650
|
+
* @public
|
|
42651
|
+
* @extensions
|
|
42652
|
+
*/
|
|
42653
|
+
var ThematicGradientTransparencyMode;
|
|
42654
|
+
(function (ThematicGradientTransparencyMode) {
|
|
42655
|
+
/** Ignore the gradient's transparency, applying only the surface's own transparency. */
|
|
42656
|
+
ThematicGradientTransparencyMode[ThematicGradientTransparencyMode["SurfaceOnly"] = 0] = "SurfaceOnly";
|
|
42657
|
+
/** The final transparency is computed from the product of the surface and gradient alpha channels.
|
|
42658
|
+
* (Alpha is the inverse of transparency, where `alpha = (255 - transparency) / 255`).
|
|
42659
|
+
* If the gradient color is opaque, this produces the same result as [[SurfaceOnly]].
|
|
42660
|
+
*/
|
|
42661
|
+
ThematicGradientTransparencyMode[ThematicGradientTransparencyMode["MultiplySurfaceAndGradient"] = 1] = "MultiplySurfaceAndGradient";
|
|
42662
|
+
})(ThematicGradientTransparencyMode || (ThematicGradientTransparencyMode = {}));
|
|
42615
42663
|
/** A color scheme used to generate the colors of a thematic gradient within an applied range.
|
|
42616
42664
|
* @see [[ThematicGradientSettings.colorScheme]]
|
|
42617
42665
|
* @see [[ThematicDisplay.range]]
|
|
@@ -42642,24 +42690,32 @@ class ThematicGradientSettings {
|
|
|
42642
42690
|
static get margin() { return .001; } // A fixed portion of the gradient for out of range values.
|
|
42643
42691
|
static get contentRange() { return 1.0 - 2.0 * ThematicGradientSettings.margin; }
|
|
42644
42692
|
static get contentMax() { return 1.0 - ThematicGradientSettings.margin; }
|
|
42693
|
+
/** @alpha */
|
|
42694
|
+
get textureTransparency() {
|
|
42695
|
+
let transp = _TextureProps__WEBPACK_IMPORTED_MODULE_4__.TextureTransparency.Opaque;
|
|
42696
|
+
if (ThematicGradientColorScheme.Custom === this.colorScheme) {
|
|
42697
|
+
let haveOpaque = false;
|
|
42698
|
+
let haveTransparent = false;
|
|
42699
|
+
for (const key of this.customKeys) {
|
|
42700
|
+
const isOpaque = key.color.isOpaque;
|
|
42701
|
+
haveOpaque = haveOpaque || isOpaque;
|
|
42702
|
+
haveTransparent = haveTransparent || !isOpaque;
|
|
42703
|
+
}
|
|
42704
|
+
if (haveTransparent)
|
|
42705
|
+
transp = haveOpaque ? _TextureProps__WEBPACK_IMPORTED_MODULE_4__.TextureTransparency.Mixed : _TextureProps__WEBPACK_IMPORTED_MODULE_4__.TextureTransparency.Translucent;
|
|
42706
|
+
}
|
|
42707
|
+
if (transp !== _TextureProps__WEBPACK_IMPORTED_MODULE_4__.TextureTransparency.Mixed)
|
|
42708
|
+
if (this.marginColor.isOpaque !== (transp === _TextureProps__WEBPACK_IMPORTED_MODULE_4__.TextureTransparency.Opaque))
|
|
42709
|
+
transp = _TextureProps__WEBPACK_IMPORTED_MODULE_4__.TextureTransparency.Mixed;
|
|
42710
|
+
return transp;
|
|
42711
|
+
}
|
|
42645
42712
|
equals(other) {
|
|
42646
|
-
if (this.mode !== other.mode)
|
|
42647
|
-
|
|
42648
|
-
|
|
42649
|
-
return false;
|
|
42650
|
-
if (!this.marginColor.equals(other.marginColor))
|
|
42651
|
-
return false;
|
|
42652
|
-
if (this.colorScheme !== other.colorScheme)
|
|
42713
|
+
if (this.mode !== other.mode || this.stepCount !== other.stepCount || !this.marginColor.equals(other.marginColor)
|
|
42714
|
+
|| this.colorScheme !== other.colorScheme || this.customKeys.length !== other.customKeys.length
|
|
42715
|
+
|| this.colorMix !== other.colorMix || this.transparencyMode !== other.transparencyMode) {
|
|
42653
42716
|
return false;
|
|
42654
|
-
if (this.customKeys.length !== other.customKeys.length)
|
|
42655
|
-
return false;
|
|
42656
|
-
if (this.colorMix !== other.colorMix)
|
|
42657
|
-
return false;
|
|
42658
|
-
for (let i = 0; i < this.customKeys.length; i++) {
|
|
42659
|
-
if (!_Gradient__WEBPACK_IMPORTED_MODULE_3__.Gradient.keyColorEquals(this.customKeys[i], other.customKeys[i]))
|
|
42660
|
-
return false;
|
|
42661
42717
|
}
|
|
42662
|
-
return
|
|
42718
|
+
return this.customKeys.every((key, index) => _Gradient__WEBPACK_IMPORTED_MODULE_3__.Gradient.keyColorEquals(key, other.customKeys[index]));
|
|
42663
42719
|
}
|
|
42664
42720
|
/** Compares two sets of thematic gradient settings.
|
|
42665
42721
|
* @param lhs First set of thematic gradient settings to compare
|
|
@@ -42680,10 +42736,11 @@ class ThematicGradientSettings {
|
|
|
42680
42736
|
return diff;
|
|
42681
42737
|
if ((diff = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.customKeys.length, rhs.customKeys.length)) !== 0)
|
|
42682
42738
|
return diff;
|
|
42683
|
-
|
|
42739
|
+
if ((diff = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.transparencyMode, rhs.transparencyMode)) !== 0)
|
|
42740
|
+
return diff;
|
|
42741
|
+
for (let i = 0; i < lhs.customKeys.length; i++)
|
|
42684
42742
|
if ((diff = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.customKeys[i].color.tbgr, rhs.customKeys[i].color.tbgr)) !== 0)
|
|
42685
42743
|
return diff;
|
|
42686
|
-
}
|
|
42687
42744
|
return diff;
|
|
42688
42745
|
}
|
|
42689
42746
|
constructor(json) {
|
|
@@ -42694,6 +42751,7 @@ class ThematicGradientSettings {
|
|
|
42694
42751
|
this.marginColor = _ColorDef__WEBPACK_IMPORTED_MODULE_2__.ColorDef.fromJSON();
|
|
42695
42752
|
this.colorScheme = ThematicGradientColorScheme.BlueRed;
|
|
42696
42753
|
this.colorMix = 0.0;
|
|
42754
|
+
this.transparencyMode = ThematicGradientTransparencyMode.SurfaceOnly;
|
|
42697
42755
|
}
|
|
42698
42756
|
else {
|
|
42699
42757
|
this.mode = (json.mode !== undefined && json.mode !== null) ? json.mode : ThematicGradientMode.Smooth;
|
|
@@ -42715,6 +42773,7 @@ class ThematicGradientSettings {
|
|
|
42715
42773
|
this.customKeys.push(new _Gradient__WEBPACK_IMPORTED_MODULE_3__.Gradient.KeyColor({ value: keyValue[0], color: _ColorDef__WEBPACK_IMPORTED_MODULE_2__.ColorDef.computeTbgrFromComponents(keyValue[1], keyValue[3], keyValue[2]) }));
|
|
42716
42774
|
}
|
|
42717
42775
|
this.colorMix = json.colorMix ?? 0.0;
|
|
42776
|
+
this.transparencyMode = json.transparencyMode ?? ThematicGradientTransparencyMode.SurfaceOnly;
|
|
42718
42777
|
}
|
|
42719
42778
|
}
|
|
42720
42779
|
static fromJSON(json) {
|
|
@@ -42733,6 +42792,8 @@ class ThematicGradientSettings {
|
|
|
42733
42792
|
props.colorScheme = this.colorScheme;
|
|
42734
42793
|
if (0 !== this.colorMix)
|
|
42735
42794
|
props.colorMix = this.colorMix;
|
|
42795
|
+
if (ThematicGradientTransparencyMode.SurfaceOnly !== this.transparencyMode)
|
|
42796
|
+
props.transparencyMode = this.transparencyMode;
|
|
42736
42797
|
if (this.customKeys.length > 0)
|
|
42737
42798
|
props.customKeys = this.customKeys.map((key) => { return { value: key.value, color: key.color.toJSON() }; });
|
|
42738
42799
|
return props;
|
|
@@ -42751,6 +42812,7 @@ class ThematicGradientSettings {
|
|
|
42751
42812
|
colorScheme: undefined !== changedProps.colorScheme ? changedProps.colorScheme : this.colorScheme,
|
|
42752
42813
|
customKeys: undefined !== changedProps.customKeys ? changedProps.customKeys : this.customKeys.map((key) => ({ value: key.value, color: key.color.tbgr })),
|
|
42753
42814
|
colorMix: undefined !== changedProps.colorMix ? changedProps.colorMix : this.colorMix,
|
|
42815
|
+
transparencyMode: changedProps.transparencyMode ?? this.transparencyMode,
|
|
42754
42816
|
};
|
|
42755
42817
|
return ThematicGradientSettings.fromJSON(props);
|
|
42756
42818
|
}
|
|
@@ -44580,6 +44642,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44580
44642
|
/* harmony export */ ThematicGradientColorScheme: () => (/* reexport safe */ _ThematicDisplay__WEBPACK_IMPORTED_MODULE_106__.ThematicGradientColorScheme),
|
|
44581
44643
|
/* harmony export */ ThematicGradientMode: () => (/* reexport safe */ _ThematicDisplay__WEBPACK_IMPORTED_MODULE_106__.ThematicGradientMode),
|
|
44582
44644
|
/* harmony export */ ThematicGradientSettings: () => (/* reexport safe */ _ThematicDisplay__WEBPACK_IMPORTED_MODULE_106__.ThematicGradientSettings),
|
|
44645
|
+
/* harmony export */ ThematicGradientTransparencyMode: () => (/* reexport safe */ _ThematicDisplay__WEBPACK_IMPORTED_MODULE_106__.ThematicGradientTransparencyMode),
|
|
44583
44646
|
/* harmony export */ TileContentSource: () => (/* reexport safe */ _TileProps__WEBPACK_IMPORTED_MODULE_108__.TileContentSource),
|
|
44584
44647
|
/* harmony export */ TileFormat: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_149__.TileFormat),
|
|
44585
44648
|
/* harmony export */ TileHeader: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_149__.TileHeader),
|
|
@@ -100105,6 +100168,7 @@ const extensionExports = {
|
|
|
100105
100168
|
ThematicDisplayMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ThematicDisplayMode,
|
|
100106
100169
|
ThematicGradientColorScheme: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ThematicGradientColorScheme,
|
|
100107
100170
|
ThematicGradientMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ThematicGradientMode,
|
|
100171
|
+
ThematicGradientTransparencyMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ThematicGradientTransparencyMode,
|
|
100108
100172
|
Tile: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.Tile,
|
|
100109
100173
|
TileAdmin: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.TileAdmin,
|
|
100110
100174
|
TileBoundingBoxes: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.TileBoundingBoxes,
|
|
@@ -123348,7 +123412,8 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
|
|
|
123348
123412
|
return target.isReadPixelsInProgress ? opaquePass : "translucent";
|
|
123349
123413
|
const vf = target.currentViewFlags;
|
|
123350
123414
|
// When rendering thematic isolines, we need translucency because they have anti-aliasing.
|
|
123351
|
-
|
|
123415
|
+
const thematic = target.wantThematicDisplay && this.supportsThematicDisplay ? target.uniforms.thematic.thematicDisplay : undefined;
|
|
123416
|
+
if (thematic && target.uniforms.thematic.wantIsoLines)
|
|
123352
123417
|
return "translucent";
|
|
123353
123418
|
// In wireframe, unless fill is explicitly enabled for planar region, surface does not draw
|
|
123354
123419
|
if (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RenderMode.Wireframe === vf.renderMode && !this.mesh.isTextureAlwaysDisplayed) {
|
|
@@ -123360,6 +123425,18 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
|
|
|
123360
123425
|
// If transparency disabled by render mode or view flag, always draw opaque.
|
|
123361
123426
|
if (!vf.transparency || _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RenderMode.SolidFill === vf.renderMode || _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RenderMode.HiddenLine === vf.renderMode)
|
|
123362
123427
|
return opaquePass;
|
|
123428
|
+
// A gradient texture applied by analysis style always fully determines the transparency of the surface.
|
|
123429
|
+
if (this.hasScalarAnimation && undefined !== target.analysisTexture) {
|
|
123430
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== target.analysisStyle?.thematic);
|
|
123431
|
+
switch (target.analysisStyle.thematic.thematicSettings.textureTransparency) {
|
|
123432
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.TextureTransparency.Translucent:
|
|
123433
|
+
return "translucent";
|
|
123434
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.TextureTransparency.Opaque:
|
|
123435
|
+
return opaquePass;
|
|
123436
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.TextureTransparency.Mixed:
|
|
123437
|
+
return `${opaquePass}-translucent`;
|
|
123438
|
+
}
|
|
123439
|
+
}
|
|
123363
123440
|
// We have 3 sources of alpha: the material, the texture, and the color.
|
|
123364
123441
|
// Base alpha comes from the material if it overrides it; otherwise from the color.
|
|
123365
123442
|
// The texture's alpha is multiplied by the base alpha.
|
|
@@ -123370,8 +123447,21 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
|
|
|
123370
123447
|
hasAlpha = mat.hasTranslucency;
|
|
123371
123448
|
else
|
|
123372
123449
|
hasAlpha = this.getColor(target).hasTranslucency;
|
|
123450
|
+
// Thematic gradient can optionally multiply gradient alpha with surface alpha.
|
|
123451
|
+
if (thematic && thematic.gradientSettings.transparencyMode === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.ThematicGradientTransparencyMode.MultiplySurfaceAndGradient) {
|
|
123452
|
+
switch (thematic.gradientSettings.textureTransparency) {
|
|
123453
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.TextureTransparency.Opaque:
|
|
123454
|
+
// This surface's alpha gets multiplied by 1 - gradient colors are all opaque.
|
|
123455
|
+
return hasAlpha ? "translucent" : opaquePass;
|
|
123456
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.TextureTransparency.Translucent:
|
|
123457
|
+
// This surface's alpha gets multiplied by < 1 - gradient colors are all translucent.
|
|
123458
|
+
return "translucent";
|
|
123459
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.TextureTransparency.Mixed:
|
|
123460
|
+
// The gradient contains a mix of translucent and opaque colors.
|
|
123461
|
+
return hasAlpha ? "translucent" : `${opaquePass}-translucent`;
|
|
123462
|
+
}
|
|
123463
|
+
}
|
|
123373
123464
|
if (!hasAlpha) {
|
|
123374
|
-
// ###TODO handle TextureTransparency.Mixed; remove Texture.hasTranslucency.
|
|
123375
123465
|
const tex = this.wantTextures(target, true) ? this.texture : undefined;
|
|
123376
123466
|
switch (tex?.transparency) {
|
|
123377
123467
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.TextureTransparency.Translucent:
|
|
@@ -127854,9 +127944,9 @@ class ThematicUniforms {
|
|
|
127854
127944
|
this._colorMix = 0.0;
|
|
127855
127945
|
this._axis = new Float32Array(3);
|
|
127856
127946
|
this._sunDirection = new Float32Array(3);
|
|
127857
|
-
this._marginColor = new
|
|
127947
|
+
this._marginColor = new _FloatRGBA__WEBPACK_IMPORTED_MODULE_8__.FloatRgba();
|
|
127858
127948
|
this._displayMode = new Float32Array(1);
|
|
127859
|
-
this._fragSettings = new Float32Array(
|
|
127949
|
+
this._fragSettings = new Float32Array(4); // gradientMode, distanceCutoff, stepCount, > 0.0 if multiply gradient alpha
|
|
127860
127950
|
this._numSensors = 0;
|
|
127861
127951
|
this._gradientDimension = _getGradientDimension();
|
|
127862
127952
|
this.syncKey = 0;
|
|
@@ -127930,15 +128020,13 @@ class ThematicUniforms {
|
|
|
127930
128020
|
this._updateAxis(this.thematicDisplay.axis, (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.ThematicDisplayMode.Slope === this.thematicDisplay.displayMode) ? target.uniforms.frustum.viewMatrix : undefined);
|
|
127931
128021
|
if (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.ThematicDisplayMode.HillShade === this.thematicDisplay.displayMode)
|
|
127932
128022
|
this._updateSunDirection(this.thematicDisplay.sunDirection, target.uniforms.frustum.viewMatrix);
|
|
127933
|
-
|
|
127934
|
-
this._marginColor[0] = marginRgb.red;
|
|
127935
|
-
this._marginColor[1] = marginRgb.green;
|
|
127936
|
-
this._marginColor[2] = marginRgb.blue;
|
|
128023
|
+
this._marginColor.setColorDef(this.thematicDisplay.gradientSettings.marginColor);
|
|
127937
128024
|
this._displayMode[0] = this.thematicDisplay.displayMode;
|
|
127938
128025
|
this._fragSettings[0] = this.thematicDisplay.gradientSettings.mode;
|
|
127939
128026
|
const sensorSettings = this.thematicDisplay.sensorSettings;
|
|
127940
128027
|
this._fragSettings[1] = (undefined === sensorSettings) ? 0 : this.thematicDisplay.sensorSettings.distanceCutoff;
|
|
127941
128028
|
this._fragSettings[2] = Math.min(this.thematicDisplay.gradientSettings.stepCount, this._gradientDimension);
|
|
128029
|
+
this._fragSettings[3] = this.thematicDisplay.gradientSettings.transparencyMode === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.ThematicGradientTransparencyMode.SurfaceOnly ? 0.0 : 1.0;
|
|
127942
128030
|
// If we want sensors and have no distance cutoff, then create a global shared sensor texture.
|
|
127943
128031
|
if (target.wantThematicSensors && !(this._distanceCutoff > 0)) {
|
|
127944
128032
|
this._numSensors = sensorSettings.sensors.length;
|
|
@@ -127963,7 +128051,7 @@ class ThematicUniforms {
|
|
|
127963
128051
|
}
|
|
127964
128052
|
bindMarginColor(uniform) {
|
|
127965
128053
|
if (!(0,_Sync__WEBPACK_IMPORTED_MODULE_3__.sync)(this, uniform))
|
|
127966
|
-
|
|
128054
|
+
this._marginColor.bind(uniform);
|
|
127967
128055
|
}
|
|
127968
128056
|
bindDisplayMode(uniform) {
|
|
127969
128057
|
if (!(0,_Sync__WEBPACK_IMPORTED_MODULE_3__.sync)(this, uniform))
|
|
@@ -127971,7 +128059,7 @@ class ThematicUniforms {
|
|
|
127971
128059
|
}
|
|
127972
128060
|
bindFragSettings(uniform) {
|
|
127973
128061
|
if (!(0,_Sync__WEBPACK_IMPORTED_MODULE_3__.sync)(this, uniform))
|
|
127974
|
-
uniform.
|
|
128062
|
+
uniform.setUniform4fv(this._fragSettings);
|
|
127975
128063
|
}
|
|
127976
128064
|
bindTexture(uniform, unit) {
|
|
127977
128065
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._texture);
|
|
@@ -135531,16 +135619,12 @@ const discardClassifiedByAlpha = `
|
|
|
135531
135619
|
bool isTranslucentPass = kRenderPass_Translucent == u_renderPass;
|
|
135532
135620
|
return (isOpaquePass && hasAlpha) || (isTranslucentPass && !hasAlpha);
|
|
135533
135621
|
`;
|
|
135534
|
-
const
|
|
135535
|
-
|
|
135536
|
-
|
|
135537
|
-
|
|
135538
|
-
|
|
135539
|
-
|
|
135540
|
-
return alpha < cutoff;
|
|
135541
|
-
}
|
|
135542
|
-
|
|
135543
|
-
return false;
|
|
135622
|
+
const discardByAlphaCutoff = `
|
|
135623
|
+
float cutoff = abs(u_alphaCutoff);
|
|
135624
|
+
if (kRenderPass_Translucent == u_renderPass)
|
|
135625
|
+
return u_alphaCutoff > 0.0 && alpha >= cutoff;
|
|
135626
|
+
else
|
|
135627
|
+
return alpha < cutoff;
|
|
135544
135628
|
`;
|
|
135545
135629
|
function addTransparencyDiscard(frag) {
|
|
135546
135630
|
(0,_RenderPass__WEBPACK_IMPORTED_MODULE_16__.addRenderPass)(frag);
|
|
@@ -135555,7 +135639,7 @@ function addTransparencyDiscard(frag) {
|
|
|
135555
135639
|
uniform.setUniform1f(cutoff);
|
|
135556
135640
|
});
|
|
135557
135641
|
});
|
|
135558
|
-
frag.set(5 /* FragmentShaderComponent.DiscardByAlpha */,
|
|
135642
|
+
frag.set(5 /* FragmentShaderComponent.DiscardByAlpha */, discardByAlphaCutoff);
|
|
135559
135643
|
}
|
|
135560
135644
|
/** @internal */
|
|
135561
135645
|
function createSurfaceBuilder(flags) {
|
|
@@ -135713,11 +135797,11 @@ vec4 getSensor(int index) {
|
|
|
135713
135797
|
// A stepped gradient texture is arranged with single unique color pixels for each step. The dimension of a stepped gradient texture is stepCount.
|
|
135714
135798
|
// A smooth gradient texture is arranged with blended color pixels across the entire span of the texture. The dimension of a smooth gradient texture is the system's maximum texture size.
|
|
135715
135799
|
const getColor = `
|
|
135716
|
-
|
|
135800
|
+
vec4 getColor(float ndx) {
|
|
135717
135801
|
if (ndx < 0.0 || ndx > 1.0)
|
|
135718
135802
|
return u_marginColor;
|
|
135719
135803
|
|
|
135720
|
-
return TEXTURE(s_texture, vec2(0.0, ndx))
|
|
135804
|
+
return TEXTURE(s_texture, vec2(0.0, ndx));
|
|
135721
135805
|
}
|
|
135722
135806
|
`;
|
|
135723
135807
|
// Access a stepped gradient texture at the specified index taking into account isolines.
|
|
@@ -135725,12 +135809,12 @@ vec3 getColor(float ndx) {
|
|
|
135725
135809
|
// specifically to ensure that the texels sampled result in lines of overall singular colors - no stepping into the
|
|
135726
135810
|
// neighboring bands.
|
|
135727
135811
|
const getIsoLineColor = `
|
|
135728
|
-
|
|
135812
|
+
vec4 getIsoLineColor(float ndx, float stepCount) {
|
|
135729
135813
|
if (ndx < 0.01 || ndx > 0.99)
|
|
135730
135814
|
return u_marginColor;
|
|
135731
135815
|
|
|
135732
135816
|
ndx += 0.5 / stepCount; // center on step pixels
|
|
135733
|
-
return TEXTURE(s_texture, vec2(0.0, ndx))
|
|
135817
|
+
return TEXTURE(s_texture, vec2(0.0, ndx));
|
|
135734
135818
|
}
|
|
135735
135819
|
`;
|
|
135736
135820
|
const fwidth = `\nfloat _universal_fwidth(float coord) { return fwidth(coord); }\n`;
|
|
@@ -135796,7 +135880,8 @@ const applyThematicColorPostlude = `
|
|
|
135796
135880
|
float gradientMode = u_thematicSettings.x;
|
|
135797
135881
|
float stepCount = u_thematicSettings.z;
|
|
135798
135882
|
|
|
135799
|
-
vec4 rgba =
|
|
135883
|
+
vec4 rgba = (kThematicGradientMode_IsoLines == gradientMode) ? getIsoLineColor(ndx, stepCount) : getColor(ndx);
|
|
135884
|
+
rgba.a = baseColor.a * (u_thematicSettings.w > 0.0 ? rgba.a : 1.0);
|
|
135800
135885
|
rgba = mix(rgba, baseColor, u_thematicColorMix);
|
|
135801
135886
|
|
|
135802
135887
|
if (kThematicGradientMode_IsoLines == gradientMode) {
|
|
@@ -135821,7 +135906,8 @@ const applyThematicColorPostludeForPointClouds = `
|
|
|
135821
135906
|
float gradientMode = u_thematicSettings.x;
|
|
135822
135907
|
float stepCount = u_thematicSettings.z;
|
|
135823
135908
|
|
|
135824
|
-
vec4 rgba =
|
|
135909
|
+
vec4 rgba = (kThematicGradientMode_IsoLines == gradientMode) ? getIsoLineColor(ndx, stepCount) : getColor(ndx);
|
|
135910
|
+
rgba.a = baseColor.a * (u_thematicSettings.w > 0.0 ? rgba.a : 1.0);
|
|
135825
135911
|
rgba = mix(rgba, baseColor, u_thematicColorMix);
|
|
135826
135912
|
|
|
135827
135913
|
if (kThematicGradientMode_IsoLines == gradientMode) {
|
|
@@ -135924,13 +136010,13 @@ function addThematicDisplay(builder, isForPointClouds = false, isForTerrainMesh
|
|
|
135924
136010
|
params.target.uniforms.thematic.bindDisplayMode(uniform);
|
|
135925
136011
|
});
|
|
135926
136012
|
});
|
|
135927
|
-
frag.addUniform("u_marginColor",
|
|
136013
|
+
frag.addUniform("u_marginColor", 5 /* VariableType.Vec4 */, (prog) => {
|
|
135928
136014
|
prog.addGraphicUniform("u_marginColor", (uniform, params) => {
|
|
135929
136015
|
params.target.uniforms.thematic.bindMarginColor(uniform);
|
|
135930
136016
|
});
|
|
135931
136017
|
});
|
|
135932
136018
|
// gradientMode, distanceCutoff, stepCount
|
|
135933
|
-
builder.addUniform("u_thematicSettings",
|
|
136019
|
+
builder.addUniform("u_thematicSettings", 5 /* VariableType.Vec4 */, (prog) => {
|
|
135934
136020
|
prog.addGraphicUniform("u_thematicSettings", (uniform, params) => {
|
|
135935
136021
|
params.target.uniforms.thematic.bindFragSettings(uniform);
|
|
135936
136022
|
});
|
|
@@ -148309,9 +148395,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
148309
148395
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
148310
148396
|
/* harmony export */ ArcGISTileMap: () => (/* binding */ ArcGISTileMap)
|
|
148311
148397
|
/* harmony export */ });
|
|
148312
|
-
/* harmony import */ var
|
|
148313
|
-
/* harmony import */ var
|
|
148314
|
-
/* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
|
|
148398
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
148399
|
+
/* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
|
|
148315
148400
|
/*---------------------------------------------------------------------------------------------
|
|
148316
148401
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
148317
148402
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -148321,16 +148406,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
148321
148406
|
*/
|
|
148322
148407
|
|
|
148323
148408
|
|
|
148324
|
-
|
|
148325
148409
|
const nonVisibleChildren = [false, false, false, false];
|
|
148326
148410
|
/** @internal */
|
|
148327
148411
|
class ArcGISTileMap {
|
|
148328
|
-
constructor(restBaseUrl, settings,
|
|
148412
|
+
constructor(restBaseUrl, settings, fetchFunc, nbLods) {
|
|
148329
148413
|
this.tileMapRequestSize = 32;
|
|
148330
148414
|
this.fallbackTileMapRequestSize = 2;
|
|
148331
|
-
this._tilesCache = new
|
|
148415
|
+
this._tilesCache = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Dictionary((lhs, rhs) => (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs, rhs));
|
|
148332
148416
|
this._restBaseUrl = restBaseUrl;
|
|
148333
|
-
this.
|
|
148417
|
+
this._fetchFunc = fetchFunc;
|
|
148334
148418
|
this._settings = settings;
|
|
148335
148419
|
if (nbLods !== undefined && nbLods > 0) {
|
|
148336
148420
|
this._callQueues = new Array(nbLods).fill(Promise.resolve(nonVisibleChildren));
|
|
@@ -148338,19 +148422,8 @@ class ArcGISTileMap {
|
|
|
148338
148422
|
}
|
|
148339
148423
|
async fetchTileMapFromServer(level, row, column, width, height) {
|
|
148340
148424
|
const tmpUrl = `${this._restBaseUrl}/tilemap/${level}/${row}/${column}/${width}/${height}?f=json`;
|
|
148341
|
-
const
|
|
148342
|
-
|
|
148343
|
-
if (this._accessClient) {
|
|
148344
|
-
await _internal__WEBPACK_IMPORTED_MODULE_2__.ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {
|
|
148345
|
-
mapLayerUrl: new URL(this._settings.url),
|
|
148346
|
-
userName: this._settings.userName,
|
|
148347
|
-
password: this._settings.password,
|
|
148348
|
-
});
|
|
148349
|
-
}
|
|
148350
|
-
}
|
|
148351
|
-
catch {
|
|
148352
|
-
}
|
|
148353
|
-
return (0,_request_Request__WEBPACK_IMPORTED_MODULE_0__.request)(urlObj.toString(), "json");
|
|
148425
|
+
const response = await this._fetchFunc(new URL(tmpUrl));
|
|
148426
|
+
return response.json();
|
|
148354
148427
|
}
|
|
148355
148428
|
getAvailableTilesFromCache(tiles) {
|
|
148356
148429
|
let allTilesFound = true;
|
|
@@ -148423,7 +148496,7 @@ class ArcGISTileMap {
|
|
|
148423
148496
|
if (json.adjusted) {
|
|
148424
148497
|
// If tilemap size got adjusted, I'm expecting to get adjusted size...
|
|
148425
148498
|
// otherwise there is something really odd with this server.
|
|
148426
|
-
(0,
|
|
148499
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(json.location?.width !== undefined && json.location?.height !== undefined);
|
|
148427
148500
|
if (json.location?.width !== undefined && json.location?.height !== undefined) {
|
|
148428
148501
|
tileMapWidth = json.location?.width;
|
|
148429
148502
|
tileMapHeight = json.location?.height;
|
|
@@ -148436,7 +148509,7 @@ class ArcGISTileMap {
|
|
|
148436
148509
|
const curColumn = reqColumn + i;
|
|
148437
148510
|
const curRow = reqRow + j;
|
|
148438
148511
|
// console.log(`Tilemap tile:: ${level},${curRow},${curColumn} => ${avail}`);
|
|
148439
|
-
this._tilesCache.set(
|
|
148512
|
+
this._tilesCache.set(_internal__WEBPACK_IMPORTED_MODULE_1__.QuadId.getTileContentId(level, curColumn, curRow), avail);
|
|
148440
148513
|
// Check if actual tile is among the children we are looking for, if so update the availability array.
|
|
148441
148514
|
if (curColumn >= queryTiles[0].column && curColumn <= queryTiles[queryTiles.length - 1].column
|
|
148442
148515
|
&& curRow >= queryTiles[0].row && curRow <= queryTiles[queryTiles.length - 1].row) {
|
|
@@ -148451,7 +148524,7 @@ class ArcGISTileMap {
|
|
|
148451
148524
|
// Mark all tilemap tiles to non-available in the cache too
|
|
148452
148525
|
for (let j = 0; j < tileMapWidth; j++) {
|
|
148453
148526
|
for (let i = 0; i < tileMapHeight; i++) {
|
|
148454
|
-
this._tilesCache.set(
|
|
148527
|
+
this._tilesCache.set(_internal__WEBPACK_IMPORTED_MODULE_1__.QuadId.getTileContentId(level, reqColumn + i, reqRow + j), false);
|
|
148455
148528
|
}
|
|
148456
148529
|
}
|
|
148457
148530
|
}
|
|
@@ -148643,17 +148716,12 @@ class ArcGisUtilities {
|
|
|
148643
148716
|
}
|
|
148644
148717
|
/**
|
|
148645
148718
|
* Attempt to access an ArcGIS service, and validate its service metadata.
|
|
148646
|
-
* @param
|
|
148647
|
-
* @param
|
|
148648
|
-
|
|
148649
|
-
|
|
148650
|
-
|
|
148651
|
-
|
|
148652
|
-
* @param ignoreCache Flag to skip cache lookup (i.e. force a new server request)
|
|
148653
|
-
* @return Validation Status. If successful, a list of available sub-layers will also be returned.
|
|
148654
|
-
*/
|
|
148655
|
-
static async validateSource(url, formatId, capabilitiesFilter, userName, password, ignoreCache) {
|
|
148656
|
-
const metadata = await this.getServiceJson(url, formatId, userName, password, ignoreCache);
|
|
148719
|
+
* @param source Source to validate.
|
|
148720
|
+
* @param opts Validation options
|
|
148721
|
+
*/
|
|
148722
|
+
static async validateSource(args) {
|
|
148723
|
+
const { source, ignoreCache, capabilitiesFilter } = args;
|
|
148724
|
+
const metadata = await this.getServiceJson({ url: source.url, formatId: source.formatId, userName: source.userName, password: source.password, queryParams: source.collectQueryParams(), ignoreCache });
|
|
148657
148725
|
const json = metadata?.content;
|
|
148658
148726
|
if (json === undefined) {
|
|
148659
148727
|
return { status: _internal__WEBPACK_IMPORTED_MODULE_1__.MapLayerSourceStatus.InvalidUrl };
|
|
@@ -148663,7 +148731,7 @@ class ArcGisUtilities {
|
|
|
148663
148731
|
// and return information needed to initiate the authentification process... the end-user
|
|
148664
148732
|
// will have to provide his credentials before we can fully validate this source.
|
|
148665
148733
|
if (json.error.code === ArcGisErrorCode.TokenRequired) {
|
|
148666
|
-
return (userName || password) ? { status: _internal__WEBPACK_IMPORTED_MODULE_1__.MapLayerSourceStatus.InvalidCredentials } : { status: _internal__WEBPACK_IMPORTED_MODULE_1__.MapLayerSourceStatus.RequireAuth };
|
|
148734
|
+
return (source.userName || source.password) ? { status: _internal__WEBPACK_IMPORTED_MODULE_1__.MapLayerSourceStatus.InvalidCredentials } : { status: _internal__WEBPACK_IMPORTED_MODULE_1__.MapLayerSourceStatus.RequireAuth };
|
|
148667
148735
|
}
|
|
148668
148736
|
else if (json.error.code === ArcGisErrorCode.InvalidCredentials)
|
|
148669
148737
|
return { status: _internal__WEBPACK_IMPORTED_MODULE_1__.MapLayerSourceStatus.InvalidCredentials };
|
|
@@ -148714,16 +148782,30 @@ class ArcGisUtilities {
|
|
|
148714
148782
|
* @param ignoreCache Flag to skip cache lookup (i.e. force a new server request)
|
|
148715
148783
|
* @param requireToken Flag to indicate if a token is required
|
|
148716
148784
|
*/
|
|
148717
|
-
static async getServiceJson(
|
|
148785
|
+
static async getServiceJson(args) {
|
|
148786
|
+
const { url, formatId, userName, password, queryParams, ignoreCache, requireToken } = args;
|
|
148718
148787
|
if (!ignoreCache) {
|
|
148719
148788
|
const cached = ArcGisUtilities._serviceCache.get(url);
|
|
148720
148789
|
if (cached !== undefined)
|
|
148721
148790
|
return cached;
|
|
148722
148791
|
}
|
|
148792
|
+
const appendParams = (urlObj, params) => {
|
|
148793
|
+
if (params) {
|
|
148794
|
+
Object.keys(params).forEach((paramKey) => {
|
|
148795
|
+
if (!urlObj.searchParams.has(paramKey))
|
|
148796
|
+
urlObj.searchParams.append(paramKey, params[paramKey]);
|
|
148797
|
+
});
|
|
148798
|
+
}
|
|
148799
|
+
};
|
|
148800
|
+
const createUrlObj = () => {
|
|
148801
|
+
const tmpUrl = new URL(url);
|
|
148802
|
+
tmpUrl.searchParams.append("f", "json");
|
|
148803
|
+
appendParams(tmpUrl, queryParams);
|
|
148804
|
+
return tmpUrl;
|
|
148805
|
+
};
|
|
148723
148806
|
let accessTokenRequired = false;
|
|
148724
148807
|
try {
|
|
148725
|
-
let tmpUrl =
|
|
148726
|
-
tmpUrl.searchParams.append("f", "json");
|
|
148808
|
+
let tmpUrl = createUrlObj();
|
|
148727
148809
|
// In some cases, caller might already know token is required, so append it immediately
|
|
148728
148810
|
if (requireToken) {
|
|
148729
148811
|
const accessClient = _IModelApp__WEBPACK_IMPORTED_MODULE_2__.IModelApp.mapLayerFormatRegistry.getAccessClient(formatId);
|
|
@@ -148742,8 +148824,7 @@ class ArcGisUtilities {
|
|
|
148742
148824
|
// If token required
|
|
148743
148825
|
const accessClient = _IModelApp__WEBPACK_IMPORTED_MODULE_2__.IModelApp.mapLayerFormatRegistry.getAccessClient(formatId);
|
|
148744
148826
|
if (accessClient) {
|
|
148745
|
-
tmpUrl =
|
|
148746
|
-
tmpUrl.searchParams.append("f", "json");
|
|
148827
|
+
tmpUrl = createUrlObj();
|
|
148747
148828
|
await ArcGisUtilities.appendSecurityToken(tmpUrl, accessClient, { mapLayerUrl: new URL(url), userName, password });
|
|
148748
148829
|
response = await fetch(tmpUrl.toString(), { method: "GET" });
|
|
148749
148830
|
errorCode = await ArcGisUtilities.checkForResponseErrorCode(response);
|
|
@@ -149643,7 +149724,7 @@ class ArcGISImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_0__.MapLa
|
|
|
149643
149724
|
async getServiceJson() {
|
|
149644
149725
|
let metadata;
|
|
149645
149726
|
try {
|
|
149646
|
-
metadata = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.getServiceJson(this._settings.url, this._settings.formatId, this._settings.userName, this._settings.password);
|
|
149727
|
+
metadata = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.getServiceJson({ url: this._settings.url, formatId: this._settings.formatId, userName: this._settings.userName, password: this._settings.password, queryParams: this._settings.collectQueryParams() });
|
|
149647
149728
|
}
|
|
149648
149729
|
catch (_e) {
|
|
149649
149730
|
}
|
|
@@ -149672,6 +149753,11 @@ class ArcGISImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_0__.MapLa
|
|
|
149672
149753
|
async fetch(url, options) {
|
|
149673
149754
|
let errorCode;
|
|
149674
149755
|
const urlObj = new URL(url);
|
|
149756
|
+
const queryParams = this._settings.collectQueryParams();
|
|
149757
|
+
Object.keys(queryParams).forEach((paramKey) => {
|
|
149758
|
+
if (!urlObj.searchParams.has(paramKey))
|
|
149759
|
+
urlObj.searchParams.append(paramKey, queryParams[paramKey]);
|
|
149760
|
+
});
|
|
149675
149761
|
if (this._accessTokenRequired && this._accessClient) {
|
|
149676
149762
|
this._lastAccessToken = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {
|
|
149677
149763
|
mapLayerUrl: new URL(this._settings.url),
|
|
@@ -149917,7 +150003,10 @@ class ArcGISMapLayerImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_2
|
|
|
149917
150003
|
}
|
|
149918
150004
|
// Create tile map object only if we are going to request tiles from this server and it support tilemap requests.
|
|
149919
150005
|
if (this._tileMapSupported) {
|
|
149920
|
-
|
|
150006
|
+
const fetch = async (url, options) => {
|
|
150007
|
+
return this.fetch(url, options);
|
|
150008
|
+
};
|
|
150009
|
+
this._tileMap = new _internal__WEBPACK_IMPORTED_MODULE_2__.ArcGISTileMap(this._settings.url, this._settings, fetch, json.tileInfo?.lods?.length);
|
|
149921
150010
|
}
|
|
149922
150011
|
}
|
|
149923
150012
|
// Read range using fullextent from service metadata
|
|
@@ -150768,7 +150857,8 @@ class TileUrlImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_0__.MapL
|
|
|
150768
150857
|
url = `${url}/`;
|
|
150769
150858
|
url = `${url}{level}/{column}/{row}.png`;
|
|
150770
150859
|
}
|
|
150771
|
-
|
|
150860
|
+
const tmpUrl = url.replace(levelToken, level.toString()).replace(columnToken, column.toString()).replace(rowToken, row.toString());
|
|
150861
|
+
return this.appendCustomParams(tmpUrl);
|
|
150772
150862
|
}
|
|
150773
150863
|
}
|
|
150774
150864
|
|
|
@@ -150966,7 +151056,8 @@ class WmsMapLayerImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_3__.
|
|
|
150966
151056
|
if (bboxString.length === 0 || crsString.length === 0 || layerString.length === 0)
|
|
150967
151057
|
return "";
|
|
150968
151058
|
const crsParamName = this._capabilities?.isVersion13 ? "CRS" : "SRS";
|
|
150969
|
-
|
|
151059
|
+
const tmpUrl = `${this._baseUrl}?SERVICE=WMS&VERSION=${this._capabilities?.version}&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=${this.transparentBackgroundString}&LAYERS=${layerString}&WIDTH=${this.tileSize}&HEIGHT=${this.tileSize}&${crsParamName}=${crsString}&STYLES=&BBOX=${bboxString}`;
|
|
151060
|
+
return this.appendCustomParams(tmpUrl);
|
|
150970
151061
|
}
|
|
150971
151062
|
async getToolTip(strings, quadId, carto, tree) {
|
|
150972
151063
|
await super.getToolTip(strings, quadId, carto, tree);
|
|
@@ -150986,7 +151077,8 @@ class WmsMapLayerImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_3__.
|
|
|
150986
151077
|
const y = Math.floor(.5 + (1.0 - fraction.y) * this.tileSize);
|
|
150987
151078
|
const coordinateString = this._capabilities?.isVersion13 ? `&i=${x}&j=${y}` : `&x=${x}&y=${y}`;
|
|
150988
151079
|
const crsParamName = this._capabilities?.isVersion13 ? "CRS" : "SRS";
|
|
150989
|
-
|
|
151080
|
+
let getFeatureUrl = `${this._baseUrl}?SERVICE=WMS&VERSION=${this._capabilities?.version}&REQUEST=GetFeatureInfo&LAYERS=${layerString}&WIDTH=${this.tileSize}&HEIGHT=${this.tileSize}&${crsParamName}=EPSG%3A3857&BBOX=${bboxString}&QUERY_LAYERS=${layerString}${coordinateString}&info_format=${formatString}`;
|
|
151081
|
+
getFeatureUrl = this.appendCustomParams(getFeatureUrl);
|
|
150990
151082
|
return this.toolTipFromUrl(strings, getFeatureUrl);
|
|
150991
151083
|
}
|
|
150992
151084
|
}
|
|
@@ -151154,10 +151246,11 @@ class WmtsMapLayerImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_2__
|
|
|
151154
151246
|
if (matrixSetAndLimits && matrixSetAndLimits.tileMatrixSet.tileMatrix.length > zoomLevel)
|
|
151155
151247
|
tileMatrix = matrixSetAndLimits.tileMatrixSet.tileMatrix[zoomLevel].identifier;
|
|
151156
151248
|
const styleParam = (style?.identifier === undefined ? "" : `&style=${style.identifier}`);
|
|
151157
|
-
if (tileMatrix !== undefined && matrixSetAndLimits !== undefined)
|
|
151158
|
-
|
|
151159
|
-
|
|
151160
|
-
|
|
151249
|
+
if (tileMatrix !== undefined && matrixSetAndLimits !== undefined) {
|
|
151250
|
+
const tmpUrl = `${this._baseUrl}?Service=WMTS&Version=1.0.0&Request=GetTile&Format=image%2Fpng&layer=${this.displayedLayerName}${styleParam}&TileMatrixSet=${matrixSetAndLimits.tileMatrixSet.identifier}&TileMatrix=${tileMatrix}&TileCol=${column}&TileRow=${row}`;
|
|
151251
|
+
return this.appendCustomParams(tmpUrl);
|
|
151252
|
+
}
|
|
151253
|
+
return "";
|
|
151161
151254
|
}
|
|
151162
151255
|
}
|
|
151163
151256
|
|
|
@@ -151814,17 +151907,20 @@ class MapLayerFormat {
|
|
|
151814
151907
|
* @param _ignoreCache Flag to skip cache lookup (i.e. force a new server request).
|
|
151815
151908
|
* @returns Validation Status. If successful, a list of available sub-layers may also be returned.
|
|
151816
151909
|
*/
|
|
151817
|
-
static async validateSource(_url, _userName, _password, _ignoreCache) { return { status: _internal__WEBPACK_IMPORTED_MODULE_2__.MapLayerSourceStatus.Valid }; }
|
|
151910
|
+
static async validateSource(_url, _userName, _password, _ignoreCache, _accesKey) { return { status: _internal__WEBPACK_IMPORTED_MODULE_2__.MapLayerSourceStatus.Valid }; }
|
|
151911
|
+
/** Allow a source object to be validated before being attached as a map-layer.
|
|
151912
|
+
* @beta
|
|
151913
|
+
*/
|
|
151914
|
+
static async validate(args) {
|
|
151915
|
+
return this.validateSource(args.source.url, args.source.userName, args.source.password, args.ignoreCache);
|
|
151916
|
+
}
|
|
151818
151917
|
/**
|
|
151819
151918
|
* Create a [[MapLayerImageryProvider]] that will be used to feed data in a map-layer tile tree.
|
|
151820
151919
|
* @param _settings The map layer settings to be applied to the imagery provider.
|
|
151821
151920
|
* @returns Returns the new imagery provider.
|
|
151822
151921
|
* @beta
|
|
151823
151922
|
*/
|
|
151824
|
-
static createImageryProvider(_settings) {
|
|
151825
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "Subclasses must override this method.");
|
|
151826
|
-
return undefined;
|
|
151827
|
-
}
|
|
151923
|
+
static createImageryProvider(_settings) { (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false); }
|
|
151828
151924
|
/**
|
|
151829
151925
|
* Creates a MapLayerTileTreeReference for this map layer format.
|
|
151830
151926
|
* @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.
|
|
@@ -151834,7 +151930,7 @@ class MapLayerFormat {
|
|
|
151834
151930
|
* @beta
|
|
151835
151931
|
*/
|
|
151836
151932
|
static createMapLayerTree(_layerSettings, _layerIndex, _iModel) {
|
|
151837
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false
|
|
151933
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false);
|
|
151838
151934
|
return undefined;
|
|
151839
151935
|
}
|
|
151840
151936
|
}
|
|
@@ -151896,10 +151992,30 @@ class MapLayerFormatRegistry {
|
|
|
151896
151992
|
}
|
|
151897
151993
|
return (format === undefined) ? undefined : format.createImageryProvider(layerSettings);
|
|
151898
151994
|
}
|
|
151899
|
-
|
|
151900
|
-
|
|
151901
|
-
|
|
151902
|
-
|
|
151995
|
+
/** @internal*/
|
|
151996
|
+
async validateSource(formatIdOrArgs, url, userName, password, ignoreCache) {
|
|
151997
|
+
let format;
|
|
151998
|
+
let args;
|
|
151999
|
+
if (typeof formatIdOrArgs == "string" && url !== undefined) {
|
|
152000
|
+
const formatId = formatIdOrArgs;
|
|
152001
|
+
const entry = this._formats.get(formatId);
|
|
152002
|
+
format = entry?.type;
|
|
152003
|
+
if (format !== undefined) {
|
|
152004
|
+
const source = _internal__WEBPACK_IMPORTED_MODULE_2__.MapLayerSource.fromJSON({ name: "", formatId, url });
|
|
152005
|
+
if (source !== undefined) {
|
|
152006
|
+
args = { source, ignoreCache };
|
|
152007
|
+
source.userName = userName;
|
|
152008
|
+
source.password = password;
|
|
152009
|
+
}
|
|
152010
|
+
}
|
|
152011
|
+
}
|
|
152012
|
+
else if (typeof formatIdOrArgs !== "string") {
|
|
152013
|
+
const entry = this._formats.get(formatIdOrArgs.source.formatId);
|
|
152014
|
+
format = entry?.type;
|
|
152015
|
+
}
|
|
152016
|
+
if (!args || !format)
|
|
152017
|
+
return { status: _internal__WEBPACK_IMPORTED_MODULE_2__.MapLayerSourceStatus.InvalidFormat };
|
|
152018
|
+
return format.validate(args);
|
|
151903
152019
|
}
|
|
151904
152020
|
}
|
|
151905
152021
|
|
|
@@ -151936,10 +152052,20 @@ class WmsMapLayerFormat extends ImageryMapLayerFormat {
|
|
|
151936
152052
|
return new _internal__WEBPACK_IMPORTED_MODULE_0__.WmsMapLayerImageryProvider(settings);
|
|
151937
152053
|
}
|
|
151938
152054
|
static async validateSource(url, userName, password, ignoreCache) {
|
|
152055
|
+
const source = _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSource.fromJSON({ name: "", formatId: WmsMapLayerFormat.formatId, url });
|
|
152056
|
+
if (source === undefined)
|
|
152057
|
+
return { status: _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidFormat };
|
|
152058
|
+
source.userName = userName;
|
|
152059
|
+
source.password = password;
|
|
152060
|
+
return WmsMapLayerFormat.validate({ source, ignoreCache });
|
|
152061
|
+
}
|
|
152062
|
+
static async validate(args) {
|
|
152063
|
+
const { source, ignoreCache } = args;
|
|
152064
|
+
const { url, userName, password } = source;
|
|
151939
152065
|
try {
|
|
151940
152066
|
let subLayers;
|
|
151941
152067
|
const maxVisibleSubLayers = 50;
|
|
151942
|
-
const capabilities = await _internal__WEBPACK_IMPORTED_MODULE_0__.WmsCapabilities.create(url, (userName && password ? { user: userName, password } : undefined), ignoreCache);
|
|
152068
|
+
const capabilities = await _internal__WEBPACK_IMPORTED_MODULE_0__.WmsCapabilities.create(url, (userName && password ? { user: userName, password } : undefined), ignoreCache, source.collectQueryParams());
|
|
151943
152069
|
if (capabilities !== undefined) {
|
|
151944
152070
|
subLayers = capabilities.getSubLayers(false);
|
|
151945
152071
|
const rootsSubLayer = subLayers?.find((sublayer) => sublayer.parent === undefined);
|
|
@@ -151994,9 +152120,19 @@ class WmtsMapLayerFormat extends ImageryMapLayerFormat {
|
|
|
151994
152120
|
return new _internal__WEBPACK_IMPORTED_MODULE_0__.WmtsMapLayerImageryProvider(settings);
|
|
151995
152121
|
}
|
|
151996
152122
|
static async validateSource(url, userName, password, ignoreCache) {
|
|
152123
|
+
const source = _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSource.fromJSON({ name: "", formatId: WmtsMapLayerFormat.formatId, url });
|
|
152124
|
+
if (source === undefined)
|
|
152125
|
+
return { status: _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidFormat };
|
|
152126
|
+
source.userName = userName;
|
|
152127
|
+
source.password = password;
|
|
152128
|
+
return WmtsMapLayerFormat.validate({ source, ignoreCache });
|
|
152129
|
+
}
|
|
152130
|
+
static async validate(args) {
|
|
152131
|
+
const { source, ignoreCache } = args;
|
|
152132
|
+
const { url, userName, password } = source;
|
|
151997
152133
|
try {
|
|
151998
152134
|
const subLayers = [];
|
|
151999
|
-
const capabilities = await _internal__WEBPACK_IMPORTED_MODULE_0__.WmtsCapabilities.create(url, (userName && password ? { user: userName, password } : undefined), ignoreCache);
|
|
152135
|
+
const capabilities = await _internal__WEBPACK_IMPORTED_MODULE_0__.WmtsCapabilities.create(url, (userName && password ? { user: userName, password } : undefined), ignoreCache, source.collectQueryParams());
|
|
152000
152136
|
if (!capabilities)
|
|
152001
152137
|
return { status: _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidUrl };
|
|
152002
152138
|
// Only returns layer that can be published in the Google maps or WGS84 aligned tile trees.
|
|
@@ -152043,11 +152179,19 @@ class WmtsMapLayerFormat extends ImageryMapLayerFormat {
|
|
|
152043
152179
|
WmtsMapLayerFormat.formatId = "WMTS";
|
|
152044
152180
|
class ArcGISMapLayerFormat extends ImageryMapLayerFormat {
|
|
152045
152181
|
static async validateSource(url, userName, password, ignoreCache) {
|
|
152046
|
-
const
|
|
152182
|
+
const source = _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSource.fromJSON({ name: "", formatId: WmtsMapLayerFormat.formatId, url });
|
|
152183
|
+
if (source === undefined)
|
|
152184
|
+
return { status: _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidFormat };
|
|
152185
|
+
source.userName = userName;
|
|
152186
|
+
source.password = password;
|
|
152187
|
+
return WmtsMapLayerFormat.validate({ source, ignoreCache });
|
|
152188
|
+
}
|
|
152189
|
+
static async validate(args) {
|
|
152190
|
+
const urlValidation = _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.validateUrl(args.source.url, "MapServer");
|
|
152047
152191
|
if (urlValidation !== _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.Valid)
|
|
152048
152192
|
return { status: urlValidation };
|
|
152049
152193
|
// Some Map service supporting only tiles don't include the 'Map' capabilities, thus we can't make it mandatory.
|
|
152050
|
-
return _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.validateSource(
|
|
152194
|
+
return _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.validateSource({ ...args, capabilitiesFilter: [] });
|
|
152051
152195
|
}
|
|
152052
152196
|
static createImageryProvider(settings) {
|
|
152053
152197
|
return new _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGISMapLayerImageryProvider(settings);
|
|
@@ -152433,6 +152577,47 @@ class MapLayerImageryProvider {
|
|
|
152433
152577
|
${tileExtent.longitudeRight.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)}`;
|
|
152434
152578
|
}
|
|
152435
152579
|
}
|
|
152580
|
+
/** Append custom parameters for settings to provided URL object.
|
|
152581
|
+
* Make sure custom parameters do no override query parameters already part of the URL (lower case comparison)
|
|
152582
|
+
* @internal
|
|
152583
|
+
*/
|
|
152584
|
+
appendCustomParams(url) {
|
|
152585
|
+
if (!this._settings.savedQueryParams && !this._settings.unsavedQueryParams)
|
|
152586
|
+
return url;
|
|
152587
|
+
// create a lower-case array of keys
|
|
152588
|
+
const currentParams = [];
|
|
152589
|
+
const currentUrl = new URL(url);
|
|
152590
|
+
currentUrl.searchParams.forEach((_value, key, _parent) => {
|
|
152591
|
+
currentParams.push(key.toLowerCase());
|
|
152592
|
+
});
|
|
152593
|
+
const urlParamsFromIndexArray = (indexArray, result) => {
|
|
152594
|
+
const urlParams = (result ? result : new URLSearchParams());
|
|
152595
|
+
if (!indexArray)
|
|
152596
|
+
return urlParams;
|
|
152597
|
+
Object.keys(indexArray).forEach((key) => {
|
|
152598
|
+
if (!currentParams.includes(key.toLowerCase()))
|
|
152599
|
+
urlParams.append(key, indexArray[key]);
|
|
152600
|
+
});
|
|
152601
|
+
return urlParams;
|
|
152602
|
+
};
|
|
152603
|
+
const params = urlParamsFromIndexArray(this._settings.savedQueryParams);
|
|
152604
|
+
urlParamsFromIndexArray(this._settings.unsavedQueryParams, params);
|
|
152605
|
+
const getSeparator = (u) => {
|
|
152606
|
+
let separator = "&";
|
|
152607
|
+
if (u.includes("?")) {
|
|
152608
|
+
if (u.endsWith("?"))
|
|
152609
|
+
separator = "";
|
|
152610
|
+
}
|
|
152611
|
+
else {
|
|
152612
|
+
separator = "?";
|
|
152613
|
+
}
|
|
152614
|
+
return separator;
|
|
152615
|
+
};
|
|
152616
|
+
if (params.size > 0) {
|
|
152617
|
+
url = `${url}${getSeparator(url)}${params.toString()}`;
|
|
152618
|
+
}
|
|
152619
|
+
return url;
|
|
152620
|
+
}
|
|
152436
152621
|
}
|
|
152437
152622
|
|
|
152438
152623
|
|
|
@@ -152497,21 +152682,22 @@ var MapLayerSourceStatus;
|
|
|
152497
152682
|
* @public
|
|
152498
152683
|
*/
|
|
152499
152684
|
class MapLayerSource {
|
|
152500
|
-
constructor(formatId = "WMS", name, url, baseMap = false, transparentBackground = true) {
|
|
152685
|
+
constructor(formatId = "WMS", name, url, baseMap = false, transparentBackground = true, savedQueryParams) {
|
|
152501
152686
|
this.baseMap = false;
|
|
152502
152687
|
this.formatId = formatId;
|
|
152503
152688
|
this.name = name;
|
|
152504
152689
|
this.url = url;
|
|
152505
152690
|
this.baseMap = baseMap;
|
|
152506
152691
|
this.transparentBackground = transparentBackground;
|
|
152692
|
+
this.savedQueryParams = savedQueryParams;
|
|
152507
152693
|
}
|
|
152508
152694
|
static fromJSON(json) {
|
|
152509
152695
|
if (json === undefined)
|
|
152510
152696
|
return undefined;
|
|
152511
|
-
return new MapLayerSource(json.formatId, json.name, json.url, json.baseMap, json.transparentBackground);
|
|
152697
|
+
return new MapLayerSource(json.formatId, json.name, json.url, json.baseMap, json.transparentBackground, json.queryParams);
|
|
152512
152698
|
}
|
|
152513
152699
|
async validateSource(ignoreCache) {
|
|
152514
|
-
return _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.mapLayerFormatRegistry.validateSource(
|
|
152700
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.mapLayerFormatRegistry.validateSource({ source: this, ignoreCache });
|
|
152515
152701
|
}
|
|
152516
152702
|
/** @internal*/
|
|
152517
152703
|
static fromBackgroundMapProps(props) {
|
|
@@ -152527,7 +152713,7 @@ class MapLayerSource {
|
|
|
152527
152713
|
return undefined;
|
|
152528
152714
|
}
|
|
152529
152715
|
toJSON() {
|
|
152530
|
-
return { url: this.url, name: this.name, formatId: this.formatId, transparentBackground: this.transparentBackground };
|
|
152716
|
+
return { url: this.url, name: this.name, formatId: this.formatId, transparentBackground: this.transparentBackground, queryParams: this.savedQueryParams };
|
|
152531
152717
|
}
|
|
152532
152718
|
toLayerSettings(subLayers) {
|
|
152533
152719
|
// When MapLayerSetting is created from a MapLayerSource, sub-layers and credentials need to be set separately.
|
|
@@ -152535,11 +152721,28 @@ class MapLayerSource {
|
|
|
152535
152721
|
if (this.userName !== undefined || this.password !== undefined) {
|
|
152536
152722
|
layerSettings?.setCredentials(this.userName, this.password);
|
|
152537
152723
|
}
|
|
152724
|
+
if (this.savedQueryParams) {
|
|
152725
|
+
layerSettings.savedQueryParams = { ...this.savedQueryParams };
|
|
152726
|
+
}
|
|
152727
|
+
if (this.unsavedQueryParams) {
|
|
152728
|
+
layerSettings.unsavedQueryParams = { ...this.unsavedQueryParams };
|
|
152729
|
+
}
|
|
152538
152730
|
return layerSettings;
|
|
152539
152731
|
}
|
|
152540
152732
|
getCredentials() {
|
|
152541
152733
|
return this.userName && this.password ? { user: this.userName, password: this.password } : undefined;
|
|
152542
152734
|
}
|
|
152735
|
+
/** Collect all query parameters
|
|
152736
|
+
* @beta
|
|
152737
|
+
*/
|
|
152738
|
+
collectQueryParams() {
|
|
152739
|
+
let queryParams = {};
|
|
152740
|
+
if (this.savedQueryParams)
|
|
152741
|
+
queryParams = { ...this.savedQueryParams };
|
|
152742
|
+
if (this.unsavedQueryParams)
|
|
152743
|
+
queryParams = { ...queryParams, ...this.unsavedQueryParams };
|
|
152744
|
+
return queryParams;
|
|
152745
|
+
}
|
|
152543
152746
|
}
|
|
152544
152747
|
/** A collection of [[MapLayerSource]] objects.
|
|
152545
152748
|
* @beta
|
|
@@ -155616,13 +155819,22 @@ class WmsCapabilities {
|
|
|
155616
155819
|
if (_json.Capability)
|
|
155617
155820
|
this.layer = new WmsCapability.Layer(_json.Capability.Layer, this);
|
|
155618
155821
|
}
|
|
155619
|
-
static async create(url, credentials, ignoreCache) {
|
|
155822
|
+
static async create(url, credentials, ignoreCache, queryParams) {
|
|
155620
155823
|
if (!ignoreCache) {
|
|
155621
155824
|
const cached = WmsCapabilities._capabilitiesCache.get(url);
|
|
155622
155825
|
if (cached !== undefined)
|
|
155623
155826
|
return cached;
|
|
155624
155827
|
}
|
|
155625
|
-
const
|
|
155828
|
+
const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_2__.WmsUtilities.getBaseUrl(url));
|
|
155829
|
+
tmpUrl.searchParams.append("request", "GetCapabilities");
|
|
155830
|
+
tmpUrl.searchParams.append("service", "WMS");
|
|
155831
|
+
if (queryParams) {
|
|
155832
|
+
Object.keys(queryParams).forEach((paramKey) => {
|
|
155833
|
+
if (!tmpUrl.searchParams.has(paramKey))
|
|
155834
|
+
tmpUrl.searchParams.append(paramKey, queryParams[paramKey]);
|
|
155835
|
+
});
|
|
155836
|
+
}
|
|
155837
|
+
const xmlCapabilities = await getXml(tmpUrl.toString(), credentials);
|
|
155626
155838
|
if (!xmlCapabilities)
|
|
155627
155839
|
return undefined;
|
|
155628
155840
|
const capabilities = new WmsCapabilities(new (wms_capabilities__WEBPACK_IMPORTED_MODULE_1___default())().parse(xmlCapabilities));
|
|
@@ -156115,13 +156327,22 @@ class WmtsCapabilities {
|
|
|
156115
156327
|
const xmlDoc = parser.parseFromString(xmlCapabilities, "text/xml");
|
|
156116
156328
|
return new WmtsCapabilities(xmlDoc);
|
|
156117
156329
|
}
|
|
156118
|
-
static async create(url, credentials, ignoreCache) {
|
|
156330
|
+
static async create(url, credentials, ignoreCache, queryParams) {
|
|
156119
156331
|
if (!ignoreCache) {
|
|
156120
156332
|
const cached = WmtsCapabilities._capabilitiesCache.get(url);
|
|
156121
156333
|
if (cached !== undefined)
|
|
156122
156334
|
return cached;
|
|
156123
156335
|
}
|
|
156124
|
-
const
|
|
156336
|
+
const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_2__.WmsUtilities.getBaseUrl(url));
|
|
156337
|
+
tmpUrl.searchParams.append("request", "GetCapabilities");
|
|
156338
|
+
tmpUrl.searchParams.append("service", "WMTS");
|
|
156339
|
+
if (queryParams) {
|
|
156340
|
+
Object.keys(queryParams).forEach((paramKey) => {
|
|
156341
|
+
if (!tmpUrl.searchParams.has(paramKey))
|
|
156342
|
+
tmpUrl.searchParams.append(paramKey, queryParams[paramKey]);
|
|
156343
|
+
});
|
|
156344
|
+
}
|
|
156345
|
+
const xmlCapabilities = await getXml(tmpUrl.toString(), credentials);
|
|
156125
156346
|
if (!xmlCapabilities)
|
|
156126
156347
|
return undefined;
|
|
156127
156348
|
const capabilities = WmtsCapabilities.createFromXml(xmlCapabilities);
|
|
@@ -288696,7 +288917,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
288696
288917
|
/***/ ((module) => {
|
|
288697
288918
|
|
|
288698
288919
|
"use strict";
|
|
288699
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.3.0-dev.
|
|
288920
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.3.0-dev.35","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module 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","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.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 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.3.0-dev.35","@itwin/core-bentley":"workspace:^4.3.0-dev.35","@itwin/core-common":"workspace:^4.3.0-dev.35","@itwin/core-geometry":"workspace:^4.3.0-dev.35","@itwin/core-orbitgt":"workspace:^4.3.0-dev.35","@itwin/core-quantity":"workspace:^4.3.0-dev.35"},"//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.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/sinon":"^10.0.15","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^15.0.4","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","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/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.1.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","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
288700
288921
|
|
|
288701
288922
|
/***/ })
|
|
288702
288923
|
|