@itwin/core-frontend 4.2.0-dev.19 → 4.2.0-dev.22
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/CHANGELOG.md +8 -1
- package/lib/cjs/Viewport.d.ts +10 -4
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +10 -4
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts +2 -2
- package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/TileTreeReference.js +1 -1
- package/lib/cjs/tile/TileTreeReference.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -2
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +2 -2
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapFeatureInfo.d.ts +7 -0
- package/lib/cjs/tile/map/MapFeatureInfo.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapFeatureInfo.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +2 -2
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts +9 -3
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +8 -3
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/Viewport.d.ts +10 -4
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +10 -4
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts +2 -2
- package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/TileTreeReference.js +1 -1
- package/lib/esm/tile/TileTreeReference.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +2 -2
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -2
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.d.ts +2 -2
- package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +2 -2
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapFeatureInfo.d.ts +7 -0
- package/lib/esm/tile/map/MapFeatureInfo.d.ts.map +1 -1
- package/lib/esm/tile/map/MapFeatureInfo.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +2 -2
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts +9 -3
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +8 -3
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/package.json +18 -18
|
@@ -9,7 +9,7 @@ import { RenderClipVolume } from "../render/RenderClipVolume";
|
|
|
9
9
|
import { RenderMemory } from "../render/RenderMemory";
|
|
10
10
|
import { DecorateContext, SceneContext } from "../ViewContext";
|
|
11
11
|
import { ScreenViewport } from "../Viewport";
|
|
12
|
-
import { DisclosedTileTreeSet, GeometryTileTreeReference, MapLayerFeatureInfo, TileDrawArgs, TileGeometryCollector, TileTree, TileTreeOwner } from "./internal";
|
|
12
|
+
import { DisclosedTileTreeSet, GeometryTileTreeReference, MapFeatureInfoOptions, MapLayerFeatureInfo, TileDrawArgs, TileGeometryCollector, TileTree, TileTreeOwner } from "./internal";
|
|
13
13
|
/** Describes the type of graphics produced by a [[TileTreeReference]].
|
|
14
14
|
* @public
|
|
15
15
|
* @extensions
|
|
@@ -53,7 +53,7 @@ export declare abstract class TileTreeReference {
|
|
|
53
53
|
/** Optionally return a MapLayerFeatureInfo object describing the hit.].
|
|
54
54
|
* @alpha
|
|
55
55
|
*/
|
|
56
|
-
getMapFeatureInfo(_hit: HitDetail): Promise<MapLayerFeatureInfo[] | undefined>;
|
|
56
|
+
getMapFeatureInfo(_hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<MapLayerFeatureInfo[] | undefined>;
|
|
57
57
|
/** Optionally add any decorations specific to this reference. For example, map tile trees may add a logo image and/or copyright attributions.
|
|
58
58
|
* @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.
|
|
59
59
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTreeReference.d.ts","sourceRoot":"","sources":["../../../src/tile/TileTreeReference.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,aAAa,EAAE,UAAU,EAA0B,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1J,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4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umer */ {
|
|
|
61
61
|
/** Optionally return a MapLayerFeatureInfo object describing the hit.].
|
|
62
62
|
* @alpha
|
|
63
63
|
*/
|
|
64
|
-
async getMapFeatureInfo(_hit) { return undefined; }
|
|
64
|
+
async getMapFeatureInfo(_hit, _options) { return undefined; }
|
|
65
65
|
/** Optionally add any decorations specific to this reference. For example, map tile trees may add a logo image and/or copyright attributions.
|
|
66
66
|
* @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.
|
|
67
67
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTreeReference.js","sourceRoot":"","sources":["../../../src/tile/TileTreeReference.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAqB,OAAO,EAAa,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAA6E,sBAAsB,EAAqB,MAAM,oBAAoB,CAAC;AAO1J,OAAO,EACiE,YAAY,EAAmC,kBAAkB,GACxI,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wDAAwD;IACxD,uEAAiB,CAAA;IACjB,2CAA2C;IAC3C,uDAAS,CAAA;IACT,+CAA+C;IAC/C,2DAAW,CAAA;AACb,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAgB,iBAAiB,CAAC,sCAAsC;IAI5E;mBACe;IACR,cAAc,KAAI,CAAC;IAE1B;;;OAGG;IACI,iBAAiB,CAAC,KAA2B;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;QACrC,IAAI,SAAS,KAAK,IAAI;YACpB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,qFAAqF;IAC9E,UAAU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AiK;IACjK,IAAW,QAAQ,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAEhD;;;OAGG;IACH,IAAW,sBAAsB,KAAa,OAAO,sBAAsB,CAAC,WAAW,CAAC,CAAC,CAAC;IAE1F,iGAAiG;IAC1F,YAAY,CAAC,MAAwB,EAAE,GAAmB,IAAU,CAAC;IAE5E;;;;OAIG;IACO,4BAA4B;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAOD;;OAEG;IACO,oBAAoB,CAAC,SAAgC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;YACjC,KAAK,kBAAkB,CAAC,MAAM;gBAC5B,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC;gBAC3B,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBACpC,MAAM;YACR,KAAK,kBAAkB,CAAC,OAAO;gBAC7B,SAAS,CAAC,WAAW,EAAE,CAAC;gBACxB,MAAM;SACT;IACH,CAAC;IAED;;;;;OAKG;IACI,2BAA2B;QAChC,IAAI,IAAI,CAAC,mBAAmB,EAAE;YAC5B,0KAA0K;YAC1K,OAAO,IAAiC,CAAC;SAC1C;QAED,OAAO,IAAI,CAAC,4BAA4B,EAAE,CAAC;IAC7C,CAAC;CACF","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, MapLayerFeatureInfo, TileDrawArgs, TileGeometryCollector, TileTree, TileTreeLoadStatus, TileTreeOwner,\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 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 /** Optionally return a tooltip describing the hit. */\r\n public async getToolTip(_hit: HitDetail): Promise<HTMLElement | string | undefined> { return undefined; }\r\n\r\n /** Optionally return a MapLayerFeatureInfo object describing the hit.].\r\n * @alpha\r\n */\r\n public async getMapFeatureInfo(_hit: HitDetail): 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 });\r\n }\r\n\r\n /** @internal */\r\n protected getAnimationTransformNodeId(_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 * @beta\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 * @beta\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 * @beta\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 * @beta\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"]}
|
|
1
|
+
{"version":3,"file":"TileTreeReference.js","sourceRoot":"","sources":["../../../src/tile/TileTreeReference.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAqB,OAAO,EAAa,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAA6E,sBAAsB,EAAqB,MAAM,oBAAoB,CAAC;AAO1J,OAAO,EACwF,YAAY,EAAmC,kBAAkB,GAC/J,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wDAAwD;IACxD,uEAAiB,CAAA;IACjB,2CAA2C;IAC3C,uDAAS,CAAA;IACT,+CAA+C;IAC/C,2DAAW,CAAA;AACb,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAgB,iBAAiB,CAAC,sCAAsC;IAI5E;mBACe;IACR,cAAc,KAAI,CAAC;IAE1B;;;OAGG;IACI,iBAAiB,CAAC,KAA2B;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;QACrC,IAAI,SAAS,KAAK,IAAI;YACpB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,qFAAqF;IAC9E,UAAU,CAAC,OAAqB;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,SAAS,KAAK,IAAI;YACpB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,0IAA0I;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AAY,CAAC,MAAwB,EAAE,GAAmB,IAAU,CAAC;IAE5E;;;;OAIG;IACO,4BAA4B;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAOD;;OAEG;IACO,oBAAoB,CAAC,SAAgC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;YACjC,KAAK,kBAAkB,CAAC,MAAM;gBAC5B,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC;gBAC3B,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBACpC,MAAM;YACR,KAAK,kBAAkB,CAAC,OAAO;gBAC7B,SAAS,CAAC,WAAW,EAAE,CAAC;gBACxB,MAAM;SACT;IACH,CAAC;IAED;;;;;OAKG;IACI,2BAA2B;QAChC,IAAI,IAAI,CAAC,mBAAmB,EAAE;YAC5B,0KAA0K;YAC1K,OAAO,IAAiC,CAAC;SAC1C;QAED,OAAO,IAAI,CAAC,4BAA4B,EAAE,CAAC;IAC7C,CAAC;CACF","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, TileDrawArgs, TileGeometryCollector, TileTree, TileTreeLoadStatus, TileTreeOwner,\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 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 /** Optionally return a tooltip describing the hit. */\r\n public async getToolTip(_hit: HitDetail): Promise<HTMLElement | string | undefined> { return undefined; }\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 });\r\n }\r\n\r\n /** @internal */\r\n protected getAnimationTransformNodeId(_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 * @beta\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 * @beta\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 * @beta\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 * @beta\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"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Tiles
|
|
3
3
|
*/
|
|
4
4
|
import { Cartographic, ImageMapLayerSettings, ImageSource } from "@itwin/core-common";
|
|
5
|
-
import { ArcGISImageryProvider, ImageryMapTile, ImageryMapTileTree, MapLayerFeatureInfo, QuadId } from "../../internal";
|
|
5
|
+
import { ArcGISImageryProvider, ImageryMapTile, ImageryMapTileTree, MapFeatureInfoOptions, MapLayerFeatureInfo, QuadId } from "../../internal";
|
|
6
6
|
import { Range2dProps, XYProps } from "@itwin/core-geometry";
|
|
7
7
|
import { HitDetail } from "../../../HitDetail";
|
|
8
8
|
/** @internal */
|
|
@@ -82,7 +82,7 @@ export declare class ArcGISMapLayerImageryProvider extends ArcGISImageryProvider
|
|
|
82
82
|
addLogoCards(cards: HTMLTableElement): void;
|
|
83
83
|
private getIdentifyData;
|
|
84
84
|
getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void>;
|
|
85
|
-
getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree, hit: HitDetail): Promise<void>;
|
|
85
|
+
getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void>;
|
|
86
86
|
protected getLayerString(prefix?: string): string;
|
|
87
87
|
constructUrl(row: number, column: number, zoomLevel: number): Promise<string>;
|
|
88
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGISMapLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAEjH,OAAO,EAC8D,qBAAqB,EAExF,cAAc,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ArcGISMapLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAEjH,OAAO,EAC8D,qBAAqB,EAExF,cAAc,EAAE,kBAAkB,EAAqB,qBAAqB,EAAmB,mBAAmB,EAC3D,MAAM,EAC9D,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAoB,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,gBAAgB;AAChB,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,KAAK,GAAC,SAAS,GAAC,KAAK,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,gBAAgB;AAChB,MAAM,WAAW,6BAA6B;IAC5C,uDAAuD;IACvD,QAAQ,EAAE,OAAO,CAAC;IAElB,mFAAmF;IACnF,YAAY,EAAE,mBAAmB,CAAC;IAElC,8GAA8G;IAC9G,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;MAEE;IACF,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAEnC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,YAAY,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,+BAA+B,CAAC;IAE9C;OACG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE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MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB3G,cAAc,CAAC,YAAY,EAAE,mBAAmB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+DzM,SAAS,CAAC,cAAc,CAAC,MAAM,SAAS,GAAG,MAAM;IAWpC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAU3F"}
|
|
@@ -253,14 +253,15 @@ export class ArcGISMapLayerImageryProvider extends ArcGISImageryProvider {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
// Makes an identify request to ESRI MapService , and return it as a list MapLayerFeatureInfo object
|
|
256
|
-
async getFeatureInfo(featureInfos, quadId, carto, _tree, hit) {
|
|
256
|
+
async getFeatureInfo(featureInfos, quadId, carto, _tree, hit, options) {
|
|
257
257
|
if (!this._querySupported)
|
|
258
258
|
return;
|
|
259
259
|
const tileExtent = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);
|
|
260
260
|
const toleranceWorld = (tileExtent.top - tileExtent.bottom) / this.tileSize;
|
|
261
261
|
const maxAllowableOffsetFactor = 2;
|
|
262
262
|
const maxAllowableOffset = maxAllowableOffsetFactor * toleranceWorld;
|
|
263
|
-
const
|
|
263
|
+
const tolerancePixel = options?.tolerance ?? 7;
|
|
264
|
+
const json = await this.getIdentifyData(quadId, carto, tolerancePixel, true, maxAllowableOffset);
|
|
264
265
|
if (json && Array.isArray(json.results)) {
|
|
265
266
|
const renderer = new ArcGisGraphicsRenderer(hit.iModel);
|
|
266
267
|
const layerInfo = { layerName: this._settings.name, subLayerInfos: [] };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGISMapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAoD,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,eAAe,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,aAAa,EACvG,eAAe,EACqB,iBAAiB,EACrD,6BAA6B,GAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAyB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,cAAc,GAAI,uDAAuD,CAAC;AA6DhF,gBAAgB;AAChB,MAAM,OAAO,wBAAwB;IAC5B,MAAM,CAAC,QAAQ,CAAC,OAAmB,EAAE,IAAmC,EAAE,gBAAyB;QAExG,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,CAAC,QAAQ,GAAG,GAAG,MAAM,CAAC,QAAQ,WAAW,CAAC;QAEhD,IAAI,IAAI,CAAC,CAAC,EAAE;YACV,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;SACzC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,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ACtC;YAED,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC9B;IACH,CAAC;IAES,cAAc,CAAC,MAAM,GAAG,MAAM;QACtC,MAAM,MAAM,GAAG,IAAI,KAAK,EAAU,CAAC;QACnC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC5C,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,QAAQ,CAAC;gBAC5C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAC3C,CAAC;IAED,0CAA0C;IACnC,KAAK,CAAC,YAAY,CAAC,GAAW,EAAE,MAAc,EAAE,SAAiB;QACtE,IAAI,MAAM,CAAC;QACX,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,SAAS,SAAS,IAAI,GAAG,IAAI,MAAM,GAAG,CAAC;SACtE;aAAM;YACL,MAAM,UAAU,GAAG,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,cAAc,CAAC;YACzF,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,gBAAgB,UAAU,SAAS,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,WAAW,IAAI,CAAC,cAAc,EAAE,2BAA2B,IAAI,CAAC,2BAA2B,+BAA+B,CAAC;SAC3N;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","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\nimport { Cartographic, ImageMapLayerSettings, ImageSource, IModelStatus, ServerError } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../../IModelApp\";\r\nimport {\r\n ArcGisErrorCode, ArcGisGeometryReaderJSON, ArcGisGraphicsRenderer, ArcGISImageryProvider, ArcGISTileMap,\r\n ArcGisUtilities,\r\n ImageryMapTile, ImageryMapTileTree, MapCartoRectangle, MapLayerFeature, MapLayerFeatureInfo,\r\n MapLayerImageryProviderStatus, MapSubLayerFeatureInfo, QuadId,\r\n} from \"../../internal\";\r\nimport { PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { Point2d, Range2d, Range2dProps, XYProps } from \"@itwin/core-geometry\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { HitDetail } from \"../../../HitDetail\";\r\n\r\nconst loggerCategory = \"MapLayerImageryProvider.ArcGISMapLayerImageryProvider\";\r\n\r\n/** @internal */\r\nexport interface ArcGISIdentifyImageDisplayProps {\r\n width: number;\r\n height: number;\r\n dpi: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGISIdentifyLayersProps {\r\n prefix: \"top\"|\"visible\"|\"all\";\r\n layerIds?: string[];\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGISIdentifyRequestUrlProps {\r\n /** The geometry to identify on. Point only support */\r\n geometry: XYProps;\r\n\r\n /** The type of geometry specified by the geometry parameter. Point only support */\r\n geometryType: \"esriGeometryPoint\";\r\n\r\n /** The well-known ID of the spatial reference of the input and output geometries as well as the mapExtent. */\r\n sr?: number;\r\n\r\n /** The layers to perform the identify operation on. The default value is top.\r\n * Format: [top | visible | all]:layerId1,layerId2\r\n */\r\n layers?: ArcGISIdentifyLayersProps;\r\n\r\n /** The distance in screen pixels from the specified geometry within which the identify operation should be performed.\r\n * The value for the tolerance is an integer.\r\n */\r\n tolerance: number;\r\n\r\n /** The extent or bounding box of the map currently being viewed.\r\n * Format: <xmin>, <ymin>, <xmax>, <ymax>\r\n */\r\n mapExtent: Range2dProps;\r\n\r\n /** The screen image display parameters (width, height, and DPI) of the map being currently viewed. T\r\n * Format: <width>,<height>,<dpi>\r\n */\r\n imageDisplay: ArcGISIdentifyImageDisplayProps;\r\n\r\n /** If true, the result set will include the geometries associated with each result. The default is true.\r\n */\r\n returnGeometry?: boolean;\r\n\r\n /** This option can be used to specify the maximum allowable offset to be used for generalizing geometries returned by the identify operation.\r\n * The maxAllowableOffset is in the units of the sr.\r\n */\r\n maxAllowableOffset?: number;\r\n\r\n /** The response format. The default response format is html.\r\n */\r\n f?: \"json\"|\"html\";\r\n\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGISIdentifyRequestUrl {\r\n public static fromJSON(baseUrl: URL|string, json: ArcGISIdentifyRequestUrlProps, srFractionDigits?: number): URL {\r\n\r\n const newUrl = new URL(baseUrl);\r\n newUrl.pathname = `${newUrl.pathname}/identify`;\r\n\r\n if (json.f) {\r\n newUrl.searchParams.append(\"f\", json.f);\r\n }\r\n\r\n const geomPt = Point2d.fromJSON(json.geometry);\r\n newUrl.searchParams.append(\"geometry\", `${this.toFixed(geomPt.x, srFractionDigits)},${this.toFixed(geomPt.y, srFractionDigits)}`);\r\n newUrl.searchParams.append(\"geometryType\", json.geometryType);\r\n\r\n if (json.sr) {\r\n newUrl.searchParams.append(\"sr\", `${json.geometryType}`);\r\n }\r\n\r\n if (json.layers) {\r\n newUrl.searchParams.append(\"layers\", `${json.layers.prefix}${json.layers.layerIds?.length ? `: ${json.layers.layerIds.join(\",\")}` : \"\"}`);\r\n }\r\n\r\n newUrl.searchParams.append(\"tolerance\", `${json.tolerance}`);\r\n\r\n newUrl.searchParams.append(\"mapExtent\", ArcGISIdentifyRequestUrl.getExtentString(json.mapExtent, srFractionDigits));\r\n\r\n newUrl.searchParams.append(\"imageDisplay\", `${json.imageDisplay.width},${json.imageDisplay.height},${json.imageDisplay.dpi}`);\r\n\r\n if (json.returnGeometry !== undefined) {\r\n newUrl.searchParams.append(\"returnGeometry\", json.returnGeometry ? \"true\" : \"false\");\r\n }\r\n\r\n if (json.maxAllowableOffset !== undefined) {\r\n newUrl.searchParams.append(\"maxAllowableOffset\", `${this.toFixed(json.maxAllowableOffset, srFractionDigits)}`);\r\n }\r\n\r\n return newUrl;\r\n }\r\n\r\n public static toFixed(value: number, srFractionDigits?: number) {\r\n return srFractionDigits === undefined ? value.toString() : value.toFixed(srFractionDigits);\r\n }\r\n\r\n public static getExtentString(range: Range2dProps, srFractionDigits?: number) {\r\n const extent = Range2d.fromJSON(range);\r\n const extentStringArray: string[] = [];\r\n extent.toFloat64Array().forEach((value) => extentStringArray.push(this.toFixed(value, srFractionDigits)));\r\n return extentStringArray.join(\",\");\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGISMapLayerImageryProvider extends ArcGISImageryProvider {\r\n private _maxDepthFromLod = 0;\r\n private _minDepthFromLod = 0;\r\n private _copyrightText = \"Copyright\";\r\n private _tileMapSupported = false;\r\n private _mapSupported = false;\r\n private _tilesOnly = false;\r\n private _tileMap: ArcGISTileMap|undefined;\r\n\r\n public serviceJson: any;\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, false);\r\n this._accessClient = IModelApp.mapLayerFormatRegistry.getAccessClient(settings.formatId);\r\n }\r\n\r\n protected override get _filterByCartoRange() { return false; } // Can't trust footprint ranges (USGS Hydro)\r\n\r\n public override get minimumZoomLevel() { return Math.max(super.minimumZoomLevel, this._minDepthFromLod); }\r\n public override get maximumZoomLevel() { return this._maxDepthFromLod > 0 ? this._maxDepthFromLod : super.maximumZoomLevel; }\r\n\r\n public uintToString(uintArray: any) {\r\n return Buffer.from(uintArray).toJSON();\r\n\r\n }\r\n\r\n private async fetchTile(row: number, column: number, zoomLevel: number) {\r\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\r\n if (tileUrl.length === 0)\r\n return undefined;\r\n return this.fetch(new URL(tileUrl), { method: \"GET\" });\r\n }\r\n\r\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\r\n if ((this.status === MapLayerImageryProviderStatus.RequireAuth)) {\r\n return undefined;\r\n }\r\n\r\n try {\r\n const tileResponse = await this.fetchTile(row, column, zoomLevel);\r\n if (tileResponse === undefined)\r\n return undefined;\r\n\r\n if (!this._hasSuccessfullyFetchedTile) {\r\n this._hasSuccessfullyFetchedTile = true;\r\n }\r\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\r\n } catch (error) {\r\n Logger.logError(loggerCategory, `Error occurred when loading tile(${row},${column},${zoomLevel}) : ${error}`);\r\n return undefined;\r\n }\r\n }\r\n\r\n protected override _generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) {\r\n const childIds = this.getPotentialChildIds(tile);\r\n if (tile.quadId.level < Math.max(1, this.minimumZoomLevel-1)) {\r\n resolveChildren(childIds);\r\n return;\r\n }\r\n\r\n if (this._tileMap) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._tileMap.getChildrenAvailability(childIds).then((availability) => {\r\n const availableChildIds = new Array<QuadId>();\r\n for (let i = 0; i < availability.length; i++)\r\n if (availability[i])\r\n availableChildIds.push(childIds[i]);\r\n\r\n resolveChildren (availableChildIds);\r\n });\r\n } else if (this._usesCachedTiles && this.cartoRange) {\r\n // Filter children by range\r\n const availableChildIds = new Array<QuadId>();\r\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\r\n for (let i = 0; i < childIds.length; i++) {\r\n const childExtent = this.getEPSG4326Extent(childIds[i].row, childIds[i].column, childIds[i].level);\r\n\r\n const childRange = MapCartoRectangle.fromDegrees(childExtent.longitudeLeft, childExtent.latitudeBottom, childExtent.longitudeRight, childExtent.latitudeTop);\r\n if (childRange.intersectsRange(this.cartoRange)) {\r\n availableChildIds.push(childIds[i]);\r\n }\r\n }\r\n resolveChildren (availableChildIds);\r\n } else {\r\n resolveChildren (childIds); // Resolve all children\r\n }\r\n }\r\n\r\n public override async initialize(): Promise<void> {\r\n\r\n const metadata = await this.getServiceJson();\r\n\r\n if (metadata?.content === undefined)\r\n throw new ServerError(IModelStatus.ValidationFailed, \"\");\r\n\r\n const json = metadata.content;\r\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\r\n // Check again layer status, it might have change during await.\r\n if (this.status === MapLayerImageryProviderStatus.Valid) {\r\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\r\n return; // By returning (i.e not throwing), we ensure the tileTree get created and current provider is preserved to report status.\r\n }\r\n }\r\n\r\n this.serviceJson = json;\r\n\r\n if (json.capabilities) {\r\n const capabilities = json.capabilities.split(\",\");\r\n\r\n this._querySupported = capabilities.includes(\"Query\");\r\n this._tileMapSupported = capabilities.includes(\"Tilemap\");\r\n this._mapSupported = capabilities.includes(\"Map\");\r\n this._tilesOnly = capabilities.includes(\"TilesOnly\");\r\n }\r\n\r\n if (json.copyrightText)\r\n this._copyrightText = json.copyrightText;\r\n\r\n this._usesCachedTiles = !!json.tileInfo;\r\n\r\n if (this._usesCachedTiles) {\r\n // Only EPSG:3857 is supported with pre-rendered tiles. Fall back to 'Export' queries if possible otherwise throw.\r\n if (!ArcGisUtilities.isEpsg3857Compatible(json.tileInfo)) {\r\n if (this._mapSupported && !this._tilesOnly) {\r\n this._usesCachedTiles = false;\r\n } else {\r\n throw new ServerError(IModelStatus.ValidationFailed, \"Invalid coordinate system\");\r\n }\r\n }\r\n }\r\n\r\n if (this._usesCachedTiles) {\r\n // Read max LOD\r\n if (json.maxScale !== undefined && json.maxScale !== 0 && Array.isArray(json.tileInfo.lods)) {\r\n for (; this._maxDepthFromLod < json.tileInfo.lods.length && json.tileInfo.lods[this._maxDepthFromLod].scale > json.maxScale; this._maxDepthFromLod++)\r\n ;\r\n }\r\n\r\n // Create tile map object only if we are going to request tiles from this server and it support tilemap requests.\r\n if (this._tileMapSupported) {\r\n this._tileMap = new ArcGISTileMap(this._settings.url, this._settings, json.tileInfo?.lods?.length, this._accessClient);\r\n }\r\n }\r\n\r\n // Read range using fullextent from service metadata\r\n if (json.fullExtent) {\r\n if (json.fullExtent.spatialReference.latestWkid === 3857 || json.fullExtent.spatialReference.wkid === 102100) {\r\n const range3857 = Range2d.createFrom({\r\n low: {x: json.fullExtent.xmin, y: json.fullExtent.ymin},\r\n high: {x: json.fullExtent.xmax, y: json.fullExtent.ymax} });\r\n\r\n const west = this.getEPSG4326Lon(range3857.xLow);\r\n const south = this.getEPSG4326Lat(range3857.yLow);\r\n const east = this.getEPSG4326Lon(range3857.xHigh);\r\n const north = this.getEPSG4326Lat(range3857.yHigh);\r\n this.cartoRange = MapCartoRectangle.fromDegrees(west, south, east, north);\r\n }\r\n }\r\n\r\n // Read minLOD if available\r\n if (json.minLOD !== undefined) {\r\n const minLod = parseInt(json.minLOD, 10);\r\n if (!Number.isNaN(minLod)) {\r\n this._minDepthFromLod = minLod;\r\n }\r\n } else if (json.minScale) {\r\n // Read min LOD using minScale\r\n const minScale = json.minScale;\r\n if (json.tileInfo?.lods !== undefined && Array.isArray(json.tileInfo.lods)) {\r\n for (const lod of json.tileInfo.lods) {\r\n if (lod.scale < minScale) {\r\n this._minDepthFromLod = lod.level;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n public override addLogoCards(cards: HTMLTableElement): void {\r\n if (!cards.dataset.arcGisLogoCard) {\r\n cards.dataset.arcGisLogoCard = \"true\";\r\n cards.appendChild(IModelApp.makeLogoCard({ heading: \"ArcGIS\", notice: this._copyrightText }));\r\n }\r\n }\r\n\r\n // Translates the provided Cartographic into a EPSG:3857 point, and retrieve information.\r\n // tolerance is in pixels\r\n private async getIdentifyData(quadId: QuadId, carto: Cartographic, tolerance: number, returnGeometry?: boolean, maxAllowableOffset?: number): Promise<any> {\r\n\r\n const bbox = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);\r\n const layerIds = new Array<string>();\r\n this._settings.subLayers.forEach((subLayer) => {\r\n if (this._settings.isSubLayerVisible(subLayer))\r\n layerIds.push(subLayer.idString);\r\n });\r\n const urlObj = ArcGISIdentifyRequestUrl.fromJSON(this._settings.url, {\r\n f: \"json\",\r\n geometry: {x: this.getEPSG3857X(carto.longitudeDegrees), y: this.getEPSG3857Y(carto.latitudeDegrees)},\r\n geometryType: \"esriGeometryPoint\",\r\n tolerance,\r\n mapExtent: {low: {x: bbox.left, y: bbox.bottom}, high: {x: bbox.right, y: bbox.top}},\r\n imageDisplay: {width: this.tileSize, height: this.tileSize, dpi: 96},\r\n layers: {prefix: \"visible\", layerIds},\r\n returnGeometry,\r\n maxAllowableOffset}, 3 /* 1mm accuracy*/);\r\n\r\n const response = await this.fetch(urlObj, { method: \"GET\" } );\r\n return response.json();\r\n }\r\n\r\n // Makes an identify request to ESRI MapService server, and return it as a list of formatted strings\r\n public override async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n await super.getToolTip(strings, quadId, carto, tree);\r\n\r\n if (!this._querySupported)\r\n return;\r\n\r\n const stringSet = new Set<string>();\r\n const json = await this.getIdentifyData(quadId, carto, 1);\r\n\r\n if (json && Array.isArray(json.results)) {\r\n for (const result of json.results) {\r\n if (result.attributes !== undefined && result.attributes[result.displayFieldName] !== undefined) {\r\n const thisString = `${result.displayFieldName}: ${result.attributes[result.displayFieldName]}`;\r\n if (!stringSet.has(thisString)) {\r\n strings.push(thisString);\r\n stringSet.add(thisString);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Makes an identify request to ESRI MapService , and return it as a list MapLayerFeatureInfo object\r\n public override async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree, hit: HitDetail): Promise<void> {\r\n if (!this._querySupported)\r\n return;\r\n\r\n const tileExtent = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);\r\n const toleranceWorld = (tileExtent.top - tileExtent.bottom) / this.tileSize;\r\n const maxAllowableOffsetFactor = 2;\r\n const maxAllowableOffset = maxAllowableOffsetFactor*toleranceWorld;\r\n\r\n const json = await this.getIdentifyData(quadId, carto, 5, true, maxAllowableOffset);\r\n if (json && Array.isArray(json.results)) {\r\n const renderer = new ArcGisGraphicsRenderer(hit.iModel);\r\n\r\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, subLayerInfos: [] };\r\n\r\n // The 'identify' service returns us a flat/unordered list of records..\r\n // results may represent features for the a common subLayer.\r\n // For simplicity, we group together features for a given sub-layer.\r\n const subLayers = new Map<string, MapSubLayerFeatureInfo> ();\r\n\r\n for (const result of json.results) {\r\n\r\n let subLayerInfo = subLayers.get(result.layerName);\r\n if (!subLayerInfo) {\r\n subLayerInfo = {\r\n subLayerName: result.layerName ?? \"\",\r\n displayFieldName: result.displayFieldName,\r\n features: [],\r\n };\r\n subLayers.set(result.layerName, subLayerInfo);\r\n }\r\n const feature: MapLayerFeature = {geometries: [], attributes: []};\r\n\r\n // Read all feature attributes\r\n for (const [key, value] of Object.entries(result.attributes)) {\r\n // Convert everything to string for now\r\n const strValue = String(value);\r\n feature.attributes.push({\r\n value: { valueFormat: PropertyValueFormat.Primitive, value: strValue, displayValue: strValue },\r\n property: { name: key, displayLabel: key, typename: StandardTypeNames.String },\r\n });\r\n }\r\n\r\n // Read feature geometries\r\n const geomReader = new ArcGisGeometryReaderJSON(result.geometryType, renderer);\r\n await geomReader.readGeometry(result.geometry);\r\n const graphics = renderer.moveGraphics();\r\n feature.geometries = graphics.map((graphic) => {\r\n return {graphic};\r\n });\r\n subLayerInfo.features.push(feature);\r\n\r\n }\r\n\r\n for ( const value of subLayers.values()) {\r\n layerInfo.subLayerInfos!.push(value);\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n }\r\n\r\n protected getLayerString(prefix = \"show\"): string {\r\n const layers = new Array<string>();\r\n this._settings.subLayers.forEach((subLayer) => {\r\n if (this._settings.isSubLayerVisible(subLayer))\r\n layers.push(subLayer.idString);\r\n });\r\n\r\n return `${prefix}: ${layers.join(\",\")} `;\r\n }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n let tmpUrl;\r\n if (this._usesCachedTiles) {\r\n tmpUrl = `${this._settings.url}/tile/${zoomLevel}/${row}/${column} `;\r\n } else {\r\n const bboxString = `${this.getEPSG3857ExtentString(row, column, zoomLevel)}&bboxSR=3857`;\r\n tmpUrl = `${this._settings.url}/export?bbox=${bboxString}&size=${this.tileSize},${this.tileSize}&layers=${this.getLayerString()}&format=png&transparent=${this.transparentBackgroundString}&f=image&sr=3857&imagesr=3857`;\r\n }\r\n return tmpUrl;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGISMapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAoD,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,eAAe,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,aAAa,EACvG,eAAe,EACqB,iBAAiB,EACrD,6BAA6B,GAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAyB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,cAAc,GAAI,uDAAuD,CAAC;AA6DhF,gBAAgB;AAChB,MAAM,OAAO,wBAAwB;IAC5B,MAAM,CAAC,QAAQ,CAAC,OAAmB,EAAE,IAAmC,EAAE,gBAAyB;QAExG,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,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E,MAAM,EAAE,SAAS,CAAC,cAAc,CAAC;YACzF,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,gBAAgB,UAAU,SAAS,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,WAAW,IAAI,CAAC,cAAc,EAAE,2BAA2B,IAAI,CAAC,2BAA2B,+BAA+B,CAAC;SAC3N;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","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\nimport { Cartographic, ImageMapLayerSettings, ImageSource, IModelStatus, ServerError } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../../IModelApp\";\r\nimport {\r\n ArcGisErrorCode, ArcGisGeometryReaderJSON, ArcGisGraphicsRenderer, ArcGISImageryProvider, ArcGISTileMap,\r\n ArcGisUtilities,\r\n ImageryMapTile, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeature, MapLayerFeatureInfo,\r\n MapLayerImageryProviderStatus, MapSubLayerFeatureInfo, QuadId,\r\n} from \"../../internal\";\r\nimport { PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { Point2d, Range2d, Range2dProps, XYProps } from \"@itwin/core-geometry\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { HitDetail } from \"../../../HitDetail\";\r\n\r\nconst loggerCategory = \"MapLayerImageryProvider.ArcGISMapLayerImageryProvider\";\r\n\r\n/** @internal */\r\nexport interface ArcGISIdentifyImageDisplayProps {\r\n width: number;\r\n height: number;\r\n dpi: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGISIdentifyLayersProps {\r\n prefix: \"top\"|\"visible\"|\"all\";\r\n layerIds?: string[];\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGISIdentifyRequestUrlProps {\r\n /** The geometry to identify on. Point only support */\r\n geometry: XYProps;\r\n\r\n /** The type of geometry specified by the geometry parameter. Point only support */\r\n geometryType: \"esriGeometryPoint\";\r\n\r\n /** The well-known ID of the spatial reference of the input and output geometries as well as the mapExtent. */\r\n sr?: number;\r\n\r\n /** The layers to perform the identify operation on. The default value is top.\r\n * Format: [top | visible | all]:layerId1,layerId2\r\n */\r\n layers?: ArcGISIdentifyLayersProps;\r\n\r\n /** The distance in screen pixels from the specified geometry within which the identify operation should be performed.\r\n * The value for the tolerance is an integer.\r\n */\r\n tolerance: number;\r\n\r\n /** The extent or bounding box of the map currently being viewed.\r\n * Format: <xmin>, <ymin>, <xmax>, <ymax>\r\n */\r\n mapExtent: Range2dProps;\r\n\r\n /** The screen image display parameters (width, height, and DPI) of the map being currently viewed. T\r\n * Format: <width>,<height>,<dpi>\r\n */\r\n imageDisplay: ArcGISIdentifyImageDisplayProps;\r\n\r\n /** If true, the result set will include the geometries associated with each result. The default is true.\r\n */\r\n returnGeometry?: boolean;\r\n\r\n /** This option can be used to specify the maximum allowable offset to be used for generalizing geometries returned by the identify operation.\r\n * The maxAllowableOffset is in the units of the sr.\r\n */\r\n maxAllowableOffset?: number;\r\n\r\n /** The response format. The default response format is html.\r\n */\r\n f?: \"json\"|\"html\";\r\n\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGISIdentifyRequestUrl {\r\n public static fromJSON(baseUrl: URL|string, json: ArcGISIdentifyRequestUrlProps, srFractionDigits?: number): URL {\r\n\r\n const newUrl = new URL(baseUrl);\r\n newUrl.pathname = `${newUrl.pathname}/identify`;\r\n\r\n if (json.f) {\r\n newUrl.searchParams.append(\"f\", json.f);\r\n }\r\n\r\n const geomPt = Point2d.fromJSON(json.geometry);\r\n newUrl.searchParams.append(\"geometry\", `${this.toFixed(geomPt.x, srFractionDigits)},${this.toFixed(geomPt.y, srFractionDigits)}`);\r\n newUrl.searchParams.append(\"geometryType\", json.geometryType);\r\n\r\n if (json.sr) {\r\n newUrl.searchParams.append(\"sr\", `${json.geometryType}`);\r\n }\r\n\r\n if (json.layers) {\r\n newUrl.searchParams.append(\"layers\", `${json.layers.prefix}${json.layers.layerIds?.length ? `: ${json.layers.layerIds.join(\",\")}` : \"\"}`);\r\n }\r\n\r\n newUrl.searchParams.append(\"tolerance\", `${json.tolerance}`);\r\n\r\n newUrl.searchParams.append(\"mapExtent\", ArcGISIdentifyRequestUrl.getExtentString(json.mapExtent, srFractionDigits));\r\n\r\n newUrl.searchParams.append(\"imageDisplay\", `${json.imageDisplay.width},${json.imageDisplay.height},${json.imageDisplay.dpi}`);\r\n\r\n if (json.returnGeometry !== undefined) {\r\n newUrl.searchParams.append(\"returnGeometry\", json.returnGeometry ? \"true\" : \"false\");\r\n }\r\n\r\n if (json.maxAllowableOffset !== undefined) {\r\n newUrl.searchParams.append(\"maxAllowableOffset\", `${this.toFixed(json.maxAllowableOffset, srFractionDigits)}`);\r\n }\r\n\r\n return newUrl;\r\n }\r\n\r\n public static toFixed(value: number, srFractionDigits?: number) {\r\n return srFractionDigits === undefined ? value.toString() : value.toFixed(srFractionDigits);\r\n }\r\n\r\n public static getExtentString(range: Range2dProps, srFractionDigits?: number) {\r\n const extent = Range2d.fromJSON(range);\r\n const extentStringArray: string[] = [];\r\n extent.toFloat64Array().forEach((value) => extentStringArray.push(this.toFixed(value, srFractionDigits)));\r\n return extentStringArray.join(\",\");\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGISMapLayerImageryProvider extends ArcGISImageryProvider {\r\n private _maxDepthFromLod = 0;\r\n private _minDepthFromLod = 0;\r\n private _copyrightText = \"Copyright\";\r\n private _tileMapSupported = false;\r\n private _mapSupported = false;\r\n private _tilesOnly = false;\r\n private _tileMap: ArcGISTileMap|undefined;\r\n\r\n public serviceJson: any;\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, false);\r\n this._accessClient = IModelApp.mapLayerFormatRegistry.getAccessClient(settings.formatId);\r\n }\r\n\r\n protected override get _filterByCartoRange() { return false; } // Can't trust footprint ranges (USGS Hydro)\r\n\r\n public override get minimumZoomLevel() { return Math.max(super.minimumZoomLevel, this._minDepthFromLod); }\r\n public override get maximumZoomLevel() { return this._maxDepthFromLod > 0 ? this._maxDepthFromLod : super.maximumZoomLevel; }\r\n\r\n public uintToString(uintArray: any) {\r\n return Buffer.from(uintArray).toJSON();\r\n\r\n }\r\n\r\n private async fetchTile(row: number, column: number, zoomLevel: number) {\r\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\r\n if (tileUrl.length === 0)\r\n return undefined;\r\n return this.fetch(new URL(tileUrl), { method: \"GET\" });\r\n }\r\n\r\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\r\n if ((this.status === MapLayerImageryProviderStatus.RequireAuth)) {\r\n return undefined;\r\n }\r\n\r\n try {\r\n const tileResponse = await this.fetchTile(row, column, zoomLevel);\r\n if (tileResponse === undefined)\r\n return undefined;\r\n\r\n if (!this._hasSuccessfullyFetchedTile) {\r\n this._hasSuccessfullyFetchedTile = true;\r\n }\r\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\r\n } catch (error) {\r\n Logger.logError(loggerCategory, `Error occurred when loading tile(${row},${column},${zoomLevel}) : ${error}`);\r\n return undefined;\r\n }\r\n }\r\n\r\n protected override _generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) {\r\n const childIds = this.getPotentialChildIds(tile);\r\n if (tile.quadId.level < Math.max(1, this.minimumZoomLevel-1)) {\r\n resolveChildren(childIds);\r\n return;\r\n }\r\n\r\n if (this._tileMap) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._tileMap.getChildrenAvailability(childIds).then((availability) => {\r\n const availableChildIds = new Array<QuadId>();\r\n for (let i = 0; i < availability.length; i++)\r\n if (availability[i])\r\n availableChildIds.push(childIds[i]);\r\n\r\n resolveChildren (availableChildIds);\r\n });\r\n } else if (this._usesCachedTiles && this.cartoRange) {\r\n // Filter children by range\r\n const availableChildIds = new Array<QuadId>();\r\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\r\n for (let i = 0; i < childIds.length; i++) {\r\n const childExtent = this.getEPSG4326Extent(childIds[i].row, childIds[i].column, childIds[i].level);\r\n\r\n const childRange = MapCartoRectangle.fromDegrees(childExtent.longitudeLeft, childExtent.latitudeBottom, childExtent.longitudeRight, childExtent.latitudeTop);\r\n if (childRange.intersectsRange(this.cartoRange)) {\r\n availableChildIds.push(childIds[i]);\r\n }\r\n }\r\n resolveChildren (availableChildIds);\r\n } else {\r\n resolveChildren (childIds); // Resolve all children\r\n }\r\n }\r\n\r\n public override async initialize(): Promise<void> {\r\n\r\n const metadata = await this.getServiceJson();\r\n\r\n if (metadata?.content === undefined)\r\n throw new ServerError(IModelStatus.ValidationFailed, \"\");\r\n\r\n const json = metadata.content;\r\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\r\n // Check again layer status, it might have change during await.\r\n if (this.status === MapLayerImageryProviderStatus.Valid) {\r\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\r\n return; // By returning (i.e not throwing), we ensure the tileTree get created and current provider is preserved to report status.\r\n }\r\n }\r\n\r\n this.serviceJson = json;\r\n\r\n if (json.capabilities) {\r\n const capabilities = json.capabilities.split(\",\");\r\n\r\n this._querySupported = capabilities.includes(\"Query\");\r\n this._tileMapSupported = capabilities.includes(\"Tilemap\");\r\n this._mapSupported = capabilities.includes(\"Map\");\r\n this._tilesOnly = capabilities.includes(\"TilesOnly\");\r\n }\r\n\r\n if (json.copyrightText)\r\n this._copyrightText = json.copyrightText;\r\n\r\n this._usesCachedTiles = !!json.tileInfo;\r\n\r\n if (this._usesCachedTiles) {\r\n // Only EPSG:3857 is supported with pre-rendered tiles. Fall back to 'Export' queries if possible otherwise throw.\r\n if (!ArcGisUtilities.isEpsg3857Compatible(json.tileInfo)) {\r\n if (this._mapSupported && !this._tilesOnly) {\r\n this._usesCachedTiles = false;\r\n } else {\r\n throw new ServerError(IModelStatus.ValidationFailed, \"Invalid coordinate system\");\r\n }\r\n }\r\n }\r\n\r\n if (this._usesCachedTiles) {\r\n // Read max LOD\r\n if (json.maxScale !== undefined && json.maxScale !== 0 && Array.isArray(json.tileInfo.lods)) {\r\n for (; this._maxDepthFromLod < json.tileInfo.lods.length && json.tileInfo.lods[this._maxDepthFromLod].scale > json.maxScale; this._maxDepthFromLod++)\r\n ;\r\n }\r\n\r\n // Create tile map object only if we are going to request tiles from this server and it support tilemap requests.\r\n if (this._tileMapSupported) {\r\n this._tileMap = new ArcGISTileMap(this._settings.url, this._settings, json.tileInfo?.lods?.length, this._accessClient);\r\n }\r\n }\r\n\r\n // Read range using fullextent from service metadata\r\n if (json.fullExtent) {\r\n if (json.fullExtent.spatialReference.latestWkid === 3857 || json.fullExtent.spatialReference.wkid === 102100) {\r\n const range3857 = Range2d.createFrom({\r\n low: {x: json.fullExtent.xmin, y: json.fullExtent.ymin},\r\n high: {x: json.fullExtent.xmax, y: json.fullExtent.ymax} });\r\n\r\n const west = this.getEPSG4326Lon(range3857.xLow);\r\n const south = this.getEPSG4326Lat(range3857.yLow);\r\n const east = this.getEPSG4326Lon(range3857.xHigh);\r\n const north = this.getEPSG4326Lat(range3857.yHigh);\r\n this.cartoRange = MapCartoRectangle.fromDegrees(west, south, east, north);\r\n }\r\n }\r\n\r\n // Read minLOD if available\r\n if (json.minLOD !== undefined) {\r\n const minLod = parseInt(json.minLOD, 10);\r\n if (!Number.isNaN(minLod)) {\r\n this._minDepthFromLod = minLod;\r\n }\r\n } else if (json.minScale) {\r\n // Read min LOD using minScale\r\n const minScale = json.minScale;\r\n if (json.tileInfo?.lods !== undefined && Array.isArray(json.tileInfo.lods)) {\r\n for (const lod of json.tileInfo.lods) {\r\n if (lod.scale < minScale) {\r\n this._minDepthFromLod = lod.level;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n public override addLogoCards(cards: HTMLTableElement): void {\r\n if (!cards.dataset.arcGisLogoCard) {\r\n cards.dataset.arcGisLogoCard = \"true\";\r\n cards.appendChild(IModelApp.makeLogoCard({ heading: \"ArcGIS\", notice: this._copyrightText }));\r\n }\r\n }\r\n\r\n // Translates the provided Cartographic into a EPSG:3857 point, and retrieve information.\r\n // tolerance is in pixels\r\n private async getIdentifyData(quadId: QuadId, carto: Cartographic, tolerance: number, returnGeometry?: boolean, maxAllowableOffset?: number): Promise<any> {\r\n\r\n const bbox = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);\r\n const layerIds = new Array<string>();\r\n this._settings.subLayers.forEach((subLayer) => {\r\n if (this._settings.isSubLayerVisible(subLayer))\r\n layerIds.push(subLayer.idString);\r\n });\r\n const urlObj = ArcGISIdentifyRequestUrl.fromJSON(this._settings.url, {\r\n f: \"json\",\r\n geometry: {x: this.getEPSG3857X(carto.longitudeDegrees), y: this.getEPSG3857Y(carto.latitudeDegrees)},\r\n geometryType: \"esriGeometryPoint\",\r\n tolerance,\r\n mapExtent: {low: {x: bbox.left, y: bbox.bottom}, high: {x: bbox.right, y: bbox.top}},\r\n imageDisplay: {width: this.tileSize, height: this.tileSize, dpi: 96},\r\n layers: {prefix: \"visible\", layerIds},\r\n returnGeometry,\r\n maxAllowableOffset}, 3 /* 1mm accuracy*/);\r\n\r\n const response = await this.fetch(urlObj, { method: \"GET\" } );\r\n return response.json();\r\n }\r\n\r\n // Makes an identify request to ESRI MapService server, and return it as a list of formatted strings\r\n public override async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n await super.getToolTip(strings, quadId, carto, tree);\r\n\r\n if (!this._querySupported)\r\n return;\r\n\r\n const stringSet = new Set<string>();\r\n const json = await this.getIdentifyData(quadId, carto, 1);\r\n\r\n if (json && Array.isArray(json.results)) {\r\n for (const result of json.results) {\r\n if (result.attributes !== undefined && result.attributes[result.displayFieldName] !== undefined) {\r\n const thisString = `${result.displayFieldName}: ${result.attributes[result.displayFieldName]}`;\r\n if (!stringSet.has(thisString)) {\r\n strings.push(thisString);\r\n stringSet.add(thisString);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Makes an identify request to ESRI MapService , and return it as a list MapLayerFeatureInfo object\r\n public override async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void> {\r\n if (!this._querySupported)\r\n return;\r\n\r\n const tileExtent = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);\r\n const toleranceWorld = (tileExtent.top - tileExtent.bottom) / this.tileSize;\r\n const maxAllowableOffsetFactor = 2;\r\n const maxAllowableOffset = maxAllowableOffsetFactor*toleranceWorld;\r\n\r\n const tolerancePixel = options?.tolerance ?? 7;\r\n const json = await this.getIdentifyData(quadId, carto, tolerancePixel, true, maxAllowableOffset);\r\n if (json && Array.isArray(json.results)) {\r\n const renderer = new ArcGisGraphicsRenderer(hit.iModel);\r\n\r\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, subLayerInfos: [] };\r\n\r\n // The 'identify' service returns us a flat/unordered list of records..\r\n // results may represent features for the a common subLayer.\r\n // For simplicity, we group together features for a given sub-layer.\r\n const subLayers = new Map<string, MapSubLayerFeatureInfo> ();\r\n\r\n for (const result of json.results) {\r\n\r\n let subLayerInfo = subLayers.get(result.layerName);\r\n if (!subLayerInfo) {\r\n subLayerInfo = {\r\n subLayerName: result.layerName ?? \"\",\r\n displayFieldName: result.displayFieldName,\r\n features: [],\r\n };\r\n subLayers.set(result.layerName, subLayerInfo);\r\n }\r\n const feature: MapLayerFeature = {geometries: [], attributes: []};\r\n\r\n // Read all feature attributes\r\n for (const [key, value] of Object.entries(result.attributes)) {\r\n // Convert everything to string for now\r\n const strValue = String(value);\r\n feature.attributes.push({\r\n value: { valueFormat: PropertyValueFormat.Primitive, value: strValue, displayValue: strValue },\r\n property: { name: key, displayLabel: key, typename: StandardTypeNames.String },\r\n });\r\n }\r\n\r\n // Read feature geometries\r\n const geomReader = new ArcGisGeometryReaderJSON(result.geometryType, renderer);\r\n await geomReader.readGeometry(result.geometry);\r\n const graphics = renderer.moveGraphics();\r\n feature.geometries = graphics.map((graphic) => {\r\n return {graphic};\r\n });\r\n subLayerInfo.features.push(feature);\r\n\r\n }\r\n\r\n for ( const value of subLayers.values()) {\r\n layerInfo.subLayerInfos!.push(value);\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n }\r\n\r\n protected getLayerString(prefix = \"show\"): string {\r\n const layers = new Array<string>();\r\n this._settings.subLayers.forEach((subLayer) => {\r\n if (this._settings.isSubLayerVisible(subLayer))\r\n layers.push(subLayer.idString);\r\n });\r\n\r\n return `${prefix}: ${layers.join(\",\")} `;\r\n }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n let tmpUrl;\r\n if (this._usesCachedTiles) {\r\n tmpUrl = `${this._settings.url}/tile/${zoomLevel}/${row}/${column} `;\r\n } else {\r\n const bboxString = `${this.getEPSG3857ExtentString(row, column, zoomLevel)}&bboxSR=3857`;\r\n tmpUrl = `${this._settings.url}/export?bbox=${bboxString}&size=${this.tileSize},${this.tileSize}&layers=${this.getLayerString()}&format=png&transparent=${this.transparentBackgroundString}&f=image&sr=3857&imagesr=3857`;\r\n }\r\n return tmpUrl;\r\n }\r\n}\r\n"]}
|
|
@@ -6,7 +6,7 @@ import { IModelConnection } from "../../IModelConnection";
|
|
|
6
6
|
import { RenderMemory } from "../../render/RenderMemory";
|
|
7
7
|
import { RenderSystem } from "../../render/RenderSystem";
|
|
8
8
|
import { ScreenViewport } from "../../Viewport";
|
|
9
|
-
import { MapCartoRectangle, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTileTreeScaleRangeVisibility, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree, RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTreeLoadStatus, TileTreeOwner } from "../internal";
|
|
9
|
+
import { MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTileTreeScaleRangeVisibility, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree, RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTreeLoadStatus, TileTreeOwner } from "../internal";
|
|
10
10
|
import { HitDetail } from "../../HitDetail";
|
|
11
11
|
/** @internal */
|
|
12
12
|
export interface ImageryTileContent extends TileContent {
|
|
@@ -92,7 +92,7 @@ declare class ImageryTileLoader extends RealityTileLoader {
|
|
|
92
92
|
get maximumScreenSize(): number;
|
|
93
93
|
get imageryProvider(): MapLayerImageryProvider;
|
|
94
94
|
getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void>;
|
|
95
|
-
getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree, hit: HitDetail): Promise<void>;
|
|
95
|
+
getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void>;
|
|
96
96
|
generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void): void;
|
|
97
97
|
/** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */
|
|
98
98
|
loadChildren(_tile: RealityTile): Promise<Tile[] | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageryTileTree.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/ImageryTileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,YAAY,EAAsC,gBAAgB,EAAE,aAAa,EA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AEe,cAAc;IAI9B,IAAoB,eAAe,IAAI,uBAAuB,GAAG,SAAS,CAMzE;CACF"}
|
|
@@ -225,8 +225,8 @@ class ImageryTileLoader extends RealityTileLoader {
|
|
|
225
225
|
get maximumScreenSize() { return this._imageryProvider.maximumScreenSize; }
|
|
226
226
|
get imageryProvider() { return this._imageryProvider; }
|
|
227
227
|
async getToolTip(strings, quadId, carto, tree) { await this._imageryProvider.getToolTip(strings, quadId, carto, tree); }
|
|
228
|
-
async getMapFeatureInfo(featureInfos, quadId, carto, tree, hit) {
|
|
229
|
-
await this._imageryProvider.getFeatureInfo(featureInfos, quadId, carto, tree, hit);
|
|
228
|
+
async getMapFeatureInfo(featureInfos, quadId, carto, tree, hit, options) {
|
|
229
|
+
await this._imageryProvider.getFeatureInfo(featureInfos, quadId, carto, tree, hit, options);
|
|
230
230
|
}
|
|
231
231
|
generateChildIds(tile, resolveChildren) { return this._imageryProvider.generateChildIds(tile, resolveChildren); }
|
|
232
232
|
/** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageryTileTree.js","sourceRoot":"","sources":["../../../../src/tile/map/ImageryTileTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAC;AACzI,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAuC,WAAW,EAAoB,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AAC1I,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,OAAO,EACL,iBAAiB,EAAgD,yBAAyB,EAAW,+BAA+B,EAAmB,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,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,MAAM,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC;QACxL,OAAO,IAAI,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;CACF;AAED,MAAM,mBAAmB,GAAG,IAAI,2BAA2B,EAAE,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,yBAAyB;IACzE,YAAmB,aAA+B,EAAE,UAAkB,EAAE,MAAwB;QAC9F,KAAK,CAAC,aAAa,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,IAAoB,YAAY,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IAEpD,gDAAgD;IAChD,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,mBAAmB,CAAC,CAAC;IACpG,CAAC;IAEe,cAAc;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,mBAAmB,CAAC,CAAC;IACtG,CAAC;IAED,IAAoB,eAAe;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,YAAY,kBAAkB,CAAC;YAChD,OAAO,SAAS,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;IAC5C,CAAC;CACF","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, compareBooleans, compareNumbers, compareStrings, compareStringsOrUndefined, dispose, Logger} from \"@itwin/core-bentley\";\r\nimport { Angle, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, MapLayerSettings, RenderTexture, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { RenderMemory } from \"../../render/RenderMemory\";\r\nimport { RenderSystem } from \"../../render/RenderSystem\";\r\nimport { ScreenViewport } from \"../../Viewport\";\r\nimport {\r\n MapCartoRectangle, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTileTreeScaleRangeVisibility, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree,\r\n RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTree, TileTreeLoadStatus, TileTreeOwner,\r\n TileTreeSupplier,\r\n} from \"../internal\";\r\nimport { HitDetail } from \"../../HitDetail\";\r\n\r\nconst loggerCategory = \"ImageryMapTileTree\";\r\n\r\n/** @internal */\r\nexport interface ImageryTileContent extends TileContent {\r\n imageryTexture?: RenderTexture;\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTile extends RealityTile {\r\n private _texture?: RenderTexture;\r\n private _mapTileUsageCount = 0;\r\n\r\n private readonly _outOfLodRange: boolean;\r\n\r\n constructor(params: TileParams, public imageryTree: ImageryMapTileTree, public quadId: QuadId, public rectangle: MapCartoRectangle) {\r\n super(params, imageryTree);\r\n\r\n this._outOfLodRange = this.depth < imageryTree.minDepth;\r\n }\r\n\r\n public get texture() { return this._texture; }\r\n public get tilingScheme() { return this.imageryTree.tilingScheme; }\r\n public override get isDisplayable() { return (this.depth > 1) && super.isDisplayable; }\r\n public override get isOutOfLodRange(): boolean { return this._outOfLodRange;}\r\n\r\n public override setContent(content: ImageryTileContent): void {\r\n this._texture = content.imageryTexture; // No dispose - textures may be shared by terrain tiles so let garbage collector dispose them.\r\n if (undefined === content.imageryTexture)\r\n (this.parent! as ImageryMapTile).setLeaf(); // Avoid traversing bing branches after no graphics is found.\r\n\r\n this.setIsReady();\r\n }\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], rectangleToDrape: MapCartoRectangle, drapePixelSize: number, args: TileDrawArgs): TileTreeLoadStatus {\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const isSmallerThanDrape = (this.rectangle.xLength() / this.maximumSize) < drapePixelSize;\r\n if ( (this.isLeaf ) // Include leaves so tiles get stretched past max LOD levels. (Only for base imagery layer)\r\n || isSmallerThanDrape\r\n || this._anyChildNotFound) {\r\n if (this.isOutOfLodRange ) {\r\n drapeTiles.push(this);\r\n this.setIsReady();\r\n } else if (this.isLeaf && !isSmallerThanDrape && !this._anyChildNotFound) {\r\n // These tiles are selected because we are beyond the max LOD of the tile tree,\r\n // might be used to display \"stretched\" tiles instead of having blank.\r\n highResolutionReplacementTiles.push(this);\r\n } else {\r\n drapeTiles.push(this);\r\n }\r\n return TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n let status = this.loadChildren();\r\n if (TileTreeLoadStatus.Loading === status) {\r\n args.markChildrenLoading();\r\n } else if (TileTreeLoadStatus.Loaded === status) {\r\n if (undefined !== this.children) {\r\n for (const child of this.children) {\r\n const mapChild = child as ImageryMapTile;\r\n if (mapChild.rectangle.intersectsRange(rectangleToDrape))\r\n status = mapChild.selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, rectangleToDrape, drapePixelSize, args);\r\n if (TileTreeLoadStatus.Loaded !== status)\r\n break;\r\n }\r\n }\r\n }\r\n return status;\r\n }\r\n public markMapTileUsage() {\r\n this._mapTileUsageCount++;\r\n }\r\n public releaseMapTileUsage() {\r\n assert(!this._texture || this._mapTileUsageCount > 0);\r\n if (this._mapTileUsageCount)\r\n this._mapTileUsageCount--;\r\n }\r\n\r\n /** @internal */\r\n public override setLeaf(): void {\r\n // Don't potentially re-request the children later.\r\n this.disposeChildren();\r\n this._isLeaf = true;\r\n this._childrenLoadStatus = TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n protected override _loadChildren(resolve: (children: Tile[] | undefined) => void, _reject: (error: Error) => void): void {\r\n\r\n const imageryTree = this.imageryTree;\r\n const resolveChildren = (childIds: QuadId[]) => {\r\n const children = new Array<Tile>();\r\n const childrenAreLeaves = (this.depth + 1) === imageryTree.maxDepth;\r\n // If children depth is lower than min LOD, mark them as disabled.\r\n // This is important: if those tiles are requested and the server refuse to serve them,\r\n // they will be marked as not found and their descendant will never be displayed.\r\n\r\n childIds.forEach((quadId) => {\r\n const rectangle = imageryTree.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n const range = Range3d.createXYZXYZ(rectangle.low.x, rectangle.low.x, 0, rectangle.high.x, rectangle.high.y, 0);\r\n const maximumSize = imageryTree.imageryLoader.maximumScreenSize;\r\n const tile = new ImageryMapTile({ parent: this, isLeaf: childrenAreLeaves, contentId: quadId.contentId, range, maximumSize}, imageryTree, quadId, rectangle);\r\n children.push(tile);\r\n });\r\n\r\n resolve(children);\r\n };\r\n\r\n imageryTree.imageryLoader.generateChildIds(this, resolveChildren);\r\n }\r\n\r\n protected override _collectStatistics(stats: RenderMemory.Statistics): void {\r\n super._collectStatistics(stats);\r\n if (this._texture)\r\n stats.addTexture(this._texture.bytesUsed);\r\n }\r\n\r\n public override freeMemory(): void {\r\n // ###TODO MapTiles and ImageryMapTiles share resources and don't currently interact well with TileAdmin.freeMemory(). Opt out for now.\r\n }\r\n\r\n public override disposeContents() {\r\n if (0 === this._mapTileUsageCount) {\r\n super.disposeContents();\r\n this.disposeTexture();\r\n }\r\n }\r\n\r\n private disposeTexture(): void {\r\n this._texture = dispose(this._texture);\r\n }\r\n public override dispose() {\r\n this._mapTileUsageCount = 0;\r\n super.dispose();\r\n }\r\n}\r\n\r\n/** Object that holds various state values for an ImageryTileTree\r\n * @internal */\r\nexport class ImageryTileTreeState {\r\n private _scaleRangeVis: MapTileTreeScaleRangeVisibility;\r\n\r\n constructor() {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Unknown;\r\n }\r\n\r\n /** Get the scale range visibility of the imagery tile tree.\r\n * @returns the scale range visibility of the imagery tile tree.\r\n */\r\n public getScaleRangeVisibility() {return this._scaleRangeVis;}\r\n\r\n /** Makes a deep copy of the current object.\r\n */\r\n public clone() {\r\n const clone = new ImageryTileTreeState();\r\n clone._scaleRangeVis = this._scaleRangeVis;\r\n return clone;\r\n }\r\n\r\n /** Reset the scale range visibility of imagery tile tree (i.e. unknown)\r\n */\r\n public reset() {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Unknown;\r\n }\r\n\r\n /** Sets the scale range visibility of the current imagery tile tree.\r\n * The state will be derived based on the previous visibility values:\r\n * Initial state: 'Unknown'\r\n * The first call will set the state to either: 'Visible' or 'Hidden'.\r\n * If subsequent visibility values are not consistent with the first visibility state, the state become 'Partial',\r\n * meaning the imagery tree currently contains a mixed of tiles being in range and out of range.\r\n */\r\n public setScaleRangeVisibility(visible: boolean) {\r\n if (this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Unknown) {\r\n this._scaleRangeVis = (visible ? MapTileTreeScaleRangeVisibility.Visible : MapTileTreeScaleRangeVisibility.Hidden);\r\n } else if ((visible && this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Hidden) || (!visible && this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Visible)) {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Partial;\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTileTree extends RealityTileTree {\r\n constructor(params: RealityTileTreeParams, private _imageryLoader: ImageryTileLoader) {\r\n super(params);\r\n const rootQuadId = new QuadId(_imageryLoader.imageryProvider.tilingScheme.rootLevel, 0, 0);\r\n this._rootTile = new ImageryMapTile(params.rootTile, this, rootQuadId, this.getTileRectangle(rootQuadId));\r\n }\r\n public get tilingScheme(): MapTilingScheme { return this._imageryLoader.imageryProvider.tilingScheme; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryLoader.addLogoCards(cards, vp);\r\n }\r\n\r\n public getTileRectangle(quadId: QuadId): MapCartoRectangle {\r\n return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n }\r\n public get imageryLoader(): ImageryTileLoader { return this._imageryLoader; }\r\n public override get is3d(): boolean {\r\n assert(false);\r\n return false;\r\n }\r\n public override get viewFlagOverrides(): ViewFlagOverrides {\r\n assert(false);\r\n return {};\r\n }\r\n public override get isContentUnbounded(): boolean {\r\n assert(false);\r\n return true;\r\n }\r\n protected override _selectTiles(_args: TileDrawArgs): Tile[] {\r\n assert(false);\r\n return [];\r\n }\r\n public override draw(_args: TileDrawArgs): void { assert(false); }\r\n\r\n private static _scratchDrapeRectangle = MapCartoRectangle.createZero();\r\n private static _drapeIntersectionScale = 1.0 - 1.0E-5;\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], tileToDrape: MapTile, args: TileDrawArgs): TileTreeLoadStatus {\r\n const drapeRectangle = tileToDrape.rectangle.clone(ImageryMapTileTree._scratchDrapeRectangle);\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const drapePixelSize = 1.05 * tileToDrape.rectangle.xLength() / tileToDrape.maximumSize;\r\n drapeRectangle.scaleAboutCenterInPlace(ImageryMapTileTree._drapeIntersectionScale); // Contract slightly to avoid draping adjacent or slivers.\r\n return (this.rootTile as ImageryMapTile).selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, drapeRectangle, drapePixelSize, args);\r\n }\r\n public cartoRectangleFromQuadId(quadId: QuadId): MapCartoRectangle { return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level); }\r\n}\r\n\r\nclass ImageryTileLoader extends RealityTileLoader {\r\n constructor(private _imageryProvider: MapLayerImageryProvider, private _iModel: IModelConnection) {\r\n super();\r\n }\r\n public override computeTilePriority(tile: Tile): number {\r\n return 25 * (this._imageryProvider.usesCachedTiles ? 2 : 1) - tile.depth; // Always cached first then descending by depth (high resolution/front first)\r\n } // Prioritized fast, cached tiles first.\r\n\r\n public get maxDepth(): number { return this._imageryProvider.maximumZoomLevel; }\r\n public get minDepth(): number { return this._imageryProvider.minimumZoomLevel; }\r\n public get priority(): TileLoadPriority { return TileLoadPriority.Map; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryProvider.addLogoCards(cards, vp);\r\n }\r\n\r\n public get maximumScreenSize(): number { return this._imageryProvider.maximumScreenSize; }\r\n public get imageryProvider(): MapLayerImageryProvider { return this._imageryProvider; }\r\n public async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> { await this._imageryProvider.getToolTip(strings, quadId, carto, tree); }\r\n\r\n public async getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree, hit: HitDetail): Promise<void> {\r\n await this._imageryProvider.getFeatureInfo(featureInfos, quadId, carto, tree, hit);\r\n }\r\n\r\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) { return this._imageryProvider.generateChildIds(tile, resolveChildren); }\r\n\r\n /** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */\r\n public async loadChildren(_tile: RealityTile): Promise<Tile[] | undefined> {\r\n assert(false);\r\n return undefined;\r\n }\r\n public async requestTileContent(tile: Tile, _isCanceled: () => boolean): Promise<TileRequest.Response> {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n return this._imageryProvider.loadTile(quadId.row, quadId.column, quadId.level);\r\n }\r\n\r\n public getRequestChannel(_tile: Tile) {\r\n // ###TODO use hostname from url - but so many layers to go through to get that...\r\n return IModelApp.tileAdmin.channels.getForHttp(\"itwinjs-imagery\");\r\n }\r\n\r\n public override async loadTileContent(tile: Tile, data: TileRequest.ResponseData, system: RenderSystem): Promise<ImageryTileContent> {\r\n assert(data instanceof ImageSource);\r\n assert(tile instanceof ImageryMapTile);\r\n const content: ImageryTileContent = {};\r\n const texture = await this.loadTextureImage(data, system);\r\n if (undefined === texture)\r\n return content;\r\n\r\n content.imageryTexture = texture;\r\n return content;\r\n }\r\n\r\n private async loadTextureImage(source: ImageSource, system: RenderSystem): Promise<RenderTexture | undefined> {\r\n try {\r\n return await system.createTextureFromSource({\r\n type: RenderTexture.Type.FilteredTileSection,\r\n source,\r\n });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\ninterface ImageryMapLayerTreeId {\r\n settings: ImageMapLayerSettings;\r\n}\r\n\r\n/** Supplies a TileTree that can load and draw tiles based on our imagery provider.\r\n * The TileTree is uniquely identified by its imagery type.\r\n */\r\nclass ImageryMapLayerTreeSupplier implements TileTreeSupplier {\r\n /** Return a numeric value indicating how two tree IDs are ordered relative to one another.\r\n * This allows the ID to serve as a lookup key to find the corresponding TileTree.\r\n */\r\n public compareTileTreeIds(lhs: ImageryMapLayerTreeId, rhs: ImageryMapLayerTreeId): number {\r\n let cmp = compareStrings(lhs.settings.formatId, rhs.settings.formatId);\r\n if (0 === cmp) {\r\n cmp = compareStrings(lhs.settings.url, rhs.settings.url);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.userName, rhs.settings.userName);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.password, rhs.settings.password);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.transparentBackground, rhs.settings.transparentBackground);\r\n if (0 === cmp) {\r\n cmp = compareNumbers(lhs.settings.subLayers.length, rhs.settings.subLayers.length);\r\n if (0 === cmp) {\r\n for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++) {\r\n cmp = compareStrings(lhs.settings.subLayers[i].name, rhs.settings.subLayers[i].name);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n /** The first time a tree of a particular imagery type is requested, this function creates it. */\r\n public async createTileTree(id: ImageryMapLayerTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n const imageryProvider = IModelApp.mapLayerFormatRegistry.createImageryProvider(id.settings);\r\n if (undefined === imageryProvider) {\r\n Logger.logError(loggerCategory, `Failed to create imagery provider for format '${id.settings.formatId}'`);\r\n return undefined;\r\n }\r\n\r\n try {\r\n await imageryProvider.initialize();\r\n } catch (e: any) {\r\n Logger.logError(loggerCategory, `Could not initialize imagery provider for map layer '${id.settings.name}' : ${e}`);\r\n throw e;\r\n }\r\n\r\n const modelId = iModel.transientIds.getNext();\r\n const tilingScheme = imageryProvider.tilingScheme;\r\n const rootLevel = (1 === tilingScheme.numberOfLevelZeroTilesX && 1 === tilingScheme.numberOfLevelZeroTilesY) ? 0 : -1;\r\n const rootTileId = new QuadId(rootLevel, 0, 0).contentId;\r\n const rootRange = Range3d.createXYZXYZ(-Angle.piRadians, -Angle.piOver2Radians, 0, Angle.piRadians, Angle.piOver2Radians, 0);\r\n const rootTileProps = { contentId: rootTileId, range: rootRange, maximumSize: 0 };\r\n const loader = new ImageryTileLoader(imageryProvider, iModel);\r\n const treeProps = { rootTile: rootTileProps, id: modelId, modelId, iModel, location: Transform.createIdentity(), priority: TileLoadPriority.Map, loader, gcsConverterAvailable: false };\r\n return new ImageryMapTileTree(treeProps, loader);\r\n }\r\n}\r\n\r\nconst imageryTreeSupplier = new ImageryMapLayerTreeSupplier();\r\n\r\n/** A reference to one of our tile trees. The specific TileTree drawn may change when the desired imagery type or target iModel changes.\r\n * @internal\r\n */\r\nexport class ImageryMapLayerTreeReference extends MapLayerTileTreeReference {\r\n public constructor(layerSettings: MapLayerSettings, layerIndex: number, iModel: IModelConnection) {\r\n super(layerSettings, layerIndex, iModel);\r\n }\r\n\r\n public override get castsShadows() { return false; }\r\n\r\n /** Return the owner of the TileTree to draw. */\r\n public get treeOwner(): TileTreeOwner {\r\n return this.iModel.tiles.getTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n\r\n public override resetTreeOwner() {\r\n return this.iModel.tiles.resetTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n\r\n public override get imageryProvider(): MapLayerImageryProvider | undefined {\r\n const tree = this.treeOwner.load();\r\n if (!tree || !(tree instanceof ImageryMapTileTree))\r\n return undefined;\r\n\r\n return tree.imageryLoader.imageryProvider;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ImageryTileTree.js","sourceRoot":"","sources":["../../../../src/tile/map/ImageryTileTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAC;AACzI,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAuC,WAAW,EAAoB,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AAC1I,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,OAAO,EACL,iBAAiB,EAAuE,yBAAyB,EAAW,+BAA+B,EAAmB,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAC7K,gBAAgB,EAAqC,kBAAkB,GAEhI,MAAM,aAAa,CAAC;AAGrB,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAO5C,gBAAgB;AAChB,MAAM,OAAO,cAAe,SAAQ,WAAW;IAM7C,YAAY,MAAkB,EAAS,WAA+B,EAAS,MAAc,EAAS,SAA4B;QAChI,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CA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AyB;IACzE,YAAmB,aAA+B,EAAE,UAAkB,EAAE,MAAwB;QAC9F,KAAK,CAAC,aAAa,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,IAAoB,YAAY,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IAEpD,gDAAgD;IAChD,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,mBAAmB,CAAC,CAAC;IACpG,CAAC;IAEe,cAAc;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,mBAAmB,CAAC,CAAC;IACtG,CAAC;IAED,IAAoB,eAAe;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,YAAY,kBAAkB,CAAC;YAChD,OAAO,SAAS,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;IAC5C,CAAC;CACF","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, compareBooleans, compareNumbers, compareStrings, compareStringsOrUndefined, dispose, Logger} from \"@itwin/core-bentley\";\r\nimport { Angle, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, MapLayerSettings, RenderTexture, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { RenderMemory } from \"../../render/RenderMemory\";\r\nimport { RenderSystem } from \"../../render/RenderSystem\";\r\nimport { ScreenViewport } from \"../../Viewport\";\r\nimport {\r\n MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTileTreeScaleRangeVisibility, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree,\r\n RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTree, TileTreeLoadStatus, TileTreeOwner,\r\n TileTreeSupplier,\r\n} from \"../internal\";\r\nimport { HitDetail } from \"../../HitDetail\";\r\n\r\nconst loggerCategory = \"ImageryMapTileTree\";\r\n\r\n/** @internal */\r\nexport interface ImageryTileContent extends TileContent {\r\n imageryTexture?: RenderTexture;\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTile extends RealityTile {\r\n private _texture?: RenderTexture;\r\n private _mapTileUsageCount = 0;\r\n\r\n private readonly _outOfLodRange: boolean;\r\n\r\n constructor(params: TileParams, public imageryTree: ImageryMapTileTree, public quadId: QuadId, public rectangle: MapCartoRectangle) {\r\n super(params, imageryTree);\r\n\r\n this._outOfLodRange = this.depth < imageryTree.minDepth;\r\n }\r\n\r\n public get texture() { return this._texture; }\r\n public get tilingScheme() { return this.imageryTree.tilingScheme; }\r\n public override get isDisplayable() { return (this.depth > 1) && super.isDisplayable; }\r\n public override get isOutOfLodRange(): boolean { return this._outOfLodRange;}\r\n\r\n public override setContent(content: ImageryTileContent): void {\r\n this._texture = content.imageryTexture; // No dispose - textures may be shared by terrain tiles so let garbage collector dispose them.\r\n if (undefined === content.imageryTexture)\r\n (this.parent! as ImageryMapTile).setLeaf(); // Avoid traversing bing branches after no graphics is found.\r\n\r\n this.setIsReady();\r\n }\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], rectangleToDrape: MapCartoRectangle, drapePixelSize: number, args: TileDrawArgs): TileTreeLoadStatus {\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const isSmallerThanDrape = (this.rectangle.xLength() / this.maximumSize) < drapePixelSize;\r\n if ( (this.isLeaf ) // Include leaves so tiles get stretched past max LOD levels. (Only for base imagery layer)\r\n || isSmallerThanDrape\r\n || this._anyChildNotFound) {\r\n if (this.isOutOfLodRange ) {\r\n drapeTiles.push(this);\r\n this.setIsReady();\r\n } else if (this.isLeaf && !isSmallerThanDrape && !this._anyChildNotFound) {\r\n // These tiles are selected because we are beyond the max LOD of the tile tree,\r\n // might be used to display \"stretched\" tiles instead of having blank.\r\n highResolutionReplacementTiles.push(this);\r\n } else {\r\n drapeTiles.push(this);\r\n }\r\n return TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n let status = this.loadChildren();\r\n if (TileTreeLoadStatus.Loading === status) {\r\n args.markChildrenLoading();\r\n } else if (TileTreeLoadStatus.Loaded === status) {\r\n if (undefined !== this.children) {\r\n for (const child of this.children) {\r\n const mapChild = child as ImageryMapTile;\r\n if (mapChild.rectangle.intersectsRange(rectangleToDrape))\r\n status = mapChild.selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, rectangleToDrape, drapePixelSize, args);\r\n if (TileTreeLoadStatus.Loaded !== status)\r\n break;\r\n }\r\n }\r\n }\r\n return status;\r\n }\r\n public markMapTileUsage() {\r\n this._mapTileUsageCount++;\r\n }\r\n public releaseMapTileUsage() {\r\n assert(!this._texture || this._mapTileUsageCount > 0);\r\n if (this._mapTileUsageCount)\r\n this._mapTileUsageCount--;\r\n }\r\n\r\n /** @internal */\r\n public override setLeaf(): void {\r\n // Don't potentially re-request the children later.\r\n this.disposeChildren();\r\n this._isLeaf = true;\r\n this._childrenLoadStatus = TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n protected override _loadChildren(resolve: (children: Tile[] | undefined) => void, _reject: (error: Error) => void): void {\r\n\r\n const imageryTree = this.imageryTree;\r\n const resolveChildren = (childIds: QuadId[]) => {\r\n const children = new Array<Tile>();\r\n const childrenAreLeaves = (this.depth + 1) === imageryTree.maxDepth;\r\n // If children depth is lower than min LOD, mark them as disabled.\r\n // This is important: if those tiles are requested and the server refuse to serve them,\r\n // they will be marked as not found and their descendant will never be displayed.\r\n\r\n childIds.forEach((quadId) => {\r\n const rectangle = imageryTree.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n const range = Range3d.createXYZXYZ(rectangle.low.x, rectangle.low.x, 0, rectangle.high.x, rectangle.high.y, 0);\r\n const maximumSize = imageryTree.imageryLoader.maximumScreenSize;\r\n const tile = new ImageryMapTile({ parent: this, isLeaf: childrenAreLeaves, contentId: quadId.contentId, range, maximumSize}, imageryTree, quadId, rectangle);\r\n children.push(tile);\r\n });\r\n\r\n resolve(children);\r\n };\r\n\r\n imageryTree.imageryLoader.generateChildIds(this, resolveChildren);\r\n }\r\n\r\n protected override _collectStatistics(stats: RenderMemory.Statistics): void {\r\n super._collectStatistics(stats);\r\n if (this._texture)\r\n stats.addTexture(this._texture.bytesUsed);\r\n }\r\n\r\n public override freeMemory(): void {\r\n // ###TODO MapTiles and ImageryMapTiles share resources and don't currently interact well with TileAdmin.freeMemory(). Opt out for now.\r\n }\r\n\r\n public override disposeContents() {\r\n if (0 === this._mapTileUsageCount) {\r\n super.disposeContents();\r\n this.disposeTexture();\r\n }\r\n }\r\n\r\n private disposeTexture(): void {\r\n this._texture = dispose(this._texture);\r\n }\r\n public override dispose() {\r\n this._mapTileUsageCount = 0;\r\n super.dispose();\r\n }\r\n}\r\n\r\n/** Object that holds various state values for an ImageryTileTree\r\n * @internal */\r\nexport class ImageryTileTreeState {\r\n private _scaleRangeVis: MapTileTreeScaleRangeVisibility;\r\n\r\n constructor() {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Unknown;\r\n }\r\n\r\n /** Get the scale range visibility of the imagery tile tree.\r\n * @returns the scale range visibility of the imagery tile tree.\r\n */\r\n public getScaleRangeVisibility() {return this._scaleRangeVis;}\r\n\r\n /** Makes a deep copy of the current object.\r\n */\r\n public clone() {\r\n const clone = new ImageryTileTreeState();\r\n clone._scaleRangeVis = this._scaleRangeVis;\r\n return clone;\r\n }\r\n\r\n /** Reset the scale range visibility of imagery tile tree (i.e. unknown)\r\n */\r\n public reset() {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Unknown;\r\n }\r\n\r\n /** Sets the scale range visibility of the current imagery tile tree.\r\n * The state will be derived based on the previous visibility values:\r\n * Initial state: 'Unknown'\r\n * The first call will set the state to either: 'Visible' or 'Hidden'.\r\n * If subsequent visibility values are not consistent with the first visibility state, the state become 'Partial',\r\n * meaning the imagery tree currently contains a mixed of tiles being in range and out of range.\r\n */\r\n public setScaleRangeVisibility(visible: boolean) {\r\n if (this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Unknown) {\r\n this._scaleRangeVis = (visible ? MapTileTreeScaleRangeVisibility.Visible : MapTileTreeScaleRangeVisibility.Hidden);\r\n } else if ((visible && this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Hidden) || (!visible && this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Visible)) {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Partial;\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTileTree extends RealityTileTree {\r\n constructor(params: RealityTileTreeParams, private _imageryLoader: ImageryTileLoader) {\r\n super(params);\r\n const rootQuadId = new QuadId(_imageryLoader.imageryProvider.tilingScheme.rootLevel, 0, 0);\r\n this._rootTile = new ImageryMapTile(params.rootTile, this, rootQuadId, this.getTileRectangle(rootQuadId));\r\n }\r\n public get tilingScheme(): MapTilingScheme { return this._imageryLoader.imageryProvider.tilingScheme; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryLoader.addLogoCards(cards, vp);\r\n }\r\n\r\n public getTileRectangle(quadId: QuadId): MapCartoRectangle {\r\n return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n }\r\n public get imageryLoader(): ImageryTileLoader { return this._imageryLoader; }\r\n public override get is3d(): boolean {\r\n assert(false);\r\n return false;\r\n }\r\n public override get viewFlagOverrides(): ViewFlagOverrides {\r\n assert(false);\r\n return {};\r\n }\r\n public override get isContentUnbounded(): boolean {\r\n assert(false);\r\n return true;\r\n }\r\n protected override _selectTiles(_args: TileDrawArgs): Tile[] {\r\n assert(false);\r\n return [];\r\n }\r\n public override draw(_args: TileDrawArgs): void { assert(false); }\r\n\r\n private static _scratchDrapeRectangle = MapCartoRectangle.createZero();\r\n private static _drapeIntersectionScale = 1.0 - 1.0E-5;\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], tileToDrape: MapTile, args: TileDrawArgs): TileTreeLoadStatus {\r\n const drapeRectangle = tileToDrape.rectangle.clone(ImageryMapTileTree._scratchDrapeRectangle);\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const drapePixelSize = 1.05 * tileToDrape.rectangle.xLength() / tileToDrape.maximumSize;\r\n drapeRectangle.scaleAboutCenterInPlace(ImageryMapTileTree._drapeIntersectionScale); // Contract slightly to avoid draping adjacent or slivers.\r\n return (this.rootTile as ImageryMapTile).selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, drapeRectangle, drapePixelSize, args);\r\n }\r\n public cartoRectangleFromQuadId(quadId: QuadId): MapCartoRectangle { return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level); }\r\n}\r\n\r\nclass ImageryTileLoader extends RealityTileLoader {\r\n constructor(private _imageryProvider: MapLayerImageryProvider, private _iModel: IModelConnection) {\r\n super();\r\n }\r\n public override computeTilePriority(tile: Tile): number {\r\n return 25 * (this._imageryProvider.usesCachedTiles ? 2 : 1) - tile.depth; // Always cached first then descending by depth (high resolution/front first)\r\n } // Prioritized fast, cached tiles first.\r\n\r\n public get maxDepth(): number { return this._imageryProvider.maximumZoomLevel; }\r\n public get minDepth(): number { return this._imageryProvider.minimumZoomLevel; }\r\n public get priority(): TileLoadPriority { return TileLoadPriority.Map; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryProvider.addLogoCards(cards, vp);\r\n }\r\n\r\n public get maximumScreenSize(): number { return this._imageryProvider.maximumScreenSize; }\r\n public get imageryProvider(): MapLayerImageryProvider { return this._imageryProvider; }\r\n public async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> { await this._imageryProvider.getToolTip(strings, quadId, carto, tree); }\r\n\r\n public async getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void> {\r\n await this._imageryProvider.getFeatureInfo(featureInfos, quadId, carto, tree, hit, options);\r\n }\r\n\r\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) { return this._imageryProvider.generateChildIds(tile, resolveChildren); }\r\n\r\n /** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */\r\n public async loadChildren(_tile: RealityTile): Promise<Tile[] | undefined> {\r\n assert(false);\r\n return undefined;\r\n }\r\n public async requestTileContent(tile: Tile, _isCanceled: () => boolean): Promise<TileRequest.Response> {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n return this._imageryProvider.loadTile(quadId.row, quadId.column, quadId.level);\r\n }\r\n\r\n public getRequestChannel(_tile: Tile) {\r\n // ###TODO use hostname from url - but so many layers to go through to get that...\r\n return IModelApp.tileAdmin.channels.getForHttp(\"itwinjs-imagery\");\r\n }\r\n\r\n public override async loadTileContent(tile: Tile, data: TileRequest.ResponseData, system: RenderSystem): Promise<ImageryTileContent> {\r\n assert(data instanceof ImageSource);\r\n assert(tile instanceof ImageryMapTile);\r\n const content: ImageryTileContent = {};\r\n const texture = await this.loadTextureImage(data, system);\r\n if (undefined === texture)\r\n return content;\r\n\r\n content.imageryTexture = texture;\r\n return content;\r\n }\r\n\r\n private async loadTextureImage(source: ImageSource, system: RenderSystem): Promise<RenderTexture | undefined> {\r\n try {\r\n return await system.createTextureFromSource({\r\n type: RenderTexture.Type.FilteredTileSection,\r\n source,\r\n });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\ninterface ImageryMapLayerTreeId {\r\n settings: ImageMapLayerSettings;\r\n}\r\n\r\n/** Supplies a TileTree that can load and draw tiles based on our imagery provider.\r\n * The TileTree is uniquely identified by its imagery type.\r\n */\r\nclass ImageryMapLayerTreeSupplier implements TileTreeSupplier {\r\n /** Return a numeric value indicating how two tree IDs are ordered relative to one another.\r\n * This allows the ID to serve as a lookup key to find the corresponding TileTree.\r\n */\r\n public compareTileTreeIds(lhs: ImageryMapLayerTreeId, rhs: ImageryMapLayerTreeId): number {\r\n let cmp = compareStrings(lhs.settings.formatId, rhs.settings.formatId);\r\n if (0 === cmp) {\r\n cmp = compareStrings(lhs.settings.url, rhs.settings.url);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.userName, rhs.settings.userName);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.password, rhs.settings.password);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.transparentBackground, rhs.settings.transparentBackground);\r\n if (0 === cmp) {\r\n cmp = compareNumbers(lhs.settings.subLayers.length, rhs.settings.subLayers.length);\r\n if (0 === cmp) {\r\n for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++) {\r\n cmp = compareStrings(lhs.settings.subLayers[i].name, rhs.settings.subLayers[i].name);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n /** The first time a tree of a particular imagery type is requested, this function creates it. */\r\n public async createTileTree(id: ImageryMapLayerTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n const imageryProvider = IModelApp.mapLayerFormatRegistry.createImageryProvider(id.settings);\r\n if (undefined === imageryProvider) {\r\n Logger.logError(loggerCategory, `Failed to create imagery provider for format '${id.settings.formatId}'`);\r\n return undefined;\r\n }\r\n\r\n try {\r\n await imageryProvider.initialize();\r\n } catch (e: any) {\r\n Logger.logError(loggerCategory, `Could not initialize imagery provider for map layer '${id.settings.name}' : ${e}`);\r\n throw e;\r\n }\r\n\r\n const modelId = iModel.transientIds.getNext();\r\n const tilingScheme = imageryProvider.tilingScheme;\r\n const rootLevel = (1 === tilingScheme.numberOfLevelZeroTilesX && 1 === tilingScheme.numberOfLevelZeroTilesY) ? 0 : -1;\r\n const rootTileId = new QuadId(rootLevel, 0, 0).contentId;\r\n const rootRange = Range3d.createXYZXYZ(-Angle.piRadians, -Angle.piOver2Radians, 0, Angle.piRadians, Angle.piOver2Radians, 0);\r\n const rootTileProps = { contentId: rootTileId, range: rootRange, maximumSize: 0 };\r\n const loader = new ImageryTileLoader(imageryProvider, iModel);\r\n const treeProps = { rootTile: rootTileProps, id: modelId, modelId, iModel, location: Transform.createIdentity(), priority: TileLoadPriority.Map, loader, gcsConverterAvailable: false };\r\n return new ImageryMapTileTree(treeProps, loader);\r\n }\r\n}\r\n\r\nconst imageryTreeSupplier = new ImageryMapLayerTreeSupplier();\r\n\r\n/** A reference to one of our tile trees. The specific TileTree drawn may change when the desired imagery type or target iModel changes.\r\n * @internal\r\n */\r\nexport class ImageryMapLayerTreeReference extends MapLayerTileTreeReference {\r\n public constructor(layerSettings: MapLayerSettings, layerIndex: number, iModel: IModelConnection) {\r\n super(layerSettings, layerIndex, iModel);\r\n }\r\n\r\n public override get castsShadows() { return false; }\r\n\r\n /** Return the owner of the TileTree to draw. */\r\n public get treeOwner(): TileTreeOwner {\r\n return this.iModel.tiles.getTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n\r\n public override resetTreeOwner() {\r\n return this.iModel.tiles.resetTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n\r\n public override get imageryProvider(): MapLayerImageryProvider | undefined {\r\n const tree = this.treeOwner.load();\r\n if (!tree || !(tree instanceof ImageryMapTileTree))\r\n return undefined;\r\n\r\n return tree.imageryLoader.imageryProvider;\r\n }\r\n}\r\n"]}
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
import { PropertyDescription, PropertyRecord, PropertyValue } from "@itwin/appui-abstract";
|
|
5
5
|
import { Cartographic } from "@itwin/core-common";
|
|
6
6
|
import { GraphicPrimitive } from "../../render/GraphicPrimitive";
|
|
7
|
+
/** Options supplied to a `Viewport.getMapFeatureInfo` .
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export interface MapFeatureInfoOptions {
|
|
11
|
+
/** The distance in screen pixels from the specified geometry within which the query operation should be performed. */
|
|
12
|
+
tolerance?: number;
|
|
13
|
+
}
|
|
7
14
|
/** Contains record data of a [[MapLayerFeature]] instance .
|
|
8
15
|
* @beta
|
|
9
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapFeatureInfo.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapFeatureInfo.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,mHAAmH;gBAChG,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,mBAAmB;CAGvE;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACnC,+EAA+E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