@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,30 +1,30 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- import { StandardTypeNames } from "@itwin/appui-abstract";
6
- /** @internal */
7
- export class ArcGisFeatureReader {
8
- constructor(settings, layerMetadata) {
9
- // Force display value of date to ISO 8601 format.
10
- // Turning this ON, will disable display value in end-user's locale
11
- this.forceDateDisplayValueToIso = false;
12
- this.toFixedWithoutPadding = (value) => {
13
- return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));
14
- };
15
- this.getDisplayValue = (typename, value) => {
16
- if (value === undefined) {
17
- return "";
18
- }
19
- else if (typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {
20
- return value.toISOString();
21
- }
22
- else {
23
- return `${value}`;
24
- }
25
- };
26
- this._settings = settings;
27
- this._layerMetadata = layerMetadata;
28
- }
29
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { StandardTypeNames } from "@itwin/appui-abstract";
6
+ /** @internal */
7
+ export class ArcGisFeatureReader {
8
+ constructor(settings, layerMetadata) {
9
+ // Force display value of date to ISO 8601 format.
10
+ // Turning this ON, will disable display value in end-user's locale
11
+ this.forceDateDisplayValueToIso = false;
12
+ this.toFixedWithoutPadding = (value) => {
13
+ return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));
14
+ };
15
+ this.getDisplayValue = (typename, value) => {
16
+ if (value === undefined) {
17
+ return "";
18
+ }
19
+ else if (typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {
20
+ return value.toISOString();
21
+ }
22
+ else {
23
+ return `${value}`;
24
+ }
25
+ };
26
+ this._settings = settings;
27
+ this._layerMetadata = layerMetadata;
28
+ }
29
+ }
30
30
  //# sourceMappingURL=ArcGisFeatureReader.js.map
@@ -1,33 +1,33 @@
1
- import { Transform } from "@itwin/core-geometry";
2
- import { ArcGisSymbologyRenderer } from "./ArcGisSymbologyRenderer";
3
- /** @internal */
4
- export declare class ArcGisFeatureRenderer {
5
- private _symbol;
6
- private _transform;
7
- private _context;
8
- constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform);
9
- get transform(): Transform | undefined;
10
- private closePath;
11
- private lineTo;
12
- private moveTo;
13
- private fill;
14
- private stroke;
15
- /**
16
- * Render a path on the renderer's context.
17
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
18
- * @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
19
- * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
20
- * @param fill Indicates if the path should be filled or not.
21
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
22
- */
23
- renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean): void;
24
- /**
25
- * Render a point on the renderer's context.
26
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
27
- * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
28
- * @param geometryCoords Array that linearly encodes vertices.
29
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
30
- */
31
- renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean): void;
32
- }
1
+ import { Transform } from "@itwin/core-geometry";
2
+ import { ArcGisSymbologyRenderer } from "./ArcGisSymbologyRenderer";
3
+ /** @internal */
4
+ export declare class ArcGisFeatureRenderer {
5
+ private _symbol;
6
+ private _transform;
7
+ private _context;
8
+ constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform);
9
+ get transform(): Transform | undefined;
10
+ private closePath;
11
+ private lineTo;
12
+ private moveTo;
13
+ private fill;
14
+ private stroke;
15
+ /**
16
+ * Render a path on the renderer's context.
17
+ * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
18
+ * @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
19
+ * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
20
+ * @param fill Indicates if the path should be filled or not.
21
+ * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
22
+ */
23
+ renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean): void;
24
+ /**
25
+ * Render a point on the renderer's context.
26
+ * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
27
+ * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
28
+ * @param geometryCoords Array that linearly encodes vertices.
29
+ * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
30
+ */
31
+ renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean): void;
32
+ }
33
33
  //# sourceMappingURL=ArcGisFeatureRenderer.d.ts.map
