@itwin/map-layers-formats 4.0.0-dev.52 → 4.0.0-dev.55

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 (148) 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 +3 -3
  5. package/.rush/temp/package-deps_cover.json +3 -3
  6. package/.rush/temp/package-deps_docs.json +3 -3
  7. package/.rush/temp/shrinkwrap-deps.json +44 -51
  8. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  9. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +132 -132
  13. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  14. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -200
  15. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  16. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -421
  17. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  18. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  19. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  20. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
  21. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  22. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
  23. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  24. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
  25. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  26. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  27. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -42
  28. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  29. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  30. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -189
  31. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  32. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  33. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2270 -2270
  34. package/lib/cjs/map-layers-formats.d.ts +8 -8
  35. package/lib/cjs/map-layers-formats.js +28 -24
  36. package/lib/cjs/map-layers-formats.js.map +1 -1
  37. package/lib/cjs/mapLayersFormats.d.ts +10 -10
  38. package/lib/cjs/mapLayersFormats.js +28 -28
  39. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  40. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
  41. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  42. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
  43. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  44. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
  45. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  46. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -679
  47. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  48. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  49. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
  50. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  51. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
  52. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  53. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
  54. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  55. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
  56. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
  57. package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
  58. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  59. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
  60. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  61. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  62. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
  63. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  64. package/lib/cjs/test/coverage/.nyc_output/186e5c44-6980-4d7a-9c52-bb4c9af0ad82.json +1 -0
  65. package/lib/cjs/test/coverage/.nyc_output/processinfo/186e5c44-6980-4d7a-9c52-bb4c9af0ad82.json +1 -0
  66. package/lib/cjs/test/coverage/.nyc_output/processinfo/a4fe7565-9b86-4573-8375-3819c82246d8.json +1 -0
  67. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
  68. package/lib/cjs/test/coverage/cobertura-coverage.xml +39 -39
  69. package/lib/cjs/test/coverage/lcov-report/index.html +1 -1
  70. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
  71. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +1 -1
  72. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +1 -1
  73. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +1 -1
  74. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
  75. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
  76. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
  77. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +1 -1
  78. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +1 -1
  79. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +1 -1
  80. package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
  81. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
  82. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
  83. package/lib/cjs/test/coverage/lcov.info +47 -47
  84. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  85. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  86. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
  87. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  88. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  89. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -128
  90. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  91. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -196
  92. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  93. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -417
  94. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  95. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  96. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  97. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
  98. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  99. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
  100. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  103. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  104. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -38
  105. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  106. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  107. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -182
  108. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  109. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  110. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2267 -2267
  111. package/lib/esm/map-layers-formats.d.ts +8 -8
  112. package/lib/esm/map-layers-formats.js +12 -12
  113. package/lib/esm/mapLayersFormats.d.ts +10 -10
  114. package/lib/esm/mapLayersFormats.js +24 -24
  115. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  116. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
  117. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  118. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
  119. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  120. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
  121. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  122. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -677
  123. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  124. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  125. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
  126. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  127. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
  128. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  129. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
  130. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  131. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
  132. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
  133. package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
  134. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  135. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
  136. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  137. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  138. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
  139. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  140. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  141. package/lib/test/junit_results.xml +52 -52
  142. package/map-layers-formats.build.log +2 -2
  143. package/package.json +13 -13
  144. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
  145. package/lib/cjs/test/coverage/.nyc_output/579ba75b-0cfc-4b77-82ad-4f939b76443a.json +0 -1
  146. package/lib/cjs/test/coverage/.nyc_output/processinfo/579ba75b-0cfc-4b77-82ad-4f939b76443a.json +0 -1
  147. package/lib/cjs/test/coverage/.nyc_output/processinfo/f0a37b08-29bc-49a6-a608-b82501dccee7.json +0 -1
  148. /package/lib/cjs/test/coverage/.nyc_output/{f0a37b08-29bc-49a6-a608-b82501dccee7.json → a4fe7565-9b86-4573-8375-3819c82246d8.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,39 +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
- 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
- }
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
+ }
39
39
  //# sourceMappingURL=ArcGisFeatureResponse.js.map