@itwin/map-layers-formats 4.0.0-dev.6 → 4.0.0-dev.60

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 (157) hide show
  1. package/.rush/temp/operation/build_ci/state.json +1 -1
  2. package/.rush/temp/operation/cover/state.json +1 -1
  3. package/.rush/temp/operation/docs/state.json +1 -1
  4. package/.rush/temp/package-deps_build_ci.json +6 -6
  5. package/.rush/temp/package-deps_cover.json +6 -6
  6. package/.rush/temp/package-deps_docs.json +6 -6
  7. package/.rush/temp/shrinkwrap-deps.json +180 -22
  8. package/CHANGELOG.json +21 -0
  9. package/CHANGELOG.md +14 -1
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  14. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +132 -134
  15. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  16. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  17. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -202
  18. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  19. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  20. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -422
  21. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  22. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  23. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  24. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
  25. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  26. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
  27. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  28. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
  29. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  30. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  31. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -43
  32. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  33. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  34. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  35. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -192
  36. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  37. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  38. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2270 -2270
  39. package/lib/cjs/map-layers-formats.d.ts +8 -8
  40. package/lib/cjs/map-layers-formats.js +28 -24
  41. package/lib/cjs/map-layers-formats.js.map +1 -1
  42. package/lib/cjs/mapLayersFormats.d.ts +10 -10
  43. package/lib/cjs/mapLayersFormats.js +28 -28
  44. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  45. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
  46. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  47. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
  48. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  49. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
  50. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  51. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -680
  52. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  53. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  54. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
  55. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  56. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
  57. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  58. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
  59. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  60. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  61. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
  62. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
  63. package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
  64. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  65. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
  66. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  67. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  68. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
  69. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  70. package/lib/cjs/test/coverage/.nyc_output/3f025032-ec3e-4471-b05c-cd145bff9ba2.json +1 -0
  71. package/lib/cjs/test/coverage/.nyc_output/processinfo/2cc62aaf-7bdd-43fe-84af-17ff34118ab9.json +1 -0
  72. package/lib/cjs/test/coverage/.nyc_output/processinfo/{5c2897a9-bc6a-4e12-9b66-4c2a6ef8f467.json → 3f025032-ec3e-4471-b05c-cd145bff9ba2.json} +1 -1
  73. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
  74. package/lib/cjs/test/coverage/cobertura-coverage.xml +71 -71
  75. package/lib/cjs/test/coverage/lcov-report/index.html +5 -5
  76. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
  77. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +10 -10
  78. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +7 -7
  79. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +10 -10
  80. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
  81. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
  82. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
  83. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +4 -4
  84. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +8 -8
  85. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +13 -13
  86. package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
  87. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
  88. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
  89. package/lib/cjs/test/coverage/lcov.info +355 -531
  90. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  91. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  92. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
  93. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  94. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  95. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -130
  96. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  97. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  98. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -198
  99. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  100. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -418
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  103. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  104. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  105. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
  106. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  107. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
  108. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  109. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
  110. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  111. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  112. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -39
  113. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  114. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  115. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  116. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -185
  117. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  118. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  119. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2267 -2267
  120. package/lib/esm/map-layers-formats.d.ts +8 -8
  121. package/lib/esm/map-layers-formats.js +12 -12
  122. package/lib/esm/mapLayersFormats.d.ts +10 -10
  123. package/lib/esm/mapLayersFormats.js +24 -24
  124. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  125. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
  126. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  127. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
  128. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  129. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
  130. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  131. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -678
  132. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  133. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  134. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
  135. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  136. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
  137. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  138. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
  139. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  140. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  141. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
  142. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
  143. package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
  144. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  145. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
  146. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  147. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  148. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
  149. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  150. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  151. package/lib/test/junit_results.xml +51 -51
  152. package/package.json +13 -13
  153. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
  154. package/tsconfig.json +1 -2
  155. package/lib/cjs/test/coverage/.nyc_output/5c2897a9-bc6a-4e12-9b66-4c2a6ef8f467.json +0 -1
  156. package/lib/cjs/test/coverage/.nyc_output/processinfo/703fc6cd-b118-4918-beb4-7b470ccb986a.json +0 -1
  157. /package/lib/cjs/test/coverage/.nyc_output/{703fc6cd-b118-4918-beb4-7b470ccb986a.json → 2cc62aaf-7bdd-43fe-84af-17ff34118ab9.json} +0 -0
