@itwin/core-frontend 5.1.0-dev.1 → 5.1.0-dev.12
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 +20 -1
- package/lib/cjs/AccuDraw.d.ts +2 -0
- package/lib/cjs/AccuDraw.d.ts.map +1 -1
- package/lib/cjs/AccuDraw.js +2 -0
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts +12 -0
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +21 -0
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/SheetViewState.d.ts +2 -0
- package/lib/cjs/SheetViewState.d.ts.map +1 -1
- package/lib/cjs/SheetViewState.js +25 -3
- package/lib/cjs/SheetViewState.js.map +1 -1
- package/lib/cjs/ViewContext.d.ts +4 -1
- package/lib/cjs/ViewContext.d.ts.map +1 -1
- package/lib/cjs/ViewContext.js +10 -5
- package/lib/cjs/ViewContext.js.map +1 -1
- package/lib/cjs/ViewManager.js +2 -2
- package/lib/cjs/ViewManager.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +1 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +2 -2
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +1 -1
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/extension/providers/ExtensionLoadScript.d.ts.map +1 -1
- package/lib/cjs/extension/providers/ExtensionLoadScript.js +24 -6
- package/lib/cjs/extension/providers/ExtensionLoadScript.js.map +1 -1
- package/lib/cjs/internal/cross-package.d.ts +1 -1
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/render/MockRender.d.ts +1 -1
- package/lib/cjs/internal/render/MockRender.d.ts.map +1 -1
- package/lib/cjs/internal/render/MockRender.js +1 -1
- package/lib/cjs/internal/render/MockRender.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Mesh.js +1 -1
- package/lib/cjs/internal/render/webgl/Mesh.js.map +1 -1
- package/lib/cjs/internal/render/webgl/RenderCommands.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/RenderCommands.js +2 -3
- package/lib/cjs/internal/render/webgl/RenderCommands.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Target.d.ts +1 -1
- package/lib/cjs/internal/render/webgl/Target.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/Target.js +2 -2
- package/lib/cjs/internal/render/webgl/Target.js.map +1 -1
- package/lib/cjs/internal/render/webgl/TargetGraphics.d.ts +3 -3
- package/lib/cjs/internal/render/webgl/TargetGraphics.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/TargetGraphics.js +10 -7
- package/lib/cjs/internal/render/webgl/TargetGraphics.js.map +1 -1
- package/lib/cjs/internal/tile/GraphicsCollector.d.ts +1 -0
- package/lib/cjs/internal/tile/GraphicsCollector.d.ts.map +1 -1
- package/lib/cjs/internal/tile/GraphicsCollector.js +1 -0
- package/lib/cjs/internal/tile/GraphicsCollector.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTile.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTile.js +2 -1
- package/lib/cjs/internal/tile/IModelTile.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.js +2 -1
- package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js +8 -2
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
- package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityTileLoader.js +2 -1
- package/lib/cjs/internal/tile/RealityTileLoader.js.map +1 -1
- package/lib/cjs/render/RenderTarget.d.ts +1 -1
- package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
- package/lib/cjs/render/RenderTarget.js.map +1 -1
- package/lib/cjs/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileTree.js +1 -1
- package/lib/cjs/tile/RealityTileTree.js.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.d.ts +1 -0
- package/lib/cjs/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.js +2 -0
- package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.d.ts +10 -0
- package/lib/cjs/tile/map/MapCartoRectangle.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.js +12 -0
- package/lib/cjs/tile/map/MapCartoRectangle.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 +8 -4
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/QuadId.d.ts +15 -0
- package/lib/cjs/tile/map/QuadId.d.ts.map +1 -1
- package/lib/cjs/tile/map/QuadId.js +12 -0
- package/lib/cjs/tile/map/QuadId.js.map +1 -1
- package/lib/cjs/tools/AccuDrawViewportUI.d.ts +7 -0
- package/lib/cjs/tools/AccuDrawViewportUI.d.ts.map +1 -1
- package/lib/cjs/tools/AccuDrawViewportUI.js +14 -0
- package/lib/cjs/tools/AccuDrawViewportUI.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts +1 -0
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +8 -2
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/AccuDraw.d.ts +2 -0
- package/lib/esm/AccuDraw.d.ts.map +1 -1
- package/lib/esm/AccuDraw.js +2 -0
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +12 -0
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +21 -0
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/SheetViewState.d.ts +2 -0
- package/lib/esm/SheetViewState.d.ts.map +1 -1
- package/lib/esm/SheetViewState.js +25 -3
- package/lib/esm/SheetViewState.js.map +1 -1
- package/lib/esm/ViewContext.d.ts +4 -1
- package/lib/esm/ViewContext.d.ts.map +1 -1
- package/lib/esm/ViewContext.js +10 -5
- package/lib/esm/ViewContext.js.map +1 -1
- package/lib/esm/ViewManager.js +2 -2
- package/lib/esm/ViewManager.js.map +1 -1
- package/lib/esm/Viewport.d.ts +1 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +2 -2
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +1 -1
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/extension/providers/ExtensionLoadScript.d.ts.map +1 -1
- package/lib/esm/extension/providers/ExtensionLoadScript.js +1 -6
- package/lib/esm/extension/providers/ExtensionLoadScript.js.map +1 -1
- package/lib/esm/internal/cross-package.d.ts +1 -1
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/render/MockRender.d.ts +1 -1
- package/lib/esm/internal/render/MockRender.d.ts.map +1 -1
- package/lib/esm/internal/render/MockRender.js +1 -1
- package/lib/esm/internal/render/MockRender.js.map +1 -1
- package/lib/esm/internal/render/webgl/Mesh.js +1 -1
- package/lib/esm/internal/render/webgl/Mesh.js.map +1 -1
- package/lib/esm/internal/render/webgl/RenderCommands.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/RenderCommands.js +2 -3
- package/lib/esm/internal/render/webgl/RenderCommands.js.map +1 -1
- package/lib/esm/internal/render/webgl/Target.d.ts +1 -1
- package/lib/esm/internal/render/webgl/Target.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/Target.js +2 -2
- package/lib/esm/internal/render/webgl/Target.js.map +1 -1
- package/lib/esm/internal/render/webgl/TargetGraphics.d.ts +3 -3
- package/lib/esm/internal/render/webgl/TargetGraphics.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/TargetGraphics.js +10 -7
- package/lib/esm/internal/render/webgl/TargetGraphics.js.map +1 -1
- package/lib/esm/internal/tile/GraphicsCollector.d.ts +1 -0
- package/lib/esm/internal/tile/GraphicsCollector.d.ts.map +1 -1
- package/lib/esm/internal/tile/GraphicsCollector.js +1 -0
- package/lib/esm/internal/tile/GraphicsCollector.js.map +1 -1
- package/lib/esm/internal/tile/IModelTile.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTile.js +2 -1
- package/lib/esm/internal/tile/IModelTile.js.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.js +2 -1
- package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js +8 -2
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
- package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityTileLoader.js +2 -1
- package/lib/esm/internal/tile/RealityTileLoader.js.map +1 -1
- package/lib/esm/render/RenderTarget.d.ts +1 -1
- package/lib/esm/render/RenderTarget.d.ts.map +1 -1
- package/lib/esm/render/RenderTarget.js.map +1 -1
- package/lib/esm/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileTree.js +2 -2
- package/lib/esm/tile/RealityTileTree.js.map +1 -1
- package/lib/esm/tile/TileDrawArgs.d.ts +1 -0
- package/lib/esm/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/esm/tile/TileDrawArgs.js +2 -0
- package/lib/esm/tile/TileDrawArgs.js.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.d.ts +10 -0
- package/lib/esm/tile/map/MapCartoRectangle.d.ts.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.js +12 -0
- package/lib/esm/tile/map/MapCartoRectangle.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 +8 -4
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/QuadId.d.ts +15 -0
- package/lib/esm/tile/map/QuadId.d.ts.map +1 -1
- package/lib/esm/tile/map/QuadId.js +12 -0
- package/lib/esm/tile/map/QuadId.js.map +1 -1
- package/lib/esm/tools/AccuDrawViewportUI.d.ts +7 -0
- package/lib/esm/tools/AccuDrawViewportUI.d.ts.map +1 -1
- package/lib/esm/tools/AccuDrawViewportUI.js +14 -0
- package/lib/esm/tools/AccuDrawViewportUI.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts +1 -0
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +8 -2
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +20 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileDrawArgs.js","sourceRoot":"","sources":["../../../src/tile/TileDrawArgs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAsI;AACtI,oDAA6G;AAE7G,2DAA8E;AAM9E,gDAA6C;A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M,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACxC,IAAI,SAAS,KAAK,QAAQ;YACxB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,uEAAuE;IAChE,oBAAoB,CAAC,WAA4B,EAAE,QAAuB;QAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,SAAS,KAAK,MAAM;YACtB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,4JAA4J;IACrJ,aAAa,CAAC,IAAU;QAC7B,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,mEAAmE;IAC5D,mBAAmB;QACxB,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC;IACrC,CAAC;IAED,oVAAoV;IAC7U,QAAQ,CAAC,IAAU;QACxB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,IAAU;QACzB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,MAAc,IAAU,CAAC;IAErD,eAAe;IACf,IAAW,4BAA4B,KAAyB,OAAO,SAAS,CAAC,CAAC,CAAC;CACpF;AA7VD,oCA6VC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { BeTimePoint } from \"@itwin/core-bentley\";\nimport { ClipVector, Geometry, Map4d, Matrix4d, Point3d, Point4d, Range1d, Range3d, Transform, Vector3d } from \"@itwin/core-geometry\";\nimport { FeatureAppearanceProvider, FrustumPlanes, HiddenLine, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\nimport { GraphicBranch, GraphicBranchOptions } from \"../render/GraphicBranch\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderGraphic } from \"../render/RenderGraphic\";\nimport { RenderPlanarClassifier } from \"../internal/render/RenderPlanarClassifier\";\nimport { SceneContext } from \"../ViewContext\";\nimport { ViewingSpace } from \"../ViewingSpace\";\nimport { CoordSystem } from \"../CoordSystem\";\nimport { Tile, TileGraphicType, TileTree } from \"./internal\";\nimport { RenderTextureDrape } from \"../internal/render/RenderTextureDrape\";\n\nconst scratchRange = new Range3d();\nconst scratchPoint = Point3d.create();\nconst scratchPoint4d = Point4d.create();\nconst scratchXRange = Range1d.createNull();\nconst scratchYRange = Range1d.createNull();\nconst scratchMatrix4d = Matrix4d.createIdentity();\n\n/** Parameters used to construct [[TileDrawArgs]].\n * @public\n * @extensions\n */\nexport interface TileDrawArgParams {\n /** Context for the scene into which the tiles are to be rendered. */\n context: SceneContext;\n /** Transform to be applied when drawing the tiles. */\n location: Transform;\n /** The tile tree from which to obtain tiles. */\n tree: TileTree;\n /** The time at which these args were created. */\n now: BeTimePoint;\n /** Overrides to apply to the view's [ViewFlags]($common) when drawing the tiles. */\n viewFlagOverrides: ViewFlagOverrides;\n /** Clip volume used to clip the tiles. */\n clipVolume?: RenderClipVolume;\n /** True if a tile and its child tiles should not be drawn simultaneously. */\n parentsAndChildrenExclusive: boolean;\n /** Symbology overrides to apply to the tiles. */\n symbologyOverrides: FeatureSymbology.Overrides | undefined;\n /** Optionally customizes the view's symbology overrides for the tiles. */\n appearanceProvider?: FeatureAppearanceProvider;\n /** Optionally overrides the view's hidden line settings. */\n hiddenLineSettings?: HiddenLine.Settings;\n /** If defined, tiles should be culled if they do not intersect this clip. */\n intersectionClip?: ClipVector;\n /** If defined, the Id of a node in the scene's [RenderSchedule.Script]($common) that applies a transform to the graphics;\n * or \"0xffffffff\" for any node that does *not* apply a transform.\n * @internal\n */\n animationTransformNodeId?: number;\n /** See [[GraphicBranch.groupNodeId]].\n * @internal\n */\n groupNodeId?: number;\n /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */\n boundingRange?: Range3d;\n /** @alpha */\n maximumScreenSpaceError?: number;\n /** @alpha */\n transformFromIModel?: Transform;\n}\n\n/**\n * Provides context used when selecting and drawing [[Tile]]s.\n * @see [[TileTree.selectTiles]]\n * @see [[TileTree.draw]]\n * @public\n * @extensions\n */\nexport class TileDrawArgs {\n /** Transform to the location in iModel coordinates at which the tiles are to be drawn. */\n public readonly location: Transform;\n /** The tile tree being drawn. */\n public readonly tree: TileTree;\n /** Optional clip volume applied to the tiles. */\n public clipVolume: RenderClipVolume | undefined;\n /** The context in which the tiles will be drawn, exposing, e.g., the [[Viewport]] and accepting [[RenderGraphic]]s to be drawn. */\n public readonly context: SceneContext;\n /** Describes the viewed volume. */\n public viewingSpace: ViewingSpace;\n /** Holds the tile graphics to be drawn. */\n public readonly graphics: GraphicBranch = new GraphicBranch();\n /** @internal */\n public readonly now: BeTimePoint;\n /** The planes of the viewing frustum, used for frustum culling. */\n protected _frustumPlanes?: FrustumPlanes;\n /** @internal */\n public planarClassifier?: RenderPlanarClassifier;\n /** @internal */\n public drape?: RenderTextureDrape;\n /** Optional clip volume applied to all tiles in the view. */\n public readonly viewClip?: ClipVector;\n /** True if a tile and its child tiles should not be drawn simultaneously. */\n public parentsAndChildrenExclusive: boolean;\n /** @internal */\n private _appearanceProvider?: FeatureAppearanceProvider;\n /** Optional overrides for the view's hidden line settings. */\n public hiddenLineSettings?: HiddenLine.Settings;\n /** Tiles that we want to draw and that are ready to draw. May not actually be selected, e.g. if sibling tiles are not yet ready. */\n public readonly readyTiles = new Set<Tile>();\n /** Tiles whose contents should be kept in memory regardless of whether or not they are selected for display.\n * @internal\n */\n public readonly touchedTiles = new Set<Tile>();\n /** For perspective views, the view-Z of the near plane. */\n private readonly _nearFrontCenter?: Point3d;\n /** Overrides applied to the view's [ViewFlags]($common) when drawing the tiles. */\n public get viewFlagOverrides(): ViewFlagOverrides { return this.graphics.viewFlagOverrides; }\n /** If defined, replaces the view's own symbology overrides when drawing the tiles. */\n public get symbologyOverrides(): FeatureSymbology.Overrides | undefined { return this.graphics.symbologyOverrides; }\n /** If defined, tiles will be culled if they do not intersect this clip. */\n public intersectionClip?: ClipVector;\n /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */\n public boundingRange?: Range3d;\n /** @internal */\n public readonly pixelSizeScaleFactor;\n /** @internal */\n public readonly animationTransformNodeId?: number;\n /** @internal */\n public readonly groupNodeId?: number;\n /** @alpha */\n public maximumScreenSpaceError;\n /** @alpha */\n public transformFromIModel?: Transform;\n\n /** Compute the size in pixels of the specified tile at the point on its bounding sphere closest to the camera. */\n public getPixelSize(tile: Tile): number {\n const sizeFromProjection = this.getPixelSizeFromProjection(tile);\n if (undefined !== sizeFromProjection)\n return sizeFromProjection;\n\n const radius = this.getTileRadius(tile); // use a sphere to test pixel size. We don't know the orientation of the image within the bounding box.\n const center = this.getTileCenter(tile);\n\n const pixelSizeAtPt = this.computePixelSizeInMetersAtClosestPoint(center, radius);\n return 0 !== pixelSizeAtPt ? this.context.adjustPixelSizeForLOD(radius / pixelSizeAtPt) : 1.0e-3;\n }\n\n /** If the tile provides corners (from an OBB) then this produces most accurate representation of the tile size */\n private getPixelSizeFromProjection(tile: Tile): number | undefined {\n const sizeProjectionCorners = tile.getSizeProjectionCorners();\n if (!sizeProjectionCorners)\n return undefined;\n\n /* For maps or global reality models we use the projected screen rectangle rather than sphere to calculate pixel size to avoid excessive tiles at horizon. */\n const tileToView = this.worldToViewMap.transform0.multiplyMatrixMatrix(Matrix4d.createTransform(this.location, scratchMatrix4d), scratchMatrix4d);\n scratchXRange.setNull();\n scratchYRange.setNull();\n\n let behindEye = false;\n for (const corner of sizeProjectionCorners) {\n const viewCorner = tileToView.multiplyPoint3d(corner, 1, scratchPoint4d);\n if (viewCorner.w < 0.0) {\n behindEye = true;\n break;\n }\n\n scratchXRange.extendX(viewCorner.x / viewCorner.w);\n scratchYRange.extendX(viewCorner.y / viewCorner.w);\n }\n if (behindEye)\n return undefined;\n\n return scratchXRange.isNull ? 1.0E-3 : this.context.adjustPixelSizeForLOD(Math.sqrt(scratchXRange.length() * scratchYRange.length()));\n }\n\n /** Compute the size in meters of one pixel at the point on the tile's bounding sphere closest to the camera. */\n public getPixelSizeInMetersAtClosestPoint(tile: Tile): number {\n const radius = this.getTileRadius(tile); // use a sphere to test pixel size. We don't know the orientation of the image within the bounding box.\n const center = this.getTileCenter(tile);\n\n const pixelSizeAtPt = this.computePixelSizeInMetersAtClosestPoint(center, radius);\n return 0 !== pixelSizeAtPt ? this.context.adjustPixelSizeForLOD(pixelSizeAtPt) : 1.0e-3;\n }\n\n /** Compute the size in meters of one pixel at the point on a sphere closest to the camera.\n * Device scaling is not applied.\n */\n public computePixelSizeInMetersAtClosestPoint(center: Point3d, radius: number): number {\n if (this.context.viewport.view.is3d() && this.context.viewport.isCameraOn && this._nearFrontCenter) {\n const toFront = Vector3d.createStartEnd(center, this._nearFrontCenter);\n const viewZ = this.context.viewport.rotation.rowZ();\n // If the sphere overlaps the near front plane just use near front point. This also handles behind eye conditions.\n if (viewZ.dotProduct(toFront) < radius) {\n center = this._nearFrontCenter;\n } else {\n // Find point on sphere closest to eye.\n const toEye = center.unitVectorTo(this.context.viewport.view.camera.eye);\n\n if (toEye) { // Only if tile is not already behind the eye.\n toEye.scaleInPlace(radius);\n center.addInPlace(toEye);\n }\n }\n }\n\n const viewPt = this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(center);\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\n return this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt).distance(this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt2));\n }\n\n /** Compute this size of a sphere on screen in pixels */\n public getRangePixelSize(range: Range3d): number {\n const transformedRange = this.location.multiplyRange(range, scratchRange);\n const center = transformedRange.localXYZToWorld(.5, .5, .5, scratchPoint)!;\n const radius = transformedRange.diagonal().magnitude();\n\n const viewPt = this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(center);\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\n const pixelSizeAtPt = this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt).distance(this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt2));\n return 0 !== pixelSizeAtPt ? radius / pixelSizeAtPt : 1.0e-3;\n }\n\n /** @internal */\n public getTileGraphics(tile: Tile) {\n return tile.produceGraphics();\n }\n\n /** The planes of the viewing frustum, used for frustum culling. */\n public get frustumPlanes(): FrustumPlanes {\n return this._frustumPlanes !== undefined ? this._frustumPlanes : this.context.frustumPlanes;\n }\n\n /** Provides conversions between [[CoordSystem.World]] and [[CoordSystem.View]]. */\n public get worldToViewMap(): Map4d {\n return this.viewingSpace.worldToViewMap;\n }\n\n private computePixelSizeScaleFactor(): number {\n // Check to see if a model display transform with non-uniform scaling is being used.\n const mat = this.context.viewport.view.modelDisplayTransformProvider?.getModelDisplayTransform(this.tree.modelId)?.transform.matrix;\n if (!mat)\n return 1;\n\n const scale = [0, 1, 2].map((x) => mat.getColumn(x).magnitude());\n if (Math.abs(scale[0] - scale[1]) <= Geometry.smallMetricDistance && Math.abs(scale[0] - scale[2]) <= Geometry.smallMetricDistance)\n return 1;\n\n // If the component with the largest scale is not the same as the component with the largest tile range use it to adjust the pixel size.\n const rangeDiag = this.tree.range.diagonal();\n let maxS = 0;\n let maxR = 0;\n if (scale[0] > scale[1])\n maxS = (scale[0] > scale[2] ? 0 : 2);\n else\n maxS = (scale[1] > scale[2] ? 1 : 2);\n\n if (rangeDiag.x > rangeDiag.y)\n maxR = (rangeDiag.x > rangeDiag.z ? 0 : 2);\n else\n maxR = (rangeDiag.y > rangeDiag.z ? 1 : 2);\n\n return maxS !== maxR ? scale[maxS] : 1;\n }\n\n /** Constructor */\n public constructor(params: TileDrawArgParams) {\n const { location, tree, context, now, viewFlagOverrides, clipVolume, parentsAndChildrenExclusive, symbologyOverrides } = params;\n this.location = location;\n this.tree = tree;\n this.context = context;\n this.now = now;\n this._appearanceProvider = params.appearanceProvider;\n this.hiddenLineSettings = params.hiddenLineSettings;\n this.animationTransformNodeId = params.animationTransformNodeId;\n this.groupNodeId = params.groupNodeId;\n this.boundingRange = params.boundingRange;\n this.maximumScreenSpaceError = params.maximumScreenSpaceError ?? 16; // 16 is Cesium's default.\n this.transformFromIModel = params.transformFromIModel;\n\n // Do not cull tiles based on clip volume if tiles outside clip are supposed to be drawn but in a different color.\n if (undefined !== clipVolume && !context.viewport.view.displayStyle.settings.clipStyle.outsideColor)\n this.clipVolume = clipVolume;\n\n this.graphics.setViewFlagOverrides(viewFlagOverrides);\n this.graphics.symbologyOverrides = symbologyOverrides;\n this.graphics.animationId = tree.modelId;\n\n this.viewingSpace = context.viewingSpace;\n this._frustumPlanes = FrustumPlanes.fromFrustum(this.viewingSpace.getFrustum());\n\n this.planarClassifier = context.getPlanarClassifierForModel(tree.modelId);\n this.drape = context.getTextureDrapeForModel(tree.modelId);\n\n // NB: If the tile tree has its own clip, do not also apply the view's clip.\n if (context.viewFlags.clipVolume && false !== viewFlagOverrides.clipVolume && undefined === clipVolume) {\n const outsideClipColor = context.viewport.displayStyle.settings.clipStyle.outsideColor;\n this.viewClip = undefined === outsideClipColor ? context.viewport.view.getViewClip() : undefined;\n }\n\n this.parentsAndChildrenExclusive = parentsAndChildrenExclusive;\n if (context.viewport.isCameraOn)\n this._nearFrontCenter = context.viewport.getFrustum(CoordSystem.World).frontCenter;\n\n this.pixelSizeScaleFactor = this.computePixelSizeScaleFactor();\n }\n\n /** A multiplier applied to a [[Tile]]'s `maximumSize` property to adjust level of detail.\n * @see [[Viewport.tileSizeModifier]].\n * @public\n */\n public get tileSizeModifier(): number { return this.context.viewport.tileSizeModifier; }\n\n /** @internal */\n public getTileCenter(tile: Tile): Point3d { return this.location.multiplyPoint3d(tile.center); }\n\n /** @internal */\n public getTileRadius(tile: Tile): number {\n let range: Range3d = tile.range.clone(scratchRange);\n if (tile.tree.is2d) {\n // 2d tiles have a fixed Z range of [-1, 1]. Sometimes (e.g., hypermodeling) we draw them within a 3d view. Prevent Z from artificially expanding the radius.\n range.low.z = range.high.z = 0;\n }\n\n range = this.location.multiplyRange(range, range);\n return 0.5 * range.low.distance(range.high);\n }\n\n /** @internal */\n public get clip(): ClipVector | undefined {\n return undefined !== this.clipVolume ? this.clipVolume.clipVector : undefined;\n }\n\n /** Add a provider to supplement or override the symbology overrides for the view.\n * @note If a provider already exists, the new provider will be chained such that it sees the base overrides\n * after they have potentially been modified by the existing provider.\n * @public\n */\n public addAppearanceProvider(provider: FeatureAppearanceProvider): void {\n this._appearanceProvider = this._appearanceProvider ? FeatureAppearanceProvider.chain(this._appearanceProvider, provider) : provider;\n }\n\n /** Optionally customizes aspects of the view's [[FeatureSymbology.Overrides]]. */\n public get appearanceProvider(): FeatureAppearanceProvider | undefined {\n return this._appearanceProvider;\n }\n\n /** @internal */\n public produceGraphics(): RenderGraphic | undefined {\n return this._produceGraphicBranch(this.graphics);\n }\n /** @internal */\n public get secondaryClassifiers(): Map<number, RenderPlanarClassifier>| undefined {\n return undefined;\n }\n\n /** @internal */\n private _produceGraphicBranch(graphics: GraphicBranch): RenderGraphic | undefined {\n if (graphics.isEmpty)\n return undefined;\n\n const opts: GraphicBranchOptions = {\n iModel: this.tree.iModel,\n transformFromIModel: this.transformFromIModel,\n clipVolume: this.clipVolume,\n classifierOrDrape: this.planarClassifier ?? this.drape,\n appearanceProvider: this.appearanceProvider,\n hline: this.hiddenLineSettings,\n secondaryClassifiers: this.secondaryClassifiers,\n };\n\n let graphic = this.context.createGraphicBranch(graphics, this.location, opts);\n if (undefined !== this.animationTransformNodeId)\n graphic = this.context.renderSystem.createAnimationTransformNode(graphic, this.animationTransformNodeId);\n\n if (undefined !== this.groupNodeId) {\n const branch = new GraphicBranch();\n branch.add(graphic);\n branch.groupNodeId = this.groupNodeId;\n graphic = this.context.createGraphicBranch(branch, Transform.identity);\n }\n\n return graphic;\n }\n\n /** Output graphics for all accumulated tiles. */\n public drawGraphics(): void {\n const graphics = this.produceGraphics();\n if (undefined !== graphics)\n this.context.outputGraphic(graphics);\n }\n\n /** Output graphics of the specified type for all accumulated tiles. */\n public drawGraphicsWithType(graphicType: TileGraphicType, graphics: GraphicBranch): void {\n const branch = this._produceGraphicBranch(graphics);\n if (undefined !== branch)\n this.context.withGraphicType(graphicType, () => this.context.outputGraphic(branch));\n }\n\n /** Indicate that graphics for the specified tile are desired but not yet available. Subsequently a request will be enqueued to load the tile's graphics. */\n public insertMissing(tile: Tile): void {\n this.context.insertMissingTile(tile);\n }\n\n /** Indicate that some requested child tiles are not yet loaded. */\n public markChildrenLoading(): void {\n this.context.markChildrenLoading();\n }\n\n /** Indicate that the specified tile is being used for some purpose by the [[SceneContext]]'s [[Viewport]]. Typically \"used\" means \"displayed\", but the exact meaning is up to the [[TileTree]] - for example, \"used\" might also mean that the tile's children are being used. A tile that is \"in use\" by any [[Viewport]] will not be discarded. */\n public markUsed(tile: Tile): void {\n tile.usageMarker.mark(this.context.viewport, this.now);\n }\n\n /** Indicate that the specified tile should be displayed and that its graphics are ready to be displayed. The number of \"ready\" tiles is used in conjunction with the number of \"missing\" tiles to convey to the user how complete the current view is.\n * @see [[insertMissing]]\n */\n public markReady(tile: Tile): void {\n this.readyTiles.add(tile);\n }\n\n /** Invoked by [[TileTree.selectTiles]]. This exists chiefly for [[SolarShadowMap]].\n * @internal\n */\n public processSelectedTiles(_tiles: Tile[]): void { }\n\n /* @internal */\n public get maxRealityTreeSelectionCount(): number | undefined { return undefined; }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TileDrawArgs.js","sourceRoot":"","sources":["../../../src/tile/TileDrawArgs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAsI;AACtI,oDAA6G;AAE7G,2DAA8E;AAM9E,gDAA6C;AAI7C,MAAM,YAAY,GAAG,IAAI,uBAAO,EAAE,CAAC;AACnC,MAAM,YAAY,GAAG,uBAAO,CAAC,MAAM,EAAE,CAAC;AACtC,MAAM,cAAc,GAAG,uBAAO,CAAC,MAAM,EAAE,CAAC;AACxC,MAAM,aAAa,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAC3C,MAAM,aAAa,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAC3C,MAAM,eAAe,GAAG,wBAAQ,CAAC,cAAc,EAAE,CAAC;AA8ClD;;;;;;GAMG;AACH,MAAa,YAAY;IACvB,0FAA0F;IAC1E,QAAQ,CAAY;IACpC,iCAAiC;IACjB,IAAI,CAAW;IAC/B,iDAAiD;IAC1C,UAAU,CAA+B;IAChD,mIAAmI;IACnH,OAAO,CAAe;IACtC,mCAAmC;IAC5B,YAAY,CAAe;IAClC,2CAA2C;IAC3B,QAAQ,GAAkB,IAAI,6BAAa,EAAE,CAAC;IAC9D,gBAAgB;IACA,GAAG,CAAc;IACjC,mEAAmE;IACzD,cAAc,CAAiB;IACzC,gBAAgB;IACT,gBAAgB,CAA0B;IACjD,gBAAgB;IACT,KAAK,CAAsB;IAClC,6DAA6D;IAC7C,QAAQ,CAAc;IACtC,6EAA6E;IACtE,2BAA2B,CAAU;IAC5C,gBAAgB;IACR,mBAAmB,CAA6B;IACxD,8DAA8D;IACvD,kBAAkB,CAAuB;IAChD,oIAAoI;IACpH,UAAU,GAAG,IAAI,GAAG,EAAQ,CAAC;IAC7C;;OAEG;IACa,YAAY,GAAG,IAAI,GAAG,EAAQ,CAAC;IAC/C,2DAA2D;IAC1C,gBAAgB,CA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AS,CAAC,CAAC,CAAC;IAEnF,eAAe;IACf,IAAW,+BAA+B,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;CACvE;AAhWD,oCAgWC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { BeTimePoint } from \"@itwin/core-bentley\";\nimport { ClipVector, Geometry, Map4d, Matrix4d, Point3d, Point4d, Range1d, Range3d, Transform, Vector3d } from \"@itwin/core-geometry\";\nimport { FeatureAppearanceProvider, FrustumPlanes, HiddenLine, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\nimport { GraphicBranch, GraphicBranchOptions } from \"../render/GraphicBranch\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderGraphic } from \"../render/RenderGraphic\";\nimport { RenderPlanarClassifier } from \"../internal/render/RenderPlanarClassifier\";\nimport { SceneContext } from \"../ViewContext\";\nimport { ViewingSpace } from \"../ViewingSpace\";\nimport { CoordSystem } from \"../CoordSystem\";\nimport { Tile, TileGraphicType, TileTree } from \"./internal\";\nimport { RenderTextureDrape } from \"../internal/render/RenderTextureDrape\";\n\nconst scratchRange = new Range3d();\nconst scratchPoint = Point3d.create();\nconst scratchPoint4d = Point4d.create();\nconst scratchXRange = Range1d.createNull();\nconst scratchYRange = Range1d.createNull();\nconst scratchMatrix4d = Matrix4d.createIdentity();\n\n/** Parameters used to construct [[TileDrawArgs]].\n * @public\n * @extensions\n */\nexport interface TileDrawArgParams {\n /** Context for the scene into which the tiles are to be rendered. */\n context: SceneContext;\n /** Transform to be applied when drawing the tiles. */\n location: Transform;\n /** The tile tree from which to obtain tiles. */\n tree: TileTree;\n /** The time at which these args were created. */\n now: BeTimePoint;\n /** Overrides to apply to the view's [ViewFlags]($common) when drawing the tiles. */\n viewFlagOverrides: ViewFlagOverrides;\n /** Clip volume used to clip the tiles. */\n clipVolume?: RenderClipVolume;\n /** True if a tile and its child tiles should not be drawn simultaneously. */\n parentsAndChildrenExclusive: boolean;\n /** Symbology overrides to apply to the tiles. */\n symbologyOverrides: FeatureSymbology.Overrides | undefined;\n /** Optionally customizes the view's symbology overrides for the tiles. */\n appearanceProvider?: FeatureAppearanceProvider;\n /** Optionally overrides the view's hidden line settings. */\n hiddenLineSettings?: HiddenLine.Settings;\n /** If defined, tiles should be culled if they do not intersect this clip. */\n intersectionClip?: ClipVector;\n /** If defined, the Id of a node in the scene's [RenderSchedule.Script]($common) that applies a transform to the graphics;\n * or \"0xffffffff\" for any node that does *not* apply a transform.\n * @internal\n */\n animationTransformNodeId?: number;\n /** See [[GraphicBranch.groupNodeId]].\n * @internal\n */\n groupNodeId?: number;\n /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */\n boundingRange?: Range3d;\n /** @alpha */\n maximumScreenSpaceError?: number;\n /** @alpha */\n transformFromIModel?: Transform;\n}\n\n/**\n * Provides context used when selecting and drawing [[Tile]]s.\n * @see [[TileTree.selectTiles]]\n * @see [[TileTree.draw]]\n * @public\n * @extensions\n */\nexport class TileDrawArgs {\n /** Transform to the location in iModel coordinates at which the tiles are to be drawn. */\n public readonly location: Transform;\n /** The tile tree being drawn. */\n public readonly tree: TileTree;\n /** Optional clip volume applied to the tiles. */\n public clipVolume: RenderClipVolume | undefined;\n /** The context in which the tiles will be drawn, exposing, e.g., the [[Viewport]] and accepting [[RenderGraphic]]s to be drawn. */\n public readonly context: SceneContext;\n /** Describes the viewed volume. */\n public viewingSpace: ViewingSpace;\n /** Holds the tile graphics to be drawn. */\n public readonly graphics: GraphicBranch = new GraphicBranch();\n /** @internal */\n public readonly now: BeTimePoint;\n /** The planes of the viewing frustum, used for frustum culling. */\n protected _frustumPlanes?: FrustumPlanes;\n /** @internal */\n public planarClassifier?: RenderPlanarClassifier;\n /** @internal */\n public drape?: RenderTextureDrape;\n /** Optional clip volume applied to all tiles in the view. */\n public readonly viewClip?: ClipVector;\n /** True if a tile and its child tiles should not be drawn simultaneously. */\n public parentsAndChildrenExclusive: boolean;\n /** @internal */\n private _appearanceProvider?: FeatureAppearanceProvider;\n /** Optional overrides for the view's hidden line settings. */\n public hiddenLineSettings?: HiddenLine.Settings;\n /** Tiles that we want to draw and that are ready to draw. May not actually be selected, e.g. if sibling tiles are not yet ready. */\n public readonly readyTiles = new Set<Tile>();\n /** Tiles whose contents should be kept in memory regardless of whether or not they are selected for display.\n * @internal\n */\n public readonly touchedTiles = new Set<Tile>();\n /** For perspective views, the view-Z of the near plane. */\n private readonly _nearFrontCenter?: Point3d;\n /** Overrides applied to the view's [ViewFlags]($common) when drawing the tiles. */\n public get viewFlagOverrides(): ViewFlagOverrides { return this.graphics.viewFlagOverrides; }\n /** If defined, replaces the view's own symbology overrides when drawing the tiles. */\n public get symbologyOverrides(): FeatureSymbology.Overrides | undefined { return this.graphics.symbologyOverrides; }\n /** If defined, tiles will be culled if they do not intersect this clip. */\n public intersectionClip?: ClipVector;\n /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */\n public boundingRange?: Range3d;\n /** @internal */\n public readonly pixelSizeScaleFactor;\n /** @internal */\n public readonly animationTransformNodeId?: number;\n /** @internal */\n public readonly groupNodeId?: number;\n /** @alpha */\n public maximumScreenSpaceError;\n /** @alpha */\n public transformFromIModel?: Transform;\n\n /** Compute the size in pixels of the specified tile at the point on its bounding sphere closest to the camera. */\n public getPixelSize(tile: Tile): number {\n const sizeFromProjection = this.getPixelSizeFromProjection(tile);\n if (undefined !== sizeFromProjection)\n return sizeFromProjection;\n\n const radius = this.getTileRadius(tile); // use a sphere to test pixel size. We don't know the orientation of the image within the bounding box.\n const center = this.getTileCenter(tile);\n\n const pixelSizeAtPt = this.computePixelSizeInMetersAtClosestPoint(center, radius);\n return 0 !== pixelSizeAtPt ? this.context.adjustPixelSizeForLOD(radius / pixelSizeAtPt) : 1.0e-3;\n }\n\n /** If the tile provides corners (from an OBB) then this produces most accurate representation of the tile size */\n private getPixelSizeFromProjection(tile: Tile): number | undefined {\n const sizeProjectionCorners = tile.getSizeProjectionCorners();\n if (!sizeProjectionCorners)\n return undefined;\n\n /* For maps or global reality models we use the projected screen rectangle rather than sphere to calculate pixel size to avoid excessive tiles at horizon. */\n const tileToView = this.worldToViewMap.transform0.multiplyMatrixMatrix(Matrix4d.createTransform(this.location, scratchMatrix4d), scratchMatrix4d);\n scratchXRange.setNull();\n scratchYRange.setNull();\n\n let behindEye = false;\n for (const corner of sizeProjectionCorners) {\n const viewCorner = tileToView.multiplyPoint3d(corner, 1, scratchPoint4d);\n if (viewCorner.w < 0.0) {\n behindEye = true;\n break;\n }\n\n scratchXRange.extendX(viewCorner.x / viewCorner.w);\n scratchYRange.extendX(viewCorner.y / viewCorner.w);\n }\n if (behindEye)\n return undefined;\n\n return scratchXRange.isNull ? 1.0E-3 : this.context.adjustPixelSizeForLOD(Math.sqrt(scratchXRange.length() * scratchYRange.length()));\n }\n\n /** Compute the size in meters of one pixel at the point on the tile's bounding sphere closest to the camera. */\n public getPixelSizeInMetersAtClosestPoint(tile: Tile): number {\n const radius = this.getTileRadius(tile); // use a sphere to test pixel size. We don't know the orientation of the image within the bounding box.\n const center = this.getTileCenter(tile);\n\n const pixelSizeAtPt = this.computePixelSizeInMetersAtClosestPoint(center, radius);\n return 0 !== pixelSizeAtPt ? this.context.adjustPixelSizeForLOD(pixelSizeAtPt) : 1.0e-3;\n }\n\n /** Compute the size in meters of one pixel at the point on a sphere closest to the camera.\n * Device scaling is not applied.\n */\n public computePixelSizeInMetersAtClosestPoint(center: Point3d, radius: number): number {\n if (this.context.viewport.view.is3d() && this.context.viewport.isCameraOn && this._nearFrontCenter) {\n const toFront = Vector3d.createStartEnd(center, this._nearFrontCenter);\n const viewZ = this.context.viewport.rotation.rowZ();\n // If the sphere overlaps the near front plane just use near front point. This also handles behind eye conditions.\n if (viewZ.dotProduct(toFront) < radius) {\n center = this._nearFrontCenter;\n } else {\n // Find point on sphere closest to eye.\n const toEye = center.unitVectorTo(this.context.viewport.view.camera.eye);\n\n if (toEye) { // Only if tile is not already behind the eye.\n toEye.scaleInPlace(radius);\n center.addInPlace(toEye);\n }\n }\n }\n\n const viewPt = this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(center);\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\n return this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt).distance(this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt2));\n }\n\n /** Compute this size of a sphere on screen in pixels */\n public getRangePixelSize(range: Range3d): number {\n const transformedRange = this.location.multiplyRange(range, scratchRange);\n const center = transformedRange.localXYZToWorld(.5, .5, .5, scratchPoint)!;\n const radius = transformedRange.diagonal().magnitude();\n\n const viewPt = this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(center);\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\n const pixelSizeAtPt = this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt).distance(this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt2));\n return 0 !== pixelSizeAtPt ? radius / pixelSizeAtPt : 1.0e-3;\n }\n\n /** @internal */\n public getTileGraphics(tile: Tile) {\n return tile.produceGraphics();\n }\n\n /** The planes of the viewing frustum, used for frustum culling. */\n public get frustumPlanes(): FrustumPlanes {\n return this._frustumPlanes !== undefined ? this._frustumPlanes : this.context.frustumPlanes;\n }\n\n /** Provides conversions between [[CoordSystem.World]] and [[CoordSystem.View]]. */\n public get worldToViewMap(): Map4d {\n return this.viewingSpace.worldToViewMap;\n }\n\n private computePixelSizeScaleFactor(): number {\n // Check to see if a model display transform with non-uniform scaling is being used.\n const mat = this.context.viewport.view.modelDisplayTransformProvider?.getModelDisplayTransform(this.tree.modelId)?.transform.matrix;\n if (!mat)\n return 1;\n\n const scale = [0, 1, 2].map((x) => mat.getColumn(x).magnitude());\n if (Math.abs(scale[0] - scale[1]) <= Geometry.smallMetricDistance && Math.abs(scale[0] - scale[2]) <= Geometry.smallMetricDistance)\n return 1;\n\n // If the component with the largest scale is not the same as the component with the largest tile range use it to adjust the pixel size.\n const rangeDiag = this.tree.range.diagonal();\n let maxS = 0;\n let maxR = 0;\n if (scale[0] > scale[1])\n maxS = (scale[0] > scale[2] ? 0 : 2);\n else\n maxS = (scale[1] > scale[2] ? 1 : 2);\n\n if (rangeDiag.x > rangeDiag.y)\n maxR = (rangeDiag.x > rangeDiag.z ? 0 : 2);\n else\n maxR = (rangeDiag.y > rangeDiag.z ? 1 : 2);\n\n return maxS !== maxR ? scale[maxS] : 1;\n }\n\n /** Constructor */\n public constructor(params: TileDrawArgParams) {\n const { location, tree, context, now, viewFlagOverrides, clipVolume, parentsAndChildrenExclusive, symbologyOverrides } = params;\n this.location = location;\n this.tree = tree;\n this.context = context;\n this.now = now;\n this._appearanceProvider = params.appearanceProvider;\n this.hiddenLineSettings = params.hiddenLineSettings;\n this.animationTransformNodeId = params.animationTransformNodeId;\n this.groupNodeId = params.groupNodeId;\n this.boundingRange = params.boundingRange;\n this.maximumScreenSpaceError = params.maximumScreenSpaceError ?? 16; // 16 is Cesium's default.\n this.transformFromIModel = params.transformFromIModel;\n\n // Do not cull tiles based on clip volume if tiles outside clip are supposed to be drawn but in a different color.\n if (undefined !== clipVolume && !context.viewport.view.displayStyle.settings.clipStyle.outsideColor)\n this.clipVolume = clipVolume;\n\n this.graphics.setViewFlagOverrides(viewFlagOverrides);\n this.graphics.symbologyOverrides = symbologyOverrides;\n this.graphics.animationId = tree.modelId;\n\n this.viewingSpace = context.viewingSpace;\n this._frustumPlanes = FrustumPlanes.fromFrustum(this.viewingSpace.getFrustum());\n\n this.planarClassifier = context.getPlanarClassifierForModel(tree.modelId);\n this.drape = context.getTextureDrapeForModel(tree.modelId);\n\n // NB: If the tile tree has its own clip, do not also apply the view's clip.\n if (context.viewFlags.clipVolume && false !== viewFlagOverrides.clipVolume && undefined === clipVolume) {\n const outsideClipColor = context.viewport.displayStyle.settings.clipStyle.outsideColor;\n this.viewClip = undefined === outsideClipColor ? context.viewport.view.getViewClip() : undefined;\n }\n\n this.parentsAndChildrenExclusive = parentsAndChildrenExclusive;\n if (context.viewport.isCameraOn)\n this._nearFrontCenter = context.viewport.getFrustum(CoordSystem.World).frontCenter;\n\n this.pixelSizeScaleFactor = this.computePixelSizeScaleFactor();\n }\n\n /** A multiplier applied to a [[Tile]]'s `maximumSize` property to adjust level of detail.\n * @see [[Viewport.tileSizeModifier]].\n * @public\n */\n public get tileSizeModifier(): number { return this.context.viewport.tileSizeModifier; }\n\n /** @internal */\n public getTileCenter(tile: Tile): Point3d { return this.location.multiplyPoint3d(tile.center); }\n\n /** @internal */\n public getTileRadius(tile: Tile): number {\n let range: Range3d = tile.range.clone(scratchRange);\n if (tile.tree.is2d) {\n // 2d tiles have a fixed Z range of [-1, 1]. Sometimes (e.g., hypermodeling) we draw them within a 3d view. Prevent Z from artificially expanding the radius.\n range.low.z = range.high.z = 0;\n }\n\n range = this.location.multiplyRange(range, range);\n return 0.5 * range.low.distance(range.high);\n }\n\n /** @internal */\n public get clip(): ClipVector | undefined {\n return undefined !== this.clipVolume ? this.clipVolume.clipVector : undefined;\n }\n\n /** Add a provider to supplement or override the symbology overrides for the view.\n * @note If a provider already exists, the new provider will be chained such that it sees the base overrides\n * after they have potentially been modified by the existing provider.\n * @public\n */\n public addAppearanceProvider(provider: FeatureAppearanceProvider): void {\n this._appearanceProvider = this._appearanceProvider ? FeatureAppearanceProvider.chain(this._appearanceProvider, provider) : provider;\n }\n\n /** Optionally customizes aspects of the view's [[FeatureSymbology.Overrides]]. */\n public get appearanceProvider(): FeatureAppearanceProvider | undefined {\n return this._appearanceProvider;\n }\n\n /** @internal */\n public produceGraphics(): RenderGraphic | undefined {\n return this._produceGraphicBranch(this.graphics);\n }\n /** @internal */\n public get secondaryClassifiers(): Map<number, RenderPlanarClassifier>| undefined {\n return undefined;\n }\n\n /** @internal */\n private _produceGraphicBranch(graphics: GraphicBranch): RenderGraphic | undefined {\n if (graphics.isEmpty)\n return undefined;\n\n const opts: GraphicBranchOptions = {\n iModel: this.tree.iModel,\n transformFromIModel: this.transformFromIModel,\n clipVolume: this.clipVolume,\n classifierOrDrape: this.planarClassifier ?? this.drape,\n appearanceProvider: this.appearanceProvider,\n hline: this.hiddenLineSettings,\n secondaryClassifiers: this.secondaryClassifiers,\n };\n\n let graphic = this.context.createGraphicBranch(graphics, this.location, opts);\n if (undefined !== this.animationTransformNodeId)\n graphic = this.context.renderSystem.createAnimationTransformNode(graphic, this.animationTransformNodeId);\n\n if (undefined !== this.groupNodeId) {\n const branch = new GraphicBranch();\n branch.add(graphic);\n branch.groupNodeId = this.groupNodeId;\n graphic = this.context.createGraphicBranch(branch, Transform.identity);\n }\n\n return graphic;\n }\n\n /** Output graphics for all accumulated tiles. */\n public drawGraphics(): void {\n const graphics = this.produceGraphics();\n if (undefined !== graphics)\n this.context.outputGraphic(graphics);\n }\n\n /** Output graphics of the specified type for all accumulated tiles. */\n public drawGraphicsWithType(graphicType: TileGraphicType, graphics: GraphicBranch): void {\n const branch = this._produceGraphicBranch(graphics);\n if (undefined !== branch)\n this.context.withGraphicType(graphicType, () => this.context.outputGraphic(branch));\n }\n\n /** Indicate that graphics for the specified tile are desired but not yet available. Subsequently a request will be enqueued to load the tile's graphics. */\n public insertMissing(tile: Tile): void {\n this.context.insertMissingTile(tile);\n }\n\n /** Indicate that some requested child tiles are not yet loaded. */\n public markChildrenLoading(): void {\n this.context.markChildrenLoading();\n }\n\n /** Indicate that the specified tile is being used for some purpose by the [[SceneContext]]'s [[Viewport]]. Typically \"used\" means \"displayed\", but the exact meaning is up to the [[TileTree]] - for example, \"used\" might also mean that the tile's children are being used. A tile that is \"in use\" by any [[Viewport]] will not be discarded. */\n public markUsed(tile: Tile): void {\n tile.usageMarker.mark(this.context.viewport, this.now);\n }\n\n /** Indicate that the specified tile should be displayed and that its graphics are ready to be displayed. The number of \"ready\" tiles is used in conjunction with the number of \"missing\" tiles to convey to the user how complete the current view is.\n * @see [[insertMissing]]\n */\n public markReady(tile: Tile): void {\n this.readyTiles.add(tile);\n }\n\n /** Invoked by [[TileTree.selectTiles]]. This exists chiefly for [[SolarShadowMap]].\n * @internal\n */\n public processSelectedTiles(_tiles: Tile[]): void { }\n\n /* @internal */\n public get maxRealityTreeSelectionCount(): number | undefined { return undefined; }\n\n /* @internal */\n public get shouldCollectClassifierGraphics(): boolean { return true; }\n}\n"]}
|
|
@@ -86,5 +86,15 @@ export declare class MapCartoRectangle extends Range2d {
|
|
|
86
86
|
fractionFromCartographic(carto: Cartographic): Point2d | undefined;
|
|
87
87
|
/** @internal */
|
|
88
88
|
getTileFractionRange(tilingScheme: MapTilingScheme): Range2d;
|
|
89
|
+
/**
|
|
90
|
+
* Compute rectangle with angles specified in degrees.
|
|
91
|
+
* @beta
|
|
92
|
+
*/
|
|
93
|
+
toDegrees(): {
|
|
94
|
+
north: number;
|
|
95
|
+
south: number;
|
|
96
|
+
east: number;
|
|
97
|
+
west: number;
|
|
98
|
+
};
|
|
89
99
|
}
|
|
90
100
|
//# sourceMappingURL=MapCartoRectangle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapCartoRectangle.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapCartoRectangle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAS,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAK9C;;;;;;;GAOG;AACH,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C;;;;;;;OAOG;IACH,SAAS,aAAa,IAAI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AAM,CADe;IACxC,IAAW,IAAI,CAAC,CAAC,EAAE,MAAM,EAAqB;IAE9C,wCAAwC;IACxC,IAAW,KAAK,IACI,MAAM,CADe;IACzC,IAAW,KAAK,CAAC,CAAC,EAAE,MAAM,EAAqB;IAE/C,wCAAwC;IACxC,IAAW,IAAI,IACI,MAAM,CADgB;IACzC,IAAW,IAAI,CAAC,CAAC,EAAE,MAAM,EAAsB;IAE/C,wCAAwC;IACxC,IAAW,KAAK,IACI,MAAM,CADgB;IAC1C,IAAW,KAAK,CAAC,CAAC,EAAE,MAAM,EAAsB;IAEhD,uFAAuF;IACvF,IAAW,aAAa,WAEvB;IAED,gFAAgF;IAChF,IAAW,kBAAkB,IAAI,kBAAkB,CAKlD;IAED,iDAAiD;IACjD,IAAW,WAAW,IAAI,YAAY,CAKrC;IAED,wEAAwE;IACxE,IAAW,cAAc,IAAI,cAAc,CAK1C;IAED;;;;;;OAMG;IACI,UAAU,CAAC,IAAI,SAAI,EAAE,KAAK,SAAI,EAAE,IAAI,SAAI,EAAE,KAAK,SAAI;IAO1D,yHAAyH;IAClH,oBAAoB,CAAC,KAAK,EAAE,YAAY;IAI/C;;;OAGG;IACI,SAAS,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY;IAQrD;;OAEG;IACI,wBAAwB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,GAAG,SAAS;IAKzE,gBAAgB;IACT,oBAAoB,CAAC,YAAY,EAAE,eAAe;IASxD;;;MAGE;IACM,SAAS;;;;;;CAUnB"}
|
|
@@ -145,6 +145,18 @@ class MapCartoRectangle extends core_geometry_1.Range2d {
|
|
|
145
145
|
scratchMercatorFractionRange.high.y = tilingScheme.latitudeToYFraction(this.high.y);
|
|
146
146
|
return scratchMercatorFractionRange;
|
|
147
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Compute rectangle with angles specified in degrees.
|
|
150
|
+
* @beta
|
|
151
|
+
*/
|
|
152
|
+
toDegrees() {
|
|
153
|
+
return {
|
|
154
|
+
north: core_geometry_1.Angle.radiansToDegrees(this.north),
|
|
155
|
+
south: core_geometry_1.Angle.radiansToDegrees(this.south),
|
|
156
|
+
east: core_geometry_1.Angle.radiansToDegrees(this.east),
|
|
157
|
+
west: core_geometry_1.Angle.radiansToDegrees(this.west),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
148
160
|
}
|
|
149
161
|
exports.MapCartoRectangle = MapCartoRectangle;
|
|
150
162
|
//# sourceMappingURL=MapCartoRectangle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapCartoRectangle.js","sourceRoot":"","sources":["../../../../src/tile/map/MapCartoRectangle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAA+D;AAC/D,oDAAkD;AAIlD,MAAM,4BAA4B,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAC1D,MAAM,cAAc,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAa,iBAAkB,SAAQ,uBAAO;IAC5C;;;;;;;OAOG;IACH,YAAsB,IAAY,EAAE,KAAa,EAAE,IAAY,EAAE,KAAa;QAC5E,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,sDAAsD;IAC/C,MAAM,CAAC,UAAU;QACtB,OAAO,IAAI,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,8EAA8E;IACvE,MAAM,CAAC,aAAa;QACzB,OAAO,IAAI,iBAAiB,CAAC,CAAC,qBAAK,CAAC,SAAS,EAAE,CAAC,qBAAK,CAAC,cAAc,EAAE,qBAAK,CAAC,SAAS,EAAE,qBAAK,CAAC,cAAc,CAAC,CAA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AAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrF,4BAA4B,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAClF,4BAA4B,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpF,OAAO,4BAA4B,CAAC;IACtC,CAAC;CACF;AA/ID,8CA+IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { Angle, Point2d, Range2d } from \"@itwin/core-geometry\";\nimport { Cartographic } from \"@itwin/core-common\";\nimport { GlobalLocation, GlobalLocationArea } from \"../../ViewGlobalLocation\";\nimport { MapTilingScheme } from \"../internal\";\n\nconst scratchMercatorFractionRange = Range2d.createNull();\nconst scratchPoint2d = Point2d.createZero();\n\n/** A specialization of [Range2d]($core-geometry) representing a [Cartographic]($common) region on the surface of the Earth,\n * used by [[MapTile]]s.\n * The `x` components of the `low` and `high` points refer to the western and eastern longitudes, respectively.\n * The `y` components of the `low` and `high` points refer to the southern and northern latitudes, respectively.\n * Longitudes are stored in radians in the range [-pi, pi].\n * Latitudes are stored in radians in the range [-pi/2, pi/2].\n * @public\n */\nexport class MapCartoRectangle extends Range2d {\n /** Construct a new rectangle with angles specified in radians.\n * @param west The western longitude in radians, in [-pi, pi].\n * @param south The southern latitude in radians, in [-pi/2, pi/2].\n * @param east The eastern latitude in radians, in [-pi, pi].\n * @param north The northern latitude in radians, in [-pi/2, pi/2].\n * @note If `north` is less than `south`, they will be swapped.\n * @see [[fromRadians]], [[fromDegrees]], [[createZero]], and [[createMaximum]] to construct a new rectangle.\n */\n protected constructor(west: number, south: number, east: number, north: number) {\n super(west, Math.min(south, north), east, Math.max(south, north));\n }\n\n /** Create a rectangle with all angles set to zero. */\n public static createZero(): MapCartoRectangle {\n return new MapCartoRectangle(0, 0, 0, 0);\n }\n\n /** Create a rectangle encompassing all points on the surface of the Earth. */\n public static createMaximum(): MapCartoRectangle {\n return new MapCartoRectangle(-Angle.piRadians, -Angle.piOver2Radians, Angle.piRadians, Angle.piOver2Radians);\n }\n\n /** Create a new rectangle with angles specified in radians.\n * @param west The western longitude in radians, in [-pi, pi].\n * @param south The southern latitude in radians, in [-pi/2, pi/2].\n * @param east The eastern latitude in radians, in [-pi, pi].\n * @param north The northern latitude in radians, in [-pi/2, pi/2].\n * @param result An optional preallocated rectangle to hold the result.\n * @note If `north` is less than `south`, they will be swapped.\n */\n public static fromRadians(west: number, south: number, east: number, north: number, result?: MapCartoRectangle): MapCartoRectangle {\n result = result ?? MapCartoRectangle.createZero();\n result.setRadians(west, south, east, north);\n return result;\n }\n\n /** Create a new rectangle with angles specified in degrees.\n * @param west The western longitude in degrees, in [-180, 180].\n * @param south The southern latitude in degrees, in [-90, 90].\n * @param east The eastern latitude in degrees, in [-180, 180].\n * @param north The northern latitude in degrees, in [-90, 90].\n * @param result An optional preallocated rectangle to hold the result.\n * @note If `north` is less than `south`, they will be swapped.\n */\n public static fromDegrees(west: number, south: number, east: number, north: number, result?: MapCartoRectangle): MapCartoRectangle {\n const mult = Angle.radiansPerDegree;\n return MapCartoRectangle.fromRadians(west * mult, south * mult, east * mult, north * mult, result);\n }\n\n /** The western longitude in radians. */\n public get west() { return this.low.x; }\n public set west(x: number) { this.low.x = x; }\n\n /** The southern latitude in radians. */\n public get south() { return this.low.y; }\n public set south(y: number) { this.low.y = y; }\n\n /** The eastern longitude in radians. */\n public get east() { return this.high.x; }\n public set east(x: number) { this.high.x = x; }\n\n /** The northern latitude in radians. */\n public get north() { return this.high.y; }\n public set north(y: number) { this.high.y = y; }\n\n /** A non-localized string representation of this rectangle, for debugging purposes. */\n public get latLongString() {\n return `Latitude: ${this.low.y * Angle.degreesPerRadian} - ${this.high.y * Angle.degreesPerRadian} Longitude: ${this.low.x * Angle.degreesPerRadian} - ${this.high.x * Angle.degreesPerRadian}`;\n }\n\n /** A pair of [[Cartographic]]s representing the same area as this rectangle. */\n public get globalLocationArea(): GlobalLocationArea {\n return {\n southwest: Cartographic.fromRadians({longitude: this.west, latitude: this.south}),\n northeast: Cartographic.fromRadians({longitude: this.east, latitude: this.north}),\n };\n }\n\n /** The cartographic center of this rectangle. */\n public get cartoCenter(): Cartographic {\n return Cartographic.fromRadians({\n longitude: (this.low.x + this.high.x) / 2,\n latitude: (this.low.y + this.high.y) / 2,\n });\n }\n\n /** The [[globalLocationArea]] and [[cartoCenter]] of this rectangle. */\n public get globalLocation(): GlobalLocation {\n return {\n center: this.cartoCenter,\n area: this.globalLocationArea,\n };\n }\n\n /** Reinitialize this rectangle using angles specified in radians.\n * @param west The western longitude in radians, in [-pi, pi].\n * @param south The southern latitude in radians, in [-pi/2, pi/2].\n * @param east The eastern latitude in radians, in [-pi, pi].\n * @param north The northern latitude in radians, in [-pi/2, pi/2].\n * @note If `north` is less than `south`, they will be swapped.\n */\n public setRadians(west = 0, south = 0, east = 0, north = 0) {\n this.west = west;\n this.south = south;\n this.east = east;\n this.north = north;\n }\n\n /** Returns true if the specified cartographic location is contained within this rectangle's area, ignoring elevation. */\n public containsCartographic(carto: Cartographic) {\n return this.containsXY(carto.longitude, carto.latitude);\n }\n\n /** Returns the position at the center of this rectangle, at an elevation of zero.\n * @param result An optional preallocated Cartographic to store the result.\n * @returns the center of this rectangle.\n */\n public getCenter(result?: Cartographic): Cartographic {\n return Cartographic.fromRadians({\n longitude: (this.west + this.east) / 2,\n latitude: (this.north + this.south) / 2,\n height: 0,\n }, result);\n }\n\n /** Computes fractional coordinates of the specified position within this rectangle's area.\n * @see [Range2d.worldToLocal]($core-geometry)\n */\n public fractionFromCartographic(carto: Cartographic): Point2d | undefined {\n const pt = Point2d.create(carto.longitude, carto.latitude, scratchPoint2d);\n return this.worldToLocal(pt);\n }\n\n /** @internal */\n public getTileFractionRange(tilingScheme: MapTilingScheme) {\n scratchMercatorFractionRange.low.x = tilingScheme.longitudeToXFraction(this.low.x);\n scratchMercatorFractionRange.high.x = tilingScheme.longitudeToXFraction(this.high.x);\n scratchMercatorFractionRange.low.y = tilingScheme.latitudeToYFraction(this.low.y);\n scratchMercatorFractionRange.high.y = tilingScheme.latitudeToYFraction(this.high.y);\n\n return scratchMercatorFractionRange;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MapCartoRectangle.js","sourceRoot":"","sources":["../../../../src/tile/map/MapCartoRectangle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAA+D;AAC/D,oDAAkD;AAIlD,MAAM,4BAA4B,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAC1D,MAAM,cAAc,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAa,iBAAkB,SAAQ,uBAAO;IAC5C;;;;;;;OAOG;IACH,YAAsB,IAAY,EAAE,KAAa,EAAE,IAAY,EAAE,KAAa;QAC5E,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,sDAAsD;IAC/C,MAAM,CAAC,UAAU;QACtB,OAAO,IAAI,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,8EAA8E;IACvE,MAAM,CAAC,aAAa;QACzB,OAAO,IAAI,iBAAiB,CAAC,CAAC,qBAAK,CAAC,SAAS,EAAE,CAAC,qBAAK,CAAC,cAAc,EAAE,qBAAK,CAAC,SAAS,EAAE,qBAAK,CAAC,cAAc,CAAC,CAAC;IAC/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AI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrF,4BAA4B,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAClF,4BAA4B,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpF,OAAO,4BAA4B,CAAC;IACtC,CAAC;IAEA;;;MAGE;IACM,SAAS;QACd,OAAO;YACL,KAAK,EAAE,qBAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;YACzC,KAAK,EAAE,qBAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;YACzC,IAAI,EAAE,qBAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;YACvC,IAAI,EAAE,qBAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;SACxC,CAAA;IACH,CAAC;CAGJ;AA9JD,8CA8JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { Angle, Point2d, Range2d } from \"@itwin/core-geometry\";\nimport { Cartographic } from \"@itwin/core-common\";\nimport { GlobalLocation, GlobalLocationArea } from \"../../ViewGlobalLocation\";\nimport { MapTilingScheme } from \"../internal\";\n\nconst scratchMercatorFractionRange = Range2d.createNull();\nconst scratchPoint2d = Point2d.createZero();\n\n/** A specialization of [Range2d]($core-geometry) representing a [Cartographic]($common) region on the surface of the Earth,\n * used by [[MapTile]]s.\n * The `x` components of the `low` and `high` points refer to the western and eastern longitudes, respectively.\n * The `y` components of the `low` and `high` points refer to the southern and northern latitudes, respectively.\n * Longitudes are stored in radians in the range [-pi, pi].\n * Latitudes are stored in radians in the range [-pi/2, pi/2].\n * @public\n */\nexport class MapCartoRectangle extends Range2d {\n /** Construct a new rectangle with angles specified in radians.\n * @param west The western longitude in radians, in [-pi, pi].\n * @param south The southern latitude in radians, in [-pi/2, pi/2].\n * @param east The eastern latitude in radians, in [-pi, pi].\n * @param north The northern latitude in radians, in [-pi/2, pi/2].\n * @note If `north` is less than `south`, they will be swapped.\n * @see [[fromRadians]], [[fromDegrees]], [[createZero]], and [[createMaximum]] to construct a new rectangle.\n */\n protected constructor(west: number, south: number, east: number, north: number) {\n super(west, Math.min(south, north), east, Math.max(south, north));\n }\n\n /** Create a rectangle with all angles set to zero. */\n public static createZero(): MapCartoRectangle {\n return new MapCartoRectangle(0, 0, 0, 0);\n }\n\n /** Create a rectangle encompassing all points on the surface of the Earth. */\n public static createMaximum(): MapCartoRectangle {\n return new MapCartoRectangle(-Angle.piRadians, -Angle.piOver2Radians, Angle.piRadians, Angle.piOver2Radians);\n }\n\n /** Create a new rectangle with angles specified in radians.\n * @param west The western longitude in radians, in [-pi, pi].\n * @param south The southern latitude in radians, in [-pi/2, pi/2].\n * @param east The eastern latitude in radians, in [-pi, pi].\n * @param north The northern latitude in radians, in [-pi/2, pi/2].\n * @param result An optional preallocated rectangle to hold the result.\n * @note If `north` is less than `south`, they will be swapped.\n */\n public static fromRadians(west: number, south: number, east: number, north: number, result?: MapCartoRectangle): MapCartoRectangle {\n result = result ?? MapCartoRectangle.createZero();\n result.setRadians(west, south, east, north);\n return result;\n }\n\n /** Create a new rectangle with angles specified in degrees.\n * @param west The western longitude in degrees, in [-180, 180].\n * @param south The southern latitude in degrees, in [-90, 90].\n * @param east The eastern latitude in degrees, in [-180, 180].\n * @param north The northern latitude in degrees, in [-90, 90].\n * @param result An optional preallocated rectangle to hold the result.\n * @note If `north` is less than `south`, they will be swapped.\n */\n public static fromDegrees(west: number, south: number, east: number, north: number, result?: MapCartoRectangle): MapCartoRectangle {\n const mult = Angle.radiansPerDegree;\n return MapCartoRectangle.fromRadians(west * mult, south * mult, east * mult, north * mult, result);\n }\n\n /** The western longitude in radians. */\n public get west() { return this.low.x; }\n public set west(x: number) { this.low.x = x; }\n\n /** The southern latitude in radians. */\n public get south() { return this.low.y; }\n public set south(y: number) { this.low.y = y; }\n\n /** The eastern longitude in radians. */\n public get east() { return this.high.x; }\n public set east(x: number) { this.high.x = x; }\n\n /** The northern latitude in radians. */\n public get north() { return this.high.y; }\n public set north(y: number) { this.high.y = y; }\n\n /** A non-localized string representation of this rectangle, for debugging purposes. */\n public get latLongString() {\n return `Latitude: ${this.low.y * Angle.degreesPerRadian} - ${this.high.y * Angle.degreesPerRadian} Longitude: ${this.low.x * Angle.degreesPerRadian} - ${this.high.x * Angle.degreesPerRadian}`;\n }\n\n /** A pair of [[Cartographic]]s representing the same area as this rectangle. */\n public get globalLocationArea(): GlobalLocationArea {\n return {\n southwest: Cartographic.fromRadians({longitude: this.west, latitude: this.south}),\n northeast: Cartographic.fromRadians({longitude: this.east, latitude: this.north}),\n };\n }\n\n /** The cartographic center of this rectangle. */\n public get cartoCenter(): Cartographic {\n return Cartographic.fromRadians({\n longitude: (this.low.x + this.high.x) / 2,\n latitude: (this.low.y + this.high.y) / 2,\n });\n }\n\n /** The [[globalLocationArea]] and [[cartoCenter]] of this rectangle. */\n public get globalLocation(): GlobalLocation {\n return {\n center: this.cartoCenter,\n area: this.globalLocationArea,\n };\n }\n\n /** Reinitialize this rectangle using angles specified in radians.\n * @param west The western longitude in radians, in [-pi, pi].\n * @param south The southern latitude in radians, in [-pi/2, pi/2].\n * @param east The eastern latitude in radians, in [-pi, pi].\n * @param north The northern latitude in radians, in [-pi/2, pi/2].\n * @note If `north` is less than `south`, they will be swapped.\n */\n public setRadians(west = 0, south = 0, east = 0, north = 0) {\n this.west = west;\n this.south = south;\n this.east = east;\n this.north = north;\n }\n\n /** Returns true if the specified cartographic location is contained within this rectangle's area, ignoring elevation. */\n public containsCartographic(carto: Cartographic) {\n return this.containsXY(carto.longitude, carto.latitude);\n }\n\n /** Returns the position at the center of this rectangle, at an elevation of zero.\n * @param result An optional preallocated Cartographic to store the result.\n * @returns the center of this rectangle.\n */\n public getCenter(result?: Cartographic): Cartographic {\n return Cartographic.fromRadians({\n longitude: (this.west + this.east) / 2,\n latitude: (this.north + this.south) / 2,\n height: 0,\n }, result);\n }\n\n /** Computes fractional coordinates of the specified position within this rectangle's area.\n * @see [Range2d.worldToLocal]($core-geometry)\n */\n public fractionFromCartographic(carto: Cartographic): Point2d | undefined {\n const pt = Point2d.create(carto.longitude, carto.latitude, scratchPoint2d);\n return this.worldToLocal(pt);\n }\n\n /** @internal */\n public getTileFractionRange(tilingScheme: MapTilingScheme) {\n scratchMercatorFractionRange.low.x = tilingScheme.longitudeToXFraction(this.low.x);\n scratchMercatorFractionRange.high.x = tilingScheme.longitudeToXFraction(this.high.x);\n scratchMercatorFractionRange.low.y = tilingScheme.latitudeToYFraction(this.low.y);\n scratchMercatorFractionRange.high.y = tilingScheme.latitudeToYFraction(this.high.y);\n\n return scratchMercatorFractionRange;\n }\n\n /**\n * Compute rectangle with angles specified in degrees.\n * @beta\n */\n public toDegrees() {\n return {\n north: Angle.radiansToDegrees(this.north),\n south: Angle.radiansToDegrees(this.south),\n east: Angle.radiansToDegrees(this.east),\n west: Angle.radiansToDegrees(this.west),\n }\n }\n\n\n}\n"]}
|
|
@@ -138,9 +138,9 @@ export declare abstract class MapLayerImageryProvider {
|
|
|
138
138
|
/** @internal */
|
|
139
139
|
protected setRequestAuthorization(headers: Headers): void;
|
|
140
140
|
/** @internal */
|
|
141
|
-
makeTileRequest(url: string, timeoutMs?: number): Promise<Response>;
|
|
141
|
+
makeTileRequest(url: string, timeoutMs?: number, authorization?: string): Promise<Response>;
|
|
142
142
|
/** @internal */
|
|
143
|
-
makeRequest(url: string, timeoutMs?: number): Promise<Response>;
|
|
143
|
+
makeRequest(url: string, timeoutMs?: number, authorization?: string): Promise<Response>;
|
|
144
144
|
/** Returns a map layer tile at the specified settings. */
|
|
145
145
|
loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined>;
|
|
146
146
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAqB,MAAM,oBAAoB,CAAC;AAIzG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA6C,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,EAA2B,MAAM,aAAa,CAAC;AAC7N,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD;;GAEG;AACH,oBAAY,6BAA6B;IACvC,KAAK,IAAA;IACL,WAAW,IAAA;CACZ;AAED,gBAAgB;AAChB,MAAM,WAAW,WAAW;IAE1B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,8BAAsB,uBAAuB;IAqE/B,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,qBAAqB;IAAE,SAAS,CAAC,gBAAgB,EAAE,OAAO;IApEpG,SAAS,CAAC,2BAA2B,UAAS;IAC9C,SAAgB,eAAe,qBAA0B,uBAAuB,KAAK,IAAI,EAAI;IAE7F,gBAAgB;IAChB,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiC;IAEvE,gBAAgB;IAChB,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAgC;IAExE,gBAAgB;IAChB,O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CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAWtI,gBAAgB;IACT,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAK7E,gBAAgB;IACT,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO;IAM/G,gBAAgB;IACT,uBAAuB,CAAC,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO;IASpF;;OAEG;IACH,SAAS,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM;CAQzC"}
|
|
@@ -207,7 +207,7 @@ class MapLayerImageryProvider {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
/** @internal */
|
|
210
|
-
async makeTileRequest(url, timeoutMs) {
|
|
210
|
+
async makeTileRequest(url, timeoutMs, authorization) {
|
|
211
211
|
// We want to complete the first request before letting other requests go;
|
|
212
212
|
// this done to avoid flooding server with requests missing credentials
|
|
213
213
|
if (!this._firstRequestPromise)
|
|
@@ -216,7 +216,7 @@ class MapLayerImageryProvider {
|
|
|
216
216
|
await this._firstRequestPromise;
|
|
217
217
|
let response;
|
|
218
218
|
try {
|
|
219
|
-
response = await this.makeRequest(url, timeoutMs);
|
|
219
|
+
response = await this.makeRequest(url, timeoutMs, authorization);
|
|
220
220
|
}
|
|
221
221
|
finally {
|
|
222
222
|
this.onFirstRequestCompleted.raiseEvent();
|
|
@@ -226,11 +226,15 @@ class MapLayerImageryProvider {
|
|
|
226
226
|
return response;
|
|
227
227
|
}
|
|
228
228
|
/** @internal */
|
|
229
|
-
async makeRequest(url, timeoutMs) {
|
|
229
|
+
async makeRequest(url, timeoutMs, authorization) {
|
|
230
230
|
let response;
|
|
231
231
|
let headers;
|
|
232
232
|
let hasCreds = false;
|
|
233
|
-
if (
|
|
233
|
+
if (authorization) {
|
|
234
|
+
headers = new Headers();
|
|
235
|
+
headers.set("Authorization", authorization);
|
|
236
|
+
}
|
|
237
|
+
else if (this._settings.userName && this._settings.password) {
|
|
234
238
|
hasCreds = true;
|
|
235
239
|
headers = new Headers();
|
|
236
240
|
this.setRequestAuthorization(headers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,oDAAyG;AACzG,wDAA6C;AAC7C,+CAA4C;AAC5C,mEAAwF;AAExF,0CAA6N;AAE7N,+CAAyG;AAGzG,gBAAgB;AAChB,MAAM,aAAa,GAAG,GAAG,EAAE,gBAAgB,GAAG,GAAG,CAAC;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B;;GAEG;AACH,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACvC,mFAAK,CAAA;IACL,+FAAW,CAAA;AACb,CAAC,EAHW,6BAA6B,6CAA7B,6BAA6B,QAGxC;AAWD;;;GAGG;AACH,MAAsB,uBAAuB;IAqEZ;IAA4C;IApEjE,2BAA2B,GAAG,KAAK,CAAC;IAC9B,eAAe,GAAG,IAAI,sBAAO,EAA+C,CAAC;IAE7F,gBAAgB;IACC,qBAAqB,GAAG,IAAI,kCAAuB,EAAE,CAAC;IAEvE,gBAAgB;IACC,uBAAuB,GAAG,IAAI,iCAAsB,EAAE,CAAC;IAExE,gBAAgB;IACR,OAAO,GAAG,6BAA6B,CAAC,KAAK,CAAC;IAEtD,gBAAgB;IACN,uBAAuB,GAAG,KAAK,CAAC;IA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M,GAAG,IAAA,4BAAiB,EAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACrE,MAAM,GAAG,IAAA,4BAAiB,EAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA9cD,0DA8cC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayers\n */\n\nimport { assert, BeEvent } from \"@itwin/core-bentley\";\nimport { Cartographic, ImageMapLayerSettings, ImageSource, ImageSourceFormat } from \"@itwin/core-common\";\nimport { Angle } from \"@itwin/core-geometry\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../../NotificationManager\";\nimport { ScreenViewport } from \"../../Viewport\";\nimport { appendQueryParams, GeographicTilingScheme, ImageryMapTile, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeatureInfo, MapTilingScheme, QuadId, WebMercatorTilingScheme } from \"../internal\";\nimport { HitDetail } from \"../../HitDetail\";\nimport { headersIncludeAuthMethod, setBasicAuthorization, setRequestTimeout } from \"../../request/utils\";\nimport { DecorateContext } from \"../../ViewContext\";\n\n/** @internal */\nconst tileImageSize = 256, untiledImageSize = 256;\nconst earthRadius = 6378137;\nconst doDebugToolTips = false;\n\n/** The status of the map layer imagery provider that lets you know if authentication is needed to request tiles.\n * @public\n */\nexport enum MapLayerImageryProviderStatus {\n Valid,\n RequireAuth,\n}\n\n/** @internal */\nexport interface WGS84Extent\n{\n longitudeLeft: number;\n longitudeRight: number;\n latitudeTop: number;\n latitudeBottom: number;\n}\n\n/** Abstract class for map layer imagery providers.\n * Map layer imagery providers request and provide tile images and other data. Each map layer from a separate source needs its own imagery provider object.\n * @beta\n */\nexport abstract class MapLayerImageryProvider {\n protected _hasSuccessfullyFetchedTile = false;\n public readonly onStatusChanged = new BeEvent<(provider: MapLayerImageryProvider) => void>();\n\n /** @internal */\n private readonly _mercatorTilingScheme = new WebMercatorTilingScheme();\n\n /** @internal */\n private readonly _geographicTilingScheme = new GeographicTilingScheme();\n\n /** @internal */\n private _status = MapLayerImageryProviderStatus.Valid;\n\n /** @internal */\n protected _includeUserCredentials = false;\n\n /** @internal */\n protected readonly onFirstRequestCompleted = new BeEvent<() => void>();\n\n /** @internal */\n protected _firstRequestPromise: Promise<void>|undefined;\n\n /** @internal */\n public get status() { return this._status; }\n\n /** Determine if this provider supports map feature info.\n * For example, this can be used to show the map feature info tool only when a provider is registered to support it.\n * @returns true if provider supports map feature info else return false.\n * @public\n */\n public get supportsMapFeatureInfo(): boolean { return false; }\n\n public resetStatus() { this.setStatus(MapLayerImageryProviderStatus.Valid); }\n\n /** @internal */\n public get tileSize(): number { return this._usesCachedTiles ? tileImageSize : untiledImageSize; }\n\n /** @internal */\n public get maximumScreenSize() { return 2 * this.tileSize; }\n\n public get minimumZoomLevel(): number { return this.defaultMinimumZoomLevel; }\n\n public get maximumZoomLevel(): number { return this.defaultMaximumZoomLevel; }\n\n /** @internal */\n public get usesCachedTiles() { return this._usesCachedTiles; }\n\n public get mutualExclusiveSubLayer(): boolean { return false; }\n\n /** @internal */\n public get useGeographicTilingScheme() { return false; }\n\n public cartoRange?: MapCartoRectangle;\n\n /**\n * This value is used internally for various computations, this should not get overriden.\n * @internal\n */\n protected readonly defaultMinimumZoomLevel = 0;\n\n /**\n * This value is used internally for various computations, this should not get overriden.\n * @internal\n */\n protected readonly defaultMaximumZoomLevel = 22;\n\n /** @internal */\n protected get _filterByCartoRange() { return true; }\n\n constructor(protected readonly _settings: ImageMapLayerSettings, protected _usesCachedTiles: boolean) {\n this._mercatorTilingScheme = new WebMercatorTilingScheme();\n this._geographicTilingScheme = new GeographicTilingScheme(2, 1, true);\n }\n\n /**\n * Initialize the provider by loading the first tile at its default maximum zoom level.\n * @beta\n */\n public async initialize(): Promise<void> {\n this.loadTile(0, 0, this.defaultMaximumZoomLevel).then((tileData: ImageSource | undefined) => { // eslint-disable-line @typescript-eslint/no-floating-promises\n if (tileData !== undefined)\n this._missingTileData = tileData.data as Uint8Array;\n });\n }\n\n public abstract constructUrl(row: number, column: number, zoomLevel: number): Promise<string>;\n\n public get tilingScheme(): MapTilingScheme { return this.useGeographicTilingScheme ? this._geographicTilingScheme : this._mercatorTilingScheme; }\n\n /** @deprecated in 5.0 Use [addAttributions] instead. */\n public addLogoCards(_cards: HTMLTableElement, _viewport: ScreenViewport): void { }\n\n /**\n * Add attribution logo cards for the data supplied by this provider to the [[Viewport]]'s logo div.\n * @param _cards Logo cards HTML element that may contain custom data attributes.\n * @param _viewport Viewport to add logo cards to.\n * @beta\n */\n public async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return Promise.resolve(this.addLogoCards(cards, vp));\n }\n\n /** @internal */\n protected _missingTileData?: Uint8Array;\n\n /** @internal */\n public get transparentBackgroundString(): string { return this._settings.transparentBackground ? \"true\" : \"false\"; }\n\n /** @internal */\n protected async _areChildrenAvailable(_tile: ImageryMapTile): Promise<boolean> { return true; }\n\n /** @internal */\n public getPotentialChildIds(quadId: QuadId): QuadId[] {\n const childLevel = quadId.level + 1;\n return quadId.getChildIds(this.tilingScheme.getNumberOfXChildrenAtLevel(childLevel), this.tilingScheme.getNumberOfYChildrenAtLevel(childLevel));\n }\n\n /**\n * Get child IDs of a quad and generate tiles based on these child IDs.\n * See [[ImageryTileTree._loadChildren]] for the definition of `resolveChildren` where this function is commonly called.\n * @param quadId quad to generate child IDs for.\n * @param resolveChildren Function that creates tiles from child IDs.\n * @beta\n */\n protected _generateChildIds(quadId: QuadId, resolveChildren: (childIds: QuadId[]) => void) {\n resolveChildren(this.getPotentialChildIds(quadId));\n }\n\n /** @internal */\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) {\n if (tile.depth >= this.maximumZoomLevel || (undefined !== this.cartoRange && this._filterByCartoRange && !this.cartoRange.intersectsRange(tile.rectangle))) {\n tile.setLeaf();\n return;\n }\n this._generateChildIds(tile.quadId, resolveChildren);\n }\n\n /**\n * Get tooltip text for a specific quad and cartographic position.\n * @param strings List of strings to contain tooltip text.\n * @param quadId Quad ID to get tooltip for.\n * @param _carto Cartographic that may be used to retrieve and/or format tooltip text.\n * @param tree Tree associated with the quad to get the tooltip for.\n * @internal\n */\n public async getToolTip(strings: string[], quadId: QuadId, _carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\n if (doDebugToolTips) {\n const range = quadId.getLatLongRangeDegrees(tree.tilingScheme);\n strings.push(`QuadId: ${quadId.debugString}, Lat: ${range.low.x} - ${range.high.x} Long: ${range.low.y} - ${range.high.y}`);\n }\n }\n\n /** @internal */\n public async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], _quadId: QuadId, _carto: Cartographic, _tree: ImageryMapTileTree, _hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<void> {\n // default implementation; simply return an empty feature info\n featureInfos.push({ layerName: this._settings.name });\n }\n\n /** @internal */\n public decorate(_context: DecorateContext): void {\n }\n\n /** @internal */\n protected async getImageFromTileResponse(tileResponse: Response, zoomLevel: number) {\n const arrayBuffer = await tileResponse.arrayBuffer();\n const byteArray: Uint8Array = new Uint8Array(arrayBuffer);\n if (!byteArray || (byteArray.length === 0))\n return undefined;\n if (this.matchesMissingTile(byteArray) && zoomLevel > 8)\n return undefined;\n\n const contentType = tileResponse.headers.get(\"content-type\")?.toLowerCase();\n let imageFormat: ImageSourceFormat | undefined;\n if (contentType) {\n // Note: 'includes' is used here instead of exact comparison because we encountered\n // some servers that would give content type such as 'image/png;charset=UTF-8'.\n if (contentType.includes(\"image/jpeg\"))\n imageFormat = ImageSourceFormat.Jpeg;\n else if (contentType.includes(\"image/png\"))\n imageFormat = ImageSourceFormat.Png;\n }\n\n if (imageFormat !== undefined)\n return new ImageSource(byteArray, imageFormat);\n\n assert(false, \"Invalid tile content type\");\n return undefined;\n }\n\n /**\n * Change the status of this provider.\n * Sub-classes should override 'onStatusUpdated' instead of this method.\n * @internal\n */\n public setStatus(status: MapLayerImageryProviderStatus) {\n if (this._status !== status) {\n this.onStatusUpdated(status);\n this._status = status;\n this.onStatusChanged.raiseEvent(this);\n }\n }\n\n /** Method called whenever the status changes, giving the opportunity to sub-classes to have a custom behavior.\n * @internal\n */\n protected onStatusUpdated(_newStatus: MapLayerImageryProviderStatus) { }\n\n /** @internal */\n protected setRequestAuthorization(headers: Headers) {\n if (this._settings.userName && this._settings.password) {\n setBasicAuthorization(headers, this._settings.userName, this._settings.password);\n }\n }\n\n /** @internal */\n public async makeTileRequest(url: string, timeoutMs?: number): Promise<Response> {\n\n // We want to complete the first request before letting other requests go;\n // this done to avoid flooding server with requests missing credentials\n if (!this._firstRequestPromise)\n this._firstRequestPromise = new Promise<void>((resolve: any) => this.onFirstRequestCompleted.addOnce(()=>resolve()));\n else\n await this._firstRequestPromise;\n\n let response: Response|undefined;\n try {\n response = await this.makeRequest(url, timeoutMs);\n } finally {\n this.onFirstRequestCompleted.raiseEvent();\n }\n\n if (response === undefined)\n throw new Error(\"fetch call failed\");\n\n return response;\n }\n\n /** @internal */\n public async makeRequest(url: string, timeoutMs?: number) {\n\n let response: Response|undefined;\n\n let headers: Headers | undefined;\n let hasCreds = false;\n if (this._settings.userName && this._settings.password) {\n hasCreds = true;\n headers = new Headers();\n this.setRequestAuthorization(headers);\n }\n const opts: RequestInit = {\n method: \"GET\",\n headers,\n credentials: this._includeUserCredentials ? \"include\" : undefined,\n };\n\n if (timeoutMs !== undefined)\n setRequestTimeout(opts, timeoutMs);\n\n response = await fetch(url, opts);\n\n if (response.status === 401\n && headersIncludeAuthMethod(response.headers, [\"ntlm\", \"negotiate\"])\n && !this._includeUserCredentials\n && !hasCreds\n ) {\n // Removed the previous headers and make sure \"include\" credentials is set\n opts.headers = undefined;\n opts.credentials = \"include\";\n\n // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)\n response = await fetch(url, opts);\n if (response.status === 200) {\n this._includeUserCredentials = true; // avoid going through 401 challenges over and over\n }\n }\n\n return response;\n }\n\n /** Returns a map layer tile at the specified settings. */\n public async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n\n try {\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\n if (tileUrl.length === 0)\n return undefined;\n\n const tileResponse: Response = await this.makeTileRequest(tileUrl);\n\n if (!this._hasSuccessfullyFetchedTile) {\n this._hasSuccessfullyFetchedTile = true;\n }\n\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error: any) {\n if (error?.status === 401) {\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\n\n // Only report error to end-user if we were previously able to fetch tiles\n // and then encountered an error, otherwise I assume an error was already reported\n // through the source validation process.\n if (this._hasSuccessfullyFetchedTile) {\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.LoadTileTokenError\", { layerName: this._settings.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\n }\n\n }\n return undefined;\n }\n }\n\n /** @internal */\n protected async toolTipFromUrl(strings: string[], url: string): Promise<void> {\n const headers = new Headers();\n this.setRequestAuthorization(headers);\n\n try {\n const response = await fetch(url, {\n method: \"GET\",\n headers,\n credentials: this._includeUserCredentials ? \"include\" : undefined,\n });\n const text = await response.text();\n if (undefined !== text) {\n strings.push(text);\n }\n } catch {\n }\n }\n\n /** @internal */\n public matchesMissingTile(tileData: Uint8Array): boolean {\n if (!this._missingTileData)\n return false;\n if (tileData.length !== this._missingTileData.length)\n return false;\n for (let i: number = 0; i < tileData.length; i += 10) {\n if (this._missingTileData[i] !== tileData[i]) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Calculates the projected x cartesian coordinate in EPSG:3857 from the longitude in EPSG:4326 (WGS84)\n * @param longitude Longitude in EPSG:4326 (WGS84)\n * @internal\n */\n public getEPSG3857X(longitude: number): number {\n return longitude * 20037508.34 / 180.0;\n }\n\n /**\n * Calculates the projected y cartesian coordinate in EPSG:3857 from the latitude in EPSG:4326 (WGS84)\n * @param latitude Latitude in EPSG:4326 (WGS84)\n * @internal\n */\n public getEPSG3857Y(latitude: number): number {\n const y = Math.log(Math.tan((90.0 + latitude) * Math.PI / 360.0)) / (Math.PI / 180.0);\n return y * 20037508.34 / 180.0;\n }\n\n /**\n * Calculates the longitude in EPSG:4326 (WGS84) from the projected x cartesian coordinate in EPSG:3857\n * @param x3857 Projected x cartesian coordinate in EPSG:3857\n * @internal\n */\n public getEPSG4326Lon(x3857: number): number {\n return Angle.radiansToDegrees(x3857 / earthRadius);\n }\n\n /**\n * Calculates the latitude in EPSG:4326 (WGS84) from the projected y cartesian coordinate in EPSG:3857\n * @param y3857 Projected y cartesian coordinate in EPSG:3857\n * @internal\n */\n public getEPSG4326Lat(y3857: number): number {\n const y = 2 * Math.atan(Math.exp(y3857 / earthRadius)) - (Math.PI / 2);\n return Angle.radiansToDegrees(y);\n }\n\n /**\n * Get the bounding box/extents of a tile in EPSG:4326 (WGS84) format.\n * Map tile providers like Bing and Mapbox allow the URL to be constructed directly from the zoom level and tile coordinates.\n * However, WMS-based servers take a bounding box instead. This method can help get that bounding box from a tile.\n * @param row Row of the tile\n * @param column Column of the tile\n * @param zoomLevel Desired zoom level of the tile\n * @internal\n */\n public getEPSG4326Extent(row: number, column: number, zoomLevel: number): WGS84Extent {\n // Shift left (this.tileSize << zoomLevel) overflow when using 512 pixels tile at higher resolution,\n // so use Math.pow instead (I assume the performance lost to be minimal)\n const mapSize = this.tileSize * Math.pow(2, zoomLevel);\n const leftGrid = this.tileSize * column;\n const topGrid = this.tileSize * row;\n\n const longitudeLeft = 360 * ((leftGrid / mapSize) - 0.5);\n const y0 = 0.5 - ((topGrid + this.tileSize) / mapSize);\n const latitudeBottom = 90.0 - 360.0 * Math.atan(Math.exp(-y0 * 2 * Math.PI)) / Math.PI;\n\n const longitudeRight = 360 * (((leftGrid + this.tileSize) / mapSize) - 0.5);\n const y1 = 0.5 - (topGrid / mapSize);\n const latitudeTop = 90.0 - 360.0 * Math.atan(Math.exp(-y1 * 2 * Math.PI)) / Math.PI;\n\n return { longitudeLeft, longitudeRight, latitudeTop, latitudeBottom };\n }\n\n /**\n * Get the bounding box/extents of a tile in EPSG:3857 format.\n * @param row Row of the tile\n * @param column Column of the tile\n * @param zoomLevel Desired zoom level of the tile\n * @internal\n */\n public getEPSG3857Extent(row: number, column: number, zoomLevel: number): { left: number, right: number, top: number, bottom: number } {\n const epsg4326Extent = this.getEPSG4326Extent(row, column, zoomLevel);\n\n const left = this.getEPSG3857X(epsg4326Extent.longitudeLeft);\n const right = this.getEPSG3857X(epsg4326Extent.longitudeRight);\n const bottom = this.getEPSG3857Y(epsg4326Extent.latitudeBottom);\n const top = this.getEPSG3857Y(epsg4326Extent.latitudeTop);\n\n return { left, right, bottom, top };\n }\n\n /** @internal */\n public getEPSG3857ExtentString(row: number, column: number, zoomLevel: number) {\n const tileExtent = this.getEPSG3857Extent(row, column, zoomLevel);\n return `${tileExtent.left.toFixed(2)},${tileExtent.bottom.toFixed(2)},${tileExtent.right.toFixed(2)},${tileExtent.top.toFixed(2)}`;\n }\n\n /** @internal */\n public getEPSG4326TileExtentString(row: number, column: number, zoomLevel: number, latLongAxisOrdering: boolean) {\n const tileExtent = this.getEPSG4326Extent(row, column, zoomLevel);\n return this.getEPSG4326ExtentString(tileExtent, latLongAxisOrdering);\n\n }\n\n /** @internal */\n public getEPSG4326ExtentString(tileExtent: WGS84Extent, latLongAxisOrdering: boolean) {\n\n if (latLongAxisOrdering) {\n return `${tileExtent.latitudeBottom.toFixed(8)},${tileExtent.longitudeLeft.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)},${tileExtent.longitudeRight.toFixed(8)}`;\n } else {\n return `${tileExtent.longitudeLeft.toFixed(8)},${tileExtent.latitudeBottom.toFixed(8)},${tileExtent.longitudeRight.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)}`;\n }\n }\n\n /** Append custom parameters for settings to provided URL object.\n * @internal\n */\n protected appendCustomParams(url: string) {\n if (!this._settings.savedQueryParams && !this._settings.unsavedQueryParams)\n return url;\n\n let tmpUrl = appendQueryParams(url, this._settings.savedQueryParams);\n tmpUrl = appendQueryParams(tmpUrl, this._settings.unsavedQueryParams);\n return tmpUrl;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,oDAAyG;AACzG,wDAA6C;AAC7C,+CAA4C;AAC5C,mEAAwF;AAExF,0CAA6N;AAE7N,+CAAyG;AAGzG,gBAAgB;AAChB,MAAM,aAAa,GAAG,GAAG,EAAE,gBAAgB,GAAG,GAAG,CAAC;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B;;GAEG;AACH,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACvC,mFAAK,CAAA;IACL,+FAAW,CAAA;AACb,CAAC,EAHW,6BAA6B,6CAA7B,6BAA6B,QAGxC;AAWD;;;GAGG;AACH,MAAsB,uBAAuB;IAqEZ;IAA4C;IApEjE,2BAA2B,GAAG,KAAK,CAAC;IAC9B,eAAe,GAAG,IAAI,sBAAO,EAA+C,CAAC;IAE7F,gBAAgB;IACC,qBAAqB,GAAG,IAAI,kCAAuB,EAAE,CAAC;IAEvE,gBAAgB;IACC,uBAAuB,GAAG,IAAI,iCAAsB,EAAE,CAAC;IAExE,gBAAgB;IACR,OAAO,GAAG,6BAA6B,CAAC,KAAK,CAAC;IAEtD,gBAAgB;IACN,uBAAuB,GAAG,KAAK,CAAC;IAE1C,gBAA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C;IAED;;OAEG;IACO,kBAAkB,CAAC,GAAW;QACtC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB;YACxE,OAAO,GAAG,CAAC;QAEb,IAAI,MAAM,GAAG,IAAA,4BAAiB,EAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACrE,MAAM,GAAG,IAAA,4BAAiB,EAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAjdD,0DAidC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayers\n */\n\nimport { assert, BeEvent } from \"@itwin/core-bentley\";\nimport { Cartographic, ImageMapLayerSettings, ImageSource, ImageSourceFormat } from \"@itwin/core-common\";\nimport { Angle } from \"@itwin/core-geometry\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../../NotificationManager\";\nimport { ScreenViewport } from \"../../Viewport\";\nimport { appendQueryParams, GeographicTilingScheme, ImageryMapTile, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeatureInfo, MapTilingScheme, QuadId, WebMercatorTilingScheme } from \"../internal\";\nimport { HitDetail } from \"../../HitDetail\";\nimport { headersIncludeAuthMethod, setBasicAuthorization, setRequestTimeout } from \"../../request/utils\";\nimport { DecorateContext } from \"../../ViewContext\";\n\n/** @internal */\nconst tileImageSize = 256, untiledImageSize = 256;\nconst earthRadius = 6378137;\nconst doDebugToolTips = false;\n\n/** The status of the map layer imagery provider that lets you know if authentication is needed to request tiles.\n * @public\n */\nexport enum MapLayerImageryProviderStatus {\n Valid,\n RequireAuth,\n}\n\n/** @internal */\nexport interface WGS84Extent\n{\n longitudeLeft: number;\n longitudeRight: number;\n latitudeTop: number;\n latitudeBottom: number;\n}\n\n/** Abstract class for map layer imagery providers.\n * Map layer imagery providers request and provide tile images and other data. Each map layer from a separate source needs its own imagery provider object.\n * @beta\n */\nexport abstract class MapLayerImageryProvider {\n protected _hasSuccessfullyFetchedTile = false;\n public readonly onStatusChanged = new BeEvent<(provider: MapLayerImageryProvider) => void>();\n\n /** @internal */\n private readonly _mercatorTilingScheme = new WebMercatorTilingScheme();\n\n /** @internal */\n private readonly _geographicTilingScheme = new GeographicTilingScheme();\n\n /** @internal */\n private _status = MapLayerImageryProviderStatus.Valid;\n\n /** @internal */\n protected _includeUserCredentials = false;\n\n /** @internal */\n protected readonly onFirstRequestCompleted = new BeEvent<() => void>();\n\n /** @internal */\n protected _firstRequestPromise: Promise<void>|undefined;\n\n /** @internal */\n public get status() { return this._status; }\n\n /** Determine if this provider supports map feature info.\n * For example, this can be used to show the map feature info tool only when a provider is registered to support it.\n * @returns true if provider supports map feature info else return false.\n * @public\n */\n public get supportsMapFeatureInfo(): boolean { return false; }\n\n public resetStatus() { this.setStatus(MapLayerImageryProviderStatus.Valid); }\n\n /** @internal */\n public get tileSize(): number { return this._usesCachedTiles ? tileImageSize : untiledImageSize; }\n\n /** @internal */\n public get maximumScreenSize() { return 2 * this.tileSize; }\n\n public get minimumZoomLevel(): number { return this.defaultMinimumZoomLevel; }\n\n public get maximumZoomLevel(): number { return this.defaultMaximumZoomLevel; }\n\n /** @internal */\n public get usesCachedTiles() { return this._usesCachedTiles; }\n\n public get mutualExclusiveSubLayer(): boolean { return false; }\n\n /** @internal */\n public get useGeographicTilingScheme() { return false; }\n\n public cartoRange?: MapCartoRectangle;\n\n /**\n * This value is used internally for various computations, this should not get overriden.\n * @internal\n */\n protected readonly defaultMinimumZoomLevel = 0;\n\n /**\n * This value is used internally for various computations, this should not get overriden.\n * @internal\n */\n protected readonly defaultMaximumZoomLevel = 22;\n\n /** @internal */\n protected get _filterByCartoRange() { return true; }\n\n constructor(protected readonly _settings: ImageMapLayerSettings, protected _usesCachedTiles: boolean) {\n this._mercatorTilingScheme = new WebMercatorTilingScheme();\n this._geographicTilingScheme = new GeographicTilingScheme(2, 1, true);\n }\n\n /**\n * Initialize the provider by loading the first tile at its default maximum zoom level.\n * @beta\n */\n public async initialize(): Promise<void> {\n this.loadTile(0, 0, this.defaultMaximumZoomLevel).then((tileData: ImageSource | undefined) => { // eslint-disable-line @typescript-eslint/no-floating-promises\n if (tileData !== undefined)\n this._missingTileData = tileData.data as Uint8Array;\n });\n }\n\n public abstract constructUrl(row: number, column: number, zoomLevel: number): Promise<string>;\n\n public get tilingScheme(): MapTilingScheme { return this.useGeographicTilingScheme ? this._geographicTilingScheme : this._mercatorTilingScheme; }\n\n /** @deprecated in 5.0 Use [addAttributions] instead. */\n public addLogoCards(_cards: HTMLTableElement, _viewport: ScreenViewport): void { }\n\n /**\n * Add attribution logo cards for the data supplied by this provider to the [[Viewport]]'s logo div.\n * @param _cards Logo cards HTML element that may contain custom data attributes.\n * @param _viewport Viewport to add logo cards to.\n * @beta\n */\n public async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return Promise.resolve(this.addLogoCards(cards, vp));\n }\n\n /** @internal */\n protected _missingTileData?: Uint8Array;\n\n /** @internal */\n public get transparentBackgroundString(): string { return this._settings.transparentBackground ? \"true\" : \"false\"; }\n\n /** @internal */\n protected async _areChildrenAvailable(_tile: ImageryMapTile): Promise<boolean> { return true; }\n\n /** @internal */\n public getPotentialChildIds(quadId: QuadId): QuadId[] {\n const childLevel = quadId.level + 1;\n return quadId.getChildIds(this.tilingScheme.getNumberOfXChildrenAtLevel(childLevel), this.tilingScheme.getNumberOfYChildrenAtLevel(childLevel));\n }\n\n /**\n * Get child IDs of a quad and generate tiles based on these child IDs.\n * See [[ImageryTileTree._loadChildren]] for the definition of `resolveChildren` where this function is commonly called.\n * @param quadId quad to generate child IDs for.\n * @param resolveChildren Function that creates tiles from child IDs.\n * @beta\n */\n protected _generateChildIds(quadId: QuadId, resolveChildren: (childIds: QuadId[]) => void) {\n resolveChildren(this.getPotentialChildIds(quadId));\n }\n\n /** @internal */\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) {\n if (tile.depth >= this.maximumZoomLevel || (undefined !== this.cartoRange && this._filterByCartoRange && !this.cartoRange.intersectsRange(tile.rectangle))) {\n tile.setLeaf();\n return;\n }\n this._generateChildIds(tile.quadId, resolveChildren);\n }\n\n /**\n * Get tooltip text for a specific quad and cartographic position.\n * @param strings List of strings to contain tooltip text.\n * @param quadId Quad ID to get tooltip for.\n * @param _carto Cartographic that may be used to retrieve and/or format tooltip text.\n * @param tree Tree associated with the quad to get the tooltip for.\n * @internal\n */\n public async getToolTip(strings: string[], quadId: QuadId, _carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\n if (doDebugToolTips) {\n const range = quadId.getLatLongRangeDegrees(tree.tilingScheme);\n strings.push(`QuadId: ${quadId.debugString}, Lat: ${range.low.x} - ${range.high.x} Long: ${range.low.y} - ${range.high.y}`);\n }\n }\n\n /** @internal */\n public async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], _quadId: QuadId, _carto: Cartographic, _tree: ImageryMapTileTree, _hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<void> {\n // default implementation; simply return an empty feature info\n featureInfos.push({ layerName: this._settings.name });\n }\n\n /** @internal */\n public decorate(_context: DecorateContext): void {\n }\n\n /** @internal */\n protected async getImageFromTileResponse(tileResponse: Response, zoomLevel: number) {\n const arrayBuffer = await tileResponse.arrayBuffer();\n const byteArray: Uint8Array = new Uint8Array(arrayBuffer);\n if (!byteArray || (byteArray.length === 0))\n return undefined;\n if (this.matchesMissingTile(byteArray) && zoomLevel > 8)\n return undefined;\n\n const contentType = tileResponse.headers.get(\"content-type\")?.toLowerCase();\n let imageFormat: ImageSourceFormat | undefined;\n if (contentType) {\n // Note: 'includes' is used here instead of exact comparison because we encountered\n // some servers that would give content type such as 'image/png;charset=UTF-8'.\n if (contentType.includes(\"image/jpeg\"))\n imageFormat = ImageSourceFormat.Jpeg;\n else if (contentType.includes(\"image/png\"))\n imageFormat = ImageSourceFormat.Png;\n }\n\n if (imageFormat !== undefined)\n return new ImageSource(byteArray, imageFormat);\n\n assert(false, \"Invalid tile content type\");\n return undefined;\n }\n\n /**\n * Change the status of this provider.\n * Sub-classes should override 'onStatusUpdated' instead of this method.\n * @internal\n */\n public setStatus(status: MapLayerImageryProviderStatus) {\n if (this._status !== status) {\n this.onStatusUpdated(status);\n this._status = status;\n this.onStatusChanged.raiseEvent(this);\n }\n }\n\n /** Method called whenever the status changes, giving the opportunity to sub-classes to have a custom behavior.\n * @internal\n */\n protected onStatusUpdated(_newStatus: MapLayerImageryProviderStatus) { }\n\n /** @internal */\n protected setRequestAuthorization(headers: Headers) {\n if (this._settings.userName && this._settings.password) {\n setBasicAuthorization(headers, this._settings.userName, this._settings.password);\n }\n }\n\n /** @internal */\n public async makeTileRequest(url: string, timeoutMs?: number, authorization?: string): Promise<Response> {\n\n // We want to complete the first request before letting other requests go;\n // this done to avoid flooding server with requests missing credentials\n if (!this._firstRequestPromise)\n this._firstRequestPromise = new Promise<void>((resolve: any) => this.onFirstRequestCompleted.addOnce(()=>resolve()));\n else\n await this._firstRequestPromise;\n\n let response: Response|undefined;\n try {\n response = await this.makeRequest(url, timeoutMs, authorization);\n } finally {\n this.onFirstRequestCompleted.raiseEvent();\n }\n\n if (response === undefined)\n throw new Error(\"fetch call failed\");\n\n return response;\n }\n\n /** @internal */\n public async makeRequest(url: string, timeoutMs?: number, authorization?: string): Promise<Response> {\n\n let response: Response|undefined;\n\n let headers: Headers | undefined;\n let hasCreds = false;\n if (authorization) {\n headers = new Headers();\n headers.set(\"Authorization\", authorization);\n } else if (this._settings.userName && this._settings.password) {\n hasCreds = true;\n headers = new Headers();\n this.setRequestAuthorization(headers);\n }\n const opts: RequestInit = {\n method: \"GET\",\n headers,\n credentials: this._includeUserCredentials ? \"include\" : undefined,\n };\n\n if (timeoutMs !== undefined)\n setRequestTimeout(opts, timeoutMs);\n\n response = await fetch(url, opts);\n\n if (response.status === 401\n && headersIncludeAuthMethod(response.headers, [\"ntlm\", \"negotiate\"])\n && !this._includeUserCredentials\n && !hasCreds\n ) {\n // Removed the previous headers and make sure \"include\" credentials is set\n opts.headers = undefined;\n opts.credentials = \"include\";\n\n // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)\n response = await fetch(url, opts);\n if (response.status === 200) {\n this._includeUserCredentials = true; // avoid going through 401 challenges over and over\n }\n }\n\n return response;\n }\n\n /** Returns a map layer tile at the specified settings. */\n public async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n\n try {\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\n if (tileUrl.length === 0)\n return undefined;\n\n const tileResponse: Response = await this.makeTileRequest(tileUrl);\n\n if (!this._hasSuccessfullyFetchedTile) {\n this._hasSuccessfullyFetchedTile = true;\n }\n\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error: any) {\n if (error?.status === 401) {\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\n\n // Only report error to end-user if we were previously able to fetch tiles\n // and then encountered an error, otherwise I assume an error was already reported\n // through the source validation process.\n if (this._hasSuccessfullyFetchedTile) {\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.LoadTileTokenError\", { layerName: this._settings.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\n }\n\n }\n return undefined;\n }\n }\n\n /** @internal */\n protected async toolTipFromUrl(strings: string[], url: string): Promise<void> {\n const headers = new Headers();\n this.setRequestAuthorization(headers);\n\n try {\n const response = await fetch(url, {\n method: \"GET\",\n headers,\n credentials: this._includeUserCredentials ? \"include\" : undefined,\n });\n const text = await response.text();\n if (undefined !== text) {\n strings.push(text);\n }\n } catch {\n }\n }\n\n /** @internal */\n public matchesMissingTile(tileData: Uint8Array): boolean {\n if (!this._missingTileData)\n return false;\n if (tileData.length !== this._missingTileData.length)\n return false;\n for (let i: number = 0; i < tileData.length; i += 10) {\n if (this._missingTileData[i] !== tileData[i]) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Calculates the projected x cartesian coordinate in EPSG:3857 from the longitude in EPSG:4326 (WGS84)\n * @param longitude Longitude in EPSG:4326 (WGS84)\n * @internal\n */\n public getEPSG3857X(longitude: number): number {\n return longitude * 20037508.34 / 180.0;\n }\n\n /**\n * Calculates the projected y cartesian coordinate in EPSG:3857 from the latitude in EPSG:4326 (WGS84)\n * @param latitude Latitude in EPSG:4326 (WGS84)\n * @internal\n */\n public getEPSG3857Y(latitude: number): number {\n const y = Math.log(Math.tan((90.0 + latitude) * Math.PI / 360.0)) / (Math.PI / 180.0);\n return y * 20037508.34 / 180.0;\n }\n\n /**\n * Calculates the longitude in EPSG:4326 (WGS84) from the projected x cartesian coordinate in EPSG:3857\n * @param x3857 Projected x cartesian coordinate in EPSG:3857\n * @internal\n */\n public getEPSG4326Lon(x3857: number): number {\n return Angle.radiansToDegrees(x3857 / earthRadius);\n }\n\n /**\n * Calculates the latitude in EPSG:4326 (WGS84) from the projected y cartesian coordinate in EPSG:3857\n * @param y3857 Projected y cartesian coordinate in EPSG:3857\n * @internal\n */\n public getEPSG4326Lat(y3857: number): number {\n const y = 2 * Math.atan(Math.exp(y3857 / earthRadius)) - (Math.PI / 2);\n return Angle.radiansToDegrees(y);\n }\n\n /**\n * Get the bounding box/extents of a tile in EPSG:4326 (WGS84) format.\n * Map tile providers like Bing and Mapbox allow the URL to be constructed directly from the zoom level and tile coordinates.\n * However, WMS-based servers take a bounding box instead. This method can help get that bounding box from a tile.\n * @param row Row of the tile\n * @param column Column of the tile\n * @param zoomLevel Desired zoom level of the tile\n * @internal\n */\n public getEPSG4326Extent(row: number, column: number, zoomLevel: number): WGS84Extent {\n // Shift left (this.tileSize << zoomLevel) overflow when using 512 pixels tile at higher resolution,\n // so use Math.pow instead (I assume the performance lost to be minimal)\n const mapSize = this.tileSize * Math.pow(2, zoomLevel);\n const leftGrid = this.tileSize * column;\n const topGrid = this.tileSize * row;\n\n const longitudeLeft = 360 * ((leftGrid / mapSize) - 0.5);\n const y0 = 0.5 - ((topGrid + this.tileSize) / mapSize);\n const latitudeBottom = 90.0 - 360.0 * Math.atan(Math.exp(-y0 * 2 * Math.PI)) / Math.PI;\n\n const longitudeRight = 360 * (((leftGrid + this.tileSize) / mapSize) - 0.5);\n const y1 = 0.5 - (topGrid / mapSize);\n const latitudeTop = 90.0 - 360.0 * Math.atan(Math.exp(-y1 * 2 * Math.PI)) / Math.PI;\n\n return { longitudeLeft, longitudeRight, latitudeTop, latitudeBottom };\n }\n\n /**\n * Get the bounding box/extents of a tile in EPSG:3857 format.\n * @param row Row of the tile\n * @param column Column of the tile\n * @param zoomLevel Desired zoom level of the tile\n * @internal\n */\n public getEPSG3857Extent(row: number, column: number, zoomLevel: number): { left: number, right: number, top: number, bottom: number } {\n const epsg4326Extent = this.getEPSG4326Extent(row, column, zoomLevel);\n\n const left = this.getEPSG3857X(epsg4326Extent.longitudeLeft);\n const right = this.getEPSG3857X(epsg4326Extent.longitudeRight);\n const bottom = this.getEPSG3857Y(epsg4326Extent.latitudeBottom);\n const top = this.getEPSG3857Y(epsg4326Extent.latitudeTop);\n\n return { left, right, bottom, top };\n }\n\n /** @internal */\n public getEPSG3857ExtentString(row: number, column: number, zoomLevel: number) {\n const tileExtent = this.getEPSG3857Extent(row, column, zoomLevel);\n return `${tileExtent.left.toFixed(2)},${tileExtent.bottom.toFixed(2)},${tileExtent.right.toFixed(2)},${tileExtent.top.toFixed(2)}`;\n }\n\n /** @internal */\n public getEPSG4326TileExtentString(row: number, column: number, zoomLevel: number, latLongAxisOrdering: boolean) {\n const tileExtent = this.getEPSG4326Extent(row, column, zoomLevel);\n return this.getEPSG4326ExtentString(tileExtent, latLongAxisOrdering);\n\n }\n\n /** @internal */\n public getEPSG4326ExtentString(tileExtent: WGS84Extent, latLongAxisOrdering: boolean) {\n\n if (latLongAxisOrdering) {\n return `${tileExtent.latitudeBottom.toFixed(8)},${tileExtent.longitudeLeft.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)},${tileExtent.longitudeRight.toFixed(8)}`;\n } else {\n return `${tileExtent.longitudeLeft.toFixed(8)},${tileExtent.latitudeBottom.toFixed(8)},${tileExtent.longitudeRight.toFixed(8)},${tileExtent.latitudeTop.toFixed(8)}`;\n }\n }\n\n /** Append custom parameters for settings to provided URL object.\n * @internal\n */\n protected appendCustomParams(url: string) {\n if (!this._settings.savedQueryParams && !this._settings.unsavedQueryParams)\n return url;\n\n let tmpUrl = appendQueryParams(url, this._settings.savedQueryParams);\n tmpUrl = appendQueryParams(tmpUrl, this._settings.unsavedQueryParams);\n return tmpUrl;\n }\n}\n"]}
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { AngleSweep, Range2d } from "@itwin/core-geometry";
|
|
5
5
|
import { MapTilingScheme } from "../internal";
|
|
6
|
+
/** The JSON representation of a [[QuadId]]
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface QuadIdProps {
|
|
10
|
+
/** The level of the node within the tree, increasing with each subdivision, as a non-negative integer. */
|
|
11
|
+
level: number;
|
|
12
|
+
/** The node's position along the X axis as a non-negative integer. */
|
|
13
|
+
column: number;
|
|
14
|
+
/** The node's position along the Y axis as a non-negative integer. */
|
|
15
|
+
row: number;
|
|
16
|
+
}
|
|
6
17
|
/** Identifies a node within a [quad tree](https://en.wikipedia.org/wiki/Quadtree), such as a [[MapTile]] within a [[MapTileTree]].
|
|
7
18
|
* A quad tree recursively sub-divides a two-dimensional space along the X and Y axes such that each node on level L has four child nodes on
|
|
8
19
|
* level L+1.
|
|
@@ -45,5 +56,9 @@ export declare class QuadId {
|
|
|
45
56
|
bordersNorthPole(mapTilingScheme: MapTilingScheme): boolean;
|
|
46
57
|
/** Compares this Id to another according to the conventions of an [OrderedComparator]($bentley). */
|
|
47
58
|
compare(other: QuadId): number;
|
|
59
|
+
/** Creates a QuadId from a JSON representation */
|
|
60
|
+
static fromJSON(props: QuadIdProps): QuadId;
|
|
61
|
+
/** Convert this QuadId to a JSON representation */
|
|
62
|
+
static toJSON(props: QuadIdProps): QuadIdProps;
|
|
48
63
|
}
|
|
49
64
|
//# sourceMappingURL=QuadId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuadId.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/QuadId.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAS,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAK9C;;;;GAIG;AACH,qBAAa,MAAM;IACjB,0GAA0G;IACnG,KAAK,EAAE,MAAM,CAAC;IACrB,sEAAsE;IAC/D,MAAM,EAAE,MAAM,CAAC;IACtB,sEAAsE;IAC/D,GAAG,EAAE,MAAM,CAAC;IAEnB,aAAa;IACb,IAAW,OAAO,YAEjB;IAED,aAAa;WACC,mBAAmB,CAAC,QAAQ,EAAE,MAAM;IASlD,aAAa;IACb,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,aAAa;WACC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAIlF,aAAa;IACb,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,mFAAmF;gBAChE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAM7D,yEAAyE;IAClE,WAAW,CAAC,WAAW,SAAI,EAAE,QAAQ,SAAI,GAAG,MAAM,EAAE;IAY3D,wHAAwH;IACjH,sBAAsB,CAAC,eAAe,EAAE,eAA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,IAAI,MAAM,CAE/B;IAED,mFAAmF;gBAChE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAM7D,yEAAyE;IAClE,WAAW,CAAC,WAAW,SAAI,EAAE,QAAQ,SAAI,GAAG,MAAM,EAAE;IAY3D,wHAAwH;IACjH,sBAAsB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO;IAIxE,wHAAwH;IACjH,sBAAsB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO;IAIxE,OAAO,CAAC,gBAAgB;IAYxB,aAAa;IACN,aAAa,CAAC,eAAe,EAAE,eAAe,GAAG;QAAE,SAAS,EAAE,UAAU,CAAC;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAE;IAYvG,wGAAwG;IACjG,gBAAgB,CAAC,eAAe,EAAE,eAAe;IAIxD,wGAAwG;IACjG,gBAAgB,CAAC,eAAe,EAAE,eAAe;IAIxD,oGAAoG;IAC7F,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAMrC,kDAAkD;WACpC,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;IAIhD,mDAAmD;WACvC,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;CAOtD"}
|
|
@@ -106,6 +106,18 @@ class QuadId {
|
|
|
106
106
|
(0, core_bentley_1.compareNumbers)(this.row, other.row) ||
|
|
107
107
|
(0, core_bentley_1.compareNumbers)(this.column, other.column);
|
|
108
108
|
}
|
|
109
|
+
/** Creates a QuadId from a JSON representation */
|
|
110
|
+
static fromJSON(props) {
|
|
111
|
+
return new QuadId(props.level, props.column, props.row);
|
|
112
|
+
}
|
|
113
|
+
/** Convert this QuadId to a JSON representation */
|
|
114
|
+
static toJSON(props) {
|
|
115
|
+
return {
|
|
116
|
+
level: props.level,
|
|
117
|
+
column: props.column,
|
|
118
|
+
row: props.row,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
109
121
|
}
|
|
110
122
|
exports.QuadId = QuadId;
|
|
111
123
|
//# sourceMappingURL=QuadId.js.map
|