@@ -1,139 +1,139 @@
1
- /** @internal */
2
- export class ArcGisFeatureRenderer {
3
- constructor(context, symbol, world2PixelTransform) {
4
- this._symbol = symbol;
5
- this._context = context;
6
- this._transform = world2PixelTransform;
7
- }
8
- get transform() { return this._transform; }
9
- // Utility functions to make ease testing.
10
- closePath() {
11
- this._context.closePath();
12
- }
13
- lineTo(x, y) {
14
- this._context.lineTo(x, y);
15
- }
16
- moveTo(x, y) {
17
- this._context.moveTo(x, y);
18
- }
19
- fill() {
20
- this._context.fill();
21
- }
22
- stroke() {
23
- this._context.stroke();
24
- }
25
- /**
26
- * Render a path on the renderer's context.
27
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
28
- * @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
29
- * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
30
- * @param fill Indicates if the path should be filled or not.
31
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
32
- */
33
- renderPath(geometryLengths, geometryCoords, fill, stride, relativeCoords) {
34
- if (stride < 2 || stride > 3) {
35
- return;
36
- }
37
- // Keep track of our position in the in the 'coords' array:
38
- // Every time we loop on the 'lengths' array, the position
39
- // to start reading vertices in the 'coords' must be the sum of all previously read vertices.
40
- let coordsOffset = 0;
41
- // Begin the path here.
42
- // Note: Even though path is closed inside the 'geometryLengths' loop,
43
- // it's import to begin the path only once.
44
- this._context.beginPath();
45
- for (const vertexCount of geometryLengths) {
46
- let lastPtX = 0, lastPtY = 0;
47
- for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
48
- let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
49
- let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
50
- if (vertexIdx === 0) {
51
- // first vertex is always "absolute" and must be drawn as 'moveTo' (i.e. not lineTo)
52
- if (relativeCoords) {
53
- lastPtX = pX;
54
- lastPtY = pY;
55
- }
56
- if (this._transform) {
57
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
58
- pX = transformedPoint.x;
59
- pY = transformedPoint.y;
60
- }
61
- this.moveTo(pX, pY);
62
- }
63
- else {
64
- // Following vertices are relative to the previous one (sadly not really well documented by ESRI)
65
- // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)
66
- if (relativeCoords) {
67
- pX = lastPtX = lastPtX + pX;
68
- pY = lastPtY = lastPtY + pY;
69
- }
70
- if (this._transform) {
71
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
72
- pX = transformedPoint.x;
73
- pY = transformedPoint.y;
74
- }
75
- this.lineTo(pX, pY);
76
- }
77
- }
78
- coordsOffset += stride * vertexCount;
79
- if (fill) {
80
- // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)
81
- this.closePath();
82
- }
83
- }
84
- if (fill) {
85
- this._symbol.applyFillStyle(this._context);
86
- this.fill();
87
- }
88
- this._symbol.applyStrokeStyle(this._context);
89
- this.stroke(); // draw line path or polygon outline
90
- }
91
- /**
92
- * Render a point on the renderer's context.
93
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
94
- * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
95
- * @param geometryCoords Array that linearly encodes vertices.
96
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
97
- */
98
- renderPoint(geometryLengths, geometryCoords, stride, relativeCoords) {
99
- if (stride < 2 || stride > 3) {
100
- return;
101
- }
102
- let coordsOffset = 0;
103
- if (geometryLengths.length === 0) {
104
- // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.
105
- if (geometryCoords.length >= stride) {
106
- if (this._transform) {
107
- const transformedPoint = this._transform.multiplyPoint2d({ x: geometryCoords[0], y: geometryCoords[1] });
108
- this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);
109
- }
110
- else {
111
- this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);
112
- }
113
- }
114
- }
115
- else {
116
- // MULTI-POINTS: Needs testing
117
- // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.
118
- for (const vertexCount of geometryLengths) {
119
- let lastPtX = 0, lastPtY = 0;
120
- for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
121
- let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
122
- let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
123
- if (relativeCoords) {
124
- pX = lastPtX = lastPtX + pX;
125
- pY = lastPtY = lastPtY + pY;
126
- }
127
- if (this._transform) {
128
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
129
- pX = transformedPoint.x;
130
- pY = transformedPoint.y;
131
- }
132
- this._symbol.drawPoint(this._context, pX, pY);
133
- }
134
- coordsOffset += stride * vertexCount;
135
- }
136
- }
137
- }
138
- }
1
+ /** @internal */
2
+ export class ArcGisFeatureRenderer {
3
+ constructor(context, symbol, world2PixelTransform) {
4
+ this._symbol = symbol;
5
+ this._context = context;
6
+ this._transform = world2PixelTransform;
7
+ }
8
+ get transform() { return this._transform; }
9
+ // Utility functions to make ease testing.
10
+ closePath() {
11
+ this._context.closePath();
12
+ }
13
+ lineTo(x, y) {
14
+ this._context.lineTo(x, y);
15
+ }
16
+ moveTo(x, y) {
17
+ this._context.moveTo(x, y);
18
+ }
19
+ fill() {
20
+ this._context.fill();
21
+ }
22
+ stroke() {
23
+ this._context.stroke();
24
+ }
25
+ /**
26
+ * Render a path on the renderer's context.
27
+ * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
28
+ * @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
29
+ * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
30
+ * @param fill Indicates if the path should be filled or not.
31
+ * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
32
+ */
33
+ renderPath(geometryLengths, geometryCoords, fill, stride, relativeCoords) {
34
+ if (stride < 2 || stride > 3) {
35
+ return;
36
+ }
37
+ // Keep track of our position in the in the 'coords' array:
38
+ // Every time we loop on the 'lengths' array, the position
39
+ // to start reading vertices in the 'coords' must be the sum of all previously read vertices.
40
+ let coordsOffset = 0;
41
+ // Begin the path here.
42
+ // Note: Even though path is closed inside the 'geometryLengths' loop,
43
+ // it's import to begin the path only once.
44
+ this._context.beginPath();
45
+ for (const vertexCount of geometryLengths) {
46
+ let lastPtX = 0, lastPtY = 0;
47
+ for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
48
+ let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
49
+ let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
50
+ if (vertexIdx === 0) {
51
+ // first vertex is always "absolute" and must be drawn as 'moveTo' (i.e. not lineTo)
52
+ if (relativeCoords) {
53
+ lastPtX = pX;
54
+ lastPtY = pY;
55
+ }
56
+ if (this._transform) {
57
+ const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
58
+ pX = transformedPoint.x;
59
+ pY = transformedPoint.y;
60
+ }
61
+ this.moveTo(pX, pY);
62
+ }
63
+ else {
64
+ // Following vertices are relative to the previous one (sadly not really well documented by ESRI)
65
+ // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)
66
+ if (relativeCoords) {
67
+ pX = lastPtX = lastPtX + pX;
68
+ pY = lastPtY = lastPtY + pY;
69
+ }
70
+ if (this._transform) {
71
+ const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
72
+ pX = transformedPoint.x;
73
+ pY = transformedPoint.y;
74
+ }
75
+ this.lineTo(pX, pY);
76
+ }
77
+ }
78
+ coordsOffset += stride * vertexCount;
79
+ if (fill) {
80
+ // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)
81
+ this.closePath();
82
+ }
83
+ }
84
+ if (fill) {
85
+ this._symbol.applyFillStyle(this._context);
86
+ this.fill();
87
+ }
88
+ this._symbol.applyStrokeStyle(this._context);
89
+ this.stroke(); // draw line path or polygon outline
90
+ }
91
+ /**
92
+ * Render a point on the renderer's context.
93
+ * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
94
+ * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
95
+ * @param geometryCoords Array that linearly encodes vertices.
96
+ * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
97
+ */
98
+ renderPoint(geometryLengths, geometryCoords, stride, relativeCoords) {
99
+ if (stride < 2 || stride > 3) {
100
+ return;
101
+ }
102
+ let coordsOffset = 0;
103
+ if (geometryLengths.length === 0) {
104
+ // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.
105
+ if (geometryCoords.length >= stride) {
106
+ if (this._transform) {
107
+ const transformedPoint = this._transform.multiplyPoint2d({ x: geometryCoords[0], y: geometryCoords[1] });
108
+ this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);
109
+ }
110
+ else {
111
+ this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);
112
+ }
113
+ }
114
+ }
115
+ else {
116
+ // MULTI-POINTS: Needs testing
117
+ // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.
118
+ for (const vertexCount of geometryLengths) {
119
+ let lastPtX = 0, lastPtY = 0;
120
+ for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
121
+ let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
122
+ let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
123
+ if (relativeCoords) {
124
+ pX = lastPtX = lastPtX + pX;
125
+ pY = lastPtY = lastPtY + pY;
126
+ }
127
+ if (this._transform) {
128
+ const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
129
+ pX = transformedPoint.x;
130
+ pY = transformedPoint.y;
131
+ }
132
+ this._symbol.drawPoint(this._context, pX, pY);
133
+ }
134
+ coordsOffset += stride * vertexCount;
135
+ }
136
+ }
137
+ }
138
+ }
139
139
  //# sourceMappingURL=ArcGisFeatureRenderer.js.map