@@ -1,34 +1,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
- exports.ArcGisFeatureReader = void 0;
8
- const appui_abstract_1 = require("@itwin/appui-abstract");
9
- /** @internal */
10
- class ArcGisFeatureReader {
11
- constructor(settings, layerMetadata) {
12
- // Force display value of date to ISO 8601 format.
13
- // Turning this ON, will disable display value in end-user's locale
14
- this.forceDateDisplayValueToIso = false;
15
- this.toFixedWithoutPadding = (value) => {
16
- return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));
17
- };
18
- this.getDisplayValue = (typename, value) => {
19
- if (value === undefined) {
20
- return "";
21
- }
22
- else if (typename === appui_abstract_1.StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {
23
- return value.toISOString();
24
- }
25
- else {
26
- return `${value}`;
27
- }
28
- };
29
- this._settings = settings;
30
- this._layerMetadata = layerMetadata;
31
- }
32
- }
33
- exports.ArcGisFeatureReader = ArcGisFeatureReader;
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.ArcGisFeatureReader = void 0;
8
+ const appui_abstract_1 = require("@itwin/appui-abstract");
9
+ /** @internal */
10
+ class ArcGisFeatureReader {
11
+ constructor(settings, layerMetadata) {
12
+ // Force display value of date to ISO 8601 format.
13
+ // Turning this ON, will disable display value in end-user's locale
14
+ this.forceDateDisplayValueToIso = false;
15
+ this.toFixedWithoutPadding = (value) => {
16
+ return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));
17
+ };
18
+ this.getDisplayValue = (typename, value) => {
19
+ if (value === undefined) {
20
+ return "";
21
+ }
22
+ else if (typename === appui_abstract_1.StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {
23
+ return value.toISOString();
24
+ }
25
+ else {
26
+ return `${value}`;
27
+ }
28
+ };
29
+ this._settings = settings;
30
+ this._layerMetadata = layerMetadata;
31
+ }
32
+ }
33
+ exports.ArcGisFeatureReader = ArcGisFeatureReader;
34
34
  //# 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,143 +1,143 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ArcGisFeatureRenderer = void 0;
