@itwin/map-layers-formats 3.7.17 → 3.8.0

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 (173) hide show
  1. package/.rush/temp/d8b4633f5de9404e0cc3d7f2d38b0b1796b3c3db.log +10 -0
  2. package/.rush/temp/operation/build_ci/state.json +1 -1
  3. package/.rush/temp/operation/cover/state.json +1 -1
  4. package/.rush/temp/operation/docs/state.json +1 -1
  5. package/.rush/temp/package-deps_cover.json +3 -3
  6. package/.rush/temp/package-deps_docs.json +3 -3
  7. package/CHANGELOG.json +6 -0
  8. package/CHANGELOG.md +6 -1
  9. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +134 -134
  14. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  15. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  16. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +205 -205
  17. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  18. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  19. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +426 -426
  20. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  21. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  22. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
  23. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  24. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  25. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
  26. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  27. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  28. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
  29. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
  30. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  31. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +43 -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.js +192 -192
  35. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  36. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  37. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2270 -2270
  38. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  39. package/lib/cjs/map-layers-formats.d.ts +8 -8
  40. package/lib/cjs/map-layers-formats.js +24 -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/mapLayersFormats.js.map +1 -1
  45. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  46. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
  47. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -1
  48. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  49. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
  50. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -1
  51. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  52. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
  53. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -1
  54. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  55. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +680 -680
  56. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  57. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  58. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
  59. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -1
  60. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  61. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
  62. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -1
  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/ArcGisSymbologyRenderer.test.js.map +1 -1
  69. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
  70. package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
  71. package/lib/cjs/test/ArcGisFeature/Mocks.js.map +1 -1
  72. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  73. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
  74. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  75. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  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/30f898ea-9e83-4ce6-b350-715085fba0aa.json +1 -0
  79. package/lib/cjs/test/coverage/.nyc_output/processinfo/{3ddcaf4b-cad7-4b8f-8aa1-4045acac103f.json → 30f898ea-9e83-4ce6-b350-715085fba0aa.json} +1 -1
  80. package/lib/cjs/test/coverage/.nyc_output/processinfo/94d85507-6283-4d4b-a1cb-0b0c400beb1b.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 +1 -1
  83. package/lib/cjs/test/coverage/lcov-report/index.html +1 -1
  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 +1 -1
  86. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +1 -1
  87. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +1 -1
  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 +1 -1
  92. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +1 -1
  93. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +1 -1
  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/tsconfig.tsbuildinfo +1 -1
  98. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  99. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +10 -10
  100. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +130 -130
  103. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  104. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  105. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +201 -201
  106. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  107. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  108. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +422 -422
  109. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  110. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  111. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
  112. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  113. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  114. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
  115. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  116. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  117. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
  118. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
  119. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  120. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +39 -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.js +185 -185
  124. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  125. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  126. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2267 -2267
  127. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  128. package/lib/esm/map-layers-formats.d.ts +8 -8
  129. package/lib/esm/map-layers-formats.js +12 -12
  130. package/lib/esm/map-layers-formats.js.map +1 -1
  131. package/lib/esm/mapLayersFormats.d.ts +10 -10
  132. package/lib/esm/mapLayersFormats.js +24 -24
  133. package/lib/esm/mapLayersFormats.js.map +1 -1
  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/ArcGisFeatureFeatureFormats.test.js.map +1 -1
  137. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  138. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
  139. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -1
  140. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  141. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
  142. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -1
  143. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  144. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +678 -678
  145. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  146. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  147. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
  148. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -1
  149. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  150. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
  151. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -1
  152. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  153. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
  154. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  155. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  156. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
  157. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -1
  158. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
  159. package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
  160. package/lib/esm/test/ArcGisFeature/Mocks.js.map +1 -1
  161. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  162. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +415 -415
  163. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  164. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  165. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +422 -422
  166. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  167. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  168. package/lib/test/junit_results.xml +47 -47
  169. package/package.json +12 -12
  170. package/.rush/temp/package-deps_build_ci.json +0 -36
  171. package/lib/cjs/test/coverage/.nyc_output/3ddcaf4b-cad7-4b8f-8aa1-4045acac103f.json +0 -1
  172. package/lib/cjs/test/coverage/.nyc_output/processinfo/ed368a38-912e-4cb7-acf0-becadbfc86d5.json +0 -1
  173. /package/lib/cjs/test/coverage/.nyc_output/{ed368a38-912e-4cb7-acf0-becadbfc86d5.json → 94d85507-6283-4d4b-a1cb-0b0c400beb1b.json} +0 -0