@@ -1,17 +1,17 @@
1
- import { ArcGisExtent, ArcGisFeatureFormat } from "./ArcGisFeatureQuery";
2
- /** @internal */
3
- export interface ArcGisResponseData {
4
- data: any;
5
- exceedTransferLimit: boolean;
6
- }
7
- /** @internal */
8
- export declare type ArcGisFieldType = "esriFieldTypeInteger" | "esriFieldTypeSmallInteger" | "esriFieldTypeDouble" | "esriFieldTypeSingle" | "esriFieldTypeString" | "esriFieldTypeDate" | "esriFieldTypeGeometry" | "esriFieldTypeOID" | "esriFieldTypeBlob" | "esriFieldTypeGlobalID" | "esriFieldTypeRaster" | "esriFieldTypeGUID" | "esriFieldTypeXML";
9
- /** @internal */
10
- export declare class ArcGisFeatureResponse {
11
- readonly format: ArcGisFeatureFormat;
12
- readonly envelope: ArcGisExtent | undefined;
13
- private _response;
14
- constructor(format: ArcGisFeatureFormat, response: Promise<Response>, envelope?: ArcGisExtent);
15
- getResponseData(): Promise<ArcGisResponseData | undefined>;
16
- }
1
+ import { ArcGisExtent, ArcGisFeatureFormat } from "./ArcGisFeatureQuery";
2
+ /** @internal */
3
+ export interface ArcGisResponseData {
4
+ data: any;
5
+ exceedTransferLimit: boolean;
6
+ }
7
+ /** @internal */
8
+ export type ArcGisFieldType = "esriFieldTypeInteger" | "esriFieldTypeSmallInteger" | "esriFieldTypeDouble" | "esriFieldTypeSingle" | "esriFieldTypeString" | "esriFieldTypeDate" | "esriFieldTypeGeometry" | "esriFieldTypeOID" | "esriFieldTypeBlob" | "esriFieldTypeGlobalID" | "esriFieldTypeRaster" | "esriFieldTypeGUID" | "esriFieldTypeXML";
9
+ /** @internal */
10
+ export declare class ArcGisFeatureResponse {
11
+ readonly format: ArcGisFeatureFormat;
12
+ readonly envelope: ArcGisExtent | undefined;
13
+ private _response;
14
+ constructor(format: ArcGisFeatureFormat, response: Promise<Response>, envelope?: ArcGisExtent);
15
+ getResponseData(): Promise<ArcGisResponseData | undefined>;
16
+ }
17
17
  //# sourceMappingURL=ArcGisFeatureResponse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArcGisFeatureResponse.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGzE,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,GAAG,CAAC;IACV,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,gBAAgB;AAChB,oBAAY,eAAe,GACzB,sBAAsB,GACpB,2BAA2B,GAC3B,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,kBAAkB,GAClB,mBAAmB,GACnB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB,gBAAgB;AAChB,qBAAa,qBAAqB;IAChC,SAAgB,MAAM,EAAE,mBAAmB,CAAC;IAC5C,SAAgB,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IAEnD,OAAO,CAAC,SAAS,CAAoB;gBAEzB,MAAM,EAAE,mBAAmB,EAAG,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,EAAE,YAAY;IAMjF,eAAe,IAAI,OAAO,CAAC,kBAAkB,GAAC,SAAS,CAAC;CA4BtE"}
