@itwin/core-frontend 4.9.0-dev.22 → 4.9.0-dev.24

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.
Files changed (53) hide show
  1. package/lib/cjs/PlanarClipMaskState.d.ts +2 -3
  2. package/lib/cjs/PlanarClipMaskState.d.ts.map +1 -1
  3. package/lib/cjs/PlanarClipMaskState.js +7 -7
  4. package/lib/cjs/PlanarClipMaskState.js.map +1 -1
  5. package/lib/cjs/render/webgl/PlanarClassifier.js +3 -3
  6. package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
  7. package/lib/cjs/render/webgl/glsl/PlanarClassification.js +1 -1
  8. package/lib/cjs/render/webgl/glsl/PlanarClassification.js.map +1 -1
  9. package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
  10. package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
  11. package/lib/cjs/tile/RenderGraphicTileTree.d.ts +2 -0
  12. package/lib/cjs/tile/RenderGraphicTileTree.d.ts.map +1 -1
  13. package/lib/cjs/tile/RenderGraphicTileTree.js +2 -0
  14. package/lib/cjs/tile/RenderGraphicTileTree.js.map +1 -1
  15. package/lib/cjs/tile/TileTreeReference.d.ts +13 -5
  16. package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
  17. package/lib/cjs/tile/TileTreeReference.js +13 -5
  18. package/lib/cjs/tile/TileTreeReference.js.map +1 -1
  19. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +5 -1
  20. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  21. package/lib/cjs/tile/map/MapLayerImageryProvider.js +5 -1
  22. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  23. package/lib/cjs/tile/map/MapTileTree.d.ts +1 -1
  24. package/lib/cjs/tile/map/MapTileTree.js +1 -1
  25. package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
  26. package/lib/esm/PlanarClipMaskState.d.ts +2 -3
  27. package/lib/esm/PlanarClipMaskState.d.ts.map +1 -1
  28. package/lib/esm/PlanarClipMaskState.js +7 -7
  29. package/lib/esm/PlanarClipMaskState.js.map +1 -1
  30. package/lib/esm/render/webgl/PlanarClassifier.js +3 -3
  31. package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
  32. package/lib/esm/render/webgl/glsl/PlanarClassification.js +1 -1
  33. package/lib/esm/render/webgl/glsl/PlanarClassification.js.map +1 -1
  34. package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
  35. package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
  36. package/lib/esm/tile/RenderGraphicTileTree.d.ts +2 -0
  37. package/lib/esm/tile/RenderGraphicTileTree.d.ts.map +1 -1
  38. package/lib/esm/tile/RenderGraphicTileTree.js +2 -0
  39. package/lib/esm/tile/RenderGraphicTileTree.js.map +1 -1
  40. package/lib/esm/tile/TileTreeReference.d.ts +13 -5
  41. package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
  42. package/lib/esm/tile/TileTreeReference.js +13 -5
  43. package/lib/esm/tile/TileTreeReference.js.map +1 -1
  44. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +5 -1
  45. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  46. package/lib/esm/tile/map/MapLayerImageryProvider.js +5 -1
  47. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  48. package/lib/esm/tile/map/MapTileTree.d.ts +1 -1
  49. package/lib/esm/tile/map/MapTileTree.js +1 -1
  50. package/lib/esm/tile/map/MapTileTree.js.map +1 -1
  51. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  52. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  53. package/package.json +19 -19
