@itwin/core-frontend 3.0.0-dev.138 → 3.0.0-dev.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/AccuSnap.js +3 -3
- package/lib/cjs/AccuSnap.js.map +1 -1
- package/lib/cjs/ApproximateTerrainHeights.d.ts.map +1 -1
- package/lib/cjs/ApproximateTerrainHeights.js +2 -1
- package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
- package/lib/cjs/HitDetail.js +7 -7
- package/lib/cjs/HitDetail.js.map +1 -1
- package/lib/cjs/IModelApp.d.ts +11 -1
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +7 -2
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/ViewManager.d.ts.map +1 -1
- package/lib/cjs/ViewManager.js +8 -8
- package/lib/cjs/ViewManager.js.map +1 -1
- package/lib/cjs/Viewport.js +1 -1
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/render/MockRender.d.ts +3 -1
- package/lib/cjs/render/MockRender.d.ts.map +1 -1
- package/lib/cjs/render/MockRender.js.map +1 -1
- package/lib/cjs/render/RenderSystem.d.ts +3 -1
- package/lib/cjs/render/RenderSystem.d.ts.map +1 -1
- package/lib/cjs/render/RenderSystem.js +4 -2
- package/lib/cjs/render/RenderSystem.js.map +1 -1
- package/lib/cjs/render/primitives/EdgeParams.d.ts +50 -0
- package/lib/cjs/render/primitives/EdgeParams.d.ts.map +1 -0
- package/lib/cjs/render/primitives/EdgeParams.js +116 -0
- package/lib/cjs/render/primitives/EdgeParams.js.map +1 -0
- package/lib/cjs/render/primitives/PointStringParams.d.ts +16 -0
- package/lib/cjs/render/primitives/PointStringParams.d.ts.map +1 -0
- package/lib/cjs/render/primitives/PointStringParams.js +43 -0
- package/lib/cjs/render/primitives/PointStringParams.js.map +1 -0
- package/lib/cjs/render/primitives/PolylineParams.d.ts +44 -0
- package/lib/cjs/render/primitives/PolylineParams.d.ts.map +1 -0
- package/lib/cjs/render/primitives/PolylineParams.js +205 -0
- package/lib/cjs/render/primitives/PolylineParams.js.map +1 -0
- package/lib/cjs/render/primitives/SurfaceParams.d.ts +46 -0
- package/lib/cjs/render/primitives/SurfaceParams.d.ts.map +1 -0
- package/lib/cjs/render/primitives/SurfaceParams.js +42 -0
- package/lib/cjs/render/primitives/SurfaceParams.js.map +1 -0
- package/lib/cjs/render/primitives/VertexTable.d.ts +3 -123
- package/lib/cjs/render/primitives/VertexTable.d.ts.map +1 -1
- package/lib/cjs/render/primitives/VertexTable.js +10 -351
- package/lib/cjs/render/primitives/VertexTable.js.map +1 -1
- package/lib/cjs/render/webgl/CachedGeometry.d.ts +4 -2
- package/lib/cjs/render/webgl/CachedGeometry.d.ts.map +1 -1
- package/lib/cjs/render/webgl/CachedGeometry.js.map +1 -1
- package/lib/cjs/render/webgl/EdgeGeometry.d.ts +73 -0
- package/lib/cjs/render/webgl/EdgeGeometry.d.ts.map +1 -0
- package/lib/cjs/render/webgl/EdgeGeometry.js +141 -0
- package/lib/cjs/render/webgl/EdgeGeometry.js.map +1 -0
- package/lib/cjs/render/webgl/InstancedGeometry.d.ts +4 -4
- package/lib/cjs/render/webgl/InstancedGeometry.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Material.d.ts +1 -1
- package/lib/cjs/render/webgl/Material.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Material.js.map +1 -1
- package/lib/cjs/render/webgl/Mesh.d.ts +6 -162
- package/lib/cjs/render/webgl/Mesh.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Mesh.js +11 -456
- package/lib/cjs/render/webgl/Mesh.js.map +1 -1
- package/lib/cjs/render/webgl/MeshData.d.ts +38 -0
- package/lib/cjs/render/webgl/MeshData.d.ts.map +1 -0
- package/lib/cjs/render/webgl/MeshData.js +66 -0
- package/lib/cjs/render/webgl/MeshData.js.map +1 -0
- package/lib/cjs/render/webgl/MeshGeometry.d.ts +38 -0
- package/lib/cjs/render/webgl/MeshGeometry.d.ts.map +1 -0
- package/lib/cjs/render/webgl/MeshGeometry.js +60 -0
- package/lib/cjs/render/webgl/MeshGeometry.js.map +1 -0
- package/lib/cjs/render/webgl/PointString.d.ts +1 -1
- package/lib/cjs/render/webgl/PointString.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PointString.js.map +1 -1
- package/lib/cjs/render/webgl/Polyline.d.ts +1 -1
- package/lib/cjs/render/webgl/Polyline.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Polyline.js.map +1 -1
- package/lib/cjs/render/webgl/RenderCommands.js +4 -4
- package/lib/cjs/render/webgl/RenderCommands.js.map +1 -1
- package/lib/cjs/render/webgl/SurfaceGeometry.d.ts +54 -0
- package/lib/cjs/render/webgl/SurfaceGeometry.d.ts.map +1 -0
- package/lib/cjs/render/webgl/SurfaceGeometry.js +240 -0
- package/lib/cjs/render/webgl/SurfaceGeometry.js.map +1 -0
- package/lib/cjs/render/webgl/System.d.ts +3 -1
- package/lib/cjs/render/webgl/System.d.ts.map +1 -1
- package/lib/cjs/render/webgl/System.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/Surface.js +3 -3
- package/lib/cjs/render/webgl/glsl/Surface.js.map +1 -1
- package/lib/cjs/render-primitives.d.ts +5 -1
- package/lib/cjs/render-primitives.d.ts.map +1 -1
- package/lib/cjs/render-primitives.js +5 -1
- package/lib/cjs/render-primitives.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
- package/lib/cjs/tile/ImdlReader.js +8 -5
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.js +1 -1
- package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
- package/lib/cjs/webgl.d.ts +4 -0
- package/lib/cjs/webgl.d.ts.map +1 -1
- package/lib/cjs/webgl.js +4 -0
- package/lib/cjs/webgl.js.map +1 -1
- package/lib/esm/AccuSnap.js +3 -3
- package/lib/esm/AccuSnap.js.map +1 -1
- package/lib/esm/ApproximateTerrainHeights.d.ts.map +1 -1
- package/lib/esm/ApproximateTerrainHeights.js +2 -1
- package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
- package/lib/esm/HitDetail.js +7 -7
- package/lib/esm/HitDetail.js.map +1 -1
- package/lib/esm/IModelApp.d.ts +11 -1
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +7 -2
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/ViewManager.d.ts.map +1 -1
- package/lib/esm/ViewManager.js +8 -8
- package/lib/esm/ViewManager.js.map +1 -1
- package/lib/esm/Viewport.js +1 -1
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/render/MockRender.d.ts +3 -1
- package/lib/esm/render/MockRender.d.ts.map +1 -1
- package/lib/esm/render/MockRender.js.map +1 -1
- package/lib/esm/render/RenderSystem.d.ts +3 -1
- package/lib/esm/render/RenderSystem.d.ts.map +1 -1
- package/lib/esm/render/RenderSystem.js +3 -1
- package/lib/esm/render/RenderSystem.js.map +1 -1
- package/lib/esm/render/primitives/EdgeParams.d.ts +50 -0
- package/lib/esm/render/primitives/EdgeParams.d.ts.map +1 -0
- package/lib/esm/render/primitives/EdgeParams.js +113 -0
- package/lib/esm/render/primitives/EdgeParams.js.map +1 -0
- package/lib/esm/render/primitives/PointStringParams.d.ts +16 -0
- package/lib/esm/render/primitives/PointStringParams.d.ts.map +1 -0
- package/lib/esm/render/primitives/PointStringParams.js +39 -0
- package/lib/esm/render/primitives/PointStringParams.js.map +1 -0
- package/lib/esm/render/primitives/PolylineParams.d.ts +44 -0
- package/lib/esm/render/primitives/PolylineParams.d.ts.map +1 -0
- package/lib/esm/render/primitives/PolylineParams.js +199 -0
- package/lib/esm/render/primitives/PolylineParams.js.map +1 -0
- package/lib/esm/render/primitives/SurfaceParams.d.ts +46 -0
- package/lib/esm/render/primitives/SurfaceParams.d.ts.map +1 -0
- package/lib/esm/render/primitives/SurfaceParams.js +37 -0
- package/lib/esm/render/primitives/SurfaceParams.js.map +1 -0
- package/lib/esm/render/primitives/VertexTable.d.ts +3 -123
- package/lib/esm/render/primitives/VertexTable.d.ts.map +1 -1
- package/lib/esm/render/primitives/VertexTable.js +5 -341
- package/lib/esm/render/primitives/VertexTable.js.map +1 -1
- package/lib/esm/render/webgl/CachedGeometry.d.ts +4 -2
- package/lib/esm/render/webgl/CachedGeometry.d.ts.map +1 -1
- package/lib/esm/render/webgl/CachedGeometry.js.map +1 -1
- package/lib/esm/render/webgl/EdgeGeometry.d.ts +73 -0
- package/lib/esm/render/webgl/EdgeGeometry.d.ts.map +1 -0
- package/lib/esm/render/webgl/EdgeGeometry.js +135 -0
- package/lib/esm/render/webgl/EdgeGeometry.js.map +1 -0
- package/lib/esm/render/webgl/InstancedGeometry.d.ts +4 -4
- package/lib/esm/render/webgl/InstancedGeometry.d.ts.map +1 -1
- package/lib/esm/render/webgl/Material.d.ts +1 -1
- package/lib/esm/render/webgl/Material.d.ts.map +1 -1
- package/lib/esm/render/webgl/Material.js.map +1 -1
- package/lib/esm/render/webgl/Mesh.d.ts +6 -162
- package/lib/esm/render/webgl/Mesh.d.ts.map +1 -1
- package/lib/esm/render/webgl/Mesh.js +5 -443
- package/lib/esm/render/webgl/Mesh.js.map +1 -1
- package/lib/esm/render/webgl/MeshData.d.ts +38 -0
- package/lib/esm/render/webgl/MeshData.d.ts.map +1 -0
- package/lib/esm/render/webgl/MeshData.js +62 -0
- package/lib/esm/render/webgl/MeshData.js.map +1 -0
- package/lib/esm/render/webgl/MeshGeometry.d.ts +38 -0
- package/lib/esm/render/webgl/MeshGeometry.d.ts.map +1 -0
- package/lib/esm/render/webgl/MeshGeometry.js +56 -0
- package/lib/esm/render/webgl/MeshGeometry.js.map +1 -0
- package/lib/esm/render/webgl/PointString.d.ts +1 -1
- package/lib/esm/render/webgl/PointString.d.ts.map +1 -1
- package/lib/esm/render/webgl/PointString.js.map +1 -1
- package/lib/esm/render/webgl/Polyline.d.ts +1 -1
- package/lib/esm/render/webgl/Polyline.d.ts.map +1 -1
- package/lib/esm/render/webgl/Polyline.js.map +1 -1
- package/lib/esm/render/webgl/RenderCommands.js +1 -1
- package/lib/esm/render/webgl/RenderCommands.js.map +1 -1
- package/lib/esm/render/webgl/SurfaceGeometry.d.ts +54 -0
- package/lib/esm/render/webgl/SurfaceGeometry.d.ts.map +1 -0
- package/lib/esm/render/webgl/SurfaceGeometry.js +235 -0
- package/lib/esm/render/webgl/SurfaceGeometry.js.map +1 -0
- package/lib/esm/render/webgl/System.d.ts +3 -1
- package/lib/esm/render/webgl/System.d.ts.map +1 -1
- package/lib/esm/render/webgl/System.js.map +1 -1
- package/lib/esm/render/webgl/glsl/Surface.js +1 -1
- package/lib/esm/render/webgl/glsl/Surface.js.map +1 -1
- package/lib/esm/render-primitives.d.ts +5 -1
- package/lib/esm/render-primitives.d.ts.map +1 -1
- package/lib/esm/render-primitives.js +5 -1
- package/lib/esm/render-primitives.js.map +1 -1
- package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
- package/lib/esm/tile/ImdlReader.js +4 -1
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.js +1 -1
- package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
- package/lib/esm/webgl.d.ts +4 -0
- package/lib/esm/webgl.d.ts.map +1 -1
- package/lib/esm/webgl.js +4 -0
- package/lib/esm/webgl.js.map +1 -1
- package/package.json +22 -22
|
@@ -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,sDAAyE;AAGzE,wDAA0E;AAC1E,kDAA+C;AAE/C,6CAGwB;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,YAAY,CAAC,CAAC;QAC5D,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB;YACvC,OAAO,KAAK,CAAC;QACf,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB;YACvC,OAAO,KAAK,CAAC;QACf,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,oBAAoB;YACzC,OAAO,KAAK,CAAC;QACf,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,mBAAmB;YACxC,OAAO,KAAK,CAAC;QACf,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,mBAAmB;YACzC,OAAO,KAAK,CAAC;QACf,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,kBAAkB;YACx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a,GAAG,IAAI,KAAK,EAAmB,CAAC;YACpD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SAC1C;IACH,CAAC;CACF;AA7ID,oEA6IC","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 { ImageSource, MapLayerSettings } from \"@itwin/core-common\";\r\nimport { request, RequestOptions, Response } from \"@bentley/itwin-client\";\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: MapLayerSettings) {\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.getTilesForViewport(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: \"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,sDAAyE;AAGzE,wDAA0E;AAC1E,kDAA+C;AAE/C,6CAGwB;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,YAAY,CAAC,CAAC;QAC5D,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB;YACvC,OAAO,KAAK,CAAC;QACf,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB;YACvC,OAAO,KAAK,CAAC;QACf,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,oBAAoB;YACzC,OAAO,KAAK,CAAC;QACf,IAAI,KAAK,CAAC,GAAG,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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;AA7ID,oEA6IC","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 { ImageSource, MapLayerSettings } from \"@itwin/core-common\";\r\nimport { request, RequestOptions, Response } from \"@bentley/itwin-client\";\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: MapLayerSettings) {\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.getTilesForViewport(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"]}
|
|
@@ -142,7 +142,7 @@ class MapLayerSources {
|
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
if (queryForPublicSources) {
|
|
145
|
-
const sourcesJson = await (0, itwin_client_1.getJson)(
|
|
145
|
+
const sourcesJson = await (0, itwin_client_1.getJson)(`${IModelApp_1.IModelApp.publicPath}assets/MapLayerSources.json`);
|
|
146
146
|
for (const sourceJson of sourcesJson) {
|
|
147
147
|
const source = MapLayerSource.fromJSON(sourceJson);
|
|
148
148
|
if (source)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSources.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerSources.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,oBAAoB;;;AAEpB,sDAAqD;AACrD,wDAA+C;AAC/C,oDAE4B;AAC5B,wDAAyE;AACzE,+CAA4C;AAG5C,0CAA2F;AAE3F,gBAAgB;AAChB,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,iEAAK,CAAA;IACL,2FAAkB,CAAA;IAClB,iFAAa,CAAA;IACb,qFAAe,CAAA;IAC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AC,IAAI,KAAK,cAAc,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,KAAK,cAAc,CAAC,GAAG,CAAC,CAAC;QACrF,CAAC,CAAC,CAAC;QAEH,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACxD,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAiB,EAAE,CAAiB,EAAE,EAAE,CAAC,IAAA,6BAAc,EAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAC9I,OAAO,eAAe,CAAC,SAAS,CAAC;IACnC,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAAC,IAAY;QAC1C,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE;YAC9B,OAAO,KAAK,CAAC;SACd;QAED,mCAAmC;QACnC,MAAM,kBAAkB,GAAG,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC;QACrE,eAAe,CAAC,SAAS,CAAC,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;YACxF,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,kBAAkB,KAAK,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC;CACF;AAzHD,0CAyHC","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/** @module Views */\r\n\r\nimport { compareStrings } from \"@itwin/core-bentley\";\r\nimport { Point2d } from \"@itwin/core-geometry\";\r\nimport {\r\n BackgroundMapProvider, BackgroundMapType, BaseMapLayerSettings, DeprecatedBackgroundMapProps, MapLayerSettings, MapSubLayerProps,\r\n} from \"@itwin/core-common\";\r\nimport { getJson, RequestBasicCredentials } from \"@bentley/itwin-client\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\n\r\nimport { ArcGisUtilities, MapCartoRectangle, MapLayerSourceValidation } from \"../internal\";\r\n\r\n/** @internal */\r\nexport enum MapLayerSourceStatus {\r\n Valid,\r\n InvalidCredentials,\r\n InvalidFormat,\r\n InvalidTileTree,\r\n InvalidUrl,\r\n RequireAuth,\r\n}\r\n\r\n/** JSON representation of a map layer source.\r\n * @internal\r\n */\r\ninterface MapLayerSourceProps {\r\n /** Identifies the map layers source. Defaults to 'WMS'. */\r\n formatId?: string;\r\n /** Name */\r\n name: string;\r\n /** URL */\r\n url: string;\r\n /** True to indicate background is transparent. Defaults to 'true'. */\r\n transparentBackground?: boolean;\r\n /** Is a base layer. Defaults to 'false'. */\r\n isBase?: boolean;\r\n /** Indicate if this source definition should be used as a base map. Defaults to false. */\r\n baseMap?: boolean;\r\n /** UserName */\r\n userName?: string;\r\n /** Password */\r\n password?: string;\r\n}\r\n\r\n/** A source for map layers. These may be catalogued for convenient use by users or applications.\r\n * @internal\r\n */\r\nexport class MapLayerSource {\r\n public formatId: string;\r\n public name: string;\r\n public url: string;\r\n public baseMap = false;\r\n public transparentBackground?: boolean;\r\n public userName?: string;\r\n public password?: string;\r\n\r\n private constructor(formatId = \"WMS\", name: string, url: string, baseMap = false, transparentBackground = true, userName?: string, password?: string) {\r\n this.formatId = formatId;\r\n this.name = name;\r\n this.url = url;\r\n this.baseMap = baseMap;\r\n this.transparentBackground = transparentBackground;\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n\r\n public static fromJSON(json: MapLayerSourceProps): MapLayerSource | undefined {\r\n if (json === undefined)\r\n return undefined;\r\n\r\n return new MapLayerSource(json.formatId, json.name, json.url, json.baseMap, json.transparentBackground, json.userName, json.password);\r\n }\r\n\r\n public async validateSource(ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\r\n return IModelApp.mapLayerFormatRegistry.validateSource(this.formatId, this.url, this.getCredentials(), ignoreCache);\r\n }\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps) {\r\n const provider = BackgroundMapProvider.fromBackgroundMapProps(props);\r\n const layerSettings = BaseMapLayerSettings.fromProvider(provider);\r\n if (undefined !== layerSettings) {\r\n const source = MapLayerSource.fromJSON(layerSettings);\r\n if (source) {\r\n source.baseMap = true;\r\n return source;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n public toJSON() {\r\n return { url: this.url, name: this.name, formatId: this.formatId, transparentBackground: this.transparentBackground };\r\n }\r\n\r\n public toLayerSettings(subLayers?: MapSubLayerProps[]): MapLayerSettings | undefined {\r\n // When MapLayerSetting is created from a MapLayerSource, sub-layers and credentials need to be set separately.\r\n const layerSettings = MapLayerSettings.fromJSON({ ...this, subLayers });\r\n layerSettings?.setCredentials(this.userName, this.password);\r\n return layerSettings;\r\n }\r\n\r\n private getCredentials(): RequestBasicCredentials | undefined {\r\n return this.userName && this.password ? { user: this.userName, password: this.password } : undefined;\r\n }\r\n}\r\n\r\n/** A collection of [[MapLayerSource]] objects.\r\n * @internal\r\n */\r\nexport class MapLayerSources {\r\n private static _instance?: MapLayerSources;\r\n private constructor(private _sources: MapLayerSource[]) { }\r\n\r\n public static getInstance() { return MapLayerSources._instance; }\r\n\r\n public findByName(name: string, baseMap: boolean = false): MapLayerSource | undefined {\r\n const nameTest = name.toLowerCase();\r\n for (const source of this._sources)\r\n if (source.baseMap === baseMap && source.name.toLowerCase().indexOf(nameTest) !== -1)\r\n return source;\r\n\r\n return undefined;\r\n }\r\n public get layers(): MapLayerSource[] {\r\n const layers = new Array<MapLayerSource>();\r\n this._sources.forEach((source) => { if (!source.baseMap) layers.push(source); });\r\n return layers;\r\n }\r\n public get allSource() { return this._sources; }\r\n public get bases(): MapLayerSource[] {\r\n const layers = new Array<MapLayerSource>();\r\n this._sources.forEach((source) => { if (source.baseMap) layers.push(source); });\r\n return layers;\r\n }\r\n\r\n private static getBingMapLayerSource(): MapLayerSource[] {\r\n const mapLayerSources: MapLayerSource[] = [];\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"BingProvider\", providerData: { mapType: BackgroundMapType.Street } })!);\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"BingProvider\", providerData: { mapType: BackgroundMapType.Aerial } })!);\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"BingProvider\", providerData: { mapType: BackgroundMapType.Hybrid } })!);\r\n return mapLayerSources;\r\n }\r\n\r\n private static getMapBoxLayerSource(): MapLayerSource[] {\r\n const mapLayerSources: MapLayerSource[] = [];\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"MapBoxProvider\", providerData: { mapType: BackgroundMapType.Street } })!);\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"MapBoxProvider\", providerData: { mapType: BackgroundMapType.Aerial } })!);\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"MapBoxProvider\", providerData: { mapType: BackgroundMapType.Hybrid } })!);\r\n return mapLayerSources;\r\n }\r\n\r\n public static async create(iModel?: IModelConnection, queryForPublicSources = false, addMapBoxSources = false): Promise<MapLayerSources> {\r\n if (!queryForPublicSources && MapLayerSources._instance)\r\n return MapLayerSources._instance;\r\n\r\n if (!iModel)\r\n iModel = IModelApp.viewManager.selectedView ? IModelApp.viewManager.selectedView.iModel : undefined;\r\n\r\n let sourceRange = MapCartoRectangle.create();\r\n if (iModel) {\r\n const projectCenter = iModel.projectExtents.localXYZToWorld(.5, .5, .5)!;\r\n const cartoCenter = iModel.spatialToCartographicFromEcef(projectCenter);\r\n const globeRange = MapCartoRectangle.create();\r\n const nearDelta = Point2d.create(globeRange.xLength() / 100, globeRange.yLength() / 100);\r\n sourceRange = MapCartoRectangle.create(cartoCenter.longitude - nearDelta.x, cartoCenter.latitude - nearDelta.y, cartoCenter.longitude + nearDelta.x, cartoCenter.latitude + nearDelta.y);\r\n }\r\n\r\n const sources = new Array<MapLayerSource>();\r\n const urlSet = new Set<string>();\r\n const addSource = ((source: MapLayerSource) => {\r\n if (!urlSet.has(source.url)) {\r\n sources.push(source);\r\n urlSet.add(source.url);\r\n }\r\n });\r\n\r\n this.getBingMapLayerSource().forEach((source) => {\r\n addSource(source);\r\n });\r\n\r\n if (addMapBoxSources) {\r\n this.getMapBoxLayerSource().forEach((source) => {\r\n addSource(source);\r\n });\r\n }\r\n\r\n if (queryForPublicSources) {\r\n const sourcesJson = await getJson(\"assets/MapLayerSources.json\");\r\n\r\n for (const sourceJson of sourcesJson) {\r\n const source = MapLayerSource.fromJSON(sourceJson);\r\n if (source)\r\n addSource(source);\r\n }\r\n\r\n (await ArcGisUtilities.getSourcesFromQuery(sourceRange)).forEach((queriedSource) => addSource(queriedSource));\r\n }\r\n\r\n sources.sort((a: MapLayerSource, b: MapLayerSource) => compareStrings(a.name.toLowerCase(), b.name.toLowerCase()));\r\n\r\n const mapLayerSources = new MapLayerSources(sources);\r\n MapLayerSources._instance = mapLayerSources;\r\n\r\n return mapLayerSources;\r\n }\r\n public static async addSourceToMapLayerSources(mapLayerSource?: MapLayerSource): Promise<MapLayerSources | undefined> {\r\n if (!MapLayerSources._instance || !mapLayerSource) {\r\n return undefined;\r\n }\r\n MapLayerSources._instance._sources = MapLayerSources._instance._sources.filter((source) => {\r\n return !(source.name === mapLayerSource.name || source.url === mapLayerSource.url);\r\n });\r\n\r\n MapLayerSources._instance._sources.push(mapLayerSource);\r\n MapLayerSources._instance._sources.sort((a: MapLayerSource, b: MapLayerSource) => compareStrings(a.name.toLowerCase(), b.name.toLowerCase()));\r\n return MapLayerSources._instance;\r\n }\r\n\r\n public static removeLayerByName(name: string): boolean {\r\n if (!MapLayerSources._instance) {\r\n return false;\r\n }\r\n\r\n // For now we only rely on the name\r\n const lengthBeforeRemove = MapLayerSources._instance._sources.length;\r\n MapLayerSources._instance._sources = MapLayerSources._instance._sources.filter((source) => {\r\n return (source.name !== name);\r\n });\r\n return (lengthBeforeRemove !== MapLayerSources._instance._sources.length);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerSources.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerSources.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,oBAAoB;;;AAEpB,sDAAqD;AACrD,wDAA+C;AAC/C,oDAE4B;AAC5B,wDAAyE;AACzE,+CAA4C;AAG5C,0CAA2F;AAE3F,gBAAgB;AAChB,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,iEAAK,CAAA;IACL,2FAAkB,CAAA;IAClB,iFAAa,CAAA;IACb,qFAAe,CAAA;IACf,2EAAU,CAAA;IACV,6EAAW,CAAA;AACb,CAAC,EAPW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAO/B;AAwBD;;GAEG;AACH,MAAa,cAAc;IASzB,YAAoB,QAAQ,GAAG,KAAK,EAAE,IAAY,EAAE,GAAW,EAAE,OAAO,GAAG,KAAK,EAAE,qBAAqB,GAAG,IAAI,EAAE,QAAiB,EAAE,QAAiB;QAL7I,YAAO,GAAG,KAAK,CAAC;QAMrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAAyB;QAC9C,IAAI,IAAI,KAAK,SAAS;YACpB,OAAO,SAAS,CAA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S,CAAC,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;YACxF,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,kBAAkB,KAAK,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC;CACF;AAzHD,0CAyHC","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/** @module Views */\r\n\r\nimport { compareStrings } from \"@itwin/core-bentley\";\r\nimport { Point2d } from \"@itwin/core-geometry\";\r\nimport {\r\n BackgroundMapProvider, BackgroundMapType, BaseMapLayerSettings, DeprecatedBackgroundMapProps, MapLayerSettings, MapSubLayerProps,\r\n} from \"@itwin/core-common\";\r\nimport { getJson, RequestBasicCredentials } from \"@bentley/itwin-client\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\n\r\nimport { ArcGisUtilities, MapCartoRectangle, MapLayerSourceValidation } from \"../internal\";\r\n\r\n/** @internal */\r\nexport enum MapLayerSourceStatus {\r\n Valid,\r\n InvalidCredentials,\r\n InvalidFormat,\r\n InvalidTileTree,\r\n InvalidUrl,\r\n RequireAuth,\r\n}\r\n\r\n/** JSON representation of a map layer source.\r\n * @internal\r\n */\r\ninterface MapLayerSourceProps {\r\n /** Identifies the map layers source. Defaults to 'WMS'. */\r\n formatId?: string;\r\n /** Name */\r\n name: string;\r\n /** URL */\r\n url: string;\r\n /** True to indicate background is transparent. Defaults to 'true'. */\r\n transparentBackground?: boolean;\r\n /** Is a base layer. Defaults to 'false'. */\r\n isBase?: boolean;\r\n /** Indicate if this source definition should be used as a base map. Defaults to false. */\r\n baseMap?: boolean;\r\n /** UserName */\r\n userName?: string;\r\n /** Password */\r\n password?: string;\r\n}\r\n\r\n/** A source for map layers. These may be catalogued for convenient use by users or applications.\r\n * @internal\r\n */\r\nexport class MapLayerSource {\r\n public formatId: string;\r\n public name: string;\r\n public url: string;\r\n public baseMap = false;\r\n public transparentBackground?: boolean;\r\n public userName?: string;\r\n public password?: string;\r\n\r\n private constructor(formatId = \"WMS\", name: string, url: string, baseMap = false, transparentBackground = true, userName?: string, password?: string) {\r\n this.formatId = formatId;\r\n this.name = name;\r\n this.url = url;\r\n this.baseMap = baseMap;\r\n this.transparentBackground = transparentBackground;\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n\r\n public static fromJSON(json: MapLayerSourceProps): MapLayerSource | undefined {\r\n if (json === undefined)\r\n return undefined;\r\n\r\n return new MapLayerSource(json.formatId, json.name, json.url, json.baseMap, json.transparentBackground, json.userName, json.password);\r\n }\r\n\r\n public async validateSource(ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\r\n return IModelApp.mapLayerFormatRegistry.validateSource(this.formatId, this.url, this.getCredentials(), ignoreCache);\r\n }\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps) {\r\n const provider = BackgroundMapProvider.fromBackgroundMapProps(props);\r\n const layerSettings = BaseMapLayerSettings.fromProvider(provider);\r\n if (undefined !== layerSettings) {\r\n const source = MapLayerSource.fromJSON(layerSettings);\r\n if (source) {\r\n source.baseMap = true;\r\n return source;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n public toJSON() {\r\n return { url: this.url, name: this.name, formatId: this.formatId, transparentBackground: this.transparentBackground };\r\n }\r\n\r\n public toLayerSettings(subLayers?: MapSubLayerProps[]): MapLayerSettings | undefined {\r\n // When MapLayerSetting is created from a MapLayerSource, sub-layers and credentials need to be set separately.\r\n const layerSettings = MapLayerSettings.fromJSON({ ...this, subLayers });\r\n layerSettings?.setCredentials(this.userName, this.password);\r\n return layerSettings;\r\n }\r\n\r\n private getCredentials(): RequestBasicCredentials | undefined {\r\n return this.userName && this.password ? { user: this.userName, password: this.password } : undefined;\r\n }\r\n}\r\n\r\n/** A collection of [[MapLayerSource]] objects.\r\n * @internal\r\n */\r\nexport class MapLayerSources {\r\n private static _instance?: MapLayerSources;\r\n private constructor(private _sources: MapLayerSource[]) { }\r\n\r\n public static getInstance() { return MapLayerSources._instance; }\r\n\r\n public findByName(name: string, baseMap: boolean = false): MapLayerSource | undefined {\r\n const nameTest = name.toLowerCase();\r\n for (const source of this._sources)\r\n if (source.baseMap === baseMap && source.name.toLowerCase().indexOf(nameTest) !== -1)\r\n return source;\r\n\r\n return undefined;\r\n }\r\n public get layers(): MapLayerSource[] {\r\n const layers = new Array<MapLayerSource>();\r\n this._sources.forEach((source) => { if (!source.baseMap) layers.push(source); });\r\n return layers;\r\n }\r\n public get allSource() { return this._sources; }\r\n public get bases(): MapLayerSource[] {\r\n const layers = new Array<MapLayerSource>();\r\n this._sources.forEach((source) => { if (source.baseMap) layers.push(source); });\r\n return layers;\r\n }\r\n\r\n private static getBingMapLayerSource(): MapLayerSource[] {\r\n const mapLayerSources: MapLayerSource[] = [];\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"BingProvider\", providerData: { mapType: BackgroundMapType.Street } })!);\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"BingProvider\", providerData: { mapType: BackgroundMapType.Aerial } })!);\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"BingProvider\", providerData: { mapType: BackgroundMapType.Hybrid } })!);\r\n return mapLayerSources;\r\n }\r\n\r\n private static getMapBoxLayerSource(): MapLayerSource[] {\r\n const mapLayerSources: MapLayerSource[] = [];\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"MapBoxProvider\", providerData: { mapType: BackgroundMapType.Street } })!);\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"MapBoxProvider\", providerData: { mapType: BackgroundMapType.Aerial } })!);\r\n mapLayerSources.push(MapLayerSource.fromBackgroundMapProps({ providerName: \"MapBoxProvider\", providerData: { mapType: BackgroundMapType.Hybrid } })!);\r\n return mapLayerSources;\r\n }\r\n\r\n public static async create(iModel?: IModelConnection, queryForPublicSources = false, addMapBoxSources = false): Promise<MapLayerSources> {\r\n if (!queryForPublicSources && MapLayerSources._instance)\r\n return MapLayerSources._instance;\r\n\r\n if (!iModel)\r\n iModel = IModelApp.viewManager.selectedView ? IModelApp.viewManager.selectedView.iModel : undefined;\r\n\r\n let sourceRange = MapCartoRectangle.create();\r\n if (iModel) {\r\n const projectCenter = iModel.projectExtents.localXYZToWorld(.5, .5, .5)!;\r\n const cartoCenter = iModel.spatialToCartographicFromEcef(projectCenter);\r\n const globeRange = MapCartoRectangle.create();\r\n const nearDelta = Point2d.create(globeRange.xLength() / 100, globeRange.yLength() / 100);\r\n sourceRange = MapCartoRectangle.create(cartoCenter.longitude - nearDelta.x, cartoCenter.latitude - nearDelta.y, cartoCenter.longitude + nearDelta.x, cartoCenter.latitude + nearDelta.y);\r\n }\r\n\r\n const sources = new Array<MapLayerSource>();\r\n const urlSet = new Set<string>();\r\n const addSource = ((source: MapLayerSource) => {\r\n if (!urlSet.has(source.url)) {\r\n sources.push(source);\r\n urlSet.add(source.url);\r\n }\r\n });\r\n\r\n this.getBingMapLayerSource().forEach((source) => {\r\n addSource(source);\r\n });\r\n\r\n if (addMapBoxSources) {\r\n this.getMapBoxLayerSource().forEach((source) => {\r\n addSource(source);\r\n });\r\n }\r\n\r\n if (queryForPublicSources) {\r\n const sourcesJson = await getJson(`${IModelApp.publicPath}assets/MapLayerSources.json`);\r\n\r\n for (const sourceJson of sourcesJson) {\r\n const source = MapLayerSource.fromJSON(sourceJson);\r\n if (source)\r\n addSource(source);\r\n }\r\n\r\n (await ArcGisUtilities.getSourcesFromQuery(sourceRange)).forEach((queriedSource) => addSource(queriedSource));\r\n }\r\n\r\n sources.sort((a: MapLayerSource, b: MapLayerSource) => compareStrings(a.name.toLowerCase(), b.name.toLowerCase()));\r\n\r\n const mapLayerSources = new MapLayerSources(sources);\r\n MapLayerSources._instance = mapLayerSources;\r\n\r\n return mapLayerSources;\r\n }\r\n public static async addSourceToMapLayerSources(mapLayerSource?: MapLayerSource): Promise<MapLayerSources | undefined> {\r\n if (!MapLayerSources._instance || !mapLayerSource) {\r\n return undefined;\r\n }\r\n MapLayerSources._instance._sources = MapLayerSources._instance._sources.filter((source) => {\r\n return !(source.name === mapLayerSource.name || source.url === mapLayerSource.url);\r\n });\r\n\r\n MapLayerSources._instance._sources.push(mapLayerSource);\r\n MapLayerSources._instance._sources.sort((a: MapLayerSource, b: MapLayerSource) => compareStrings(a.name.toLowerCase(), b.name.toLowerCase()));\r\n return MapLayerSources._instance;\r\n }\r\n\r\n public static removeLayerByName(name: string): boolean {\r\n if (!MapLayerSources._instance) {\r\n return false;\r\n }\r\n\r\n // For now we only rely on the name\r\n const lengthBeforeRemove = MapLayerSources._instance._sources.length;\r\n MapLayerSources._instance._sources = MapLayerSources._instance._sources.filter((source) => {\r\n return (source.name !== name);\r\n });\r\n return (lengthBeforeRemove !== MapLayerSources._instance._sources.length);\r\n }\r\n}\r\n"]}
|
package/lib/cjs/webgl.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from "./render/webgl/ClipVolume";
|
|
|
11
11
|
export * from "./render/webgl/ColorInfo";
|
|
12
12
|
export * from "./render/webgl/Diagnostics";
|
|
13
13
|
export * from "./render/webgl/DrawCommand";
|
|
14
|
+
export * from "./render/webgl/EdgeGeometry";
|
|
14
15
|
export * from "./render/webgl/EdgeSettings";
|
|
15
16
|
export * from "./render/webgl/FeatureOverrides";
|
|
16
17
|
export * from "./render/webgl/FloatRGBA";
|
|
@@ -21,6 +22,8 @@ export * from "./render/webgl/Graphic";
|
|
|
21
22
|
export * from "./render/webgl/LineCode";
|
|
22
23
|
export * from "./render/webgl/Matrix";
|
|
23
24
|
export * from "./render/webgl/Mesh";
|
|
25
|
+
export * from "./render/webgl/MeshData";
|
|
26
|
+
export * from "./render/webgl/MeshGeometry";
|
|
24
27
|
export * from "./render/webgl/PlanarClassifier";
|
|
25
28
|
export * from "./render/webgl/PlanarGrid";
|
|
26
29
|
export * from "./render/webgl/PointString";
|
|
@@ -34,6 +37,7 @@ export * from "./render/webgl/ScreenSpaceEffect";
|
|
|
34
37
|
export * from "./render/webgl/ShaderBuilder";
|
|
35
38
|
export * from "./render/webgl/ShaderProgram";
|
|
36
39
|
export * from "./render/webgl/ShadowUniforms";
|
|
40
|
+
export * from "./render/webgl/SurfaceGeometry";
|
|
37
41
|
export * from "./render/webgl/Sync";
|
|
38
42
|
export * from "./render/webgl/System";
|
|
39
43
|
export * from "./render/webgl/PerformanceMetrics";
|
package/lib/cjs/webgl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["../../src/webgl.ts"],"names":[],"mappings":"AASA,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAA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AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC"}
|
package/lib/cjs/webgl.js
CHANGED
|
@@ -30,6 +30,7 @@ __exportStar(require("./render/webgl/ClipVolume"), exports);
|
|
|
30
30
|
__exportStar(require("./render/webgl/ColorInfo"), exports);
|
|
31
31
|
__exportStar(require("./render/webgl/Diagnostics"), exports);
|
|
32
32
|
__exportStar(require("./render/webgl/DrawCommand"), exports);
|
|
33
|
+
__exportStar(require("./render/webgl/EdgeGeometry"), exports);
|
|
33
34
|
__exportStar(require("./render/webgl/EdgeSettings"), exports);
|
|
34
35
|
__exportStar(require("./render/webgl/FeatureOverrides"), exports);
|
|
35
36
|
__exportStar(require("./render/webgl/FloatRGBA"), exports);
|
|
@@ -40,6 +41,8 @@ __exportStar(require("./render/webgl/Graphic"), exports);
|
|
|
40
41
|
__exportStar(require("./render/webgl/LineCode"), exports);
|
|
41
42
|
__exportStar(require("./render/webgl/Matrix"), exports);
|
|
42
43
|
__exportStar(require("./render/webgl/Mesh"), exports);
|
|
44
|
+
__exportStar(require("./render/webgl/MeshData"), exports);
|
|
45
|
+
__exportStar(require("./render/webgl/MeshGeometry"), exports);
|
|
43
46
|
__exportStar(require("./render/webgl/PlanarClassifier"), exports);
|
|
44
47
|
__exportStar(require("./render/webgl/PlanarGrid"), exports);
|
|
45
48
|
__exportStar(require("./render/webgl/PointString"), exports);
|
|
@@ -53,6 +56,7 @@ __exportStar(require("./render/webgl/ScreenSpaceEffect"), exports);
|
|
|
53
56
|
__exportStar(require("./render/webgl/ShaderBuilder"), exports);
|
|
54
57
|
__exportStar(require("./render/webgl/ShaderProgram"), exports);
|
|
55
58
|
__exportStar(require("./render/webgl/ShadowUniforms"), exports);
|
|
59
|
+
__exportStar(require("./render/webgl/SurfaceGeometry"), exports);
|
|
56
60
|
__exportStar(require("./render/webgl/Sync"), exports);
|
|
57
61
|
__exportStar(require("./render/webgl/System"), exports);
|
|
58
62
|
__exportStar(require("./render/webgl/PerformanceMetrics"), exports);
|
package/lib/cjs/webgl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../../src/webgl.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,4EAA4E;AAC5E,gFAAgF;AAChF,2DAA2D;AAE3D,kEAAgD;AAChD,8DAA4C;AAC5C,4DAA0C;AAC1C,+DAA6C;AAC7C,6DAA2C;AAC3C,6DAA2C;AAC3C,gEAA8C;AAC9C,iEAA+C;AAC/C,2DAAyC;AACzC,4DAA0C;AAC1C,2DAAyC;AACzC,6DAA2C;AAC3C,6DAA2C;AAC3C,8DAA4C;AAC5C,kEAAgD;AAChD,2DAAyC;AACzC,6DAA2C;AAC3C,iEAA+C;AAC/C,oDAAkC;AAClC,yDAAuC;AACvC,0DAAwC;AACxC,wDAAsC;AACtC,sDAAoC;AACpC,kEAAgD;AAChD,4DAA0C;AAC1C,6DAA2C;AAC3C,0DAAwC;AACxC,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C;AAC9C,6DAA2C;AAC3C,6DAA2C;AAC3C,mEAAiD;AACjD,+DAA6C;AAC7C,+DAA6C;AAC7C,gEAA8C;AAC9C,sDAAoC;AACpC,wDAAsC;AACtC,oEAAkD;AAClD,wDAAsC;AACtC,gEAA8C;AAC9C,gEAA8C;AAC9C,2DAAyC;AACzC,gEAA8C;AAC9C,6DAA2C;AAC3C,yDAAuC;AACvC,+DAA6C;AAC7C,2DAAyC;AACzC,kEAAgD;AAChD,qEAAmD","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\r\n// These are strictly exported for tests - consumers of the imodeljs library\r\n// should use the abstractions supplied in /render/*, not the implementations in\r\n// /render/webgl/* which are subject to change at any time.\r\n\r\nexport * from \"./render/webgl/AttributeBuffers\";\r\nexport * from \"./render/webgl/AttributeMap\";\r\nexport * from \"./render/webgl/BatchState\";\r\nexport * from \"./render/webgl/BatchUniforms\";\r\nexport * from \"./render/webgl/BranchStack\";\r\nexport * from \"./render/webgl/BranchState\";\r\nexport * from \"./render/webgl/CachedGeometry\";\r\nexport * from \"./render/webgl/ClippingProgram\";\r\nexport * from \"./render/webgl/ClipStack\";\r\nexport * from \"./render/webgl/ClipVolume\";\r\nexport * from \"./render/webgl/ColorInfo\";\r\nexport * from \"./render/webgl/Diagnostics\";\r\nexport * from \"./render/webgl/DrawCommand\";\r\nexport * from \"./render/webgl/EdgeSettings\";\r\nexport * from \"./render/webgl/FeatureOverrides\";\r\nexport * from \"./render/webgl/FloatRGBA\";\r\nexport * from \"./render/webgl/FrameBuffer\";\r\nexport * from \"./render/webgl/FrustumUniforms\";\r\nexport * from \"./render/webgl/GL\";\r\nexport * from \"./render/webgl/Graphic\";\r\nexport * from \"./render/webgl/LineCode\";\r\nexport * from \"./render/webgl/Matrix\";\r\nexport * from \"./render/webgl/Mesh\";\r\nexport * from \"./render/webgl/PlanarClassifier\";\r\nexport * from \"./render/webgl/PlanarGrid\";\r\nexport * from \"./render/webgl/PointString\";\r\nexport * from \"./render/webgl/Polyline\";\r\nexport * from \"./render/webgl/Primitive\";\r\nexport * from \"./render/webgl/RenderBuffer\";\r\nexport * from \"./render/webgl/RenderCommands\";\r\nexport * from \"./render/webgl/RenderFlags\";\r\nexport * from \"./render/webgl/RenderState\";\r\nexport * from \"./render/webgl/ScreenSpaceEffect\";\r\nexport * from \"./render/webgl/ShaderBuilder\";\r\nexport * from \"./render/webgl/ShaderProgram\";\r\nexport * from \"./render/webgl/ShadowUniforms\";\r\nexport * from \"./render/webgl/Sync\";\r\nexport * from \"./render/webgl/System\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/TargetGraphics\";\r\nexport * from \"./render/webgl/TargetUniforms\";\r\nexport * from \"./render/webgl/Technique\";\r\nexport * from \"./render/webgl/TechniqueFlags\";\r\nexport * from \"./render/webgl/TechniqueId\";\r\nexport * from \"./render/webgl/Texture\";\r\nexport * from \"./render/webgl/UniformHandle\";\r\nexport * from \"./render/webgl/VertexLUT\";\r\nexport * from \"./render/webgl/ViewRectUniforms\";\r\nexport * from \"./render/webgl/VisibleTileFeatures\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../../src/webgl.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,4EAA4E;AAC5E,gFAAgF;AAChF,2DAA2D;AAE3D,kEAAgD;AAChD,8DAA4C;AAC5C,4DAA0C;AAC1C,+DAA6C;AAC7C,6DAA2C;AAC3C,6DAA2C;AAC3C,gEAA8C;AAC9C,iEAA+C;AAC/C,2DAAyC;AACzC,4DAA0C;AAC1C,2DAAyC;AACzC,6DAA2C;AAC3C,6DAA2C;AAC3C,8DAA4C;AAC5C,8DAA4C;AAC5C,kEAAgD;AAChD,2DAAyC;AACzC,6DAA2C;AAC3C,iEAA+C;AAC/C,oDAAkC;AAClC,yDAAuC;AACvC,0DAAwC;AACxC,wDAAsC;AACtC,sDAAoC;AACpC,0DAAwC;AACxC,8DAA4C;AAC5C,kEAAgD;AAChD,4DAA0C;AAC1C,6DAA2C;AAC3C,0DAAwC;AACxC,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C;AAC9C,6DAA2C;AAC3C,6DAA2C;AAC3C,mEAAiD;AACjD,+DAA6C;AAC7C,+DAA6C;AAC7C,gEAA8C;AAC9C,iEAA+C;AAC/C,sDAAoC;AACpC,wDAAsC;AACtC,oEAAkD;AAClD,wDAAsC;AACtC,gEAA8C;AAC9C,gEAA8C;AAC9C,2DAAyC;AACzC,gEAA8C;AAC9C,6DAA2C;AAC3C,yDAAuC;AACvC,+DAA6C;AAC7C,2DAAyC;AACzC,kEAAgD;AAChD,qEAAmD","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\r\n// These are strictly exported for tests - consumers of the imodeljs library\r\n// should use the abstractions supplied in /render/*, not the implementations in\r\n// /render/webgl/* which are subject to change at any time.\r\n\r\nexport * from \"./render/webgl/AttributeBuffers\";\r\nexport * from \"./render/webgl/AttributeMap\";\r\nexport * from \"./render/webgl/BatchState\";\r\nexport * from \"./render/webgl/BatchUniforms\";\r\nexport * from \"./render/webgl/BranchStack\";\r\nexport * from \"./render/webgl/BranchState\";\r\nexport * from \"./render/webgl/CachedGeometry\";\r\nexport * from \"./render/webgl/ClippingProgram\";\r\nexport * from \"./render/webgl/ClipStack\";\r\nexport * from \"./render/webgl/ClipVolume\";\r\nexport * from \"./render/webgl/ColorInfo\";\r\nexport * from \"./render/webgl/Diagnostics\";\r\nexport * from \"./render/webgl/DrawCommand\";\r\nexport * from \"./render/webgl/EdgeGeometry\";\r\nexport * from \"./render/webgl/EdgeSettings\";\r\nexport * from \"./render/webgl/FeatureOverrides\";\r\nexport * from \"./render/webgl/FloatRGBA\";\r\nexport * from \"./render/webgl/FrameBuffer\";\r\nexport * from \"./render/webgl/FrustumUniforms\";\r\nexport * from \"./render/webgl/GL\";\r\nexport * from \"./render/webgl/Graphic\";\r\nexport * from \"./render/webgl/LineCode\";\r\nexport * from \"./render/webgl/Matrix\";\r\nexport * from \"./render/webgl/Mesh\";\r\nexport * from \"./render/webgl/MeshData\";\r\nexport * from \"./render/webgl/MeshGeometry\";\r\nexport * from \"./render/webgl/PlanarClassifier\";\r\nexport * from \"./render/webgl/PlanarGrid\";\r\nexport * from \"./render/webgl/PointString\";\r\nexport * from \"./render/webgl/Polyline\";\r\nexport * from \"./render/webgl/Primitive\";\r\nexport * from \"./render/webgl/RenderBuffer\";\r\nexport * from \"./render/webgl/RenderCommands\";\r\nexport * from \"./render/webgl/RenderFlags\";\r\nexport * from \"./render/webgl/RenderState\";\r\nexport * from \"./render/webgl/ScreenSpaceEffect\";\r\nexport * from \"./render/webgl/ShaderBuilder\";\r\nexport * from \"./render/webgl/ShaderProgram\";\r\nexport * from \"./render/webgl/ShadowUniforms\";\r\nexport * from \"./render/webgl/SurfaceGeometry\";\r\nexport * from \"./render/webgl/Sync\";\r\nexport * from \"./render/webgl/System\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/TargetGraphics\";\r\nexport * from \"./render/webgl/TargetUniforms\";\r\nexport * from \"./render/webgl/Technique\";\r\nexport * from \"./render/webgl/TechniqueFlags\";\r\nexport * from \"./render/webgl/TechniqueId\";\r\nexport * from \"./render/webgl/Texture\";\r\nexport * from \"./render/webgl/UniformHandle\";\r\nexport * from \"./render/webgl/VertexLUT\";\r\nexport * from \"./render/webgl/ViewRectUniforms\";\r\nexport * from \"./render/webgl/VisibleTileFeatures\";\r\n"]}
|
package/lib/esm/AccuSnap.js
CHANGED
|
@@ -370,7 +370,7 @@ export class AccuSnap {
|
|
|
370
370
|
return;
|
|
371
371
|
const crossPt = snap.snapPoint;
|
|
372
372
|
const viewport = snap.viewport;
|
|
373
|
-
const crossSprite = IconSprites.getSpriteFromUrl(snap.isHot ? "sprites/SnapCross.png" : "sprites/SnapUnfocused.png");
|
|
373
|
+
const crossSprite = IconSprites.getSpriteFromUrl(`${IModelApp.publicPath}${snap.isHot ? "sprites/SnapCross.png" : "sprites/SnapUnfocused.png"}`);
|
|
374
374
|
this.cross.activate(crossSprite, viewport, crossPt);
|
|
375
375
|
const snapSprite = snap.sprite;
|
|
376
376
|
if (snapSprite)
|
|
@@ -391,13 +391,13 @@ export class AccuSnap {
|
|
|
391
391
|
let errorSprite;
|
|
392
392
|
switch (out.snapStatus) {
|
|
393
393
|
case SnapStatus.FilteredByApp:
|
|
394
|
-
errorSprite = IconSprites.getSpriteFromUrl(
|
|
394
|
+
errorSprite = IconSprites.getSpriteFromUrl(`${IModelApp.publicPath}sprites/SnapAppFiltered.png`);
|
|
395
395
|
break;
|
|
396
396
|
case SnapStatus.FilteredByAppQuietly:
|
|
397
397
|
this.errorKey = undefined;
|
|
398
398
|
break;
|
|
399
399
|
case SnapStatus.NotSnappable:
|
|
400
|
-
errorSprite = IconSprites.getSpriteFromUrl(
|
|
400
|
+
errorSprite = IconSprites.getSpriteFromUrl(`${IModelApp.publicPath}sprites/SnapNotSnappable.png`);
|
|
401
401
|
this.errorKey = ElementLocateManager.getFailureMessageKey("NotSnappable");
|
|
402
402
|
break;
|
|
403
403
|
}
|