@itwin/map-layers-formats 5.0.0-dev.10 → 5.0.0-dev.102

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.
Files changed (202) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +3 -3
  3. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  4. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +4 -4
  5. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  6. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +70 -67
  7. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  8. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +17 -0
  9. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +2 -2
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +4 -2
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  14. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +1 -1
  15. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  16. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +7 -4
  17. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  18. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +2 -2
  19. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
  20. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js +3 -2
  21. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  22. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +5 -5
  23. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
  24. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js +20 -20
  25. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  26. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +3 -3
  27. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  28. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +37 -32
  29. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  30. package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts +1 -1
  31. package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts.map +1 -1
  32. package/lib/cjs/ArcGisFeature/EsriSymbology.js +28 -7
  33. package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -1
  34. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +48 -72
  35. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  36. package/lib/cjs/Feature/FeatureCanvasRenderer.d.ts +2 -2
  37. package/lib/cjs/Feature/FeatureCanvasRenderer.d.ts.map +1 -1
  38. package/lib/cjs/Feature/FeatureCanvasRenderer.js +2 -0
  39. package/lib/cjs/Feature/FeatureCanvasRenderer.js.map +1 -1
  40. package/lib/cjs/Feature/FeatureInfoReader.js +20 -20
  41. package/lib/cjs/Feature/FeatureInfoReader.js.map +1 -1
  42. package/lib/cjs/Feature/RandomMapColor.js +10 -10
  43. package/lib/cjs/Feature/RandomMapColor.js.map +1 -1
  44. package/lib/cjs/GeoJSON/GeoJSONGeometry.d.ts +1 -1
  45. package/lib/cjs/GeoJSON/GeoJSONGeometry.d.ts.map +1 -1
  46. package/lib/cjs/GeoJSON/GeoJSONGeometry.js.map +1 -1
  47. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.d.ts +1 -1
  48. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.d.ts.map +1 -1
  49. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js +5 -4
  50. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
  51. package/lib/cjs/GoogleMaps/GoogleMapDecorator.d.ts +36 -0
  52. package/lib/cjs/GoogleMaps/GoogleMapDecorator.d.ts.map +1 -0
  53. package/lib/cjs/GoogleMaps/GoogleMapDecorator.js +87 -0
  54. package/lib/cjs/GoogleMaps/GoogleMapDecorator.js.map +1 -0
  55. package/lib/cjs/GoogleMaps/GoogleMaps.d.ts +166 -0
  56. package/lib/cjs/GoogleMaps/GoogleMaps.d.ts.map +1 -0
  57. package/lib/cjs/GoogleMaps/GoogleMaps.js +56 -0
  58. package/lib/cjs/GoogleMaps/GoogleMaps.js.map +1 -0
  59. package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.d.ts +10 -0
  60. package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.d.ts.map +1 -0
  61. package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.js +20 -0
  62. package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -0
  63. package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.d.ts +25 -0
  64. package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.d.ts.map +1 -0
  65. package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.js +232 -0
  66. package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -0
  67. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js +3 -3
  68. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
  69. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.d.ts +4 -4
  70. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.d.ts.map +1 -1
  71. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js +58 -51
  72. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
  73. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.d.ts +3 -3
  74. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.d.ts.map +1 -1
  75. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js +6 -5
  76. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
  77. package/lib/cjs/Tools/GeometryTerrainDraper.d.ts +1 -1
  78. package/lib/cjs/Tools/GeometryTerrainDraper.d.ts.map +1 -1
  79. package/lib/cjs/Tools/GeometryTerrainDraper.js +13 -9
  80. package/lib/cjs/Tools/GeometryTerrainDraper.js.map +1 -1
  81. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts +1 -1
  82. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts.map +1 -1
  83. package/lib/cjs/Tools/MapFeatureInfoDecorator.js +60 -56
  84. package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -1
  85. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts +1 -1
  86. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts.map +1 -1
  87. package/lib/cjs/Tools/MapFeatureInfoTool.js +16 -19
  88. package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -1
  89. package/lib/cjs/internal/GoogleMapsUtils.d.ts +38 -0
  90. package/lib/cjs/internal/GoogleMapsUtils.d.ts.map +1 -0
  91. package/lib/cjs/internal/GoogleMapsUtils.js +104 -0
  92. package/lib/cjs/internal/GoogleMapsUtils.js.map +1 -0
  93. package/lib/cjs/map-layers-formats.d.ts +4 -3
  94. package/lib/cjs/map-layers-formats.d.ts.map +1 -1
  95. package/lib/cjs/map-layers-formats.js +4 -3
  96. package/lib/cjs/map-layers-formats.js.map +1 -1
  97. package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
  98. package/lib/cjs/mapLayersFormats.js +10 -7
  99. package/lib/cjs/mapLayersFormats.js.map +1 -1
  100. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +2 -2
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +4 -4
  103. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  104. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +52 -49
  105. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  106. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +17 -0
  107. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  108. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +2 -2
  109. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  110. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +3 -1
  111. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  112. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +1 -1
  113. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  114. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +5 -2
  115. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  116. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +2 -2
  117. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
  118. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js +2 -1
  119. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  120. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +5 -5
  121. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
  122. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js +2 -2
  123. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  124. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +3 -3
  125. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  126. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +37 -32
  127. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  128. package/lib/esm/ArcGisFeature/EsriSymbology.d.ts +1 -1
  129. package/lib/esm/ArcGisFeature/EsriSymbology.d.ts.map +1 -1
  130. package/lib/esm/ArcGisFeature/EsriSymbology.js +27 -6
  131. package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -1
  132. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +48 -72
  133. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  134. package/lib/esm/Feature/FeatureCanvasRenderer.d.ts +2 -2
  135. package/lib/esm/Feature/FeatureCanvasRenderer.d.ts.map +1 -1
  136. package/lib/esm/Feature/FeatureCanvasRenderer.js +2 -0
  137. package/lib/esm/Feature/FeatureCanvasRenderer.js.map +1 -1
  138. package/lib/esm/Feature/FeatureInfoReader.js +20 -20
  139. package/lib/esm/Feature/FeatureInfoReader.js.map +1 -1
  140. package/lib/esm/Feature/RandomMapColor.js +10 -10
  141. package/lib/esm/Feature/RandomMapColor.js.map +1 -1
  142. package/lib/esm/GeoJSON/GeoJSONGeometry.d.ts +1 -1
  143. package/lib/esm/GeoJSON/GeoJSONGeometry.d.ts.map +1 -1
  144. package/lib/esm/GeoJSON/GeoJSONGeometry.js.map +1 -1
  145. package/lib/esm/GeoJSON/GeoJSONGeometryReader.d.ts +1 -1
  146. package/lib/esm/GeoJSON/GeoJSONGeometryReader.d.ts.map +1 -1
  147. package/lib/esm/GeoJSON/GeoJSONGeometryReader.js +2 -1
  148. package/lib/esm/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
  149. package/lib/esm/GoogleMaps/GoogleMapDecorator.d.ts +36 -0
  150. package/lib/esm/GoogleMaps/GoogleMapDecorator.d.ts.map +1 -0
  151. package/lib/esm/GoogleMaps/GoogleMapDecorator.js +82 -0
  152. package/lib/esm/GoogleMaps/GoogleMapDecorator.js.map +1 -0
  153. package/lib/esm/GoogleMaps/GoogleMaps.d.ts +166 -0
  154. package/lib/esm/GoogleMaps/GoogleMaps.d.ts.map +1 -0
  155. package/lib/esm/GoogleMaps/GoogleMaps.js +53 -0
  156. package/lib/esm/GoogleMaps/GoogleMaps.js.map +1 -0
  157. package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.d.ts +10 -0
  158. package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.d.ts.map +1 -0
  159. package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.js +16 -0
  160. package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -0
  161. package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.d.ts +25 -0
  162. package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.d.ts.map +1 -0
  163. package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js +228 -0
  164. package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -0
  165. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js +2 -2
  166. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
  167. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.d.ts +4 -4
  168. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.d.ts.map +1 -1
  169. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js +49 -42
  170. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
  171. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.d.ts +3 -3
  172. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.d.ts.map +1 -1
  173. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js +3 -2
  174. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
  175. package/lib/esm/Tools/GeometryTerrainDraper.d.ts +1 -1
  176. package/lib/esm/Tools/GeometryTerrainDraper.d.ts.map +1 -1
  177. package/lib/esm/Tools/GeometryTerrainDraper.js +11 -7
  178. package/lib/esm/Tools/GeometryTerrainDraper.js.map +1 -1
  179. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts +1 -1
  180. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts.map +1 -1
  181. package/lib/esm/Tools/MapFeatureInfoDecorator.js +58 -54
  182. package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -1
  183. package/lib/esm/Tools/MapFeatureInfoTool.d.ts +1 -1
  184. package/lib/esm/Tools/MapFeatureInfoTool.d.ts.map +1 -1
  185. package/lib/esm/Tools/MapFeatureInfoTool.js +16 -19
  186. package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -1
  187. package/lib/esm/internal/GoogleMapsUtils.d.ts +38 -0
  188. package/lib/esm/internal/GoogleMapsUtils.d.ts.map +1 -0
  189. package/lib/esm/internal/GoogleMapsUtils.js +101 -0
  190. package/lib/esm/internal/GoogleMapsUtils.js.map +1 -0
  191. package/lib/esm/map-layers-formats.d.ts +4 -3
  192. package/lib/esm/map-layers-formats.d.ts.map +1 -1
  193. package/lib/esm/map-layers-formats.js +4 -3
  194. package/lib/esm/map-layers-formats.js.map +1 -1
  195. package/lib/esm/mapLayersFormats.d.ts.map +1 -1
  196. package/lib/esm/mapLayersFormats.js +7 -4
  197. package/lib/esm/mapLayersFormats.js.map +1 -1
  198. package/lib/public/images/google_on_non_white.png +0 -0
  199. package/lib/public/images/google_on_non_white_hdpi.png +0 -0
  200. package/lib/public/images/google_on_white.png +0 -0
  201. package/lib/public/images/google_on_white_hdpi.png +0 -0
  202. package/package.json +31 -27
