@itwin/core-frontend 3.5.0-dev.26 → 3.5.0-dev.27
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/MarginPercent.d.ts +27 -2
- package/lib/cjs/MarginPercent.d.ts.map +1 -1
- package/lib/cjs/MarginPercent.js +8 -2
- package/lib/cjs/MarginPercent.js.map +1 -1
- package/lib/cjs/ViewAnimation.d.ts +10 -2
- package/lib/cjs/ViewAnimation.d.ts.map +1 -1
- package/lib/cjs/ViewAnimation.js.map +1 -1
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +22 -2
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.d.ts +5 -2
- package/lib/cjs/tile/map/ArcGISTileMap.d.ts.map +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.js +17 -2
- package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/MarginPercent.d.ts +27 -2
- package/lib/esm/MarginPercent.d.ts.map +1 -1
- package/lib/esm/MarginPercent.js +8 -2
- package/lib/esm/MarginPercent.js.map +1 -1
- package/lib/esm/ViewAnimation.d.ts +10 -2
- package/lib/esm/ViewAnimation.d.ts.map +1 -1
- package/lib/esm/ViewAnimation.js.map +1 -1
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +22 -2
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.d.ts +5 -2
- package/lib/esm/tile/map/ArcGISTileMap.d.ts.map +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.js +18 -3
- package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/package.json +20 -20
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Tiles
|
|
3
3
|
*/
|
|
4
|
-
import { QuadId } from "../internal";
|
|
4
|
+
import { MapLayerAccessClient, QuadId } from "../internal";
|
|
5
|
+
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
5
6
|
/** @internal */
|
|
6
7
|
export declare class ArcGISTileMap {
|
|
7
8
|
tileMapRequestSize: number;
|
|
@@ -9,7 +10,9 @@ export declare class ArcGISTileMap {
|
|
|
9
10
|
private _callQueues;
|
|
10
11
|
private _tilesCache;
|
|
11
12
|
private _restBaseUrl;
|
|
12
|
-
|
|
13
|
+
private _accessClient;
|
|
14
|
+
private _settings;
|
|
15
|
+
constructor(restBaseUrl: string, settings: ImageMapLayerSettings, nbLods?: number, accessClient?: MapLayerAccessClient);
|
|
13
16
|
protected fetchTileMapFromServer(level: number, row: number, column: number, width: number, height: number): Promise<any>;
|
|
14
17
|
protected getAvailableTilesFromCache(tiles: QuadId[]): {
|
|
15
18
|
allTilesFound: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGISTileMap.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/ArcGISTileMap.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ArcGISTileMap.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/ArcGISTileMap.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAmB,oBAAoB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,gBAAgB;AAChB,qBAAa,aAAa;IAChB,kBAAkB,SAAM;IACxB,0BAA0B,SAAK;IAEvC,OAAO,CAAC,WAAW,CAAwC;IAC3D,OAAO,CAAC,WAAW,CAA2E;IAC9F,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,SAAS,CAAwB;gBAE7B,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,oBAAoB;cAStG,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAsB/H,SAAS,CAAC,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG;QAAC,aAAa,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,EAAE,CAAA;KAAC;IAexF,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;cA4B5D,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;cA6E7E,iCAAiC,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAkC1F"}
|
|
@@ -14,17 +14,32 @@ const internal_1 = require("../internal");
|
|
|
14
14
|
const nonVisibleChildren = [false, false, false, false];
|
|
15
15
|
/** @internal */
|
|
16
16
|
class ArcGISTileMap {
|
|
17
|
-
constructor(restBaseUrl, nbLods) {
|
|
17
|
+
constructor(restBaseUrl, settings, nbLods, accessClient) {
|
|
18
18
|
this.tileMapRequestSize = 32;
|
|
19
19
|
this.fallbackTileMapRequestSize = 2;
|
|
20
20
|
this._tilesCache = new core_bentley_1.Dictionary((lhs, rhs) => (0, core_bentley_1.compareStrings)(lhs, rhs));
|
|
21
21
|
this._restBaseUrl = restBaseUrl;
|
|
22
|
+
this._accessClient = accessClient;
|
|
23
|
+
this._settings = settings;
|
|
22
24
|
if (nbLods !== undefined && nbLods > 0) {
|
|
23
25
|
this._callQueues = new Array(nbLods).fill(Promise.resolve(nonVisibleChildren));
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
async fetchTileMapFromServer(level, row, column, width, height) {
|
|
27
|
-
const
|
|
29
|
+
const tmpUrl = `${this._restBaseUrl}/tilemap/${level}/${row}/${column}/${width}/${height}?f=json`;
|
|
30
|
+
const urlObj = new URL(tmpUrl);
|
|
31
|
+
try {
|
|
32
|
+
if (this._accessClient) {
|
|
33
|
+
await internal_1.ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {
|
|
34
|
+
mapLayerUrl: new URL(this._settings.url),
|
|
35
|
+
userName: this._settings.userName,
|
|
36
|
+
password: this._settings.password,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
}
|
|
42
|
+
const data = await (0, Request_1.request)(urlObj.toString(), {
|
|
28
43
|
method: "GET",
|
|
29
44
|
responseType: "json",
|
|
30
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGISTileMap.js","sourceRoot":"","sources":["../../../../src/tile/map/ArcGISTileMap.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mDAAgD;AAChD,sDAAyE;AACzE,0CAAqC;AAErC,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACxD,gBAAgB;AAChB,MAAa,aAAa;IAOxB,YAAY,WAAmB,EAAE,MAAe;QANxC,uBAAkB,GAAG,EAAE,CAAC;QACxB,+BAA0B,GAAG,CAAC,CAAC;QAG/B,gBAAW,GAAG,IAAI,yBAAU,CAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,IAAA,6BAAc,E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,CAAA,KAAK,CAAC,CAAC;oBACzC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,SAAS,CAAC,MAAM,EAAC,CAAC,EAAE,EAAG;wBACrC,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;qBAC5B;oBACD,SAAS,GAAG,QAAQ,CAAC;iBACtB;aACF;SACF;QAAC,OAAO,MAAM,EAAE;YACf,yDAAyD;YACzD,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAE,EAAE,CAAA,KAAK,CAAC,CAAC;SACrC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAhLD,sCAgLC","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 { request } from \"../../request/Request\";\r\nimport { assert, compareStrings, Dictionary } from \"@itwin/core-bentley\";\r\nimport { QuadId } from \"../internal\";\r\n\r\nconst nonVisibleChildren = [false, false, false, false];\r\n/** @internal */\r\nexport class ArcGISTileMap {\r\n public tileMapRequestSize = 32;\r\n public fallbackTileMapRequestSize = 2;\r\n\r\n private _callQueues: Array<Promise<boolean[]>> | undefined;\r\n private _tilesCache = new Dictionary<string, boolean>((lhs, rhs) => compareStrings(lhs, rhs));\r\n private _restBaseUrl: string;\r\n constructor(restBaseUrl: string, nbLods?: number) {\r\n this._restBaseUrl = restBaseUrl;\r\n if (nbLods !== undefined && nbLods > 0) {\r\n this._callQueues = new Array<Promise<boolean[]>>(nbLods).fill(Promise.resolve<boolean[]>(nonVisibleChildren));\r\n }\r\n\r\n }\r\n protected async fetchTileMapFromServer(level: number, row: number, column: number, width: number, height: number): Promise<any> {\r\n const data = await request(`${this._restBaseUrl}/tilemap/${level}/${row}/${column}/${width}/${height}?f=json`, {\r\n method: \"GET\",\r\n responseType: \"json\",\r\n });\r\n return data.body;\r\n }\r\n\r\n protected getAvailableTilesFromCache(tiles: QuadId[]): {allTilesFound: boolean, available: boolean[]} {\r\n let allTilesFound = true;\r\n\r\n // Check children visibility from cache\r\n const available = tiles.map((tileId) => {\r\n const avail = this._tilesCache.get(tileId.contentId);\r\n if (undefined === avail) {\r\n allTilesFound = false;\r\n }\r\n return avail ?? false;\r\n });\r\n\r\n return {allTilesFound, available};\r\n }\r\n\r\n public async getChildrenAvailability(childIds: QuadId[]): Promise<boolean[]> {\r\n if (!childIds.length)\r\n return [];\r\n\r\n // We need to check cache again:\r\n // Tiles we are looking for may have been added to cache while we were waiting in the call queue.\r\n const cacheInfo = this.getAvailableTilesFromCache(childIds);\r\n if (cacheInfo.allTilesFound) {\r\n return cacheInfo.available;\r\n }\r\n\r\n // If we never encountered this tile level before, then a tilemap request must be made to get tiles visibility.\r\n // However, we dont want several overlapping large tilemap request being made simultaneously for tiles on the same level.\r\n // To avoid this from happening, we 'serialize' async calls so that we wait until the first tilemap request has completed\r\n // before making another one.\r\n const childLevel = childIds[0].level+1;\r\n if (this._callQueues && childLevel < this._callQueues.length ) {\r\n const res = this._callQueues[childLevel].then(async () => this.getChildrenAvailabilityFromServer(childIds));\r\n this._callQueues[childLevel] = res.catch(() => nonVisibleChildren);\r\n return res;\r\n } else {\r\n // We should not be in this case, probably because server info is missing LODs in the capabilities?!\r\n return this.getChildrenAvailabilityFromServer(childIds);\r\n }\r\n }\r\n\r\n // Query tiles are tiles that we need to check availability\r\n // The array is assumed to be in in row major orientation, i.e.: [TileRow0Col0, TileRow0Col1, TileRow1Col0, TileRow1Col1,]\r\n protected async fetchAndReadTilemap(queryTiles: QuadId[], reqWidth: number, reqHeight: number) {\r\n let available: boolean[] = [];\r\n if (queryTiles.length === 0) {\r\n return available;\r\n }\r\n\r\n const row = queryTiles[0].row;\r\n const column = queryTiles[0].column;\r\n const level = queryTiles[0].level;\r\n\r\n let reqRow, reqColumn;\r\n if (reqWidth === this.fallbackTileMapRequestSize && reqHeight === this.fallbackTileMapRequestSize){\r\n reqRow = row;\r\n reqColumn = column;\r\n } else {\r\n // If tile map if big enough. create offset that will place the current tile in the middle of the tilemap.\r\n // If we place the first query tile in the top-left corner (i.e. without offset), any query for a tile located above or on the left\r\n // will trigger a new request.\r\n const offsetRow = (reqHeight/2.0)-1;\r\n const offsetColumn = (reqWidth/2.0)-1;\r\n reqRow = Math.max(row - offsetRow, 0);\r\n reqColumn = Math.max(column - offsetColumn, 0);\r\n }\r\n\r\n try {\r\n // console.log(`Tilemap request: ${level},${reqRow},${reqColumn},${reqWidth},${reqHeight}`);\r\n const json = await this.fetchTileMapFromServer(level, reqRow, reqColumn, reqWidth, reqHeight);\r\n let tileMapWidth = reqWidth;\r\n let tileMapHeight = reqHeight;\r\n if (Array.isArray(json.data)){\r\n\r\n // The response width and height might be different than the requested dimensions.\r\n // Ref: https://developers.arcgis.com/rest/services-reference/enterprise/tile-map.htm\r\n if (json.adjusted) {\r\n // If tilemap size got adjusted, I'm expecting to get adjusted size...\r\n // otherwise there is something really odd with this server.\r\n assert(json.location?.width !== undefined && json.location?.height !== undefined);\r\n if (json.location?.width !== undefined && json.location?.height !== undefined) {\r\n tileMapWidth = json.location?.width;\r\n tileMapHeight = json.location?.height;\r\n }\r\n }\r\n let k = 0;\r\n for (let j = 0; j < tileMapWidth; j++) {\r\n for (let i = 0; i < tileMapHeight; i++) {\r\n const avail = json.data[(j*tileMapWidth)+i] !== 0;\r\n const curColumn = reqColumn + i;\r\n const curRow = reqRow + j;\r\n // console.log(`Tilemap tile:: ${level},${curRow},${curColumn} => ${avail}`);\r\n this._tilesCache.set(QuadId.getTileContentId(level, curColumn, curRow), avail);\r\n\r\n // Check if actual tile is among the children we are looking for, if so update the availability array.\r\n if ( curColumn >= queryTiles[0].column && curColumn <= queryTiles[queryTiles.length-1].column\r\n && curRow >= queryTiles[0].row && curRow <= queryTiles[queryTiles.length-1].row ) {\r\n available[k++] = avail;\r\n }\r\n\r\n }\r\n }\r\n } else {\r\n // If server returns data (i.e. error 422), thats fine we assume all tiles of tilemap are not available.\r\n available = queryTiles.map(()=>false);\r\n\r\n // Mark all tilemap tiles to non-available in the cache too\r\n for (let j = 0; j < tileMapWidth; j++) {\r\n for (let i = 0; i < tileMapHeight; i++) {\r\n this._tilesCache.set(QuadId.getTileContentId(level, reqColumn + i, reqRow + j), false);\r\n }\r\n }\r\n }\r\n } catch (_error) {\r\n available = queryTiles.map(()=>false);\r\n }\r\n\r\n return available;\r\n }\r\n\r\n protected async getChildrenAvailabilityFromServer(childIds: QuadId[]): Promise<boolean[]> {\r\n // We need to check cache again:\r\n // Tiles we are looking for may have been added to cache while we were waiting in the call queue.\r\n const cacheInfo = this.getAvailableTilesFromCache(childIds);\r\n if (cacheInfo.allTilesFound) {\r\n return cacheInfo.available;\r\n }\r\n\r\n let available;\r\n try {\r\n available = await this.fetchAndReadTilemap(childIds, this.tileMapRequestSize, this.tileMapRequestSize);\r\n if (available.length !== childIds.length) {\r\n if (this.tileMapRequestSize > this.fallbackTileMapRequestSize) {\r\n // Maybe we were unlucky and the tilemap got adjusted our the tiles we are looking for got clipped,\r\n // so let try we a smaller tilemap\r\n available = await this.fetchAndReadTilemap(childIds, this.fallbackTileMapRequestSize, this.fallbackTileMapRequestSize);\r\n }\r\n\r\n if (available.length < childIds.length) {\r\n // Could not all tiles children tiles, returns what we got and fill any gaps with false.\r\n const tmpAvail = childIds.map(()=>false);\r\n for (let i=0; i<available.length;i++ ) {\r\n tmpAvail[i] = available[i];\r\n }\r\n available = tmpAvail;\r\n }\r\n }\r\n } catch (_error) {\r\n // if any error occurs, we assume tiles not to be visible\r\n available = childIds.map(()=>false);\r\n }\r\n\r\n return available;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGISTileMap.js","sourceRoot":"","sources":["../../../../src/tile/map/ArcGISTileMap.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;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AAS,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAE,EAAE,CAAA,KAAK,CAAC,CAAC;SACrC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAnMD,sCAmMC","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 { request } from \"../../request/Request\";\r\nimport { assert, compareStrings, Dictionary } from \"@itwin/core-bentley\";\r\nimport { ArcGisUtilities, MapLayerAccessClient, QuadId } from \"../internal\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\n\r\nconst nonVisibleChildren = [false, false, false, false];\r\n/** @internal */\r\nexport class ArcGISTileMap {\r\n public tileMapRequestSize = 32;\r\n public fallbackTileMapRequestSize = 2;\r\n\r\n private _callQueues: Array<Promise<boolean[]>> | undefined;\r\n private _tilesCache = new Dictionary<string, boolean>((lhs, rhs) => compareStrings(lhs, rhs));\r\n private _restBaseUrl: string;\r\n private _accessClient: MapLayerAccessClient|undefined;\r\n private _settings: ImageMapLayerSettings;\r\n\r\n constructor(restBaseUrl: string, settings: ImageMapLayerSettings, nbLods?: number, accessClient?: MapLayerAccessClient) {\r\n this._restBaseUrl = restBaseUrl;\r\n this._accessClient = accessClient;\r\n this._settings = settings;\r\n if (nbLods !== undefined && nbLods > 0) {\r\n this._callQueues = new Array<Promise<boolean[]>>(nbLods).fill(Promise.resolve<boolean[]>(nonVisibleChildren));\r\n }\r\n\r\n }\r\n protected async fetchTileMapFromServer(level: number, row: number, column: number, width: number, height: number): Promise<any> {\r\n const tmpUrl = `${this._restBaseUrl}/tilemap/${level}/${row}/${column}/${width}/${height}?f=json`;\r\n const urlObj = new URL(tmpUrl);\r\n try {\r\n if (this._accessClient) {\r\n await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {\r\n mapLayerUrl: new URL(this._settings.url),\r\n userName: this._settings.userName,\r\n password: this._settings.password,\r\n });\r\n }\r\n\r\n } catch {\r\n }\r\n\r\n const data = await request(urlObj.toString() , {\r\n method: \"GET\",\r\n responseType: \"json\",\r\n });\r\n return data.body;\r\n }\r\n\r\n protected getAvailableTilesFromCache(tiles: QuadId[]): {allTilesFound: boolean, available: boolean[]} {\r\n let allTilesFound = true;\r\n\r\n // Check children visibility from cache\r\n const available = tiles.map((tileId) => {\r\n const avail = this._tilesCache.get(tileId.contentId);\r\n if (undefined === avail) {\r\n allTilesFound = false;\r\n }\r\n return avail ?? false;\r\n });\r\n\r\n return {allTilesFound, available};\r\n }\r\n\r\n public async getChildrenAvailability(childIds: QuadId[]): Promise<boolean[]> {\r\n if (!childIds.length)\r\n return [];\r\n\r\n // We need to check cache again:\r\n // Tiles we are looking for may have been added to cache while we were waiting in the call queue.\r\n const cacheInfo = this.getAvailableTilesFromCache(childIds);\r\n if (cacheInfo.allTilesFound) {\r\n return cacheInfo.available;\r\n }\r\n\r\n // If we never encountered this tile level before, then a tilemap request must be made to get tiles visibility.\r\n // However, we dont want several overlapping large tilemap request being made simultaneously for tiles on the same level.\r\n // To avoid this from happening, we 'serialize' async calls so that we wait until the first tilemap request has completed\r\n // before making another one.\r\n const childLevel = childIds[0].level+1;\r\n if (this._callQueues && childLevel < this._callQueues.length ) {\r\n const res = this._callQueues[childLevel].then(async () => this.getChildrenAvailabilityFromServer(childIds));\r\n this._callQueues[childLevel] = res.catch(() => nonVisibleChildren);\r\n return res;\r\n } else {\r\n // We should not be in this case, probably because server info is missing LODs in the capabilities?!\r\n return this.getChildrenAvailabilityFromServer(childIds);\r\n }\r\n }\r\n\r\n // Query tiles are tiles that we need to check availability\r\n // The array is assumed to be in in row major orientation, i.e.: [TileRow0Col0, TileRow0Col1, TileRow1Col0, TileRow1Col1,]\r\n protected async fetchAndReadTilemap(queryTiles: QuadId[], reqWidth: number, reqHeight: number) {\r\n let available: boolean[] = [];\r\n if (queryTiles.length === 0) {\r\n return available;\r\n }\r\n\r\n const row = queryTiles[0].row;\r\n const column = queryTiles[0].column;\r\n const level = queryTiles[0].level;\r\n\r\n let reqRow, reqColumn;\r\n if (reqWidth === this.fallbackTileMapRequestSize && reqHeight === this.fallbackTileMapRequestSize){\r\n reqRow = row;\r\n reqColumn = column;\r\n } else {\r\n // If tile map if big enough. create offset that will place the current tile in the middle of the tilemap.\r\n // If we place the first query tile in the top-left corner (i.e. without offset), any query for a tile located above or on the left\r\n // will trigger a new request.\r\n const offsetRow = (reqHeight/2.0)-1;\r\n const offsetColumn = (reqWidth/2.0)-1;\r\n reqRow = Math.max(row - offsetRow, 0);\r\n reqColumn = Math.max(column - offsetColumn, 0);\r\n }\r\n\r\n try {\r\n // console.log(`Tilemap request: ${level},${reqRow},${reqColumn},${reqWidth},${reqHeight}`);\r\n const json = await this.fetchTileMapFromServer(level, reqRow, reqColumn, reqWidth, reqHeight);\r\n let tileMapWidth = reqWidth;\r\n let tileMapHeight = reqHeight;\r\n if (Array.isArray(json.data)){\r\n\r\n // The response width and height might be different than the requested dimensions.\r\n // Ref: https://developers.arcgis.com/rest/services-reference/enterprise/tile-map.htm\r\n if (json.adjusted) {\r\n // If tilemap size got adjusted, I'm expecting to get adjusted size...\r\n // otherwise there is something really odd with this server.\r\n assert(json.location?.width !== undefined && json.location?.height !== undefined);\r\n if (json.location?.width !== undefined && json.location?.height !== undefined) {\r\n tileMapWidth = json.location?.width;\r\n tileMapHeight = json.location?.height;\r\n }\r\n }\r\n let k = 0;\r\n for (let j = 0; j < tileMapWidth; j++) {\r\n for (let i = 0; i < tileMapHeight; i++) {\r\n const avail = json.data[(j*tileMapWidth)+i] !== 0;\r\n const curColumn = reqColumn + i;\r\n const curRow = reqRow + j;\r\n // console.log(`Tilemap tile:: ${level},${curRow},${curColumn} => ${avail}`);\r\n this._tilesCache.set(QuadId.getTileContentId(level, curColumn, curRow), avail);\r\n\r\n // Check if actual tile is among the children we are looking for, if so update the availability array.\r\n if ( curColumn >= queryTiles[0].column && curColumn <= queryTiles[queryTiles.length-1].column\r\n && curRow >= queryTiles[0].row && curRow <= queryTiles[queryTiles.length-1].row ) {\r\n available[k++] = avail;\r\n }\r\n\r\n }\r\n }\r\n } else {\r\n // If server returns data (i.e. error 422), thats fine we assume all tiles of tilemap are not available.\r\n available = queryTiles.map(()=>false);\r\n\r\n // Mark all tilemap tiles to non-available in the cache too\r\n for (let j = 0; j < tileMapWidth; j++) {\r\n for (let i = 0; i < tileMapHeight; i++) {\r\n this._tilesCache.set(QuadId.getTileContentId(level, reqColumn + i, reqRow + j), false);\r\n }\r\n }\r\n }\r\n } catch (_error) {\r\n available = queryTiles.map(()=>false);\r\n }\r\n\r\n return available;\r\n }\r\n\r\n protected async getChildrenAvailabilityFromServer(childIds: QuadId[]): Promise<boolean[]> {\r\n // We need to check cache again:\r\n // Tiles we are looking for may have been added to cache while we were waiting in the call queue.\r\n const cacheInfo = this.getAvailableTilesFromCache(childIds);\r\n if (cacheInfo.allTilesFound) {\r\n return cacheInfo.available;\r\n }\r\n\r\n let available;\r\n try {\r\n available = await this.fetchAndReadTilemap(childIds, this.tileMapRequestSize, this.tileMapRequestSize);\r\n if (available.length !== childIds.length) {\r\n if (this.tileMapRequestSize > this.fallbackTileMapRequestSize) {\r\n // Maybe we were unlucky and the tilemap got adjusted our the tiles we are looking for got clipped,\r\n // so let try we a smaller tilemap\r\n available = await this.fetchAndReadTilemap(childIds, this.fallbackTileMapRequestSize, this.fallbackTileMapRequestSize);\r\n }\r\n\r\n if (available.length < childIds.length) {\r\n // Could not all tiles children tiles, returns what we got and fill any gaps with false.\r\n const tmpAvail = childIds.map(()=>false);\r\n for (let i=0; i<available.length;i++ ) {\r\n tmpAvail[i] = available[i];\r\n }\r\n available = tmpAvail;\r\n }\r\n }\r\n } catch (_error) {\r\n // if any error occurs, we assume tiles not to be visible\r\n available = childIds.map(()=>false);\r\n }\r\n\r\n return available;\r\n }\r\n}\r\n"]}
|
|
@@ -157,7 +157,7 @@ class ArcGISMapLayerImageryProvider extends internal_1.MapLayerImageryProvider {
|
|
|
157
157
|
}
|
|
158
158
|
// Create tile map object only if we are going to request tiles from this server and it support tilemap requests.
|
|
159
159
|
if (this._usesCachedTiles && this._tileMapSupported) {
|
|
160
|
-
this._tileMap = new internal_1.ArcGISTileMap(this._settings.url, (_d = (_c = json.tileInfo) === null || _c === void 0 ? void 0 : _c.lods) === null || _d === void 0 ? void 0 : _d.length);
|
|
160
|
+
this._tileMap = new internal_1.ArcGISTileMap(this._settings.url, this._settings, (_d = (_c = json.tileInfo) === null || _c === void 0 ? void 0 : _c.lods) === null || _d === void 0 ? void 0 : _d.length, this._accessClient);
|
|
161
161
|
}
|
|
162
162
|
// Read range using fullextent from service metadata
|
|
163
163
|
if (json.fullExtent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGISMapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsF;AACtF,oDAAiH;AACjH,kDAA+C;AAC/C,sEAA2F;AAC3F,6CAIwB;AACxB,0DAA+E;AAC/E,wDAA+C;AAC/C,mCAAiC;AAEjC,gBAAgB;AAChB,MAAa,6BAA8B,SAAQ,kCAAuB;IAUxE,YAAY,QAA+B;QACzC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAVjB,qBAAgB,GAAG,CAAC,CAAC;QACrB,qBAAgB,GAAG,CAAC,CAAC;QACrB,mBAAc,GAAG,WAAW,CAAC;QAC7B,oBAAe,GAAG,KAAK,CAAC;QACxB,sBAAiB,GAAG,KAAK,CAAC;QAOhC,IAAI,CAAC,aAAa,GAAG,qBAAS,CAAC,sBAAsB,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC3F,CAAC;IAED,IAAuB,mBAAmB,KAAK,O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,cAAc,EAAE,2BAA2B,IAAI,CAAC,2BAA2B,+BAA+B,CAAC;SAC3N;QACD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI;YACF,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAE,oEAAoE;gBACxG,IAAI,CAAC,gBAAgB,GAAG,MAAM,0BAAe,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE;oBAC5F,WAAW,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;oBACxC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ;oBACjC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ;iBAAE,CAAC,CAAC;aACxC;SAEF;QAAC,MAAM;SACP;QACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;CACF;AAzWD,sEAyWC","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 { getJson, request, RequestOptions, Response } from \"../../../request/Request\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, IModelStatus, ServerError } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../../IModelApp\";\r\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../../../NotificationManager\";\r\nimport {\r\n ArcGisErrorCode, ArcGISTileMap, ArcGisUtilities,\r\n ImageryMapTile, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoRecord, MapLayerAccessClient, MapLayerAccessToken, MapLayerFeatureInfo,\r\n MapLayerImageryProvider, MapLayerImageryProviderStatus, MapSubLayerFeatureInfo, QuadId,\r\n} from \"../../internal\";\r\nimport { PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { Range2d } from \"@itwin/core-geometry\";\r\nimport { isArray } from \"lodash\";\r\n\r\n/** @internal */\r\nexport class ArcGISMapLayerImageryProvider extends MapLayerImageryProvider {\r\n private _maxDepthFromLod = 0;\r\n private _minDepthFromLod = 0;\r\n private _copyrightText = \"Copyright\";\r\n private _querySupported = false;\r\n private _tileMapSupported = false;\r\n private _tileMap: ArcGISTileMap|undefined;\r\n private _accessClient: MapLayerAccessClient|undefined;\r\n private _lastAccessToken: MapLayerAccessToken|undefined;\r\n public serviceJson: any;\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, false);\r\n this._accessClient = IModelApp.mapLayerFormatRegistry.getAccessClient(settings.formatId);\r\n }\r\n\r\n protected override get _filterByCartoRange() { return false; } // Can't trust footprint ranges (USGS Hydro)\r\n\r\n public override get minimumZoomLevel() { return Math.max(super.minimumZoomLevel, this._minDepthFromLod); }\r\n public override get maximumZoomLevel() { return this._maxDepthFromLod > 0 ? this._maxDepthFromLod : super.maximumZoomLevel; }\r\n\r\n public uintToString(uintArray: any) {\r\n return Buffer.from(uintArray).toJSON();\r\n\r\n }\r\n\r\n private async fetchTile(row: number, column: number, zoomLevel: number): Promise<Response | undefined> {\r\n const tileRequestOptions: RequestOptions = { method: \"GET\", responseType: \"arraybuffer\" };\r\n tileRequestOptions.auth = this.getRequestAuthorization();\r\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\r\n if (tileUrl.length === 0)\r\n return undefined;\r\n\r\n return request(tileUrl, tileRequestOptions);\r\n }\r\n\r\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\r\n\r\n if ((this.status === MapLayerImageryProviderStatus.RequireAuth)) {\r\n return undefined;\r\n }\r\n\r\n try {\r\n let tileResponse = await this.fetchTile(row, column, zoomLevel);\r\n if (tileResponse === undefined)\r\n return undefined;\r\n\r\n // Check the content type from the response, it might contain an authentication error that need to be reported.\r\n // Skip if the layer state was already invalid\r\n if (ArcGisUtilities.hasTokenError(tileResponse)) {\r\n\r\n if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)\r\n this._accessClient.invalidateToken(this._lastAccessToken);\r\n\r\n // Token might have expired, make a second attempt by forcing new token.\r\n if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken) {\r\n tileResponse = await this.fetchTile(row, column, zoomLevel);\r\n if (tileResponse === undefined)\r\n return undefined;\r\n }\r\n\r\n // OK at this point, if response still contain a token error, we assume end-user will\r\n // have to provide credentials again. Change the layer status so we\r\n // don't make additional invalid requests..\r\n if (tileResponse && ArcGisUtilities.hasTokenError(tileResponse)) {\r\n // Check again layer status, it might have change during await.\r\n if (this.status === MapLayerImageryProviderStatus.Valid) {\r\n this.status = MapLayerImageryProviderStatus.RequireAuth;\r\n this.onStatusChanged.raiseEvent(this);\r\n\r\n // Only report error to end-user if we were previously able to fetch tiles\r\n // and then encountered an error, otherwise I assume an error was already reported\r\n // through the source validation process.\r\n if (this._hasSuccessfullyFetchedTile) {\r\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.LoadTileTokenError\", { layerName: this._settings.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n }\r\n\r\n if (!this._hasSuccessfullyFetchedTile) {\r\n this._hasSuccessfullyFetchedTile = true;\r\n }\r\n return this.getImageFromTileResponse(tileResponse, zoomLevel);\r\n } catch (error) {\r\n return undefined;\r\n }\r\n }\r\n protected override _generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) {\r\n const childIds = this.getPotentialChildIds(tile);\r\n if (tile.quadId.level < Math.max(1, this.minimumZoomLevel-1)) {\r\n resolveChildren(childIds);\r\n return;\r\n }\r\n\r\n if (this._tileMap) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._tileMap.getChildrenAvailability(childIds).then((availability) => {\r\n const availableChildIds = new Array<QuadId>();\r\n for (let i = 0; i < availability.length; i++)\r\n if (availability[i])\r\n availableChildIds.push(childIds[i]);\r\n\r\n resolveChildren (availableChildIds);\r\n });\r\n } else if (this._usesCachedTiles && this.cartoRange) {\r\n // Filter children by range\r\n const availableChildIds = new Array<QuadId>();\r\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\r\n for (let i = 0; i < childIds.length; i++) {\r\n const childExtent = this.getEPSG4326Extent(childIds[i].row, childIds[i].column, childIds[i].level);\r\n\r\n const childRange = MapCartoRectangle.fromDegrees(childExtent.longitudeLeft, childExtent.latitudeBottom, childExtent.longitudeRight, childExtent.latitudeTop);\r\n if (childRange.intersectsRange(this.cartoRange)) {\r\n availableChildIds.push(childIds[i]);\r\n }\r\n }\r\n resolveChildren (availableChildIds);\r\n } else {\r\n resolveChildren (childIds); // Resolve all children\r\n }\r\n }\r\n\r\n private isEpsg3857Compatible(tileInfo: any) {\r\n if (tileInfo.spatialReference?.latestWkid !== 3857 || !Array.isArray(tileInfo.lods))\r\n return false;\r\n\r\n const zeroLod = tileInfo.lods[0];\r\n return zeroLod.level === 0 && Math.abs(zeroLod.resolution - 156543.03392800014) < .001;\r\n }\r\n\r\n public override async initialize(): Promise<void> {\r\n\r\n const json = await ArcGisUtilities.getServiceJson(this._settings.url, this.getRequestAuthorization());\r\n if (json === undefined)\r\n throw new ServerError(IModelStatus.ValidationFailed, \"\");\r\n\r\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\r\n // Check again layer status, it might have change during await.\r\n if (this.status === MapLayerImageryProviderStatus.Valid) {\r\n this.status = MapLayerImageryProviderStatus.RequireAuth;\r\n this.onStatusChanged.raiseEvent(this);\r\n }\r\n }\r\n\r\n if (json !== undefined) {\r\n this.serviceJson = json;\r\n\r\n if (json.capabilities) {\r\n\r\n this._querySupported = json.capabilities.indexOf(\"Query\") >= 0;\r\n this._tileMapSupported = json.capabilities.indexOf(\"Tilemap\") >= 0;\r\n }\r\n if (json.copyrightText)\r\n this._copyrightText = json.copyrightText;\r\n\r\n if (false !== (this._usesCachedTiles = json.tileInfo !== undefined && this.isEpsg3857Compatible(json.tileInfo))) {\r\n if (json.maxScale !== undefined && json.maxScale !== 0 && Array.isArray(json.tileInfo.lods)) {\r\n for (; this._maxDepthFromLod < json.tileInfo.lods.length && json.tileInfo.lods[this._maxDepthFromLod].scale > json.maxScale; this._maxDepthFromLod++)\r\n ;\r\n }\r\n }\r\n\r\n // Create tile map object only if we are going to request tiles from this server and it support tilemap requests.\r\n if (this._usesCachedTiles && this._tileMapSupported) {\r\n this._tileMap = new ArcGISTileMap(this._settings.url, json.tileInfo?.lods?.length);\r\n }\r\n\r\n // Read range using fullextent from service metadata\r\n if (json.fullExtent) {\r\n if (json.fullExtent.spatialReference.latestWkid === 3857 || json.fullExtent.spatialReference.wkid === 102100) {\r\n const range3857 = Range2d.createFrom({\r\n low: {x: json.fullExtent.xmin, y: json.fullExtent.ymin},\r\n high: {x: json.fullExtent.xmax, y: json.fullExtent.ymax} });\r\n\r\n const west = this.getEPSG4326Lon(range3857.xLow);\r\n const south = this.getEPSG4326Lat(range3857.yLow);\r\n const east = this.getEPSG4326Lon(range3857.xHigh);\r\n const north = this.getEPSG4326Lat(range3857.yHigh);\r\n this.cartoRange = MapCartoRectangle.fromDegrees(west, south, east, north);\r\n }\r\n }\r\n\r\n // Read minLOD if available\r\n if (json.minLOD !== undefined) {\r\n const minLod = parseInt(json.minLOD, 10);\r\n if (!Number.isNaN(minLod)) {\r\n this._minDepthFromLod = minLod;\r\n }\r\n } else if (json.minScale) {\r\n // Read min LOD using minScale\r\n const minScale = json.minScale;\r\n if (json.tileInfo?.lods !== undefined && isArray(json.tileInfo.lods)) {\r\n for (const lod of json.tileInfo.lods) {\r\n if (lod.scale < minScale) {\r\n this._minDepthFromLod = lod.level;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public override addLogoCards(cards: HTMLTableElement): void {\r\n if (!cards.dataset.arcGisLogoCard) {\r\n cards.dataset.arcGisLogoCard = \"true\";\r\n cards.appendChild(IModelApp.makeLogoCard({ heading: \"ArcGIS\", notice: this._copyrightText }));\r\n }\r\n }\r\n\r\n // Translates the provided Cartographic into a EPSG:3857 point, and retrieve information.\r\n // tolerance is in pixels\r\n private async getIdentifyData(quadId: QuadId, carto: Cartographic, tolerance: number): Promise<any> {\r\n const bboxString = this.getEPSG3857ExtentString(quadId.row, quadId.column, quadId.level);\r\n const x = this.getEPSG3857X(carto.longitudeDegrees);\r\n const y = this.getEPSG3857Y(carto.latitudeDegrees);\r\n const tmpUrl = `${this._settings.url}/identify?f=json&tolerance=${tolerance}&returnGeometry=false&sr=3857&imageDisplay=${this.tileSize},${this.tileSize},96&layers=${this.getLayerString(\"visible\")}&geometry=${x},${y}&geometryType=esriGeometryPoint&mapExtent=${bboxString}`;\r\n const urlObj = new URL(tmpUrl);\r\n\r\n if (this._accessClient) {\r\n try {\r\n this._lastAccessToken = undefined; // reset any previous accessToken, and rely on access client's cache\r\n this._lastAccessToken = await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });\r\n } catch {\r\n }\r\n }\r\n\r\n let json = await getJson(urlObj.toString());\r\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\r\n\r\n if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)\r\n this._accessClient.invalidateToken(this._lastAccessToken);\r\n\r\n // Token might have expired, make a second attempt by forcing new token.\r\n if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken ) {\r\n const urlObj2 = new URL(tmpUrl);\r\n if (this._accessClient) {\r\n try {\r\n await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });\r\n } catch {\r\n }\r\n }\r\n json = await getJson(urlObj2.toString());\r\n }\r\n\r\n // OK at this point, if response still contain a token error, we assume end-user will\r\n // have to provide credentials again. Change the layer status so we\r\n // don't make additional invalid requests..\r\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\r\n // Check again layer status, it might have change during await.\r\n if (this.status === MapLayerImageryProviderStatus.Valid) {\r\n this.status = MapLayerImageryProviderStatus.RequireAuth;\r\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.FetchTooltipTokenError\", { layerName: this._settings.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\r\n }\r\n\r\n json = undefined;\r\n }\r\n }\r\n\r\n return json;\r\n }\r\n\r\n // Makes an identify request to ESRI MapService server, and return it as a list of formatted strings\r\n public override async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n await super.getToolTip(strings, quadId, carto, tree);\r\n\r\n if (!this._querySupported)\r\n return;\r\n\r\n const stringSet = new Set<string>();\r\n const json = await this.getIdentifyData(quadId, carto, 1);\r\n\r\n if (json && Array.isArray(json.results)) {\r\n for (const result of json.results) {\r\n if (result.attributes !== undefined && result.attributes[result.displayFieldName] !== undefined) {\r\n const thisString = `${result.displayFieldName}: ${result.attributes[result.displayFieldName]}`;\r\n if (!stringSet.has(thisString)) {\r\n strings.push(thisString);\r\n stringSet.add(thisString);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Makes an identify request to ESRI MapService , and return it as a list MapLayerFeatureInfo object\r\n public override async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree): Promise<void> {\r\n if (!this._querySupported)\r\n return;\r\n\r\n const json = await this.getIdentifyData(quadId, carto,5 );\r\n if (json && Array.isArray(json.results)) {\r\n const layerInfo: MapLayerFeatureInfo = {layerName: this._settings.name};\r\n\r\n for (const result of json.results) {\r\n\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: result.layerName ?? \"\",\r\n displayFieldName: result.displayFieldName,\r\n records : [],\r\n };\r\n for (const [key, value] of Object.entries(result.attributes)) {\r\n // Convert everything to string for now\r\n const strValue = String(value);\r\n subLayerInfo.records?.push(new MapFeatureInfoRecord (\r\n {valueFormat:PropertyValueFormat.Primitive, value:strValue, displayValue: strValue},\r\n {name: key, displayLabel: key, typename:StandardTypeNames.String}\r\n ));\r\n }\r\n\r\n if (layerInfo.info === undefined) {\r\n layerInfo.info = [];\r\n }\r\n\r\n if (!(layerInfo.info instanceof HTMLElement)) {\r\n layerInfo.info.push(subLayerInfo);\r\n }\r\n\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n }\r\n\r\n protected getLayerString(prefix = \"show\"): string {\r\n const layers = new Array<string>();\r\n this._settings.subLayers.forEach((subLayer) => {\r\n if (this._settings.isSubLayerVisible(subLayer))\r\n layers.push(subLayer.idString);\r\n });\r\n\r\n return `${prefix}: ${layers.join(\",\")} `;\r\n }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n let tmpUrl;\r\n if (this._usesCachedTiles) {\r\n tmpUrl = `${this._settings.url}/tile/${zoomLevel}/${row}/${column} `;\r\n } else {\r\n const bboxString = `${this.getEPSG3857ExtentString(row, column, zoomLevel)}&bboxSR=3857`;\r\n tmpUrl = `${this._settings.url}/export?bbox=${bboxString}&size=${this.tileSize},${this.tileSize}&layers=${this.getLayerString()}&format=png&transparent=${this.transparentBackgroundString}&f=image&sr=3857&imagesr=3857`;\r\n }\r\n const urlObj = new URL(tmpUrl);\r\n try {\r\n if (this._accessClient) {\r\n this._lastAccessToken = undefined; // reset any previous accessToken, and rely on access client's cache\r\n this._lastAccessToken = await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {\r\n mapLayerUrl: new URL(this._settings.url),\r\n userName: this._settings.userName,\r\n password: this._settings.password });\r\n }\r\n\r\n } catch {\r\n }\r\n return urlObj.toString();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGISMapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsF;AACtF,oDAAiH;AACjH,kDAA+C;AAC/C,sEAA2F;AAC3F,6CAIwB;AACxB,0DAA+E;AAC/E,wDAA+C;AAC/C,mCAAiC;AAEjC,gBAAgB;AAChB,MAAa,6BAA8B,SAAQ,kCAAuB;IAUxE,YAAY,QAA+B;QACzC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAVjB,qBAAgB,GAAG,CAAC,CAAC;QACrB,qBAAgB,GAAG,CAAC,CAAC;QACrB,mBAAc,GAAG,WAAW,CAAC;QAC7B,oBAAe,GAAG,KAAK,CAAC;QACxB,sBAAiB,GAAG,KAAK,CAAC;QAOhC,IAAI,CAAC,aAAa,GAAG,qBAAS,CAAC,sBAAsB,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC3F,CAAC;IAED,IAAuB,mBAAmB,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC,CAAM,4CAA4C;IAEhH,IAAoB,gBAAgB,KAAK,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC1G,IAAoB,gBAAgB,KAAK,OAAO,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEtH,YAAY,CAAC,SAAc;QAChC,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC;IAEzC,CAAC;IAEO,KAA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;oBACxC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ;oBACjC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ;iBAAE,CAAC,CAAC;aACxC;SAEF;QAAC,MAAM;SACP;QACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;CACF;AAzWD,sEAyWC","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 { getJson, request, RequestOptions, Response } from \"../../../request/Request\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, IModelStatus, ServerError } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../../IModelApp\";\r\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../../../NotificationManager\";\r\nimport {\r\n ArcGisErrorCode, ArcGISTileMap, ArcGisUtilities,\r\n ImageryMapTile, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoRecord, MapLayerAccessClient, MapLayerAccessToken, MapLayerFeatureInfo,\r\n MapLayerImageryProvider, MapLayerImageryProviderStatus, MapSubLayerFeatureInfo, QuadId,\r\n} from \"../../internal\";\r\nimport { PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { Range2d } from \"@itwin/core-geometry\";\r\nimport { isArray } from \"lodash\";\r\n\r\n/** @internal */\r\nexport class ArcGISMapLayerImageryProvider extends MapLayerImageryProvider {\r\n private _maxDepthFromLod = 0;\r\n private _minDepthFromLod = 0;\r\n private _copyrightText = \"Copyright\";\r\n private _querySupported = false;\r\n private _tileMapSupported = false;\r\n private _tileMap: ArcGISTileMap|undefined;\r\n private _accessClient: MapLayerAccessClient|undefined;\r\n private _lastAccessToken: MapLayerAccessToken|undefined;\r\n public serviceJson: any;\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, false);\r\n this._accessClient = IModelApp.mapLayerFormatRegistry.getAccessClient(settings.formatId);\r\n }\r\n\r\n protected override get _filterByCartoRange() { return false; } // Can't trust footprint ranges (USGS Hydro)\r\n\r\n public override get minimumZoomLevel() { return Math.max(super.minimumZoomLevel, this._minDepthFromLod); }\r\n public override get maximumZoomLevel() { return this._maxDepthFromLod > 0 ? this._maxDepthFromLod : super.maximumZoomLevel; }\r\n\r\n public uintToString(uintArray: any) {\r\n return Buffer.from(uintArray).toJSON();\r\n\r\n }\r\n\r\n private async fetchTile(row: number, column: number, zoomLevel: number): Promise<Response | undefined> {\r\n const tileRequestOptions: RequestOptions = { method: \"GET\", responseType: \"arraybuffer\" };\r\n tileRequestOptions.auth = this.getRequestAuthorization();\r\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\r\n if (tileUrl.length === 0)\r\n return undefined;\r\n\r\n return request(tileUrl, tileRequestOptions);\r\n }\r\n\r\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\r\n\r\n if ((this.status === MapLayerImageryProviderStatus.RequireAuth)) {\r\n return undefined;\r\n }\r\n\r\n try {\r\n let tileResponse = await this.fetchTile(row, column, zoomLevel);\r\n if (tileResponse === undefined)\r\n return undefined;\r\n\r\n // Check the content type from the response, it might contain an authentication error that need to be reported.\r\n // Skip if the layer state was already invalid\r\n if (ArcGisUtilities.hasTokenError(tileResponse)) {\r\n\r\n if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)\r\n this._accessClient.invalidateToken(this._lastAccessToken);\r\n\r\n // Token might have expired, make a second attempt by forcing new token.\r\n if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken) {\r\n tileResponse = await this.fetchTile(row, column, zoomLevel);\r\n if (tileResponse === undefined)\r\n return undefined;\r\n }\r\n\r\n // OK at this point, if response still contain a token error, we assume end-user will\r\n // have to provide credentials again. Change the layer status so we\r\n // don't make additional invalid requests..\r\n if (tileResponse && ArcGisUtilities.hasTokenError(tileResponse)) {\r\n // Check again layer status, it might have change during await.\r\n if (this.status === MapLayerImageryProviderStatus.Valid) {\r\n this.status = MapLayerImageryProviderStatus.RequireAuth;\r\n this.onStatusChanged.raiseEvent(this);\r\n\r\n // Only report error to end-user if we were previously able to fetch tiles\r\n // and then encountered an error, otherwise I assume an error was already reported\r\n // through the source validation process.\r\n if (this._hasSuccessfullyFetchedTile) {\r\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.LoadTileTokenError\", { layerName: this._settings.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n }\r\n\r\n if (!this._hasSuccessfullyFetchedTile) {\r\n this._hasSuccessfullyFetchedTile = true;\r\n }\r\n return this.getImageFromTileResponse(tileResponse, zoomLevel);\r\n } catch (error) {\r\n return undefined;\r\n }\r\n }\r\n protected override _generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) {\r\n const childIds = this.getPotentialChildIds(tile);\r\n if (tile.quadId.level < Math.max(1, this.minimumZoomLevel-1)) {\r\n resolveChildren(childIds);\r\n return;\r\n }\r\n\r\n if (this._tileMap) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._tileMap.getChildrenAvailability(childIds).then((availability) => {\r\n const availableChildIds = new Array<QuadId>();\r\n for (let i = 0; i < availability.length; i++)\r\n if (availability[i])\r\n availableChildIds.push(childIds[i]);\r\n\r\n resolveChildren (availableChildIds);\r\n });\r\n } else if (this._usesCachedTiles && this.cartoRange) {\r\n // Filter children by range\r\n const availableChildIds = new Array<QuadId>();\r\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\r\n for (let i = 0; i < childIds.length; i++) {\r\n const childExtent = this.getEPSG4326Extent(childIds[i].row, childIds[i].column, childIds[i].level);\r\n\r\n const childRange = MapCartoRectangle.fromDegrees(childExtent.longitudeLeft, childExtent.latitudeBottom, childExtent.longitudeRight, childExtent.latitudeTop);\r\n if (childRange.intersectsRange(this.cartoRange)) {\r\n availableChildIds.push(childIds[i]);\r\n }\r\n }\r\n resolveChildren (availableChildIds);\r\n } else {\r\n resolveChildren (childIds); // Resolve all children\r\n }\r\n }\r\n\r\n private isEpsg3857Compatible(tileInfo: any) {\r\n if (tileInfo.spatialReference?.latestWkid !== 3857 || !Array.isArray(tileInfo.lods))\r\n return false;\r\n\r\n const zeroLod = tileInfo.lods[0];\r\n return zeroLod.level === 0 && Math.abs(zeroLod.resolution - 156543.03392800014) < .001;\r\n }\r\n\r\n public override async initialize(): Promise<void> {\r\n\r\n const json = await ArcGisUtilities.getServiceJson(this._settings.url, this.getRequestAuthorization());\r\n if (json === undefined)\r\n throw new ServerError(IModelStatus.ValidationFailed, \"\");\r\n\r\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\r\n // Check again layer status, it might have change during await.\r\n if (this.status === MapLayerImageryProviderStatus.Valid) {\r\n this.status = MapLayerImageryProviderStatus.RequireAuth;\r\n this.onStatusChanged.raiseEvent(this);\r\n }\r\n }\r\n\r\n if (json !== undefined) {\r\n this.serviceJson = json;\r\n\r\n if (json.capabilities) {\r\n\r\n this._querySupported = json.capabilities.indexOf(\"Query\") >= 0;\r\n this._tileMapSupported = json.capabilities.indexOf(\"Tilemap\") >= 0;\r\n }\r\n if (json.copyrightText)\r\n this._copyrightText = json.copyrightText;\r\n\r\n if (false !== (this._usesCachedTiles = json.tileInfo !== undefined && this.isEpsg3857Compatible(json.tileInfo))) {\r\n if (json.maxScale !== undefined && json.maxScale !== 0 && Array.isArray(json.tileInfo.lods)) {\r\n for (; this._maxDepthFromLod < json.tileInfo.lods.length && json.tileInfo.lods[this._maxDepthFromLod].scale > json.maxScale; this._maxDepthFromLod++)\r\n ;\r\n }\r\n }\r\n\r\n // Create tile map object only if we are going to request tiles from this server and it support tilemap requests.\r\n if (this._usesCachedTiles && this._tileMapSupported) {\r\n this._tileMap = new ArcGISTileMap(this._settings.url, this._settings, json.tileInfo?.lods?.length, this._accessClient);\r\n }\r\n\r\n // Read range using fullextent from service metadata\r\n if (json.fullExtent) {\r\n if (json.fullExtent.spatialReference.latestWkid === 3857 || json.fullExtent.spatialReference.wkid === 102100) {\r\n const range3857 = Range2d.createFrom({\r\n low: {x: json.fullExtent.xmin, y: json.fullExtent.ymin},\r\n high: {x: json.fullExtent.xmax, y: json.fullExtent.ymax} });\r\n\r\n const west = this.getEPSG4326Lon(range3857.xLow);\r\n const south = this.getEPSG4326Lat(range3857.yLow);\r\n const east = this.getEPSG4326Lon(range3857.xHigh);\r\n const north = this.getEPSG4326Lat(range3857.yHigh);\r\n this.cartoRange = MapCartoRectangle.fromDegrees(west, south, east, north);\r\n }\r\n }\r\n\r\n // Read minLOD if available\r\n if (json.minLOD !== undefined) {\r\n const minLod = parseInt(json.minLOD, 10);\r\n if (!Number.isNaN(minLod)) {\r\n this._minDepthFromLod = minLod;\r\n }\r\n } else if (json.minScale) {\r\n // Read min LOD using minScale\r\n const minScale = json.minScale;\r\n if (json.tileInfo?.lods !== undefined && isArray(json.tileInfo.lods)) {\r\n for (const lod of json.tileInfo.lods) {\r\n if (lod.scale < minScale) {\r\n this._minDepthFromLod = lod.level;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public override addLogoCards(cards: HTMLTableElement): void {\r\n if (!cards.dataset.arcGisLogoCard) {\r\n cards.dataset.arcGisLogoCard = \"true\";\r\n cards.appendChild(IModelApp.makeLogoCard({ heading: \"ArcGIS\", notice: this._copyrightText }));\r\n }\r\n }\r\n\r\n // Translates the provided Cartographic into a EPSG:3857 point, and retrieve information.\r\n // tolerance is in pixels\r\n private async getIdentifyData(quadId: QuadId, carto: Cartographic, tolerance: number): Promise<any> {\r\n const bboxString = this.getEPSG3857ExtentString(quadId.row, quadId.column, quadId.level);\r\n const x = this.getEPSG3857X(carto.longitudeDegrees);\r\n const y = this.getEPSG3857Y(carto.latitudeDegrees);\r\n const tmpUrl = `${this._settings.url}/identify?f=json&tolerance=${tolerance}&returnGeometry=false&sr=3857&imageDisplay=${this.tileSize},${this.tileSize},96&layers=${this.getLayerString(\"visible\")}&geometry=${x},${y}&geometryType=esriGeometryPoint&mapExtent=${bboxString}`;\r\n const urlObj = new URL(tmpUrl);\r\n\r\n if (this._accessClient) {\r\n try {\r\n this._lastAccessToken = undefined; // reset any previous accessToken, and rely on access client's cache\r\n this._lastAccessToken = await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });\r\n } catch {\r\n }\r\n }\r\n\r\n let json = await getJson(urlObj.toString());\r\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\r\n\r\n if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)\r\n this._accessClient.invalidateToken(this._lastAccessToken);\r\n\r\n // Token might have expired, make a second attempt by forcing new token.\r\n if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken ) {\r\n const urlObj2 = new URL(tmpUrl);\r\n if (this._accessClient) {\r\n try {\r\n await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });\r\n } catch {\r\n }\r\n }\r\n json = await getJson(urlObj2.toString());\r\n }\r\n\r\n // OK at this point, if response still contain a token error, we assume end-user will\r\n // have to provide credentials again. Change the layer status so we\r\n // don't make additional invalid requests..\r\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\r\n // Check again layer status, it might have change during await.\r\n if (this.status === MapLayerImageryProviderStatus.Valid) {\r\n this.status = MapLayerImageryProviderStatus.RequireAuth;\r\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.FetchTooltipTokenError\", { layerName: this._settings.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\r\n }\r\n\r\n json = undefined;\r\n }\r\n }\r\n\r\n return json;\r\n }\r\n\r\n // Makes an identify request to ESRI MapService server, and return it as a list of formatted strings\r\n public override async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n await super.getToolTip(strings, quadId, carto, tree);\r\n\r\n if (!this._querySupported)\r\n return;\r\n\r\n const stringSet = new Set<string>();\r\n const json = await this.getIdentifyData(quadId, carto, 1);\r\n\r\n if (json && Array.isArray(json.results)) {\r\n for (const result of json.results) {\r\n if (result.attributes !== undefined && result.attributes[result.displayFieldName] !== undefined) {\r\n const thisString = `${result.displayFieldName}: ${result.attributes[result.displayFieldName]}`;\r\n if (!stringSet.has(thisString)) {\r\n strings.push(thisString);\r\n stringSet.add(thisString);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Makes an identify request to ESRI MapService , and return it as a list MapLayerFeatureInfo object\r\n public override async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree): Promise<void> {\r\n if (!this._querySupported)\r\n return;\r\n\r\n const json = await this.getIdentifyData(quadId, carto,5 );\r\n if (json && Array.isArray(json.results)) {\r\n const layerInfo: MapLayerFeatureInfo = {layerName: this._settings.name};\r\n\r\n for (const result of json.results) {\r\n\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: result.layerName ?? \"\",\r\n displayFieldName: result.displayFieldName,\r\n records : [],\r\n };\r\n for (const [key, value] of Object.entries(result.attributes)) {\r\n // Convert everything to string for now\r\n const strValue = String(value);\r\n subLayerInfo.records?.push(new MapFeatureInfoRecord (\r\n {valueFormat:PropertyValueFormat.Primitive, value:strValue, displayValue: strValue},\r\n {name: key, displayLabel: key, typename:StandardTypeNames.String}\r\n ));\r\n }\r\n\r\n if (layerInfo.info === undefined) {\r\n layerInfo.info = [];\r\n }\r\n\r\n if (!(layerInfo.info instanceof HTMLElement)) {\r\n layerInfo.info.push(subLayerInfo);\r\n }\r\n\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n }\r\n\r\n protected getLayerString(prefix = \"show\"): string {\r\n const layers = new Array<string>();\r\n this._settings.subLayers.forEach((subLayer) => {\r\n if (this._settings.isSubLayerVisible(subLayer))\r\n layers.push(subLayer.idString);\r\n });\r\n\r\n return `${prefix}: ${layers.join(\",\")} `;\r\n }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n let tmpUrl;\r\n if (this._usesCachedTiles) {\r\n tmpUrl = `${this._settings.url}/tile/${zoomLevel}/${row}/${column} `;\r\n } else {\r\n const bboxString = `${this.getEPSG3857ExtentString(row, column, zoomLevel)}&bboxSR=3857`;\r\n tmpUrl = `${this._settings.url}/export?bbox=${bboxString}&size=${this.tileSize},${this.tileSize}&layers=${this.getLayerString()}&format=png&transparent=${this.transparentBackgroundString}&f=image&sr=3857&imagesr=3857`;\r\n }\r\n const urlObj = new URL(tmpUrl);\r\n try {\r\n if (this._accessClient) {\r\n this._lastAccessToken = undefined; // reset any previous accessToken, and rely on access client's cache\r\n this._lastAccessToken = await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {\r\n mapLayerUrl: new URL(this._settings.url),\r\n userName: this._settings.userName,\r\n password: this._settings.password });\r\n }\r\n\r\n } catch {\r\n }\r\n return urlObj.toString();\r\n }\r\n}\r\n"]}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Views
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
4
|
+
/** Specifies margins to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding the
|
|
5
|
+
* viewed volume by a percentage of its original size to add extra space around one or more edges.
|
|
6
|
+
* The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).
|
|
7
|
+
* The values are clamped to the range 0 through 0.25.
|
|
8
|
+
* @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.
|
|
9
|
+
* @note The way in which the extra space is computed is somewhat unintuitive and may lead to surprising results.
|
|
10
|
+
* @see [[MarginOptions.marginPercent]].
|
|
11
|
+
* @see [[PaddingPercent]] for a more predictable way of adjusting the viewed volume.
|
|
6
12
|
* @public
|
|
7
13
|
* @extensions
|
|
8
14
|
*/
|
|
@@ -13,4 +19,23 @@ export declare class MarginPercent {
|
|
|
13
19
|
bottom: number;
|
|
14
20
|
constructor(left: number, top: number, right: number, bottom: number);
|
|
15
21
|
}
|
|
22
|
+
/** Specifies padding to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding or
|
|
23
|
+
* contracting the viewed volume by a fraction of its original size.
|
|
24
|
+
* The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).
|
|
25
|
+
* Positive values add additional volume along the specified edge, negative values subtract it, and zero values have no effect.
|
|
26
|
+
* All properties default to zero if `undefined`.
|
|
27
|
+
* For example, if the original volume has a width of 100 and the padding is specified as `{ left: 1 }`, the width will be doubled to 200, with 100 padding on the left side of the view.
|
|
28
|
+
* If a padding of 0.25 is specified for each of [[left]], [[right]], [[top]], and [[bottom]], then the final volume will be inset such that 25% of the original volume falls outside
|
|
29
|
+
* of the view on each side.
|
|
30
|
+
* @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.
|
|
31
|
+
* @see [[MarginOptions.paddingPercent]].
|
|
32
|
+
* @public
|
|
33
|
+
* @extensions
|
|
34
|
+
*/
|
|
35
|
+
export interface PaddingPercent {
|
|
36
|
+
left?: number;
|
|
37
|
+
right?: number;
|
|
38
|
+
top?: number;
|
|
39
|
+
bottom?: number;
|
|
40
|
+
}
|
|
16
41
|
//# sourceMappingURL=MarginPercent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarginPercent.d.ts","sourceRoot":"","sources":["../../src/MarginPercent.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"MarginPercent.d.ts","sourceRoot":"","sources":["../../src/MarginPercent.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;;;;;;;;;GAUG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,MAAM;IAAS,GAAG,EAAE,MAAM;IAAS,KAAK,EAAE,MAAM;IAAS,MAAM,EAAE,MAAM;gBAA7E,IAAI,EAAE,MAAM,EAAS,GAAG,EAAE,MAAM,EAAS,KAAK,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM;CAOjG;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/lib/esm/MarginPercent.js
CHANGED
|
@@ -6,8 +6,14 @@
|
|
|
6
6
|
* @module Views
|
|
7
7
|
*/
|
|
8
8
|
import { Geometry } from "@itwin/core-geometry";
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
9
|
+
/** Specifies margins to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding the
|
|
10
|
+
* viewed volume by a percentage of its original size to add extra space around one or more edges.
|
|
11
|
+
* The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).
|
|
12
|
+
* The values are clamped to the range 0 through 0.25.
|
|
13
|
+
* @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.
|
|
14
|
+
* @note The way in which the extra space is computed is somewhat unintuitive and may lead to surprising results.
|
|
15
|
+
* @see [[MarginOptions.marginPercent]].
|
|
16
|
+
* @see [[PaddingPercent]] for a more predictable way of adjusting the viewed volume.
|
|
11
17
|
* @public
|
|
12
18
|
* @extensions
|
|
13
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarginPercent.js","sourceRoot":"","sources":["../../src/MarginPercent.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"MarginPercent.js","sourceRoot":"","sources":["../../src/MarginPercent.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,aAAa;IACxB,YAAmB,IAAY,EAAS,GAAW,EAAS,KAAa,EAAS,MAAc;QAA7E,SAAI,GAAJ,IAAI,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAQ;QAAS,WAAM,GAAN,MAAM,CAAQ;QAC9F,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,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 Views\r\n */\r\n\r\nimport { Geometry } from \"@itwin/core-geometry\";\r\n\r\n/** Specifies margins to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding the\r\n * viewed volume by a percentage of its original size to add extra space around one or more edges.\r\n * The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).\r\n * The values are clamped to the range 0 through 0.25.\r\n * @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.\r\n * @note The way in which the extra space is computed is somewhat unintuitive and may lead to surprising results.\r\n * @see [[MarginOptions.marginPercent]].\r\n * @see [[PaddingPercent]] for a more predictable way of adjusting the viewed volume.\r\n * @public\r\n * @extensions\r\n */\r\nexport class MarginPercent {\r\n constructor(public left: number, public top: number, public right: number, public bottom: number) {\r\n const limitMargin = (val: number) => Geometry.clamp(val, 0.0, 0.25);\r\n this.left = limitMargin(left);\r\n this.top = limitMargin(top);\r\n this.right = limitMargin(right);\r\n this.bottom = limitMargin(bottom);\r\n }\r\n}\r\n\r\n/** Specifies padding to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding or\r\n * contracting the viewed volume by a fraction of its original size.\r\n * The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).\r\n * Positive values add additional volume along the specified edge, negative values subtract it, and zero values have no effect.\r\n * All properties default to zero if `undefined`.\r\n * For example, if the original volume has a width of 100 and the padding is specified as `{ left: 1 }`, the width will be doubled to 200, with 100 padding on the left side of the view.\r\n * If a padding of 0.25 is specified for each of [[left]], [[right]], [[top]], and [[bottom]], then the final volume will be inset such that 25% of the original volume falls outside\r\n * of the view on each side.\r\n * @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.\r\n * @see [[MarginOptions.paddingPercent]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PaddingPercent {\r\n left?: number;\r\n right?: number;\r\n top?: number;\r\n bottom?: number;\r\n}\r\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { EasingFunction } from "@itwin/core-common";
|
|
5
5
|
import { ViewStatus } from "./ViewStatus";
|
|
6
|
-
import { MarginPercent } from "./MarginPercent";
|
|
6
|
+
import { MarginPercent, PaddingPercent } from "./MarginPercent";
|
|
7
7
|
import { Point3d } from "@itwin/core-geometry";
|
|
8
8
|
/** An object to animate a transition of a [[Viewport]].
|
|
9
9
|
* Only one animator may be associated with a viewport at a time. Registering a new
|
|
@@ -60,8 +60,16 @@ export interface OnViewExtentsError {
|
|
|
60
60
|
* @extensions
|
|
61
61
|
*/
|
|
62
62
|
export interface MarginOptions {
|
|
63
|
-
/**
|
|
63
|
+
/** Margins to apply around the edges of the view.
|
|
64
|
+
* @note This property is ignored if [[paddingPercent]] is specified.
|
|
65
|
+
*/
|
|
64
66
|
marginPercent?: MarginPercent;
|
|
67
|
+
/** Padding to apply around the edges of the view.
|
|
68
|
+
* Individual padding for any or all sides can be specified as a [[PaddingPercent]], or a uniform padding to be applied
|
|
69
|
+
* to all sides can be specified as a single number.
|
|
70
|
+
* @note This property takes precedence over [[marginPercent]].
|
|
71
|
+
*/
|
|
72
|
+
paddingPercent?: PaddingPercent | number;
|
|
65
73
|
}
|
|
66
74
|
/** Options that control how operations that change a viewport behave.
|
|
67
75
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewAnimation.d.ts","sourceRoot":"","sources":["../../src/ViewAnimation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ViewAnimation.d.ts","sourceRoot":"","sources":["../../src/ViewAnimation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,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.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","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 Views\r\n */\r\n\r\nimport { EasingFunction } from \"@itwin/core-common\";\r\nimport { ViewStatus } from \"./ViewStatus\";\r\nimport { MarginPercent } from \"./MarginPercent\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\n\r\n/** An object to animate a transition of a [[Viewport]].\r\n * Only one animator may be associated with a viewport at a time. Registering a new\r\n * animator interrupts and replaces any existing animator.\r\n * The animator's animate() function will be invoked just prior to the rendering of each frame.\r\n * The animator may be removed in response to certain changes to the viewport - e.g., when\r\n * the viewport is closed, or viewing tools operate on it, etc.\r\n * @see [[Viewport.setAnimator]] to apply an animator to a viewport.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Animator {\r\n /** Apply animation to the viewport. Return true when animation is completed, causing the animator to be removed from the viewport. */\r\n animate(): boolean;\r\n\r\n /** Invoked to abort this Animator. This method is called if [[Viewport.setAnimator]] is called before `animate` returns true */\r\n interrupt(): void;\r\n}\r\n\r\n/** Options that control how an Viewport animation behaves.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewAnimationOptions {\r\n /** Amount of time for animation, in milliseconds. Default is [[ScreenViewport.animation.time.normal]] */\r\n animationTime?: number;\r\n /** if animation is aborted, don't move to end, leave at current point instead. */\r\n cancelOnAbort?: boolean;\r\n /** easing function for animation. Default is Easing.Cubic.Out */\r\n easingFunction?: EasingFunction;\r\n /** Invoked when the animator is finished. didComplete is true only if the animation finished without being interrupted. */\r\n animationFinishedCallback?(didComplete: boolean): void;\r\n}\r\n\r\n/** Options that control how a view is aligned with the globe.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GlobalAlignmentOptions {\r\n /** The target point about which the alignment occurs. This point will remain stationary in the view */\r\n target: Point3d;\r\n /** If defined and true then the alignment rotation is scaled by the [[ViewState.globalViewTransition]]. This is\r\n * typically used when zooming out from is zoomed out from a specific location to a more global representation.\r\n */\r\n transition?: boolean;\r\n}\r\n\r\n/** A method to be called if an error occurs while adjusting a ViewState's extents\r\n * @public\r\n * @extensions\r\n */\r\nexport interface OnViewExtentsError {\r\n /** Function to be called when the extents are adjusted due to a limits error (view too larger or too small) */\r\n onExtentsError?: (status: ViewStatus) => ViewStatus;\r\n}\r\n\r\n/** Options that control the margin around the edges of a volume for lookAt and Fit view operations\r\n * @public\r\n * @extensions\r\n */\r\nexport interface MarginOptions {\r\n /**
|
|
1
|
+
{"version":3,"file":"ViewAnimation.js","sourceRoot":"","sources":["../../src/ViewAnimation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","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 Views\r\n */\r\n\r\nimport { EasingFunction } from \"@itwin/core-common\";\r\nimport { ViewStatus } from \"./ViewStatus\";\r\nimport { MarginPercent, PaddingPercent } from \"./MarginPercent\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\n\r\n/** An object to animate a transition of a [[Viewport]].\r\n * Only one animator may be associated with a viewport at a time. Registering a new\r\n * animator interrupts and replaces any existing animator.\r\n * The animator's animate() function will be invoked just prior to the rendering of each frame.\r\n * The animator may be removed in response to certain changes to the viewport - e.g., when\r\n * the viewport is closed, or viewing tools operate on it, etc.\r\n * @see [[Viewport.setAnimator]] to apply an animator to a viewport.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Animator {\r\n /** Apply animation to the viewport. Return true when animation is completed, causing the animator to be removed from the viewport. */\r\n animate(): boolean;\r\n\r\n /** Invoked to abort this Animator. This method is called if [[Viewport.setAnimator]] is called before `animate` returns true */\r\n interrupt(): void;\r\n}\r\n\r\n/** Options that control how an Viewport animation behaves.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewAnimationOptions {\r\n /** Amount of time for animation, in milliseconds. Default is [[ScreenViewport.animation.time.normal]] */\r\n animationTime?: number;\r\n /** if animation is aborted, don't move to end, leave at current point instead. */\r\n cancelOnAbort?: boolean;\r\n /** easing function for animation. Default is Easing.Cubic.Out */\r\n easingFunction?: EasingFunction;\r\n /** Invoked when the animator is finished. didComplete is true only if the animation finished without being interrupted. */\r\n animationFinishedCallback?(didComplete: boolean): void;\r\n}\r\n\r\n/** Options that control how a view is aligned with the globe.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GlobalAlignmentOptions {\r\n /** The target point about which the alignment occurs. This point will remain stationary in the view */\r\n target: Point3d;\r\n /** If defined and true then the alignment rotation is scaled by the [[ViewState.globalViewTransition]]. This is\r\n * typically used when zooming out from is zoomed out from a specific location to a more global representation.\r\n */\r\n transition?: boolean;\r\n}\r\n\r\n/** A method to be called if an error occurs while adjusting a ViewState's extents\r\n * @public\r\n * @extensions\r\n */\r\nexport interface OnViewExtentsError {\r\n /** Function to be called when the extents are adjusted due to a limits error (view too larger or too small) */\r\n onExtentsError?: (status: ViewStatus) => ViewStatus;\r\n}\r\n\r\n/** Options that control the margin around the edges of a volume for lookAt and Fit view operations\r\n * @public\r\n * @extensions\r\n */\r\nexport interface MarginOptions {\r\n /** Margins to apply around the edges of the view.\r\n * @note This property is ignored if [[paddingPercent]] is specified.\r\n */\r\n marginPercent?: MarginPercent;\r\n /** Padding to apply around the edges of the view.\r\n * Individual padding for any or all sides can be specified as a [[PaddingPercent]], or a uniform padding to be applied\r\n * to all sides can be specified as a single number.\r\n * @note This property takes precedence over [[marginPercent]].\r\n */\r\n paddingPercent?: PaddingPercent | number;\r\n}\r\n\r\n/** Options that control how operations that change a viewport behave.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewChangeOptions extends OnViewExtentsError, ViewAnimationOptions {\r\n /** Whether to save the result of this change into the view undo stack. Default is to save in undo. */\r\n noSaveInUndo?: boolean;\r\n /** Whether the change should be animated or not. Default is to not animate frustum change. */\r\n animateFrustumChange?: boolean;\r\n /** If defined the controls how the view will be aligned with the globe */\r\n globalAlignment?: GlobalAlignmentOptions;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewState.d.ts","sourceRoot":"","sources":["../../src/ViewState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAAiB,OAAO,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACL,KAAK,EAAa,UAAU,EAA+C,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EACzF,OAAO,EAAE,OAAO,EAAW,OAAO,EAAS,SAAS,EAAY,QAAQ,EAAE,KAAK,EAC7G,MAAM,EAAE,GAAG,EACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAC3H,4BAA4B,EAAE,6BAA6B,EACrC,cAAc,EAAE,mBAAmB,EACzD,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EACzH,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAgD,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE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AK,IAAI;IAM9D,gBAAgB;IACA,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI;IAM1E,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB;CAClE"}
|
package/lib/esm/ViewState.js
CHANGED
|
@@ -694,6 +694,7 @@ export class ViewState extends ElementState {
|
|
|
694
694
|
* @see lookAtVolume
|
|
695
695
|
*/
|
|
696
696
|
lookAtViewAlignedVolume(volume, aspect, options) {
|
|
697
|
+
var _a, _b, _c, _d;
|
|
697
698
|
if (volume.isNull) // make sure volume is valid
|
|
698
699
|
return;
|
|
699
700
|
const viewRot = this.getRotation();
|
|
@@ -704,14 +705,33 @@ export class ViewState extends ElementState {
|
|
|
704
705
|
newOrigin.z -= (minimumDepth - newDelta.z) / 2.0;
|
|
705
706
|
newDelta.z = minimumDepth;
|
|
706
707
|
}
|
|
707
|
-
const margin = options === null || options === void 0 ? void 0 : options.marginPercent;
|
|
708
708
|
if (this.is3d() && this.isCameraOn) {
|
|
709
709
|
// If the camera is on, the only way to guarantee we can see the entire volume is to set delta at the front plane, not focus plane.
|
|
710
710
|
// That generally causes the view to be too large (objects in it are too small), since we can't tell whether the objects are at
|
|
711
711
|
// the front or back of the view. For this reason, don't attempt to add any "margin" to camera views.
|
|
712
712
|
}
|
|
713
|
-
else if (
|
|
713
|
+
else if (undefined !== (options === null || options === void 0 ? void 0 : options.paddingPercent)) {
|
|
714
|
+
let left, right, top, bottom;
|
|
715
|
+
const padding = options.paddingPercent;
|
|
716
|
+
if (typeof padding === "number") {
|
|
717
|
+
left = right = top = bottom = padding;
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
left = (_a = padding.left) !== null && _a !== void 0 ? _a : 0;
|
|
721
|
+
right = (_b = padding.right) !== null && _b !== void 0 ? _b : 0;
|
|
722
|
+
top = (_c = padding.top) !== null && _c !== void 0 ? _c : 0;
|
|
723
|
+
bottom = (_d = padding.bottom) !== null && _d !== void 0 ? _d : 0;
|
|
724
|
+
}
|
|
725
|
+
const width = newDelta.x;
|
|
726
|
+
const height = newDelta.y;
|
|
727
|
+
newOrigin.x -= left * width;
|
|
728
|
+
newDelta.x += (right + left) * width;
|
|
729
|
+
newOrigin.y -= bottom * height;
|
|
730
|
+
newDelta.y += (top + bottom) * height;
|
|
731
|
+
}
|
|
732
|
+
else if (options === null || options === void 0 ? void 0 : options.marginPercent) {
|
|
714
733
|
// compute how much space we'll need for both of X and Y margins in root coordinates
|
|
734
|
+
const margin = options.marginPercent;
|
|
715
735
|
const wPercent = margin.left + margin.right;
|
|
716
736
|
const hPercent = margin.top + margin.bottom;
|
|
717
737
|
const marginHorizontal = wPercent / (1 - wPercent) * newDelta.x;
|