@itwin/map-layers-formats 4.0.0-dev.1 → 4.0.0-dev.100

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 (181) 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} +13 -13
  8. package/.rush/temp/package-deps_cover.json +12 -12
  9. package/.rush/temp/package-deps_docs.json +12 -12
  10. package/.rush/temp/shrinkwrap-deps.json +204 -54
  11. package/CHANGELOG.json +69 -0
  12. package/CHANGELOG.md +54 -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.d.ts.map +1 -1
  22. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -205
  23. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  24. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  25. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  26. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -426
  27. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  28. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  29. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  30. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
  31. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  32. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
  33. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  34. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
  35. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  36. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  37. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -43
  38. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  39. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  40. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  41. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -192
  42. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  43. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  44. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
  45. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2267 -2270
  46. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  47. package/lib/cjs/map-layers-formats.d.ts +8 -8
  48. package/lib/cjs/map-layers-formats.js +28 -24
  49. package/lib/cjs/map-layers-formats.js.map +1 -1
  50. package/lib/cjs/mapLayersFormats.d.ts +10 -10
  51. package/lib/cjs/mapLayersFormats.js +28 -28
  52. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  53. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
  54. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  55. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
  56. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  57. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
  58. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  59. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -680
  60. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  61. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  62. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
  63. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  64. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
  65. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  66. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
  67. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  68. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  69. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
  70. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
  71. package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
  72. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  73. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
  74. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
  75. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  76. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  77. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
  78. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
  79. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  80. package/lib/cjs/test/coverage/.nyc_output/bd2a5894-ab2c-4c90-bfb9-f545c1f3c3ad.json +1 -0
  81. package/lib/cjs/test/coverage/.nyc_output/processinfo/b5a5c114-6a90-41f0-ad7b-9ba31cc9d9d3.json +1 -0
  82. package/lib/cjs/test/coverage/.nyc_output/processinfo/bd2a5894-ab2c-4c90-bfb9-f545c1f3c3ad.json +1 -0
  83. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
  84. package/lib/cjs/test/coverage/cobertura-coverage.xml +229 -236
  85. package/lib/cjs/test/coverage/lcov-report/index.html +14 -14
  86. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
  87. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +10 -10
  88. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +16 -22
  89. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +16 -28
  90. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
  91. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
  92. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
  93. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +4 -4
  94. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +8 -8
  95. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +29 -29
  96. package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
  97. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
  98. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
  99. package/lib/cjs/test/coverage/lcov.info +514 -697
  100. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
  103. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  104. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  105. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -130
  106. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  107. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  108. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +1 -1
  109. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -201
  110. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  111. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  112. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  113. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -422
  114. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  115. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  116. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  117. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
  118. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  119. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
  120. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  121. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
  122. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  123. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  124. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -39
  125. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  126. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  127. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  128. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -185
  129. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  130. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  131. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
  132. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2264 -2267
  133. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  134. package/lib/esm/map-layers-formats.d.ts +8 -8
  135. package/lib/esm/map-layers-formats.js +12 -12
  136. package/lib/esm/mapLayersFormats.d.ts +10 -10
  137. package/lib/esm/mapLayersFormats.js +24 -24
  138. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  139. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
  140. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  141. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
  142. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  143. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
  144. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  145. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -678
  146. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  147. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  148. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
  149. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  150. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
  151. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  152. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
  153. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  154. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  155. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
  156. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
  157. package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
  158. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  159. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
  160. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
  161. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  162. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  163. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
  164. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
  165. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  166. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  167. package/lib/test/junit_results.xml +43 -43
  168. package/map-layers-formats.build.log +2 -2
  169. package/package.json +18 -19
  170. package/src/ArcGisFeature/ArcGisFeaturePBF.ts +3 -5
  171. package/src/ArcGisFeature/ArcGisFeatureProvider.ts +1 -5
  172. package/src/ArcGisFeature/esriPBuffer.gen.ts +1 -4
  173. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
  174. package/src/test/ArcGisFeature/NewYorkDataset.ts +187 -187
  175. package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +4 -4
  176. package/tsconfig.json +1 -2
  177. package/.rush/temp/operation/build_ci/state.json +0 -3
  178. package/lib/cjs/test/coverage/.nyc_output/076f01d3-f97f-4be1-bb26-ced6ce465355.json +0 -1
  179. package/lib/cjs/test/coverage/.nyc_output/processinfo/076f01d3-f97f-4be1-bb26-ced6ce465355.json +0 -1
  180. package/lib/cjs/test/coverage/.nyc_output/processinfo/722f7ba4-f4d4-48f9-bd83-5d50f87f28e7.json +0 -1
  181. /package/lib/cjs/test/coverage/.nyc_output/{722f7ba4-f4d4-48f9-bd83-5d50f87f28e7.json → b5a5c114-6a90-41f0-ad7b-9ba31cc9d9d3.json} +0 -0
