@itwin/core-frontend 5.0.0-dev.111 → 5.0.0-dev.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/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/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/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/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/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/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/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/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/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/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/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/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TargetGraphics.js","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/TargetGraphics.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAM5D;;GAEG;AACH,MAAM,OAAO,cAAc;IAClB,UAAU,GAAgB,EAAE,CAAC;IAC7B,UAAU,GAAgB,EAAE,CAAC;IAC7B,QAAQ,GAAgB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"TargetGraphics.js","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/TargetGraphics.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAM5D;;GAEG;AACH,MAAM,OAAO,cAAc;IAClB,UAAU,GAAgB,EAAE,CAAC;IAC7B,UAAU,GAAgB,EAAE,CAAC;IAC7B,QAAQ,GAAgB,EAAE,CAAC;IAC3B,kBAAkB,GAAgB,EAAE,CAAC;IACrC,eAAe,GAAgB,EAAE,CAAC;IACjC,YAAY,CAAe;IAE5B,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QAE3E,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACtC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjD,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,MAAM;eAC5F,CAAC,KAAK,IAAI,CAAC,kBAAkB,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IACvG,CAAC;IAEM,WAAW,CAAC,KAAY;QAC7B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;IAChC,CAAC;IAEM,cAAc,CAAC,UAAmC,EAAE,OAAgC;QACzF,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACtC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEnC,IAAI,CAAC,kBAAkB,GAAG,UAAU,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,OAAO,IAAI,EAAE,CAAC;IACvC,CAAC;IAED,IAAW,WAAW,KAA8B,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/E,IAAW,WAAW,CAAC,WAAoC;QACzD,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,IAAW,iBAAiB;QAC1B,OAAO,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC;IAC9C,CAAC;CACF","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 WebGL\n */\n\nimport { dispose, disposeArray } from \"@itwin/core-bentley\";\nimport { GraphicList } from \"../../../render/RenderGraphic\";\nimport { Decorations } from \"../../../render/Decorations\";\nimport { CanvasDecorationList } from \"../../../render/CanvasDecoration\";\nimport { Scene } from \"../../../render/Scene\";\n\n/** The various graphics associated with a [[Target]].\n * @internal\n */\nexport class TargetGraphics {\n public foreground: GraphicList = [];\n public background: GraphicList = [];\n public overlays: GraphicList = [];\n public foregroundDynamics: GraphicList = [];\n public overlayDynamics: GraphicList = [];\n private _decorations?: Decorations;\n\n public [Symbol.dispose](): void {\n this.foreground.length = this.background.length = this.overlays.length = 0;\n\n disposeArray(this.foregroundDynamics);\n disposeArray(this.overlayDynamics);\n\n this._decorations = dispose(this._decorations);\n }\n\n public get isDisposed(): boolean {\n return 0 === this.foreground.length && 0 === this.background.length && 0 === this.overlays.length\n && 0 === this.foregroundDynamics.length && 0 === this.overlayDynamics.length && !this._decorations;\n }\n\n public changeScene(scene: Scene): void {\n this.foreground = scene.foreground;\n this.background = scene.background;\n this.overlays = scene.overlay;\n }\n\n public changeDynamics(foreground: GraphicList | undefined, overlay: GraphicList | undefined) {\n disposeArray(this.foregroundDynamics);\n disposeArray(this.overlayDynamics);\n\n this.foregroundDynamics = foreground ?? [];\n this.overlayDynamics = overlay ?? [];\n }\n\n public get decorations(): Decorations | undefined { return this._decorations; }\n public set decorations(decorations: Decorations | undefined) {\n dispose(this._decorations);\n this._decorations = decorations;\n }\n\n public get canvasDecorations(): CanvasDecorationList | undefined {\n return this._decorations?.canvasDecorations;\n }\n}\n"]}
|
|
@@ -82,7 +82,7 @@ export declare abstract class RenderTarget implements Disposable, RenderMemory.C
|
|
|
82
82
|
/** @internal */
|
|
83
83
|
abstract changeScene(scene: Scene): void;
|
|
84
84
|
/** @internal */
|
|
85
|
-
abstract changeDynamics(
|
|
85
|
+
abstract changeDynamics(foreground: GraphicList | undefined, overlay: GraphicList | undefined): void;
|
|
86
86
|
/** @internal */
|
|
87
87
|
abstract changeDecorations(decorations: Decorations): void;
|
|
88
88
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderTarget.d.ts","sourceRoot":"","sources":["../../../src/render/RenderTarget.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3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B;IACT,KAAK,CAAC,uBAAiC,IAAU,CAAC;IAWzD,gBAAgB;IACT,wBAAwB,CAAC,IAAgC,IAAU,CAAC;IAC3E,gBAAgB;IACT,YAAY,CAAC,QAAmB,IAAU,CAAC;IAClD,gBAAgB;IACT,UAAU,CAAC,UAAsB,EAAE,UAAkB,IAAU,CAAC;IACvE,gBAAgB;IACT,cAAc,CAAC,SAAmB,EAAE,mBAA8C,IAAU,CAAC;IAGpG,gBAAgB;IACT,SAAS,KAAW,CAAC;IAM5B,gBAAgB;IACT,eAAe,CAAC,KAA2B,IAA6B,OAAO,SAAS,CAAC,CAAC,CAAC;IAClG,gBAAgB;IACT,iBAAiB,CAAC,cAAkC,IAAuB,OAAO,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5H,gBAAgB;IACT,iBAAiB,CAAC,MAA+B,IAAU,CAAC;IAEnE;;;OAGG;IACH,gBAAgB;IACT,iBAAiB,CAAC,SAAkB,IAAmC,OAAO,SAAS,CAAC,CAAC,CAAC;IAEjG,gBAAgB;IAChB,IAAW,YAAY,KAA2C,OAAO,SAAS,CAAC,CAAC,CAAC;IAWrF;;OAEG;IACH,gBAAgB;IACT,wBAAwB,CAAC,QAAkC,EAAE,OAAyB,EAAE,QAAsC;QACnI,QAAQ,CAAC,EAAE,CAAC,CAAC;IACf,CAAC;CACF","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 Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { ImageBuffer } from \"@itwin/core-common\";\nimport { XAndY } from \"@itwin/core-geometry\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { HiliteSet } from \"../SelectionSet\";\nimport { SceneContext } from \"../ViewContext\";\nimport { ReadImageBufferArgs, Viewport } from \"../Viewport\";\nimport { ViewRect } from \"../common/ViewRect\";\nimport { CanvasDecoration } from \"./CanvasDecoration\";\nimport { Decorations } from \"./Decorations\";\nimport { FeatureSymbology } from \"./FeatureSymbology\";\nimport { FrameStatsCollector } from \"../internal/render/FrameStatsCollector\";\nimport { AnimationBranchStates } from \"../internal/render/AnimationBranchState\";\nimport { CustomGraphicBuilderOptions, ViewportGraphicBuilderOptions } from \"./GraphicBuilder\";\nimport { Pixel } from \"./Pixel\";\nimport { GraphicList } from \"./RenderGraphic\";\nimport { RenderMemory } from \"./RenderMemory\";\nimport { RenderPlan } from \"../internal/render/RenderPlan\";\nimport { RenderPlanarClassifier } from \"../internal/render/RenderPlanarClassifier\";\nimport { RenderSystem, } from \"./RenderSystem\";\nimport { Scene } from \"./Scene\";\nimport { QueryTileFeaturesOptions, QueryVisibleFeaturesCallback } from \"./VisibleFeature\";\nimport { ActiveSpatialClassifier } from \"../SpatialClassifiersState\";\nimport { _implementationProhibited } from \"../common/internal/Symbols\";\nimport { RenderTextureDrape } from \"../internal/render/RenderTextureDrape\";\nimport { RenderTargetDebugControl } from \"../internal/render/RenderTargetDebugControl\";\n\n/** Connects a [[Viewport]] to a graphics renderer such as a [WebGLRenderingContext](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext)\n * to enable the viewport's contents to be rendered to the screen or to an off-screen buffer.\n * Application code never interacts directly with a `RenderTarget` - it interacts with the `Viewport`'s API which forwards requests to the `RenderTarget`.\n * @public\n */\nexport abstract class RenderTarget implements Disposable, RenderMemory.Consumer {\n /** @internal */\n protected abstract readonly [_implementationProhibited]: unknown;\n\n /** @internal */\n public pickOverlayDecoration(_pt: XAndY): CanvasDecoration | undefined { return undefined; }\n\n /** @internal */\n public abstract get renderSystem(): RenderSystem;\n\n /** NB: *Device pixels*, not CSS pixels! */\n /** @internal */\n public abstract get viewRect(): ViewRect;\n\n /** @internal */\n public get devicePixelRatio(): number { return 1; }\n /** @internal */\n public cssPixelsToDevicePixels(cssPixels: number, floor = true): number {\n const pix = cssPixels * this.devicePixelRatio;\n return floor ? Math.floor(pix) : pix;\n }\n\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\n * Used when computing LOD for graphics.\n */\n /** @internal */\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\n return this.renderSystem.dpiAwareLOD ? this.cssPixelsToDevicePixels(cssPixelSize, false) : cssPixelSize;\n }\n\n /** @internal */\n public abstract get wantInvertBlackBackground(): boolean;\n\n /** @internal */\n public abstract get analysisFraction(): number;\n public abstract set analysisFraction(fraction: number);\n\n /** @internal */\n public get animationBranches(): AnimationBranchStates | undefined { return undefined; }\n public set animationBranches(_transforms: AnimationBranchStates | undefined) { }\n\n /** @internal */\n public get antialiasSamples(): number { return 1; }\n public set antialiasSamples(_numSamples: number) { }\n\n /** @internal */\n public assignFrameStatsCollector(_collector: FrameStatsCollector) { }\n\n /** Update the solar shadow map. If a SceneContext is supplied, shadows are enabled; otherwise, shadows are disabled. */\n /** @internal */\n public updateSolarShadows(_context: SceneContext | undefined): void { }\n /** @internal */\n public getPlanarClassifier(_id: string): RenderPlanarClassifier | undefined { return undefined; }\n /** @internal */\n public createPlanarClassifier(_properties?: ActiveSpatialClassifier): RenderPlanarClassifier | undefined { return undefined; }\n /** @internal */\n public getTextureDrape(_id: Id64String): RenderTextureDrape | undefined { return undefined; }\n\n /** @internal */\n public createGraphicBuilder(options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions) {\n return this.renderSystem.createGraphic(options);\n }\n\n /** @internal */\n public [Symbol.dispose](): void { }\n /** @internal */\n public reset(_realityMapLayerChanged?: boolean): void { }\n /** @internal */\n public abstract changeScene(scene: Scene): void;\n /** @internal */\n public abstract changeDynamics(dynamics?: GraphicList): void;\n /** @internal */\n public abstract changeDecorations(decorations: Decorations): void;\n /** @internal */\n public abstract changeRenderPlan(plan: RenderPlan): void;\n /** @internal */\n public abstract drawFrame(sceneMilSecElapsed?: number): void;\n /** @internal */\n public overrideFeatureSymbology(_ovr: FeatureSymbology.Overrides): void { }\n /** @internal */\n public setHiliteSet(_hilited: HiliteSet): void { }\n /** @internal */\n public setFlashed(_elementId: Id64String, _intensity: number): void { }\n /** @internal */\n public onBeforeRender(_viewport: Viewport, _setSceneNeedRedraw: (redraw: boolean) => void): void { }\n /** @internal */\n public abstract setViewRect(_rect: ViewRect, _temporary: boolean): void;\n /** @internal */\n public onResized(): void { }\n /** @internal */\n public abstract updateViewRect(): boolean; // force a RenderTarget viewRect to resize if necessary since last draw\n /** `rect` is specified in *CSS* pixels. */\n /** @internal */\n public abstract readPixels(rect: ViewRect, selector: Pixel.Selector, receiver: Pixel.Receiver, excludeNonLocatable: boolean, excludedElements?: Iterable<Id64String>): void;\n /** @internal */\n public readImageBuffer(_args?: ReadImageBufferArgs): ImageBuffer | undefined { return undefined; }\n /** @internal */\n public readImageToCanvas(_overlayCanvas?: HTMLCanvasElement): HTMLCanvasElement { return document.createElement(\"canvas\"); }\n /** @internal */\n public collectStatistics(_stats: RenderMemory.Statistics): void { }\n\n /** Specify whether webgl content should be rendered directly to the screen.\n * If rendering to screen becomes enabled, returns the canvas to which to render the webgl content.\n * Returns undefined if rendering to screen becomes disabled, or is not supported by this RenderTarget.\n */\n /** @internal */\n public setRenderToScreen(_toScreen: boolean): HTMLCanvasElement | undefined { return undefined; }\n\n /** @internal */\n public get debugControl(): RenderTargetDebugControl | undefined { return undefined; }\n\n /** An ordered list of names of screen-space post-processing effects to be applied to the image produced by this target.\n * The effects are applied in the order in which they appear in the list. Any names not corresponding to a registered effect are ignored.\n * This may have no effect if this target does not support screen-space effects.\n * @see [[RenderSystem.createScreenSpaceEffectBuilder]] to create and register new effects.\n */\n /** @internal */\n public abstract get screenSpaceEffects(): Iterable<string>;\n public abstract set screenSpaceEffects(_effectNames: Iterable<string>);\n\n /** Implementation for [[Viewport.queryVisibleFeatures]]. Not intended for direct usage. The returned iterable remains valid only for the duration of the\n * Viewport.queryVisibleFeatures call.\n */\n /** @internal */\n public queryVisibleTileFeatures(_options: QueryTileFeaturesOptions, _iModel: IModelConnection, callback: QueryVisibleFeaturesCallback): void {\n callback([]);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RenderTarget.js","sourceRoot":"","sources":["../../../src/render/RenderTarget.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAyBH,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAIvE;;;;GAIG;AACH,MAAM,OAAgB,YAAY;IAIhC,gBAAgB;IACT,qBAAqB,CAAC,GAAU,IAAkC,OAAO,SAAS,CAAC,CAAC,CAAC;IAS5F,gBAAgB;IAChB,IAAW,gBAAgB,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,gBAAgB;IACT,uBAAuB,CAAC,SAAiB,EAAE,KAAK,GAAG,IAAI;QAC5D,MAAM,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC9C,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,gBAAgB;IACT,qBAAqB,CAAC,YAAoB;QAC/C,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAC1G,CAAC;IASD,gBAAgB;IAChB,IAAW,iBAAiB,KAAwC,OAAO,SAAS,CAAC,CAAC,CAAC;IACvF,IAAW,iBAAiB,CAAC,WAA8C,IAAI,CAAC;IAEhF,gBAAgB;IAChB,IAAW,gBAAgB,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,IAAW,gBAAgB,CAAC,WAAmB,IAAI,CAAC;IAEpD,gBAAgB;IACT,yBAAyB,CAAC,UAA+B,IAAI,CAAC;IAErE,wHAAwH;IAC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B,CAAC,QAAkC,EAAE,OAAyB,EAAE,QAAsC;QACnI,QAAQ,CAAC,EAAE,CAAC,CAAC;IACf,CAAC;CACF","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 Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { ImageBuffer } from \"@itwin/core-common\";\nimport { XAndY } from \"@itwin/core-geometry\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { HiliteSet } from \"../SelectionSet\";\nimport { SceneContext } from \"../ViewContext\";\nimport { ReadImageBufferArgs, Viewport } from \"../Viewport\";\nimport { ViewRect } from \"../common/ViewRect\";\nimport { CanvasDecoration } from \"./CanvasDecoration\";\nimport { Decorations } from \"./Decorations\";\nimport { FeatureSymbology } from \"./FeatureSymbology\";\nimport { FrameStatsCollector } from \"../internal/render/FrameStatsCollector\";\nimport { AnimationBranchStates } from \"../internal/render/AnimationBranchState\";\nimport { CustomGraphicBuilderOptions, ViewportGraphicBuilderOptions } from \"./GraphicBuilder\";\nimport { Pixel } from \"./Pixel\";\nimport { GraphicList } from \"./RenderGraphic\";\nimport { RenderMemory } from \"./RenderMemory\";\nimport { RenderPlan } from \"../internal/render/RenderPlan\";\nimport { RenderPlanarClassifier } from \"../internal/render/RenderPlanarClassifier\";\nimport { RenderSystem, } from \"./RenderSystem\";\nimport { Scene } from \"./Scene\";\nimport { QueryTileFeaturesOptions, QueryVisibleFeaturesCallback } from \"./VisibleFeature\";\nimport { ActiveSpatialClassifier } from \"../SpatialClassifiersState\";\nimport { _implementationProhibited } from \"../common/internal/Symbols\";\nimport { RenderTextureDrape } from \"../internal/render/RenderTextureDrape\";\nimport { RenderTargetDebugControl } from \"../internal/render/RenderTargetDebugControl\";\n\n/** Connects a [[Viewport]] to a graphics renderer such as a [WebGLRenderingContext](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext)\n * to enable the viewport's contents to be rendered to the screen or to an off-screen buffer.\n * Application code never interacts directly with a `RenderTarget` - it interacts with the `Viewport`'s API which forwards requests to the `RenderTarget`.\n * @public\n */\nexport abstract class RenderTarget implements Disposable, RenderMemory.Consumer {\n /** @internal */\n protected abstract readonly [_implementationProhibited]: unknown;\n\n /** @internal */\n public pickOverlayDecoration(_pt: XAndY): CanvasDecoration | undefined { return undefined; }\n\n /** @internal */\n public abstract get renderSystem(): RenderSystem;\n\n /** NB: *Device pixels*, not CSS pixels! */\n /** @internal */\n public abstract get viewRect(): ViewRect;\n\n /** @internal */\n public get devicePixelRatio(): number { return 1; }\n /** @internal */\n public cssPixelsToDevicePixels(cssPixels: number, floor = true): number {\n const pix = cssPixels * this.devicePixelRatio;\n return floor ? Math.floor(pix) : pix;\n }\n\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\n * Used when computing LOD for graphics.\n */\n /** @internal */\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\n return this.renderSystem.dpiAwareLOD ? this.cssPixelsToDevicePixels(cssPixelSize, false) : cssPixelSize;\n }\n\n /** @internal */\n public abstract get wantInvertBlackBackground(): boolean;\n\n /** @internal */\n public abstract get analysisFraction(): number;\n public abstract set analysisFraction(fraction: number);\n\n /** @internal */\n public get animationBranches(): AnimationBranchStates | undefined { return undefined; }\n public set animationBranches(_transforms: AnimationBranchStates | undefined) { }\n\n /** @internal */\n public get antialiasSamples(): number { return 1; }\n public set antialiasSamples(_numSamples: number) { }\n\n /** @internal */\n public assignFrameStatsCollector(_collector: FrameStatsCollector) { }\n\n /** Update the solar shadow map. If a SceneContext is supplied, shadows are enabled; otherwise, shadows are disabled. */\n /** @internal */\n public updateSolarShadows(_context: SceneContext | undefined): void { }\n /** @internal */\n public getPlanarClassifier(_id: string): RenderPlanarClassifier | undefined { return undefined; }\n /** @internal */\n public createPlanarClassifier(_properties?: ActiveSpatialClassifier): RenderPlanarClassifier | undefined { return undefined; }\n /** @internal */\n public getTextureDrape(_id: Id64String): RenderTextureDrape | undefined { return undefined; }\n\n /** @internal */\n public createGraphicBuilder(options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions) {\n return this.renderSystem.createGraphic(options);\n }\n\n /** @internal */\n public [Symbol.dispose](): void { }\n /** @internal */\n public reset(_realityMapLayerChanged?: boolean): void { }\n /** @internal */\n public abstract changeScene(scene: Scene): void;\n /** @internal */\n public abstract changeDynamics(foreground: GraphicList | undefined, overlay: GraphicList | undefined): void;\n /** @internal */\n public abstract changeDecorations(decorations: Decorations): void;\n /** @internal */\n public abstract changeRenderPlan(plan: RenderPlan): void;\n /** @internal */\n public abstract drawFrame(sceneMilSecElapsed?: number): void;\n /** @internal */\n public overrideFeatureSymbology(_ovr: FeatureSymbology.Overrides): void { }\n /** @internal */\n public setHiliteSet(_hilited: HiliteSet): void { }\n /** @internal */\n public setFlashed(_elementId: Id64String, _intensity: number): void { }\n /** @internal */\n public onBeforeRender(_viewport: Viewport, _setSceneNeedRedraw: (redraw: boolean) => void): void { }\n /** @internal */\n public abstract setViewRect(_rect: ViewRect, _temporary: boolean): void;\n /** @internal */\n public onResized(): void { }\n /** @internal */\n public abstract updateViewRect(): boolean; // force a RenderTarget viewRect to resize if necessary since last draw\n /** `rect` is specified in *CSS* pixels. */\n /** @internal */\n public abstract readPixels(rect: ViewRect, selector: Pixel.Selector, receiver: Pixel.Receiver, excludeNonLocatable: boolean, excludedElements?: Iterable<Id64String>): void;\n /** @internal */\n public readImageBuffer(_args?: ReadImageBufferArgs): ImageBuffer | undefined { return undefined; }\n /** @internal */\n public readImageToCanvas(_overlayCanvas?: HTMLCanvasElement): HTMLCanvasElement { return document.createElement(\"canvas\"); }\n /** @internal */\n public collectStatistics(_stats: RenderMemory.Statistics): void { }\n\n /** Specify whether webgl content should be rendered directly to the screen.\n * If rendering to screen becomes enabled, returns the canvas to which to render the webgl content.\n * Returns undefined if rendering to screen becomes disabled, or is not supported by this RenderTarget.\n */\n /** @internal */\n public setRenderToScreen(_toScreen: boolean): HTMLCanvasElement | undefined { return undefined; }\n\n /** @internal */\n public get debugControl(): RenderTargetDebugControl | undefined { return undefined; }\n\n /** An ordered list of names of screen-space post-processing effects to be applied to the image produced by this target.\n * The effects are applied in the order in which they appear in the list. Any names not corresponding to a registered effect are ignored.\n * This may have no effect if this target does not support screen-space effects.\n * @see [[RenderSystem.createScreenSpaceEffectBuilder]] to create and register new effects.\n */\n /** @internal */\n public abstract get screenSpaceEffects(): Iterable<string>;\n public abstract set screenSpaceEffects(_effectNames: Iterable<string>);\n\n /** Implementation for [[Viewport.queryVisibleFeatures]]. Not intended for direct usage. The returned iterable remains valid only for the duration of the\n * Viewport.queryVisibleFeatures call.\n */\n /** @internal */\n public queryVisibleTileFeatures(_options: QueryTileFeaturesOptions, _iModel: IModelConnection, callback: QueryVisibleFeaturesCallback): void {\n callback([]);\n }\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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class MapCartoRectangle extends Range2d {
|
|
|
142
142
|
scratchMercatorFractionRange.high.y = tilingScheme.latitudeToYFraction(this.high.y);
|
|
143
143
|
return scratchMercatorFractionRange;
|
|
144
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Compute rectangle with angles specified in degrees.
|
|
147
|
+
* @beta
|
|
148
|
+
*/
|
|
149
|
+
toDegrees() {
|
|
150
|
+
return {
|
|
151
|
+
north: Angle.radiansToDegrees(this.north),
|
|
152
|
+
south: Angle.radiansToDegrees(this.south),
|
|
153
|
+
east: Angle.radiansToDegrees(this.east),
|
|
154
|
+
west: Angle.radiansToDegrees(this.west),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
145
157
|
}
|
|
146
158
|
//# 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,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,MAAM,4BAA4B,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;AAC1D,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO;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,i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EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,gBAAgB;IACT,oBAAoB,CAAC,YAA6B;QACvD,4BAA4B,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACnF,4BAA4B,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC,oBAAoB,CAAC,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","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,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,MAAM,4BAA4B,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;AAC1D,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO;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;I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,cAAc,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,gBAAgB;IACT,oBAAoB,CAAC,YAA6B;QACvD,4BAA4B,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACnF,4BAA4B,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC,oBAAoB,CAAC,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;IAEA;;;MAGE;IACM,SAAS;QACd,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;YACzC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;YACzC,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;YACvC,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;SACxC,CAAA;IACH,CAAC;CAGJ","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,S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,GAAG,MAAM;IAK7C;;;;OAIG;IACI,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI5C;;;;OAIG;IACI,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK5C;;;;;;;;OAQG;IACI,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW;IAkBrF;;;;;;OAMG;IACI,iBAAiB,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"}
|
|
@@ -204,7 +204,7 @@ export class MapLayerImageryProvider {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
/** @internal */
|
|
207
|
-
async makeTileRequest(url, timeoutMs) {
|
|
207
|
+
async makeTileRequest(url, timeoutMs, authorization) {
|
|
208
208
|
// We want to complete the first request before letting other requests go;
|
|
209
209
|
// this done to avoid flooding server with requests missing credentials
|
|
210
210
|
if (!this._firstRequestPromise)
|
|
@@ -213,7 +213,7 @@ export class MapLayerImageryProvider {
|
|
|
213
213
|
await this._firstRequestPromise;
|
|
214
214
|
let response;
|
|
215
215
|
try {
|
|
216
|
-
response = await this.makeRequest(url, timeoutMs);
|
|
216
|
+
response = await this.makeRequest(url, timeoutMs, authorization);
|
|
217
217
|
}
|
|
218
218
|
finally {
|
|
219
219
|
this.onFirstRequestCompleted.raiseEvent();
|
|
@@ -223,11 +223,15 @@ export class MapLayerImageryProvider {
|
|
|
223
223
|
return response;
|
|
224
224
|
}
|
|
225
225
|
/** @internal */
|
|
226
|
-
async makeRequest(url, timeoutMs) {
|
|
226
|
+
async makeRequest(url, timeoutMs, authorization) {
|
|
227
227
|
let response;
|
|
228
228
|
let headers;
|
|
229
229
|
let hasCreds = false;
|
|
230
|
-
if (
|
|
230
|
+
if (authorization) {
|
|
231
|
+
headers = new Headers();
|
|
232
|
+
headers.set("Authorization", authorization);
|
|
233
|
+
}
|
|
234
|
+
else if (this._settings.userName && this._settings.password) {
|
|
231
235
|
hasCreds = true;
|
|
232
236
|
headers = new Headers();
|
|
233
237
|
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,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAuC,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzG,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAExF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAA8H,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE7N,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAA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AC,IAAI,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACvK,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACvK,CAAC;IACH,CAAC;IAED;;OAEG;IACO,kBAAkB,CAAC,GAAW;QACtC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB;YACxE,OAAO,GAAG,CAAC;QAEb,IAAI,MAAM,GAAG,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACrE,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","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,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAuC,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzG,OAAO,EAAE,KAAK,EAAE,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C,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","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.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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"}
|
|
@@ -103,5 +103,17 @@ export class QuadId {
|
|
|
103
103
|
compareNumbers(this.row, other.row) ||
|
|
104
104
|
compareNumbers(this.column, other.column);
|
|
105
105
|
}
|
|
106
|
+
/** Creates a QuadId from a JSON representation */
|
|
107
|
+
static fromJSON(props) {
|
|
108
|
+
return new QuadId(props.level, props.column, props.row);
|
|
109
|
+
}
|
|
110
|
+
/** Convert this QuadId to a JSON representation */
|
|
111
|
+
static toJSON(props) {
|
|
112
|
+
return {
|
|
113
|
+
level: props.level,
|
|
114
|
+
column: props.column,
|
|
115
|
+
row: props.row,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
106
118
|
}
|
|
107
119
|
//# sourceMappingURL=QuadId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuadId.js","sourceRoot":"","sources":["../../../../src/tile/map/QuadId.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAA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,oBAAoB,CAAC,QAAQ,CAAC,CACnF;SACF,CAAC;IACJ,CAAC;IAED,wGAAwG;IACjG,gBAAgB,CAAC,eAAgC;QACtD,OAAO,eAAe,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,wGAAwG;IACjG,gBAAgB,CAAC,eAAgC;QACtD,OAAO,eAAe,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,oGAAoG;IAC7F,OAAO,CAAC,KAAa;QAC1B,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;YAC5C,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;YACnC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;CACF","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 { assert, compareNumbers } from \"@itwin/core-bentley\";\nimport { Angle, AngleSweep, Range2d } from \"@itwin/core-geometry\";\nimport { Cartographic } from \"@itwin/core-common\";\nimport { MapTilingScheme } from \"../internal\";\n\nconst scratchCartographic1 = Cartographic.createZero();\nconst scratchCartographic2 = Cartographic.createZero();\n\n/** Identifies a node within a [quad tree](https://en.wikipedia.org/wiki/Quadtree), such as a [[MapTile]] within a [[MapTileTree]].\n * 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\n * level L+1.\n * @public\n */\nexport class QuadId {\n /** The level of the node within the tree, increasing with each subdivision, as a non-negative integer. */\n public level: number;\n /** The node's position along the X axis as a non-negative integer. */\n public column: number;\n /** The node's position along the Y axis as a non-negative integer. */\n public row: number;\n\n /** @alpha */\n public get isValid() {\n return this.level >= 0;\n }\n\n /** @alpha */\n public static createFromContentId(stringId: string) {\n const idParts = stringId.split(\"_\");\n assert(idParts.length === 3);\n if (3 !== idParts.length)\n return new QuadId(-1, -1, -1);\n\n return new QuadId(parseInt(idParts[0], 10), parseInt(idParts[1], 10), parseInt(idParts[2], 10));\n }\n\n /** @alpha */\n public get contentId(): string {\n return QuadId.getTileContentId(this.level, this.column, this.row);\n }\n\n /** @alpha */\n public static getTileContentId(level: number, column: number, row: number): string {\n return `${level}_${column}_${row}`;\n }\n\n /** @alpha */\n public get debugString(): string {\n return `Level: ${this.level} Column: ${this.column} Row: ${this.row}`;\n }\n\n /** Construct a new QuadId. The inputs are expected to be non-negative integers. */\n public constructor(level: number, column: number, row: number) {\n this.level = level;\n this.column = column;\n this.row = row;\n }\n\n /** Compute the QuadIds corresponding to this node's four child nodes. */\n public getChildIds(columnCount = 2, rowCount = 2): QuadId[] {\n const childIds = [];\n const level = this.level + 1;\n const column = this.column * 2;\n const row = this.row * 2;\n for (let j = 0; j < rowCount; j++)\n for (let i = 0; i < columnCount; i++)\n childIds.push(new QuadId(level, column + i, row + j));\n\n return childIds;\n }\n\n /** Compute the region of the surface of the Earth represented by this node according to the specified tiling scheme. */\n public getLatLongRangeDegrees(mapTilingScheme: MapTilingScheme): Range2d {\n return this._getLatLongRange(mapTilingScheme, \"degrees\");\n }\n\n /** Compute the region of the surface of the Earth represented by this node according to the specified tiling scheme. */\n public getLatLongRangeRadians(mapTilingScheme: MapTilingScheme): Range2d {\n return this._getLatLongRange(mapTilingScheme, \"radians\");\n }\n\n private _getLatLongRange(mapTilingScheme: MapTilingScheme, units: \"radians\" | \"degrees\"): Range2d {\n const range = Range2d.createNull();\n const factor = \"degrees\" === units ? Angle.degreesPerRadian : 1;\n\n mapTilingScheme.tileXYToCartographic(this.column, this.row, this.level, scratchCartographic1);\n range.extendXY(scratchCartographic1.longitude * factor, scratchCartographic1.latitude * factor);\n mapTilingScheme.tileXYToCartographic(this.column + 1, this.row + 1, this.level, scratchCartographic2);\n range.extendXY(scratchCartographic2.longitude * factor, scratchCartographic2.latitude * factor);\n\n return range;\n }\n\n /** @alpha */\n public getAngleSweep(mapTilingScheme: MapTilingScheme): { longitude: AngleSweep, latitude: AngleSweep } {\n mapTilingScheme.tileXYToCartographic(this.column, this.row, this.level, scratchCartographic1);\n mapTilingScheme.tileXYToCartographic(this.column + 1, this.row + 1, this.level, scratchCartographic2);\n return {\n longitude: AngleSweep.createStartEndRadians(scratchCartographic1.longitude, scratchCartographic2.longitude),\n latitude: AngleSweep.createStartEndRadians(\n Cartographic.parametricLatitudeFromGeodeticLatitude(scratchCartographic1.latitude),\n Cartographic.parametricLatitudeFromGeodeticLatitude(scratchCartographic2.latitude),\n ),\n };\n }\n\n /** Returns true if this node is adjacent to the south pole according to the specified tiling scheme. */\n public bordersSouthPole(mapTilingScheme: MapTilingScheme) {\n return mapTilingScheme.tileBordersSouthPole(this.row, this.level);\n }\n\n /** Returns true if this node is adjacent to the north pole according to the specified tiling scheme. */\n public bordersNorthPole(mapTilingScheme: MapTilingScheme) {\n return mapTilingScheme.tileBordersNorthPole(this.row, this.level);\n }\n\n /** Compares this Id to another according to the conventions of an [OrderedComparator]($bentley). */\n public compare(other: QuadId): number {\n return compareNumbers(this.level, other.level) ||\n compareNumbers(this.row, other.row) ||\n compareNumbers(this.column, other.column);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"QuadId.js","sourceRoot":"","sources":["../../../../src/tile/map/QuadId.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,oBAAoB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ACnF;SACF,CAAC;IACJ,CAAC;IAED,wGAAwG;IACjG,gBAAgB,CAAC,eAAgC;QACtD,OAAO,eAAe,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,wGAAwG;IACjG,gBAAgB,CAAC,eAAgC;QACtD,OAAO,eAAe,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,oGAAoG;IAC7F,OAAO,CAAC,KAAa;QAC1B,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;YAC5C,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;YACnC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,kDAAkD;IAC3C,MAAM,CAAC,QAAQ,CAAC,KAAkB;QACvC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;IAEC,mDAAmD;IAC9C,MAAM,CAAC,MAAM,CAAC,KAAkB;QACrC,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,GAAG,EAAE,KAAK,CAAC,GAAG;SACf,CAAC;IACJ,CAAC;CACF","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 { assert, compareNumbers } from \"@itwin/core-bentley\";\nimport { Angle, AngleSweep, Range2d } from \"@itwin/core-geometry\";\nimport { Cartographic } from \"@itwin/core-common\";\nimport { MapTilingScheme } from \"../internal\";\n\nconst scratchCartographic1 = Cartographic.createZero();\nconst scratchCartographic2 = Cartographic.createZero();\n\n/** The JSON representation of a [[QuadId]]\n * @public\n */\nexport interface QuadIdProps {\n /** The level of the node within the tree, increasing with each subdivision, as a non-negative integer. */\n level: number;\n /** The node's position along the X axis as a non-negative integer. */\n column: number;\n /** The node's position along the Y axis as a non-negative integer. */\n row: number;\n}\n\n/** Identifies a node within a [quad tree](https://en.wikipedia.org/wiki/Quadtree), such as a [[MapTile]] within a [[MapTileTree]].\n * 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\n * level L+1.\n * @public\n */\nexport class QuadId {\n /** The level of the node within the tree, increasing with each subdivision, as a non-negative integer. */\n public level: number;\n /** The node's position along the X axis as a non-negative integer. */\n public column: number;\n /** The node's position along the Y axis as a non-negative integer. */\n public row: number;\n\n /** @alpha */\n public get isValid() {\n return this.level >= 0;\n }\n\n /** @alpha */\n public static createFromContentId(stringId: string) {\n const idParts = stringId.split(\"_\");\n assert(idParts.length === 3);\n if (3 !== idParts.length)\n return new QuadId(-1, -1, -1);\n\n return new QuadId(parseInt(idParts[0], 10), parseInt(idParts[1], 10), parseInt(idParts[2], 10));\n }\n\n /** @alpha */\n public get contentId(): string {\n return QuadId.getTileContentId(this.level, this.column, this.row);\n }\n\n /** @alpha */\n public static getTileContentId(level: number, column: number, row: number): string {\n return `${level}_${column}_${row}`;\n }\n\n /** @alpha */\n public get debugString(): string {\n return `Level: ${this.level} Column: ${this.column} Row: ${this.row}`;\n }\n\n /** Construct a new QuadId. The inputs are expected to be non-negative integers. */\n public constructor(level: number, column: number, row: number) {\n this.level = level;\n this.column = column;\n this.row = row;\n }\n\n /** Compute the QuadIds corresponding to this node's four child nodes. */\n public getChildIds(columnCount = 2, rowCount = 2): QuadId[] {\n const childIds = [];\n const level = this.level + 1;\n const column = this.column * 2;\n const row = this.row * 2;\n for (let j = 0; j < rowCount; j++)\n for (let i = 0; i < columnCount; i++)\n childIds.push(new QuadId(level, column + i, row + j));\n\n return childIds;\n }\n\n /** Compute the region of the surface of the Earth represented by this node according to the specified tiling scheme. */\n public getLatLongRangeDegrees(mapTilingScheme: MapTilingScheme): Range2d {\n return this._getLatLongRange(mapTilingScheme, \"degrees\");\n }\n\n /** Compute the region of the surface of the Earth represented by this node according to the specified tiling scheme. */\n public getLatLongRangeRadians(mapTilingScheme: MapTilingScheme): Range2d {\n return this._getLatLongRange(mapTilingScheme, \"radians\");\n }\n\n private _getLatLongRange(mapTilingScheme: MapTilingScheme, units: \"radians\" | \"degrees\"): Range2d {\n const range = Range2d.createNull();\n const factor = \"degrees\" === units ? Angle.degreesPerRadian : 1;\n\n mapTilingScheme.tileXYToCartographic(this.column, this.row, this.level, scratchCartographic1);\n range.extendXY(scratchCartographic1.longitude * factor, scratchCartographic1.latitude * factor);\n mapTilingScheme.tileXYToCartographic(this.column + 1, this.row + 1, this.level, scratchCartographic2);\n range.extendXY(scratchCartographic2.longitude * factor, scratchCartographic2.latitude * factor);\n\n return range;\n }\n\n /** @alpha */\n public getAngleSweep(mapTilingScheme: MapTilingScheme): { longitude: AngleSweep, latitude: AngleSweep } {\n mapTilingScheme.tileXYToCartographic(this.column, this.row, this.level, scratchCartographic1);\n mapTilingScheme.tileXYToCartographic(this.column + 1, this.row + 1, this.level, scratchCartographic2);\n return {\n longitude: AngleSweep.createStartEndRadians(scratchCartographic1.longitude, scratchCartographic2.longitude),\n latitude: AngleSweep.createStartEndRadians(\n Cartographic.parametricLatitudeFromGeodeticLatitude(scratchCartographic1.latitude),\n Cartographic.parametricLatitudeFromGeodeticLatitude(scratchCartographic2.latitude),\n ),\n };\n }\n\n /** Returns true if this node is adjacent to the south pole according to the specified tiling scheme. */\n public bordersSouthPole(mapTilingScheme: MapTilingScheme) {\n return mapTilingScheme.tileBordersSouthPole(this.row, this.level);\n }\n\n /** Returns true if this node is adjacent to the north pole according to the specified tiling scheme. */\n public bordersNorthPole(mapTilingScheme: MapTilingScheme) {\n return mapTilingScheme.tileBordersNorthPole(this.row, this.level);\n }\n\n /** Compares this Id to another according to the conventions of an [OrderedComparator]($bentley). */\n public compare(other: QuadId): number {\n return compareNumbers(this.level, other.level) ||\n compareNumbers(this.row, other.row) ||\n compareNumbers(this.column, other.column);\n }\n\n /** Creates a QuadId from a JSON representation */\n public static fromJSON(props: QuadIdProps): QuadId {\n return new QuadId(props.level, props.column, props.row);\n }\n\n /** Convert this QuadId to a JSON representation */\n public static toJSON(props: QuadIdProps): QuadIdProps {\n return {\n level: props.level,\n column: props.column,\n row: props.row,\n };\n }\n}\n"]}
|
|
@@ -99,6 +99,10 @@ export declare class AccuDrawViewportUI extends AccuDraw {
|
|
|
99
99
|
private initializeItemStyle;
|
|
100
100
|
private createItemField;
|
|
101
101
|
private createItemFieldLock;
|
|
102
|
+
/** Called after the controls have been removed from the view. */
|
|
103
|
+
protected removedControlRect(): void;
|
|
104
|
+
/** Called after the position of the controls in the supplied view is updated. */
|
|
105
|
+
protected changedControlRect(_rect: ViewRect, _vp: ScreenViewport): void;
|
|
102
106
|
/** Use to override the position of the controls in the supplied view. */
|
|
103
107
|
protected modifyControlRect(_rect: ViewRect, _vp: ScreenViewport): void;
|
|
104
108
|
/** Return the ViewRect currently occupied by the controls in the supplied view. */
|
|
@@ -114,6 +118,9 @@ export declare class AccuDrawViewportUI extends AccuDraw {
|
|
|
114
118
|
* When returning false the compass displays in monochrome.
|
|
115
119
|
*/
|
|
116
120
|
get hasInputFocus(): boolean;
|
|
121
|
+
/** Get the item field that currently has input focus.
|
|
122
|
+
*/
|
|
123
|
+
getFocusItem(): ItemField | undefined;
|
|
117
124
|
/** Request to set focus to the specified AccuDraw input field to start entering values.
|
|
118
125
|
* The focused input field will be indicated by the background color.
|
|
119
126
|
*/
|