@itwin/map-layers-formats 5.2.0-dev.7 → 5.3.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -1
- package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.d.ts.map +1 -1
- package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.js +8 -2
- package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -1
- package/lib/cjs/internal/NativeGoogleMapsSession.d.ts +1 -0
- package/lib/cjs/internal/NativeGoogleMapsSession.d.ts.map +1 -1
- package/lib/cjs/internal/NativeGoogleMapsSession.js +6 -3
- package/lib/cjs/internal/NativeGoogleMapsSession.js.map +1 -1
- package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.d.ts.map +1 -1
- package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js +8 -2
- package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -1
- package/lib/esm/internal/NativeGoogleMapsSession.d.ts +1 -0
- package/lib/esm/internal/NativeGoogleMapsSession.d.ts.map +1 -1
- package/lib/esm/internal/NativeGoogleMapsSession.js +6 -3
- package/lib/esm/internal/NativeGoogleMapsSession.js.map +1 -1
- package/lib/public/images/GoogleMaps_Logo_Gray.svg +50 -0
- package/lib/public/images/GoogleMaps_Logo_WithDarkOutline.svg +78 -0
- package/lib/public/images/GoogleMaps_Logo_WithLightOutline.svg +78 -0
- package/package.json +13 -13
- package/lib/public/images/google_on_non_white.png +0 -0
- package/lib/public/images/google_on_non_white_hdpi.png +0 -0
- package/lib/public/images/google_on_white.png +0 -0
- package/lib/public/images/google_on_white_hdpi.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
# Change Log - @itwin/map-layers-formats
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 17 Sep 2025 17:22:51 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.1.8
|
|
6
|
+
Wed, 17 Sep 2025 17:17:16 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Update Google Maps attribution
|
|
11
|
+
|
|
12
|
+
## 5.1.7
|
|
13
|
+
Tue, 09 Sep 2025 19:28:04 GMT
|
|
14
|
+
|
|
15
|
+
_Version update only_
|
|
16
|
+
|
|
17
|
+
## 5.1.6
|
|
18
|
+
Mon, 08 Sep 2025 13:53:47 GMT
|
|
19
|
+
|
|
20
|
+
_Version update only_
|
|
21
|
+
|
|
22
|
+
## 5.1.5
|
|
23
|
+
Thu, 04 Sep 2025 13:51:09 GMT
|
|
24
|
+
|
|
25
|
+
_Version update only_
|
|
26
|
+
|
|
27
|
+
## 5.1.4
|
|
28
|
+
Fri, 22 Aug 2025 14:22:33 GMT
|
|
29
|
+
|
|
30
|
+
_Version update only_
|
|
31
|
+
|
|
32
|
+
## 5.1.3
|
|
33
|
+
Wed, 20 Aug 2025 13:57:10 GMT
|
|
34
|
+
|
|
35
|
+
_Version update only_
|
|
36
|
+
|
|
37
|
+
## 5.1.2
|
|
38
|
+
Thu, 14 Aug 2025 19:38:08 GMT
|
|
39
|
+
|
|
40
|
+
_Version update only_
|
|
4
41
|
|
|
5
42
|
## 5.1.1
|
|
6
43
|
Fri, 08 Aug 2025 18:06:10 GMT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsImageryProvider.d.ts","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAkC,iBAAiB,EAAE,uBAAuB,EAAwB,cAAc,EAAQ,MAAM,sBAAsB,CAAC;AAC/K,OAAO,EAAE,8BAA8B,EAAuF,wBAAwB,EAAE,YAAY,EAAE,MAA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E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI5E,iBAAiB,CAAC,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;YAoBxF,iBAAiB;YAiCjB,YAAY;IASJ,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAiDhG,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAIxD,OAAO,CAAC,gBAAgB;IAIF,eAAe,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA8BlG"}
|
|
@@ -210,7 +210,10 @@ class GoogleMapsImageryProvider extends core_frontend_1.MapLayerImageryProvider
|
|
|
210
210
|
const attrList = await this.fetchAttributions(tiles);
|
|
211
211
|
for (const attr of attrList) {
|
|
212
212
|
attr.split(",").forEach((line) => {
|
|
213
|
-
|
|
213
|
+
// Attempt to reduce duplicates, since if there are multiple zoom levels sometimes the same info is returned
|
|
214
|
+
if (!copyrightMsg.includes(line)) {
|
|
215
|
+
copyrightMsg += `${copyrightMsg.length === 0 ? "" : "<br>"}${line}`;
|
|
216
|
+
}
|
|
214
217
|
});
|
|
215
218
|
}
|
|
216
219
|
}
|
|
@@ -218,8 +221,11 @@ class GoogleMapsImageryProvider extends core_frontend_1.MapLayerImageryProvider
|
|
|
218
221
|
core_bentley_1.Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message ?? "Unknown error"}`);
|
|
219
222
|
}
|
|
220
223
|
}
|
|
224
|
+
const iconSrc = document.createElement("img");
|
|
225
|
+
iconSrc.src = `${core_frontend_1.IModelApp.publicPath}images/GoogleMaps_Logo_Gray.svg`;
|
|
226
|
+
iconSrc.style.padding = "10px 10px 5px 10px";
|
|
221
227
|
cards.appendChild(core_frontend_1.IModelApp.makeLogoCard({
|
|
222
|
-
iconSrc
|
|
228
|
+
iconSrc,
|
|
223
229
|
heading: "Google Maps",
|
|
224
230
|
notice: copyrightMsg
|
|
225
231
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsImageryProvider.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA0E;AAE1E,wDAA+K;AAE/K,uFAAwF;AACxF,uEAAiE;AAEjE,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD;;;EAGE;AACF,MAAa,yBAA0B,SAAQ,uCAAuB;IAE5D,UAAU,CAAsB;IAChC,sBAAsB,GAAG,KAAK,CAAC;IAC/B,SAAS,GAAG,GAAG,CAAC;IAChB,eAAe,CAA4B;IAC3C,eAAe,CAA2C;IAC1D,cAAc,CAAqB;IAC3C,YAAY,QAA+B,EAAE,cAAyC;QACpF,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,mCAAmB,EAAE,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IAExC,CAAC;IACD,IAAoB,QAAQ,KAAa,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,UAAU;QAC9B,IAAI,CAAC,eAAe,GAAG,oCAAe,CAAC,6BAA6B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrF,IAAI,CAAC,eAAe,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAAA,CAAC;QACtF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC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UAAU,iCAAiC;YACjE,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;SAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF;AA/ND,8DA+NC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { BentleyError, BentleyStatus, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\nimport { DecorateContext, GoogleMapsDecorator, IModelApp, MapCartoRectangle, MapLayerImageryProvider, MapTile, QuadIdProps, ScreenViewport, Tile } from \"@itwin/core-frontend\";\nimport { GoogleMapsCreateSessionOptions, GoogleMapsLayerTypes, GoogleMapsMapTypes, GoogleMapsScaleFactors, GoogleMapsSession, GoogleMapsSessionManager, ViewportInfo } from \"./GoogleMapsSession.js\";\nimport { NativeGoogleMapsSessionManager } from \"../internal/NativeGoogleMapsSession.js\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\n\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\n\n/*\n* Google Maps imagery provider\n* @beta\n*/\nexport class GoogleMapsImageryProvider extends MapLayerImageryProvider {\n\n private _decorator: GoogleMapsDecorator;\n private _hadUnrecoverableError = false;\n private _tileSize = 256;\n private _sessionManager?: GoogleMapsSessionManager;\n private _sessionOptions: GoogleMapsCreateSessionOptions|undefined;\n private _activeSession?: GoogleMapsSession;\n constructor(settings: ImageMapLayerSettings, sessionManager?: GoogleMapsSessionManager) {\n super(settings, true);\n this._decorator = new GoogleMapsDecorator();\n this._sessionManager = sessionManager;\n\n }\n public override get tileSize(): number { return this._tileSize; }\n\n public override async initialize(): Promise<void> {\n this._sessionOptions = GoogleMapsUtils.getSessionOptionsFromMapLayer(this._settings);\n this._sessionManager = await this.getSessionManager();\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);;\n this._tileSize = this._activeSession.getTileSize();\n const isActivated = await this._decorator.activate(this._settings.properties!.mapType as GoogleMapsMapTypes);\n if (!isActivated) {\n const msg = `Failed to activate decorator`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected async getSessionManager (): Promise<GoogleMapsSessionManager> {\n if (this._sessionManager)\n return this._sessionManager;\n\n if (this._settings.accessKey?.value) {\n return new NativeGoogleMapsSessionManager(this._settings.accessKey.value);\n } else {\n const msg = `Missing GoogleMaps api key`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected createCreateSessionOptions(settings: ImageMapLayerSettings): GoogleMapsCreateSessionOptions {\n const layerPropertyKeys = settings.properties ? Object.keys(settings.properties) : undefined;\n if (layerPropertyKeys === undefined ||\n !layerPropertyKeys.includes(\"mapType\") ||\n !layerPropertyKeys.includes(\"language\") ||\n !layerPropertyKeys.includes(\"region\")) {\n const msg = \"Missing session options\";\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n\n const createSessionOptions: GoogleMapsCreateSessionOptions = {\n mapType: settings.properties!.mapType as GoogleMapsMapTypes,\n region: this._settings.properties!.region as string,\n language: this._settings.properties!.language as string,\n }\n\n if (Array.isArray(this._settings.properties?.layerTypes) && this._settings.properties.layerTypes.length > 0) {\n createSessionOptions.layerTypes = this._settings.properties.layerTypes as GoogleMapsLayerTypes[];\n }\n\n if (this._settings.properties?.scale !== undefined) {\n createSessionOptions.scale = this._settings.properties.scale as GoogleMapsScaleFactors;\n }\n\n if (this._settings.properties?.overlay !== undefined) {\n createSessionOptions.overlay = this._settings.properties.overlay as boolean;\n }\n\n if (this._settings.properties?.apiOptions !== undefined) {\n createSessionOptions.apiOptions = this._settings.properties.apiOptions as string[];\n }\n return createSessionOptions;\n }\n\n // not used, see loadTile\n public async constructUrl(_row: number, _column: number, _level: number): Promise<string> {\n return \"\";\n }\n\n public async fetchViewportInfo(rectangle: MapCartoRectangle, zoomLevel: number): Promise<ViewportInfo> {\n if (!this._activeSession) {\n Logger.logError(loggerCategory, `Session is not initialized`);\n throw new BentleyError(BentleyStatus.ERROR, \"Session is not initialized\");\n }\n\n const req = this._activeSession.getViewportInfoRequest(rectangle, zoomLevel);\n const request = new Request(req.url, {method: \"GET\"});\n if (req.authorization) {\n request.headers.set(\"Authorization\", req.authorization);\n }\n // Add the session token to the request\n const response = await fetch(request);\n if (!response.ok) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${response.statusText}`);\n throw new BentleyError(BentleyStatus.ERROR, `Error while loading viewport info: ${response.statusText}`);\n }\n return response.json() as Promise<ViewportInfo>;\n }\n\n private async fetchAttributions(tiles: Set<Tile>): Promise<string[]> {\n const zooms = new Set<number>();\n const matchingAttributions: string[] = [];\n\n // Viewport info requests must be made for a specific zoom level\n tiles.forEach((tile) => zooms.add(tile.depth));\n\n for (const zoom of zooms) {\n let cartoRect: MapCartoRectangle|undefined;\n for (const tile of tiles) {\n if (tile.depth === zoom && tile instanceof MapTile) {\n const extent = this.getEPSG4326Extent(tile.quadId.row, tile.quadId.column, tile.depth);\n const rect = MapCartoRectangle.fromDegrees(extent.longitudeLeft, extent.latitudeBottom, extent.longitudeRight, extent.latitudeTop)\n if (cartoRect)\n cartoRect.union(rect);\n else\n cartoRect = rect;\n }\n }\n if (cartoRect && this._activeSession) {\n try {\n const viewportInfo = await this.fetchViewportInfo(cartoRect, zoom);\n if (viewportInfo?.copyright) {\n matchingAttributions.push(viewportInfo.copyright);\n }\n } catch (error:any) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${error?.message??\"Unknown error\"}`);\n }\n }\n }\n\n return matchingAttributions;\n }\n private async logJsonError(tileResponse: Response) {\n try {\n const error = await tileResponse.json();\n Logger.logError(loggerCategory, `Error while loading tile: ${error?.message}`);\n } catch {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n }\n\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n const tilePos: QuadIdProps = {row, column, level: zoomLevel};\n if (this._hadUnrecoverableError)\n return undefined;\n\n if (this._activeSession === undefined || this._sessionOptions === undefined) {\n Logger.logError(loggerCategory, `Session manager is not initialized`);\n return undefined;\n }\n\n try {\n let tileRequest = this._activeSession.getTileRequest(tilePos);\n let tileResponse: Response = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\") && this._sessionManager) {\n try {\n // Session might have expired, lets try to refresh it\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);\n tileRequest = this._activeSession.getTileRequest(tilePos);\n tileResponse = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\")) {\n await this.logJsonError(tileResponse);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n this._hadUnrecoverableError = true; // Prevent from doing more invalid requests\n return undefined;\n }\n }\n catch {\n await this.logJsonError(tileResponse);\n }\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n return undefined;\n }\n }\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error: any) {\n if (error?.code === 401) {\n Logger.logError(loggerCategory, `Authorize to load tile: ${error.message}`);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${error.message}`);\n }\n return undefined;\n }\n }\n\n public override decorate(context: DecorateContext): void {\n this._decorator.decorate(context);\n }\n\n private getSelectedTiles(vp: ScreenViewport) {\n return IModelApp.tileAdmin.getTilesForUser(vp)?.selected\n }\n\n public override async addAttributions (cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n let copyrightMsg = \"\";\n const tiles = this.getSelectedTiles(vp);\n if (tiles) {\n try {\n const attrList = await this.fetchAttributions(tiles);\n for (const attr of attrList) {\n attr.split(\",\").forEach((line) => {\n copyrightMsg += `${copyrightMsg.length===0 ? \"\": \"<br\"}${line}`;\n });\n }\n }\n catch (error: any) {\n Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message??\"Unknown error\"}`);\n }\n }\n\n cards.appendChild(IModelApp.makeLogoCard({\n iconSrc: `${IModelApp.publicPath}images/google_on_white_hdpi.png`,\n heading: \"Google Maps\",\n notice: copyrightMsg }));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GoogleMapsImageryProvider.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA0E;AAE1E,wDAA+K;AAE/K,uFAAwF;AACxF,uEAAiE;AAEjE,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD;;;EAGE;AACF,MAAa,yBAA0B,SAAQ,uCAAuB;IAE5D,UAAU,CAAsB;IAChC,sBAAsB,GAAG,KAAK,CAAC;IAC/B,SAAS,GAAG,GAAG,CAAC;IAChB,eAAe,CAA4B;IAC3C,eAAe,CAA2C;IAC1D,cAAc,CAAqB;IAC3C,YAAY,QAA+B,EAAE,cAAyC;QACpF,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,mCAAmB,EAAE,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IACD,IAAoB,QAAQ,KAAa,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,UAAU;QAC9B,IAAI,CAAC,eAAe,GAAG,oCAAe,CAAC,6BAA6B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrF,IAAI,CAAC,eAAe,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,MAA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AC;YACD,OAAO,KAAU,EAAE,CAAC;gBAClB,qBAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,qCAAqC,KAAK,EAAE,OAAO,IAAE,eAAe,EAAE,CAAC,CAAC;YAC1G,CAAC;QACH,CAAC;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,GAAG,GAAG,yBAAS,CAAC,UAAU,iCAAiC,CAAC;QACvE,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,oBAAoB,CAAC;QAE7C,KAAK,CAAC,WAAW,CAAC,yBAAS,CAAC,YAAY,CAAC;YACvC,OAAO;YACP,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;SACrB,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AAtOD,8DAsOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { BentleyError, BentleyStatus, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\nimport { DecorateContext, GoogleMapsDecorator, IModelApp, MapCartoRectangle, MapLayerImageryProvider, MapTile, QuadIdProps, ScreenViewport, Tile } from \"@itwin/core-frontend\";\nimport { GoogleMapsCreateSessionOptions, GoogleMapsLayerTypes, GoogleMapsMapTypes, GoogleMapsScaleFactors, GoogleMapsSession, GoogleMapsSessionManager, ViewportInfo } from \"./GoogleMapsSession.js\";\nimport { NativeGoogleMapsSessionManager } from \"../internal/NativeGoogleMapsSession.js\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\n\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\n\n/*\n* Google Maps imagery provider\n* @beta\n*/\nexport class GoogleMapsImageryProvider extends MapLayerImageryProvider {\n\n private _decorator: GoogleMapsDecorator;\n private _hadUnrecoverableError = false;\n private _tileSize = 256;\n private _sessionManager?: GoogleMapsSessionManager;\n private _sessionOptions: GoogleMapsCreateSessionOptions|undefined;\n private _activeSession?: GoogleMapsSession;\n constructor(settings: ImageMapLayerSettings, sessionManager?: GoogleMapsSessionManager) {\n super(settings, true);\n this._decorator = new GoogleMapsDecorator();\n this._sessionManager = sessionManager;\n }\n public override get tileSize(): number { return this._tileSize; }\n\n public override async initialize(): Promise<void> {\n this._sessionOptions = GoogleMapsUtils.getSessionOptionsFromMapLayer(this._settings);\n this._sessionManager = await this.getSessionManager();\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);;\n this._tileSize = this._activeSession.getTileSize();\n const isActivated = await this._decorator.activate(this._settings.properties!.mapType as GoogleMapsMapTypes);\n if (!isActivated) {\n const msg = `Failed to activate decorator`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected async getSessionManager(): Promise<GoogleMapsSessionManager> {\n if (this._sessionManager)\n return this._sessionManager;\n\n if (this._settings.accessKey?.value) {\n return new NativeGoogleMapsSessionManager(this._settings.accessKey.value);\n } else {\n const msg = `Missing GoogleMaps api key`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected createCreateSessionOptions(settings: ImageMapLayerSettings): GoogleMapsCreateSessionOptions {\n const layerPropertyKeys = settings.properties ? Object.keys(settings.properties) : undefined;\n if (layerPropertyKeys === undefined ||\n !layerPropertyKeys.includes(\"mapType\") ||\n !layerPropertyKeys.includes(\"language\") ||\n !layerPropertyKeys.includes(\"region\")) {\n const msg = \"Missing session options\";\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n\n const createSessionOptions: GoogleMapsCreateSessionOptions = {\n mapType: settings.properties!.mapType as GoogleMapsMapTypes,\n region: this._settings.properties!.region as string,\n language: this._settings.properties!.language as string,\n }\n\n if (Array.isArray(this._settings.properties?.layerTypes) && this._settings.properties.layerTypes.length > 0) {\n createSessionOptions.layerTypes = this._settings.properties.layerTypes as GoogleMapsLayerTypes[];\n }\n\n if (this._settings.properties?.scale !== undefined) {\n createSessionOptions.scale = this._settings.properties.scale as GoogleMapsScaleFactors;\n }\n\n if (this._settings.properties?.overlay !== undefined) {\n createSessionOptions.overlay = this._settings.properties.overlay as boolean;\n }\n\n if (this._settings.properties?.apiOptions !== undefined) {\n createSessionOptions.apiOptions = this._settings.properties.apiOptions as string[];\n }\n return createSessionOptions;\n }\n\n // not used, see loadTile\n public async constructUrl(_row: number, _column: number, _level: number): Promise<string> {\n return \"\";\n }\n\n public async fetchViewportInfo(rectangle: MapCartoRectangle, zoomLevel: number): Promise<ViewportInfo> {\n if (!this._activeSession) {\n Logger.logError(loggerCategory, `Session is not initialized`);\n throw new BentleyError(BentleyStatus.ERROR, \"Session is not initialized\");\n }\n\n const req = this._activeSession.getViewportInfoRequest(rectangle, zoomLevel);\n const request = new Request(req.url, {method: \"GET\"});\n if (req.authorization) {\n request.headers.set(\"Authorization\", req.authorization);\n }\n // Add the session token to the request\n const response = await fetch(request);\n if (!response.ok) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${response.statusText}`);\n throw new BentleyError(BentleyStatus.ERROR, `Error while loading viewport info: ${response.statusText}`);\n }\n return response.json() as Promise<ViewportInfo>;\n }\n\n private async fetchAttributions(tiles: Set<Tile>): Promise<string[]> {\n const zooms = new Set<number>();\n const matchingAttributions: string[] = [];\n\n // Viewport info requests must be made for a specific zoom level\n tiles.forEach((tile) => zooms.add(tile.depth));\n\n for (const zoom of zooms) {\n let cartoRect: MapCartoRectangle|undefined;\n for (const tile of tiles) {\n if (tile.depth === zoom && tile instanceof MapTile) {\n const extent = this.getEPSG4326Extent(tile.quadId.row, tile.quadId.column, tile.depth);\n const rect = MapCartoRectangle.fromDegrees(extent.longitudeLeft, extent.latitudeBottom, extent.longitudeRight, extent.latitudeTop)\n if (cartoRect)\n cartoRect.union(rect);\n else\n cartoRect = rect;\n }\n }\n if (cartoRect && this._activeSession) {\n try {\n const viewportInfo = await this.fetchViewportInfo(cartoRect, zoom);\n if (viewportInfo?.copyright) {\n matchingAttributions.push(viewportInfo.copyright);\n }\n } catch (error:any) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${error?.message??\"Unknown error\"}`);\n }\n }\n }\n\n return matchingAttributions;\n }\n private async logJsonError(tileResponse: Response) {\n try {\n const error = await tileResponse.json();\n Logger.logError(loggerCategory, `Error while loading tile: ${error?.message}`);\n } catch {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n }\n\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n const tilePos: QuadIdProps = {row, column, level: zoomLevel};\n if (this._hadUnrecoverableError)\n return undefined;\n\n if (this._activeSession === undefined || this._sessionOptions === undefined) {\n Logger.logError(loggerCategory, `Session manager is not initialized`);\n return undefined;\n }\n\n try {\n let tileRequest = this._activeSession.getTileRequest(tilePos);\n let tileResponse: Response = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\") && this._sessionManager) {\n try {\n // Session might have expired, lets try to refresh it\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);\n tileRequest = this._activeSession.getTileRequest(tilePos);\n tileResponse = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\")) {\n await this.logJsonError(tileResponse);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n this._hadUnrecoverableError = true; // Prevent from doing more invalid requests\n return undefined;\n }\n }\n catch {\n await this.logJsonError(tileResponse);\n }\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n return undefined;\n }\n }\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error: any) {\n if (error?.code === 401) {\n Logger.logError(loggerCategory, `Authorize to load tile: ${error.message}`);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${error.message}`);\n }\n return undefined;\n }\n }\n\n public override decorate(context: DecorateContext): void {\n this._decorator.decorate(context);\n }\n\n private getSelectedTiles(vp: ScreenViewport) {\n return IModelApp.tileAdmin.getTilesForUser(vp)?.selected;\n }\n\n public override async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n let copyrightMsg = \"\";\n const tiles = this.getSelectedTiles(vp);\n if (tiles) {\n try {\n const attrList = await this.fetchAttributions(tiles);\n for (const attr of attrList) {\n attr.split(\",\").forEach((line) => {\n // Attempt to reduce duplicates, since if there are multiple zoom levels sometimes the same info is returned\n if (!copyrightMsg.includes(line)) {\n copyrightMsg += `${copyrightMsg.length === 0 ? \"\": \"<br>\"}${line}`;\n }\n });\n }\n }\n catch (error: any) {\n Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message??\"Unknown error\"}`);\n }\n }\n\n const iconSrc = document.createElement(\"img\");\n iconSrc.src = `${IModelApp.publicPath}images/GoogleMaps_Logo_Gray.svg`;\n iconSrc.style.padding = \"10px 10px 5px 10px\";\n\n cards.appendChild(IModelApp.makeLogoCard({\n iconSrc,\n heading: \"Google Maps\",\n notice: copyrightMsg\n }));\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ export declare class NativeGoogleMapsSession extends BaseGoogleMapsSession {
|
|
|
10
10
|
readonly apiKey: string;
|
|
11
11
|
constructor(json: GoogleMapsSessionData, apiKey: string);
|
|
12
12
|
protected getTileApiBaseUrl(): string;
|
|
13
|
+
protected getViewportApiBaseUrl(): string;
|
|
13
14
|
getTileSize(): number;
|
|
14
15
|
getTileRequest(position: QuadIdProps): GoogleMapsRequest;
|
|
15
16
|
getViewportInfoRequest(rectangle: MapCartoRectangle, zoomLevel: number): GoogleMapsRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGoogleMapsSession.d.ts","sourceRoot":"","sources":["../../../src/internal/NativeGoogleMapsSession.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeGoogleMapsSession.d.ts","sourceRoot":"","sources":["../../../src/internal/NativeGoogleMapsSession.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAQlM,qBAAa,uBAAwB,SAAQ,qBAAqB;IAChE,OAAc,iBAAiB,SAA4C;IAC3E,OAAc,kBAAkB,SAAiD;IACjF,SAAgB,IAAI,EAAE,qBAAqB,CAAC;IAC5C,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM;IAM9D,SAAS,CAAC,iBAAiB;IAI3B,SAAS,CAAC,qBAAqB;IAIxB,WAAW,IAAI,MAAM;IAIrB,cAAc,CAAC,QAAQ,EAAE,WAAW,GAAG,iBAAiB;IAOxD,sBAAsB,CAAC,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB;IAYjG;;;;;MAKE;WACkB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAUjH;AAMD,qBAAa,8BAA+B,SAAQ,wBAAwB;IAC1E,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEnB,MAAM,EAAE,MAAM;IAKb,aAAa,CAAC,cAAc,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAIvG"}
|
|
@@ -28,6 +28,9 @@ class NativeGoogleMapsSession extends GoogleMapsSession_js_1.BaseGoogleMapsSessi
|
|
|
28
28
|
getTileApiBaseUrl() {
|
|
29
29
|
return NativeGoogleMapsSession.getTileApiBaseUrl;
|
|
30
30
|
}
|
|
31
|
+
getViewportApiBaseUrl() {
|
|
32
|
+
return NativeGoogleMapsSession.viewportApiBaseUrl;
|
|
33
|
+
}
|
|
31
34
|
getTileSize() {
|
|
32
35
|
return this.json.tileWidth;
|
|
33
36
|
}
|
|
@@ -39,9 +42,9 @@ class NativeGoogleMapsSession extends GoogleMapsSession_js_1.BaseGoogleMapsSessi
|
|
|
39
42
|
}
|
|
40
43
|
getViewportInfoRequest(rectangle, zoomLevel) {
|
|
41
44
|
const degrees = rectangle.toDegrees();
|
|
42
|
-
const url = new URL(`${this.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
const url = new URL(`${this.getViewportApiBaseUrl()}` +
|
|
46
|
+
`?zoom=${zoomLevel}` +
|
|
47
|
+
`&north=${degrees.north}&south=${degrees.south}&east=${degrees.east}&west=${degrees.west}`);
|
|
45
48
|
url.searchParams.append("key", this.apiKey);
|
|
46
49
|
url.searchParams.append("session", this.json.session);
|
|
47
50
|
return { url };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGoogleMapsSession.js","sourceRoot":"","sources":["../../../src/internal/NativeGoogleMapsSession.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAE7C,6EAAkM;
|
|
1
|
+
{"version":3,"file":"NativeGoogleMapsSession.js","sourceRoot":"","sources":["../../../src/internal/NativeGoogleMapsSession.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sD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AAI,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;CACF;AAZD,wEAYC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { MapCartoRectangle, QuadIdProps } from \"@itwin/core-frontend\";\nimport { BaseGoogleMapsSession, GoogleMapsCreateSessionOptions, GoogleMapsRequest, GoogleMapsSession, GoogleMapsSessionData, GoogleMapsSessionManager } from \"../GoogleMaps/GoogleMapsSession.js\";\n\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\n\n/*\n* Google Maps session\n* @internal\n*/\nexport class NativeGoogleMapsSession extends BaseGoogleMapsSession {\n public static getTileApiBaseUrl = \"https://tile.googleapis.com/v1/2dtiles\";\n public static viewportApiBaseUrl = `https://tile.googleapis.com/tile/v1/viewport`\n public readonly json: GoogleMapsSessionData;\n public readonly apiKey: string;\n\n public constructor(json: GoogleMapsSessionData, apiKey: string) {\n super();\n this.json = json;\n this.apiKey = apiKey;\n }\n\n protected getTileApiBaseUrl() {\n return NativeGoogleMapsSession.getTileApiBaseUrl;\n }\n\n protected getViewportApiBaseUrl() {\n return NativeGoogleMapsSession.viewportApiBaseUrl;\n }\n\n public getTileSize(): number {\n return this.json.tileWidth;\n }\n\n public getTileRequest(position: QuadIdProps): GoogleMapsRequest {\n const url = this.getTilePositionUrl(position);\n url.searchParams.append(\"key\", this.apiKey);\n url.searchParams.append(\"session\", this.json.session);\n return {url};\n }\n\n public getViewportInfoRequest(rectangle: MapCartoRectangle, zoomLevel: number): GoogleMapsRequest {\n const degrees = rectangle.toDegrees();\n const url = new URL(\n `${this.getViewportApiBaseUrl()}` +\n `?zoom=${zoomLevel}` +\n `&north=${degrees.north}&south=${degrees.south}&east=${degrees.east}&west=${degrees.west}`\n );\n url.searchParams.append(\"key\", this.apiKey);\n url.searchParams.append(\"session\", this.json.session);\n return {url};\n }\n\n /**\n * Creates a Google Maps session.\n * @param apiKey Google Cloud API key\n * @param opts Options to create the session\n * @internal\n */\n public static async create(apiKey: string, opts: GoogleMapsCreateSessionOptions): Promise<GoogleMapsSessionData> {\n const url = `https://tile.googleapis.com/v1/createSession?key=${apiKey}`;\n const request = new Request(url, {method: \"POST\", body: JSON.stringify(opts)});\n const response = await fetch (request);\n if (!response.ok) {\n throw new Error(`CreateSession request failed: ${response.status} - ${response.statusText}`);\n }\n Logger.logInfo(loggerCategory, `Session created successfully`);\n return response.json();\n }\n}\n\n/*\n* Google Maps session manager that uses standard API key to create a session.\n* @beta\n*/\nexport class NativeGoogleMapsSessionManager extends GoogleMapsSessionManager {\n public readonly apiKey: string;\n\n constructor(apiKey: string) {\n super();\n this.apiKey = apiKey;\n }\n\n public async createSession(sessionOptions: GoogleMapsCreateSessionOptions): Promise<GoogleMapsSession> {\n const json = await NativeGoogleMapsSession.create(this.apiKey, sessionOptions);\n return new NativeGoogleMapsSession(json, this.apiKey);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsImageryProvider.d.ts","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAkC,iBAAiB,EAAE,uBAAuB,EAAwB,cAAc,EAAQ,MAAM,sBAAsB,CAAC;AAC/K,OAAO,EAAE,8BAA8B,EAAuF,wBAAwB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAUrM,qBAAa,yBAA0B,SAAQ,uBAAuB;IAEpE,OAAO,CAAC,UAAU,CAAsB;IACxC,OAAO,CAAC,sBAAsB,CAAS;IACvC,OAAO,CAAC,SAAS,CAAO;IACxB,OAAO,CAAC,eA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YAoBxF,iBAAiB;YAiCjB,YAAY;IASJ,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAiDhG,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAIxD,OAAO,CAAC,gBAAgB;IAIF,eAAe,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA8BlG"}
|
|
@@ -207,7 +207,10 @@ export class GoogleMapsImageryProvider extends MapLayerImageryProvider {
|
|
|
207
207
|
const attrList = await this.fetchAttributions(tiles);
|
|
208
208
|
for (const attr of attrList) {
|
|
209
209
|
attr.split(",").forEach((line) => {
|
|
210
|
-
|
|
210
|
+
// Attempt to reduce duplicates, since if there are multiple zoom levels sometimes the same info is returned
|
|
211
|
+
if (!copyrightMsg.includes(line)) {
|
|
212
|
+
copyrightMsg += `${copyrightMsg.length === 0 ? "" : "<br>"}${line}`;
|
|
213
|
+
}
|
|
211
214
|
});
|
|
212
215
|
}
|
|
213
216
|
}
|
|
@@ -215,8 +218,11 @@ export class GoogleMapsImageryProvider extends MapLayerImageryProvider {
|
|
|
215
218
|
Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message ?? "Unknown error"}`);
|
|
216
219
|
}
|
|
217
220
|
}
|
|
221
|
+
const iconSrc = document.createElement("img");
|
|
222
|
+
iconSrc.src = `${IModelApp.publicPath}images/GoogleMaps_Logo_Gray.svg`;
|
|
223
|
+
iconSrc.style.padding = "10px 10px 5px 10px";
|
|
218
224
|
cards.appendChild(IModelApp.makeLogoCard({
|
|
219
|
-
iconSrc
|
|
225
|
+
iconSrc,
|
|
220
226
|
heading: "Google Maps",
|
|
221
227
|
notice: copyrightMsg
|
|
222
228
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsImageryProvider.js","sourceRo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jE,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;SAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { BentleyError, BentleyStatus, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\nimport { DecorateContext, GoogleMapsDecorator, IModelApp, MapCartoRectangle, MapLayerImageryProvider, MapTile, QuadIdProps, ScreenViewport, Tile } from \"@itwin/core-frontend\";\nimport { GoogleMapsCreateSessionOptions, GoogleMapsLayerTypes, GoogleMapsMapTypes, GoogleMapsScaleFactors, GoogleMapsSession, GoogleMapsSessionManager, ViewportInfo } from \"./GoogleMapsSession.js\";\nimport { NativeGoogleMapsSessionManager } from \"../internal/NativeGoogleMapsSession.js\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\n\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\n\n/*\n* Google Maps imagery provider\n* @beta\n*/\nexport class GoogleMapsImageryProvider extends MapLayerImageryProvider {\n\n private _decorator: GoogleMapsDecorator;\n private _hadUnrecoverableError = false;\n private _tileSize = 256;\n private _sessionManager?: GoogleMapsSessionManager;\n private _sessionOptions: GoogleMapsCreateSessionOptions|undefined;\n private _activeSession?: GoogleMapsSession;\n constructor(settings: ImageMapLayerSettings, sessionManager?: GoogleMapsSessionManager) {\n super(settings, true);\n this._decorator = new GoogleMapsDecorator();\n this._sessionManager = sessionManager;\n\n }\n public override get tileSize(): number { return this._tileSize; }\n\n public override async initialize(): Promise<void> {\n this._sessionOptions = GoogleMapsUtils.getSessionOptionsFromMapLayer(this._settings);\n this._sessionManager = await this.getSessionManager();\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);;\n this._tileSize = this._activeSession.getTileSize();\n const isActivated = await this._decorator.activate(this._settings.properties!.mapType as GoogleMapsMapTypes);\n if (!isActivated) {\n const msg = `Failed to activate decorator`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected async getSessionManager (): Promise<GoogleMapsSessionManager> {\n if (this._sessionManager)\n return this._sessionManager;\n\n if (this._settings.accessKey?.value) {\n return new NativeGoogleMapsSessionManager(this._settings.accessKey.value);\n } else {\n const msg = `Missing GoogleMaps api key`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected createCreateSessionOptions(settings: ImageMapLayerSettings): GoogleMapsCreateSessionOptions {\n const layerPropertyKeys = settings.properties ? Object.keys(settings.properties) : undefined;\n if (layerPropertyKeys === undefined ||\n !layerPropertyKeys.includes(\"mapType\") ||\n !layerPropertyKeys.includes(\"language\") ||\n !layerPropertyKeys.includes(\"region\")) {\n const msg = \"Missing session options\";\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n\n const createSessionOptions: GoogleMapsCreateSessionOptions = {\n mapType: settings.properties!.mapType as GoogleMapsMapTypes,\n region: this._settings.properties!.region as string,\n language: this._settings.properties!.language as string,\n }\n\n if (Array.isArray(this._settings.properties?.layerTypes) && this._settings.properties.layerTypes.length > 0) {\n createSessionOptions.layerTypes = this._settings.properties.layerTypes as GoogleMapsLayerTypes[];\n }\n\n if (this._settings.properties?.scale !== undefined) {\n createSessionOptions.scale = this._settings.properties.scale as GoogleMapsScaleFactors;\n }\n\n if (this._settings.properties?.overlay !== undefined) {\n createSessionOptions.overlay = this._settings.properties.overlay as boolean;\n }\n\n if (this._settings.properties?.apiOptions !== undefined) {\n createSessionOptions.apiOptions = this._settings.properties.apiOptions as string[];\n }\n return createSessionOptions;\n }\n\n // not used, see loadTile\n public async constructUrl(_row: number, _column: number, _level: number): Promise<string> {\n return \"\";\n }\n\n public async fetchViewportInfo(rectangle: MapCartoRectangle, zoomLevel: number): Promise<ViewportInfo> {\n if (!this._activeSession) {\n Logger.logError(loggerCategory, `Session is not initialized`);\n throw new BentleyError(BentleyStatus.ERROR, \"Session is not initialized\");\n }\n\n const req = this._activeSession.getViewportInfoRequest(rectangle, zoomLevel);\n const request = new Request(req.url, {method: \"GET\"});\n if (req.authorization) {\n request.headers.set(\"Authorization\", req.authorization);\n }\n // Add the session token to the request\n const response = await fetch(request);\n if (!response.ok) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${response.statusText}`);\n throw new BentleyError(BentleyStatus.ERROR, `Error while loading viewport info: ${response.statusText}`);\n }\n return response.json() as Promise<ViewportInfo>;\n }\n\n private async fetchAttributions(tiles: Set<Tile>): Promise<string[]> {\n const zooms = new Set<number>();\n const matchingAttributions: string[] = [];\n\n // Viewport info requests must be made for a specific zoom level\n tiles.forEach((tile) => zooms.add(tile.depth));\n\n for (const zoom of zooms) {\n let cartoRect: MapCartoRectangle|undefined;\n for (const tile of tiles) {\n if (tile.depth === zoom && tile instanceof MapTile) {\n const extent = this.getEPSG4326Extent(tile.quadId.row, tile.quadId.column, tile.depth);\n const rect = MapCartoRectangle.fromDegrees(extent.longitudeLeft, extent.latitudeBottom, extent.longitudeRight, extent.latitudeTop)\n if (cartoRect)\n cartoRect.union(rect);\n else\n cartoRect = rect;\n }\n }\n if (cartoRect && this._activeSession) {\n try {\n const viewportInfo = await this.fetchViewportInfo(cartoRect, zoom);\n if (viewportInfo?.copyright) {\n matchingAttributions.push(viewportInfo.copyright);\n }\n } catch (error:any) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${error?.message??\"Unknown error\"}`);\n }\n }\n }\n\n return matchingAttributions;\n }\n private async logJsonError(tileResponse: Response) {\n try {\n const error = await tileResponse.json();\n Logger.logError(loggerCategory, `Error while loading tile: ${error?.message}`);\n } catch {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n }\n\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n const tilePos: QuadIdProps = {row, column, level: zoomLevel};\n if (this._hadUnrecoverableError)\n return undefined;\n\n if (this._activeSession === undefined || this._sessionOptions === undefined) {\n Logger.logError(loggerCategory, `Session manager is not initialized`);\n return undefined;\n }\n\n try {\n let tileRequest = this._activeSession.getTileRequest(tilePos);\n let tileResponse: Response = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\") && this._sessionManager) {\n try {\n // Session might have expired, lets try to refresh it\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);\n tileRequest = this._activeSession.getTileRequest(tilePos);\n tileResponse = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\")) {\n await this.logJsonError(tileResponse);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n this._hadUnrecoverableError = true; // Prevent from doing more invalid requests\n return undefined;\n }\n }\n catch {\n await this.logJsonError(tileResponse);\n }\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n return undefined;\n }\n }\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error: any) {\n if (error?.code === 401) {\n Logger.logError(loggerCategory, `Authorize to load tile: ${error.message}`);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${error.message}`);\n }\n return undefined;\n }\n }\n\n public override decorate(context: DecorateContext): void {\n this._decorator.decorate(context);\n }\n\n private getSelectedTiles(vp: ScreenViewport) {\n return IModelApp.tileAdmin.getTilesForUser(vp)?.selected\n }\n\n public override async addAttributions (cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n let copyrightMsg = \"\";\n const tiles = this.getSelectedTiles(vp);\n if (tiles) {\n try {\n const attrList = await this.fetchAttributions(tiles);\n for (const attr of attrList) {\n attr.split(\",\").forEach((line) => {\n copyrightMsg += `${copyrightMsg.length===0 ? \"\": \"<br\"}${line}`;\n });\n }\n }\n catch (error: any) {\n Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message??\"Unknown error\"}`);\n }\n }\n\n cards.appendChild(IModelApp.makeLogoCard({\n iconSrc: `${IModelApp.publicPath}images/google_on_white_hdpi.png`,\n heading: \"Google Maps\",\n notice: copyrightMsg }));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GoogleMapsImageryProvider.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAmB,mBAAmB,EAAE,SAAS,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,OAAO,EAAqC,MAAM,sBAAsB,CAAC;AAE/K,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD;;;EAGE;AACF,MAAM,OAAO,yBAA0B,SAAQ,uBAAuB;IAE5D,UAAU,CAAsB;IAChC,sBAAsB,GAAG,KAAK,CAAC;IAC/B,SAAS,GAAG,GAAG,CAAC;IAChB,eAAe,CAA4B;IAC3C,eAAe,CAA2C;IAC1D,cAAc,CAAqB;IAC3C,YAAY,QAA+B,EAAE,cAAyC;QACpF,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IACD,IAAoB,QAAQ,KAAa,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAEjD,KAAK,CAA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AI,GAAG,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA,CAAC,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;wBACrE,CAAC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,OAAO,KAAU,EAAE,CAAC;gBAClB,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,qCAAqC,KAAK,EAAE,OAAO,IAAE,eAAe,EAAE,CAAC,CAAC;YAC1G,CAAC;QACH,CAAC;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,UAAU,iCAAiC,CAAC;QACvE,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,oBAAoB,CAAC;QAE7C,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC;YACvC,OAAO;YACP,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;SACrB,CAAC,CAAC,CAAC;IACN,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { BentleyError, BentleyStatus, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\nimport { DecorateContext, GoogleMapsDecorator, IModelApp, MapCartoRectangle, MapLayerImageryProvider, MapTile, QuadIdProps, ScreenViewport, Tile } from \"@itwin/core-frontend\";\nimport { GoogleMapsCreateSessionOptions, GoogleMapsLayerTypes, GoogleMapsMapTypes, GoogleMapsScaleFactors, GoogleMapsSession, GoogleMapsSessionManager, ViewportInfo } from \"./GoogleMapsSession.js\";\nimport { NativeGoogleMapsSessionManager } from \"../internal/NativeGoogleMapsSession.js\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\n\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\n\n/*\n* Google Maps imagery provider\n* @beta\n*/\nexport class GoogleMapsImageryProvider extends MapLayerImageryProvider {\n\n private _decorator: GoogleMapsDecorator;\n private _hadUnrecoverableError = false;\n private _tileSize = 256;\n private _sessionManager?: GoogleMapsSessionManager;\n private _sessionOptions: GoogleMapsCreateSessionOptions|undefined;\n private _activeSession?: GoogleMapsSession;\n constructor(settings: ImageMapLayerSettings, sessionManager?: GoogleMapsSessionManager) {\n super(settings, true);\n this._decorator = new GoogleMapsDecorator();\n this._sessionManager = sessionManager;\n }\n public override get tileSize(): number { return this._tileSize; }\n\n public override async initialize(): Promise<void> {\n this._sessionOptions = GoogleMapsUtils.getSessionOptionsFromMapLayer(this._settings);\n this._sessionManager = await this.getSessionManager();\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);;\n this._tileSize = this._activeSession.getTileSize();\n const isActivated = await this._decorator.activate(this._settings.properties!.mapType as GoogleMapsMapTypes);\n if (!isActivated) {\n const msg = `Failed to activate decorator`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected async getSessionManager(): Promise<GoogleMapsSessionManager> {\n if (this._sessionManager)\n return this._sessionManager;\n\n if (this._settings.accessKey?.value) {\n return new NativeGoogleMapsSessionManager(this._settings.accessKey.value);\n } else {\n const msg = `Missing GoogleMaps api key`;\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n }\n\n protected createCreateSessionOptions(settings: ImageMapLayerSettings): GoogleMapsCreateSessionOptions {\n const layerPropertyKeys = settings.properties ? Object.keys(settings.properties) : undefined;\n if (layerPropertyKeys === undefined ||\n !layerPropertyKeys.includes(\"mapType\") ||\n !layerPropertyKeys.includes(\"language\") ||\n !layerPropertyKeys.includes(\"region\")) {\n const msg = \"Missing session options\";\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n\n const createSessionOptions: GoogleMapsCreateSessionOptions = {\n mapType: settings.properties!.mapType as GoogleMapsMapTypes,\n region: this._settings.properties!.region as string,\n language: this._settings.properties!.language as string,\n }\n\n if (Array.isArray(this._settings.properties?.layerTypes) && this._settings.properties.layerTypes.length > 0) {\n createSessionOptions.layerTypes = this._settings.properties.layerTypes as GoogleMapsLayerTypes[];\n }\n\n if (this._settings.properties?.scale !== undefined) {\n createSessionOptions.scale = this._settings.properties.scale as GoogleMapsScaleFactors;\n }\n\n if (this._settings.properties?.overlay !== undefined) {\n createSessionOptions.overlay = this._settings.properties.overlay as boolean;\n }\n\n if (this._settings.properties?.apiOptions !== undefined) {\n createSessionOptions.apiOptions = this._settings.properties.apiOptions as string[];\n }\n return createSessionOptions;\n }\n\n // not used, see loadTile\n public async constructUrl(_row: number, _column: number, _level: number): Promise<string> {\n return \"\";\n }\n\n public async fetchViewportInfo(rectangle: MapCartoRectangle, zoomLevel: number): Promise<ViewportInfo> {\n if (!this._activeSession) {\n Logger.logError(loggerCategory, `Session is not initialized`);\n throw new BentleyError(BentleyStatus.ERROR, \"Session is not initialized\");\n }\n\n const req = this._activeSession.getViewportInfoRequest(rectangle, zoomLevel);\n const request = new Request(req.url, {method: \"GET\"});\n if (req.authorization) {\n request.headers.set(\"Authorization\", req.authorization);\n }\n // Add the session token to the request\n const response = await fetch(request);\n if (!response.ok) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${response.statusText}`);\n throw new BentleyError(BentleyStatus.ERROR, `Error while loading viewport info: ${response.statusText}`);\n }\n return response.json() as Promise<ViewportInfo>;\n }\n\n private async fetchAttributions(tiles: Set<Tile>): Promise<string[]> {\n const zooms = new Set<number>();\n const matchingAttributions: string[] = [];\n\n // Viewport info requests must be made for a specific zoom level\n tiles.forEach((tile) => zooms.add(tile.depth));\n\n for (const zoom of zooms) {\n let cartoRect: MapCartoRectangle|undefined;\n for (const tile of tiles) {\n if (tile.depth === zoom && tile instanceof MapTile) {\n const extent = this.getEPSG4326Extent(tile.quadId.row, tile.quadId.column, tile.depth);\n const rect = MapCartoRectangle.fromDegrees(extent.longitudeLeft, extent.latitudeBottom, extent.longitudeRight, extent.latitudeTop)\n if (cartoRect)\n cartoRect.union(rect);\n else\n cartoRect = rect;\n }\n }\n if (cartoRect && this._activeSession) {\n try {\n const viewportInfo = await this.fetchViewportInfo(cartoRect, zoom);\n if (viewportInfo?.copyright) {\n matchingAttributions.push(viewportInfo.copyright);\n }\n } catch (error:any) {\n Logger.logError(loggerCategory, `Error while loading viewport info: ${error?.message??\"Unknown error\"}`);\n }\n }\n }\n\n return matchingAttributions;\n }\n private async logJsonError(tileResponse: Response) {\n try {\n const error = await tileResponse.json();\n Logger.logError(loggerCategory, `Error while loading tile: ${error?.message}`);\n } catch {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n }\n\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n const tilePos: QuadIdProps = {row, column, level: zoomLevel};\n if (this._hadUnrecoverableError)\n return undefined;\n\n if (this._activeSession === undefined || this._sessionOptions === undefined) {\n Logger.logError(loggerCategory, `Session manager is not initialized`);\n return undefined;\n }\n\n try {\n let tileRequest = this._activeSession.getTileRequest(tilePos);\n let tileResponse: Response = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\") && this._sessionManager) {\n try {\n // Session might have expired, lets try to refresh it\n this._activeSession = await this._sessionManager.createSession(this._sessionOptions);\n tileRequest = this._activeSession.getTileRequest(tilePos);\n tileResponse = await this.makeTileRequest(tileRequest.url.toString(), undefined, tileRequest.authorization);\n if (!tileResponse.ok) {\n if (tileResponse.headers.get(\"content-type\")?.includes(\"application/json\")) {\n await this.logJsonError(tileResponse);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n }\n this._hadUnrecoverableError = true; // Prevent from doing more invalid requests\n return undefined;\n }\n }\n catch {\n await this.logJsonError(tileResponse);\n }\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${tileResponse.statusText}`);\n return undefined;\n }\n }\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error: any) {\n if (error?.code === 401) {\n Logger.logError(loggerCategory, `Authorize to load tile: ${error.message}`);\n } else {\n Logger.logError(loggerCategory, `Error while loading tile: ${error.message}`);\n }\n return undefined;\n }\n }\n\n public override decorate(context: DecorateContext): void {\n this._decorator.decorate(context);\n }\n\n private getSelectedTiles(vp: ScreenViewport) {\n return IModelApp.tileAdmin.getTilesForUser(vp)?.selected;\n }\n\n public override async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n let copyrightMsg = \"\";\n const tiles = this.getSelectedTiles(vp);\n if (tiles) {\n try {\n const attrList = await this.fetchAttributions(tiles);\n for (const attr of attrList) {\n attr.split(\",\").forEach((line) => {\n // Attempt to reduce duplicates, since if there are multiple zoom levels sometimes the same info is returned\n if (!copyrightMsg.includes(line)) {\n copyrightMsg += `${copyrightMsg.length === 0 ? \"\": \"<br>\"}${line}`;\n }\n });\n }\n }\n catch (error: any) {\n Logger.logError(loggerCategory, `Error while loading attributions: ${error?.message??\"Unknown error\"}`);\n }\n }\n\n const iconSrc = document.createElement(\"img\");\n iconSrc.src = `${IModelApp.publicPath}images/GoogleMaps_Logo_Gray.svg`;\n iconSrc.style.padding = \"10px 10px 5px 10px\";\n\n cards.appendChild(IModelApp.makeLogoCard({\n iconSrc,\n heading: \"Google Maps\",\n notice: copyrightMsg\n }));\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ export declare class NativeGoogleMapsSession extends BaseGoogleMapsSession {
|
|
|
10
10
|
readonly apiKey: string;
|
|
11
11
|
constructor(json: GoogleMapsSessionData, apiKey: string);
|
|
12
12
|
protected getTileApiBaseUrl(): string;
|
|
13
|
+
protected getViewportApiBaseUrl(): string;
|
|
13
14
|
getTileSize(): number;
|
|
14
15
|
getTileRequest(position: QuadIdProps): GoogleMapsRequest;
|
|
15
16
|
getViewportInfoRequest(rectangle: MapCartoRectangle, zoomLevel: number): GoogleMapsRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGoogleMapsSession.d.ts","sourceRoot":"","sources":["../../../src/internal/NativeGoogleMapsSession.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeGoogleMapsSession.d.ts","sourceRoot":"","sources":["../../../src/internal/NativeGoogleMapsSession.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAQlM,qBAAa,uBAAwB,SAAQ,qBAAqB;IAChE,OAAc,iBAAiB,SAA4C;IAC3E,OAAc,kBAAkB,SAAiD;IACjF,SAAgB,IAAI,EAAE,qBAAqB,CAAC;IAC5C,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM;IAM9D,SAAS,CAAC,iBAAiB;IAI3B,SAAS,CAAC,qBAAqB;IAIxB,WAAW,IAAI,MAAM;IAIrB,cAAc,CAAC,QAAQ,EAAE,WAAW,GAAG,iBAAiB;IAOxD,sBAAsB,CAAC,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB;IAYjG;;;;;MAKE;WACkB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAUjH;AAMD,qBAAa,8BAA+B,SAAQ,wBAAwB;IAC1E,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEnB,MAAM,EAAE,MAAM;IAKb,aAAa,CAAC,cAAc,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAIvG"}
|
|
@@ -25,6 +25,9 @@ export class NativeGoogleMapsSession extends BaseGoogleMapsSession {
|
|
|
25
25
|
getTileApiBaseUrl() {
|
|
26
26
|
return NativeGoogleMapsSession.getTileApiBaseUrl;
|
|
27
27
|
}
|
|
28
|
+
getViewportApiBaseUrl() {
|
|
29
|
+
return NativeGoogleMapsSession.viewportApiBaseUrl;
|
|
30
|
+
}
|
|
28
31
|
getTileSize() {
|
|
29
32
|
return this.json.tileWidth;
|
|
30
33
|
}
|
|
@@ -36,9 +39,9 @@ export class NativeGoogleMapsSession extends BaseGoogleMapsSession {
|
|
|
36
39
|
}
|
|
37
40
|
getViewportInfoRequest(rectangle, zoomLevel) {
|
|
38
41
|
const degrees = rectangle.toDegrees();
|
|
39
|
-
const url = new URL(`${this.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
const url = new URL(`${this.getViewportApiBaseUrl()}` +
|
|
43
|
+
`?zoom=${zoomLevel}` +
|
|
44
|
+
`&north=${degrees.north}&south=${degrees.south}&east=${degrees.east}&west=${degrees.west}`);
|
|
42
45
|
url.searchParams.append("key", this.apiKey);
|
|
43
46
|
url.searchParams.append("session", this.json.session);
|
|
44
47
|
return { url };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGoogleMapsSession.js","sourceRoot":"","sources":["../../../src/internal/NativeGoogleMapsSession.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,O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AAM,CAAS;IAE/B,YAAY,MAAc;QACxB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,cAA8C;QACvE,MAAM,IAAI,GAAG,MAAM,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QAC/E,OAAO,IAAI,uBAAuB,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { MapCartoRectangle, QuadIdProps } from \"@itwin/core-frontend\";\nimport { BaseGoogleMapsSession, GoogleMapsCreateSessionOptions, GoogleMapsRequest, GoogleMapsSession, GoogleMapsSessionData, GoogleMapsSessionManager } from \"../GoogleMaps/GoogleMapsSession.js\";\n\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\n\n/*\n* Google Maps session\n* @internal\n*/\nexport class NativeGoogleMapsSession extends BaseGoogleMapsSession {\n public static getTileApiBaseUrl = \"https://tile.googleapis.com/v1/2dtiles\";\n public static viewportApiBaseUrl = `https://tile.googleapis.com/tile/v1/viewport`\n public readonly json: GoogleMapsSessionData;\n public readonly apiKey: string;\n\n public constructor(json: GoogleMapsSessionData, apiKey: string) {\n super();\n this.json = json;\n this.apiKey = apiKey;\n }\n\n protected getTileApiBaseUrl() {\n return NativeGoogleMapsSession.getTileApiBaseUrl;\n }\n\n protected getViewportApiBaseUrl() {\n return NativeGoogleMapsSession.viewportApiBaseUrl;\n }\n\n public getTileSize(): number {\n return this.json.tileWidth;\n }\n\n public getTileRequest(position: QuadIdProps): GoogleMapsRequest {\n const url = this.getTilePositionUrl(position);\n url.searchParams.append(\"key\", this.apiKey);\n url.searchParams.append(\"session\", this.json.session);\n return {url};\n }\n\n public getViewportInfoRequest(rectangle: MapCartoRectangle, zoomLevel: number): GoogleMapsRequest {\n const degrees = rectangle.toDegrees();\n const url = new URL(\n `${this.getViewportApiBaseUrl()}` +\n `?zoom=${zoomLevel}` +\n `&north=${degrees.north}&south=${degrees.south}&east=${degrees.east}&west=${degrees.west}`\n );\n url.searchParams.append(\"key\", this.apiKey);\n url.searchParams.append(\"session\", this.json.session);\n return {url};\n }\n\n /**\n * Creates a Google Maps session.\n * @param apiKey Google Cloud API key\n * @param opts Options to create the session\n * @internal\n */\n public static async create(apiKey: string, opts: GoogleMapsCreateSessionOptions): Promise<GoogleMapsSessionData> {\n const url = `https://tile.googleapis.com/v1/createSession?key=${apiKey}`;\n const request = new Request(url, {method: \"POST\", body: JSON.stringify(opts)});\n const response = await fetch (request);\n if (!response.ok) {\n throw new Error(`CreateSession request failed: ${response.status} - ${response.statusText}`);\n }\n Logger.logInfo(loggerCategory, `Session created successfully`);\n return response.json();\n }\n}\n\n/*\n* Google Maps session manager that uses standard API key to create a session.\n* @beta\n*/\nexport class NativeGoogleMapsSessionManager extends GoogleMapsSessionManager {\n public readonly apiKey: string;\n\n constructor(apiKey: string) {\n super();\n this.apiKey = apiKey;\n }\n\n public async createSession(sessionOptions: GoogleMapsCreateSessionOptions): Promise<GoogleMapsSession> {\n const json = await NativeGoogleMapsSession.create(this.apiKey, sessionOptions);\n return new NativeGoogleMapsSession(json, this.apiKey);\n }\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
width="98px" height="18px" viewBox="0 0 98 18" enable-background="new 0 0 98 18" xml:space="preserve">
|
|
5
|
+
<g>
|
|
6
|
+
<path fill="#5E5E5E" d="M7.08,13.96c-1.93,0-3.59-0.68-4.99-2.05C0.7,10.54,0,8.9,0,6.98c0-1.92,0.7-3.56,2.09-4.93
|
|
7
|
+
C3.49,0.68,5.15,0,7.08,0c1.85,0,3.45,0.64,4.79,1.92l-1.35,1.35C9.56,2.36,8.41,1.91,7.08,1.91c-1.4,0-2.58,0.49-3.55,1.48
|
|
8
|
+
C2.56,4.38,2.08,5.57,2.08,6.98c0,1.41,0.49,2.61,1.46,3.59c0.97,0.99,2.15,1.48,3.55,1.48c1.42,0,2.59-0.47,3.53-1.4
|
|
9
|
+
c0.56-0.56,0.9-1.36,1.04-2.4H7.08V6.35h6.42c0.07,0.34,0.1,0.74,0.1,1.19c0,1.87-0.55,3.36-1.65,4.46
|
|
10
|
+
C10.71,13.31,9.08,13.96,7.08,13.96z M22,12.68c-0.87,0.86-1.94,1.29-3.2,1.29c-1.26,0-2.33-0.43-3.2-1.29
|
|
11
|
+
c-0.87-0.86-1.31-1.93-1.31-3.21c0-1.28,0.44-2.35,1.31-3.21c0.87-0.86,1.94-1.29,3.2-1.29c1.26,0,2.33,0.43,3.2,1.29
|
|
12
|
+
c0.87,0.86,1.31,1.93,1.31,3.21C23.31,10.75,22.88,11.82,22,12.68z M17.01,11.42c0.5,0.52,1.1,0.77,1.79,0.77
|
|
13
|
+
c0.69,0,1.29-0.26,1.79-0.77c0.5-0.52,0.75-1.17,0.75-1.95c0-0.79-0.25-1.45-0.74-1.96C20.1,7,19.5,6.74,18.8,6.74
|
|
14
|
+
c-0.7,0-1.3,0.26-1.8,0.77c-0.49,0.51-0.74,1.16-0.74,1.96C16.26,10.25,16.51,10.9,17.01,11.42z M31.85,12.68
|
|
15
|
+
c-0.87,0.86-1.94,1.29-3.2,1.29s-2.33-0.43-3.2-1.29c-0.87-0.86-1.31-1.93-1.31-3.21c0-1.28,0.44-2.35,1.31-3.21
|
|
16
|
+
c0.87-0.86,1.94-1.29,3.2-1.29s2.33,0.43,3.2,1.29c0.87,0.86,1.31,1.93,1.31,3.21C33.16,10.75,32.72,11.82,31.85,12.68z
|
|
17
|
+
M26.86,11.42c0.5,0.52,1.1,0.77,1.79,0.77c0.69,0,1.29-0.26,1.79-0.77c0.5-0.52,0.75-1.17,0.75-1.95c0-0.79-0.25-1.45-0.74-1.96
|
|
18
|
+
s-1.09-0.77-1.8-0.77c-0.7,0-1.3,0.26-1.8,0.77c-0.49,0.51-0.74,1.16-0.74,1.96C26.11,10.25,26.36,10.9,26.86,11.42z M38.32,18
|
|
19
|
+
c-1,0-1.84-0.27-2.52-0.8c-0.68-0.53-1.17-1.15-1.46-1.86l1.72-0.72c0.18,0.43,0.47,0.81,0.85,1.12c0.39,0.32,0.86,0.48,1.41,0.48
|
|
20
|
+
c0.75,0,1.34-0.23,1.76-0.68c0.43-0.45,0.64-1.11,0.64-1.96v-0.65h-0.07c-0.56,0.68-1.35,1.02-2.37,1.02
|
|
21
|
+
c-1.15,0-2.15-0.44-3.01-1.31c-0.86-0.87-1.29-1.93-1.29-3.17c0-1.25,0.43-2.31,1.29-3.19c0.86-0.88,1.87-1.32,3.01-1.32
|
|
22
|
+
c0.51,0,0.97,0.1,1.39,0.29c0.41,0.19,0.74,0.43,0.98,0.72h0.07V5.25h1.87v8.07c0,1.57-0.4,2.74-1.2,3.52
|
|
23
|
+
C40.59,17.61,39.57,18,38.32,18z M38.45,12.19c0.68,0,1.25-0.26,1.71-0.77c0.46-0.52,0.69-1.16,0.69-1.93
|
|
24
|
+
c0-0.78-0.23-1.44-0.69-1.96C39.7,7,39.13,6.74,38.45,6.74c-0.69,0-1.28,0.26-1.77,0.78c-0.49,0.52-0.73,1.18-0.73,1.96
|
|
25
|
+
c0,0.77,0.24,1.42,0.73,1.93C37.17,11.93,37.76,12.19,38.45,12.19z M45.93,0.48v13.21h-1.98V0.48H45.93z M51.34,13.96
|
|
26
|
+
c-1.27,0-2.33-0.43-3.18-1.29c-0.85-0.86-1.28-1.93-1.28-3.2c0-1.32,0.41-2.4,1.23-3.24c0.82-0.84,1.82-1.26,3.01-1.26
|
|
27
|
+
c0.55,0,1.05,0.1,1.52,0.3c0.47,0.2,0.85,0.45,1.16,0.77c0.31,0.31,0.55,0.62,0.73,0.91c0.18,0.3,0.33,0.59,0.44,0.89l0.2,0.51
|
|
28
|
+
l-6.01,2.49c0.47,0.91,1.19,1.36,2.18,1.36c0.91,0,1.65-0.41,2.21-1.24l1.53,1.02c-0.34,0.51-0.82,0.97-1.45,1.38
|
|
29
|
+
C53.02,13.76,52.25,13.96,51.34,13.96z M48.84,9.33l4.02-1.67c-0.11-0.28-0.32-0.51-0.63-0.69c-0.31-0.18-0.65-0.26-1.04-0.26
|
|
30
|
+
c-0.58,0-1.12,0.24-1.63,0.72C49.06,7.9,48.82,8.54,48.84,9.33z"/>
|
|
31
|
+
<path fill="#5E5E5E" d="M60.05,13.69V1.5h1.57l4.24,7.42h0.07l4.24-7.42h1.57v12.19h-1.57V6.45l0.07-2.04h-0.07l-3.81,6.69h-0.92
|
|
32
|
+
l-3.81-6.69h-0.07l0.07,2.04v7.24H60.05z M76.36,13.96c-0.89,0-1.63-0.26-2.22-0.77c-0.6-0.51-0.89-1.19-0.89-2.03
|
|
33
|
+
c0-0.91,0.35-1.62,1.06-2.14c0.7-0.52,1.57-0.77,2.61-0.77c0.92,0,1.67,0.17,2.26,0.51V8.53c0-0.61-0.21-1.1-0.63-1.47
|
|
34
|
+
c-0.42-0.37-0.94-0.55-1.55-0.55c-0.45,0-0.87,0.11-1.23,0.32C75.39,7.04,75.13,7.34,75,7.71L73.57,7.1
|
|
35
|
+
c0.19-0.5,0.57-0.96,1.14-1.39c0.57-0.43,1.32-0.64,2.25-0.64c1.07,0,1.95,0.31,2.66,0.94c0.7,0.62,1.06,1.5,1.06,2.64v5.04h-1.5
|
|
36
|
+
v-1.16H79.1C78.48,13.49,77.56,13.96,76.36,13.96z M76.61,12.53c0.65,0,1.23-0.24,1.76-0.72c0.53-0.48,0.79-1.05,0.79-1.71
|
|
37
|
+
c-0.44-0.36-1.11-0.54-1.99-0.54c-0.76,0-1.33,0.16-1.72,0.49c-0.39,0.33-0.58,0.72-0.58,1.16c0,0.41,0.18,0.73,0.53,0.97
|
|
38
|
+
C75.76,12.41,76.16,12.53,76.61,12.53z M86.58,13.96c-0.64,0-1.21-0.14-1.71-0.41c-0.51-0.27-0.88-0.61-1.13-1.02h-0.07l0.07,1.16
|
|
39
|
+
v3.68h-1.57V5.35h1.5v1.16h0.07c0.25-0.41,0.63-0.75,1.13-1.02c0.51-0.27,1.08-0.41,1.71-0.41c1.08,0,2.01,0.43,2.79,1.28
|
|
40
|
+
c0.78,0.85,1.18,1.91,1.18,3.17c0,1.26-0.39,2.32-1.18,3.17C88.59,13.54,87.66,13.96,86.58,13.96z M86.32,12.53
|
|
41
|
+
c0.73,0,1.35-0.28,1.87-0.83c0.52-0.55,0.78-1.28,0.78-2.19c0-0.91-0.26-1.64-0.78-2.19c-0.52-0.55-1.15-0.83-1.87-0.83
|
|
42
|
+
c-0.74,0-1.37,0.27-1.88,0.82c-0.52,0.54-0.77,1.28-0.77,2.2s0.26,1.65,0.77,2.2C84.96,12.26,85.58,12.53,86.32,12.53z
|
|
43
|
+
M94.71,13.96c-0.93,0-1.7-0.23-2.31-0.68c-0.61-0.45-1.05-1.02-1.34-1.7l1.4-0.58c0.44,1.04,1.2,1.57,2.26,1.57
|
|
44
|
+
c0.49,0,0.89-0.11,1.2-0.32c0.31-0.22,0.47-0.5,0.47-0.85c0-0.54-0.38-0.91-1.14-1.11l-1.69-0.41c-0.53-0.14-1.04-0.39-1.52-0.77
|
|
45
|
+
c-0.48-0.38-0.72-0.89-0.72-1.54c0-0.74,0.33-1.34,0.98-1.8c0.65-0.46,1.43-0.69,2.32-0.69c0.74,0,1.4,0.17,1.98,0.5
|
|
46
|
+
c0.58,0.34,0.99,0.81,1.24,1.44L96.5,7.58c-0.31-0.74-0.94-1.11-1.91-1.11c-0.47,0-0.86,0.1-1.18,0.29
|
|
47
|
+
c-0.32,0.19-0.48,0.45-0.48,0.78c0,0.48,0.37,0.8,1.11,0.97l1.65,0.39c0.78,0.18,1.36,0.49,1.74,0.94c0.37,0.44,0.56,0.94,0.56,1.5
|
|
48
|
+
c0,0.75-0.31,1.37-0.92,1.87C96.47,13.71,95.68,13.96,94.71,13.96z"/>
|
|
49
|
+
</g>
|
|
50
|
+
</svg>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
width="105px" height="22px" viewBox="0 0 105 22" enable-background="new 0 0 105 22" xml:space="preserve">
|
|
5
|
+
<g id="Logo">
|
|
6
|
+
<g id="Outline" opacity="0.8">
|
|
7
|
+
<path fill="#1E1E1E" d="M59.77,11.44l-0.93-2.32c-0.16-0.4-0.36-0.81-0.61-1.22c-0.26-0.42-0.6-0.85-1.01-1.27
|
|
8
|
+
c-0.49-0.5-1.1-0.9-1.8-1.2c-0.71-0.3-1.49-0.46-2.3-0.46c-1.16,0-2.25,0.3-3.19,0.87V0.48h-5.98v4.77H42
|
|
9
|
+
c-0.54-0.18-1.12-0.27-1.72-0.27c-1.68,0-3.21,0.66-4.44,1.92c-0.09,0.09-0.18,0.19-0.26,0.29c-0.1-0.12-0.21-0.24-0.33-0.35
|
|
10
|
+
c-1.26-1.23-2.81-1.86-4.6-1.86c-1.77,0-3.36,0.64-4.6,1.86c-0.11,0.11-0.22,0.22-0.32,0.34c-0.1-0.12-0.21-0.23-0.32-0.34
|
|
11
|
+
c-1.26-1.23-2.81-1.86-4.6-1.86c-1.55,0-2.91,0.46-4.06,1.38h-2.47l2.46-2.46l-1.48-1.41C13.53,0.83,11.46,0,9.08,0
|
|
12
|
+
C6.62,0,4.47,0.88,2.7,2.62C0.91,4.38,0,6.51,0,8.98s0.91,4.61,2.7,6.36c1.78,1.74,3.93,2.62,6.39,2.62
|
|
13
|
+
c2.56,0,4.68-0.87,6.28-2.54c0.04-0.04,0.08-0.08,0.12-0.13c0.21,0.29,0.44,0.56,0.7,0.81c1.24,1.22,2.83,1.86,4.6,1.86
|
|
14
|
+
c1.8,0,3.34-0.62,4.6-1.86c0.11-0.11,0.22-0.22,0.32-0.34c0.1,0.12,0.21,0.23,0.32,0.34c1.24,1.22,2.83,1.86,4.6,1.86
|
|
15
|
+
c1.26,0,2.4-0.31,3.4-0.92l0.45,1.07c0.43,1.02,1.13,1.91,2.08,2.66c1.04,0.81,2.3,1.23,3.75,1.23c1.78,0,3.29-0.58,4.47-1.73
|
|
16
|
+
c0.71-0.69,1.21-1.55,1.5-2.58h3.64v-0.67c1,0.62,2.16,0.94,3.42,0.94c1.3,0,2.44-0.32,3.39-0.94c0.85-0.55,1.53-1.21,2.02-1.94
|
|
17
|
+
l1.11-1.66l-1.87-1.25L59.77,11.44z"/>
|
|
18
|
+
<path fill="#1E1E1E" d="M105,10.11l-0.74-1.84c-0.42-1.05-1.13-1.86-2.1-2.43c-0.89-0.51-1.89-0.77-2.98-0.77
|
|
19
|
+
c-1.31,0-2.48,0.35-3.48,1.05c-0.24,0.17-0.45,0.36-0.65,0.56c-1.11-1.05-2.46-1.61-3.95-1.61c-0.63,0-1.22,0.09-1.78,0.27h-4.63
|
|
20
|
+
v0.6c-0.93-0.58-2-0.87-3.21-0.87c-1.26,0-2.34,0.31-3.22,0.9V1.5h-4.73l-3.11,5.45l-3.1-5.45H62.6v16.19h5.57V15.1h0.65h3.24
|
|
21
|
+
h0.65v2.59h5.57v-0.37c0.77,0.42,1.65,0.64,2.62,0.64c0.64,0,1.23-0.09,1.78-0.27h2.03v3.68h5.57v-3.46
|
|
22
|
+
c0.27,0.04,0.56,0.06,0.84,0.06c1.5,0,2.87-0.57,3.98-1.64c0.2,0.2,0.42,0.39,0.65,0.56c0.96,0.72,2.14,1.08,3.51,1.08
|
|
23
|
+
c1.43,0,2.65-0.4,3.63-1.2c1.08-0.88,1.66-2.07,1.66-3.42c0-0.97-0.32-1.89-0.93-2.66L105,10.11z"/>
|
|
24
|
+
</g>
|
|
25
|
+
<g id="Inner_text">
|
|
26
|
+
<g>
|
|
27
|
+
<path fill="#FFFFFF" d="M9.08,8.35v1.9h4.58c-0.14,1.04-0.48,1.84-1.04,2.4c-0.94,0.93-2.11,1.4-3.53,1.4
|
|
28
|
+
c-1.4,0-2.58-0.49-3.55-1.48c-0.97-0.98-1.46-2.18-1.46-3.59c0-1.41,0.48-2.6,1.45-3.59C6.5,4.4,7.68,3.91,9.08,3.91
|
|
29
|
+
c1.33,0,2.47,0.45,3.44,1.36l1.35-1.35C12.53,2.64,10.93,2,9.08,2C7.15,2,5.49,2.68,4.09,4.05C2.7,5.42,2,7.06,2,8.98
|
|
30
|
+
c0,1.92,0.7,3.56,2.09,4.93c1.4,1.37,3.06,2.05,4.99,2.05c2,0,3.63-0.65,4.87-1.96c1.1-1.1,1.65-2.59,1.65-4.46
|
|
31
|
+
c0-0.45-0.03-0.85-0.1-1.19H9.08z"/>
|
|
32
|
+
<path fill="#FFFFFF" d="M42.72,7.97h-0.07c-0.24-0.29-0.57-0.53-0.98-0.72c-0.42-0.19-0.88-0.29-1.39-0.29
|
|
33
|
+
c-1.14,0-2.15,0.44-3.01,1.32c-0.86,0.88-1.29,1.94-1.29,3.19c0,1.24,0.43,2.3,1.29,3.17c0.86,0.87,1.86,1.31,3.01,1.31
|
|
34
|
+
c1.02,0,1.81-0.34,2.37-1.02h0.07v0.65c0,0.85-0.21,1.51-0.64,1.96c-0.42,0.45-1.01,0.68-1.76,0.68c-0.55,0-1.02-0.16-1.41-0.48
|
|
35
|
+
c-0.38-0.31-0.67-0.69-0.85-1.12l-1.72,0.72c0.29,0.71,0.78,1.33,1.46,1.86c0.68,0.53,1.52,0.8,2.52,0.8
|
|
36
|
+
c1.25,0,2.27-0.39,3.07-1.17c0.8-0.78,1.2-1.95,1.2-3.52V7.24h-1.87V7.97z M42.16,13.42c-0.46,0.51-1.03,0.77-1.71,0.77
|
|
37
|
+
c-0.69,0-1.28-0.26-1.77-0.78c-0.49-0.51-0.73-1.16-0.73-1.93c0-0.78,0.24-1.44,0.73-1.96c0.49-0.52,1.08-0.78,1.77-0.78
|
|
38
|
+
c0.68,0,1.25,0.26,1.71,0.79c0.46,0.52,0.69,1.18,0.69,1.96C42.85,12.26,42.62,12.9,42.16,13.42z"/>
|
|
39
|
+
<path fill="#FFFFFF" d="M20.8,6.97c-1.26,0-2.33,0.43-3.2,1.29s-1.31,1.93-1.31,3.21c0,1.28,0.44,2.35,1.31,3.21
|
|
40
|
+
s1.94,1.29,3.2,1.29s2.33-0.43,3.2-1.29c0.88-0.86,1.31-1.93,1.31-3.21c0-1.28-0.44-2.35-1.31-3.21S22.06,6.97,20.8,6.97z
|
|
41
|
+
M22.59,13.42c-0.5,0.51-1.1,0.77-1.79,0.77s-1.29-0.25-1.79-0.77c-0.5-0.52-0.75-1.17-0.75-1.95c0-0.8,0.25-1.45,0.74-1.96
|
|
42
|
+
c0.5-0.51,1.1-0.77,1.8-0.77S22.1,9,22.6,9.51c0.49,0.51,0.74,1.17,0.74,1.96C23.34,12.25,23.09,12.9,22.59,13.42z"/>
|
|
43
|
+
<rect x="45.95" y="2.48" fill="#FFFFFF" width="1.98" height="13.21"/>
|
|
44
|
+
<path fill="#FFFFFF" d="M53.34,14.2c-0.99,0-1.71-0.45-2.18-1.36l6.01-2.49l-0.2-0.51c-0.11-0.3-0.26-0.59-0.44-0.89
|
|
45
|
+
c-0.18-0.29-0.42-0.6-0.73-0.91c-0.31-0.32-0.69-0.57-1.16-0.77c-0.47-0.2-0.97-0.3-1.52-0.3c-1.19,0-2.19,0.42-3.01,1.26
|
|
46
|
+
c-0.82,0.84-1.23,1.92-1.23,3.24c0,1.27,0.43,2.34,1.28,3.2c0.85,0.86,1.91,1.29,3.18,1.29c0.91,0,1.68-0.2,2.29-0.6
|
|
47
|
+
c0.63-0.41,1.11-0.87,1.45-1.38l-1.53-1.02C54.99,13.79,54.25,14.2,53.34,14.2z M51.56,9.43c0.51-0.48,1.05-0.72,1.63-0.72
|
|
48
|
+
c0.39,0,0.73,0.08,1.04,0.26c0.31,0.18,0.52,0.41,0.63,0.69l-4.02,1.67C50.82,10.54,51.06,9.9,51.56,9.43z"/>
|
|
49
|
+
<path fill="#FFFFFF" d="M30.65,6.97c-1.26,0-2.33,0.43-3.2,1.29s-1.31,1.93-1.31,3.21c0,1.28,0.44,2.35,1.31,3.21
|
|
50
|
+
s1.94,1.29,3.2,1.29c1.26,0,2.33-0.43,3.2-1.29c0.87-0.86,1.31-1.93,1.31-3.21c0-1.28-0.44-2.35-1.31-3.21S31.91,6.97,30.65,6.97
|
|
51
|
+
z M32.44,13.42c-0.5,0.51-1.1,0.77-1.79,0.77s-1.29-0.25-1.79-0.77c-0.5-0.52-0.75-1.17-0.75-1.95c0-0.8,0.25-1.45,0.74-1.96
|
|
52
|
+
c0.5-0.51,1.1-0.77,1.8-0.77c0.71,0,1.31,0.26,1.8,0.77s0.74,1.17,0.74,1.96C33.19,12.25,32.94,12.9,32.44,13.42z"/>
|
|
53
|
+
</g>
|
|
54
|
+
<g>
|
|
55
|
+
<polygon fill="#FFFFFF" points="70.48,10.92 70.41,10.92 66.17,3.5 64.6,3.5 64.6,15.69 66.17,15.69 66.17,8.45 66.1,6.41
|
|
56
|
+
66.17,6.41 69.98,13.1 70.9,13.1 74.72,6.41 74.79,6.41 74.72,8.45 74.72,15.69 76.29,15.69 76.29,3.5 74.72,3.5 "/>
|
|
57
|
+
<path fill="#FFFFFF" d="M81.5,7.07c-0.93,0-1.68,0.21-2.25,0.64S78.3,8.6,78.11,9.1l1.44,0.61c0.14-0.38,0.39-0.67,0.76-0.89
|
|
58
|
+
c0.36-0.21,0.78-0.32,1.23-0.32c0.61,0,1.13,0.18,1.55,0.55c0.42,0.37,0.63,0.86,0.63,1.47v0.24c-0.59-0.34-1.34-0.51-2.26-0.51
|
|
59
|
+
c-1.04,0-1.91,0.25-2.61,0.77c-0.71,0.52-1.06,1.23-1.06,2.14c0,0.84,0.29,1.52,0.89,2.03c0.59,0.51,1.33,0.77,2.22,0.77
|
|
60
|
+
c1.21,0,2.12-0.47,2.75-1.43h0.07v1.16h1.5v-5.04c0-1.14-0.36-2.02-1.06-2.64C83.45,7.38,82.57,7.07,81.5,7.07z M82.92,13.81
|
|
61
|
+
c-0.53,0.48-1.11,0.72-1.76,0.72c-0.46,0-0.86-0.12-1.21-0.35c-0.35-0.24-0.53-0.56-0.53-0.97c0-0.44,0.19-0.83,0.58-1.16
|
|
62
|
+
s0.96-0.49,1.72-0.49c0.88,0,1.55,0.18,1.99,0.54C83.71,12.76,83.45,13.33,82.92,13.81z"/>
|
|
63
|
+
<path fill="#FFFFFF" d="M91.12,7.08c-0.63,0-1.2,0.14-1.71,0.41c-0.5,0.27-0.88,0.61-1.13,1.02h-0.07V7.35h-1.5v12.02h1.57v-3.68
|
|
64
|
+
l-0.07-1.16h0.07c0.25,0.41,0.62,0.75,1.13,1.02c0.5,0.27,1.07,0.41,1.71,0.41c1.08,0,2.01-0.42,2.79-1.26
|
|
65
|
+
c0.79-0.85,1.18-1.91,1.18-3.17c0-1.26-0.4-2.32-1.18-3.17C93.13,7.51,92.2,7.08,91.12,7.08z M92.73,13.7
|
|
66
|
+
c-0.52,0.55-1.14,0.83-1.87,0.83c-0.73,0-1.36-0.27-1.88-0.82c-0.51-0.55-0.77-1.28-0.77-2.2s0.25-1.66,0.77-2.2
|
|
67
|
+
c0.51-0.55,1.14-0.82,1.88-0.82c0.72,0,1.35,0.28,1.87,0.83c0.52,0.55,0.78,1.28,0.78,2.19C93.51,12.42,93.25,13.15,92.73,13.7z"
|
|
68
|
+
/>
|
|
69
|
+
<path fill="#FFFFFF" d="M101.96,11.84c-0.38-0.45-0.96-0.76-1.74-0.94l-1.65-0.39c-0.74-0.17-1.11-0.49-1.11-0.97
|
|
70
|
+
c0-0.33,0.16-0.59,0.48-0.78s0.71-0.29,1.18-0.29c0.97,0,1.6,0.37,1.91,1.11l1.36-0.56c-0.25-0.63-0.66-1.1-1.24-1.44
|
|
71
|
+
c-0.58-0.33-1.24-0.5-1.98-0.5c-0.89,0-1.67,0.23-2.32,0.69c-0.65,0.46-0.98,1.06-0.98,1.8c0,0.65,0.24,1.16,0.72,1.54
|
|
72
|
+
s0.99,0.63,1.52,0.77l1.69,0.41c0.76,0.2,1.14,0.57,1.14,1.11c0,0.35-0.16,0.63-0.47,0.85c-0.31,0.21-0.71,0.32-1.2,0.32
|
|
73
|
+
c-1.06,0-1.82-0.53-2.26-1.57l-1.4,0.58c0.29,0.68,0.73,1.25,1.34,1.7c0.61,0.45,1.38,0.68,2.31,0.68c0.96,0,1.75-0.25,2.34-0.75
|
|
74
|
+
c0.61-0.5,0.92-1.12,0.92-1.87C102.52,12.78,102.33,12.28,101.96,11.84z"/>
|
|
75
|
+
</g>
|
|
76
|
+
</g>
|
|
77
|
+
</g>
|
|
78
|
+
</svg>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
width="105px" height="22px" viewBox="0 0 105 22" enable-background="new 0 0 105 22" xml:space="preserve">
|
|
5
|
+
<g id="Logo">
|
|
6
|
+
<g id="Outline" opacity="0.8">
|
|
7
|
+
<path fill="#FFFFFF" d="M59.77,11.44l-0.93-2.32c-0.16-0.4-0.36-0.81-0.61-1.22c-0.26-0.42-0.6-0.85-1.01-1.27
|
|
8
|
+
c-0.49-0.5-1.1-0.9-1.8-1.2c-0.71-0.3-1.49-0.46-2.3-0.46c-1.16,0-2.25,0.3-3.19,0.87V0.48h-5.98v4.77H42
|
|
9
|
+
c-0.54-0.18-1.12-0.27-1.72-0.27c-1.68,0-3.21,0.66-4.44,1.92c-0.09,0.09-0.18,0.19-0.26,0.29c-0.1-0.12-0.21-0.24-0.33-0.35
|
|
10
|
+
c-1.26-1.23-2.81-1.86-4.6-1.86c-1.77,0-3.36,0.64-4.6,1.86c-0.11,0.11-0.22,0.22-0.32,0.34c-0.1-0.12-0.21-0.23-0.32-0.34
|
|
11
|
+
c-1.26-1.23-2.81-1.86-4.6-1.86c-1.55,0-2.91,0.46-4.06,1.38h-2.47l2.46-2.46l-1.48-1.41C13.53,0.83,11.46,0,9.08,0
|
|
12
|
+
C6.62,0,4.47,0.88,2.7,2.62C0.91,4.38,0,6.51,0,8.98s0.91,4.61,2.7,6.36c1.78,1.74,3.93,2.62,6.39,2.62
|
|
13
|
+
c2.56,0,4.68-0.87,6.28-2.54c0.04-0.04,0.08-0.08,0.12-0.13c0.21,0.29,0.44,0.56,0.7,0.81c1.24,1.22,2.83,1.86,4.6,1.86
|
|
14
|
+
c1.8,0,3.34-0.62,4.6-1.86c0.11-0.11,0.22-0.22,0.32-0.34c0.1,0.12,0.21,0.23,0.32,0.34c1.24,1.22,2.83,1.86,4.6,1.86
|
|
15
|
+
c1.26,0,2.4-0.31,3.4-0.92l0.45,1.07c0.43,1.02,1.13,1.91,2.08,2.66c1.04,0.81,2.3,1.23,3.75,1.23c1.78,0,3.29-0.58,4.47-1.73
|
|
16
|
+
c0.71-0.69,1.21-1.55,1.5-2.58h3.64v-0.67c1,0.62,2.16,0.94,3.42,0.94c1.3,0,2.44-0.32,3.39-0.94c0.85-0.55,1.53-1.21,2.02-1.94
|
|
17
|
+
l1.11-1.66l-1.87-1.25L59.77,11.44z"/>
|
|
18
|
+
<path fill="#FFFFFF" d="M105,10.11l-0.74-1.84c-0.42-1.05-1.13-1.86-2.1-2.43c-0.89-0.51-1.89-0.77-2.98-0.77
|
|
19
|
+
c-1.31,0-2.48,0.35-3.48,1.05c-0.24,0.17-0.45,0.36-0.65,0.56c-1.11-1.05-2.46-1.61-3.95-1.61c-0.63,0-1.22,0.09-1.78,0.27h-4.63
|
|
20
|
+
v0.6c-0.93-0.58-2-0.87-3.21-0.87c-1.26,0-2.34,0.31-3.22,0.9V1.5h-4.73l-3.11,5.45l-3.1-5.45H62.6v16.19h5.57V15.1h0.65h3.24
|
|
21
|
+
h0.65v2.59h5.57v-0.37c0.77,0.42,1.65,0.64,2.62,0.64c0.64,0,1.23-0.09,1.78-0.27h2.03v3.68h5.57v-3.46
|
|
22
|
+
c0.27,0.04,0.56,0.06,0.84,0.06c1.5,0,2.87-0.57,3.98-1.64c0.2,0.2,0.42,0.39,0.65,0.56c0.96,0.72,2.14,1.08,3.51,1.08
|
|
23
|
+
c1.43,0,2.65-0.4,3.63-1.2c1.08-0.88,1.66-2.07,1.66-3.42c0-0.97-0.32-1.89-0.93-2.66L105,10.11z"/>
|
|
24
|
+
</g>
|
|
25
|
+
<g id="Inner_text">
|
|
26
|
+
<g>
|
|
27
|
+
<path fill="#474747" d="M9.08,8.35v1.9h4.58c-0.14,1.04-0.48,1.84-1.04,2.4c-0.94,0.93-2.11,1.4-3.53,1.4
|
|
28
|
+
c-1.4,0-2.58-0.49-3.55-1.48c-0.97-0.98-1.46-2.18-1.46-3.59c0-1.41,0.48-2.6,1.45-3.59C6.5,4.4,7.68,3.91,9.08,3.91
|
|
29
|
+
c1.33,0,2.47,0.45,3.44,1.36l1.35-1.35C12.53,2.64,10.93,2,9.08,2C7.15,2,5.49,2.68,4.09,4.05C2.7,5.42,2,7.06,2,8.98
|
|
30
|
+
c0,1.92,0.7,3.56,2.09,4.93c1.4,1.37,3.06,2.05,4.99,2.05c2,0,3.63-0.65,4.87-1.96c1.1-1.1,1.65-2.59,1.65-4.46
|
|
31
|
+
c0-0.45-0.03-0.85-0.1-1.19H9.08z"/>
|
|
32
|
+
<path fill="#474747" d="M42.72,7.97h-0.07c-0.24-0.29-0.57-0.53-0.98-0.72c-0.42-0.19-0.88-0.29-1.39-0.29
|
|
33
|
+
c-1.14,0-2.15,0.44-3.01,1.32c-0.86,0.88-1.29,1.94-1.29,3.19c0,1.24,0.43,2.3,1.29,3.17c0.86,0.87,1.86,1.31,3.01,1.31
|
|
34
|
+
c1.02,0,1.81-0.34,2.37-1.02h0.07v0.65c0,0.85-0.21,1.51-0.64,1.96c-0.42,0.45-1.01,0.68-1.76,0.68c-0.55,0-1.02-0.16-1.41-0.48
|
|
35
|
+
c-0.38-0.31-0.67-0.69-0.85-1.12l-1.72,0.72c0.29,0.71,0.78,1.33,1.46,1.86c0.68,0.53,1.52,0.8,2.52,0.8
|
|
36
|
+
c1.25,0,2.27-0.39,3.07-1.17c0.8-0.78,1.2-1.95,1.2-3.52V7.24h-1.87V7.97z M42.16,13.42c-0.46,0.51-1.03,0.77-1.71,0.77
|
|
37
|
+
c-0.69,0-1.28-0.26-1.77-0.78c-0.49-0.51-0.73-1.16-0.73-1.93c0-0.78,0.24-1.44,0.73-1.96c0.49-0.52,1.08-0.78,1.77-0.78
|
|
38
|
+
c0.68,0,1.25,0.26,1.71,0.79c0.46,0.52,0.69,1.18,0.69,1.96C42.85,12.26,42.62,12.9,42.16,13.42z"/>
|
|
39
|
+
<path fill="#474747" d="M20.8,6.97c-1.26,0-2.33,0.43-3.2,1.29s-1.31,1.93-1.31,3.21c0,1.28,0.44,2.35,1.31,3.21
|
|
40
|
+
s1.94,1.29,3.2,1.29s2.33-0.43,3.2-1.29c0.88-0.86,1.31-1.93,1.31-3.21c0-1.28-0.44-2.35-1.31-3.21S22.06,6.97,20.8,6.97z
|
|
41
|
+
M22.59,13.42c-0.5,0.51-1.1,0.77-1.79,0.77s-1.29-0.25-1.79-0.77c-0.5-0.52-0.75-1.17-0.75-1.95c0-0.8,0.25-1.45,0.74-1.96
|
|
42
|
+
c0.5-0.51,1.1-0.77,1.8-0.77S22.1,9,22.6,9.51c0.49,0.51,0.74,1.17,0.74,1.96C23.34,12.25,23.09,12.9,22.59,13.42z"/>
|
|
43
|
+
<rect x="45.95" y="2.48" fill="#474747" width="1.98" height="13.21"/>
|
|
44
|
+
<path fill="#474747" d="M53.34,14.2c-0.99,0-1.71-0.45-2.18-1.36l6.01-2.49l-0.2-0.51c-0.11-0.3-0.26-0.59-0.44-0.89
|
|
45
|
+
c-0.18-0.29-0.42-0.6-0.73-0.91c-0.31-0.32-0.69-0.57-1.16-0.77c-0.47-0.2-0.97-0.3-1.52-0.3c-1.19,0-2.19,0.42-3.01,1.26
|
|
46
|
+
c-0.82,0.84-1.23,1.92-1.23,3.24c0,1.27,0.43,2.34,1.28,3.2c0.85,0.86,1.91,1.29,3.18,1.29c0.91,0,1.68-0.2,2.29-0.6
|
|
47
|
+
c0.63-0.41,1.11-0.87,1.45-1.38l-1.53-1.02C54.99,13.79,54.25,14.2,53.34,14.2z M51.56,9.43c0.51-0.48,1.05-0.72,1.63-0.72
|
|
48
|
+
c0.39,0,0.73,0.08,1.04,0.26c0.31,0.18,0.52,0.41,0.63,0.69l-4.02,1.67C50.82,10.54,51.06,9.9,51.56,9.43z"/>
|
|
49
|
+
<path fill="#474747" d="M30.65,6.97c-1.26,0-2.33,0.43-3.2,1.29s-1.31,1.93-1.31,3.21c0,1.28,0.44,2.35,1.31,3.21
|
|
50
|
+
s1.94,1.29,3.2,1.29c1.26,0,2.33-0.43,3.2-1.29c0.87-0.86,1.31-1.93,1.31-3.21c0-1.28-0.44-2.35-1.31-3.21S31.91,6.97,30.65,6.97
|
|
51
|
+
z M32.44,13.42c-0.5,0.51-1.1,0.77-1.79,0.77s-1.29-0.25-1.79-0.77c-0.5-0.52-0.75-1.17-0.75-1.95c0-0.8,0.25-1.45,0.74-1.96
|
|
52
|
+
c0.5-0.51,1.1-0.77,1.8-0.77c0.71,0,1.31,0.26,1.8,0.77s0.74,1.17,0.74,1.96C33.19,12.25,32.94,12.9,32.44,13.42z"/>
|
|
53
|
+
</g>
|
|
54
|
+
<g>
|
|
55
|
+
<polygon fill="#474747" points="70.48,10.92 70.41,10.92 66.17,3.5 64.6,3.5 64.6,15.69 66.17,15.69 66.17,8.45 66.1,6.41
|
|
56
|
+
66.17,6.41 69.98,13.1 70.9,13.1 74.72,6.41 74.79,6.41 74.72,8.45 74.72,15.69 76.29,15.69 76.29,3.5 74.72,3.5 "/>
|
|
57
|
+
<path fill="#474747" d="M81.5,7.07c-0.93,0-1.68,0.21-2.25,0.64S78.3,8.6,78.11,9.1l1.44,0.61c0.14-0.38,0.39-0.67,0.76-0.89
|
|
58
|
+
c0.36-0.21,0.78-0.32,1.23-0.32c0.61,0,1.13,0.18,1.55,0.55c0.42,0.37,0.63,0.86,0.63,1.47v0.24c-0.59-0.34-1.34-0.51-2.26-0.51
|
|
59
|
+
c-1.04,0-1.91,0.25-2.61,0.77c-0.71,0.52-1.06,1.23-1.06,2.14c0,0.84,0.29,1.52,0.89,2.03c0.59,0.51,1.33,0.77,2.22,0.77
|
|
60
|
+
c1.21,0,2.12-0.47,2.75-1.43h0.07v1.16h1.5v-5.04c0-1.14-0.36-2.02-1.06-2.64C83.45,7.38,82.57,7.07,81.5,7.07z M82.92,13.81
|
|
61
|
+
c-0.53,0.48-1.11,0.72-1.76,0.72c-0.46,0-0.86-0.12-1.21-0.35c-0.35-0.24-0.53-0.56-0.53-0.97c0-0.44,0.19-0.83,0.58-1.16
|
|
62
|
+
s0.96-0.49,1.72-0.49c0.88,0,1.55,0.18,1.99,0.54C83.71,12.76,83.45,13.33,82.92,13.81z"/>
|
|
63
|
+
<path fill="#474747" d="M91.12,7.08c-0.63,0-1.2,0.14-1.71,0.41c-0.5,0.27-0.88,0.61-1.13,1.02h-0.07V7.35h-1.5v12.02h1.57v-3.68
|
|
64
|
+
l-0.07-1.16h0.07c0.25,0.41,0.62,0.75,1.13,1.02c0.5,0.27,1.07,0.41,1.71,0.41c1.08,0,2.01-0.42,2.79-1.26
|
|
65
|
+
c0.79-0.85,1.18-1.91,1.18-3.17c0-1.26-0.4-2.32-1.18-3.17C93.13,7.51,92.2,7.08,91.12,7.08z M92.73,13.7
|
|
66
|
+
c-0.52,0.55-1.14,0.83-1.87,0.83c-0.73,0-1.36-0.27-1.88-0.82c-0.51-0.55-0.77-1.28-0.77-2.2s0.25-1.66,0.77-2.2
|
|
67
|
+
c0.51-0.55,1.14-0.82,1.88-0.82c0.72,0,1.35,0.28,1.87,0.83c0.52,0.55,0.78,1.28,0.78,2.19C93.51,12.42,93.25,13.15,92.73,13.7z"
|
|
68
|
+
/>
|
|
69
|
+
<path fill="#474747" d="M101.96,11.84c-0.38-0.45-0.96-0.76-1.74-0.94l-1.65-0.39c-0.74-0.17-1.11-0.49-1.11-0.97
|
|
70
|
+
c0-0.33,0.16-0.59,0.48-0.78s0.71-0.29,1.18-0.29c0.97,0,1.6,0.37,1.91,1.11l1.36-0.56c-0.25-0.63-0.66-1.1-1.24-1.44
|
|
71
|
+
c-0.58-0.33-1.24-0.5-1.98-0.5c-0.89,0-1.67,0.23-2.32,0.69c-0.65,0.46-0.98,1.06-0.98,1.8c0,0.65,0.24,1.16,0.72,1.54
|
|
72
|
+
s0.99,0.63,1.52,0.77l1.69,0.41c0.76,0.2,1.14,0.57,1.14,1.11c0,0.35-0.16,0.63-0.47,0.85c-0.31,0.21-0.71,0.32-1.2,0.32
|
|
73
|
+
c-1.06,0-1.82-0.53-2.26-1.57l-1.4,0.58c0.29,0.68,0.73,1.25,1.34,1.7c0.61,0.45,1.38,0.68,2.31,0.68c0.96,0,1.75-0.25,2.34-0.75
|
|
74
|
+
c0.61-0.5,0.92-1.12,0.92-1.87C102.52,12.78,102.33,12.28,101.96,11.84z"/>
|
|
75
|
+
</g>
|
|
76
|
+
</g>
|
|
77
|
+
</g>
|
|
78
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/map-layers-formats",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0-dev.1",
|
|
4
4
|
"description": "Enables additional map-layers formats in iTwin.js",
|
|
5
5
|
"main": "lib/cjs/map-layers-formats.js",
|
|
6
6
|
"module": "lib/esm/map-layers-formats.js",
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"typemoq": "^2.1.0",
|
|
54
54
|
"typescript": "~5.6.2",
|
|
55
55
|
"fetch-mock": "~11.1.3",
|
|
56
|
-
"@itwin/
|
|
57
|
-
"@itwin/
|
|
58
|
-
"@itwin/
|
|
59
|
-
"@itwin/core-
|
|
60
|
-
"@itwin/core-bentley": "5.
|
|
61
|
-
"
|
|
62
|
-
"
|
|
56
|
+
"@itwin/appui-abstract": "5.3.0-dev.1",
|
|
57
|
+
"@itwin/core-common": "5.3.0-dev.1",
|
|
58
|
+
"@itwin/build-tools": "5.3.0-dev.1",
|
|
59
|
+
"@itwin/core-geometry": "5.3.0-dev.1",
|
|
60
|
+
"@itwin/core-bentley": "5.3.0-dev.1",
|
|
61
|
+
"internal-tools": "3.0.0-dev.69",
|
|
62
|
+
"@itwin/core-frontend": "5.3.0-dev.1"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@itwin/
|
|
66
|
-
"@itwin/core-common": "5.
|
|
67
|
-
"@itwin/
|
|
68
|
-
"@itwin/core-frontend": "5.
|
|
69
|
-
"@itwin/core-geometry": "5.
|
|
65
|
+
"@itwin/core-bentley": "5.3.0-dev.1",
|
|
66
|
+
"@itwin/core-common": "5.3.0-dev.1",
|
|
67
|
+
"@itwin/appui-abstract": "5.3.0-dev.1",
|
|
68
|
+
"@itwin/core-frontend": "5.3.0-dev.1",
|
|
69
|
+
"@itwin/core-geometry": "5.3.0-dev.1"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"google-protobuf": "~3.20.1",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|