@itwin/map-layers-formats 4.0.0-dev.8 → 4.0.0-dev.81

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 (175) hide show
  1. package/.rush/temp/operation/build/all.log +3 -0
  2. package/.rush/temp/operation/build/state.json +3 -0
  3. package/.rush/temp/operation/cover/all.log +98 -0
  4. package/.rush/temp/operation/cover/state.json +1 -1
  5. package/.rush/temp/operation/docs/all.log +30 -0
  6. package/.rush/temp/operation/docs/state.json +1 -1
  7. package/.rush/temp/{package-deps_build_ci.json → package-deps_build.json} +11 -11
  8. package/.rush/temp/package-deps_cover.json +10 -10
  9. package/.rush/temp/package-deps_docs.json +10 -10
  10. package/.rush/temp/shrinkwrap-deps.json +190 -44
  11. package/CHANGELOG.json +57 -0
  12. package/CHANGELOG.md +44 -1
  13. package/config/rush-project.json +1 -2
  14. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  15. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
  16. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  17. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  18. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +132 -134
  19. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  20. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  21. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -202
  22. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  23. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  24. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -422
  25. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  26. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  27. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  28. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
  29. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  30. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
  31. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  32. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
  33. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  34. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  35. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -43
  36. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  37. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  38. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  39. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -192
  40. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  41. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  42. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
  43. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2267 -2270
  44. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  45. package/lib/cjs/map-layers-formats.d.ts +8 -8
  46. package/lib/cjs/map-layers-formats.js +28 -24
  47. package/lib/cjs/map-layers-formats.js.map +1 -1
  48. package/lib/cjs/mapLayersFormats.d.ts +10 -10
  49. package/lib/cjs/mapLayersFormats.js +28 -28
  50. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  51. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
  52. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  53. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
  54. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  55. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
  56. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  57. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -680
  58. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  59. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  60. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
  61. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  62. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
  63. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  64. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
  65. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  66. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  67. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
  68. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
  69. package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
  70. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  71. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
  72. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
  73. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  74. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  75. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
  76. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
  77. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  78. package/lib/cjs/test/coverage/.nyc_output/cd866071-e986-4027-89f6-9a70b6e25ed3.json +1 -0
  79. package/lib/cjs/test/coverage/.nyc_output/processinfo/4c93adb3-7e95-4a63-9814-a25d79ab4680.json +1 -0
  80. package/lib/cjs/test/coverage/.nyc_output/processinfo/cd866071-e986-4027-89f6-9a70b6e25ed3.json +1 -0
  81. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
  82. package/lib/cjs/test/coverage/cobertura-coverage.xml +72 -72
  83. package/lib/cjs/test/coverage/lcov-report/index.html +5 -5
  84. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
  85. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +10 -10
  86. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +7 -7
  87. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +10 -10
  88. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
  89. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
  90. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
  91. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +4 -4
  92. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +8 -8
  93. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +13 -13
  94. package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
  95. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
  96. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
  97. package/lib/cjs/test/coverage/lcov.info +355 -531
  98. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  99. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  100. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  103. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -130
  104. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  105. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  106. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -198
  107. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  108. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  109. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -418
  110. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  111. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  112. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  113. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
  114. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  115. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
  116. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  117. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
  118. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  119. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  120. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -39
  121. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  122. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  123. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  124. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -185
  125. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  126. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  127. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
  128. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2264 -2267
  129. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  130. package/lib/esm/map-layers-formats.d.ts +8 -8
  131. package/lib/esm/map-layers-formats.js +12 -12
  132. package/lib/esm/mapLayersFormats.d.ts +10 -10
  133. package/lib/esm/mapLayersFormats.js +24 -24
  134. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  135. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
  136. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  137. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
  138. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  139. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
  140. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  141. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -678
  142. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  143. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  144. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
  145. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  146. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
  147. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  148. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
  149. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  150. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  151. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
  152. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
  153. package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
  154. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  155. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
  156. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
  157. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  158. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  159. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
  160. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
  161. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  162. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  163. package/lib/test/junit_results.xml +44 -44
  164. package/map-layers-formats.build.log +2 -2
  165. package/package.json +17 -17
  166. package/src/ArcGisFeature/esriPBuffer.gen.ts +1 -4
  167. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
  168. package/src/test/ArcGisFeature/NewYorkDataset.ts +187 -187
  169. package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +4 -4
  170. package/tsconfig.json +1 -2
  171. package/.rush/temp/operation/build_ci/state.json +0 -3
  172. package/lib/cjs/test/coverage/.nyc_output/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
  173. package/lib/cjs/test/coverage/.nyc_output/processinfo/5901bdfe-760d-4ca3-9674-876be7ed11b1.json +0 -1
  174. package/lib/cjs/test/coverage/.nyc_output/processinfo/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
  175. /package/lib/cjs/test/coverage/.nyc_output/{5901bdfe-760d-4ca3-9674-876be7ed11b1.json → 4c93adb3-7e95-4a63-9814-a25d79ab4680.json} +0 -0