1
+ {"version":3,"file":"ArcGisFeatureResponse.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGzE,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,GAAG,CAAC;IACV,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,gBAAgB;AAChB,MAAM,MAAM,eAAe,GACzB,sBAAsB,GACpB,2BAA2B,GAC3B,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,kBAAkB,GAClB,mBAAmB,GACnB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB,gBAAgB;AAChB,qBAAa,qBAAqB;IAChC,SAAgB,MAAM,EAAE,mBAAmB,CAAC;IAC5C,SAAgB,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IAEnD,OAAO,CAAC,SAAS,CAAoB;gBAEzB,MAAM,EAAE,mBAAmB,EAAG,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,EAAE,YAAY;IAMjF,eAAe,IAAI,OAAO,CAAC,kBAAkB,GAAC,SAAS,CAAC;CA4BtE"}
@@ -1,40 +1,39 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- import { esriPBuffer } from "./esriPBuffer.gen";
6
- /** @internal */
7
- export class ArcGisFeatureResponse {
8
- constructor(format, response, envelope) {
9
- this.format = format;
10
- this._response = response;
11
- this.envelope = envelope;
12
- }
13
- async getResponseData() {
14
- var _a, _b;
15
- let data;
16
- try {
17
- const tileResponse = await this._response;
18
- if (tileResponse === undefined || tileResponse.status !== 200)
19
- return undefined;
20
- if (this.format === "PBF") {
21
- const byteArray = new Uint8Array(await tileResponse.arrayBuffer());
22
- if (!byteArray || (byteArray.length === 0))
23
- return undefined;
24
- data = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
25
- const collection = data;
26
- return { data, exceedTransferLimit: (_b = (_a = collection === null || collection === void 0 ? void 0 : collection.queryResult) === null || _a === void 0 ? void 0 : _a.featureResult) === null || _b === void 0 ? void 0 : _b.exceededTransferLimit };
27
- }
28
- else {
29
- data = await tileResponse.json();
30
- if (data === undefined || data == null)
31
- return undefined;
32
- return { data, exceedTransferLimit: data.exceededTransferLimit };
33
- }
34
- }
35
- catch (_e) {
36
- return undefined;
37
- }
38
- }
39
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { esriPBuffer } from "./esriPBuffer.gen";
6
+ /** @internal */
7
+ export class ArcGisFeatureResponse {
8
+ constructor(format, response, envelope) {
9
+ this.format = format;
10
+ this._response = response;
11
+ this.envelope = envelope;
12
+ }
13
+ async getResponseData() {
14
+ let data;
15
+ try {
16
+ const tileResponse = await this._response;
17
+ if (tileResponse === undefined || tileResponse.status !== 200)
18
+ return undefined;
19
+ if (this.format === "PBF") {
20
+ const byteArray = new Uint8Array(await tileResponse.arrayBuffer());
21
+ if (!byteArray || (byteArray.length === 0))
22
+ return undefined;
23
+ data = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
24
+ const collection = data;
25
+ return { data, exceedTransferLimit: collection?.queryResult?.featureResult?.exceededTransferLimit };
26
+ }
27
+ else {
28
+ data = await tileResponse.json();
29
+ if (data === undefined || data == null)
30
+ return undefined;
31
+ return { data, exceedTransferLimit: data.exceededTransferLimit };
32
+ }
33
+ }
34
+ catch (_e) {
35
+ return undefined;
36
+ }
37
+ }
38
+ }
40
39
  //# sourceMappingURL=ArcGisFeatureResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArcGisFeatureResponse.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureResponse.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBhD,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IAMhC,YAAY,MAA2B,EAAG,QAA2B,EAAE,QAAuB;QAC5F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,eAAe;;QAC1B,IAAI,IAAmB,CAAC;QACxB,IAAI;YACF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC;YAC1C,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,CAAC,MAAM,KAAK,GAAG;gBAC3D,OAAO,SAAS,CAAC;YAEnB,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,EAAE;gBACzB,MAAM,SAAS,GAAe,IAAI,UAAU,CAAC,MAAM,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC/E,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC;oBACxC,OAAO,SAAS,CAAC;gBAEnB,IAAI,GAAG,WAAW,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;gBACnE,MAAM,UAAU,GAAG,IAA4C,CAAC;gBAChE,OAAO,EAAC,IAAI,EAAE,mBAAmB,EAAE,MAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,0CAAE,aAAa,0CAAE,qBAAqB,EAAC,CAAC;aAEnG;iBAAM;gBACL,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;gBACjC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,IAAI,IAAI;oBACpC,OAAO,SAAS,CAAC;gBAEnB,OAAO,EAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,qBAAqB,EAAC,CAAC;aAChE;SAEF;QAAC,OAAM,EAAE,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { ArcGisExtent, ArcGisFeatureFormat } from \"./ArcGisFeatureQuery\";\r\nimport { esriPBuffer } from \"./esriPBuffer.gen\";\r\n\r\n/** @internal */\r\nexport interface ArcGisResponseData {\r\n data: any;\r\n exceedTransferLimit: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport type ArcGisFieldType =\r\n \"esriFieldTypeInteger\"\r\n | \"esriFieldTypeSmallInteger\"\r\n | \"esriFieldTypeDouble\"\r\n | \"esriFieldTypeSingle\"\r\n | \"esriFieldTypeString\"\r\n | \"esriFieldTypeDate\"\r\n | \"esriFieldTypeGeometry\"\r\n | \"esriFieldTypeOID\"\r\n | \"esriFieldTypeBlob\"\r\n | \"esriFieldTypeGlobalID\"\r\n | \"esriFieldTypeRaster\"\r\n | \"esriFieldTypeGUID\"\r\n | \"esriFieldTypeXML\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureResponse {\r\n public readonly format: ArcGisFeatureFormat;\r\n public readonly envelope: ArcGisExtent | undefined;\r\n\r\n private _response: Promise<Response>;\r\n\r\n constructor(format: ArcGisFeatureFormat, response: Promise<Response>, envelope?: ArcGisExtent) {\r\n this.format = format;\r\n this._response = response;\r\n this.envelope = envelope;\r\n }\r\n\r\n public async getResponseData(): Promise<ArcGisResponseData|undefined> {\r\n let data: any|undefined;\r\n try {\r\n const tileResponse = await this._response;\r\n if (tileResponse === undefined || tileResponse.status !== 200 )\r\n return undefined;\r\n\r\n if (this.format === \"PBF\") {\r\n const byteArray: Uint8Array = new Uint8Array(await tileResponse.arrayBuffer());\r\n if (!byteArray || (byteArray.length === 0))\r\n return undefined;\r\n\r\n data = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);\r\n const collection = data as esriPBuffer.FeatureCollectionPBuffer;\r\n return {data, exceedTransferLimit: collection?.queryResult?.featureResult?.exceededTransferLimit};\r\n\r\n } else {\r\n data = await tileResponse.json();\r\n if (data === undefined || data == null)\r\n return undefined;\r\n\r\n return {data, exceedTransferLimit: data.exceededTransferLimit};\r\n }\r\n\r\n } catch(_e) {\r\n return undefined;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ArcGisFeatureResponse.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureResponse.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBhD,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IAMhC,YAAY,MAA2B,EAAG,QAA2B,EAAE,QAAuB;QAC5F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,eAAe;QAC1B,IAAI,IAAmB,CAAC;QACxB,IAAI;YACF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC;YAC1C,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,CAAC,MAAM,KAAK,GAAG;gBAC3D,OAAO,SAAS,CAAC;YAEnB,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,EAAE;gBACzB,MAAM,SAAS,GAAe,IAAI,UAAU,CAAC,MAAM,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC/E,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC;oBACxC,OAAO,SAAS,CAAC;gBAEnB,IAAI,GAAG,WAAW,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;gBACnE,MAAM,UAAU,GAAG,IAA4C,CAAC;gBAChE,OAAO,EAAC,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,qBAAqB,EAAC,CAAC;aAEnG;iBAAM;gBACL,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;gBACjC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,IAAI,IAAI;oBACpC,OAAO,SAAS,CAAC;gBAEnB,OAAO,EAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,qBAAqB,EAAC,CAAC;aAChE;SAEF;QAAC,OAAM,EAAE,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { ArcGisExtent, ArcGisFeatureFormat } from \"./ArcGisFeatureQuery\";\r\nimport { esriPBuffer } from \"./esriPBuffer.gen\";\r\n\r\n/** @internal */\r\nexport interface ArcGisResponseData {\r\n data: any;\r\n exceedTransferLimit: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport type ArcGisFieldType =\r\n \"esriFieldTypeInteger\"\r\n | \"esriFieldTypeSmallInteger\"\r\n | \"esriFieldTypeDouble\"\r\n | \"esriFieldTypeSingle\"\r\n | \"esriFieldTypeString\"\r\n | \"esriFieldTypeDate\"\r\n | \"esriFieldTypeGeometry\"\r\n | \"esriFieldTypeOID\"\r\n | \"esriFieldTypeBlob\"\r\n | \"esriFieldTypeGlobalID\"\r\n | \"esriFieldTypeRaster\"\r\n | \"esriFieldTypeGUID\"\r\n | \"esriFieldTypeXML\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureResponse {\r\n public readonly format: ArcGisFeatureFormat;\r\n public readonly envelope: ArcGisExtent | undefined;\r\n\r\n private _response: Promise<Response>;\r\n\r\n constructor(format: ArcGisFeatureFormat, response: Promise<Response>, envelope?: ArcGisExtent) {\r\n this.format = format;\r\n this._response = response;\r\n this.envelope = envelope;\r\n }\r\n\r\n public async getResponseData(): Promise<ArcGisResponseData|undefined> {\r\n let data: any|undefined;\r\n try {\r\n const tileResponse = await this._response;\r\n if (tileResponse === undefined || tileResponse.status !== 200 )\r\n return undefined;\r\n\r\n if (this.format === \"PBF\") {\r\n const byteArray: Uint8Array = new Uint8Array(await tileResponse.arrayBuffer());\r\n if (!byteArray || (byteArray.length === 0))\r\n return undefined;\r\n\r\n data = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);\r\n const collection = data as esriPBuffer.FeatureCollectionPBuffer;\r\n return {data, exceedTransferLimit: collection?.queryResult?.featureResult?.exceededTransferLimit};\r\n\r\n } else {\r\n data = await tileResponse.json();\r\n if (data === undefined || data == null)\r\n return undefined;\r\n\r\n return {data, exceedTransferLimit: data.exceededTransferLimit};\r\n }\r\n\r\n } catch(_e) {\r\n return undefined;\r\n }\r\n }\r\n}\r\n"]}