@@ -1 +1 @@
1
- {"version":3,"file":"TileTreeReference.js","sourceRoot":"","sources":["../../../src/tile/TileTreeReference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA0D;AAC1D,wDAA6E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AGG;IACO,4BAA4B;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAMD;OACG;IACO,oBAAoB,CAAC,SAAgC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAClC,KAAK,6BAAkB,CAAC,MAAM;gBAC5B,IAAA,qBAAM,EAAC,SAAS,KAAK,IAAI,CAAC,CAAC;gBAC3B,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBACpC,MAAM;YACR,KAAK,6BAAkB,CAAC,OAAO;gBAC7B,SAAS,CAAC,WAAW,EAAE,CAAC;gBACxB,MAAM;QACV,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,2BAA2B;QAChC,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,0KAA0K;YAC1K,OAAO,IAAiC,CAAC;QAC3C,CAAC;QAED,OAAO,IAAI,CAAC,4BAA4B,EAAE,CAAC;IAC7C,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,uBAAuB,CAAC,IAA+B;QACnE,OAAO,IAAA,6CAAkC,EAAC,IAAI,CAAC,CAAC;IAClD,CAAC;CACF;AA5QD,8CA4QC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, BeTimePoint } from \"@itwin/core-bentley\";\r\nimport { Matrix4d, Range1d, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { ElementAlignedBox3d, FeatureAppearanceProvider, FrustumPlanes, HiddenLine, PlanarClipMaskPriority, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { HitDetail } from \"../HitDetail\";\r\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\r\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\r\nimport { RenderMemory } from \"../render/RenderMemory\";\r\nimport { DecorateContext, SceneContext } from \"../ViewContext\";\r\nimport { ScreenViewport } from \"../Viewport\";\r\nimport {\r\n DisclosedTileTreeSet, GeometryTileTreeReference, MapFeatureInfoOptions, MapLayerFeatureInfo, RenderGraphicTileTreeArgs, TileDrawArgs, TileGeometryCollector, TileTree, TileTreeLoadStatus, TileTreeOwner, tileTreeReferenceFromRenderGraphic,\r\n} from \"./internal\";\r\n\r\n/** Describes the type of graphics produced by a [[TileTreeReference]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum TileGraphicType {\r\n /** Rendered behind all other geometry without depth. */\r\n BackgroundMap = 0,\r\n /** Rendered with normal scene graphics. */\r\n Scene = 1,\r\n /** Rendered in front of all other geometry. */\r\n Overlay = 2,\r\n}\r\n\r\n/** A reference to a [[TileTree]] suitable for drawing within a [[Viewport]]. The reference does not *own* its tile tree - it merely refers to it by\r\n * way of the tree's [[TileTreeOwner]].\r\n * The specific [[TileTree]] referenced by this object may change based on the current state of the Viewport in which it is drawn - for example,\r\n * as a result of changing the RenderMode, or animation settings, or classification settings, etc.\r\n * A reference to a TileTree is typically associated with a [[ViewState]], a [[DisplayStyleState]], or a [[Viewport]].\r\n * Multiple TileTreeReferences can refer to the same TileTree with different parameters and logic - for example, the same background map tiles can be displayed in two viewports with\r\n * differing levels of transparency.\r\n * @see [[TiledGraphicsProvider]] to supply custom [[TileTreeReference]]s to be drawn within a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class TileTreeReference /* implements RenderMemory.Consumer */ {\r\n /** The owner of the currently-referenced [[TileTree]]. Do not store a direct reference to it, because it may change or become disposed at any time. */\r\n public abstract get treeOwner(): TileTreeOwner;\r\n\r\n /** Force a new tree owner / tile tree to be created for the current tile tree reference\r\n * @internal\r\n */\r\n public resetTreeOwner() {}\r\n\r\n /** Disclose *all* TileTrees use by this reference. This may include things like map tiles used for draping on terrain.\r\n * Override this and call super if you have such auxiliary trees.\r\n * @note Any tree *NOT* disclosed becomes a candidate for *purging* (being unloaded from memory along with all of its tiles and graphics).\r\n */\r\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n const tree = this.treeOwner.tileTree;\r\n if (undefined !== tree)\r\n trees.add(tree);\r\n }\r\n\r\n /** Adds this reference's graphics to the scene. By default this invokes [[draw]]. */\r\n public addToScene(context: SceneContext): void {\r\n const args = this.createDrawArgs(context);\r\n if (undefined !== args)\r\n this.draw(args);\r\n }\r\n\r\n /** Adds this reference's graphics to the scene. By default this invokes [[TileTree.draw]] on the referenced TileTree, if it is loaded. */\r\n public draw(args: TileDrawArgs): void {\r\n args.tree.draw(args);\r\n }\r\n\r\n /** Return a tooltip describing the hit, or `undefined` if no tooltip can be supplied.\r\n * If you override this method, make sure to check that `hit` represents an entity belonging to your tile tree, e.g., by checking `hit.modelId` and `hit.sourceId`.\r\n * If you *don't* override this method, override [[canSupplyToolTip]] to return false.\r\n * Callers who want to obtain a tooltip should prefer [[getToolTipPromise]].\r\n */\r\n public async getToolTip(_hit: HitDetail): Promise<HTMLElement | string | undefined> { return undefined; }\r\n\r\n /** Return whether this TileTreeReference can supply a tooltip describing the entity represented by the specified hit.\r\n * [[getToolTipPromise]] calls [[getToolTip]] if and only if `canSupplyToolTip` returns `true`.\r\n * If your tile tree never supplies tooltips, override this to return `false`.\r\n */\r\n public canSupplyToolTip(_hit: HitDetail): boolean {\r\n return true;\r\n }\r\n\r\n /** Obtain a tooltip describing the specified `hit`, or `undefined` if this tile tree reference cannot supply a tooltip for the hit. */\r\n public getToolTipPromise(hit: HitDetail): Promise<HTMLElement | string | undefined> | undefined {\r\n return this.canSupplyToolTip(hit) ? this.getToolTip(hit).catch(() => undefined) : undefined;\r\n }\r\n\r\n /** Optionally return a MapLayerFeatureInfo object describing the hit.].\r\n * @alpha\r\n */\r\n public async getMapFeatureInfo(_hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<MapLayerFeatureInfo[] | undefined> { return undefined; }\r\n\r\n /** Optionally add any decorations specific to this reference. For example, map tile trees may add a logo image and/or copyright attributions.\r\n * @note This is currently only invoked for background maps and TiledGraphicsProviders - others have no decorations, but if they did implement this it would not be called.\r\n */\r\n public decorate(_context: DecorateContext): void { }\r\n\r\n /** Unions this reference's range with the supplied range to help compute a volume in world space for fitting a viewport to its contents.\r\n * Override this function if a reference's range should not be included in the fit range, or a range different from its tile tree's range should be used.\r\n */\r\n public unionFitRange(union: Range3d): void {\r\n const contentRange = this.computeWorldContentRange();\r\n if (!contentRange.isNull)\r\n union.extendRange(contentRange);\r\n }\r\n\r\n /** Record graphics memory consumed by this tile tree reference. */\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n const tree = this.treeOwner.tileTree;\r\n if (undefined !== tree)\r\n tree.collectStatistics(stats);\r\n }\r\n\r\n /** Return true if the tile tree is fully loaded and ready to draw.\r\n * The default implementation returns true if the tile tree loading process completed (whether it resulted in success or failure).\r\n * @note Do *not* override this property - override [[_isLoadingComplete]] instead..\r\n * @public\r\n */\r\n public get isLoadingComplete(): boolean {\r\n switch (this.treeOwner.loadStatus) {\r\n case TileTreeLoadStatus.NotLoaded:\r\n case TileTreeLoadStatus.Loading:\r\n return false;\r\n case TileTreeLoadStatus.NotFound:\r\n return true; // we tried, and failed, to load.\r\n case TileTreeLoadStatus.Loaded:\r\n return this._isLoadingComplete;\r\n }\r\n }\r\n\r\n /** Override if additional asynchronous loading is required after the tile tree is successfully loaded, to indicate when that loading has completed.\r\n * @public\r\n */\r\n protected get _isLoadingComplete(): boolean {\r\n return true;\r\n }\r\n\r\n /** Create context for drawing the tile tree, if it is ready for drawing.\r\n * TileTreeReferences can override individual portions of the context, e.g. apply their own transform.\r\n * Returns undefined if, e.g., the tile tree is not yet loaded.\r\n */\r\n public createDrawArgs(context: SceneContext): TileDrawArgs | undefined {\r\n const tree = this.treeOwner.load();\r\n if (undefined === tree)\r\n return undefined;\r\n\r\n return new TileDrawArgs({\r\n context,\r\n tree,\r\n now: BeTimePoint.now(),\r\n location: this.computeTransform(tree),\r\n viewFlagOverrides: this.getViewFlagOverrides(tree),\r\n clipVolume: this.getClipVolume(tree),\r\n parentsAndChildrenExclusive: tree.parentsAndChildrenExclusive,\r\n symbologyOverrides: this.getSymbologyOverrides(tree),\r\n appearanceProvider: this.getAppearanceProvider(tree),\r\n hiddenLineSettings: this.getHiddenLineSettings(tree),\r\n animationTransformNodeId: this.getAnimationTransformNodeId(tree),\r\n groupNodeId: this.getGroupNodeId(tree),\r\n });\r\n }\r\n\r\n /** @internal */\r\n protected getAnimationTransformNodeId(_tree: TileTree): number | undefined {\r\n return undefined;\r\n }\r\n /** @internal */\r\n protected getGroupNodeId(_tree: TileTree): number | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Supply transform from this tile tree reference's location to iModel coordinate space.\r\n * @returns undefined if the TileTree is not yet loaded.\r\n */\r\n public getLocation(): Transform | undefined {\r\n const tree = this.treeOwner.load();\r\n return undefined !== tree ? this.computeTransform(tree) : undefined;\r\n }\r\n\r\n /** Compute a transform from this tile tree reference's coordinate space to the [[IModelConnection]]'s coordinate space. */\r\n protected computeTransform(tree: TileTree): Transform {\r\n return tree.iModelTransform.clone();\r\n }\r\n\r\n /** Compute the range of this tile tree's contents in world coordinates.\r\n * @returns The content range in world coodinates, or a null range if the tile tree is not loaded or has a null content range.\r\n */\r\n public computeWorldContentRange(): ElementAlignedBox3d {\r\n const range = new Range3d();\r\n const tree = this.treeOwner.tileTree;\r\n if (undefined !== tree && !tree.rootTile.contentRange.isNull)\r\n this.computeTransform(tree).multiplyRange(tree.rootTile.contentRange, range);\r\n\r\n return range;\r\n }\r\n\r\n /** Return the clip volume applied to this reference's tile tree, if any. */\r\n protected getClipVolume(tree: TileTree): RenderClipVolume | undefined {\r\n return tree.clipVolume;\r\n }\r\n\r\n /** Supply overrides that should be applied to the [[ViewState]]'s [ViewFlags]($common) when drawing this tile tree reference. */\r\n protected getViewFlagOverrides(tree: TileTree): ViewFlagOverrides {\r\n return tree.viewFlagOverrides;\r\n }\r\n\r\n /** Return overrides that *replace* any defined for the view. */\r\n protected getSymbologyOverrides(_tree: TileTree): FeatureSymbology.Overrides | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Return a provider that can supplement the view's symbology overrides. */\r\n protected getAppearanceProvider(_tree: TileTree): FeatureAppearanceProvider | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Return hidden line settings to replace those defined for the view. */\r\n protected getHiddenLineSettings(_tree: TileTree): HiddenLine.Settings | undefined {\r\n return undefined;\r\n }\r\n\r\n /* Extend range to include transformed range of this tile tree.\r\n * @internal\r\n */\r\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, frustumPlanes?: FrustumPlanes) {\r\n const tree = this.treeOwner.tileTree;\r\n if (undefined === tree)\r\n return;\r\n\r\n const location = this.computeTransform(tree);\r\n tree.accumulateTransformedRange(range, matrix, location, frustumPlanes);\r\n }\r\n\r\n /** @internal */\r\n public getTerrainHeight(_terrainHeights: Range1d): void { }\r\n\r\n /** Return whether the geometry exposed by this tile tree reference should cast shadows on other geometry. */\r\n public get castsShadows(): boolean {\r\n return true;\r\n }\r\n\r\n /** Return whether this reference has global coverage. Mapping data is global and some non-primary models such as the OSM building layer have global coverage */\r\n public get isGlobal(): boolean { return false; }\r\n\r\n /** Return the clip mask priority for this model - models will be clipped by any other viewed model with a higher proirity.\r\n * BIM models have highest prioirty and are never clipped.\r\n * @alpha\r\n */\r\n public get planarclipMaskPriority(): number { return PlanarClipMaskPriority.DesignModel; }\r\n\r\n /** Add attribution logo cards for the tile tree source logo cards to the viewport's logo div. */\r\n public addLogoCards(_cards: HTMLTableElement, _vp: ScreenViewport): void { }\r\n\r\n /** Create a tile tree reference equivalent to this one that also supplies an implementation of [[GeometryTileTreeReference.collectTileGeometry]].\r\n * Return `undefined` if geometry collection is not supported.\r\n * @see [[createGeometryTreeReference]].\r\n */\r\n protected _createGeometryTreeReference(): GeometryTileTreeReference | undefined {\r\n return undefined;\r\n }\r\n\r\n /** If defined, supplies the implementation of [[GeometryTileTreeReference.collectTileGeometry]].\r\n */\r\n public collectTileGeometry?: (collector: TileGeometryCollector) => void;\r\n\r\n /** A function that can be assigned to [[collectTileGeometry]] to enable geometry collection for references to tile trees that support geometry collection.\r\n */\r\n protected _collectTileGeometry(collector: TileGeometryCollector): void {\r\n const tree = this.treeOwner.load();\r\n switch (this.treeOwner.loadStatus) {\r\n case TileTreeLoadStatus.Loaded:\r\n assert(undefined !== tree);\r\n tree.collectTileGeometry(collector);\r\n break;\r\n case TileTreeLoadStatus.Loading:\r\n collector.markLoading();\r\n break;\r\n }\r\n }\r\n\r\n /** Obtain a tile tree reference equivalent to this one that also supplies an implementation of [[GeometryTileTreeReference.collectTileGeometry]], or\r\n * undefined if geometry collection is not supported.\r\n * Currently, only terrain and reality model tiles support geometry collection.\r\n * @note Do not override this method - override [[_createGeometryTreeReference]] instead.\r\n */\r\n public createGeometryTreeReference(): GeometryTileTreeReference | undefined {\r\n if (this.collectTileGeometry) {\r\n // Unclear why compiler doesn't detect that `this` satisfies the GeometryTileTreeReference interface...it must be looking only at the types, not this particular instance.\r\n return this as GeometryTileTreeReference;\r\n }\r\n\r\n return this._createGeometryTreeReference();\r\n }\r\n\r\n /** Create a [[TileTreeReference]] that displays a pre-defined [[RenderGraphic]].\r\n * The reference can be used by a [[TiledGraphicsProvider]] or as a [[DynamicSpatialClassifier]]. For example:\r\n * ```ts\r\n * [[include:TileTreeReference_createFromRenderGraphic]]\r\n *```\r\n * @beta\r\n */\r\n public static createFromRenderGraphic(args: RenderGraphicTileTreeArgs): TileTreeReference {\r\n return tileTreeReferenceFromRenderGraphic(args);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"TileTreeReference.js","sourceRoot":"","sources":["../../../src/tile/TileTreeReference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA0D;AAC1D,wDAA6E;AAC7E,oD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BAA4B;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAMD;OACG;IACO,oBAAoB,CAAC,SAAgC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAClC,KAAK,6BAAkB,CAAC,MAAM;gBAC5B,IAAA,qBAAM,EAAC,SAAS,KAAK,IAAI,CAAC,CAAC;gBAC3B,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBACpC,MAAM;YACR,KAAK,6BAAkB,CAAC,OAAO;gBAC7B,SAAS,CAAC,WAAW,EAAE,CAAC;gBACxB,MAAM;QACV,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,2BAA2B;QAChC,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,0KAA0K;YAC1K,OAAO,IAAiC,CAAC;QAC3C,CAAC;QAED,OAAO,IAAI,CAAC,4BAA4B,EAAE,CAAC;IAC7C,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,MAAM,CAAC,uBAAuB,CAAC,IAA+B;QACnE,OAAO,IAAA,6CAAkC,EAAC,IAAI,CAAC,CAAC;IAClD,CAAC;CACF;AApRD,8CAoRC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, BeTimePoint } from \"@itwin/core-bentley\";\r\nimport { Matrix4d, Range1d, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { ElementAlignedBox3d, FeatureAppearanceProvider, FrustumPlanes, HiddenLine, PlanarClipMaskPriority, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { HitDetail } from \"../HitDetail\";\r\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\r\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\r\nimport { RenderMemory } from \"../render/RenderMemory\";\r\nimport { DecorateContext, SceneContext } from \"../ViewContext\";\r\nimport { ScreenViewport } from \"../Viewport\";\r\nimport {\r\n DisclosedTileTreeSet, GeometryTileTreeReference, MapFeatureInfoOptions, MapLayerFeatureInfo, RenderGraphicTileTreeArgs, TileDrawArgs, TileGeometryCollector, TileTree, TileTreeLoadStatus, TileTreeOwner, tileTreeReferenceFromRenderGraphic,\r\n} from \"./internal\";\r\n\r\n/** Describes the type of graphics produced by a [[TileTreeReference]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum TileGraphicType {\r\n /** Rendered behind all other geometry without depth. */\r\n BackgroundMap = 0,\r\n /** Rendered with normal scene graphics. */\r\n Scene = 1,\r\n /** Rendered in front of all other geometry. */\r\n Overlay = 2,\r\n}\r\n\r\n/** A reference to a [[TileTree]] suitable for drawing within a [[Viewport]]. The reference does not *own* its tile tree - it merely refers to it by\r\n * way of the tree's [[TileTreeOwner]].\r\n * The specific [[TileTree]] referenced by this object may change based on the current state of the Viewport in which it is drawn - for example,\r\n * as a result of changing the RenderMode, or animation settings, or classification settings, etc.\r\n * A reference to a TileTree is typically associated with a [[ViewState]], a [[DisplayStyleState]], or a [[Viewport]].\r\n * Multiple TileTreeReferences can refer to the same TileTree with different parameters and logic - for example, the same background map tiles can be displayed in two viewports with\r\n * differing levels of transparency.\r\n * @see [[TiledGraphicsProvider]] to supply custom [[TileTreeReference]]s to be drawn within a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class TileTreeReference /* implements RenderMemory.Consumer */ {\r\n /** The owner of the currently-referenced [[TileTree]]. Do not store a direct reference to it, because it may change or become disposed at any time. */\r\n public abstract get treeOwner(): TileTreeOwner;\r\n\r\n /** Force a new tree owner / tile tree to be created for the current tile tree reference\r\n * @internal\r\n */\r\n public resetTreeOwner() {}\r\n\r\n /** Disclose *all* TileTrees use by this reference. This may include things like map tiles used for draping on terrain.\r\n * Override this and call super if you have such auxiliary trees.\r\n * @note Any tree *NOT* disclosed becomes a candidate for *purging* (being unloaded from memory along with all of its tiles and graphics).\r\n */\r\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n const tree = this.treeOwner.tileTree;\r\n if (undefined !== tree)\r\n trees.add(tree);\r\n }\r\n\r\n /** Adds this reference's graphics to the scene. By default this invokes [[draw]]. */\r\n public addToScene(context: SceneContext): void {\r\n const args = this.createDrawArgs(context);\r\n if (undefined !== args)\r\n this.draw(args);\r\n }\r\n\r\n /** Adds this reference's graphics to the scene. By default this invokes [[TileTree.draw]] on the referenced TileTree, if it is loaded. */\r\n public draw(args: TileDrawArgs): void {\r\n args.tree.draw(args);\r\n }\r\n\r\n /** Return a tooltip describing the hit, or `undefined` if no tooltip can be supplied.\r\n * If you override this method, make sure to check that `hit` represents an entity belonging to your tile tree, e.g., by checking `hit.modelId` and `hit.sourceId`.\r\n * If you *don't* override this method, override [[canSupplyToolTip]] to return false.\r\n * Callers who want to obtain a tooltip should prefer [[getToolTipPromise]].\r\n */\r\n public async getToolTip(_hit: HitDetail): Promise<HTMLElement | string | undefined> { return undefined; }\r\n\r\n /** Return whether this TileTreeReference can supply a tooltip describing the entity represented by the specified hit.\r\n * [[getToolTipPromise]] calls [[getToolTip]] if and only if `canSupplyToolTip` returns `true`.\r\n * If your tile tree never supplies tooltips, override this to return `false`.\r\n */\r\n public canSupplyToolTip(_hit: HitDetail): boolean {\r\n return true;\r\n }\r\n\r\n /** Obtain a tooltip describing the specified `hit`, or `undefined` if this tile tree reference cannot supply a tooltip for the hit. */\r\n public getToolTipPromise(hit: HitDetail): Promise<HTMLElement | string | undefined> | undefined {\r\n return this.canSupplyToolTip(hit) ? this.getToolTip(hit).catch(() => undefined) : undefined;\r\n }\r\n\r\n /** Optionally return a MapLayerFeatureInfo object describing the hit.].\r\n * @alpha\r\n */\r\n public async getMapFeatureInfo(_hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<MapLayerFeatureInfo[] | undefined> { return undefined; }\r\n\r\n /** Optionally add any decorations specific to this reference. For example, map tile trees may add a logo image and/or copyright attributions.\r\n * @note This is currently only invoked for background maps and TiledGraphicsProviders - others have no decorations, but if they did implement this it would not be called.\r\n */\r\n public decorate(_context: DecorateContext): void { }\r\n\r\n /** Unions this reference's range with the supplied range to help compute a volume in world space for fitting a viewport to its contents.\r\n * Override this function if a reference's range should not be included in the fit range, or a range different from its tile tree's range should be used.\r\n */\r\n public unionFitRange(union: Range3d): void {\r\n const contentRange = this.computeWorldContentRange();\r\n if (!contentRange.isNull)\r\n union.extendRange(contentRange);\r\n }\r\n\r\n /** Record graphics memory consumed by this tile tree reference. */\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n const tree = this.treeOwner.tileTree;\r\n if (undefined !== tree)\r\n tree.collectStatistics(stats);\r\n }\r\n\r\n /** Return true if the tile tree is fully loaded and ready to draw.\r\n * The default implementation returns true if the tile tree loading process completed (whether it resulted in success or failure).\r\n * @note Do *not* override this property - override [[_isLoadingComplete]] instead..\r\n * @public\r\n */\r\n public get isLoadingComplete(): boolean {\r\n switch (this.treeOwner.loadStatus) {\r\n case TileTreeLoadStatus.NotLoaded:\r\n case TileTreeLoadStatus.Loading:\r\n return false;\r\n case TileTreeLoadStatus.NotFound:\r\n return true; // we tried, and failed, to load.\r\n case TileTreeLoadStatus.Loaded:\r\n return this._isLoadingComplete;\r\n }\r\n }\r\n\r\n /** Override if additional asynchronous loading is required after the tile tree is successfully loaded, to indicate when that loading has completed.\r\n * @public\r\n */\r\n protected get _isLoadingComplete(): boolean {\r\n return true;\r\n }\r\n\r\n /** Create context for drawing the tile tree, if it is ready for drawing.\r\n * TileTreeReferences can override individual portions of the context, e.g. apply their own transform.\r\n * Returns undefined if, e.g., the tile tree is not yet loaded.\r\n */\r\n public createDrawArgs(context: SceneContext): TileDrawArgs | undefined {\r\n const tree = this.treeOwner.load();\r\n if (undefined === tree)\r\n return undefined;\r\n\r\n return new TileDrawArgs({\r\n context,\r\n tree,\r\n now: BeTimePoint.now(),\r\n location: this.computeTransform(tree),\r\n viewFlagOverrides: this.getViewFlagOverrides(tree),\r\n clipVolume: this.getClipVolume(tree),\r\n parentsAndChildrenExclusive: tree.parentsAndChildrenExclusive,\r\n symbologyOverrides: this.getSymbologyOverrides(tree),\r\n appearanceProvider: this.getAppearanceProvider(tree),\r\n hiddenLineSettings: this.getHiddenLineSettings(tree),\r\n animationTransformNodeId: this.getAnimationTransformNodeId(tree),\r\n groupNodeId: this.getGroupNodeId(tree),\r\n });\r\n }\r\n\r\n /** @internal */\r\n protected getAnimationTransformNodeId(_tree: TileTree): number | undefined {\r\n return undefined;\r\n }\r\n /** @internal */\r\n protected getGroupNodeId(_tree: TileTree): number | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Supply transform from this tile tree reference's location to iModel coordinate space.\r\n * @returns undefined if the TileTree is not yet loaded.\r\n */\r\n public getLocation(): Transform | undefined {\r\n const tree = this.treeOwner.load();\r\n return undefined !== tree ? this.computeTransform(tree) : undefined;\r\n }\r\n\r\n /** Compute a transform from this tile tree reference's coordinate space to the [[IModelConnection]]'s coordinate space. */\r\n protected computeTransform(tree: TileTree): Transform {\r\n return tree.iModelTransform.clone();\r\n }\r\n\r\n /** Compute the range of this tile tree's contents in world coordinates.\r\n * @returns The content range in world coodinates, or a null range if the tile tree is not loaded or has a null content range.\r\n */\r\n public computeWorldContentRange(): ElementAlignedBox3d {\r\n const range = new Range3d();\r\n const tree = this.treeOwner.tileTree;\r\n if (undefined !== tree && !tree.rootTile.contentRange.isNull)\r\n this.computeTransform(tree).multiplyRange(tree.rootTile.contentRange, range);\r\n\r\n return range;\r\n }\r\n\r\n /** Return the clip volume applied to this reference's tile tree, if any. */\r\n protected getClipVolume(tree: TileTree): RenderClipVolume | undefined {\r\n return tree.clipVolume;\r\n }\r\n\r\n /** Supply overrides that should be applied to the [[ViewState]]'s [ViewFlags]($common) when drawing this tile tree reference. */\r\n protected getViewFlagOverrides(tree: TileTree): ViewFlagOverrides {\r\n return tree.viewFlagOverrides;\r\n }\r\n\r\n /** Return overrides that *replace* any defined for the view. */\r\n protected getSymbologyOverrides(_tree: TileTree): FeatureSymbology.Overrides | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Return a provider that can supplement the view's symbology overrides. */\r\n protected getAppearanceProvider(_tree: TileTree): FeatureAppearanceProvider | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Return hidden line settings to replace those defined for the view. */\r\n protected getHiddenLineSettings(_tree: TileTree): HiddenLine.Settings | undefined {\r\n return undefined;\r\n }\r\n\r\n /* Extend range to include transformed range of this tile tree.\r\n * @internal\r\n */\r\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, frustumPlanes?: FrustumPlanes) {\r\n const tree = this.treeOwner.tileTree;\r\n if (undefined === tree)\r\n return;\r\n\r\n const location = this.computeTransform(tree);\r\n tree.accumulateTransformedRange(range, matrix, location, frustumPlanes);\r\n }\r\n\r\n /** @internal */\r\n public getTerrainHeight(_terrainHeights: Range1d): void { }\r\n\r\n /** Return whether the geometry exposed by this tile tree reference should cast shadows on other geometry. */\r\n public get castsShadows(): boolean {\r\n return true;\r\n }\r\n\r\n /** Return whether this reference has global coverage. Mapping data is global and some non-primary models such as the OSM building layer have global coverage */\r\n public get isGlobal(): boolean { return false; }\r\n\r\n /** The [PlanarClipMaskPriority]($common) of this tile tree used to determine which tile trees contribute to a clip mask when\r\n * using [PlanarClipMaskMode.Priority]($common).\r\n * @beta\r\n */\r\n public get planarClipMaskPriority(): number { return PlanarClipMaskPriority.DesignModel; }\r\n\r\n /** Add attribution logo cards for the tile tree source logo cards to the viewport's logo div. */\r\n public addLogoCards(_cards: HTMLTableElement, _vp: ScreenViewport): void { }\r\n\r\n /** Create a tile tree reference equivalent to this one that also supplies an implementation of [[GeometryTileTreeReference.collectTileGeometry]].\r\n * Return `undefined` if geometry collection is not supported.\r\n * @see [[createGeometryTreeReference]].\r\n */\r\n protected _createGeometryTreeReference(): GeometryTileTreeReference | undefined {\r\n return undefined;\r\n }\r\n\r\n /** If defined, supplies the implementation of [[GeometryTileTreeReference.collectTileGeometry]].\r\n */\r\n public collectTileGeometry?: (collector: TileGeometryCollector) => void;\r\n\r\n /** A function that can be assigned to [[collectTileGeometry]] to enable geometry collection for references to tile trees that support geometry collection.\r\n */\r\n protected _collectTileGeometry(collector: TileGeometryCollector): void {\r\n const tree = this.treeOwner.load();\r\n switch (this.treeOwner.loadStatus) {\r\n case TileTreeLoadStatus.Loaded:\r\n assert(undefined !== tree);\r\n tree.collectTileGeometry(collector);\r\n break;\r\n case TileTreeLoadStatus.Loading:\r\n collector.markLoading();\r\n break;\r\n }\r\n }\r\n\r\n /** Obtain a tile tree reference equivalent to this one that also supplies an implementation of [[GeometryTileTreeReference.collectTileGeometry]], or\r\n * undefined if geometry collection is not supported.\r\n * Currently, only terrain and reality model tiles support geometry collection.\r\n * @note Do not override this method - override [[_createGeometryTreeReference]] instead.\r\n */\r\n public createGeometryTreeReference(): GeometryTileTreeReference | undefined {\r\n if (this.collectTileGeometry) {\r\n // Unclear why compiler doesn't detect that `this` satisfies the GeometryTileTreeReference interface...it must be looking only at the types, not this particular instance.\r\n return this as GeometryTileTreeReference;\r\n }\r\n\r\n return this._createGeometryTreeReference();\r\n }\r\n\r\n /** Create a [[TileTreeReference]] that displays a pre-defined [[RenderGraphic]].\r\n * The reference can be used to add dynamic content to a [[Viewport]]'s scene as a [[TiledGraphicsProvider]], as in the following example:\r\n * ```ts\r\n * [[include:TileTreeReference_createFromRenderGraphic]]\r\n *```\r\n * Or, it can be used as a [[DynamicSpatialClassifier]] to contextualize a reality model, like so:\r\n * ```ts\r\n * [[include:TileTreeReference_DynamicClassifier]]\r\n * ```\r\n * It can also be used to mask out portions of the background map or terrain via [PlanarClipMaskSettings]($common), as shown below:\r\n * ```ts\r\n * [[include:TileTreeReference_DynamicClipMask]]\r\n * ```\r\n * @beta\r\n */\r\n public static createFromRenderGraphic(args: RenderGraphicTileTreeArgs): TileTreeReference {\r\n return tileTreeReferenceFromRenderGraphic(args);\r\n }\r\n}\r\n"]}
@@ -43,7 +43,11 @@ export declare abstract class MapLayerImageryProvider {
43
43
  protected _firstRequestPromise: Promise<void> | undefined;
44
44
  /** @internal */
45
45
  get status(): MapLayerImageryProviderStatus;
46
- /** @alpha */
46
+ /** Determine if this provider supports map feature info.
47
+ * For example, this can be used to show the map feature info tool only when a provider is registered to support it.
48
+ * @returns true if provider supports map feature info else return false.
49
+ * @public
50
+ */
47
51
  get supportsMapFeatureInfo(): boolean;
48
52
  resetStatus(): void;
49
53
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAqB,MAAM,oBAAoB,CAAC;AAIzG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA6C,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,EAA2B,MAAM,aAAa,CAAC;AAC7N,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C;;GAEG;AACH,oBAAY,6BAA6B;IACvC,KAAK,IAAA;IACL,WAAW,IAAA;CACZ;AAED,gBAAgB;AAChB,MAAM,WAAW,WAAW;IAE1B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,8BAAsB,uBAAuB;IAiE/B,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,qBAAqB;IAAE,SAAS,CAAC,gBAAgB,EAA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AM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAWtI,gBAAgB;IACT,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAK7E,gBAAgB;IACT,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO;IAM/G,gBAAgB;IACT,uBAAuB,CAAC,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO;IASpF;;OAEG;IACH,SAAS,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM;CAQzC"}
@@ -34,7 +34,11 @@ var MapLayerImageryProviderStatus;
34
34
  class MapLayerImageryProvider {
35
35
  /** @internal */
36
36
  get status() { return this._status; }
37
- /** @alpha */
37
+ /** Determine if this provider supports map feature info.
38
+ * For example, this can be used to show the map feature info tool only when a provider is registered to support it.
39
+ * @returns true if provider supports map feature info else return false.
40
+ * @public
41
+ */
38
42
  get supportsMapFeatureInfo() { return false; }
39
43
  resetStatus() { this.setStatus(MapLayerImageryProviderStatus.Valid); }
40
44
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,oDAAyG;AACzG,wDAA6C;AAC7C,+CAA4C;AAC5C,mEAAwF;AAExF,0CAA6N;AAE7N,+CAAyG;AAEzG,gBAAgB;AAChB,MAAM,aAAa,GAAG,GAAG,EAAE,gBAAgB,GAAG,GAAG,CAAC;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B;;GAEG;AACH,IAAY,6BAGX;AA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I,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB;YACxE,OAAO,GAAG,CAAC;QAEb,IAAI,MAAM,GAAG,IAAA,4BAAiB,EAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACrE,MAAM,GAAG,IAAA,4BAAiB,EAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAhcD,0DAgcC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport { assert, BeEvent } from \"@itwin/core-bentley\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, ImageSourceFormat } from \"@itwin/core-common\";\r\nimport { Angle } from \"@itwin/core-geometry\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../../NotificationManager\";\r\nimport { ScreenViewport } from \"../../Viewport\";\r\nimport { appendQueryParams, GeographicTilingScheme, ImageryMapTile, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeatureInfo, MapTilingScheme, QuadId, WebMercatorTilingScheme } from \"../internal\";\r\nimport { HitDetail } from \"../../HitDetail\";\r\nimport { headersIncludeAuthMethod, setBasicAuthorization, setRequestTimeout } from \"../../request/utils\";\r\n\r\n/** @internal */\r\nconst tileImageSize = 256, untiledImageSize = 256;\r\nconst earthRadius = 6378137;\r\nconst doDebugToolTips = false;\r\n\r\n/** The status of the map layer imagery provider that lets you know if authentication is needed to request tiles.\r\n * @public\r\n */\r\nexport enum MapLayerImageryProviderStatus {\r\n Valid,\r\n RequireAuth,\r\n}\r\n\r\n/** @internal */\r\nexport interface WGS84Extent\r\n{\r\n longitudeLeft: number;\r\n longitudeRight: number;\r\n latitudeTop: number;\r\n latitudeBottom: number;\r\n}\r\n\r\n/** Abstract class for map layer imagery providers.\r\n * 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.\r\n * @beta\r\n */\r\nexport abstract class MapLayerImageryProvider {\r\n protected _hasSuccessfullyFetchedTile = false;\r\n public readonly onStatusChanged = new BeEvent<(provider: MapLayerImageryProvider) => void>();\r\n\r\n /** @internal */\r\n private readonly _mercatorTilingScheme = new WebMercatorTilingScheme();\r\n\r\n /** @internal */\r\n private readonly _geographicTilingScheme = new GeographicTilingScheme();\r\n\r\n /** @internal */\r\n private _status = MapLayerImageryProviderStatus.Valid;\r\n\r\n /** @internal */\r\n protected _includeUserCredentials = false;\r\n\r\n /** @internal */\r\n protected readonly onFirstRequestCompleted = new BeEvent<() => void>();\r\n\r\n /** @internal */\r\n protected _firstRequestPromise: Promise<void>|undefined;\r\n\r\n /** @internal */\r\n public get status() { return this._status; }\r\n\r\n /** @alpha */\r\n public get supportsMapFeatureInfo() { return false; }\r\n\r\n public resetStatus() { this.setStatus(MapLayerImageryProviderStatus.Valid); }\r\n\r\n /** @internal */\r\n public get tileSize(): number { return this._usesCachedTiles ? tileImageSize : untiledImageSize; }\r\n\r\n /** @internal */\r\n public get maximumScreenSize() { return 2 * this.tileSize; }\r\n\r\n public get minimumZoomLevel(): number { return this.defaultMinimumZoomLevel; }\r\n\r\n public get maximumZoomLevel(): number { return this.defaultMaximumZoomLevel; }\r\n\r\n /** @internal */\r\n public get usesCachedTiles() { return this._usesCachedTiles; }\r\n\r\n public get mutualExclusiveSubLayer(): boolean { return false; }\r\n\r\n /** @internal */\r\n public get useGeographicTilingScheme() { return false; }\r\n\r\n public cartoRange?: MapCartoRectangle;\r\n\r\n /**\r\n * This value is used internally for various computations, this should not get overriden.\r\n * @internal\r\n */\r\n protected readonly defaultMinimumZoomLevel = 0;\r\n\r\n /**\r\n * This value is used internally for various computations, this should not get overriden.\r\n * @internal\r\n */\r\n protected readonly defaultMaximumZoomLevel = 22;\r\n\r\n /** @internal */\r\n protected get _filterByCartoRange() { return true; }\r\n\r\n constructor(protected readonly _settings: ImageMapLayerSettings, protected _usesCachedTiles: boolean) {\r\n this._mercatorTilingScheme = new WebMercatorTilingScheme();\r\n this._geographicTilingScheme = new GeographicTilingScheme(2, 1, true);\r\n }\r\n\r\n /**\r\n * Initialize the provider by loading the first tile at its default maximum zoom level.\r\n * @beta\r\n */\r\n public async initialize(): Promise<void> {\r\n this.loadTile(0, 0, this.defaultMaximumZoomLevel).then((tileData: ImageSource | undefined) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n if (tileData !== undefined)\r\n this._missingTileData = tileData.data as Uint8Array;\r\n });\r\n }\r\n\r\n public abstract constructUrl(row: number, column: number, zoomLevel: number): Promise<string>;\r\n\r\n public get tilingScheme(): MapTilingScheme { return this.useGeographicTilingScheme ? this._geographicTilingScheme : this._mercatorTilingScheme; }\r\n\r\n /**\r\n * Add attribution logo cards for the data supplied by this provider to the [[Viewport]]'s logo div.\r\n * @param _cards Logo cards HTML element that may contain custom data attributes.\r\n * @param _viewport Viewport to add logo cards to.\r\n * @beta\r\n */\r\n public addLogoCards(_cards: HTMLTableElement, _viewport: ScreenViewport): void { }\r\n\r\n /** @internal */\r\n protected _missingTileData?: Uint8Array;\r\n\r\n /** @internal */\r\n public get transparentBackgroundString(): string { return this._settings.transparentBackground ? \"true\" : \"false\"; }\r\n\r\n /** @internal */\r\n protected async _areChildrenAvailable(_tile: ImageryMapTile): Promise<boolean> { return true; }\r\n\r\n /** @internal */\r\n public getPotentialChildIds(quadId: QuadId): QuadId[] {\r\n const childLevel = quadId.level + 1;\r\n return quadId.getChildIds(this.tilingScheme.getNumberOfXChildrenAtLevel(childLevel), this.tilingScheme.getNumberOfYChildrenAtLevel(childLevel));\r\n }\r\n\r\n /**\r\n * Get child IDs of a quad and generate tiles based on these child IDs.\r\n * See [[ImageryTileTree._loadChildren]] for the definition of `resolveChildren` where this function is commonly called.\r\n * @param quadId quad to generate child IDs for.\r\n * @param resolveChildren Function that creates tiles from child IDs.\r\n * @beta\r\n */\r\n protected _generateChildIds(quadId: QuadId, resolveChildren: (childIds: QuadId[]) => void) {\r\n resolveChildren(this.getPotentialChildIds(quadId));\r\n }\r\n\r\n /** @internal */\r\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) {\r\n if (tile.depth >= this.maximumZoomLevel || (undefined !== this.cartoRange && this._filterByCartoRange && !this.cartoRange.intersectsRange(tile.rectangle))) {\r\n tile.setLeaf();\r\n return;\r\n }\r\n this._generateChildIds(tile.quadId, resolveChildren);\r\n }\r\n\r\n /**\r\n * Get tooltip text for a specific quad and cartographic position.\r\n * @param strings List of strings to contain tooltip text.\r\n * @param quadId Quad ID to get tooltip for.\r\n * @param _carto Cartographic that may be used to retrieve and/or format tooltip text.\r\n * @param tree Tree associated with the quad to get the tooltip for.\r\n * @internal\r\n */\r\n public async getToolTip(strings: string[], quadId: QuadId, _carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n if (doDebugToolTips) {\r\n const range = quadId.getLatLongRangeDegrees(tree.tilingScheme);\r\n strings.push(`QuadId: ${quadId.debugString}, Lat: ${range.low.x} - ${range.high.x} Long: ${range.low.y} - ${range.high.y}`);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], _quadId: QuadId, _carto: Cartographic, _tree: ImageryMapTileTree, _hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<void> {\r\n // default implementation; simply return an empty feature info\r\n featureInfos.push({ layerName: this._settings.name });\r\n }\r\n\r\n /** @internal */\r\n protected async getImageFromTileResponse(tileResponse: Response, zoomLevel: number) {\r\n const arrayBuffer = await tileResponse.arrayBuffer();\r\n const byteArray: Uint8Array = new Uint8Array(arrayBuffer);\r\n if (!byteArray || (byteArray.length === 0))\r\n return undefined;\r\n if (this.matchesMissingTile(byteArray) && zoomLevel > 8)\r\n return undefined;\r\n\r\n const contentType = tileResponse.headers.get(\"content-type\")?.toLowerCase();\r\n let imageFormat: ImageSourceFormat | undefined;\r\n if (contentType) {\r\n // Note: 'includes' is used here instead of exact comparison because we encountered\r\n // some servers that would give content type such as 'image/png;charset=UTF-8'.\r\n if (contentType.includes(\"image/jpeg\"))\r\n imageFormat = ImageSourceFormat.Jpeg;\r\n else if (contentType.includes(\"image/png\"))\r\n imageFormat = ImageSourceFormat.Png;\r\n }\r\n\r\n if (imageFormat !== undefined)\r\n return new ImageSource(byteArray, imageFormat);\r\n\r\n assert(false, \"Invalid tile content type\");\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Change the status of this provider.\r\n * Sub-classes should override 'onStatusUpdated' instead of this method.\r\n * @internal\r\n */\r\n public setStatus(status: MapLayerImageryProviderStatus) {\r\n if (this._status !== status) {\r\n this.onStatusUpdated(status);\r\n this._status = status;\r\n this.onStatusChanged.raiseEvent(this);\r\n }\r\n }\r\n\r\n /** Method called whenever the status changes, giving the opportunity to sub-classes to have a custom behavior.\r\n * @internal\r\n */\r\n protected onStatusUpdated(_newStatus: MapLayerImageryProviderStatus) { }\r\n\r\n /** @internal */\r\n protected setRequestAuthorization(headers: Headers) {\r\n if (this._settings.userName && this._settings.password) {\r\n setBasicAuthorization(headers, this._settings.userName, this._settings.password);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public async makeTileRequest(url: string, timeoutMs?: number): Promise<Response> {\r\n\r\n // We want to complete the first request before letting other requests go;\r\n // this done to avoid flooding server with requests missing credentials\r\n if (!this._firstRequestPromise)\r\n this._firstRequestPromise = new Promise<void>((resolve: any) => this.onFirstRequestCompleted.addOnce(()=>resolve()));\r\n else\r\n await this._firstRequestPromise;\r\n\r\n let response: Response|undefined;\r\n try {\r\n response = await this.makeRequest(url, timeoutMs);\r\n } finally {\r\n this.onFirstRequestCompleted.raiseEvent();\r\n }\r\n\r\n if (response === undefined)\r\n throw new Error(\"fetch call failed\");\r\n\r\n return response;\r\n }\r\n\r\n /** @internal */\r\n public async makeRequest(url: string, timeoutMs?: number) {\r\n\r\n let response: Response|undefined;\r\n\r\n let headers: Headers | undefined;\r\n let hasCreds = false;\r\n if (this._settings.userName && this._settings.password) {\r\n hasCreds = true;\r\n headers = new Headers();\r\n this.setRequestAuthorization(headers);\r\n }\r\n const opts: RequestInit = {\r\n method: \"GET\",\r\n headers,\r\n credentials: this._includeUserCredentials ? \"include\" : undefined,\r\n };\r\n\r\n if (timeoutMs !== undefined)\r\n setRequestTimeout(opts, timeoutMs);\r\n\r\n response = await fetch(url, opts);\r\n\r\n if (response.status === 401\r\n && headersIncludeAuthMethod(response.headers, [\"ntlm\", \"negotiate\"])\r\n && !this._includeUserCredentials\r\n && !hasCreds\r\n ) {\r\n // Removed the previous headers and make sure \"include\" credentials is set\r\n opts.headers = undefined;\r\n opts.credentials = \"include\";\r\n\r\n // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)\r\n response = await fetch(url, opts);\r\n if (response.status === 200) {\r\n this._includeUserCredentials = true; // avoid going through 401 challenges over and over\r\n }\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /** Returns a map layer tile at the specified settings. */\r\n public async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\r\n\r\n try {\r\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\r\n if (tileUrl.length === 0)\r\n return undefined;\r\n\r\n const tileResponse: Response = await this.makeTileRequest(tileUrl);\r\n\r\n if (!this._hasSuccessfullyFetchedTile) {\r\n this._hasSuccessfullyFetchedTile = true;\r\n }\r\n\r\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\r\n } catch (error: any) {\r\n if (error?.status === 401) {\r\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\r\n\r\n // Only report error to end-user if we were previously able to fetch tiles\r\n // and then encountered an error, otherwise I assume an error was already reported\r\n // through the source validation process.\r\n if (this._hasSuccessfullyFetchedTile) {\r\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.LoadTileTokenError\", { layerName: this._settings.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\r\n }\r\n\r\n }\r\n return undefined;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected async toolTipFromUrl(strings: string[], url: string): Promise<void> {\r\n const headers = new Headers();\r\n this.setRequestAuthorization(headers);\r\n\r\n try {\r\n const response = await fetch(url, {\r\n method: \"GET\",\r\n headers,\r\n credentials: this._includeUserCredentials ? \"include\" : undefined,\r\n });\r\n const text = await response.text();\r\n if (undefined !== text) {\r\n strings.push(text);\r\n }\r\n } catch {\r\n }\r\n }\r\n\r\n /** @internal */\r\n public matchesMissingTile(tileData: Uint8Array): boolean {\r\n if (!this._missingTileData)\r\n return false;\r\n if (tileData.length !== this._missingTileData.length)\r\n return false;\r\n for (let i: number = 0; i < tileData.length; i += 10) {\r\n if (this._missingTileData[i] !== tileData[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Calculates the projected x cartesian coordinate in EPSG:3857 from the longitude in EPSG:4326 (WGS84)\r\n * @param longitude Longitude in EPSG:4326 (WGS84)\r\n * @internal\r\n */\r\n public getEPSG3857X(longitude: number): number {\r\n return longitude * 20037508.34 / 180.0;\r\n }\r\n\r\n /**\r\n * Calculates the projected y cartesian coordinate in EPSG:3857 from the latitude in EPSG:4326 (WGS84)\r\n * @param latitude Latitude in EPSG:4326 (WGS84)\r\n * @internal\r\n */\r\n public getEPSG3857Y(latitude: number): number {\r\n const y = Math.log(Math.tan((90.0 + latitude) * Math.PI / 360.0)) / (Math.PI / 180.0);\r\n return y * 20037508.34 / 180.0;\r\n }\r\n\r\n /**\r\n * Calculates the longitude in EPSG:4326 (WGS84) from the projected x cartesian coordinate in EPSG:3857\r\n * @param x3857 Projected x cartesian coordinate in EPSG:3857\r\n * @internal\r\n */\r\n public getEPSG4326Lon(x3857: number): number {\r\n return Angle.radiansToDegrees(x3857 / earthRadius);\r\n }\r\n\r\n /**\r\n * Calculates the latitude in EPSG:4326 (WGS84) from the projected y cartesian coordinate in EPSG:3857\r\n * @param y3857 Projected y cartesian coordinate in EPSG:3857\r\n * @internal\r\n */\r\n public getEPSG4326Lat(y3857: number): number {\r\n const y = 2 * Math.atan(Math.exp(y3857 / earthRadius)) - (Math.PI / 2);\r\n return Angle.radiansToDegrees(y);\r\n }\r\n\r\n /**\r\n * Get the bounding box/extents of a tile in EPSG:4326 (WGS84) format.\r\n * Map tile providers like Bing and Mapbox allow the URL to be constructed directly from the zoom level and tile coordinates.\r\n * However, WMS-based servers take a bounding box instead. This method can help get that bounding box from a tile.\r\n * @param row Row of the tile\r\n * @param column Column of the tile\r\n * @param zoomLevel Desired zoom level of the tile\r\n * @internal\r\n */\r\n public getEPSG4326Extent(row: number, column: number, zoomLevel: number): WGS84Extent {\r\n // Shift left (this.tileSize << zoomLevel) overflow when using 512 pixels tile at higher resolution,\r\n // so use Math.pow instead (I assume the performance lost to be minimal)\r\n const mapSize = this.tileSize * Math.pow(2, zoomLevel);\r\n const leftGrid = this.tileSize * column;\r\n const topGrid = this.tileSize * row;\r\n\r\n const longitudeLeft = 360 * ((leftGrid / mapSize) - 0.5);\r\n const y0 = 0.5 - ((topGrid + this.tileSize) / mapSize);\r\n const latitudeBottom = 90.0 - 360.0 * Math.atan(Math.exp(-y0 * 2 * Math.PI)) / Math.PI;\r\n\r\n const longitudeRight = 360 * (((leftGrid + this.tileSize) / mapSize) - 0.5);\r\n const y1 = 0.5 - (topGrid / mapSize);\r\n const latitudeTop = 90.0 - 360.0 * Math.atan(Math.exp(-y1 * 2 * Math.PI)) / Math.PI;\r\n\r\n return { longitudeLeft, longitudeRight, latitudeTop, latitudeBottom };\r\n }\r\n\r\n /**\r\n * Get the bounding box/extents of a tile in EPSG:3857 format.\r\n * @param row Row of the tile\r\n * @param column Column of the tile\r\n * @param zoomLevel Desired zoom level of the tile\r\n * @internal\r\n */\r\n public getEPSG3857Extent(row: number, column: number, zoomLevel: number): { left: number, right: number, top: number, bottom: number } {\r\n const epsg4326Extent = this.getEPSG4326Extent(row, column, zoomLevel);\r\n\r\n const left = this.getEPSG3857X(epsg4326Extent.longitudeLeft);\r\n const right = this.getEPSG3857X(epsg4326Extent.longitudeRight);\r\n const bottom = this.getEPSG3857Y(epsg4326Extent.latitudeBottom);\r\n const top = this.getEPSG3857Y(epsg4326Extent.latitudeTop);\r\n\r\n return { left, right, bottom, top };\r\n }\r\n\r\n /** @internal */\r\n public getEPSG3857ExtentString(row: number, column: number, zoomLevel: number) {\r\n const tileExtent = this.getEPSG3857Extent(row, column, zoomLevel);\r\n return `${tileExtent.left.toFixed(2)},${tileExtent.bottom.toFixed(2)},${tileExtent.right.toFixed(2)},${tileExtent.top.toFixed(2)}`;\r\n }\r\n\r\n /** @internal */\r\n public getEPSG4326TileExtentString(row: number, column: number, zoomLevel: number, latLongAxisOrdering: boolean) {\r\n const tileExtent = this.getEPSG4326Extent(row, column, zoomLevel);\r\n return this.getEPSG4326ExtentString(tileExtent, latLongAxisOrdering);\r\n\r\n }\r\n\r\n /** @internal */\r\n public getEPSG4326ExtentString(tileExtent: WGS84Extent, latLongAxisOrdering: boolean) {\r\n\r\n if (latLongAxisOrdering) {\r\n return `${tileExtent.latitudeBottom.toFixed(8)},${tileExtent.longitudeLeft.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)},${tileExtent.longitudeRight.toFixed(8)}`;\r\n } else {\r\n return `${tileExtent.longitudeLeft.toFixed(8)},${tileExtent.latitudeBottom.toFixed(8)},${tileExtent.longitudeRight.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)}`;\r\n }\r\n }\r\n\r\n /** Append custom parameters for settings to provided URL object.\r\n * @internal\r\n */\r\n protected appendCustomParams(url: string) {\r\n if (!this._settings.savedQueryParams && !this._settings.unsavedQueryParams)\r\n return url;\r\n\r\n let tmpUrl = appendQueryParams(url, this._settings.savedQueryParams);\r\n tmpUrl = appendQueryParams(tmpUrl, this._settings.unsavedQueryParams);\r\n return tmpUrl;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"MapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,oDAAyG;AACzG,wDAA6C;AAC7C,+CAA4C;AAC5C,mEAAwF;AAExF,0CAA6N;AAE7N,+CAAyG;AAEzG,gBAAgB;AAChB,MAAM,aAAa,GAAG,GAAG,EAAE,gBAAgB,GAAG,GAAG,CAAC;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B;;GAEG;AACH,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACvC,mFAAK,CAAA;IACL,+FAAW,CAAA;AACb,CAAC,EAHW,6BAA6B,6CAA7B,6BAA6B,QAGxC;AAWD;;;GAGG;AACH,MAAsB,uBAAuB;IAsB3C,gBAAgB;IAChB,IAAW,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5C;;;;OAIG;IACH,IAAW,sBAAsB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAEvD,WAAW,KAAK,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE7E,gBAAgB;IAChB,IAAW,QAAQ,KAAa,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAElG,gBAAgB;IAChB,IAAW,iBAAiB,KAAK,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE5D,IAAW,gBAAgB,KAAa,OAAO,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAE9E,IAAW,gBAAgB,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CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACvK,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACvK,CAAC;IACH,CAAC;IAED;;OAEG;IACO,kBAAkB,CAAC,GAAW;QACtC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB;YACxE,OAAO,GAAG,CAAC;QAEb,IAAI,MAAM,GAAG,IAAA,4BAAiB,EAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACrE,MAAM,GAAG,IAAA,4BAAiB,EAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AApcD,0DAocC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport { assert, BeEvent } from \"@itwin/core-bentley\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, ImageSourceFormat } from \"@itwin/core-common\";\r\nimport { Angle } from \"@itwin/core-geometry\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../../NotificationManager\";\r\nimport { ScreenViewport } from \"../../Viewport\";\r\nimport { appendQueryParams, GeographicTilingScheme, ImageryMapTile, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeatureInfo, MapTilingScheme, QuadId, WebMercatorTilingScheme } from \"../internal\";\r\nimport { HitDetail } from \"../../HitDetail\";\r\nimport { headersIncludeAuthMethod, setBasicAuthorization, setRequestTimeout } from \"../../request/utils\";\r\n\r\n/** @internal */\r\nconst tileImageSize = 256, untiledImageSize = 256;\r\nconst earthRadius = 6378137;\r\nconst doDebugToolTips = false;\r\n\r\n/** The status of the map layer imagery provider that lets you know if authentication is needed to request tiles.\r\n * @public\r\n */\r\nexport enum MapLayerImageryProviderStatus {\r\n Valid,\r\n RequireAuth,\r\n}\r\n\r\n/** @internal */\r\nexport interface WGS84Extent\r\n{\r\n longitudeLeft: number;\r\n longitudeRight: number;\r\n latitudeTop: number;\r\n latitudeBottom: number;\r\n}\r\n\r\n/** Abstract class for map layer imagery providers.\r\n * 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.\r\n * @beta\r\n */\r\nexport abstract class MapLayerImageryProvider {\r\n protected _hasSuccessfullyFetchedTile = false;\r\n public readonly onStatusChanged = new BeEvent<(provider: MapLayerImageryProvider) => void>();\r\n\r\n /** @internal */\r\n private readonly _mercatorTilingScheme = new WebMercatorTilingScheme();\r\n\r\n /** @internal */\r\n private readonly _geographicTilingScheme = new GeographicTilingScheme();\r\n\r\n /** @internal */\r\n private _status = MapLayerImageryProviderStatus.Valid;\r\n\r\n /** @internal */\r\n protected _includeUserCredentials = false;\r\n\r\n /** @internal */\r\n protected readonly onFirstRequestCompleted = new BeEvent<() => void>();\r\n\r\n /** @internal */\r\n protected _firstRequestPromise: Promise<void>|undefined;\r\n\r\n /** @internal */\r\n public get status() { return this._status; }\r\n\r\n /** Determine if this provider supports map feature info.\r\n * For example, this can be used to show the map feature info tool only when a provider is registered to support it.\r\n * @returns true if provider supports map feature info else return false.\r\n * @public\r\n */\r\n public get supportsMapFeatureInfo(): boolean { return false; }\r\n\r\n public resetStatus() { this.setStatus(MapLayerImageryProviderStatus.Valid); }\r\n\r\n /** @internal */\r\n public get tileSize(): number { return this._usesCachedTiles ? tileImageSize : untiledImageSize; }\r\n\r\n /** @internal */\r\n public get maximumScreenSize() { return 2 * this.tileSize; }\r\n\r\n public get minimumZoomLevel(): number { return this.defaultMinimumZoomLevel; }\r\n\r\n public get maximumZoomLevel(): number { return this.defaultMaximumZoomLevel; }\r\n\r\n /** @internal */\r\n public get usesCachedTiles() { return this._usesCachedTiles; }\r\n\r\n public get mutualExclusiveSubLayer(): boolean { return false; }\r\n\r\n /** @internal */\r\n public get useGeographicTilingScheme() { return false; }\r\n\r\n public cartoRange?: MapCartoRectangle;\r\n\r\n /**\r\n * This value is used internally for various computations, this should not get overriden.\r\n * @internal\r\n */\r\n protected readonly defaultMinimumZoomLevel = 0;\r\n\r\n /**\r\n * This value is used internally for various computations, this should not get overriden.\r\n * @internal\r\n */\r\n protected readonly defaultMaximumZoomLevel = 22;\r\n\r\n /** @internal */\r\n protected get _filterByCartoRange() { return true; }\r\n\r\n constructor(protected readonly _settings: ImageMapLayerSettings, protected _usesCachedTiles: boolean) {\r\n this._mercatorTilingScheme = new WebMercatorTilingScheme();\r\n this._geographicTilingScheme = new GeographicTilingScheme(2, 1, true);\r\n }\r\n\r\n /**\r\n * Initialize the provider by loading the first tile at its default maximum zoom level.\r\n * @beta\r\n */\r\n public async initialize(): Promise<void> {\r\n this.loadTile(0, 0, this.defaultMaximumZoomLevel).then((tileData: ImageSource | undefined) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n if (tileData !== undefined)\r\n this._missingTileData = tileData.data as Uint8Array;\r\n });\r\n }\r\n\r\n public abstract constructUrl(row: number, column: number, zoomLevel: number): Promise<string>;\r\n\r\n public get tilingScheme(): MapTilingScheme { return this.useGeographicTilingScheme ? this._geographicTilingScheme : this._mercatorTilingScheme; }\r\n\r\n /**\r\n * Add attribution logo cards for the data supplied by this provider to the [[Viewport]]'s logo div.\r\n * @param _cards Logo cards HTML element that may contain custom data attributes.\r\n * @param _viewport Viewport to add logo cards to.\r\n * @beta\r\n */\r\n public addLogoCards(_cards: HTMLTableElement, _viewport: ScreenViewport): void { }\r\n\r\n /** @internal */\r\n protected _missingTileData?: Uint8Array;\r\n\r\n /** @internal */\r\n public get transparentBackgroundString(): string { return this._settings.transparentBackground ? \"true\" : \"false\"; }\r\n\r\n /** @internal */\r\n protected async _areChildrenAvailable(_tile: ImageryMapTile): Promise<boolean> { return true; }\r\n\r\n /** @internal */\r\n public getPotentialChildIds(quadId: QuadId): QuadId[] {\r\n const childLevel = quadId.level + 1;\r\n return quadId.getChildIds(this.tilingScheme.getNumberOfXChildrenAtLevel(childLevel), this.tilingScheme.getNumberOfYChildrenAtLevel(childLevel));\r\n }\r\n\r\n /**\r\n * Get child IDs of a quad and generate tiles based on these child IDs.\r\n * See [[ImageryTileTree._loadChildren]] for the definition of `resolveChildren` where this function is commonly called.\r\n * @param quadId quad to generate child IDs for.\r\n * @param resolveChildren Function that creates tiles from child IDs.\r\n * @beta\r\n */\r\n protected _generateChildIds(quadId: QuadId, resolveChildren: (childIds: QuadId[]) => void) {\r\n resolveChildren(this.getPotentialChildIds(quadId));\r\n }\r\n\r\n /** @internal */\r\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) {\r\n if (tile.depth >= this.maximumZoomLevel || (undefined !== this.cartoRange && this._filterByCartoRange && !this.cartoRange.intersectsRange(tile.rectangle))) {\r\n tile.setLeaf();\r\n return;\r\n }\r\n this._generateChildIds(tile.quadId, resolveChildren);\r\n }\r\n\r\n /**\r\n * Get tooltip text for a specific quad and cartographic position.\r\n * @param strings List of strings to contain tooltip text.\r\n * @param quadId Quad ID to get tooltip for.\r\n * @param _carto Cartographic that may be used to retrieve and/or format tooltip text.\r\n * @param tree Tree associated with the quad to get the tooltip for.\r\n * @internal\r\n */\r\n public async getToolTip(strings: string[], quadId: QuadId, _carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n if (doDebugToolTips) {\r\n const range = quadId.getLatLongRangeDegrees(tree.tilingScheme);\r\n strings.push(`QuadId: ${quadId.debugString}, Lat: ${range.low.x} - ${range.high.x} Long: ${range.low.y} - ${range.high.y}`);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], _quadId: QuadId, _carto: Cartographic, _tree: ImageryMapTileTree, _hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<void> {\r\n // default implementation; simply return an empty feature info\r\n featureInfos.push({ layerName: this._settings.name });\r\n }\r\n\r\n /** @internal */\r\n protected async getImageFromTileResponse(tileResponse: Response, zoomLevel: number) {\r\n const arrayBuffer = await tileResponse.arrayBuffer();\r\n const byteArray: Uint8Array = new Uint8Array(arrayBuffer);\r\n if (!byteArray || (byteArray.length === 0))\r\n return undefined;\r\n if (this.matchesMissingTile(byteArray) && zoomLevel > 8)\r\n return undefined;\r\n\r\n const contentType = tileResponse.headers.get(\"content-type\")?.toLowerCase();\r\n let imageFormat: ImageSourceFormat | undefined;\r\n if (contentType) {\r\n // Note: 'includes' is used here instead of exact comparison because we encountered\r\n // some servers that would give content type such as 'image/png;charset=UTF-8'.\r\n if (contentType.includes(\"image/jpeg\"))\r\n imageFormat = ImageSourceFormat.Jpeg;\r\n else if (contentType.includes(\"image/png\"))\r\n imageFormat = ImageSourceFormat.Png;\r\n }\r\n\r\n if (imageFormat !== undefined)\r\n return new ImageSource(byteArray, imageFormat);\r\n\r\n assert(false, \"Invalid tile content type\");\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Change the status of this provider.\r\n * Sub-classes should override 'onStatusUpdated' instead of this method.\r\n * @internal\r\n */\r\n public setStatus(status: MapLayerImageryProviderStatus) {\r\n if (this._status !== status) {\r\n this.onStatusUpdated(status);\r\n this._status = status;\r\n this.onStatusChanged.raiseEvent(this);\r\n }\r\n }\r\n\r\n /** Method called whenever the status changes, giving the opportunity to sub-classes to have a custom behavior.\r\n * @internal\r\n */\r\n protected onStatusUpdated(_newStatus: MapLayerImageryProviderStatus) { }\r\n\r\n /** @internal */\r\n protected setRequestAuthorization(headers: Headers) {\r\n if (this._settings.userName && this._settings.password) {\r\n setBasicAuthorization(headers, this._settings.userName, this._settings.password);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public async makeTileRequest(url: string, timeoutMs?: number): Promise<Response> {\r\n\r\n // We want to complete the first request before letting other requests go;\r\n // this done to avoid flooding server with requests missing credentials\r\n if (!this._firstRequestPromise)\r\n this._firstRequestPromise = new Promise<void>((resolve: any) => this.onFirstRequestCompleted.addOnce(()=>resolve()));\r\n else\r\n await this._firstRequestPromise;\r\n\r\n let response: Response|undefined;\r\n try {\r\n response = await this.makeRequest(url, timeoutMs);\r\n } finally {\r\n this.onFirstRequestCompleted.raiseEvent();\r\n }\r\n\r\n if (response === undefined)\r\n throw new Error(\"fetch call failed\");\r\n\r\n return response;\r\n }\r\n\r\n /** @internal */\r\n public async makeRequest(url: string, timeoutMs?: number) {\r\n\r\n let response: Response|undefined;\r\n\r\n let headers: Headers | undefined;\r\n let hasCreds = false;\r\n if (this._settings.userName && this._settings.password) {\r\n hasCreds = true;\r\n headers = new Headers();\r\n this.setRequestAuthorization(headers);\r\n }\r\n const opts: RequestInit = {\r\n method: \"GET\",\r\n headers,\r\n credentials: this._includeUserCredentials ? \"include\" : undefined,\r\n };\r\n\r\n if (timeoutMs !== undefined)\r\n setRequestTimeout(opts, timeoutMs);\r\n\r\n response = await fetch(url, opts);\r\n\r\n if (response.status === 401\r\n && headersIncludeAuthMethod(response.headers, [\"ntlm\", \"negotiate\"])\r\n && !this._includeUserCredentials\r\n && !hasCreds\r\n ) {\r\n // Removed the previous headers and make sure \"include\" credentials is set\r\n opts.headers = undefined;\r\n opts.credentials = \"include\";\r\n\r\n // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)\r\n response = await fetch(url, opts);\r\n if (response.status === 200) {\r\n this._includeUserCredentials = true; // avoid going through 401 challenges over and over\r\n }\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /** Returns a map layer tile at the specified settings. */\r\n public async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\r\n\r\n try {\r\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\r\n if (tileUrl.length === 0)\r\n return undefined;\r\n\r\n const tileResponse: Response = await this.makeTileRequest(tileUrl);\r\n\r\n if (!this._hasSuccessfullyFetchedTile) {\r\n this._hasSuccessfullyFetchedTile = true;\r\n }\r\n\r\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\r\n } catch (error: any) {\r\n if (error?.status === 401) {\r\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\r\n\r\n // Only report error to end-user if we were previously able to fetch tiles\r\n // and then encountered an error, otherwise I assume an error was already reported\r\n // through the source validation process.\r\n if (this._hasSuccessfullyFetchedTile) {\r\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.LoadTileTokenError\", { layerName: this._settings.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\r\n }\r\n\r\n }\r\n return undefined;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected async toolTipFromUrl(strings: string[], url: string): Promise<void> {\r\n const headers = new Headers();\r\n this.setRequestAuthorization(headers);\r\n\r\n try {\r\n const response = await fetch(url, {\r\n method: \"GET\",\r\n headers,\r\n credentials: this._includeUserCredentials ? \"include\" : undefined,\r\n });\r\n const text = await response.text();\r\n if (undefined !== text) {\r\n strings.push(text);\r\n }\r\n } catch {\r\n }\r\n }\r\n\r\n /** @internal */\r\n public matchesMissingTile(tileData: Uint8Array): boolean {\r\n if (!this._missingTileData)\r\n return false;\r\n if (tileData.length !== this._missingTileData.length)\r\n return false;\r\n for (let i: number = 0; i < tileData.length; i += 10) {\r\n if (this._missingTileData[i] !== tileData[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Calculates the projected x cartesian coordinate in EPSG:3857 from the longitude in EPSG:4326 (WGS84)\r\n * @param longitude Longitude in EPSG:4326 (WGS84)\r\n * @internal\r\n */\r\n public getEPSG3857X(longitude: number): number {\r\n return longitude * 20037508.34 / 180.0;\r\n }\r\n\r\n /**\r\n * Calculates the projected y cartesian coordinate in EPSG:3857 from the latitude in EPSG:4326 (WGS84)\r\n * @param latitude Latitude in EPSG:4326 (WGS84)\r\n * @internal\r\n */\r\n public getEPSG3857Y(latitude: number): number {\r\n const y = Math.log(Math.tan((90.0 + latitude) * Math.PI / 360.0)) / (Math.PI / 180.0);\r\n return y * 20037508.34 / 180.0;\r\n }\r\n\r\n /**\r\n * Calculates the longitude in EPSG:4326 (WGS84) from the projected x cartesian coordinate in EPSG:3857\r\n * @param x3857 Projected x cartesian coordinate in EPSG:3857\r\n * @internal\r\n */\r\n public getEPSG4326Lon(x3857: number): number {\r\n return Angle.radiansToDegrees(x3857 / earthRadius);\r\n }\r\n\r\n /**\r\n * Calculates the latitude in EPSG:4326 (WGS84) from the projected y cartesian coordinate in EPSG:3857\r\n * @param y3857 Projected y cartesian coordinate in EPSG:3857\r\n * @internal\r\n */\r\n public getEPSG4326Lat(y3857: number): number {\r\n const y = 2 * Math.atan(Math.exp(y3857 / earthRadius)) - (Math.PI / 2);\r\n return Angle.radiansToDegrees(y);\r\n }\r\n\r\n /**\r\n * Get the bounding box/extents of a tile in EPSG:4326 (WGS84) format.\r\n * Map tile providers like Bing and Mapbox allow the URL to be constructed directly from the zoom level and tile coordinates.\r\n * However, WMS-based servers take a bounding box instead. This method can help get that bounding box from a tile.\r\n * @param row Row of the tile\r\n * @param column Column of the tile\r\n * @param zoomLevel Desired zoom level of the tile\r\n * @internal\r\n */\r\n public getEPSG4326Extent(row: number, column: number, zoomLevel: number): WGS84Extent {\r\n // Shift left (this.tileSize << zoomLevel) overflow when using 512 pixels tile at higher resolution,\r\n // so use Math.pow instead (I assume the performance lost to be minimal)\r\n const mapSize = this.tileSize * Math.pow(2, zoomLevel);\r\n const leftGrid = this.tileSize * column;\r\n const topGrid = this.tileSize * row;\r\n\r\n const longitudeLeft = 360 * ((leftGrid / mapSize) - 0.5);\r\n const y0 = 0.5 - ((topGrid + this.tileSize) / mapSize);\r\n const latitudeBottom = 90.0 - 360.0 * Math.atan(Math.exp(-y0 * 2 * Math.PI)) / Math.PI;\r\n\r\n const longitudeRight = 360 * (((leftGrid + this.tileSize) / mapSize) - 0.5);\r\n const y1 = 0.5 - (topGrid / mapSize);\r\n const latitudeTop = 90.0 - 360.0 * Math.atan(Math.exp(-y1 * 2 * Math.PI)) / Math.PI;\r\n\r\n return { longitudeLeft, longitudeRight, latitudeTop, latitudeBottom };\r\n }\r\n\r\n /**\r\n * Get the bounding box/extents of a tile in EPSG:3857 format.\r\n * @param row Row of the tile\r\n * @param column Column of the tile\r\n * @param zoomLevel Desired zoom level of the tile\r\n * @internal\r\n */\r\n public getEPSG3857Extent(row: number, column: number, zoomLevel: number): { left: number, right: number, top: number, bottom: number } {\r\n const epsg4326Extent = this.getEPSG4326Extent(row, column, zoomLevel);\r\n\r\n const left = this.getEPSG3857X(epsg4326Extent.longitudeLeft);\r\n const right = this.getEPSG3857X(epsg4326Extent.longitudeRight);\r\n const bottom = this.getEPSG3857Y(epsg4326Extent.latitudeBottom);\r\n const top = this.getEPSG3857Y(epsg4326Extent.latitudeTop);\r\n\r\n return { left, right, bottom, top };\r\n }\r\n\r\n /** @internal */\r\n public getEPSG3857ExtentString(row: number, column: number, zoomLevel: number) {\r\n const tileExtent = this.getEPSG3857Extent(row, column, zoomLevel);\r\n return `${tileExtent.left.toFixed(2)},${tileExtent.bottom.toFixed(2)},${tileExtent.right.toFixed(2)},${tileExtent.top.toFixed(2)}`;\r\n }\r\n\r\n /** @internal */\r\n public getEPSG4326TileExtentString(row: number, column: number, zoomLevel: number, latLongAxisOrdering: boolean) {\r\n const tileExtent = this.getEPSG4326Extent(row, column, zoomLevel);\r\n return this.getEPSG4326ExtentString(tileExtent, latLongAxisOrdering);\r\n\r\n }\r\n\r\n /** @internal */\r\n public getEPSG4326ExtentString(tileExtent: WGS84Extent, latLongAxisOrdering: boolean) {\r\n\r\n if (latLongAxisOrdering) {\r\n return `${tileExtent.latitudeBottom.toFixed(8)},${tileExtent.longitudeLeft.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)},${tileExtent.longitudeRight.toFixed(8)}`;\r\n } else {\r\n return `${tileExtent.longitudeLeft.toFixed(8)},${tileExtent.latitudeBottom.toFixed(8)},${tileExtent.longitudeRight.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)}`;\r\n }\r\n }\r\n\r\n /** Append custom parameters for settings to provided URL object.\r\n * @internal\r\n */\r\n protected appendCustomParams(url: string) {\r\n if (!this._settings.savedQueryParams && !this._settings.unsavedQueryParams)\r\n return url;\r\n\r\n let tmpUrl = appendQueryParams(url, this._settings.savedQueryParams);\r\n tmpUrl = appendQueryParams(tmpUrl, this._settings.unsavedQueryParams);\r\n return tmpUrl;\r\n }\r\n}\r\n"]}
@@ -228,7 +228,7 @@ export declare class MapTileTreeReference extends TileTreeReference {
228
228
  forEachLayerTileTreeRef(func: (ref: TileTreeReference) => void): void;
229
229
  get isGlobal(): boolean;
230
230
  get baseColor(): ColorDef | undefined;
231
- get planarclipMaskPriority(): number;
231
+ get planarClipMaskPriority(): number;
232
232
  protected _createGeometryTreeReference(): GeometryTileTreeReference | undefined;
233
233
  /** Terrain tiles do not contribute to the range used by "fit view". */
234
234
  unionFitRange(_range: Range3d): void;
@@ -623,7 +623,7 @@ class MapTileTreeReference extends internal_1.TileTreeReference {
623
623
  }
624
624
  get isGlobal() { return true; }
625
625
  get baseColor() { return this._baseColor; }
626
- get planarclipMaskPriority() { return core_common_1.PlanarClipMaskPriority.BackgroundMap; }
626
+ get planarClipMaskPriority() { return core_common_1.PlanarClipMaskPriority.BackgroundMap; }
627
627
  _createGeometryTreeReference() {
628
628
  if (!this._settings.applyTerrain || this._isDrape)
629
629
  return undefined; // Don't bother generating non-terrain (flat) geometry.