@@ -1,9 +1,9 @@
1
- export * from "./mapLayersFormats";
2
- export * from "./ArcGisFeature/ArcGisFeatureProvider";
3
- /** @docs-package-description
4
- * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
5
- */
6
- /** @docs-group-description MapLayersFormats
7
- * APIs for working with the map layer formats provided by this package.
8
- */
1
+ export * from "./mapLayersFormats";
2
+ export * from "./ArcGisFeature/ArcGisFeatureProvider";
3
+ /** @docs-package-description
4
+ * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
5
+ */
6
+ /** @docs-group-description MapLayersFormats
7
+ * APIs for working with the map layer formats provided by this package.
8
+ */
9
9
  //# sourceMappingURL=map-layers-formats.d.ts.map
@@ -1,25 +1,29 @@
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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./mapLayersFormats"), exports);
18
- __exportStar(require("./ArcGisFeature/ArcGisFeatureProvider"), exports);
19
- /** @docs-package-description
20
- * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
21
- */
22
- /** @docs-group-description MapLayersFormats
23
- * APIs for working with the map layer formats provided by this package.
24
- */
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./mapLayersFormats"), exports);
22
+ __exportStar(require("./ArcGisFeature/ArcGisFeatureProvider"), exports);
23
+ /** @docs-package-description
24
+ * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
25
+ */
26
+ /** @docs-group-description MapLayersFormats
27
+ * APIs for working with the map layer formats provided by this package.
28
+ */
25
29
  //# sourceMappingURL=map-layers-formats.js.map
@@ -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;AAEtD;;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\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,qDAAmC;AACnC,wEAAsD;AAEtD;;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\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,11 +1,11 @@
1
- /** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
2
- * @beta
3
- */
4
- export declare class MapLayersFormats {
5
- /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
6
- * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
7
- * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
8
- */
9
- static initialize(): void;
10
- }
1
+ /** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
2
+ * @beta
3
+ */
4
+ export declare class MapLayersFormats {
5
+ /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
6
+ * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
7
+ * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
8
+ */
9
+ static initialize(): void;
10
+ }
11
11
  //# sourceMappingURL=mapLayersFormats.d.ts.map
@@ -1,29 +1,29 @@
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.MapLayersFormats = void 0;
8
- /** @packageDocumentation
9
- * @module MapLayersFormats
10
- */
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- const core_frontend_1 = require("@itwin/core-frontend");
13
- const ArcGisFeatureFormat_1 = require("./ArcGisFeature/ArcGisFeatureFormat");
14
- /** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
15
- * @beta
16
- */
17
- class MapLayersFormats {
18
- /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
19
- * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
20
- * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
21
- */
22
- static initialize() {
23
- (0, core_bentley_1.assert)(core_frontend_1.IModelApp.initialized, "MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown");
24
- if (core_frontend_1.IModelApp.initialized)
25
- core_frontend_1.IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat);
26
- }
27
- }
28
- exports.MapLayersFormats = MapLayersFormats;
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.MapLayersFormats = void 0;
8
+ /** @packageDocumentation
9
+ * @module MapLayersFormats
10
+ */
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ const core_frontend_1 = require("@itwin/core-frontend");
13
+ const ArcGisFeatureFormat_1 = require("./ArcGisFeature/ArcGisFeatureFormat");
14
+ /** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
15
+ * @beta
16
+ */
17
+ class MapLayersFormats {
18
+ /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
19
+ * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
20
+ * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
21
+ */
22
+ static initialize() {
23
+ (0, core_bentley_1.assert)(core_frontend_1.IModelApp.initialized, "MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown");
24
+ if (core_frontend_1.IModelApp.initialized)
25
+ core_frontend_1.IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat);
26
+ }
27
+ }
28
+ exports.MapLayersFormats = MapLayersFormats;
29
29
  //# sourceMappingURL=mapLayersFormats.js.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=ArcGisFeatureFeatureFormats.test.d.ts.map