@@ -1,168 +1,168 @@
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 ArcGisFeaturePBF_1 = require("../../ArcGisFeature/ArcGisFeaturePBF");
12
- const ArcGisFeatureRenderer_1 = require("../../ArcGisFeature/ArcGisFeatureRenderer");
13
- const ArcGisSymbologyRenderer_1 = require("../../ArcGisFeature/ArcGisSymbologyRenderer");
14
- const esriPBuffer_gen_1 = require("../../ArcGisFeature/esriPBuffer.gen");
15
- const Mocks_1 = require("./Mocks");
16
- const PhillyLandmarksDataset_1 = require("./PhillyLandmarksDataset");
17
- const createFeaturePBF = () => {
18
- const settings = core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource);
19
- const featurePbf = new ArcGisFeaturePBF_1.ArcGisFeaturePBF(settings, { name: "SampleLayer" });
20
- // Locale configuration depends on the testing machine (i.e. linux vs windows),
21
- // so we need to force date display to Iso to get a consistent value.
22
- // In real scenario, we still want dates to be displayed in end-user's locale.
23
- featurePbf.forceDateDisplayValueToIso = true;
24
- return featurePbf;
25
- };
26
- describe("ArcGisFeaturePBF", () => {
27
- const sandbox = sinon.createSandbox();
28
- afterEach(async () => {
29
- sandbox.restore();
30
- });
31
- it("should convert pbf geometry type to Esri types", async () => {
32
- (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch))
33
- .to.equals("esriGeometryMultiPatch");
34
- (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint))
35
- .to.equals("esriGeometryMultipoint");
36
- (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint))
37
- .to.equals("esriGeometryPoint");
38
- (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon))
39
- .to.equals("esriGeometryPolygon");
40
- (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline))
41
- .to.equals("esriGeometryPolyline");
42
- (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(""))
43
- .to.equals("esriGeometryNull");
44
- });
45
- it("should read FeatureInfo in PBF", async () => {
46
- const byteArray = core_common_1.Base64EncodedString.toUint8Array(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryPbf);
47
- const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
48
- const settings = core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource);
49
- const featurePbf = new ArcGisFeaturePBF_1.ArcGisFeaturePBF(settings, { name: "SampleLayer" });
50
- // In some cases, PBF gives more floating-point precision than JSON.
51
- // Since I want to use the same output reference for both formats, I force a max precision of 8.
52
- featurePbf.floatPrecision = 8;
53
- const results = [];
54
- featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
55
- // Make deep comparison by using JSON.stringify
56
- (0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));
57
- });
58
- it("should read FeatureInfo from PBF (philly transportation)", async () => {
59
- const byteArray = core_common_1.Base64EncodedString.toUint8Array(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryEncodedPbf);
60
- const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
61
- const featurePbf = createFeaturePBF();
62
- // In some cases, PBF gives more floating-point precision than JSON.
63
- // Since I want to use the same output reference for both formats, I force a max precision.
64
- featurePbf.floatPrecision = 2;
65
- const results = [];
66
- featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
67
- // Make deep comparison by using JSON.stringify
68
- (0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));
69
- });
70
- it("should read all data types from FeatureInfo ", async () => {
71
- // In this test we use a synthetic PBuffer object to initialize a feature collection object.
72
- // The is to ensure we cover correctly all possible attribute value types.
73
- const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.fieldsCoveragePbufferCollection);
74
- const featurePbf = createFeaturePBF();
75
- const results = [];
76
- featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
77
- // Make deep comparison by using JSON.stringify
78
- (0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.fieldsCoverageGetFeatureInfoResultRef));
79
- });
80
- it("should readAndRender single ring polygon feature", async () => {
81
- const featurePbf = createFeaturePBF();
82
- const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf);
83
- const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.geometryType);
84
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
85
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
86
- const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
87
- featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
88
- (0, chai_1.expect)(renderPathSpy.calledOnce);
89
- const firstCall = renderPathSpy.getCalls()[0];
90
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
91
- (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
92
- (0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
93
- (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
94
- });
95
- it("should readAndRender multiple ring polygon feature", async () => {
96
- const featurePbf = createFeaturePBF();
97
- const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.geometryType);
98
- const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf);
99
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
100
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
101
- const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
102
- featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
103
- (0, chai_1.expect)(renderPathSpy.calledOnce);
104
- const firstCall = renderPathSpy.getCalls()[0];
105
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
106
- (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
107
- (0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
108
- (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
109
- });
110
- it("should readAndRender simple path", async () => {
111
- const featurePbf = createFeaturePBF();
112
- const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf);
113
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.geometryType), PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
114
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
115
- const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
116
- featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
117
- (0, chai_1.expect)(renderPathSpy.calledOnce);
118
- const firstCall = renderPathSpy.getCalls()[0];
119
- (0, chai_1.expect)(firstCall).to.not.undefined;
120
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
121
- (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
122
- (0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
123
- (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
124
- });
125
- it("should readAndRender multi path", async () => {
126
- const featurePbf = createFeaturePBF();
127
- const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf);
128
- const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);
129
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
130
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
131
- const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
132
- featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
133
- (0, chai_1.expect)(renderPathSpy.calledOnce);
134
- const firstCall = renderPathSpy.getCalls()[0];
135
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
136
- (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
137
- (0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
138
- (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
139
- });
140
- it("should readAndRender simple point", async () => {
141
- const featurePbf = createFeaturePBF();
142
- const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf);
143
- const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);
144
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
145
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
146
- const spy = sinon.spy(featureRenderer, "renderPoint");
147
- featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
148
- (0, chai_1.expect)(spy.calledOnce);
149
- // Pbf contains already the right output format expect, lets rely on that.
150
- const geometryCoords = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;
151
- const firstCall = spy.getCalls()[0];
152
- (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
153
- (0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
154
- (0, chai_1.expect)(firstCall.args[2]).to.eql(2); // stride
155
- });
156
- it("should log error when readAndRender / readFeatureInfo is called invalid response Data", async () => {
157
- const featurePbf = createFeaturePBF();
158
- const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer("esriGeometryAny", PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
159
- const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
160
- const logErrorSpy = sandbox.spy(core_bentley_1.Logger, "logError");
161
- featurePbf.readAndRender({ data: { test: "test" }, exceedTransferLimit: false }, featureRenderer);
162
- (0, chai_1.expect)(logErrorSpy.calledOnce);
163
- logErrorSpy.resetHistory();
164
- featurePbf.readFeatureInfo({ data: { test: "test" }, exceedTransferLimit: false }, []);
165
- (0, chai_1.expect)(logErrorSpy.calledOnce);
166
- });
167
- });
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 ArcGisFeaturePBF_1 = require("../../ArcGisFeature/ArcGisFeaturePBF");
12
+ const ArcGisFeatureRenderer_1 = require("../../ArcGisFeature/ArcGisFeatureRenderer");
13
+ const ArcGisSymbologyRenderer_1 = require("../../ArcGisFeature/ArcGisSymbologyRenderer");
14
+ const esriPBuffer_gen_1 = require("../../ArcGisFeature/esriPBuffer.gen");
15
+ const Mocks_1 = require("./Mocks");
16
+ const PhillyLandmarksDataset_1 = require("./PhillyLandmarksDataset");
17
+ const createFeaturePBF = () => {
18
+ const settings = core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource);
19
+ const featurePbf = new ArcGisFeaturePBF_1.ArcGisFeaturePBF(settings, { name: "SampleLayer" });
20
+ // Locale configuration depends on the testing machine (i.e. linux vs windows),
21
+ // so we need to force date display to Iso to get a consistent value.
22
+ // In real scenario, we still want dates to be displayed in end-user's locale.
23
+ featurePbf.forceDateDisplayValueToIso = true;
24
+ return featurePbf;
25
+ };
26
+ describe("ArcGisFeaturePBF", () => {
27
+ const sandbox = sinon.createSandbox();
28
+ afterEach(async () => {
29
+ sandbox.restore();
30
+ });
31
+ it("should convert pbf geometry type to Esri types", async () => {
32
+ (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch))
33
+ .to.equals("esriGeometryMultiPatch");
34
+ (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint))
35
+ .to.equals("esriGeometryMultipoint");
36
+ (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint))
37
+ .to.equals("esriGeometryPoint");
38
+ (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon))
39
+ .to.equals("esriGeometryPolygon");
40
+ (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline))
41
+ .to.equals("esriGeometryPolyline");
42
+ (0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(""))
43
+ .to.equals("esriGeometryNull");
44
+ });
45
+ it("should read FeatureInfo in PBF", async () => {
46
+ const byteArray = core_common_1.Base64EncodedString.toUint8Array(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryPbf);
47
+ const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
48
+ const settings = core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource);
49
+ const featurePbf = new ArcGisFeaturePBF_1.ArcGisFeaturePBF(settings, { name: "SampleLayer" });
50
+ // In some cases, PBF gives more floating-point precision than JSON.
51
+ // Since I want to use the same output reference for both formats, I force a max precision of 8.
52
+ featurePbf.floatPrecision = 8;
53
+ const results = [];
54
+ featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
55
+ // Make deep comparison by using JSON.stringify
56
+ (0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));
57
+ });
58
+ it("should read FeatureInfo from PBF (philly transportation)", async () => {
59
+ const byteArray = core_common_1.Base64EncodedString.toUint8Array(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryEncodedPbf);
60
+ const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
61
+ const featurePbf = createFeaturePBF();
62
+ // In some cases, PBF gives more floating-point precision than JSON.
63
+ // Since I want to use the same output reference for both formats, I force a max precision.
64
+ featurePbf.floatPrecision = 2;
65
+ const results = [];
66
+ featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
67
+ // Make deep comparison by using JSON.stringify
68
+ (0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));
69
+ });
70
+ it("should read all data types from FeatureInfo ", async () => {
71
+ // In this test we use a synthetic PBuffer object to initialize a feature collection object.
72
+ // The is to ensure we cover correctly all possible attribute value types.
73
+ const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.fieldsCoveragePbufferCollection);
74
+ const featurePbf = createFeaturePBF();
75
+ const results = [];
76
+ featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
77
+ // Make deep comparison by using JSON.stringify
78
+ (0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.fieldsCoverageGetFeatureInfoResultRef));
79
+ });
80
+ it("should readAndRender single ring polygon feature", async () => {
81
+ const featurePbf = createFeaturePBF();
82
+ const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf);
83
+ const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.geometryType);
84
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
85
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
86
+ const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
87
+ featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
88
+ (0, chai_1.expect)(renderPathSpy.calledOnce);
89
+ const firstCall = renderPathSpy.getCalls()[0];
90
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
91
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
92
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
93
+ (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
94
+ });
95
+ it("should readAndRender multiple ring polygon feature", async () => {
96
+ const featurePbf = createFeaturePBF();
97
+ const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.geometryType);
98
+ const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf);
99
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
100
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
101
+ const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
102
+ featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
103
+ (0, chai_1.expect)(renderPathSpy.calledOnce);
104
+ const firstCall = renderPathSpy.getCalls()[0];
105
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
106
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
107
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
108
+ (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
109
+ });
110
+ it("should readAndRender simple path", async () => {
111
+ const featurePbf = createFeaturePBF();
112
+ const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf);
113
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.geometryType), PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
114
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
115
+ const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
116
+ featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
117
+ (0, chai_1.expect)(renderPathSpy.calledOnce);
118
+ const firstCall = renderPathSpy.getCalls()[0];
119
+ (0, chai_1.expect)(firstCall).to.not.undefined;
120
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
121
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
122
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
123
+ (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
124
+ });
125
+ it("should readAndRender multi path", async () => {
126
+ const featurePbf = createFeaturePBF();
127
+ const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf);
128
+ const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);
129
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
130
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
131
+ const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
132
+ featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
133
+ (0, chai_1.expect)(renderPathSpy.calledOnce);
134
+ const firstCall = renderPathSpy.getCalls()[0];
135
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
136
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
137
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
138
+ (0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
139
+ });
140
+ it("should readAndRender simple point", async () => {
141
+ const featurePbf = createFeaturePBF();
142
+ const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf);
143
+ const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);
144
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
145
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
146
+ const spy = sinon.spy(featureRenderer, "renderPoint");
147
+ featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
148
+ (0, chai_1.expect)(spy.calledOnce);
149
+ // Pbf contains already the right output format expect, lets rely on that.
150
+ const geometryCoords = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;
151
+ const firstCall = spy.getCalls()[0];
152
+ (0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
153
+ (0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
154
+ (0, chai_1.expect)(firstCall.args[2]).to.eql(2); // stride
155
+ });
156
+ it("should log error when readAndRender / readFeatureInfo is called invalid response Data", async () => {
157
+ const featurePbf = createFeaturePBF();
158
+ const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer("esriGeometryAny", PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
159
+ const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
160
+ const logErrorSpy = sandbox.spy(core_bentley_1.Logger, "logError");
161
+ featurePbf.readAndRender({ data: { test: "test" }, exceedTransferLimit: false }, featureRenderer);
162
+ (0, chai_1.expect)(logErrorSpy.calledOnce);
163
+ logErrorSpy.resetHistory();
164
+ featurePbf.readFeatureInfo({ data: { test: "test" }, exceedTransferLimit: false }, []);
165
+ (0, chai_1.expect)(logErrorSpy.calledOnce);
166
+ });
167
+ });
168
168
  //# sourceMappingURL=ArcGisFeaturePBF.test.js.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=ArcGisFeatureProvider.test.d.ts.map