@itwin/map-layers-formats 5.0.0-dev.68 → 5.0.0-dev.69
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/GoogleMaps/GoogleMapDecorator.d.ts +36 -0
- package/lib/cjs/GoogleMaps/GoogleMapDecorator.d.ts.map +1 -0
- package/lib/cjs/GoogleMaps/GoogleMapDecorator.js +83 -0
- package/lib/cjs/GoogleMaps/GoogleMapDecorator.js.map +1 -0
- package/lib/cjs/GoogleMaps/GoogleMaps.d.ts +166 -0
- package/lib/cjs/GoogleMaps/GoogleMaps.d.ts.map +1 -0
- package/lib/cjs/GoogleMaps/GoogleMaps.js +56 -0
- package/lib/cjs/GoogleMaps/GoogleMaps.js.map +1 -0
- package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.d.ts +10 -0
- package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.d.ts.map +1 -0
- package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.js +20 -0
- package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -0
- package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.d.ts +25 -0
- package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.d.ts.map +1 -0
- package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.js +232 -0
- package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -0
- package/lib/cjs/internal/GoogleMapsUtils.d.ts +38 -0
- package/lib/cjs/internal/GoogleMapsUtils.d.ts.map +1 -0
- package/lib/cjs/internal/GoogleMapsUtils.js +104 -0
- package/lib/cjs/internal/GoogleMapsUtils.js.map +1 -0
- package/lib/cjs/map-layers-formats.d.ts +1 -0
- package/lib/cjs/map-layers-formats.d.ts.map +1 -1
- package/lib/cjs/map-layers-formats.js +1 -0
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
- package/lib/cjs/mapLayersFormats.js +2 -0
- package/lib/cjs/mapLayersFormats.js.map +1 -1
- package/lib/esm/GoogleMaps/GoogleMapDecorator.d.ts +36 -0
- package/lib/esm/GoogleMaps/GoogleMapDecorator.d.ts.map +1 -0
- package/lib/esm/GoogleMaps/GoogleMapDecorator.js +78 -0
- package/lib/esm/GoogleMaps/GoogleMapDecorator.js.map +1 -0
- package/lib/esm/GoogleMaps/GoogleMaps.d.ts +166 -0
- package/lib/esm/GoogleMaps/GoogleMaps.d.ts.map +1 -0
- package/lib/esm/GoogleMaps/GoogleMaps.js +53 -0
- package/lib/esm/GoogleMaps/GoogleMaps.js.map +1 -0
- package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.d.ts +10 -0
- package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.d.ts.map +1 -0
- package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.js +16 -0
- package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -0
- package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.d.ts +25 -0
- package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.d.ts.map +1 -0
- package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js +228 -0
- package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -0
- package/lib/esm/internal/GoogleMapsUtils.d.ts +38 -0
- package/lib/esm/internal/GoogleMapsUtils.d.ts.map +1 -0
- package/lib/esm/internal/GoogleMapsUtils.js +101 -0
- package/lib/esm/internal/GoogleMapsUtils.js.map +1 -0
- package/lib/esm/map-layers-formats.d.ts +1 -0
- package/lib/esm/map-layers-formats.d.ts.map +1 -1
- package/lib/esm/map-layers-formats.js +1 -0
- package/lib/esm/map-layers-formats.js.map +1 -1
- package/lib/esm/mapLayersFormats.d.ts.map +1 -1
- package/lib/esm/mapLayersFormats.js +2 -0
- package/lib/esm/mapLayersFormats.js.map +1 -1
- 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/package.json +12 -12
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
6
|
+
import { GoogleMapsMapLayerFormat } from "../GoogleMaps/GoogleMapsImageryFormat";
|
|
7
|
+
import { Logger } from "@itwin/core-bentley";
|
|
8
|
+
import { Angle } from "@itwin/core-geometry";
|
|
9
|
+
const loggerCategory = "MapLayersFormats.GoogleMaps";
|
|
10
|
+
/** @internal */
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
|
+
export const GoogleMapsUtils = {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a Google Maps session.
|
|
15
|
+
* @param apiKey Google Cloud API key
|
|
16
|
+
* @param opts Options to create the session
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
createSession: async (apiKey, opts) => {
|
|
20
|
+
const url = `https://tile.googleapis.com/v1/createSession?key=${apiKey}`;
|
|
21
|
+
const request = new Request(url, { method: "POST", body: JSON.stringify(opts) });
|
|
22
|
+
const response = await fetch(request);
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
throw new Error(`CreateSession request failed: ${response.status} - ${response.statusText}`);
|
|
25
|
+
}
|
|
26
|
+
Logger.logInfo(loggerCategory, `Session created successfully`);
|
|
27
|
+
return response.json();
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* Register the google maps format if it is not already registered.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
checkFormatRegistered: () => {
|
|
34
|
+
if (!IModelApp.mapLayerFormatRegistry.isRegistered(GoogleMapsMapLayerFormat.formatId)) {
|
|
35
|
+
throw new Error(`GoogleMaps format is not registered`);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Creates a Google Maps layer props.
|
|
40
|
+
* @param name Name of the layer (Defaults to "GoogleMaps")
|
|
41
|
+
* @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
createMapLayerProps: (name = "GoogleMaps", opts) => {
|
|
45
|
+
GoogleMapsUtils.checkFormatRegistered();
|
|
46
|
+
return {
|
|
47
|
+
formatId: GoogleMapsMapLayerFormat.formatId,
|
|
48
|
+
url: "",
|
|
49
|
+
name,
|
|
50
|
+
properties: GoogleMapsUtils.createPropertiesFromSessionOptions(opts ?? { mapType: "satellite", language: "en-US", region: "US:", layerTypes: ["layerRoadmap"] }),
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves the maximum zoom level available within a bounding rectangle.
|
|
55
|
+
* @param rectangle The bounding rectangle
|
|
56
|
+
* @returns The maximum zoom level available within the bounding rectangle.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
getViewportInfo: async (params) => {
|
|
60
|
+
const { rectangle, session, key, zoom } = params;
|
|
61
|
+
const north = Angle.radiansToDegrees(rectangle.north);
|
|
62
|
+
const south = Angle.radiansToDegrees(rectangle.south);
|
|
63
|
+
const east = Angle.radiansToDegrees(rectangle.east);
|
|
64
|
+
const west = Angle.radiansToDegrees(rectangle.west);
|
|
65
|
+
const url = `https://tile.googleapis.com/tile/v1/viewport?session=${session}&key=${key}&zoom=${zoom}&north=${north}&south=${south}&east=${east}&west=${west}`;
|
|
66
|
+
const request = new Request(url, { method: "GET" });
|
|
67
|
+
const response = await fetch(request);
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const json = await response.json();
|
|
72
|
+
return json;
|
|
73
|
+
;
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* Converts the session options to provider properties
|
|
77
|
+
* @param opts Options to create the session
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
createPropertiesFromSessionOptions: (opts) => {
|
|
81
|
+
const properties = {
|
|
82
|
+
mapType: opts.mapType,
|
|
83
|
+
language: opts.language,
|
|
84
|
+
region: opts.region,
|
|
85
|
+
};
|
|
86
|
+
if (opts.layerTypes !== undefined) {
|
|
87
|
+
properties.layerTypes = [...opts.layerTypes];
|
|
88
|
+
}
|
|
89
|
+
if (opts.scale !== undefined) {
|
|
90
|
+
properties.scale = opts.scale;
|
|
91
|
+
}
|
|
92
|
+
if (opts.overlay !== undefined) {
|
|
93
|
+
properties.overlay = opts.overlay;
|
|
94
|
+
}
|
|
95
|
+
if (opts.apiOptions !== undefined) {
|
|
96
|
+
properties.apiOptions = [...opts.apiOptions];
|
|
97
|
+
}
|
|
98
|
+
return properties;
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=GoogleMapsUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleMapsUtils.js","sourceRoot":"","sources":["../../../src/internal/GoogleMapsUtils.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD,gBAAgB;AAChB,gEAAgE;AAChE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B;;;;;MAKE;IACF,aAAa,EAAE,KAAK,EAAE,MAAc,EAAE,IAAoC,EAA8B,EAAE;QACxG,MAAM,GAAG,GAAG,oDAAoD,MAAM,EAAE,CAAC;QAC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E,CAAC;YAC7B,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAChC,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QACpC,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAClC,UAAU,CAAC,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA","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\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { GoogleMapsMapLayerFormat } from \"../GoogleMaps/GoogleMapsImageryFormat\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerProps, MapLayerProviderProperties } from \"@itwin/core-common\";\nimport { Angle } from \"@itwin/core-geometry\";\nimport { GoogleMapsCreateSessionOptions, GoogleMapsSession, ViewportInfo, ViewportInfoRequestParams } from \"../GoogleMaps/GoogleMaps\";\n\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const GoogleMapsUtils = {\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 createSession: async (apiKey: string, opts: GoogleMapsCreateSessionOptions): Promise<GoogleMapsSession> => {\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 * Register the google maps format if it is not already registered.\n * @internal\n */\n checkFormatRegistered: () => {\n if (!IModelApp.mapLayerFormatRegistry.isRegistered(GoogleMapsMapLayerFormat.formatId)) {\n throw new Error(`GoogleMaps format is not registered`);\n }\n },\n\n /**\n * Creates a Google Maps layer props.\n * @param name Name of the layer (Defaults to \"GoogleMaps\")\n * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)\n * @internal\n*/\n createMapLayerProps: (name: string = \"GoogleMaps\", opts?: GoogleMapsCreateSessionOptions): ImageMapLayerProps => {\n GoogleMapsUtils.checkFormatRegistered();\n\n return {\n formatId: GoogleMapsMapLayerFormat.formatId,\n url: \"\",\n name,\n properties: GoogleMapsUtils.createPropertiesFromSessionOptions(opts ?? {mapType: \"satellite\", language: \"en-US\", region: \"US:\", layerTypes: [\"layerRoadmap\"]}),\n };\n },\n\n /**\n * Retrieves the maximum zoom level available within a bounding rectangle.\n * @param rectangle The bounding rectangle\n * @returns The maximum zoom level available within the bounding rectangle.\n * @internal\n */\n getViewportInfo: async (params: ViewportInfoRequestParams): Promise<ViewportInfo | undefined>=> {\n const {rectangle, session, key, zoom} = params;\n const north = Angle.radiansToDegrees(rectangle.north);\n const south = Angle.radiansToDegrees(rectangle.south);\n const east = Angle.radiansToDegrees(rectangle.east);\n const west = Angle.radiansToDegrees(rectangle.west);\n const url = `https://tile.googleapis.com/tile/v1/viewport?session=${session}&key=${key}&zoom=${zoom}&north=${north}&south=${south}&east=${east}&west=${west}`;\n const request = new Request(url, {method: \"GET\"});\n const response = await fetch (request);\n if (!response.ok) {\n return undefined;\n }\n const json = await response.json();\n return json as ViewportInfo;;\n },\n\n /**\n * Converts the session options to provider properties\n * @param opts Options to create the session\n * @internal\n */\n createPropertiesFromSessionOptions: (opts: GoogleMapsCreateSessionOptions): MapLayerProviderProperties => {\n const properties: MapLayerProviderProperties = {\n mapType: opts.mapType,\n language: opts.language,\n region: opts.region,\n }\n\n if (opts.layerTypes !== undefined) {\n properties.layerTypes = [...opts.layerTypes];\n }\n\n if (opts.scale !== undefined) {\n properties.scale = opts.scale;\n }\n\n if (opts.overlay !== undefined) {\n properties.overlay = opts.overlay;\n }\n\n if (opts.apiOptions !== undefined) {\n properties.apiOptions = [...opts.apiOptions];\n }\n\n return properties;\n },\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./mapLayersFormats";
|
|
2
2
|
export * from "./ArcGisFeature/ArcGisFeatureProvider";
|
|
3
3
|
export * from "./Tools/MapFeatureInfoTool";
|
|
4
|
+
export * from "./GoogleMaps/GoogleMaps";
|
|
4
5
|
/** @docs-package-description
|
|
5
6
|
* This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
|
|
6
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers-formats.d.ts","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":"AAKA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"map-layers-formats.d.ts","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":"AAKA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AAExC;;GAEG;AAEH;;GAEG"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export * from "./mapLayersFormats";
|
|
6
6
|
export * from "./ArcGisFeature/ArcGisFeatureProvider";
|
|
7
7
|
export * from "./Tools/MapFeatureInfoTool";
|
|
8
|
+
export * from "./GoogleMaps/GoogleMaps";
|
|
8
9
|
/** @docs-package-description
|
|
9
10
|
* This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
|
|
10
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers-formats.js","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"map-layers-formats.js","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AAExC;;GAEG;AAEH;;GAEG","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\nexport * from \"./mapLayersFormats\";\nexport * from \"./ArcGisFeature/ArcGisFeatureProvider\";\nexport * from \"./Tools/MapFeatureInfoTool\";\nexport * from \"./GoogleMaps/GoogleMaps\";\n\n/** @docs-package-description\n * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.\n */\n\n/** @docs-group-description MapLayersFormats\n * APIs for working with the map layer formats provided by this package.\n */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapLayersFormats.d.ts","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"mapLayersFormats.d.ts","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAE3B,OAAO,CAAC,MAAM,CAAC,UAAU,CAAsB;IAC/C,OAAc,YAAY,EAAE,YAAY,CAAC;IAEzC;;;OAGG;WACiB,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9E,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;CAEF"}
|
|
@@ -10,6 +10,7 @@ import { IModelApp } from "@itwin/core-frontend";
|
|
|
10
10
|
import { ArcGisFeatureMapLayerFormat } from "./ArcGisFeature/ArcGisFeatureFormat";
|
|
11
11
|
import { MapFeatureInfoTool } from "./Tools/MapFeatureInfoTool";
|
|
12
12
|
import { OgcApiFeaturesMapLayerFormat } from "./OgcApiFeatures/OgcApiFeaturesFormat";
|
|
13
|
+
import { GoogleMapsMapLayerFormat } from "./GoogleMaps/GoogleMapsImageryFormat";
|
|
13
14
|
/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
|
|
14
15
|
* @beta
|
|
15
16
|
*/
|
|
@@ -25,6 +26,7 @@ export class MapLayersFormats {
|
|
|
25
26
|
if (IModelApp.initialized) {
|
|
26
27
|
IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureMapLayerFormat);
|
|
27
28
|
IModelApp.mapLayerFormatRegistry.register(OgcApiFeaturesMapLayerFormat);
|
|
29
|
+
IModelApp.mapLayerFormatRegistry.register(GoogleMapsMapLayerFormat);
|
|
28
30
|
}
|
|
29
31
|
// register namespace containing localized strings for this package
|
|
30
32
|
MapLayersFormats.localization = config?.localization ?? IModelApp.localization;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapLayersFormats.js","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,M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,qBAAqB,CAAC,CAAC;IACtE,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,gBAAgB,CAAC,UAAU,CAAC;IACrC,CAAC","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\n/** @packageDocumentation\n * @module MapLayersFormats\n */\nimport { assert } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { ArcGisFeatureMapLayerFormat } from \"./ArcGisFeature/ArcGisFeatureFormat\";\nimport { MapFeatureInfoTool } from \"./Tools/MapFeatureInfoTool\";\nimport { Localization } from \"@itwin/core-common\";\nimport { OgcApiFeaturesMapLayerFormat } from \"./OgcApiFeatures/OgcApiFeaturesFormat\";\nimport { GoogleMapsMapLayerFormat } from \"./GoogleMaps/GoogleMapsImageryFormat\";\n\n/** Configuration options.\n * @beta\n */\nexport interface MapLayersFormatsConfig {\n localization?: Localization;\n}\n\n/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.\n * @beta\n */\nexport class MapLayersFormats {\n\n private static _defaultNs = \"mapLayersFormats\";\n public static localization: Localization;\n\n /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).\n * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).\n * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).\n */\n public static async initialize(config?: MapLayersFormatsConfig): Promise<void> {\n assert(IModelApp.initialized, \"MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown\");\n if (IModelApp.initialized) {\n IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureMapLayerFormat);\n IModelApp.mapLayerFormatRegistry.register(OgcApiFeaturesMapLayerFormat);\n IModelApp.mapLayerFormatRegistry.register(GoogleMapsMapLayerFormat);\n }\n\n // register namespace containing localized strings for this package\n MapLayersFormats.localization = config?.localization ?? IModelApp.localization;\n await MapLayersFormats.localization.registerNamespace(\n MapLayersFormats.localizationNamespace,\n );\n\n MapFeatureInfoTool.register(MapLayersFormats.localizationNamespace);\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return MapLayersFormats._defaultNs;\n }\n\n}\n"]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/map-layers-formats",
|
|
3
|
-
"version": "5.0.0-dev.
|
|
3
|
+
"version": "5.0.0-dev.69",
|
|
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",
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
"typemoq": "^2.1.0",
|
|
47
47
|
"typescript": "~5.6.2",
|
|
48
48
|
"fetch-mock": "~11.1.3",
|
|
49
|
-
"@itwin/appui-abstract": "5.0.0-dev.
|
|
50
|
-
"@itwin/
|
|
51
|
-
"@itwin/
|
|
52
|
-
"@itwin/core-
|
|
53
|
-
"@itwin/core-frontend": "5.0.0-dev.
|
|
54
|
-
"@itwin/core-
|
|
49
|
+
"@itwin/appui-abstract": "5.0.0-dev.69",
|
|
50
|
+
"@itwin/build-tools": "5.0.0-dev.69",
|
|
51
|
+
"@itwin/core-bentley": "5.0.0-dev.69",
|
|
52
|
+
"@itwin/core-common": "5.0.0-dev.69",
|
|
53
|
+
"@itwin/core-frontend": "5.0.0-dev.69",
|
|
54
|
+
"@itwin/core-geometry": "5.0.0-dev.69"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@itwin/appui-abstract": "5.0.0-dev.
|
|
58
|
-
"@itwin/core-
|
|
59
|
-
"@itwin/core-
|
|
60
|
-
"@itwin/core-
|
|
61
|
-
"@itwin/core-
|
|
57
|
+
"@itwin/appui-abstract": "5.0.0-dev.69",
|
|
58
|
+
"@itwin/core-frontend": "5.0.0-dev.69",
|
|
59
|
+
"@itwin/core-geometry": "5.0.0-dev.69",
|
|
60
|
+
"@itwin/core-bentley": "5.0.0-dev.69",
|
|
61
|
+
"@itwin/core-common": "5.0.0-dev.69"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"google-protobuf": "~3.20.1",
|