@@ -1,18 +1,18 @@
1
- import { Primitives, StandardTypeNames } from "@itwin/appui-abstract";
2
- import { ImageMapLayerSettings } from "@itwin/core-common";
3
- import { MapLayerFeatureInfo } from "@itwin/core-frontend";
4
- import { ArcGisFeatureRenderer } from "./ArcGisFeatureRenderer";
5
- import { ArcGisResponseData } from "./ArcGisFeatureResponse";
6
- /** @internal */
7
- export declare abstract class ArcGisFeatureReader {
8
- floatPrecision: number | undefined;
9
- forceDateDisplayValueToIso: boolean;
10
- protected _settings: ImageMapLayerSettings;
11
- protected _layerMetadata: any;
12
- constructor(settings: ImageMapLayerSettings, layerMetadata: any);
13
- abstract readAndRender(response: ArcGisResponseData, _renderer: ArcGisFeatureRenderer): void;
14
- abstract readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]): void;
15
- protected toFixedWithoutPadding: (value: number) => number;
16
- protected getDisplayValue: (typename: StandardTypeNames, value: Primitives.Value | undefined) => string;
17
- }
1
+ import { Primitives, StandardTypeNames } from "@itwin/appui-abstract";
2
+ import { ImageMapLayerSettings } from "@itwin/core-common";
3
+ import { MapLayerFeatureInfo } from "@itwin/core-frontend";
4
+ import { ArcGisFeatureRenderer } from "./ArcGisFeatureRenderer";
5
+ import { ArcGisResponseData } from "./ArcGisFeatureResponse";
6
+ /** @internal */
7
+ export declare abstract class ArcGisFeatureReader {
8
+ floatPrecision: number | undefined;
9
+ forceDateDisplayValueToIso: boolean;
10
+ protected _settings: ImageMapLayerSettings;
11
+ protected _layerMetadata: any;
12
+ constructor(settings: ImageMapLayerSettings, layerMetadata: any);
13
+ abstract readAndRender(response: ArcGisResponseData, _renderer: ArcGisFeatureRenderer): void;
14
+ abstract readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]): void;
15
+ protected toFixedWithoutPadding: (value: number) => number;
16
+ protected getDisplayValue: (typename: StandardTypeNames, value: Primitives.Value | undefined) => string;
17
+ }
18
18
  //# sourceMappingURL=ArcGisFeatureReader.d.ts.map