@@ -1,35 +1,35 @@
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
- const core_common_1 = require("@itwin/core-common");
8
- const core_frontend_1 = require("@itwin/core-frontend");
9
- const chai_1 = require("chai");
10
- const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
11
- const Mocks_1 = require("./Mocks");
12
- const sinon = require("sinon");
13
- describe("ArcGisFeaturePBF", () => {
14
- const sandbox = sinon.createSandbox();
15
- afterEach(async () => {
16
- sandbox.restore();
17
- });
18
- it("should createImageryProvider", async () => {
19
- const provider = ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.createImageryProvider(core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource));
20
- (0, chai_1.expect)(provider).to.not.undefined;
21
- });
22
- it("should validateSource", async () => {
23
- const fakeMethod = async (_url, _formatId, _filter, _userName, _password, _ignoreCache) => {
24
- return { status: core_frontend_1.MapLayerSourceStatus.Valid };
25
- };
26
- const validateSourceStub = sinon.stub(core_frontend_1.ArcGisUtilities, "validateSource").callsFake(fakeMethod);
27
- await ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.validateSource(Mocks_1.esriFeatureSampleSource.url);
28
- (0, chai_1.expect)(validateSourceStub.calledOnce).to.be.true;
29
- const firstCall = validateSourceStub.getCalls()[0];
30
- (0, chai_1.expect)(firstCall.args[0]).to.equals(Mocks_1.esriFeatureSampleSource.url);
31
- (0, chai_1.expect)(firstCall.args[1]).to.equals(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId);
32
- (0, chai_1.expect)(firstCall.args[2]).to.eqls(["query"]);
33
- });
34
- });
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
+ const core_common_1 = require("@itwin/core-common");
8
+ const core_frontend_1 = require("@itwin/core-frontend");
9
+ const chai_1 = require("chai");
10
+ const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
11
+ const Mocks_1 = require("./Mocks");
12
+ const sinon = require("sinon");
13
+ describe("ArcGisFeaturePBF", () => {
14
+ const sandbox = sinon.createSandbox();
15
+ afterEach(async () => {
16
+ sandbox.restore();
17
+ });
18
+ it("should createImageryProvider", async () => {
19
+ const provider = ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.createImageryProvider(core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource));
20
+ (0, chai_1.expect)(provider).to.not.undefined;
21
+ });
22
+ it("should validateSource", async () => {
23
+ const fakeMethod = async (_url, _formatId, _filter, _userName, _password, _ignoreCache) => {
24
+ return { status: core_frontend_1.MapLayerSourceStatus.Valid };
25
+ };
26
+ const validateSourceStub = sinon.stub(core_frontend_1.ArcGisUtilities, "validateSource").callsFake(fakeMethod);
27
+ await ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.validateSource(Mocks_1.esriFeatureSampleSource.url);
28
+ (0, chai_1.expect)(validateSourceStub.calledOnce).to.be.true;
29
+ const firstCall = validateSourceStub.getCalls()[0];
30
+ (0, chai_1.expect)(firstCall.args[0]).to.equals(Mocks_1.esriFeatureSampleSource.url);
31
+ (0, chai_1.expect)(firstCall.args[1]).to.equals(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId);
32
+ (0, chai_1.expect)(firstCall.args[2]).to.eqls(["query"]);
33
+ });
34
+ });
35
35
  //# sourceMappingURL=ArcGisFeatureFeatureFormats.test.js.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=ArcGisFeatureJSON.test.d.ts.map