@@ -0,0 +1,38 @@
1
+ import { ImageMapLayerProps, MapLayerProviderProperties } from "@itwin/core-common";
2
+ import { GoogleMapsCreateSessionOptions, GoogleMapsSession, ViewportInfo, ViewportInfoRequestParams } from "../GoogleMaps/GoogleMaps.js";
3
+ /** @internal */
4
+ export declare const GoogleMapsUtils: {
5
+ /**
6
+ * Creates a Google Maps session.
7
+ * @param apiKey Google Cloud API key
8
+ * @param opts Options to create the session
9
+ * @internal
10
+ */
11
+ createSession: (apiKey: string, opts: GoogleMapsCreateSessionOptions) => Promise<GoogleMapsSession>;
12
+ /**
13
+ * Register the google maps format if it is not already registered.
14
+ * @internal
15
+ */
16
+ checkFormatRegistered: () => void;
17
+ /**
18
+ * Creates a Google Maps layer props.
19
+ * @param name Name of the layer (Defaults to "GoogleMaps")
20
+ * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)
21
+ * @internal
22
+ */
23
+ createMapLayerProps: (name?: string, opts?: GoogleMapsCreateSessionOptions) => ImageMapLayerProps;
24
+ /**
25
+ * Retrieves the maximum zoom level available within a bounding rectangle.
26
+ * @param rectangle The bounding rectangle
27
+ * @returns The maximum zoom level available within the bounding rectangle.
28
+ * @internal
29
+ */
30
+ getViewportInfo: (params: ViewportInfoRequestParams) => Promise<ViewportInfo | undefined>;
31
+ /**
32
+ * Converts the session options to provider properties
33
+ * @param opts Options to create the session
34
+ * @internal
35
+ */
36
+ createPropertiesFromSessionOptions: (opts: GoogleMapsCreateSessionOptions) => MapLayerProviderProperties;
37
+ };
38
+ //# sourceMappingURL=GoogleMapsUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleMapsUtils.d.ts","sourceRoot":"","sources":["../../../src/internal/GoogleMapsUtils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGpF,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAKzI,gBAAgB;AAEhB,eAAO,MAAM,eAAe;IAC1B;;;;;MAKE;4BAC4B,MAAM,QAAQ,8BAA8B,KAAG,OAAO,CAAC,iBAAiB,CAAC;IAWvG;;;MAGE;;IAOF;;;;;IAKA;iCAC4B,MAAM,SAAwB,8BAA8B,KAAG,kBAAkB;IAW7G;;;;;MAKE;8BAC8B,yBAAyB,KAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAgB3F;;;;IAIA;+CACyC,8BAA8B,KAAG,0BAA0B;CAyBvG,CAAA"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.GoogleMapsUtils = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const core_frontend_1 = require("@itwin/core-frontend");
10
+ const core_geometry_1 = require("@itwin/core-geometry");
11
+ const GoogleMapsImageryFormat_js_1 = require("../GoogleMaps/GoogleMapsImageryFormat.js");
12
+ const loggerCategory = "MapLayersFormats.GoogleMaps";
13
+ /** @internal */
14
+ // eslint-disable-next-line @typescript-eslint/naming-convention
15
+ exports.GoogleMapsUtils = {
16
+ /**
17
+ * Creates a Google Maps session.
18
+ * @param apiKey Google Cloud API key
19
+ * @param opts Options to create the session
20
+ * @internal
21
+ */
22
+ createSession: async (apiKey, opts) => {
23
+ const url = `https://tile.googleapis.com/v1/createSession?key=${apiKey}`;
24
+ const request = new Request(url, { method: "POST", body: JSON.stringify(opts) });
25
+ const response = await fetch(request);
26
+ if (!response.ok) {
27
+ throw new Error(`CreateSession request failed: ${response.status} - ${response.statusText}`);
28
+ }
29
+ core_bentley_1.Logger.logInfo(loggerCategory, `Session created successfully`);
30
+ return response.json();
31
+ },
32
+ /**
33
+ * Register the google maps format if it is not already registered.
34
+ * @internal
35
+ */
36
+ checkFormatRegistered: () => {
37
+ if (!core_frontend_1.IModelApp.mapLayerFormatRegistry.isRegistered(GoogleMapsImageryFormat_js_1.GoogleMapsMapLayerFormat.formatId)) {
38
+ throw new Error(`GoogleMaps format is not registered`);
39
+ }
40
+ },
41
+ /**
42
+ * Creates a Google Maps layer props.
43
+ * @param name Name of the layer (Defaults to "GoogleMaps")
44
+ * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)
45
+ * @internal
46
+ */
47
+ createMapLayerProps: (name = "GoogleMaps", opts) => {
48
+ exports.GoogleMapsUtils.checkFormatRegistered();
49
+ return {
50
+ formatId: GoogleMapsImageryFormat_js_1.GoogleMapsMapLayerFormat.formatId,
51
+ url: "",
52
+ name,
53
+ properties: exports.GoogleMapsUtils.createPropertiesFromSessionOptions(opts ?? { mapType: "satellite", language: "en-US", region: "US:", layerTypes: ["layerRoadmap"] }),
54
+ };
55
+ },
56
+ /**
57
+ * Retrieves the maximum zoom level available within a bounding rectangle.
58
+ * @param rectangle The bounding rectangle
59
+ * @returns The maximum zoom level available within the bounding rectangle.
60
+ * @internal
61
+ */
62
+ getViewportInfo: async (params) => {
63
+ const { rectangle, session, key, zoom } = params;
64
+ const north = core_geometry_1.Angle.radiansToDegrees(rectangle.north);
65
+ const south = core_geometry_1.Angle.radiansToDegrees(rectangle.south);
66
+ const east = core_geometry_1.Angle.radiansToDegrees(rectangle.east);
67
+ const west = core_geometry_1.Angle.radiansToDegrees(rectangle.west);
68
+ const url = `https://tile.googleapis.com/tile/v1/viewport?session=${session}&key=${key}&zoom=${zoom}&north=${north}&south=${south}&east=${east}&west=${west}`;
69
+ const request = new Request(url, { method: "GET" });
70
+ const response = await fetch(request);
71
+ if (!response.ok) {
72
+ return undefined;
73
+ }
74
+ const json = await response.json();
75
+ return json;
76
+ ;
77
+ },
78
+ /**
79
+ * Converts the session options to provider properties
80
+ * @param opts Options to create the session
81
+ * @internal
82
+ */
83
+ createPropertiesFromSessionOptions: (opts) => {
84
+ const properties = {
85
+ mapType: opts.mapType,
86
+ language: opts.language,
87
+ region: opts.region,
88
+ };
89
+ if (opts.layerTypes !== undefined) {
90
+ properties.layerTypes = [...opts.layerTypes];
91
+ }
92
+ if (opts.scale !== undefined) {
93
+ properties.scale = opts.scale;
94
+ }
95
+ if (opts.overlay !== undefined) {
96
+ properties.overlay = opts.overlay;
97
+ }
98
+ if (opts.apiOptions !== undefined) {
99
+ properties.apiOptions = [...opts.apiOptions];
100
+ }
101
+ return properties;
102
+ },
103
+ };
104
+ //# 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,sDAA6C;AAE7C,wDAAiD;AACjD,wDAA6C;AAE7C,yFAAoF;AAEpF,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD,gBAAgB;AAChB,gEAAgE;AACnD,QAAA,eAAe,GAAG;IAC7B;;;;;MAKE;IACF,aAAa,EAAE,KAAK,EAAE,MAAc,EAAE,IAAoC,EAA8B,EAAE;QACxG,MAAM,GAAG,GAAG,oDAAoD,MAAM,EAAE,CAAC;QACzE,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;QAC/E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAE,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,iCAAiC,QAAQ,CAAC,MAAM,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QAC/F,CAAC;QACD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED;;;MAGE;IACF,qBAAqB,EAAE,GAAG,EAAE;QAC1B,IAAI,CAAC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AAM,EAAE,KAAK,EAAC,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAE,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,IAAoB,CAAC;QAAA,CAAC;IAC/B,CAAC;IAEC;;;;IAIA;IACF,kCAAkC,EAAE,CAAC,IAAoC,EAA8B,EAAE;QACvG,MAAM,UAAU,GAA+B;YAC7C,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;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,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { ImageMapLayerProps, MapLayerProviderProperties } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { Angle } from \"@itwin/core-geometry\";\r\nimport { GoogleMapsCreateSessionOptions, GoogleMapsSession, ViewportInfo, ViewportInfoRequestParams } from \"../GoogleMaps/GoogleMaps.js\";\r\nimport { GoogleMapsMapLayerFormat } from \"../GoogleMaps/GoogleMapsImageryFormat.js\";\r\n\r\nconst loggerCategory = \"MapLayersFormats.GoogleMaps\";\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const GoogleMapsUtils = {\r\n /**\r\n * Creates a Google Maps session.\r\n * @param apiKey Google Cloud API key\r\n * @param opts Options to create the session\r\n * @internal\r\n */\r\n createSession: async (apiKey: string, opts: GoogleMapsCreateSessionOptions): Promise<GoogleMapsSession> => {\r\n const url = `https://tile.googleapis.com/v1/createSession?key=${apiKey}`;\r\n const request = new Request(url, {method: \"POST\", body: JSON.stringify(opts)});\r\n const response = await fetch (request);\r\n if (!response.ok) {\r\n throw new Error(`CreateSession request failed: ${response.status} - ${response.statusText}`);\r\n }\r\n Logger.logInfo(loggerCategory, `Session created successfully`);\r\n return response.json();\r\n },\r\n\r\n /**\r\n * Register the google maps format if it is not already registered.\r\n * @internal\r\n */\r\n checkFormatRegistered: () => {\r\n if (!IModelApp.mapLayerFormatRegistry.isRegistered(GoogleMapsMapLayerFormat.formatId)) {\r\n throw new Error(`GoogleMaps format is not registered`);\r\n }\r\n },\r\n\r\n /**\r\n * Creates a Google Maps layer props.\r\n * @param name Name of the layer (Defaults to \"GoogleMaps\")\r\n * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)\r\n * @internal\r\n*/\r\n createMapLayerProps: (name: string = \"GoogleMaps\", opts?: GoogleMapsCreateSessionOptions): ImageMapLayerProps => {\r\n GoogleMapsUtils.checkFormatRegistered();\r\n\r\n return {\r\n formatId: GoogleMapsMapLayerFormat.formatId,\r\n url: \"\",\r\n name,\r\n properties: GoogleMapsUtils.createPropertiesFromSessionOptions(opts ?? {mapType: \"satellite\", language: \"en-US\", region: \"US:\", layerTypes: [\"layerRoadmap\"]}),\r\n };\r\n },\r\n\r\n /**\r\n * Retrieves the maximum zoom level available within a bounding rectangle.\r\n * @param rectangle The bounding rectangle\r\n * @returns The maximum zoom level available within the bounding rectangle.\r\n * @internal\r\n */\r\n getViewportInfo: async (params: ViewportInfoRequestParams): Promise<ViewportInfo | undefined>=> {\r\n const {rectangle, session, key, zoom} = params;\r\n const north = Angle.radiansToDegrees(rectangle.north);\r\n const south = Angle.radiansToDegrees(rectangle.south);\r\n const east = Angle.radiansToDegrees(rectangle.east);\r\n const west = Angle.radiansToDegrees(rectangle.west);\r\n const url = `https://tile.googleapis.com/tile/v1/viewport?session=${session}&key=${key}&zoom=${zoom}&north=${north}&south=${south}&east=${east}&west=${west}`;\r\n const request = new Request(url, {method: \"GET\"});\r\n const response = await fetch (request);\r\n if (!response.ok) {\r\n return undefined;\r\n }\r\n const json = await response.json();\r\n return json as ViewportInfo;;\r\n },\r\n\r\n /**\r\n * Converts the session options to provider properties\r\n * @param opts Options to create the session\r\n * @internal\r\n */\r\n createPropertiesFromSessionOptions: (opts: GoogleMapsCreateSessionOptions): MapLayerProviderProperties => {\r\n const properties: MapLayerProviderProperties = {\r\n mapType: opts.mapType,\r\n language: opts.language,\r\n region: opts.region,\r\n }\r\n\r\n if (opts.layerTypes !== undefined) {\r\n properties.layerTypes = [...opts.layerTypes];\r\n }\r\n\r\n if (opts.scale !== undefined) {\r\n properties.scale = opts.scale;\r\n }\r\n\r\n if (opts.overlay !== undefined) {\r\n properties.overlay = opts.overlay;\r\n }\r\n\r\n if (opts.apiOptions !== undefined) {\r\n properties.apiOptions = [...opts.apiOptions];\r\n }\r\n\r\n return properties;\r\n },\r\n}\r\n"]}
@@ -1,6 +1,7 @@
1
- export * from "./mapLayersFormats";
2
- export * from "./ArcGisFeature/ArcGisFeatureProvider";
3
- export * from "./Tools/MapFeatureInfoTool";
1
+ export * from "./ArcGisFeature/ArcGisFeatureProvider.js";
2
+ export * from "./GoogleMaps/GoogleMaps.js";
3
+ export * from "./mapLayersFormats.js";
4
+ export * from "./Tools/MapFeatureInfoTool.js";
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;AAE3C;;GAEG;AAEH;;GAEG"}
1
+ {"version":3,"file":"map-layers-formats.d.ts","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":"AAKA,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAE9C;;GAEG;AAEH;;GAEG"}
@@ -18,9 +18,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- __exportStar(require("./mapLayersFormats"), exports);
22
- __exportStar(require("./ArcGisFeature/ArcGisFeatureProvider"), exports);
23
- __exportStar(require("./Tools/MapFeatureInfoTool"), exports);
21
+ __exportStar(require("./ArcGisFeature/ArcGisFeatureProvider.js"), exports);
22
+ __exportStar(require("./GoogleMaps/GoogleMaps.js"), exports);
23
+ __exportStar(require("./mapLayersFormats.js"), exports);
24
+ __exportStar(require("./Tools/MapFeatureInfoTool.js"), exports);
24
25
  /** @docs-package-description
25
26
  * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
26
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"map-layers-formats.js","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,qDAAmC;AACnC,wEAAsD;AACtD,6DAA2C;AAE3C;;GAEG;AAEH;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./mapLayersFormats\";\r\nexport * from \"./ArcGisFeature/ArcGisFeatureProvider\";\r\nexport * from \"./Tools/MapFeatureInfoTool\";\r\n\r\n/** @docs-package-description\r\n * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.\r\n */\r\n\r\n/** @docs-group-description MapLayersFormats\r\n * APIs for working with the map layer formats provided by this package.\r\n */\r\n"]}
1
+ {"version":3,"file":"map-layers-formats.js","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,2EAAyD;AACzD,6DAA2C;AAC3C,wDAAsC;AACtC,gEAA8C;AAE9C;;GAEG;AAEH;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./ArcGisFeature/ArcGisFeatureProvider.js\";\r\nexport * from \"./GoogleMaps/GoogleMaps.js\";\r\nexport * from \"./mapLayersFormats.js\";\r\nexport * from \"./Tools/MapFeatureInfoTool.js\";\r\n\r\n/** @docs-package-description\r\n * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.\r\n */\r\n\r\n/** @docs-group-description MapLayersFormats\r\n * APIs for working with the map layer formats provided by this package.\r\n */\r\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;AAGlD;;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;IAgB9E,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;CAEF"}
1
+ {"version":3,"file":"mapLayersFormats.d.ts","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOlD;;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,13 +10,16 @@ exports.MapLayersFormats = void 0;
10
10
  */
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_frontend_1 = require("@itwin/core-frontend");
13
- const ArcGisFeatureFormat_1 = require("./ArcGisFeature/ArcGisFeatureFormat");
14
- const MapFeatureInfoTool_1 = require("./Tools/MapFeatureInfoTool");
15
- const OgcApiFeaturesFormat_1 = require("./OgcApiFeatures/OgcApiFeaturesFormat");
13
+ const ArcGisFeatureFormat_js_1 = require("./ArcGisFeature/ArcGisFeatureFormat.js");
14
+ const GoogleMapsImageryFormat_js_1 = require("./GoogleMaps/GoogleMapsImageryFormat.js");
15
+ const OgcApiFeaturesFormat_js_1 = require("./OgcApiFeatures/OgcApiFeaturesFormat.js");
16
+ const MapFeatureInfoTool_js_1 = require("./Tools/MapFeatureInfoTool.js");
16
17
  /** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
17
18
  * @beta
18
19
  */
19
20
  class MapLayersFormats {
21
+ static _defaultNs = "mapLayersFormats";
22
+ static localization;
20
23
  /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
21
24
  * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
22
25
  * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
@@ -24,13 +27,14 @@ class MapLayersFormats {
24
27
  static async initialize(config) {
25
28
  (0, core_bentley_1.assert)(core_frontend_1.IModelApp.initialized, "MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown");
26
29
  if (core_frontend_1.IModelApp.initialized) {
27
- core_frontend_1.IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat);
28
- core_frontend_1.IModelApp.mapLayerFormatRegistry.register(OgcApiFeaturesFormat_1.OgcApiFeaturesMapLayerFormat);
30
+ core_frontend_1.IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureFormat_js_1.ArcGisFeatureMapLayerFormat);
31
+ core_frontend_1.IModelApp.mapLayerFormatRegistry.register(OgcApiFeaturesFormat_js_1.OgcApiFeaturesMapLayerFormat);
32
+ core_frontend_1.IModelApp.mapLayerFormatRegistry.register(GoogleMapsImageryFormat_js_1.GoogleMapsMapLayerFormat);
29
33
  }
30
34
  // register namespace containing localized strings for this package
31
35
  MapLayersFormats.localization = config?.localization ?? core_frontend_1.IModelApp.localization;
32
36
  await MapLayersFormats.localization.registerNamespace(MapLayersFormats.localizationNamespace);
33
- MapFeatureInfoTool_1.MapFeatureInfoTool.register(MapLayersFormats.localizationNamespace);
37
+ MapFeatureInfoTool_js_1.MapFeatureInfoTool.register(MapLayersFormats.localizationNamespace);
34
38
  }
35
39
  /** The internationalization service namespace. */
36
40
  static get localizationNamespace() {
@@ -38,5 +42,4 @@ class MapLayersFormats {
38
42
  }
39
43
  }
40
44
  exports.MapLayersFormats = MapLayersFormats;
41
- MapLayersFormats._defaultNs = "mapLayersFormats";
42
45
  //# sourceMappingURL=mapLayersFormats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapLayersFormats.js","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sDAA6C;AAC7C,wDAAiD;AACjD,6EAAkF;AAClF,mEAAgE;AAEhE,gFAAqF;AASrF;;GAEG;AACH,MAAa,gBAAgB;IAK3B;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAA+B;QAC5D,IAAA,qBAAM,EAAC,yBAAS,CAAC,WAAW,EAAE,kGAAkG,CAAC,CAAC;QAClI,IAAI,yBAAS,CAAC,WAAW,EAAE,CAAC;YAC1B,yBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,iDAA2B,CAAC,CAAC;YACvE,yBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,mDAA4B,CAAC,CAAC;QAC1E,CAAC;QAED,mEAAmE;QACnE,gBAAgB,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,yBAAS,CAAC,YAAY,CAAC;QAC/E,MAAM,gBAAgB,CAAC,YAAY,CAAC,iBAAiB,CACnD,gBAAgB,CAAC,qBAAqB,CACvC,CAAC;QAEF,uCAAkB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IACtE,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,gBAAgB,CAAC,UAAU,CAAC;IACrC,CAAC;;AA5BH,4CA8BC;AA5BgB,2BAAU,GAAG,kBAAkB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module MapLayersFormats\r\n */\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { ArcGisFeatureMapLayerFormat } from \"./ArcGisFeature/ArcGisFeatureFormat\";\r\nimport { MapFeatureInfoTool } from \"./Tools/MapFeatureInfoTool\";\r\nimport { Localization } from \"@itwin/core-common\";\r\nimport { OgcApiFeaturesMapLayerFormat } from \"./OgcApiFeatures/OgcApiFeaturesFormat\";\r\n\r\n/** Configuration options.\r\n * @beta\r\n */\r\nexport interface MapLayersFormatsConfig {\r\n localization?: Localization;\r\n}\r\n\r\n/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.\r\n * @beta\r\n */\r\nexport class MapLayersFormats {\r\n\r\n private static _defaultNs = \"mapLayersFormats\";\r\n public static localization: Localization;\r\n\r\n /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).\r\n * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).\r\n * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).\r\n */\r\n public static async initialize(config?: MapLayersFormatsConfig): Promise<void> {\r\n assert(IModelApp.initialized, \"MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown\");\r\n if (IModelApp.initialized) {\r\n IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureMapLayerFormat);\r\n IModelApp.mapLayerFormatRegistry.register(OgcApiFeaturesMapLayerFormat);\r\n }\r\n\r\n // register namespace containing localized strings for this package\r\n MapLayersFormats.localization = config?.localization ?? IModelApp.localization;\r\n await MapLayersFormats.localization.registerNamespace(\r\n MapLayersFormats.localizationNamespace,\r\n );\r\n\r\n MapFeatureInfoTool.register(MapLayersFormats.localizationNamespace);\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return MapLayersFormats._defaultNs;\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"mapLayersFormats.js","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sDAA6C;AAE7C,wDAAiD;AACjD,mFAAqF;AACrF,wFAAmF;AACnF,sFAAwF;AACxF,yEAAmE;AASnE;;GAEG;AACH,MAAa,gBAAgB;IAEnB,MAAM,CAAC,UAAU,GAAG,kBAAkB,CAAC;IACxC,MAAM,CAAC,YAAY,CAAe;IAEzC;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAA+B;QAC5D,IAAA,qBAAM,EAAC,yBAAS,CAAC,WAAW,EAAE,kGAAkG,CAAC,CAAC;QAClI,IAAI,yBAAS,CAAC,WAAW,EAAE,CAAC;YAC1B,yBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,oDAA2B,CAAC,CAAC;YACvE,yBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,sDAA4B,CAAC,CAAC;YACxE,yBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,qDAAwB,CAAC,CAAC;QACtE,CAAC;QAED,mEAAmE;QACnE,gBAAgB,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,yBAAS,CAAC,YAAY,CAAC;QAC/E,MAAM,gBAAgB,CAAC,YAAY,CAAC,iBAAiB,CACnD,gBAAgB,CAAC,qBAAqB,CACvC,CAAC;QAEF,0CAAkB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IACtE,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,gBAAgB,CAAC,UAAU,CAAC;IACrC,CAAC;;AA7BH,4CA+BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module MapLayersFormats\r\n */\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Localization } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { ArcGisFeatureMapLayerFormat } from \"./ArcGisFeature/ArcGisFeatureFormat.js\";\r\nimport { GoogleMapsMapLayerFormat } from \"./GoogleMaps/GoogleMapsImageryFormat.js\";\r\nimport { OgcApiFeaturesMapLayerFormat } from \"./OgcApiFeatures/OgcApiFeaturesFormat.js\";\r\nimport { MapFeatureInfoTool } from \"./Tools/MapFeatureInfoTool.js\";\r\n\r\n/** Configuration options.\r\n * @beta\r\n */\r\nexport interface MapLayersFormatsConfig {\r\n localization?: Localization;\r\n}\r\n\r\n/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.\r\n * @beta\r\n */\r\nexport class MapLayersFormats {\r\n\r\n private static _defaultNs = \"mapLayersFormats\";\r\n public static localization: Localization;\r\n\r\n /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).\r\n * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).\r\n * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).\r\n */\r\n public static async initialize(config?: MapLayersFormatsConfig): Promise<void> {\r\n assert(IModelApp.initialized, \"MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown\");\r\n if (IModelApp.initialized) {\r\n IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureMapLayerFormat);\r\n IModelApp.mapLayerFormatRegistry.register(OgcApiFeaturesMapLayerFormat);\r\n IModelApp.mapLayerFormatRegistry.register(GoogleMapsMapLayerFormat);\r\n }\r\n\r\n // register namespace containing localized strings for this package\r\n MapLayersFormats.localization = config?.localization ?? IModelApp.localization;\r\n await MapLayersFormats.localization.registerNamespace(\r\n MapLayersFormats.localizationNamespace,\r\n );\r\n\r\n MapFeatureInfoTool.register(MapLayersFormats.localizationNamespace);\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return MapLayersFormats._defaultNs;\r\n }\r\n\r\n}\r\n"]}
@@ -1,7 +1,8 @@
1
1
  import { ArcGisUtilities, ImageryMapLayerFormat, MapLayerSource, MapLayerSourceStatus } from "@itwin/core-frontend";
2
- import { ArcGisFeatureProvider } from "./ArcGisFeatureProvider";
2
+ import { ArcGisFeatureProvider } from "./ArcGisFeatureProvider.js";
3
3
  /** @internal */
4
4
  export class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {
5
+ static formatId = "ArcGISFeature";
5
6
  static createImageryProvider(settings) { return new ArcGisFeatureProvider(settings); }
6
7
  static async validateSource(url, userName, password, ignoreCache) {
7
8
  const urlValidation = ArcGisUtilities.validateUrl(url, "FeatureServer");
@@ -22,5 +23,4 @@ export class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {
22
23
  return ArcGisUtilities.validateSource({ ...args, capabilitiesFilter: ["query"] });
23
24
  }
24
25
  }
25
- ArcGisFeatureMapLayerFormat.formatId = "ArcGISFeature";
26
26
  //# sourceMappingURL=ArcGisFeatureFormat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArcGisFeatureFormat.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureFormat.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAA2B,cAAc,EAAE,oBAAoB,EAAgD,MAAM,sBAAsB,CAAC;AAC3L,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,gBAAgB;AAChB,MAAM,OAAO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xBsB,oCAAQ,GAAG,eAAe,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisUtilities, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerSourceValidation, ValidateSourceArgs } from \"@itwin/core-frontend\";\r\nimport { ArcGisFeatureProvider } from \"./ArcGisFeatureProvider\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {\r\n public static override formatId = \"ArcGISFeature\";\r\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined { return new ArcGisFeatureProvider(settings); }\r\n public static override async validateSource(url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\r\n const urlValidation = ArcGisUtilities.validateUrl(url, \"FeatureServer\");\r\n if (urlValidation !== MapLayerSourceStatus.Valid)\r\n return { status: urlValidation };\r\n\r\n const source = MapLayerSource.fromJSON({name: \"\", url, formatId: this.formatId});\r\n if (!source)\r\n return {status: MapLayerSourceStatus.InvalidFormat};\r\n source.userName = userName;\r\n source.password = password;\r\n\r\n return ArcGisUtilities.validateSource({source, capabilitiesFilter: [\"query\"], ignoreCache});\r\n }\r\n\r\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\r\n\r\n const urlValidation = ArcGisUtilities.validateUrl(args.source.url, \"FeatureServer\");\r\n if (urlValidation !== MapLayerSourceStatus.Valid)\r\n return {status: urlValidation};\r\n\r\n // Some Map service supporting only tiles don't include the 'Map' capabilities, thus we can't make it mandatory.\r\n return ArcGisUtilities.validateSource({...args, capabilitiesFilter: [\"query\"]});\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ArcGisFeatureFormat.js","sourceRoot":"","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C,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACpF,IAAI,aAAa,KAAK,oBAAoB,CAAC,KAAK;YAC9C,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,CAAC;QAEjC,gHAAgH;QAChH,OAAO,eAAe,CAAC,cAAc,CAAC,EAAC,GAAG,IAAI,EAAE,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAC,CAAC,CAAC;IAClF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisUtilities, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerSourceValidation, ValidateSourceArgs } from \"@itwin/core-frontend\";\r\nimport { ArcGisFeatureProvider } from \"./ArcGisFeatureProvider.js\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {\r\n public static override formatId = \"ArcGISFeature\";\r\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined { return new ArcGisFeatureProvider(settings); }\r\n public static override async validateSource(url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\r\n const urlValidation = ArcGisUtilities.validateUrl(url, \"FeatureServer\");\r\n if (urlValidation !== MapLayerSourceStatus.Valid)\r\n return { status: urlValidation };\r\n\r\n const source = MapLayerSource.fromJSON({name: \"\", url, formatId: this.formatId});\r\n if (!source)\r\n return {status: MapLayerSourceStatus.InvalidFormat};\r\n source.userName = userName;\r\n source.password = password;\r\n\r\n return ArcGisUtilities.validateSource({source, capabilitiesFilter: [\"query\"], ignoreCache});\r\n }\r\n\r\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\r\n\r\n const urlValidation = ArcGisUtilities.validateUrl(args.source.url, \"FeatureServer\");\r\n if (urlValidation !== MapLayerSourceStatus.Valid)\r\n return {status: urlValidation};\r\n\r\n // Some Map service supporting only tiles don't include the 'Map' capabilities, thus we can't make it mandatory.\r\n return ArcGisUtilities.validateSource({...args, capabilitiesFilter: [\"query\"]});\r\n }\r\n}\r\n"]}
@@ -1,9 +1,9 @@
1
1
  import { Cartographic, ImageMapLayerSettings, ImageSource } from "@itwin/core-common";
2
- import { Transform } from "@itwin/core-geometry";
3
2
  import { ArcGISImageryProvider, HitDetail, ImageryMapTileTree, MapFeatureInfoOptions, MapLayerFeatureInfo, QuadId } from "@itwin/core-frontend";
4
- import { ArcGisExtent, ArcGisFeatureFormat, ArcGisFeatureResultType, ArcGisGeometry } from "./ArcGisFeatureQuery";
5
- import { EsriPMS, EsriSFS, EsriSLS, EsriSLSProps, EsriSymbol } from "./EsriSymbology";
6
- import { FeatureDefaultSymbology } from "../Feature/FeatureSymbology";
3
+ import { Transform } from "@itwin/core-geometry";
4
+ import { FeatureDefaultSymbology } from "../Feature/FeatureSymbology.js";
5
+ import { ArcGisExtent, ArcGisFeatureFormat, ArcGisFeatureResultType, ArcGisGeometry } from "./ArcGisFeatureQuery.js";
6
+ import { EsriPMS, EsriSFS, EsriSLS, EsriSLSProps, EsriSymbol } from "./EsriSymbology.js";
7
7
  /**
8
8
  * @internal
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ArcGisFeatureProvider.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAkC,MAAM,oBAAoB,CAAC;AAEtH,OAAO,EAA8B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAmB,qBAAqB,EAAmE,SAAS,EAAE,kBAAkB,EAAqB,qBAAqB,EAAE,mBAAmB,EAAiC,MAAM,EAAqB,MAAM,sBAAsB,CAAC;AACvS,OAAO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EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;YA+E3L,SAAS;IAkBhB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB;IAU1G,SAAS,CAAC,gCAAgC,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAsBnE,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;CAgHjH"}
@@ -2,81 +2,86 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- var _a;
6
- import { ImageSource, ImageSourceFormat, ServerError } from "@itwin/core-common";
7
5
  import { base64StringToUint8Array, IModelStatus, Logger } from "@itwin/core-bentley";
8
- import { Matrix4d, Point3d, Range2d } from "@itwin/core-geometry";
6
+ import { ImageSource, ImageSourceFormat, ServerError } from "@itwin/core-common";
9
7
  import { ArcGisErrorCode, ArcGISImageryProvider, ArcGisUtilities, FeatureGraphicsRenderer, MapCartoRectangle, MapLayerImageryProviderStatus, setRequestTimeout } from "@itwin/core-frontend";
10
- import { arcgisFeatureFormats, ArcGisFeatureQuery } from "./ArcGisFeatureQuery";
11
- import { ArcGisPbfFeatureReader } from "./ArcGisPbfFeatureReader";
12
- import { ArcGisJsonFeatureReader } from "./ArcGisJsonFeatureReader";
13
- import { ArcGisFeatureResponse } from "./ArcGisFeatureResponse";
14
- import { EsriPMS, EsriRenderer, EsriSFS, EsriSLS } from "./EsriSymbology";
15
- import { FeatureCanvasRenderer } from "../Feature/FeatureCanvasRenderer";
16
- import { ArcGisSymbologyCanvasRenderer } from "./ArcGisSymbologyRenderer";
8
+ import { Matrix4d, Point3d, Range2d } from "@itwin/core-geometry";
9
+ import { FeatureCanvasRenderer } from "../Feature/FeatureCanvasRenderer.js";
10
+ import { arcgisFeatureFormats, ArcGisFeatureQuery } from "./ArcGisFeatureQuery.js";
11
+ import { ArcGisFeatureResponse } from "./ArcGisFeatureResponse.js";
12
+ import { ArcGisJsonFeatureReader } from "./ArcGisJsonFeatureReader.js";
13
+ import { ArcGisPbfFeatureReader } from "./ArcGisPbfFeatureReader.js";
14
+ import { ArcGisSymbologyCanvasRenderer } from "./ArcGisSymbologyRenderer.js";
15
+ import { EsriPMS, EsriRenderer, EsriSFS, EsriSLS } from "./EsriSymbology.js";
17
16
  const loggerCategory = "MapLayersFormats.ArcGISFeature";
18
17
  /**
19
18
  * @internal
20
19
  */
21
20
  export class DefaultArcGiSymbology {
21
+ static defaultPMS = EsriPMS.fromJSON({
22
+ type: "esriPMS",
23
+ url: "",
24
+ contentType: "image/png",
25
+ imageData: "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAmBJREFUOE+Nk01IVFEUx//n3jfvOZOaJkMtiiJ7o9RG3LgoqKhFSFJBTS1ahFBBi0ijfJXCIyQr+hBbSIsoW7iQoKKFCw2CkAI3tZAgy8Ei+xhoTCbnje/NPfHGnA816KzuPR+/c8/HJRQJE7o+VUhym0DcCOYGgBQEXjOLlyqo+nHanCkMoaL4rslKjZwOQLT4ek3Mmz3FACFNLB67ut6M1nWphbg8wI6VyJK5KEH0EQFVJRKbwzokAW++p/ErraAYSQK3u47bC3vLnA+ZB9i2gHF0oyQMCfCGNaUa+vauxs71wWz2V18cnBj8gQ8J1/eeBnHUa4sMFQDGdGno+4gwEAoQzjVUon3rqlx1KY9x7+0MWobjAPg3QJ2eZV4tAEyFNCN5FkSXyw2B3j1hRGvLcgBXMV5MptA4MOXr0gT0u5bZnAf0jBsyiSgJPAxqhON1K3FlRxUMvwFAtv7u0Wl0jvwEmJNEuOhakTt5wKEBifr6Oo14BIBRpgt07w6jcVMIngKGY7NofR5HwlF+zDcpsC193vyYB/innvHywCzdZfAR/+onX1segBTAxHzzfPE7/8yzzIPLjJE1LTixHZx5CtCK4gXLzovBiDPUsYxVM7gUkB3nWKlm6DYEnQGzXARxCOK+a1WfKtQXb6LNAvr7iCboCUA1Ocdsdv5KLPe7F6pH/w3wLbc+BwOuc5IZ1wEE/jonQbjptZn24tKKX7BgvR2r0NKZRwDvAqCI+Z30VJPTURv7P4A9psuQcYAUPwAoReBLrmX2Lmls7i8sZ7kWLwuoxA1FVJGxzMPLufi6P2r+2xFbOUjGAAAAAElFTkSuQmCC",
26
+ width: 16,
27
+ height: 16,
28
+ xoffset: -8,
29
+ yoffset: -16,
30
+ });
31
+ static defaultSLSProps = {
32
+ type: "esriSLS",
33
+ color: [0, 0, 255, 255],
34
+ width: 1,
35
+ style: "esriSLSSolid",
36
+ };
37
+ static defaultSLS = EsriSLS.fromJSON(this.defaultSLSProps);
38
+ static defaultSFS = EsriSFS.fromJSON({
39
+ type: "esriSFS",
40
+ color: [0, 0, 255, 100], // blue fill
41
+ style: "esriSFSSolid",
42
+ outline: this.defaultSLSProps,
43
+ });
22
44
  async initialize() {
23
45
  // Marker image need to be loaded upfront;
24
- await _a.defaultPMS.loadImage();
46
+ await DefaultArcGiSymbology.defaultPMS.loadImage();
25
47
  }
26
48
  getSymbology(geomType) {
27
49
  if (geomType === "esriGeometryPoint" || geomType === "esriGeometryMultipoint") {
28
- return _a.defaultPMS;
50
+ return DefaultArcGiSymbology.defaultPMS;
29
51
  }
30
52
  else if (geomType === "esriGeometryLine" || geomType === "esriGeometryPolyline") {
31
- return _a.defaultSLS;
53
+ return DefaultArcGiSymbology.defaultSLS;
32
54
  }
33
55
  else if (geomType === "esriGeometryPolygon") {
34
- return _a.defaultSFS;
56
+ return DefaultArcGiSymbology.defaultSFS;
35
57
  }
36
58
  throw new Error(`Could not get default symbology for geometry type: '${geomType}'`);
37
59
  }
38
60
  }
39
- _a = DefaultArcGiSymbology;
40
- DefaultArcGiSymbology.defaultPMS = EsriPMS.fromJSON({
41
- type: "esriPMS",
42
- url: "",
43
- contentType: "image/png",
44
- imageData: "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAmBJREFUOE+Nk01IVFEUx//n3jfvOZOaJkMtiiJ7o9RG3LgoqKhFSFJBTS1ahFBBi0ijfJXCIyQr+hBbSIsoW7iQoKKFCw2CkAI3tZAgy8Ei+xhoTCbnje/NPfHGnA816KzuPR+/c8/HJRQJE7o+VUhym0DcCOYGgBQEXjOLlyqo+nHanCkMoaL4rslKjZwOQLT4ek3Mmz3FACFNLB67ut6M1nWphbg8wI6VyJK5KEH0EQFVJRKbwzokAW++p/ErraAYSQK3u47bC3vLnA+ZB9i2gHF0oyQMCfCGNaUa+vauxs71wWz2V18cnBj8gQ8J1/eeBnHUa4sMFQDGdGno+4gwEAoQzjVUon3rqlx1KY9x7+0MWobjAPg3QJ2eZV4tAEyFNCN5FkSXyw2B3j1hRGvLcgBXMV5MptA4MOXr0gT0u5bZnAf0jBsyiSgJPAxqhON1K3FlRxUMvwFAtv7u0Wl0jvwEmJNEuOhakTt5wKEBifr6Oo14BIBRpgt07w6jcVMIngKGY7NofR5HwlF+zDcpsC193vyYB/innvHywCzdZfAR/+onX1segBTAxHzzfPE7/8yzzIPLjJE1LTixHZx5CtCK4gXLzovBiDPUsYxVM7gUkB3nWKlm6DYEnQGzXARxCOK+a1WfKtQXb6LNAvr7iCboCUA1Ocdsdv5KLPe7F6pH/w3wLbc+BwOuc5IZ1wEE/jonQbjptZn24tKKX7BgvR2r0NKZRwDvAqCI+Z30VJPTURv7P4A9psuQcYAUPwAoReBLrmX2Lmls7i8sZ7kWLwuoxA1FVJGxzMPLufi6P2r+2xFbOUjGAAAAAElFTkSuQmCC",
45
- width: 16,
46
- height: 16,
47
- xoffset: -8,
48
- yoffset: -16,
49
- });
50
- DefaultArcGiSymbology.defaultSLSProps = {
51
- type: "esriSLS",
52
- color: [0, 0, 255, 255],
53
- width: 1,
54
- style: "esriSLSSolid",
55
- };
56
- DefaultArcGiSymbology.defaultSLS = EsriSLS.fromJSON(_a.defaultSLSProps);
57
- DefaultArcGiSymbology.defaultSFS = EsriSFS.fromJSON({
58
- type: "esriSFS",
59
- color: [0, 0, 255, 100], // blue fill
60
- style: "esriSFSSolid",
61
- outline: _a.defaultSLSProps,
62
- });
63
61
  /** Provide tiles from a ESRI ArcGIS Feature service
64
62
  * @internal
65
63
  */
66
64
  export class ArcGisFeatureProvider extends ArcGISImageryProvider {
65
+ // Debug flags, should always be committed to FALSE !
66
+ _drawDebugInfo = false;
67
+ _debugFeatureGeom = false;
68
+ _supportsCoordinatesQuantization = false;
69
+ _layerId = 0;
70
+ _layerMetadata;
71
+ _format;
72
+ _outSR = 102100;
73
+ _maxDepthFromLod = 0;
74
+ _minDepthFromLod = 0;
75
+ _defaultSymbol = new DefaultArcGiSymbology();
76
+ _renderer;
77
+ _symbologyRenderer;
78
+ static _nbSubTiles = 2; // Number of subtiles for a single axis
79
+ serviceJson;
67
80
  get minimumZoomLevel() { return this._minDepthFromLod; }
68
81
  get maximumZoomLevel() { return this._maxDepthFromLod; }
82
+ static _extentCache = new Map();
69
83
  constructor(settings) {
70
84
  super(settings, true);
71
- // Debug flags, should always be committed to FALSE !
72
- this._drawDebugInfo = false;
73
- this._debugFeatureGeom = false;
74
- this._supportsCoordinatesQuantization = false;
75
- this._layerId = 0;
76
- this._outSR = 102100;
77
- this._maxDepthFromLod = 0;
78
- this._minDepthFromLod = 0;
79
- this._defaultSymbol = new DefaultArcGiSymbology();
80
85
  }
81
86
  async initialize() {
82
87
  const metadata = await this.getServiceJson();
@@ -542,6 +547,4 @@ export class ArcGisFeatureProvider extends ArcGISImageryProvider {
542
547
  return undefined;
543
548
  }
544
549
  }
545
- ArcGisFeatureProvider._nbSubTiles = 2; // Number of subtiles for a single axis
546
- ArcGisFeatureProvider._extentCache = new Map();
547
550
  //# sourceMappingURL=ArcGisFeatureProvider.js.map