@@ -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 +1 @@
1
- {"version":3,"file":"ArcGisFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAAsE;AAMtE,gBAAgB;AAChB,MAAsB,mBAAmB;IAWvC,YAAmB,QAA+B,EAAE,aAAkB;QAPtE,kDAAkD;QAClD,mEAAmE;QAC5D,+BAA0B,GAAG,KAAK,CAAC;QAc/B,0BAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;YACnD,OAAO,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACtG,CAAC,CAAC;QAEQ,oBAAe,GAAG,CAAC,QAA2B,EAAE,KAAiC,EAAE,EAAE;YAC7F,IAAI,KAAK,KAAK,SAAS,EAAE;gBACvB,OAAQ,EAAE,CAAC;aACZ;iBAAM,IAAK,QAAQ,KAAK,kCAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE;gBACtF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;aACtC;iBAAM;gBACL,OAAO,GAAG,KAAK,EAAE,CAAC;aACnB;QACH,CAAC,CAAC;QApBA,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;CAmBF;AAjCD,kDAiCC","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 { Primitives, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { MapLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { ArcGisFeatureRenderer } from \"./ArcGisFeatureRenderer\";\r\nimport { ArcGisResponseData } from \"./ArcGisFeatureResponse\";\r\n\r\n/** @internal */\r\nexport abstract class ArcGisFeatureReader {\r\n // Optionally you can set the floating precision\r\n public floatPrecision: number|undefined;\r\n\r\n // Force display value of date to ISO 8601 format.\r\n // Turning this ON, will disable display value in end-user's locale\r\n public forceDateDisplayValueToIso = false;\r\n\r\n protected _settings: ImageMapLayerSettings;\r\n protected _layerMetadata: any;\r\n\r\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\r\n this._settings = settings;\r\n this._layerMetadata = layerMetadata;\r\n }\r\n\r\n public abstract readAndRender(response: ArcGisResponseData, _renderer: ArcGisFeatureRenderer): void;\r\n\r\n public abstract readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]): void;\r\n\r\n protected toFixedWithoutPadding = (value: number) => {\r\n return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));\r\n };\r\n\r\n protected getDisplayValue = (typename: StandardTypeNames, value: Primitives.Value|undefined) => {\r\n if (value === undefined) {\r\n return \"\";\r\n } else if ( typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {\r\n return (value as Date).toISOString();\r\n } else {\r\n return `${value}`;\r\n }\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"ArcGisFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAAsE;AAMtE,gBAAgB;AAChB,MAAsB,mBAAmB;IAWvC,YAAmB,QAA+B,EAAE,aAAkB;QAPtE,kDAAkD;QAClD,mEAAmE;QAC5D,+BAA0B,GAAG,KAAK,CAAC;QAc/B,0BAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;YACnD,OAAO,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACtG,CAAC,CAAC;QAEQ,oBAAe,GAAG,CAAC,QAA2B,EAAE,KAAiC,EAAE,EAAE;YAC7F,IAAI,KAAK,KAAK,SAAS,EAAE;gBACvB,OAAQ,EAAE,CAAC;aACZ;iBAAM,IAAK,QAAQ,KAAK,kCAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE;gBACtF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;aACtC;iBAAM;gBACL,OAAO,GAAG,KAAK,EAAE,CAAC;aACnB;QACH,CAAC,CAAC;QApBA,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;CAmBF;AAjCD,kDAiCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Primitives, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { MapLayerFeatureInfo } from \"@itwin/core-frontend\";\nimport { ArcGisFeatureRenderer } from \"./ArcGisFeatureRenderer\";\nimport { ArcGisResponseData } from \"./ArcGisFeatureResponse\";\n\n/** @internal */\nexport abstract class ArcGisFeatureReader {\n // Optionally you can set the floating precision\n public floatPrecision: number|undefined;\n\n // Force display value of date to ISO 8601 format.\n // Turning this ON, will disable display value in end-user's locale\n public forceDateDisplayValueToIso = false;\n\n protected _settings: ImageMapLayerSettings;\n protected _layerMetadata: any;\n\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\n this._settings = settings;\n this._layerMetadata = layerMetadata;\n }\n\n public abstract readAndRender(response: ArcGisResponseData, _renderer: ArcGisFeatureRenderer): void;\n\n public abstract readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]): void;\n\n protected toFixedWithoutPadding = (value: number) => {\n return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));\n };\n\n protected getDisplayValue = (typename: StandardTypeNames, value: Primitives.Value|undefined) => {\n if (value === undefined) {\n return \"\";\n } else if ( typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {\n return (value as Date).toISOString();\n } else {\n return `${value}`;\n }\n };\n}\n"]}
@@ -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 +1 @@
1
- {"version":3,"file":"ArcGisFeatureRenderer.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureRenderer.ts"],"names":[],"mappings":";;;AAOA,gBAAgB;AAChB,MAAa,qBAAqB;IAKhC,YAAY,OAAiC,EAAE,MAA+B,EAAE,oBAAgC;QAC9G,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,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C;gBAC7B,KAAK,IAAI,SAAS,GAAC,CAAC,EAAG,SAAS,GAAE,WAAW,EAAE,SAAS,EAAE,EAAE;oBAC1D,IAAI,EAAE,GAAG,cAAc,CAAC,YAAY,GAAC,CAAC,SAAS,GAAC,MAAM,CAAC,CAAC,CAAC;oBACzD,IAAI,EAAE,GAAG,cAAc,CAAC,YAAY,GAAC,CAAC,SAAS,GAAC,MAAM,CAAC,GAAC,CAAC,CAAC,CAAC;oBAE3D,IAAI,cAAc,EAAE;wBAClB,EAAE,GAAG,OAAO,GAAG,OAAO,GAAC,EAAE,CAAC;wBAC1B,EAAE,GAAG,OAAO,GAAG,OAAO,GAAC,EAAE,CAAC;qBAC3B;oBAED,IAAI,IAAI,CAAC,UAAU,EAAE;wBACnB,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC;wBACxE,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC;wBACxB,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC;qBACzB;oBAED,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;iBAE/C;gBACD,YAAY,IAAE,MAAM,GAAC,WAAW,CAAC;aAClC;SACF;IAEH,CAAC;CAEF;AAlKD,sDAkKC","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\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { ArcGisSymbologyRenderer } from \"./ArcGisSymbologyRenderer\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureRenderer {\r\n private _symbol: ArcGisSymbologyRenderer;\r\n private _transform: Transform|undefined;\r\n private _context: CanvasRenderingContext2D;\r\n\r\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform) {\r\n this._symbol = symbol;\r\n this._context = context;\r\n this._transform = world2PixelTransform;\r\n }\r\n\r\n public get transform() {return this._transform;}\r\n\r\n // Utility functions to make ease testing.\r\n private closePath() {\r\n this._context.closePath();\r\n }\r\n\r\n private lineTo(x: number, y: number) {\r\n this._context.lineTo(x,y);\r\n }\r\n\r\n private moveTo(x: number, y: number) {\r\n this._context.moveTo(x,y);\r\n }\r\n\r\n private fill() {\r\n this._context.fill();\r\n }\r\n\r\n private stroke() {\r\n this._context.stroke();\r\n }\r\n\r\n /**\r\n * Render a path on the renderer's context.\r\n * Note: Inputs are designed based on the PBF format, to avoid any data transformation.\r\n * @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)\r\n * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon\r\n * @param fill Indicates if the path should be filled or not.\r\n * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.\r\n */\r\n public renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean) {\r\n if (stride < 2 || stride > 3) {\r\n return;\r\n }\r\n\r\n // Keep track of our position in the in the 'coords' array:\r\n // Every time we loop on the 'lengths' array, the position\r\n // to start reading vertices in the 'coords' must be the sum of all previously read vertices.\r\n let coordsOffset = 0;\r\n\r\n // Begin the path here.\r\n // Note: Even though path is closed inside the 'geometryLengths' loop,\r\n // it's import to begin the path only once.\r\n this._context.beginPath();\r\n for (const vertexCount of geometryLengths) {\r\n let lastPtX = 0, lastPtY = 0;\r\n for (let vertexIdx=0 ; vertexIdx <vertexCount; vertexIdx++) {\r\n let pX = geometryCoords[coordsOffset+(vertexIdx*stride)];\r\n let pY = geometryCoords[coordsOffset+(vertexIdx*stride)+1];\r\n if (vertexIdx === 0) {\r\n // first vertex is always \"absolute\" and must be drawn as 'moveTo' (i.e. not lineTo)\r\n if (relativeCoords) {\r\n lastPtX = pX;\r\n lastPtY = pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n\r\n this.moveTo(pX, pY);\r\n } else {\r\n\r\n // Following vertices are relative to the previous one (sadly not really well documented by ESRI)\r\n // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)\r\n if (relativeCoords) {\r\n pX = lastPtX = lastPtX+pX;\r\n pY = lastPtY = lastPtY+pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n this.lineTo(pX, pY);\r\n }\r\n\r\n }\r\n coordsOffset+=stride*vertexCount;\r\n if (fill) {\r\n // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)\r\n this.closePath();\r\n }\r\n }\r\n\r\n if (fill) {\r\n this._symbol.applyFillStyle(this._context);\r\n this.fill();\r\n }\r\n\r\n this._symbol.applyStrokeStyle(this._context);\r\n this.stroke(); // draw line path or polygon outline\r\n }\r\n\r\n /**\r\n * Render a point on the renderer's context.\r\n * Note: Inputs are designed based on the PBF format, to avoid any data transformation.\r\n * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.\r\n * @param geometryCoords Array that linearly encodes vertices.\r\n * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.\r\n */\r\n public renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean) {\r\n\r\n if (stride < 2 || stride > 3) {\r\n return;\r\n }\r\n let coordsOffset = 0;\r\n if (geometryLengths.length === 0) {\r\n // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.\r\n if (geometryCoords.length >= stride) {\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: geometryCoords[0], y:geometryCoords[1]});\r\n this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);\r\n } else {\r\n this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);\r\n }\r\n }\r\n } else {\r\n // MULTI-POINTS: Needs testing\r\n // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.\r\n for (const vertexCount of geometryLengths) {\r\n let lastPtX = 0, lastPtY = 0;\r\n for (let vertexIdx=0 ; vertexIdx <vertexCount; vertexIdx++) {\r\n let pX = geometryCoords[coordsOffset+(vertexIdx*stride)];\r\n let pY = geometryCoords[coordsOffset+(vertexIdx*stride)+1];\r\n\r\n if (relativeCoords) {\r\n pX = lastPtX = lastPtX+pX;\r\n pY = lastPtY = lastPtY+pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n\r\n this._symbol.drawPoint(this._context, pX, pY);\r\n\r\n }\r\n coordsOffset+=stride*vertexCount;\r\n }\r\n }\r\n\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"ArcGisFeatureRenderer.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureRenderer.ts"],"names":[],"mappings":";;;AAOA,gBAAgB;AAChB,MAAa,qBAAqB;IAKhC,YAAY,OAAiC,EAAE,MAA+B,EAAE,oBAAgC;QAC9G,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC;IACzC,CAAC;IAED,IAAW,SAAS,KAAI,OAAO,IAAI,CAAC,UAAU,CAAC,CAAA,CAAC;IAEhD,0CAA0C;IAClC,SAAS;QACf,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAEO,M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,SAAS,GAAC,MAAM,CAAC,GAAC,CAAC,CAAC,CAAC;oBAE3D,IAAI,cAAc,EAAE;wBAClB,EAAE,GAAG,OAAO,GAAG,OAAO,GAAC,EAAE,CAAC;wBAC1B,EAAE,GAAG,OAAO,GAAG,OAAO,GAAC,EAAE,CAAC;qBAC3B;oBAED,IAAI,IAAI,CAAC,UAAU,EAAE;wBACnB,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC;wBACxE,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC;wBACxB,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC;qBACzB;oBAED,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;iBAE/C;gBACD,YAAY,IAAE,MAAM,GAAC,WAAW,CAAC;aAClC;SACF;IAEH,CAAC;CAEF;AAlKD,sDAkKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { Transform } from \"@itwin/core-geometry\";\nimport { ArcGisSymbologyRenderer } from \"./ArcGisSymbologyRenderer\";\n\n/** @internal */\nexport class ArcGisFeatureRenderer {\n private _symbol: ArcGisSymbologyRenderer;\n private _transform: Transform|undefined;\n private _context: CanvasRenderingContext2D;\n\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform) {\n this._symbol = symbol;\n this._context = context;\n this._transform = world2PixelTransform;\n }\n\n public get transform() {return this._transform;}\n\n // Utility functions to make ease testing.\n private closePath() {\n this._context.closePath();\n }\n\n private lineTo(x: number, y: number) {\n this._context.lineTo(x,y);\n }\n\n private moveTo(x: number, y: number) {\n this._context.moveTo(x,y);\n }\n\n private fill() {\n this._context.fill();\n }\n\n private stroke() {\n this._context.stroke();\n }\n\n /**\n * Render a path on the renderer's context.\n * Note: Inputs are designed based on the PBF format, to avoid any data transformation.\n * @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)\n * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon\n * @param fill Indicates if the path should be filled or not.\n * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.\n */\n public renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean) {\n if (stride < 2 || stride > 3) {\n return;\n }\n\n // Keep track of our position in the in the 'coords' array:\n // Every time we loop on the 'lengths' array, the position\n // to start reading vertices in the 'coords' must be the sum of all previously read vertices.\n let coordsOffset = 0;\n\n // Begin the path here.\n // Note: Even though path is closed inside the 'geometryLengths' loop,\n // it's import to begin the path only once.\n this._context.beginPath();\n for (const vertexCount of geometryLengths) {\n let lastPtX = 0, lastPtY = 0;\n for (let vertexIdx=0 ; vertexIdx <vertexCount; vertexIdx++) {\n let pX = geometryCoords[coordsOffset+(vertexIdx*stride)];\n let pY = geometryCoords[coordsOffset+(vertexIdx*stride)+1];\n if (vertexIdx === 0) {\n // first vertex is always \"absolute\" and must be drawn as 'moveTo' (i.e. not lineTo)\n if (relativeCoords) {\n lastPtX = pX;\n lastPtY = pY;\n }\n\n if (this._transform) {\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\n pX = transformedPoint.x;\n pY = transformedPoint.y;\n }\n\n this.moveTo(pX, pY);\n } else {\n\n // Following vertices are relative to the previous one (sadly not really well documented by ESRI)\n // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)\n if (relativeCoords) {\n pX = lastPtX = lastPtX+pX;\n pY = lastPtY = lastPtY+pY;\n }\n\n if (this._transform) {\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\n pX = transformedPoint.x;\n pY = transformedPoint.y;\n }\n this.lineTo(pX, pY);\n }\n\n }\n coordsOffset+=stride*vertexCount;\n if (fill) {\n // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)\n this.closePath();\n }\n }\n\n if (fill) {\n this._symbol.applyFillStyle(this._context);\n this.fill();\n }\n\n this._symbol.applyStrokeStyle(this._context);\n this.stroke(); // draw line path or polygon outline\n }\n\n /**\n * Render a point on the renderer's context.\n * Note: Inputs are designed based on the PBF format, to avoid any data transformation.\n * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.\n * @param geometryCoords Array that linearly encodes vertices.\n * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.\n */\n public renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean) {\n\n if (stride < 2 || stride > 3) {\n return;\n }\n let coordsOffset = 0;\n if (geometryLengths.length === 0) {\n // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.\n if (geometryCoords.length >= stride) {\n\n if (this._transform) {\n const transformedPoint = this._transform.multiplyPoint2d({x: geometryCoords[0], y:geometryCoords[1]});\n this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);\n } else {\n this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);\n }\n }\n } else {\n // MULTI-POINTS: Needs testing\n // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.\n for (const vertexCount of geometryLengths) {\n let lastPtX = 0, lastPtY = 0;\n for (let vertexIdx=0 ; vertexIdx <vertexCount; vertexIdx++) {\n let pX = geometryCoords[coordsOffset+(vertexIdx*stride)];\n let pY = geometryCoords[coordsOffset+(vertexIdx*stride)+1];\n\n if (relativeCoords) {\n pX = lastPtX = lastPtX+pX;\n pY = lastPtY = lastPtY+pY;\n }\n\n if (this._transform) {\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\n pX = transformedPoint.x;\n pY = transformedPoint.y;\n }\n\n this._symbol.drawPoint(this._context, pX, pY);\n\n }\n coordsOffset+=stride*vertexCount;\n }\n }\n\n }\n\n}\n"]}
@@ -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 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
+ }
17
17
  //# sourceMappingURL=ArcGisFeatureResponse.d.ts.map