4
- /** @internal */
5
- class ArcGisFeatureRenderer {
6
- constructor(context, symbol, world2PixelTransform) {
7
- this._symbol = symbol;
8
- this._context = context;
9
- this._transform = world2PixelTransform;
10
- }
11
- get transform() { return this._transform; }
12
- // Utility functions to make ease testing.
13
- closePath() {
14
- this._context.closePath();
15
- }
16
- lineTo(x, y) {
17
- this._context.lineTo(x, y);
18
- }
19
- moveTo(x, y) {
20
- this._context.moveTo(x, y);
21
- }
22
- fill() {
23
- this._context.fill();
24
- }
25
- stroke() {
26
- this._context.stroke();
27
- }
28
- /**
29
- * Render a path on the renderer's context.
30
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
31
- * @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)
32
- * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
33
- * @param fill Indicates if the path should be filled or not.
34
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
35
- */
36
- renderPath(geometryLengths, geometryCoords, fill, stride, relativeCoords) {
37
- if (stride < 2 || stride > 3) {
38
- return;
39
- }
40
- // Keep track of our position in the in the 'coords' array:
41
- // Every time we loop on the 'lengths' array, the position
42
- // to start reading vertices in the 'coords' must be the sum of all previously read vertices.
43
- let coordsOffset = 0;
44
- // Begin the path here.
45
- // Note: Even though path is closed inside the 'geometryLengths' loop,
46
- // it's import to begin the path only once.
47
- this._context.beginPath();
48
- for (const vertexCount of geometryLengths) {
49
- let lastPtX = 0, lastPtY = 0;
50
- for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
51
- let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
52
- let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
53
- if (vertexIdx === 0) {
54
- // first vertex is always "absolute" and must be drawn as 'moveTo' (i.e. not lineTo)
55
- if (relativeCoords) {
56
- lastPtX = pX;
57
- lastPtY = pY;
58
- }
59
- if (this._transform) {
60
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
61
- pX = transformedPoint.x;
62
- pY = transformedPoint.y;
63
- }
64
- this.moveTo(pX, pY);
65
- }
66
- else {
67
- // Following vertices are relative to the previous one (sadly not really well documented by ESRI)
68
- // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)
69
- if (relativeCoords) {
70
- pX = lastPtX = lastPtX + pX;
71
- pY = lastPtY = lastPtY + pY;
72
- }
73
- if (this._transform) {
74
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
75
- pX = transformedPoint.x;
76
- pY = transformedPoint.y;
77
- }
78
- this.lineTo(pX, pY);
79
- }
80
- }
81
- coordsOffset += stride * vertexCount;
82
- if (fill) {
83
- // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)
84
- this.closePath();
85
- }
86
- }
87
- if (fill) {
88
- this._symbol.applyFillStyle(this._context);
89
- this.fill();
90
- }
91
- this._symbol.applyStrokeStyle(this._context);
92
- this.stroke(); // draw line path or polygon outline
93
- }
94
- /**
95
- * Render a point on the renderer's context.
96
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
97
- * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
98
- * @param geometryCoords Array that linearly encodes vertices.
99
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
100
- */
101
- renderPoint(geometryLengths, geometryCoords, stride, relativeCoords) {
102
- if (stride < 2 || stride > 3) {
103
- return;
104
- }
105
- let coordsOffset = 0;
106
- if (geometryLengths.length === 0) {
107
- // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.
108
- if (geometryCoords.length >= stride) {
109
- if (this._transform) {
110
- const transformedPoint = this._transform.multiplyPoint2d({ x: geometryCoords[0], y: geometryCoords[1] });
111
- this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);
112
- }
113
- else {
114
- this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);
115
- }
116
- }
117
- }
118
- else {
119
- // MULTI-POINTS: Needs testing
120
- // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.
121
- for (const vertexCount of geometryLengths) {
122
- let lastPtX = 0, lastPtY = 0;
123
- for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
124
- let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
125
- let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
126
- if (relativeCoords) {
127
- pX = lastPtX = lastPtX + pX;
128
- pY = lastPtY = lastPtY + pY;
129
- }
130
- if (this._transform) {
131
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
132
- pX = transformedPoint.x;
133
- pY = transformedPoint.y;
134
- }
135
- this._symbol.drawPoint(this._context, pX, pY);
136
- }
137
- coordsOffset += stride * vertexCount;
138
- }
139
- }
140
- }
141
- }
142
- exports.ArcGisFeatureRenderer = ArcGisFeatureRenderer;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArcGisFeatureRenderer = void 0;
4
+ /** @internal */
5
+ class ArcGisFeatureRenderer {
6
+ constructor(context, symbol, world2PixelTransform) {
7
+ this._symbol = symbol;
8
+ this._context = context;
9
+ this._transform = world2PixelTransform;
10
+ }
11
+ get transform() { return this._transform; }
12
+ // Utility functions to make ease testing.
13
+ closePath() {
14
+ this._context.closePath();
15
+ }
16
+ lineTo(x, y) {
17
+ this._context.lineTo(x, y);
18
+ }
19
+ moveTo(x, y) {
20
+ this._context.moveTo(x, y);
21
+ }
22
+ fill() {
23
+ this._context.fill();
24
+ }
25
+ stroke() {
26
+ this._context.stroke();
27
+ }
28
+ /**
29
+ * Render a path on the renderer's context.
30
+ * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
31
+ * @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)
32
+ * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
33
+ * @param fill Indicates if the path should be filled or not.
34
+ * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
35
+ */
36
+ renderPath(geometryLengths, geometryCoords, fill, stride, relativeCoords) {
37
+ if (stride < 2 || stride > 3) {
38
+ return;
39
+ }
40
+ // Keep track of our position in the in the 'coords' array:
41
+ // Every time we loop on the 'lengths' array, the position
42
+ // to start reading vertices in the 'coords' must be the sum of all previously read vertices.
43
+ let coordsOffset = 0;
44
+ // Begin the path here.
45
+ // Note: Even though path is closed inside the 'geometryLengths' loop,
46
+ // it's import to begin the path only once.
47
+ this._context.beginPath();
48
+ for (const vertexCount of geometryLengths) {
49
+ let lastPtX = 0, lastPtY = 0;
50
+ for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
51
+ let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
52
+ let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
53
+ if (vertexIdx === 0) {
54
+ // first vertex is always "absolute" and must be drawn as 'moveTo' (i.e. not lineTo)
55
+ if (relativeCoords) {
56
+ lastPtX = pX;
57
+ lastPtY = pY;
58
+ }
59
+ if (this._transform) {
60
+ const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
61
+ pX = transformedPoint.x;
62
+ pY = transformedPoint.y;
63
+ }
64
+ this.moveTo(pX, pY);
65
+ }
66
+ else {
67
+ // Following vertices are relative to the previous one (sadly not really well documented by ESRI)
68
+ // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)
69
+ if (relativeCoords) {
70
+ pX = lastPtX = lastPtX + pX;
71
+ pY = lastPtY = lastPtY + pY;
72
+ }
73
+ if (this._transform) {
74
+ const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
75
+ pX = transformedPoint.x;
76
+ pY = transformedPoint.y;
77
+ }
78
+ this.lineTo(pX, pY);
79
+ }
80
+ }
81
+ coordsOffset += stride * vertexCount;
82
+ if (fill) {
83
+ // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)
84
+ this.closePath();
85
+ }
86
+ }
87
+ if (fill) {
88
+ this._symbol.applyFillStyle(this._context);
89
+ this.fill();
90
+ }
91
+ this._symbol.applyStrokeStyle(this._context);
92
+ this.stroke(); // draw line path or polygon outline
93
+ }
94
+ /**
95
+ * Render a point on the renderer's context.
96
+ * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
97
+ * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
98
+ * @param geometryCoords Array that linearly encodes vertices.
99
+ * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
100
+ */
101
+ renderPoint(geometryLengths, geometryCoords, stride, relativeCoords) {
102
+ if (stride < 2 || stride > 3) {
103
+ return;
104
+ }
105
+ let coordsOffset = 0;
106
+ if (geometryLengths.length === 0) {
107
+ // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.
108
+ if (geometryCoords.length >= stride) {
109
+ if (this._transform) {
110
+ const transformedPoint = this._transform.multiplyPoint2d({ x: geometryCoords[0], y: geometryCoords[1] });
111
+ this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);
112
+ }
113
+ else {
114
+ this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);
115
+ }
116
+ }
117
+ }
118
+ else {
119
+ // MULTI-POINTS: Needs testing
120
+ // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.
121
+ for (const vertexCount of geometryLengths) {
122
+ let lastPtX = 0, lastPtY = 0;
123
+ for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
124
+ let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
125
+ let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
126
+ if (relativeCoords) {
127
+ pX = lastPtX = lastPtX + pX;
128
+ pY = lastPtY = lastPtY + pY;
129
+ }
130
+ if (this._transform) {
131
+ const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
132
+ pX = transformedPoint.x;
133
+ pY = transformedPoint.y;
134
+ }
135
+ this._symbol.drawPoint(this._context, pX, pY);
136
+ }
137
+ coordsOffset += stride * vertexCount;
138
+ }
139
+ }
140
+ }
141
+ }
142
+ exports.ArcGisFeatureRenderer = ArcGisFeatureRenderer;
143
143
  //# 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,44 +1,43 @@
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.ArcGisFeatureResponse = void 0;
8
- const esriPBuffer_gen_1 = require("./esriPBuffer.gen");
9
- /** @internal */
10
- class ArcGisFeatureResponse {
11
- constructor(format, response, envelope) {
12
- this.format = format;
13
- this._response = response;
14
- this.envelope = envelope;
15
- }
16
- async getResponseData() {
17
- var _a, _b;
18
- let data;
19
- try {
20
- const tileResponse = await this._response;
21
- if (tileResponse === undefined || tileResponse.status !== 200)
22
- return undefined;
23
- if (this.format === "PBF") {
24
- const byteArray = new Uint8Array(await tileResponse.arrayBuffer());
25
- if (!byteArray || (byteArray.length === 0))
26
- return undefined;
27
- data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
28
- const collection = data;
29
- 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 };
30
- }
31
- else {
32
- data = await tileResponse.json();
33
- if (data === undefined || data == null)
34
- return undefined;
35
- return { data, exceedTransferLimit: data.exceededTransferLimit };
36
- }
37
- }
38
- catch (_e) {
39
- return undefined;
40
- }
41
- }
42
- }
43
- exports.ArcGisFeatureResponse = ArcGisFeatureResponse;
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.ArcGisFeatureResponse = void 0;
8
+ const esriPBuffer_gen_1 = require("./esriPBuffer.gen");
9
+ /** @internal */
10
+ class ArcGisFeatureResponse {
11
+ constructor(format, response, envelope) {
12
+ this.format = format;
13
+ this._response = response;
14
+ this.envelope = envelope;
15
+ }
16
+ async getResponseData() {
17
+ let data;
18
+ try {
19
+ const tileResponse = await this._response;
20
+ if (tileResponse === undefined || tileResponse.status !== 200)
21
+ return undefined;
22
+ if (this.format === "PBF") {
23
+ const byteArray = new Uint8Array(await tileResponse.arrayBuffer());
24
+ if (!byteArray || (byteArray.length === 0))
25
+ return undefined;
26
+ data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
27
+ const collection = data;
28
+ return { data, exceedTransferLimit: collection?.queryResult?.featureResult?.exceededTransferLimit };
29
+ }
30
+ else {
31
+ data = await tileResponse.json();
32
+ if (data === undefined || data == null)
33
+ return undefined;
34
+ return { data, exceedTransferLimit: data.exceededTransferLimit };
35
+ }
36
+ }
37
+ catch (_e) {
38
+ return undefined;
39
+ }
40
+ }
41
+ }
42
+ exports.ArcGisFeatureResponse = ArcGisFeatureResponse;
44
43
  //# 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,uDAAgD;AAwBhD,gBAAgB;AAChB,MAAa,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,6BAAW,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;AAxCD,sDAwCC","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,uDAAgD;AAwBhD,gBAAgB;AAChB,MAAa,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,6BAAW,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;AAxCD,sDAwCC","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"]}