@itwin/core-frontend 3.3.0-dev.4 → 3.3.0-dev.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -1
- package/lib/cjs/AccuSnap.d.ts.map +1 -1
- package/lib/cjs/AccuSnap.js +56 -49
- package/lib/cjs/AccuSnap.js.map +1 -1
- package/lib/cjs/DisplayStyleState.d.ts +68 -17
- package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleState.js +66 -20
- package/lib/cjs/DisplayStyleState.js.map +1 -1
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +1 -1
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/TentativePoint.js +1 -1
- package/lib/cjs/TentativePoint.js.map +1 -1
- package/lib/cjs/ViewRect.d.ts +5 -3
- package/lib/cjs/ViewRect.d.ts.map +1 -1
- package/lib/cjs/ViewRect.js +11 -7
- package/lib/cjs/ViewRect.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/extension/ExtensionAdmin.d.ts +5 -2
- package/lib/cjs/extension/ExtensionAdmin.d.ts.map +1 -1
- package/lib/cjs/extension/ExtensionAdmin.js +24 -6
- package/lib/cjs/extension/ExtensionAdmin.js.map +1 -1
- package/lib/cjs/extension/ExtensionRuntime.js +165 -158
- package/lib/cjs/extension/ExtensionRuntime.js.map +1 -1
- package/lib/cjs/extension/providers/ExtensionServiceClient.d.ts +8 -6
- package/lib/cjs/extension/providers/ExtensionServiceClient.d.ts.map +1 -1
- package/lib/cjs/extension/providers/ExtensionServiceClient.js +13 -6
- package/lib/cjs/extension/providers/ExtensionServiceClient.js.map +1 -1
- package/lib/cjs/extension/providers/RemoteExtensionProvider.d.ts +0 -2
- package/lib/cjs/extension/providers/RemoteExtensionProvider.d.ts.map +1 -1
- package/lib/cjs/extension/providers/RemoteExtensionProvider.js +9 -22
- package/lib/cjs/extension/providers/RemoteExtensionProvider.js.map +1 -1
- package/lib/cjs/extension/providers/ServiceExtensionProvider.d.ts +7 -6
- package/lib/cjs/extension/providers/ServiceExtensionProvider.d.ts.map +1 -1
- package/lib/cjs/extension/providers/ServiceExtensionProvider.js +13 -24
- package/lib/cjs/extension/providers/ServiceExtensionProvider.js.map +1 -1
- package/lib/cjs/render/RenderSystem.d.ts +5 -0
- package/lib/cjs/render/RenderSystem.d.ts.map +1 -1
- package/lib/cjs/render/RenderSystem.js.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js +3 -1
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
- package/lib/cjs/render/webgl/ShaderProgram.js +1 -1
- package/lib/cjs/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/cjs/render/webgl/Target.d.ts +1 -1
- package/lib/cjs/render/webgl/Target.js +2 -2
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/cjs/render/webgl/UniformHandle.d.ts +2 -1
- package/lib/cjs/render/webgl/UniformHandle.d.ts.map +1 -1
- package/lib/cjs/render/webgl/UniformHandle.js +15 -3
- package/lib/cjs/render/webgl/UniformHandle.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/RealityMesh.d.ts.map +1 -1
- package/lib/cjs/render/webgl/glsl/RealityMesh.js +5 -2
- package/lib/cjs/render/webgl/glsl/RealityMesh.js.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js +2 -1
- package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +6 -2
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +51 -4
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +5 -2
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +5 -2
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +6 -2
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.d.ts +1 -0
- package/lib/cjs/tile/map/MapCartoRectangle.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.js +1 -0
- package/lib/cjs/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +2 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +3 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +24 -10
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.d.ts +14 -9
- package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.js +14 -6
- package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +3 -5
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.d.ts +2 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.js +1 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.js.map +1 -1
- package/lib/cjs/tools/PrimitiveTool.js +4 -4
- package/lib/cjs/tools/PrimitiveTool.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +25 -10
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/AccuSnap.d.ts.map +1 -1
- package/lib/esm/AccuSnap.js +56 -49
- package/lib/esm/AccuSnap.js.map +1 -1
- package/lib/esm/DisplayStyleState.d.ts +68 -17
- package/lib/esm/DisplayStyleState.d.ts.map +1 -1
- package/lib/esm/DisplayStyleState.js +66 -20
- package/lib/esm/DisplayStyleState.js.map +1 -1
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +2 -2
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/TentativePoint.js +1 -1
- package/lib/esm/TentativePoint.js.map +1 -1
- package/lib/esm/ViewRect.d.ts +5 -3
- package/lib/esm/ViewRect.d.ts.map +1 -1
- package/lib/esm/ViewRect.js +11 -7
- package/lib/esm/ViewRect.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/extension/ExtensionAdmin.d.ts +5 -2
- package/lib/esm/extension/ExtensionAdmin.d.ts.map +1 -1
- package/lib/esm/extension/ExtensionAdmin.js +24 -6
- package/lib/esm/extension/ExtensionAdmin.js.map +1 -1
- package/lib/esm/extension/ExtensionRuntime.js +168 -161
- package/lib/esm/extension/ExtensionRuntime.js.map +1 -1
- package/lib/esm/extension/providers/ExtensionServiceClient.d.ts +8 -6
- package/lib/esm/extension/providers/ExtensionServiceClient.d.ts.map +1 -1
- package/lib/esm/extension/providers/ExtensionServiceClient.js +13 -6
- package/lib/esm/extension/providers/ExtensionServiceClient.js.map +1 -1
- package/lib/esm/extension/providers/RemoteExtensionProvider.d.ts +0 -2
- package/lib/esm/extension/providers/RemoteExtensionProvider.d.ts.map +1 -1
- package/lib/esm/extension/providers/RemoteExtensionProvider.js +9 -22
- package/lib/esm/extension/providers/RemoteExtensionProvider.js.map +1 -1
- package/lib/esm/extension/providers/ServiceExtensionProvider.d.ts +7 -6
- package/lib/esm/extension/providers/ServiceExtensionProvider.d.ts.map +1 -1
- package/lib/esm/extension/providers/ServiceExtensionProvider.js +13 -24
- package/lib/esm/extension/providers/ServiceExtensionProvider.js.map +1 -1
- package/lib/esm/render/RenderSystem.d.ts +5 -0
- package/lib/esm/render/RenderSystem.d.ts.map +1 -1
- package/lib/esm/render/RenderSystem.js.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.js +3 -1
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
- package/lib/esm/render/webgl/ShaderProgram.js +1 -1
- package/lib/esm/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/esm/render/webgl/Target.d.ts +1 -1
- package/lib/esm/render/webgl/Target.js +2 -2
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/lib/esm/render/webgl/UniformHandle.d.ts +2 -1
- package/lib/esm/render/webgl/UniformHandle.d.ts.map +1 -1
- package/lib/esm/render/webgl/UniformHandle.js +15 -3
- package/lib/esm/render/webgl/UniformHandle.js.map +1 -1
- package/lib/esm/render/webgl/glsl/RealityMesh.d.ts.map +1 -1
- package/lib/esm/render/webgl/glsl/RealityMesh.js +5 -2
- package/lib/esm/render/webgl/glsl/RealityMesh.js.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.js +2 -1
- package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +6 -2
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +51 -4
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +5 -2
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +5 -2
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.d.ts +2 -2
- package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +6 -2
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.d.ts +1 -0
- package/lib/esm/tile/map/MapCartoRectangle.d.ts.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.js +1 -0
- package/lib/esm/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +2 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +3 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +25 -11
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.d.ts +14 -9
- package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.js +14 -6
- package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +3 -5
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/TerrainMeshProvider.d.ts +2 -1
- package/lib/esm/tile/map/TerrainMeshProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/TerrainMeshProvider.js +1 -1
- package/lib/esm/tile/map/TerrainMeshProvider.js.map +1 -1
- package/lib/esm/tools/PrimitiveTool.js +4 -4
- package/lib/esm/tools/PrimitiveTool.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +25 -10
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/package.json +21 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BingImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/BingImageryProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGzE,OAAO,EAAE,OAAO,EAA4B,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EACL,uBAAuB,EAAE,OAAO,EAAmB,MAAM,EACnD,uBAAuB,GAC9B,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,QAAQ;IACZ,YAAoB,kBAA0B,EACpC,mBAA2B,EAC3B,mBAA2B,EAC3B,oBAA4B,EAC5B,iBAAyB,EACzB,iBAAyB;QALf,uBAAkB,GAAlB,kBAAkB,CAAQ;QACpC,wBAAmB,GAAnB,mBAAmB,CAAQ;QAC3B,wBAAmB,GAAnB,mBAAmB,CAAQ;QAC3B,yBAAoB,GAApB,oBAAoB,CAAQ;QAC5B,sBAAiB,GAAjB,iBAAiB,CAAQ;QACzB,sBAAiB,GAAjB,iBAAiB,CAAQ;IAAI,CAAC;IAEjC,QAAQ,CAAC,MAAc,EAAE,YAA6B;QAC3D,MAAM,KAAK,GAAY,MAAM,CAAC,eAAe,CAAC,YAA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KAAK,MAAM,iBAAiB,IAAI,oBAAoB,CAAC,aAAa,EAAE;gBAClE,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAC1I,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACxD,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aAC9B;YACD,MAAM,eAAe,GAAoB,IAAI,eAAe,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;YAC1F,IAAI,CAAC,IAAI,CAAC,aAAa;gBACrB,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,EAAmB,CAAC;YACpD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SAC1C;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, BentleyError, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { Range2d } from \"@itwin/core-geometry\";\r\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\r\nimport { request, RequestOptions, Response } from \"../../../request/Request\";\r\nimport { IModelApp } from \"../../../IModelApp\";\r\nimport { ScreenViewport } from \"../../../Viewport\";\r\nimport {\r\n MapLayerImageryProvider, MapTile, MapTilingScheme, QuadId,\r\n Tile, WebMercatorTilingScheme,\r\n} from \"../../internal\";\r\n\r\n/** Represents one range of geography and tile zoom levels for a bing data provider\r\n * @internal\r\n */\r\nclass Coverage {\r\n constructor(private _lowerLeftLatitude: number,\r\n private _lowerLeftLongitude: number,\r\n private _upperRightLatitude: number,\r\n private _upperRightLongitude: number,\r\n private _minimumZoomLevel: number,\r\n private _maximumZoomLevel: number) { }\r\n\r\n public overlaps(quadId: QuadId, tilingScheme: MapTilingScheme): boolean {\r\n const range: Range2d = quadId.getLatLongRange(tilingScheme);\r\n if (quadId.level < this._minimumZoomLevel)\r\n return false;\r\n if (quadId.level > this._maximumZoomLevel)\r\n return false;\r\n if (range.low.x > this._upperRightLongitude)\r\n return false;\r\n if (range.low.y > this._upperRightLatitude)\r\n return false;\r\n if (range.high.x < this._lowerLeftLongitude)\r\n return false;\r\n if (range.high.y < this._lowerLeftLatitude)\r\n return false;\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Represents the copyright message and an array of coverage data for one of bing's data providers (HERE for example).\r\n * @internal\r\n */\r\nclass BingAttribution {\r\n constructor(public copyrightMessage: string, private _coverages: Coverage[]) { }\r\n\r\n public matchesTile(tile: Tile, tilingScheme: MapTilingScheme): boolean {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n for (const coverage of this._coverages) {\r\n if (coverage.overlaps(quadId, tilingScheme))\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n// in deployed applications, we can only make https requests, but the Bing Maps metadata request returns templates with \"http:\".\r\n// This function fixes those.\r\nfunction replaceHttpWithHttps(originalUrl: string) {\r\n return originalUrl.startsWith(\"http:\") ? \"https:\".concat(originalUrl.slice(5)) : originalUrl;\r\n}\r\n\r\n/** @internal */\r\nexport class BingMapsImageryLayerProvider extends MapLayerImageryProvider {\r\n private _urlTemplate?: string;\r\n private _urlSubdomains?: string[];\r\n private _zoomMax: number;\r\n private _tileHeight: number;\r\n private _tileWidth: number;\r\n private _attributions?: BingAttribution[]; // array of Bing's data providers.\r\n private _mapTilingScheme: MapTilingScheme;\r\n private _urlBase: string;\r\n\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, true);\r\n this._urlBase = settings.url;\r\n this._zoomMax = 0;\r\n this._tileHeight = this._tileWidth = 0;\r\n this._mapTilingScheme = new WebMercatorTilingScheme();\r\n }\r\n\r\n public get tileWidth(): number { return this._tileWidth; }\r\n public get tileHeight(): number { return this._tileHeight; }\r\n\r\n private tileXYToQuadKey(tileX: number, tileY: number, zoomLevel: number) {\r\n // from C# example in bing documentation https://msdn.microsoft.com/en-us/library/bb259689.aspx\r\n let quadKey: string = \"\";\r\n\r\n // Root tile is not displayable. Returns 0 for _GetMaximumSize(). Should not end up here.\r\n assert(0 !== zoomLevel);\r\n\r\n for (let i: number = zoomLevel; i > 0; i--) {\r\n let digit: number = 0x30; // '0'\r\n const mask: number = 1 << (i - 1);\r\n if ((tileX & mask) !== 0) {\r\n digit++;\r\n }\r\n if ((tileY & mask) !== 0) {\r\n digit++;\r\n digit++;\r\n }\r\n quadKey = quadKey.concat(String.fromCharCode(digit));\r\n }\r\n return quadKey;\r\n }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n // From the tile, get a \"quadKey\" the Microsoft way.\r\n const quadKey: string = this.tileXYToQuadKey(column, row, zoomLevel);\r\n const subdomain: string = this._urlSubdomains![(row + column) % this._urlSubdomains!.length];\r\n\r\n // from the template url, construct the tile url.\r\n let url: string = this._urlTemplate!.replace(\"{subdomain}\", subdomain);\r\n url = url.replace(\"{quadkey}\", quadKey);\r\n\r\n return url;\r\n }\r\n\r\n // gets the attributions that match the tile set.\r\n private getMatchingAttributions(tiles: Set<Tile> | undefined): BingAttribution[] {\r\n const matchingAttributions: BingAttribution[] = new Array<BingAttribution>();\r\n if (!this._attributions || !tiles)\r\n return matchingAttributions;\r\n\r\n const unmatchedSet: BingAttribution[] = this._attributions.slice();\r\n for (const tile of tiles) {\r\n if (tile instanceof MapTile)\r\n // compare to the set of Bing attributions that we have not yet matched.\r\n for (let iAttr = 0; iAttr < unmatchedSet.length; iAttr++) {\r\n const attribution = unmatchedSet[iAttr];\r\n if (attribution && attribution.matchesTile(tile, this._mapTilingScheme)) {\r\n matchingAttributions.push(attribution);\r\n delete unmatchedSet[iAttr];\r\n }\r\n }\r\n }\r\n return matchingAttributions;\r\n }\r\n\r\n public override getLogo(vp: ScreenViewport): HTMLTableRowElement | undefined {\r\n const tiles = IModelApp.tileAdmin.getTilesForUser(vp)?.selected;\r\n const matchingAttributions = this.getMatchingAttributions(tiles);\r\n const copyrights: string[] = [];\r\n for (const match of matchingAttributions)\r\n copyrights.push(match.copyrightMessage);\r\n\r\n let copyrightMsg = \"\";\r\n for (let i = 0; i < copyrights.length; ++i) {\r\n if (i > 0)\r\n copyrightMsg += \"<br>\";\r\n copyrightMsg += copyrights[i];\r\n }\r\n return IModelApp.makeLogoCard({ iconSrc: `${IModelApp.publicPath}images/bing.svg`, heading: \"Microsoft Bing\", notice: copyrightMsg });\r\n }\r\n\r\n // initializes the BingImageryProvider by reading the templateUrl, logo image, and attribution list.\r\n public override async initialize(): Promise<void> {\r\n // get the template url\r\n const bingRequestUrl = this._urlBase.replace(\"{bingKey}\", this._settings.accessKey ? this._settings.accessKey.value : \"\");\r\n const requestOptions: RequestOptions = { method: \"GET\" };\r\n\r\n try {\r\n const response: Response = await request(bingRequestUrl, requestOptions);\r\n const bingResponseProps: any = response.body;\r\n\r\n const thisResourceSetProps = bingResponseProps.resourceSets[0];\r\n const thisResourceProps = thisResourceSetProps.resources[0];\r\n this._zoomMax = thisResourceProps.zoomMax;\r\n this._tileHeight = thisResourceProps.imageHeight;\r\n this._tileWidth = thisResourceProps.imageWidth;\r\n this._urlTemplate = replaceHttpWithHttps(thisResourceProps.imageUrl.replace(\"{culture}\", \"en-US\")); // NEEDSWORK - get locale from somewhere.\r\n this._urlSubdomains = thisResourceProps.imageUrlSubdomains;\r\n // read the list of Bing's data suppliers and the range of data they provide. Used in calculation of copyright message.\r\n this.readAttributions(thisResourceProps.imageryProviders);\r\n\r\n // Bing sometimes provides tiles that have nothing but a camera icon in the middle of them when you ask\r\n // for tiles at zoom levels where they don't have data. Their application stops you from zooming in when that's the\r\n // case, but we can't stop - the user might want to look at design data a closer zoom. So we intentionally load such\r\n // a tile, and then compare other tiles to it, rejecting them if they match.\r\n this.loadTile(0, 0, this._zoomMax - 1).then((tileData: ImageSource | undefined) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n if (tileData !== undefined) this._missingTileData = tileData.data as Uint8Array;\r\n });\r\n } catch (error) {\r\n throw new BentleyError(IModelStatus.BadModel, \"Error in Bing Server communications\");\r\n }\r\n }\r\n\r\n // reads the list of Bing data providers and the map range for which they each provide data.\r\n private readAttributions(attributionProps: any) {\r\n for (const thisAttributionProps of attributionProps) {\r\n const copyrightMessage: string = thisAttributionProps.attribution;\r\n const coverages: Coverage[] = new Array<Coverage>();\r\n for (const thisCoverageProps of thisAttributionProps.coverageAreas) {\r\n const thisCoverage = new Coverage(thisCoverageProps.bbox[0], thisCoverageProps.bbox[1], thisCoverageProps.bbox[2], thisCoverageProps.bbox[3],\r\n thisCoverageProps.zoomMin, thisCoverageProps.zoomMax);\r\n coverages.push(thisCoverage);\r\n }\r\n const thisAttribution: BingAttribution = new BingAttribution(copyrightMessage, coverages);\r\n if (!this._attributions)\r\n this._attributions = new Array<BingAttribution>();\r\n this._attributions.push(thisAttribution);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BingImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/BingImageryProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGzE,OAAO,EAAE,OAAO,EAA4B,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EACL,uBAAuB,EAAE,OAAO,EAAmB,MAAM,EACnD,uBAAuB,GAC9B,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,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CAAC,IAAI,CAAC,CAAC,QAAiC,EAAE,EAAE;gBAChF,IAAI,QAAQ,KAAK,SAAS;oBAAE,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,IAAkB,CAAC;YAClF,CAAC,CAAC,CAAC;SACJ;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,YAAY,CAAC,YAAY,CAAC,QAAQ,EAAE,qCAAqC,CAAC,CAAC;SACtF;IACH,CAAC;IAED,4FAA4F;IACpF,gBAAgB,CAAC,gBAAqB;QAC5C,KAAK,MAAM,oBAAoB,IAAI,gBAAgB,EAAE;YACnD,MAAM,gBAAgB,GAAW,oBAAoB,CAAC,WAAW,CAAC;YAClE,MAAM,SAAS,GAAe,IAAI,KAAK,EAAY,CAAC;YACpD,KAAK,MAAM,iBAAiB,IAAI,oBAAoB,CAAC,aAAa,EAAE;gBAClE,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAC1I,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACxD,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aAC9B;YACD,MAAM,eAAe,GAAoB,IAAI,eAAe,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;YAC1F,IAAI,CAAC,IAAI,CAAC,aAAa;gBACrB,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,EAAmB,CAAC;YACpD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SAC1C;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, BentleyError, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { Range2d } from \"@itwin/core-geometry\";\r\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\r\nimport { request, RequestOptions, Response } from \"../../../request/Request\";\r\nimport { IModelApp } from \"../../../IModelApp\";\r\nimport { ScreenViewport } from \"../../../Viewport\";\r\nimport {\r\n MapLayerImageryProvider, MapTile, MapTilingScheme, QuadId,\r\n Tile, WebMercatorTilingScheme,\r\n} from \"../../internal\";\r\n\r\n/** Represents one range of geography and tile zoom levels for a bing data provider\r\n * @internal\r\n */\r\nclass Coverage {\r\n constructor(private _lowerLeftLatitude: number,\r\n private _lowerLeftLongitude: number,\r\n private _upperRightLatitude: number,\r\n private _upperRightLongitude: number,\r\n private _minimumZoomLevel: number,\r\n private _maximumZoomLevel: number) { }\r\n\r\n public overlaps(quadId: QuadId, tilingScheme: MapTilingScheme): boolean {\r\n const range: Range2d = quadId.getLatLongRange(tilingScheme);\r\n if (quadId.level < this._minimumZoomLevel)\r\n return false;\r\n if (quadId.level > this._maximumZoomLevel)\r\n return false;\r\n if (range.low.x > this._upperRightLongitude)\r\n return false;\r\n if (range.low.y > this._upperRightLatitude)\r\n return false;\r\n if (range.high.x < this._lowerLeftLongitude)\r\n return false;\r\n if (range.high.y < this._lowerLeftLatitude)\r\n return false;\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Represents the copyright message and an array of coverage data for one of bing's data providers (HERE for example).\r\n * @internal\r\n */\r\nclass BingAttribution {\r\n constructor(public copyrightMessage: string, private _coverages: Coverage[]) { }\r\n\r\n public matchesTile(tile: Tile, tilingScheme: MapTilingScheme): boolean {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n for (const coverage of this._coverages) {\r\n if (coverage.overlaps(quadId, tilingScheme))\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n// in deployed applications, we can only make https requests, but the Bing Maps metadata request returns templates with \"http:\".\r\n// This function fixes those.\r\nfunction replaceHttpWithHttps(originalUrl: string) {\r\n return originalUrl.startsWith(\"http:\") ? \"https:\".concat(originalUrl.slice(5)) : originalUrl;\r\n}\r\n\r\n/** @internal */\r\nexport class BingMapsImageryLayerProvider extends MapLayerImageryProvider {\r\n private _urlTemplate?: string;\r\n private _urlSubdomains?: string[];\r\n private _zoomMax: number;\r\n private _tileHeight: number;\r\n private _tileWidth: number;\r\n private _attributions?: BingAttribution[]; // array of Bing's data providers.\r\n private _mapTilingScheme: MapTilingScheme;\r\n private _urlBase: string;\r\n\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, true);\r\n this._urlBase = settings.url;\r\n this._zoomMax = 0;\r\n this._tileHeight = this._tileWidth = 0;\r\n this._mapTilingScheme = new WebMercatorTilingScheme();\r\n }\r\n\r\n public get tileWidth(): number { return this._tileWidth; }\r\n public get tileHeight(): number { return this._tileHeight; }\r\n\r\n private tileXYToQuadKey(tileX: number, tileY: number, zoomLevel: number) {\r\n // from C# example in bing documentation https://msdn.microsoft.com/en-us/library/bb259689.aspx\r\n let quadKey: string = \"\";\r\n\r\n // Root tile is not displayable. Returns 0 for _GetMaximumSize(). Should not end up here.\r\n assert(0 !== zoomLevel);\r\n\r\n for (let i: number = zoomLevel; i > 0; i--) {\r\n let digit: number = 0x30; // '0'\r\n const mask: number = 1 << (i - 1);\r\n if ((tileX & mask) !== 0) {\r\n digit++;\r\n }\r\n if ((tileY & mask) !== 0) {\r\n digit++;\r\n digit++;\r\n }\r\n quadKey = quadKey.concat(String.fromCharCode(digit));\r\n }\r\n return quadKey;\r\n }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n // From the tile, get a \"quadKey\" the Microsoft way.\r\n const quadKey: string = this.tileXYToQuadKey(column, row, zoomLevel);\r\n const subdomain: string = this._urlSubdomains![(row + column) % this._urlSubdomains!.length];\r\n\r\n // from the template url, construct the tile url.\r\n let url: string = this._urlTemplate!.replace(\"{subdomain}\", subdomain);\r\n url = url.replace(\"{quadkey}\", quadKey);\r\n\r\n return url;\r\n }\r\n\r\n // gets the attributions that match the tile set.\r\n private getMatchingAttributions(tiles: Set<Tile> | undefined): BingAttribution[] {\r\n const matchingAttributions: BingAttribution[] = new Array<BingAttribution>();\r\n if (!this._attributions || !tiles)\r\n return matchingAttributions;\r\n\r\n const unmatchedSet: BingAttribution[] = this._attributions.slice();\r\n for (const tile of tiles) {\r\n if (tile instanceof MapTile)\r\n // compare to the set of Bing attributions that we have not yet matched.\r\n for (let iAttr = 0; iAttr < unmatchedSet.length; iAttr++) {\r\n const attribution = unmatchedSet[iAttr];\r\n if (attribution && attribution.matchesTile(tile, this._mapTilingScheme)) {\r\n matchingAttributions.push(attribution);\r\n delete unmatchedSet[iAttr];\r\n }\r\n }\r\n }\r\n return matchingAttributions;\r\n }\r\n\r\n public override addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n const tiles = IModelApp.tileAdmin.getTilesForUser(vp)?.selected;\r\n const matchingAttributions = this.getMatchingAttributions(tiles);\r\n const copyrights: string[] = [];\r\n for (const match of matchingAttributions)\r\n copyrights.push(match.copyrightMessage);\r\n\r\n let copyrightMsg = \"\";\r\n for (let i = 0; i < copyrights.length; ++i) {\r\n if (i > 0)\r\n copyrightMsg += \"<br>\";\r\n copyrightMsg += copyrights[i];\r\n }\r\n\r\n cards.appendChild(IModelApp.makeLogoCard({ iconSrc: `${IModelApp.publicPath}images/bing.svg`, heading: \"Microsoft Bing\", notice: copyrightMsg }));\r\n }\r\n\r\n // initializes the BingImageryProvider by reading the templateUrl, logo image, and attribution list.\r\n public override async initialize(): Promise<void> {\r\n // get the template url\r\n const bingRequestUrl = this._urlBase.replace(\"{bingKey}\", this._settings.accessKey ? this._settings.accessKey.value : \"\");\r\n const requestOptions: RequestOptions = { method: \"GET\" };\r\n\r\n try {\r\n const response: Response = await request(bingRequestUrl, requestOptions);\r\n const bingResponseProps: any = response.body;\r\n\r\n const thisResourceSetProps = bingResponseProps.resourceSets[0];\r\n const thisResourceProps = thisResourceSetProps.resources[0];\r\n this._zoomMax = thisResourceProps.zoomMax;\r\n this._tileHeight = thisResourceProps.imageHeight;\r\n this._tileWidth = thisResourceProps.imageWidth;\r\n this._urlTemplate = replaceHttpWithHttps(thisResourceProps.imageUrl.replace(\"{culture}\", \"en-US\")); // NEEDSWORK - get locale from somewhere.\r\n this._urlSubdomains = thisResourceProps.imageUrlSubdomains;\r\n // read the list of Bing's data suppliers and the range of data they provide. Used in calculation of copyright message.\r\n this.readAttributions(thisResourceProps.imageryProviders);\r\n\r\n // Bing sometimes provides tiles that have nothing but a camera icon in the middle of them when you ask\r\n // for tiles at zoom levels where they don't have data. Their application stops you from zooming in when that's the\r\n // case, but we can't stop - the user might want to look at design data a closer zoom. So we intentionally load such\r\n // a tile, and then compare other tiles to it, rejecting them if they match.\r\n this.loadTile(0, 0, this._zoomMax - 1).then((tileData: ImageSource | undefined) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n if (tileData !== undefined) this._missingTileData = tileData.data as Uint8Array;\r\n });\r\n } catch (error) {\r\n throw new BentleyError(IModelStatus.BadModel, \"Error in Bing Server communications\");\r\n }\r\n }\r\n\r\n // reads the list of Bing data providers and the map range for which they each provide data.\r\n private readAttributions(attributionProps: any) {\r\n for (const thisAttributionProps of attributionProps) {\r\n const copyrightMessage: string = thisAttributionProps.attribution;\r\n const coverages: Coverage[] = new Array<Coverage>();\r\n for (const thisCoverageProps of thisAttributionProps.coverageAreas) {\r\n const thisCoverage = new Coverage(thisCoverageProps.bbox[0], thisCoverageProps.bbox[1], thisCoverageProps.bbox[2], thisCoverageProps.bbox[3],\r\n thisCoverageProps.zoomMin, thisCoverageProps.zoomMax);\r\n coverages.push(thisCoverage);\r\n }\r\n const thisAttribution: BingAttribution = new BingAttribution(copyrightMessage, coverages);\r\n if (!this._attributions)\r\n this._attributions = new Array<BingAttribution>();\r\n this._attributions.push(thisAttribution);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -16,7 +16,7 @@ export declare class MapBoxLayerImageryProvider extends MapLayerImageryProvider
|
|
|
16
16
|
get minimumZoomLevel(): number;
|
|
17
17
|
get maximumZoomLevel(): number;
|
|
18
18
|
constructUrl(row: number, column: number, zoomLevel: number): Promise<string>;
|
|
19
|
-
|
|
19
|
+
addLogoCards(cards: HTMLTableElement): void;
|
|
20
20
|
initialize(): Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=MapBoxLayerImageryProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapBoxLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/MapBoxLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,uBAAuB;IACrE,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,EAAE,qBAAqB;IAM3C,IAAW,SAAS,IAAI,MAAM,CAAgB;IAC9C,IAAW,UAAU,IAAI,MAAM,CAAgB;IAC/C,IAAoB,gBAAgB,IAAI,MAAM,CAA0B;IACxE,IAAoB,gBAAgB,IAAI,MAAM,CAA0B;IAG3D,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAc1E,
|
|
1
|
+
{"version":3,"file":"MapBoxLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/MapBoxLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,uBAAuB;IACrE,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,EAAE,qBAAqB;IAM3C,IAAW,SAAS,IAAI,MAAM,CAAgB;IAC9C,IAAW,UAAU,IAAI,MAAM,CAAgB;IAC/C,IAAoB,gBAAgB,IAAI,MAAM,CAA0B;IACxE,IAAoB,gBAAgB,IAAI,MAAM,CAA0B;IAG3D,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAc1E,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAQrC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAClD"}
|
|
@@ -33,8 +33,11 @@ export class MapBoxLayerImageryProvider extends MapLayerImageryProvider {
|
|
|
33
33
|
url = url.concat(`?${this._settings.accessKey.key}=${this._settings.accessKey.value}`);
|
|
34
34
|
return url;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
addLogoCards(cards) {
|
|
37
|
+
if (!cards.dataset.mapboxLogoCard) {
|
|
38
|
+
cards.dataset.mapboxLogoCard = "true";
|
|
39
|
+
cards.appendChild(IModelApp.makeLogoCard({ heading: "Mapbox", notice: IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.MapBoxCopyright") }));
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
// no initialization needed for MapBoxImageryProvider.
|
|
40
43
|
async initialize() { }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapBoxLayerImageryProvider.js","sourceRoot":"","sources":["../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CAAC,CAAC;QAClE,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,QAAQ,EAAE,IAAI,MAAM,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACpF,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;QAEvF,OAAO,GAAG,CAAC;IACb,CAAC;IAEe,YAAY,CAAC,KAAuB;QAClD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE;YACjC,KAAK,CAAC,OAAO,CAAC,cAAc,GAAG,MAAM,CAAC;YACtC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,wCAAwC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC/J;IACH,CAAC;IAED,sDAAsD;IACtC,KAAK,CAAC,UAAU,KAAoB,CAAC;CACtD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../../IModelApp\";\r\nimport { MapLayerImageryProvider } from \"../../internal\";\r\n\r\n/** Base class imagery map layer formats. Subclasses should override formatId and [[MapLayerFormat.createImageryProvider]].\r\n * @internal\r\n */\r\nexport class MapBoxLayerImageryProvider extends MapLayerImageryProvider {\r\n private _zoomMin: number;\r\n private _zoomMax: number;\r\n private _baseUrl: string;\r\n\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, true);\r\n this._baseUrl = settings.url;\r\n this._zoomMin = 1; this._zoomMax = 20;\r\n }\r\n\r\n public get tileWidth(): number { return 256; }\r\n public get tileHeight(): number { return 256; }\r\n public override get minimumZoomLevel(): number { return this._zoomMin; }\r\n public override get maximumZoomLevel(): number { return this._zoomMax; }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n if (!this._settings.accessKey) {\r\n return \"\";\r\n }\r\n\r\n // from the template url, construct the tile url.\r\n // format: {baseUrl}/{tileSize}/{level}/{column}/{row}?access_token={token}\r\n let url: string = this._baseUrl.concat(this.tileWidth.toString());\r\n url = url.concat(`/${zoomLevel.toString()}/${column.toString()}/${row.toString()}`);\r\n url = url.concat(`?${this._settings.accessKey.key}=${this._settings.accessKey.value}`);\r\n\r\n return url;\r\n }\r\n\r\n public override addLogoCards(cards: HTMLTableElement): void {\r\n if (!cards.dataset.mapboxLogoCard) {\r\n cards.dataset.mapboxLogoCard = \"true\";\r\n cards.appendChild(IModelApp.makeLogoCard({ heading: \"Mapbox\", notice: IModelApp.localization.getLocalizedString(\"iModelJs:BackgroundMap.MapBoxCopyright\") }));\r\n }\r\n }\r\n\r\n // no initialization needed for MapBoxImageryProvider.\r\n public override async initialize(): Promise<void> { }\r\n}\r\n"]}
|
|
@@ -40,7 +40,7 @@ export declare class ImageryMapTileTree extends RealityTileTree {
|
|
|
40
40
|
private _imageryLoader;
|
|
41
41
|
constructor(params: RealityTileTreeParams, _imageryLoader: ImageryTileLoader);
|
|
42
42
|
get tilingScheme(): MapTilingScheme;
|
|
43
|
-
|
|
43
|
+
addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void;
|
|
44
44
|
getTileRectangle(quadId: QuadId): MapCartoRectangle;
|
|
45
45
|
get imageryLoader(): ImageryTileLoader;
|
|
46
46
|
get is3d(): boolean;
|
|
@@ -61,7 +61,7 @@ declare class ImageryTileLoader extends RealityTileLoader {
|
|
|
61
61
|
get maxDepth(): number;
|
|
62
62
|
get minDepth(): number;
|
|
63
63
|
get priority(): TileLoadPriority;
|
|
64
|
-
|
|
64
|
+
addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void;
|
|
65
65
|
get maximumScreenSize(): number;
|
|
66
66
|
get imageryProvider(): MapLayerImageryProvider;
|
|
67
67
|
getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageryTileTree.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/ImageryTileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,YAAY,EAAsC,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE1I,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,iBAAiB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAC7K,qBAAqB,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAY,kBAAkB,EAAE,aAAa,EAE/I,MAAM,aAAa,CAAC;AAErB,gBAAgB;AAChB,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,cAAc,CAAC,EAAE,aAAa,CAAC;CAChC;AAED,gBAAgB;AAChB,qBAAa,cAAe,SAAQ,WAAW;IAGN,WAAW,EAAE,kBAAkB;IAAS,MAAM,EAAE,MAAM;IAAS,SAAS,EAAE,iBAAiB;IAFlI,OAAO,CAAC,QAAQ,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IhG,IAAoB,YAAY,YAAoB;IAEpD,gDAAgD;IAChD,IAAW,SAAS,IAAI,aAAa,CAEpC;IACD,IAAoB,eAAe,IAAI,uBAAuB,GAAG,SAAS,CAMzE;CACF"}
|
|
@@ -117,7 +117,9 @@ export class ImageryMapTileTree extends RealityTileTree {
|
|
|
117
117
|
this._rootTile = new ImageryMapTile(params.rootTile, this, rootQuadId, this.getTileRectangle(rootQuadId));
|
|
118
118
|
}
|
|
119
119
|
get tilingScheme() { return this._imageryLoader.imageryProvider.tilingScheme; }
|
|
120
|
-
|
|
120
|
+
addLogoCards(cards, vp) {
|
|
121
|
+
this._imageryLoader.addLogoCards(cards, vp);
|
|
122
|
+
}
|
|
121
123
|
getTileRectangle(quadId) {
|
|
122
124
|
return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);
|
|
123
125
|
}
|
|
@@ -150,7 +152,9 @@ class ImageryTileLoader extends RealityTileLoader {
|
|
|
150
152
|
get maxDepth() { return this._imageryProvider.maximumZoomLevel; }
|
|
151
153
|
get minDepth() { return this._imageryProvider.minimumZoomLevel; }
|
|
152
154
|
get priority() { return TileLoadPriority.Map; }
|
|
153
|
-
|
|
155
|
+
addLogoCards(cards, vp) {
|
|
156
|
+
this._imageryProvider.addLogoCards(cards, vp);
|
|
157
|
+
}
|
|
154
158
|
get maximumScreenSize() { return this._imageryProvider.maximumScreenSize; }
|
|
155
159
|
get imageryProvider() { return this._imageryProvider; }
|
|
156
160
|
async getToolTip(strings, quadId, carto, tree) { await this._imageryProvider.getToolTip(strings, quadId, carto, tree); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageryTileTree.js","sourceRoot":"","sources":["../../../../src/tile/map/ImageryTileTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CA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;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,YAAY,kBAAkB,CAAC;YAChD,OAAO,SAAS,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;IAC5C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, compareBooleans, compareNumbers, compareStrings, compareStringsOrUndefined, dispose } from \"@itwin/core-bentley\";\r\nimport { Angle, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, MapLayerSettings, RenderTexture, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { RenderMemory } from \"../../render/RenderMemory\";\r\nimport { RenderSystem } from \"../../render/RenderSystem\";\r\nimport { ScreenViewport } from \"../../Viewport\";\r\nimport {\r\n MapCartoRectangle, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree,\r\n RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTree, TileTreeLoadStatus, TileTreeOwner,\r\n TileTreeSupplier,\r\n} from \"../internal\";\r\n\r\n/** @internal */\r\nexport interface ImageryTileContent extends TileContent {\r\n imageryTexture?: RenderTexture;\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTile extends RealityTile {\r\n private _texture?: RenderTexture;\r\n private _mapTileUsageCount = 0;\r\n constructor(params: TileParams, public imageryTree: ImageryMapTileTree, public quadId: QuadId, public rectangle: MapCartoRectangle) {\r\n super(params, imageryTree);\r\n }\r\n public get texture() { return this._texture; }\r\n public get tilingScheme() { return this.imageryTree.tilingScheme; }\r\n public override get isDisplayable() { return (this.depth > 1) && super.isDisplayable; }\r\n\r\n public override setContent(content: ImageryTileContent): void {\r\n this._texture = content.imageryTexture; // No dispose - textures may be shared by terrain tiles so let garbage collector dispose them.\r\n if (undefined === content.imageryTexture)\r\n (this.parent! as ImageryMapTile).setLeaf(); // Avoid traversing bing branches after no graphics is found.\r\n\r\n this.setIsReady();\r\n }\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], rectangleToDrape: MapCartoRectangle, drapePixelSize: number, args: TileDrawArgs): TileTreeLoadStatus {\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n if (this.isLeaf || (this.rectangle.xLength() / this.maximumSize) < drapePixelSize || this._anyChildNotFound) {\r\n if (this.isDisplayable && !this.isNotFound)\r\n drapeTiles.push(this);\r\n return TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n let status = this.loadChildren();\r\n if (TileTreeLoadStatus.Loading === status) {\r\n args.markChildrenLoading();\r\n } else if (TileTreeLoadStatus.Loaded === status) {\r\n if (undefined !== this.children) {\r\n for (const child of this.children) {\r\n const mapChild = child as ImageryMapTile;\r\n if (mapChild.rectangle.intersectsRange(rectangleToDrape))\r\n status = mapChild.selectCartoDrapeTiles(drapeTiles, rectangleToDrape, drapePixelSize, args);\r\n if (TileTreeLoadStatus.Loaded !== status)\r\n break;\r\n }\r\n }\r\n }\r\n return status;\r\n }\r\n public markMapTileUsage() {\r\n this._mapTileUsageCount++;\r\n }\r\n public releaseMapTileUsage() {\r\n assert(!this._texture || this._mapTileUsageCount > 0);\r\n if (this._mapTileUsageCount)\r\n this._mapTileUsageCount--;\r\n }\r\n\r\n /** @internal */\r\n public override setLeaf(): void {\r\n // Don't potentially re-request the children later.\r\n this.disposeChildren();\r\n this._isLeaf = true;\r\n this._childrenLoadStatus = TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n protected override _loadChildren(resolve: (children: Tile[] | undefined) => void, _reject: (error: Error) => void): void {\r\n\r\n const imageryTree = this.imageryTree;\r\n const resolveChildren = (childIds: QuadId[]) => {\r\n const children = new Array<Tile>();\r\n const childrenAreLeaves = (this.depth + 1) === imageryTree.maxDepth;\r\n // If children depth is lower than min LOD, mark them as disabled.\r\n // This is important: if those tiles are requested and the server refuse to serve them,\r\n // they will be marked as not found and their descendant will never be displayed.\r\n const childrenAreDisabled = (this.depth + 1) < imageryTree.minDepth;\r\n\r\n childIds.forEach((quadId) => {\r\n const rectangle = imageryTree.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n const range = Range3d.createXYZXYZ(rectangle.low.x, rectangle.low.x, 0, rectangle.high.x, rectangle.high.y, 0);\r\n const maximumSize = (childrenAreDisabled ? 0 : imageryTree.imageryLoader.maximumScreenSize);\r\n children.push(new ImageryMapTile({ parent: this, isLeaf: childrenAreLeaves, contentId: quadId.contentId, range, maximumSize }, imageryTree, quadId, rectangle));\r\n });\r\n\r\n resolve(children);\r\n };\r\n\r\n imageryTree.imageryLoader.generateChildIds(this, resolveChildren);\r\n }\r\n\r\n protected override _collectStatistics(stats: RenderMemory.Statistics): void {\r\n super._collectStatistics(stats);\r\n if (this._texture)\r\n stats.addTexture(this._texture.bytesUsed);\r\n }\r\n\r\n public override freeMemory(): void {\r\n // ###TODO MapTiles and ImageryMapTiles share resources and don't currently interact well with TileAdmin.freeMemory(). Opt out for now.\r\n }\r\n\r\n public override disposeContents() {\r\n if (0 === this._mapTileUsageCount) {\r\n super.disposeContents();\r\n this.disposeTexture();\r\n }\r\n }\r\n\r\n private disposeTexture(): void {\r\n this._texture = dispose(this._texture);\r\n }\r\n public override dispose() {\r\n this._mapTileUsageCount = 0;\r\n super.dispose();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTileTree extends RealityTileTree {\r\n constructor(params: RealityTileTreeParams, private _imageryLoader: ImageryTileLoader) {\r\n super(params);\r\n const rootQuadId = new QuadId(_imageryLoader.imageryProvider.tilingScheme.rootLevel, 0, 0);\r\n this._rootTile = new ImageryMapTile(params.rootTile, this, rootQuadId, this.getTileRectangle(rootQuadId));\r\n }\r\n public get tilingScheme(): MapTilingScheme { return this._imageryLoader.imageryProvider.tilingScheme; }\r\n public getLogo(vp: ScreenViewport): HTMLTableRowElement | undefined { return this._imageryLoader.getLogo(vp); }\r\n public getTileRectangle(quadId: QuadId): MapCartoRectangle {\r\n return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n }\r\n public get imageryLoader(): ImageryTileLoader { return this._imageryLoader; }\r\n public override get is3d(): boolean { assert(false); return false; }\r\n public override get viewFlagOverrides(): ViewFlagOverrides { assert(false); return {}; }\r\n public override get isContentUnbounded(): boolean { assert(false); return true; }\r\n protected override _selectTiles(_args: TileDrawArgs): Tile[] { assert(false); return []; }\r\n public override draw(_args: TileDrawArgs): void { assert(false); }\r\n\r\n private static _scratchDrapeRectangle = new MapCartoRectangle();\r\n private static _drapeIntersectionScale = 1.0 - 1.0E-5;\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], tileToDrape: MapTile, args: TileDrawArgs): TileTreeLoadStatus {\r\n const drapeRectangle = tileToDrape.rectangle.clone(ImageryMapTileTree._scratchDrapeRectangle);\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const drapePixelSize = 1.05 * tileToDrape.rectangle.xLength() / tileToDrape.maximumSize;\r\n drapeRectangle.scaleAboutCenterInPlace(ImageryMapTileTree._drapeIntersectionScale); // Contract slightly to avoid draping adjacent or slivers.\r\n return (this.rootTile as ImageryMapTile).selectCartoDrapeTiles(drapeTiles, drapeRectangle, drapePixelSize, args);\r\n }\r\n public cartoRectangleFromQuadId(quadId: QuadId): MapCartoRectangle { return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level); }\r\n}\r\n\r\nclass ImageryTileLoader extends RealityTileLoader {\r\n constructor(private _imageryProvider: MapLayerImageryProvider, private _iModel: IModelConnection) {\r\n super();\r\n }\r\n public override computeTilePriority(tile: Tile): number {\r\n return 25 * (this._imageryProvider.usesCachedTiles ? 2 : 1) - tile.depth; // Always cached first then descending by depth (high resolution/front first)\r\n } // Prioritized fast, cached tiles first.\r\n\r\n public get maxDepth(): number { return this._imageryProvider.maximumZoomLevel; }\r\n public get minDepth(): number { return this._imageryProvider.minimumZoomLevel; }\r\n public get priority(): TileLoadPriority { return TileLoadPriority.Map; }\r\n public getLogo(vp: ScreenViewport): HTMLTableRowElement | undefined { return this._imageryProvider.getLogo(vp); }\r\n public get maximumScreenSize(): number { return this._imageryProvider.maximumScreenSize; }\r\n public get imageryProvider(): MapLayerImageryProvider { return this._imageryProvider; }\r\n public async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> { await this._imageryProvider.getToolTip(strings, quadId, carto, tree); }\r\n\r\n public async getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n await this._imageryProvider.getFeatureInfo(featureInfos, quadId, carto, tree);\r\n }\r\n\r\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) { return this._imageryProvider.generateChildIds(tile, resolveChildren); }\r\n\r\n /** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */\r\n public async loadChildren(_tile: RealityTile): Promise<Tile[] | undefined> { assert(false); return undefined; }\r\n public async requestTileContent(tile: Tile, _isCanceled: () => boolean): Promise<TileRequest.Response> {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n return this._imageryProvider.loadTile(quadId.row, quadId.column, quadId.level);\r\n }\r\n\r\n public getRequestChannel(_tile: Tile) {\r\n // ###TODO use hostname from url - but so many layers to go through to get that...\r\n return IModelApp.tileAdmin.channels.getForHttp(\"itwinjs-imagery\");\r\n }\r\n\r\n public override async loadTileContent(tile: Tile, data: TileRequest.ResponseData, system: RenderSystem): Promise<ImageryTileContent> {\r\n assert(data instanceof ImageSource);\r\n assert(tile instanceof ImageryMapTile);\r\n const content: ImageryTileContent = {};\r\n const texture = await this.loadTextureImage(data, system);\r\n if (undefined === texture)\r\n return content;\r\n\r\n content.imageryTexture = texture;\r\n return content;\r\n }\r\n\r\n private async loadTextureImage(source: ImageSource, system: RenderSystem): Promise<RenderTexture | undefined> {\r\n try {\r\n return await system.createTextureFromSource({\r\n type: RenderTexture.Type.FilteredTileSection,\r\n source,\r\n });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\ninterface ImageryMapLayerTreeId {\r\n settings: ImageMapLayerSettings;\r\n}\r\n\r\n/** Supplies a TileTree that can load and draw tiles based on our imagery provider.\r\n * The TileTree is uniquely identified by its imagery type.\r\n */\r\nclass ImageryMapLayerTreeSupplier implements TileTreeSupplier {\r\n /** Return a numeric value indicating how two tree IDs are ordered relative to one another.\r\n * This allows the ID to serve as a lookup key to find the corresponding TileTree.\r\n */\r\n public compareTileTreeIds(lhs: ImageryMapLayerTreeId, rhs: ImageryMapLayerTreeId): number {\r\n let cmp = compareStrings(lhs.settings.url, rhs.settings.url);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.userName, rhs.settings.userName);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.password, rhs.settings.password);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.transparentBackground, rhs.settings.transparentBackground);\r\n if (0 === cmp) {\r\n cmp = compareNumbers(lhs.settings.subLayers.length, rhs.settings.subLayers.length);\r\n if (0 === cmp) {\r\n for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++)\r\n cmp = compareBooleans(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n /** The first time a tree of a particular imagery type is requested, this function creates it. */\r\n public async createTileTree(id: ImageryMapLayerTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n const imageryProvider = IModelApp.mapLayerFormatRegistry.createImageryProvider(id.settings);\r\n if (undefined === imageryProvider)\r\n return undefined;\r\n\r\n await imageryProvider.initialize();\r\n const modelId = iModel.transientIds.next;\r\n const tilingScheme = imageryProvider.tilingScheme;\r\n const rootLevel = (1 === tilingScheme.numberOfLevelZeroTilesX && 1 === tilingScheme.numberOfLevelZeroTilesY) ? 0 : -1;\r\n const rootTileId = new QuadId(rootLevel, 0, 0).contentId;\r\n const rootRange = Range3d.createXYZXYZ(-Angle.piRadians, -Angle.piOver2Radians, 0, Angle.piRadians, Angle.piOver2Radians, 0);\r\n const rootTileProps = { contentId: rootTileId, range: rootRange, maximumSize: 0 };\r\n const loader = new ImageryTileLoader(imageryProvider, iModel);\r\n const treeProps = { rootTile: rootTileProps, id: modelId, modelId, iModel, location: Transform.createIdentity(), priority: TileLoadPriority.Map, loader, gcsConverterAvailable: false };\r\n return new ImageryMapTileTree(treeProps, loader);\r\n }\r\n}\r\n\r\nconst imageryTreeSupplier = new ImageryMapLayerTreeSupplier();\r\n\r\n/** A reference to one of our tile trees. The specific TileTree drawn may change when the desired imagery type or target iModel changes.\r\n * @internal\r\n */\r\nexport class ImageryMapLayerTreeReference extends MapLayerTileTreeReference {\r\n public constructor(layerSettings: MapLayerSettings, layerIndex: number, iModel: IModelConnection) {\r\n super(layerSettings, layerIndex, iModel);\r\n }\r\n\r\n public override get castsShadows() { return false; }\r\n\r\n /** Return the owner of the TileTree to draw. */\r\n public get treeOwner(): TileTreeOwner {\r\n return this.iModel.tiles.getTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n public override get imageryProvider(): MapLayerImageryProvider | undefined {\r\n const tree = this.treeOwner.load();\r\n if (!tree || !(tree instanceof ImageryMapTileTree))\r\n return undefined;\r\n\r\n return tree.imageryLoader.imageryProvider;\r\n }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AU,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,IAAoB,YAAY,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IAEpD,gDAAgD;IAChD,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,mBAAmB,CAAC,CAAC;IACpG,CAAC;IACD,IAAoB,eAAe;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,YAAY,kBAAkB,CAAC;YAChD,OAAO,SAAS,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;IAC5C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, compareBooleans, compareNumbers, compareStrings, compareStringsOrUndefined, dispose } from \"@itwin/core-bentley\";\r\nimport { Angle, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, MapLayerSettings, RenderTexture, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { RenderMemory } from \"../../render/RenderMemory\";\r\nimport { RenderSystem } from \"../../render/RenderSystem\";\r\nimport { ScreenViewport } from \"../../Viewport\";\r\nimport {\r\n MapCartoRectangle, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree,\r\n RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTree, TileTreeLoadStatus, TileTreeOwner,\r\n TileTreeSupplier,\r\n} from \"../internal\";\r\n\r\n/** @internal */\r\nexport interface ImageryTileContent extends TileContent {\r\n imageryTexture?: RenderTexture;\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTile extends RealityTile {\r\n private _texture?: RenderTexture;\r\n private _mapTileUsageCount = 0;\r\n constructor(params: TileParams, public imageryTree: ImageryMapTileTree, public quadId: QuadId, public rectangle: MapCartoRectangle) {\r\n super(params, imageryTree);\r\n }\r\n public get texture() { return this._texture; }\r\n public get tilingScheme() { return this.imageryTree.tilingScheme; }\r\n public override get isDisplayable() { return (this.depth > 1) && super.isDisplayable; }\r\n\r\n public override setContent(content: ImageryTileContent): void {\r\n this._texture = content.imageryTexture; // No dispose - textures may be shared by terrain tiles so let garbage collector dispose them.\r\n if (undefined === content.imageryTexture)\r\n (this.parent! as ImageryMapTile).setLeaf(); // Avoid traversing bing branches after no graphics is found.\r\n\r\n this.setIsReady();\r\n }\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], rectangleToDrape: MapCartoRectangle, drapePixelSize: number, args: TileDrawArgs): TileTreeLoadStatus {\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n if (this.isLeaf || (this.rectangle.xLength() / this.maximumSize) < drapePixelSize || this._anyChildNotFound) {\r\n if (this.isDisplayable && !this.isNotFound)\r\n drapeTiles.push(this);\r\n return TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n let status = this.loadChildren();\r\n if (TileTreeLoadStatus.Loading === status) {\r\n args.markChildrenLoading();\r\n } else if (TileTreeLoadStatus.Loaded === status) {\r\n if (undefined !== this.children) {\r\n for (const child of this.children) {\r\n const mapChild = child as ImageryMapTile;\r\n if (mapChild.rectangle.intersectsRange(rectangleToDrape))\r\n status = mapChild.selectCartoDrapeTiles(drapeTiles, rectangleToDrape, drapePixelSize, args);\r\n if (TileTreeLoadStatus.Loaded !== status)\r\n break;\r\n }\r\n }\r\n }\r\n return status;\r\n }\r\n public markMapTileUsage() {\r\n this._mapTileUsageCount++;\r\n }\r\n public releaseMapTileUsage() {\r\n assert(!this._texture || this._mapTileUsageCount > 0);\r\n if (this._mapTileUsageCount)\r\n this._mapTileUsageCount--;\r\n }\r\n\r\n /** @internal */\r\n public override setLeaf(): void {\r\n // Don't potentially re-request the children later.\r\n this.disposeChildren();\r\n this._isLeaf = true;\r\n this._childrenLoadStatus = TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n protected override _loadChildren(resolve: (children: Tile[] | undefined) => void, _reject: (error: Error) => void): void {\r\n\r\n const imageryTree = this.imageryTree;\r\n const resolveChildren = (childIds: QuadId[]) => {\r\n const children = new Array<Tile>();\r\n const childrenAreLeaves = (this.depth + 1) === imageryTree.maxDepth;\r\n // If children depth is lower than min LOD, mark them as disabled.\r\n // This is important: if those tiles are requested and the server refuse to serve them,\r\n // they will be marked as not found and their descendant will never be displayed.\r\n const childrenAreDisabled = (this.depth + 1) < imageryTree.minDepth;\r\n\r\n childIds.forEach((quadId) => {\r\n const rectangle = imageryTree.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n const range = Range3d.createXYZXYZ(rectangle.low.x, rectangle.low.x, 0, rectangle.high.x, rectangle.high.y, 0);\r\n const maximumSize = (childrenAreDisabled ? 0 : imageryTree.imageryLoader.maximumScreenSize);\r\n children.push(new ImageryMapTile({ parent: this, isLeaf: childrenAreLeaves, contentId: quadId.contentId, range, maximumSize }, imageryTree, quadId, rectangle));\r\n });\r\n\r\n resolve(children);\r\n };\r\n\r\n imageryTree.imageryLoader.generateChildIds(this, resolveChildren);\r\n }\r\n\r\n protected override _collectStatistics(stats: RenderMemory.Statistics): void {\r\n super._collectStatistics(stats);\r\n if (this._texture)\r\n stats.addTexture(this._texture.bytesUsed);\r\n }\r\n\r\n public override freeMemory(): void {\r\n // ###TODO MapTiles and ImageryMapTiles share resources and don't currently interact well with TileAdmin.freeMemory(). Opt out for now.\r\n }\r\n\r\n public override disposeContents() {\r\n if (0 === this._mapTileUsageCount) {\r\n super.disposeContents();\r\n this.disposeTexture();\r\n }\r\n }\r\n\r\n private disposeTexture(): void {\r\n this._texture = dispose(this._texture);\r\n }\r\n public override dispose() {\r\n this._mapTileUsageCount = 0;\r\n super.dispose();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTileTree extends RealityTileTree {\r\n constructor(params: RealityTileTreeParams, private _imageryLoader: ImageryTileLoader) {\r\n super(params);\r\n const rootQuadId = new QuadId(_imageryLoader.imageryProvider.tilingScheme.rootLevel, 0, 0);\r\n this._rootTile = new ImageryMapTile(params.rootTile, this, rootQuadId, this.getTileRectangle(rootQuadId));\r\n }\r\n public get tilingScheme(): MapTilingScheme { return this._imageryLoader.imageryProvider.tilingScheme; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryLoader.addLogoCards(cards, vp);\r\n }\r\n\r\n public getTileRectangle(quadId: QuadId): MapCartoRectangle {\r\n return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n }\r\n public get imageryLoader(): ImageryTileLoader { return this._imageryLoader; }\r\n public override get is3d(): boolean { assert(false); return false; }\r\n public override get viewFlagOverrides(): ViewFlagOverrides { assert(false); return {}; }\r\n public override get isContentUnbounded(): boolean { assert(false); return true; }\r\n protected override _selectTiles(_args: TileDrawArgs): Tile[] { assert(false); return []; }\r\n public override draw(_args: TileDrawArgs): void { assert(false); }\r\n\r\n private static _scratchDrapeRectangle = new MapCartoRectangle();\r\n private static _drapeIntersectionScale = 1.0 - 1.0E-5;\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], tileToDrape: MapTile, args: TileDrawArgs): TileTreeLoadStatus {\r\n const drapeRectangle = tileToDrape.rectangle.clone(ImageryMapTileTree._scratchDrapeRectangle);\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const drapePixelSize = 1.05 * tileToDrape.rectangle.xLength() / tileToDrape.maximumSize;\r\n drapeRectangle.scaleAboutCenterInPlace(ImageryMapTileTree._drapeIntersectionScale); // Contract slightly to avoid draping adjacent or slivers.\r\n return (this.rootTile as ImageryMapTile).selectCartoDrapeTiles(drapeTiles, drapeRectangle, drapePixelSize, args);\r\n }\r\n public cartoRectangleFromQuadId(quadId: QuadId): MapCartoRectangle { return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level); }\r\n}\r\n\r\nclass ImageryTileLoader extends RealityTileLoader {\r\n constructor(private _imageryProvider: MapLayerImageryProvider, private _iModel: IModelConnection) {\r\n super();\r\n }\r\n public override computeTilePriority(tile: Tile): number {\r\n return 25 * (this._imageryProvider.usesCachedTiles ? 2 : 1) - tile.depth; // Always cached first then descending by depth (high resolution/front first)\r\n } // Prioritized fast, cached tiles first.\r\n\r\n public get maxDepth(): number { return this._imageryProvider.maximumZoomLevel; }\r\n public get minDepth(): number { return this._imageryProvider.minimumZoomLevel; }\r\n public get priority(): TileLoadPriority { return TileLoadPriority.Map; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryProvider.addLogoCards(cards, vp);\r\n }\r\n\r\n public get maximumScreenSize(): number { return this._imageryProvider.maximumScreenSize; }\r\n public get imageryProvider(): MapLayerImageryProvider { return this._imageryProvider; }\r\n public async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> { await this._imageryProvider.getToolTip(strings, quadId, carto, tree); }\r\n\r\n public async getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n await this._imageryProvider.getFeatureInfo(featureInfos, quadId, carto, tree);\r\n }\r\n\r\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) { return this._imageryProvider.generateChildIds(tile, resolveChildren); }\r\n\r\n /** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */\r\n public async loadChildren(_tile: RealityTile): Promise<Tile[] | undefined> { assert(false); return undefined; }\r\n public async requestTileContent(tile: Tile, _isCanceled: () => boolean): Promise<TileRequest.Response> {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n return this._imageryProvider.loadTile(quadId.row, quadId.column, quadId.level);\r\n }\r\n\r\n public getRequestChannel(_tile: Tile) {\r\n // ###TODO use hostname from url - but so many layers to go through to get that...\r\n return IModelApp.tileAdmin.channels.getForHttp(\"itwinjs-imagery\");\r\n }\r\n\r\n public override async loadTileContent(tile: Tile, data: TileRequest.ResponseData, system: RenderSystem): Promise<ImageryTileContent> {\r\n assert(data instanceof ImageSource);\r\n assert(tile instanceof ImageryMapTile);\r\n const content: ImageryTileContent = {};\r\n const texture = await this.loadTextureImage(data, system);\r\n if (undefined === texture)\r\n return content;\r\n\r\n content.imageryTexture = texture;\r\n return content;\r\n }\r\n\r\n private async loadTextureImage(source: ImageSource, system: RenderSystem): Promise<RenderTexture | undefined> {\r\n try {\r\n return await system.createTextureFromSource({\r\n type: RenderTexture.Type.FilteredTileSection,\r\n source,\r\n });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\ninterface ImageryMapLayerTreeId {\r\n settings: ImageMapLayerSettings;\r\n}\r\n\r\n/** Supplies a TileTree that can load and draw tiles based on our imagery provider.\r\n * The TileTree is uniquely identified by its imagery type.\r\n */\r\nclass ImageryMapLayerTreeSupplier implements TileTreeSupplier {\r\n /** Return a numeric value indicating how two tree IDs are ordered relative to one another.\r\n * This allows the ID to serve as a lookup key to find the corresponding TileTree.\r\n */\r\n public compareTileTreeIds(lhs: ImageryMapLayerTreeId, rhs: ImageryMapLayerTreeId): number {\r\n let cmp = compareStrings(lhs.settings.url, rhs.settings.url);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.userName, rhs.settings.userName);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.password, rhs.settings.password);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.transparentBackground, rhs.settings.transparentBackground);\r\n if (0 === cmp) {\r\n cmp = compareNumbers(lhs.settings.subLayers.length, rhs.settings.subLayers.length);\r\n if (0 === cmp) {\r\n for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++)\r\n cmp = compareBooleans(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n /** The first time a tree of a particular imagery type is requested, this function creates it. */\r\n public async createTileTree(id: ImageryMapLayerTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n const imageryProvider = IModelApp.mapLayerFormatRegistry.createImageryProvider(id.settings);\r\n if (undefined === imageryProvider)\r\n return undefined;\r\n\r\n await imageryProvider.initialize();\r\n const modelId = iModel.transientIds.next;\r\n const tilingScheme = imageryProvider.tilingScheme;\r\n const rootLevel = (1 === tilingScheme.numberOfLevelZeroTilesX && 1 === tilingScheme.numberOfLevelZeroTilesY) ? 0 : -1;\r\n const rootTileId = new QuadId(rootLevel, 0, 0).contentId;\r\n const rootRange = Range3d.createXYZXYZ(-Angle.piRadians, -Angle.piOver2Radians, 0, Angle.piRadians, Angle.piOver2Radians, 0);\r\n const rootTileProps = { contentId: rootTileId, range: rootRange, maximumSize: 0 };\r\n const loader = new ImageryTileLoader(imageryProvider, iModel);\r\n const treeProps = { rootTile: rootTileProps, id: modelId, modelId, iModel, location: Transform.createIdentity(), priority: TileLoadPriority.Map, loader, gcsConverterAvailable: false };\r\n return new ImageryMapTileTree(treeProps, loader);\r\n }\r\n}\r\n\r\nconst imageryTreeSupplier = new ImageryMapLayerTreeSupplier();\r\n\r\n/** A reference to one of our tile trees. The specific TileTree drawn may change when the desired imagery type or target iModel changes.\r\n * @internal\r\n */\r\nexport class ImageryMapLayerTreeReference extends MapLayerTileTreeReference {\r\n public constructor(layerSettings: MapLayerSettings, layerIndex: number, iModel: IModelConnection) {\r\n super(layerSettings, layerIndex, iModel);\r\n }\r\n\r\n public override get castsShadows() { return false; }\r\n\r\n /** Return the owner of the TileTree to draw. */\r\n public get treeOwner(): TileTreeOwner {\r\n return this.iModel.tiles.getTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n public override get imageryProvider(): MapLayerImageryProvider | undefined {\r\n const tree = this.treeOwner.load();\r\n if (!tree || !(tree instanceof ImageryMapTileTree))\r\n return undefined;\r\n\r\n return tree.imageryLoader.imageryProvider;\r\n }\r\n}\r\n"]}
|
|
@@ -28,6 +28,7 @@ export declare class MapCartoRectangle extends Range2d {
|
|
|
28
28
|
containsCartographic(carto: Cartographic): boolean;
|
|
29
29
|
getCenter(result?: Cartographic): Cartographic;
|
|
30
30
|
fractionFromCartographic(carto: Cartographic): Point2d | undefined;
|
|
31
|
+
/** @internal */
|
|
31
32
|
getTileFractionRange(tilingScheme: MapTilingScheme): Range2d;
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=MapCartoRectangle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapCartoRectangle.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapCartoRectangle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAS,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAK9C;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,OAAO;gBACzB,IAAI,SAAI,EAAE,KAAK,SAAI,EAAE,IAAI,SAAI,EAAE,KAAK,SAAI;WAG7C,MAAM,CAAC,IAAI,SAAmB,EAAE,KAAK,SAAwB,EAAE,IAAI,SAAkB,EAAE,KAAK,SAAuB,EAAE,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
48
48
|
return Cartographic.fromRadians({ longitude: (this.west + this.east) / 2, latitude: (this.north + this.south) / 2, height: 0 }, result);
|
|
49
49
|
}
|
|
50
50
|
fractionFromCartographic(carto) { return this.worldToLocal(Point2d.create(carto.longitude, carto.latitude, scratchPoint2d)); }
|
|
51
|
+
/** @internal */
|
|
51
52
|
getTileFractionRange(tilingScheme) {
|
|
52
53
|
scratchMercatorFractionRange.low.x = tilingScheme.longitudeToXFraction(this.low.x);
|
|
53
54
|
scratchMercatorFractionRange.high.x = tilingScheme.longitudeToXFraction(this.high.x);
|
|
@@ -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;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO;IAC5C,YAAmB,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC;QACzD,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;IACM,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,GAAG,KAAK,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK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C,CAAC,CAAC;IAExK,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { Angle, Point2d, Range2d } from \"@itwin/core-geometry\";\r\nimport { Cartographic } from \"@itwin/core-common\";\r\nimport { GlobalLocation, GlobalLocationArea } from \"../../ViewGlobalLocation\";\r\nimport { MapTilingScheme } from \"../internal\";\r\n\r\nconst scratchMercatorFractionRange = Range2d.createNull();\r\nconst scratchPoint2d = Point2d.createZero();\r\n\r\n/** A specialization of Range2d that represents a cartographic range used by map tiles.\r\n * @internal\r\n */\r\nexport class MapCartoRectangle extends Range2d {\r\n public constructor(west = 0, south = 0, east = 0, north = 0) {\r\n super(west, Math.min(south, north), east, Math.max(south, north));\r\n }\r\n public static create(west = -Angle.piRadians, south = -Angle.piOver2Radians, east = Angle.piRadians, north = Angle.piOver2Radians, result?: MapCartoRectangle): MapCartoRectangle {\r\n if (!result)\r\n return new MapCartoRectangle(west, south, east, north);\r\n result.init(west, south, east, north);\r\n return result;\r\n }\r\n\r\n public static createFromDegrees(west = -180, south = -90, east = 180, north = 90, result?: MapCartoRectangle): MapCartoRectangle {\r\n return MapCartoRectangle.create(west * Angle.radiansPerDegree, south * Angle.radiansPerDegree, east * Angle.radiansPerDegree, north * Angle.radiansPerDegree, result);\r\n }\r\n\r\n public get west() { return this.low.x; }\r\n public set west(x: number) { this.low.x = x; }\r\n public get south() { return this.low.y; }\r\n public set south(y: number) { this.low.y = y; }\r\n public get east() { return this.high.x; }\r\n public set east(x: number) { this.high.x = x; }\r\n public get north() { return this.high.y; }\r\n public set north(y: number) { this.high.y = y; }\r\n public get latLongString() { return `Latitude: ${this.low.y * Angle.degreesPerRadian} - ${this.high.y * Angle.degreesPerRadian} Longitude: ${this.low.x * Angle.degreesPerRadian} - ${this.high.x * Angle.degreesPerRadian}`; }\r\n public get globalLocationArea(): GlobalLocationArea { return { southwest: Cartographic.fromRadians({longitude: this.west, latitude: this.south}), northeast: Cartographic.fromRadians({longitude: this.east, latitude: this.north}) }; }\r\n public get cartoCenter() { return Cartographic.fromRadians({longitude: (this.low.x + this.high.x) / 2, latitude: (this.low.y + this.high.y) / 2}); }\r\n public get globalLocation(): GlobalLocation { return { center: this.cartoCenter, area: this.globalLocationArea }; }\r\n\r\n public init(west = 0, south = 0, east = 0, north = 0) {\r\n this.west = west;\r\n this.south = south;\r\n this.east = east;\r\n this.north = north;\r\n }\r\n public containsCartographic(carto: Cartographic) { return this.containsXY(carto.longitude, carto.latitude); }\r\n public getCenter(result?: Cartographic): Cartographic {\r\n return Cartographic.fromRadians({longitude: (this.west + this.east) / 2, latitude: (this.north + this.south) / 2, height: 0}, result);\r\n }\r\n public fractionFromCartographic(carto: Cartographic): Point2d | undefined { return this.worldToLocal(Point2d.create(carto.longitude, carto.latitude, scratchPoint2d)); }\r\n\r\n /** @internal */\r\n public getTileFractionRange(tilingScheme: MapTilingScheme) {\r\n scratchMercatorFractionRange.low.x = tilingScheme.longitudeToXFraction(this.low.x);\r\n scratchMercatorFractionRange.high.x = tilingScheme.longitudeToXFraction(this.high.x);\r\n scratchMercatorFractionRange.low.y = tilingScheme.latitudeToYFraction(this.low.y);\r\n scratchMercatorFractionRange.high.y = tilingScheme.latitudeToYFraction(this.high.y);\r\n\r\n return scratchMercatorFractionRange;\r\n }\r\n}\r\n"]}
|
|
@@ -17,10 +17,11 @@ export declare class MapLayerFormat {
|
|
|
17
17
|
}
|
|
18
18
|
/** @beta */
|
|
19
19
|
export declare type MapLayerFormatType = typeof MapLayerFormat;
|
|
20
|
-
/** @
|
|
20
|
+
/** @public */
|
|
21
21
|
export interface MapLayerSourceValidation {
|
|
22
22
|
status: MapLayerSourceStatus;
|
|
23
23
|
subLayers?: MapSubLayerProps[];
|
|
24
|
+
/** @beta */
|
|
24
25
|
authInfo?: MapLayerAuthenticationInfo;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerFormatRegistry.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAkC,oBAAoB,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACvN,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,YAAY;AACZ,qBAAa,cAAc;IACzB,OAAc,QAAQ,EAAE,MAAM,CAAC;WACjB,QAAQ;IAEtB,gBAAgB;WACF,qBAAqB,CAAC,SAAS,EAAE,gBAAgB,GAAG,uBAAuB,GAAG,SAAS;IACrG,gBAAgB;WAC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EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,uBAAuB,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAK5J"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerFormatRegistry.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAgC,8BAA8B,EAA6E,oBAAoB,EAA6B,MAAM,aAAa,CAAC;AAGvN,YAAY;AACZ,MAAM,OAAO,cAAc;IAElB,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7E,gBAAgB;IACT,MAAM,CAAC,qBAAqB,CAAC,SAA2B,IAAyC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxH,gBAAgB;IACT,MAAM,CAAC,kBAAkB,CAAC,cAAgC,EAAE,WAAmB,EAAE,OAAyB;QAC/G,MAAM,CAAC,KAAK,CAAC,CAAC;QACd,OAAO,SAAS,CAAC;IACnB,CAAC;IACM,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,IAAY,EAAE,YAAsC,EAAE,YAAsB,IAAuC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CACvM;
|
|
1
|
+
{"version":3,"file":"MapLayerFormatRegistry.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,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QAAQ,CAAE,CAAC;YAClE,MAAM,GAAG,GAAgB,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,CAAC;YAC9E,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;SACzD;QACD,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC1F,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,QAAgB,EAAE,GAAW,EAAE,WAAqC,EAAE,WAAqB;QACrH,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC1C,MAAM,MAAM,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC;QAC3B,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACxI,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { ImageMapLayerSettings, MapLayerKey, MapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { ImageryMapLayerTreeReference, internalMapLayerImageryFormats, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerImageryProvider, MapLayerSourceStatus, MapLayerTileTreeReference } from \"../internal\";\r\nimport { RequestBasicCredentials } from \"../../request/Request\";\r\n\r\n/** @beta */\r\nexport class MapLayerFormat {\r\n public static formatId: string;\r\n public static register() { IModelApp.mapLayerFormatRegistry.register(this); }\r\n\r\n /** @internal */\r\n public static createImageryProvider(_settings: MapLayerSettings): MapLayerImageryProvider | undefined { assert(false); }\r\n /** @internal */\r\n public static createMapLayerTree(_layerSettings: MapLayerSettings, _layerIndex: number, _iModel: IModelConnection): MapLayerTileTreeReference | undefined {\r\n assert(false);\r\n return undefined;\r\n }\r\n public static async validateSource(_url: string, _credentials?: RequestBasicCredentials, _ignoreCache?: boolean): Promise<MapLayerSourceValidation> { return { status: MapLayerSourceStatus.Valid }; }\r\n}\r\n\r\n/** @beta */\r\nexport type MapLayerFormatType = typeof MapLayerFormat;\r\n\r\n/** @public */\r\nexport interface MapLayerSourceValidation {\r\n status: MapLayerSourceStatus;\r\n subLayers?: MapSubLayerProps[];\r\n\r\n /** @beta */\r\n authInfo?: MapLayerAuthenticationInfo;\r\n}\r\n\r\n/**\r\n * Options supplied at startup via [[IModelAppOptions.mapLayerOptions]] to specify access keys for various map layer formats.\r\n * 'BingMaps' must have it's key value set to 'key'\r\n * 'MapboxImagery' must have it's key value set to 'access_token'\r\n *\r\n * @beta\r\n */\r\nexport interface MapLayerOptions {\r\n /** Access key for Azure Maps in the format `{ key: \"subscription-key\", value: \"your-azure-maps-key\" }`. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n AzureMaps?: MapLayerKey;\r\n /** Access key for Mapbox in the format `{ key: \"access_token\", value: \"your-mapbox-key\" }`. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n MapboxImagery?: MapLayerKey;\r\n /** Access key for Bing Maps in the format `{ key: \"key\", value: \"your-bing-maps-key\" }`. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n BingMaps?: MapLayerKey;\r\n /** Access keys for additional map layer formats. */\r\n [format: string]: MapLayerKey | undefined;\r\n}\r\n\r\n/** @internal */\r\nexport interface MapLayerFormatEntry {\r\n type: MapLayerFormatType;\r\n accessClient?: MapLayerAccessClient;\r\n}\r\n\r\n/** @beta */\r\nexport class MapLayerFormatRegistry {\r\n private _configOptions: MapLayerOptions;\r\n constructor(opts?: MapLayerOptions) {\r\n this._configOptions = opts ?? {};\r\n internalMapLayerImageryFormats.forEach((format) => this.register(format));\r\n }\r\n private _formats = new Map<string, MapLayerFormatEntry>();\r\n public register(formatClass: MapLayerFormatType, accessClient?: MapLayerAccessClient) {\r\n if (formatClass.formatId.length === 0)\r\n return; // must be an abstract class, ignore it\r\n\r\n this._formats.set(formatClass.formatId, {type: formatClass, accessClient});\r\n }\r\n\r\n public setAccessClient(formatId: string, accessClient: MapLayerAccessClient ): boolean {\r\n const entry = this._formats.get(formatId);\r\n if (entry !== undefined) {\r\n entry.accessClient = accessClient;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n public getAccessClient(formatId: string): MapLayerAccessClient | undefined {\r\n if (formatId.length === 0)\r\n return undefined;\r\n\r\n return this._formats.get(formatId)?.accessClient;\r\n }\r\n\r\n public get configOptions(): MapLayerOptions {\r\n return this._configOptions;\r\n }\r\n\r\n /** @internal */\r\n public createImageryMapLayerTree(layerSettings: ImageMapLayerSettings, layerIndex: number, iModel: IModelConnection): ImageryMapLayerTreeReference | undefined {\r\n const entry = this._formats.get(layerSettings.formatId);\r\n const format = entry?.type;\r\n return format !== undefined ? (format.createMapLayerTree(layerSettings, layerIndex, iModel) as ImageryMapLayerTreeReference) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public createImageryProvider(layerSettings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\r\n const entry = this._formats.get(layerSettings.formatId);\r\n const format = entry?.type;\r\n if (this._configOptions[layerSettings.formatId] !== undefined) {\r\n const keyValuePair = this._configOptions[layerSettings.formatId]!;\r\n const key: MapLayerKey = { key: keyValuePair.key, value: keyValuePair.value };\r\n layerSettings = layerSettings.clone({ accessKey: key });\r\n }\r\n return (format === undefined) ? undefined : format.createImageryProvider(layerSettings);\r\n }\r\n\r\n public async validateSource(formatId: string, url: string, credentials?: RequestBasicCredentials, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\r\n const entry = this._formats.get(formatId);\r\n const format = entry?.type;\r\n return (format === undefined) ? { status: MapLayerSourceStatus.InvalidFormat } : format.validateSource(url, credentials, ignoreCache);\r\n }\r\n}\r\n"]}
|
|
@@ -35,7 +35,7 @@ export declare abstract class MapLayerImageryProvider {
|
|
|
35
35
|
initialize(): Promise<void>;
|
|
36
36
|
abstract constructUrl(row: number, column: number, zoomLevel: number): Promise<string>;
|
|
37
37
|
get tilingScheme(): MapTilingScheme;
|
|
38
|
-
|
|
38
|
+
addLogoCards(_cards: HTMLTableElement, _viewport: ScreenViewport): void;
|
|
39
39
|
protected _missingTileData?: Uint8Array;
|
|
40
40
|
get transparentBackgroundString(): string;
|
|
41
41
|
protected _areChildrenAvailable(_tile: ImageryMapTile): Promise<boolean>;
|
|
@@ -54,6 +54,8 @@ export declare abstract class MapLayerImageryProvider {
|
|
|
54
54
|
matchesMissingTile(tileData: Uint8Array): boolean;
|
|
55
55
|
getEPSG3857X(longitude: number): number;
|
|
56
56
|
getEPSG3857Y(latitude: number): number;
|
|
57
|
+
getEPSG4326Lon(x3857: number): number;
|
|
58
|
+
getEPSG4326Lat(y3857: number): number;
|
|
57
59
|
getEPSG4326Extent(row: number, column: number, zoomLevel: number): {
|
|
58
60
|
longitudeLeft: number;
|
|
59
61
|
longitudeRight: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"MapLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryProvider.ts"],"names":[],"mappings":"AAI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
|
*/
|
|
8
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
8
|
+
import { assert, BeEvent } from "@itwin/core-bentley";
|
|
9
9
|
import { ImageSource, ImageSourceFormat } from "@itwin/core-common";
|
|
10
|
+
import { Angle } from "@itwin/core-geometry";
|
|
10
11
|
import { IModelApp } from "../../IModelApp";
|
|
11
12
|
import { NotifyMessageDetails, OutputMessagePriority } from "../../NotificationManager";
|
|
12
13
|
import { getJson, request } from "../../request/Request";
|
|
13
14
|
import { GeographicTilingScheme, WebMercatorTilingScheme } from "../internal";
|
|
14
15
|
const tileImageSize = 256, untiledImageSize = 256;
|
|
16
|
+
const earthRadius = 6378137;
|
|
15
17
|
const doDebugToolTips = false;
|
|
16
18
|
/** @internal */
|
|
17
19
|
export var MapLayerImageryProviderStatus;
|
|
@@ -49,7 +51,7 @@ export class MapLayerImageryProvider {
|
|
|
49
51
|
});
|
|
50
52
|
}
|
|
51
53
|
get tilingScheme() { return this.useGeographicTilingScheme ? this._geographicTilingScheme : this._mercatorTilingScheme; }
|
|
52
|
-
|
|
54
|
+
addLogoCards(_cards, _viewport) { }
|
|
53
55
|
get transparentBackgroundString() { return this._settings.transparentBackground ? "true" : "false"; }
|
|
54
56
|
async _areChildrenAvailable(_tile) { return true; }
|
|
55
57
|
getPotentialChildIds(tile) {
|
|
@@ -86,15 +88,18 @@ export class MapLayerImageryProvider {
|
|
|
86
88
|
if (this.matchesMissingTile(byteArray) && zoomLevel > 8)
|
|
87
89
|
return undefined;
|
|
88
90
|
let imageFormat;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
// Note: 'includes' is used here instead of exact comparison because we encountered
|
|
92
|
+
// some servers that would give content type such as 'image/png;charset=UTF-8'.
|
|
93
|
+
const contentType = tileResponse.header["content-type"].toLowerCase();
|
|
94
|
+
if (contentType.includes("image/jpeg")) {
|
|
95
|
+
imageFormat = ImageSourceFormat.Jpeg;
|
|
96
|
+
}
|
|
97
|
+
else if (contentType.includes("image/png")) {
|
|
98
|
+
imageFormat = ImageSourceFormat.Png;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
assert(false, "Invalid tile content type");
|
|
102
|
+
return undefined;
|
|
98
103
|
}
|
|
99
104
|
return new ImageSource(byteArray, imageFormat);
|
|
100
105
|
}
|
|
@@ -178,6 +183,15 @@ export class MapLayerImageryProvider {
|
|
|
178
183
|
const y = Math.log(Math.tan((90.0 + latitude) * Math.PI / 360.0)) / (Math.PI / 180.0);
|
|
179
184
|
return y * 20037508.34 / 180.0;
|
|
180
185
|
}
|
|
186
|
+
// calculates the longitude in EPSG:4326 (WGS84) from the projected x cartesian coordinate in EPSG:3857
|
|
187
|
+
getEPSG4326Lon(x3857) {
|
|
188
|
+
return Angle.radiansToDegrees(x3857 / earthRadius);
|
|
189
|
+
}
|
|
190
|
+
// calculates the latitude in EPSG:4326 (WGS84) from the projected y cartesian coordinate in EPSG:3857
|
|
191
|
+
getEPSG4326Lat(y3857) {
|
|
192
|
+
const y = 2 * Math.atan(Math.exp(y3857 / earthRadius)) - (Math.PI / 2);
|
|
193
|
+
return Angle.radiansToDegrees(y);
|
|
194
|
+
}
|
|
181
195
|
// Map tile providers like Bing and Mapbox allow the URL to be constructed directory from the zoom level and tile coordinates.
|
|
182
196
|
// However, WMS-based servers take a bounding box instead. This method can help get that bounding box from a tile.
|
|
183
197
|
getEPSG4326Extent(row, column, zoomLevel) {
|