@@ -1,162 +1,162 @@
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
- const core_bentley_1 = require("@itwin/core-bentley");
8
- const core_common_1 = require("@itwin/core-common");
9
- const chai_1 = require("chai");
10
- const sinon = require("sinon");
11
- const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
12
- const ArcGisFeatureJSON_1 = require("../../ArcGisFeature/ArcGisFeatureJSON");
13
- const ArcGisFeatureRenderer_1 = require("../../ArcGisFeature/ArcGisFeatureRenderer");
14
- const ArcGisSymbologyRenderer_1 = require("../../ArcGisFeature/ArcGisSymbologyRenderer");
15
- const Mocks_1 = require("./Mocks");
16
- const PhillyLandmarksDataset_1 = require("./PhillyLandmarksDataset");
17
- const esriFeatureSampleSource = { name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId };
18
- const createFeatureJSON = () => {
19
- const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
20
- const featurePbf = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
21
- // Locale configuration depends on the testing machine (i.e. linux vs windows),
22
- // so we need to force date display to Iso to get a consistent value.
23
- // In real scenario, we still want dates to be displayed in end-user's locale.
24
- featurePbf.forceDateDisplayValueToIso = true;
25
- return featurePbf;
26
- };
27
- describe("ArcGisFeatureJSON", () => {
28
- const sandbox = sinon.createSandbox();
29
- afterEach(async () => {
30
- sandbox.restore();
31
- });
32
- it("should read FeatureInfo in JSON (phillyTansportation)", async () => {
33
- const featureJson = createFeatureJSON();
34
- // In some cases, PBF gives more floating-point precision than JSON.
35
- // Since I want to use the same output reference for both formats, I force a max precision of 8.
36
- featureJson.floatPrecision = 8;
37
- const results = [];
38
- featureJson.readFeatureInfo({ data: PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryJson, exceedTransferLimit: false }, results);
39
- (0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));
40
- });
41
- it("should read FeatureInfo in JSON (phillyAirport)", async () => {
42
- const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
43
- const featureJson = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
44
- // In some cases, PBF gives more floating-point precision than JSON.
45
- // Since I want to use the same output reference for both formats, I force a max precision of 8.
46
- featureJson.floatPrecision = 8;
47
- const results = [];
48
- const data = JSON.parse(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryJson);
49
- featureJson.readFeatureInfo({ data, exceedTransferLimit: false }, results);
50
- const _test = JSON.stringify(results);
51
- (0, chai_1.expect)(_test).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));
52
- });
53
- it("should deflate coordinates array", async () => {
54
- // Simple deflate stride = 2
55
- let doubleArray = [[1, 2], [3, 4]];
56
- let deflated = [];
57
- let offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, 0);
58
- (0, chai_1.expect)(offset).to.equals(4);
59
- (0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4]);
60
- /// Check offset with stride = 2
61
- doubleArray = [[5, 6]];
62
- offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, offset);
63
- (0, chai_1.expect)(offset).to.equals(6);
64
- (0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
65
- // Simple deflate stride = 3
66
- doubleArray = [[1, 2, 3], [4, 5, 6]];
67
- deflated = [];
68
- offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, 0);
69
- (0, chai_1.expect)(offset).to.equals(6);
70
- (0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
71
- /// Check offset with stride = 3
72
- doubleArray = [[7, 8, 9]];
73
- offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, offset);
74
- (0, chai_1.expect)(offset).to.equals(9);
75
- (0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6, 7, 8, 9]);
76
- });
77
- it("should readAndRender single ring polygon feature", async () => {
78
- const featureJson = createFeatureJSON();
79
- const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryJson;
80
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
81
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
82
- const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
83
- featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
84
- (0, chai_1.expect)(renderPathSpy.calledOnce);
85
- const firstCall = renderPathSpy.getCalls()[0];
86
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
87
- (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
88
- (0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
89
- (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
90
- });
91
- it("should readAndRender multiple ring polygon feature", async () => {
92
- const featureJson = createFeatureJSON();
93
- const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryJson;
94
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
95
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
96
- const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
97
- featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
98
- (0, chai_1.expect)(renderPathSpy.calledOnce);
99
- const firstCall = renderPathSpy.getCalls()[0];
100
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
101
- (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
102
- (0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
103
- (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
104
- });
105
- it("should readAndRender simple path", async () => {
106
- const featureJson = createFeatureJSON();
107
- const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryJson;
108
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
109
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
110
- const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
111
- featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
112
- (0, chai_1.expect)(renderPathSpy.calledOnce);
113
- const geometryCoords = [360, 491, -2, -1, -1, 0, -1, 0, -1, 0, -1, 1, -4, 1, -10, 2, -15, 3, -1, 0, -1, 0, -2, 0, -1, 0, -1, 0, -1, -1, -1, 0, -2, -1, 0, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0];
114
- const firstCall = renderPathSpy.getCalls()[0];
115
- (0, chai_1.expect)(firstCall.args[0]).to.eql([24]); // geometryLengths
116
- (0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
117
- (0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
118
- (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
119
- });
120
- it("should readAndRender multi path", async () => {
121
- const featureJson = createFeatureJSON();
122
- const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryJson;
123
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
124
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
125
- const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
126
- featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
127
- (0, chai_1.expect)(renderPathSpy.calledOnce);
128
- // Pbf contains already the right output format expect, lets rely on that.
129
- const firstCall = renderPathSpy.getCalls()[0];
130
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths);
131
- (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords);
132
- (0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
133
- (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
134
- });
135
- it("should readAndRender simple point", async () => {
136
- const featureJson = createFeatureJSON();
137
- const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryJson;
138
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
139
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
140
- const spy = sinon.spy(featureRenderer, "renderPoint");
141
- featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
142
- (0, chai_1.expect)(spy.calledOnce);
143
- // Pbf contains already the right output format expect, lets rely on that.
144
- const geometryCoords = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;
145
- const firstCall = spy.getCalls()[0];
146
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
147
- (0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
148
- (0, chai_1.expect)(firstCall.args[2]).to.eql(2); // stride
149
- });
150
- it("should log error when readAndRender / readFeatureInfo is called invalid response Data", async () => {
151
- const featureJson = createFeatureJSON();
152
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer("esriGeometryAny", PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
153
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
154
- const logErrorSpy = sandbox.spy(core_bentley_1.Logger, "logError");
155
- featureJson.readAndRender({ data: { test: "test" }, exceedTransferLimit: false }, featureRenderer);
156
- (0, chai_1.expect)(logErrorSpy.calledOnce);
157
- logErrorSpy.resetHistory();
158
- featureJson.readFeatureInfo({ data: { test: "test" }, exceedTransferLimit: false }, []);
159
- (0, chai_1.expect)(logErrorSpy.calledOnce);
160
- });
161
- });
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
+ const core_bentley_1 = require("@itwin/core-bentley");
8
+ const core_common_1 = require("@itwin/core-common");
9
+ const chai_1 = require("chai");
10
+ const sinon = require("sinon");
11
+ const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
12
+ const ArcGisFeatureJSON_1 = require("../../ArcGisFeature/ArcGisFeatureJSON");
13
+ const ArcGisFeatureRenderer_1 = require("../../ArcGisFeature/ArcGisFeatureRenderer");
14
+ const ArcGisSymbologyRenderer_1 = require("../../ArcGisFeature/ArcGisSymbologyRenderer");
15
+ const Mocks_1 = require("./Mocks");
16
+ const PhillyLandmarksDataset_1 = require("./PhillyLandmarksDataset");
17
+ const esriFeatureSampleSource = { name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId };
18
+ const createFeatureJSON = () => {
19
+ const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
20
+ const featurePbf = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
21
+ // Locale configuration depends on the testing machine (i.e. linux vs windows),
22
+ // so we need to force date display to Iso to get a consistent value.
23
+ // In real scenario, we still want dates to be displayed in end-user's locale.
24
+ featurePbf.forceDateDisplayValueToIso = true;
25
+ return featurePbf;
26
+ };
27
+ describe("ArcGisFeatureJSON", () => {
28
+ const sandbox = sinon.createSandbox();
29
+ afterEach(async () => {
30
+ sandbox.restore();
31
+ });
32
+ it("should read FeatureInfo in JSON (phillyTansportation)", async () => {
33
+ const featureJson = createFeatureJSON();
34
+ // In some cases, PBF gives more floating-point precision than JSON.
35
+ // Since I want to use the same output reference for both formats, I force a max precision of 8.
36
+ featureJson.floatPrecision = 8;
37
+ const results = [];
38
+ featureJson.readFeatureInfo({ data: PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryJson, exceedTransferLimit: false }, results);
39
+ (0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));
40
+ });
41
+ it("should read FeatureInfo in JSON (phillyAirport)", async () => {
42
+ const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
43
+ const featureJson = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
44
+ // In some cases, PBF gives more floating-point precision than JSON.
45
+ // Since I want to use the same output reference for both formats, I force a max precision of 8.
46
+ featureJson.floatPrecision = 8;
47
+ const results = [];
48
+ const data = JSON.parse(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryJson);
49
+ featureJson.readFeatureInfo({ data, exceedTransferLimit: false }, results);
50
+ const _test = JSON.stringify(results);
51
+ (0, chai_1.expect)(_test).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));
52
+ });
53
+ it("should deflate coordinates array", async () => {
54
+ // Simple deflate stride = 2
55
+ let doubleArray = [[1, 2], [3, 4]];
56
+ let deflated = [];
57
+ let offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, 0);
58
+ (0, chai_1.expect)(offset).to.equals(4);
59
+ (0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4]);
60
+ /// Check offset with stride = 2
61
+ doubleArray = [[5, 6]];
62
+ offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, offset);
63
+ (0, chai_1.expect)(offset).to.equals(6);
64
+ (0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
65
+ // Simple deflate stride = 3
66
+ doubleArray = [[1, 2, 3], [4, 5, 6]];
67
+ deflated = [];
68
+ offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, 0);
69
+ (0, chai_1.expect)(offset).to.equals(6);
70
+ (0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
71
+ /// Check offset with stride = 3
72
+ doubleArray = [[7, 8, 9]];
73
+ offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, offset);
74
+ (0, chai_1.expect)(offset).to.equals(9);
75
+ (0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6, 7, 8, 9]);
76
+ });
77
+ it("should readAndRender single ring polygon feature", async () => {
78
+ const featureJson = createFeatureJSON();
79
+ const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryJson;
80
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
81
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
82
+ const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
83
+ featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
84
+ (0, chai_1.expect)(renderPathSpy.calledOnce);
85
+ const firstCall = renderPathSpy.getCalls()[0];
86
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
87
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
88
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
89
+ (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
90
+ });
91
+ it("should readAndRender multiple ring polygon feature", async () => {
92
+ const featureJson = createFeatureJSON();
93
+ const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryJson;
94
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
95
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
96
+ const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
97
+ featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
98
+ (0, chai_1.expect)(renderPathSpy.calledOnce);
99
+ const firstCall = renderPathSpy.getCalls()[0];
100
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
101
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
102
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
103
+ (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
104
+ });
105
+ it("should readAndRender simple path", async () => {
106
+ const featureJson = createFeatureJSON();
107
+ const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryJson;
108
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
109
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
110
+ const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
111
+ featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
112
+ (0, chai_1.expect)(renderPathSpy.calledOnce);
113
+ const geometryCoords = [360, 491, -2, -1, -1, 0, -1, 0, -1, 0, -1, 1, -4, 1, -10, 2, -15, 3, -1, 0, -1, 0, -2, 0, -1, 0, -1, 0, -1, -1, -1, 0, -2, -1, 0, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0];
114
+ const firstCall = renderPathSpy.getCalls()[0];
115
+ (0, chai_1.expect)(firstCall.args[0]).to.eql([24]); // geometryLengths
116
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
117
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
118
+ (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
119
+ });
120
+ it("should readAndRender multi path", async () => {
121
+ const featureJson = createFeatureJSON();
122
+ const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryJson;
123
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
124
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
125
+ const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
126
+ featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
127
+ (0, chai_1.expect)(renderPathSpy.calledOnce);
128
+ // Pbf contains already the right output format expect, lets rely on that.
129
+ const firstCall = renderPathSpy.getCalls()[0];
130
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths);
131
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords);
132
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
133
+ (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
134
+ });
135
+ it("should readAndRender simple point", async () => {
136
+ const featureJson = createFeatureJSON();
137
+ const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryJson;
138
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
139
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
140
+ const spy = sinon.spy(featureRenderer, "renderPoint");
141
+ featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
142
+ (0, chai_1.expect)(spy.calledOnce);
143
+ // Pbf contains already the right output format expect, lets rely on that.
144
+ const geometryCoords = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;
145
+ const firstCall = spy.getCalls()[0];
146
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
147
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
148
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(2); // stride
149
+ });
150
+ it("should log error when readAndRender / readFeatureInfo is called invalid response Data", async () => {
151
+ const featureJson = createFeatureJSON();
152
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer("esriGeometryAny", PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
153
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
154
+ const logErrorSpy = sandbox.spy(core_bentley_1.Logger, "logError");
155
+ featureJson.readAndRender({ data: { test: "test" }, exceedTransferLimit: false }, featureRenderer);
156
+ (0, chai_1.expect)(logErrorSpy.calledOnce);
157
+ logErrorSpy.resetHistory();
158
+ featureJson.readFeatureInfo({ data: { test: "test" }, exceedTransferLimit: false }, []);
159
+ (0, chai_1.expect)(logErrorSpy.calledOnce);
160
+ });
161
+ });
162
162
  //# sourceMappingURL=ArcGisFeatureJSON.test.js.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=ArcGisFeaturePBF.test.d.ts.map