@itwin/map-layers-formats 4.0.0-dev.8 → 4.0.0-dev.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/.rush/temp/operation/build/all.log +3 -0
  2. package/.rush/temp/operation/build/state.json +3 -0
  3. package/.rush/temp/operation/cover/all.log +98 -0
  4. package/.rush/temp/operation/cover/state.json +1 -1
  5. package/.rush/temp/operation/docs/all.log +30 -0
  6. package/.rush/temp/operation/docs/state.json +1 -1
  7. package/.rush/temp/{package-deps_build_ci.json → package-deps_build.json} +11 -11
  8. package/.rush/temp/package-deps_cover.json +10 -10
  9. package/.rush/temp/package-deps_docs.json +10 -10
  10. package/.rush/temp/shrinkwrap-deps.json +190 -44
  11. package/CHANGELOG.json +57 -0
  12. package/CHANGELOG.md +44 -1
  13. package/config/rush-project.json +1 -2
  14. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  15. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
  16. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  17. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  18. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +132 -134
  19. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  20. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  21. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -202
  22. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  23. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  24. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -422
  25. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  26. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  27. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  28. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
  29. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  30. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
  31. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  32. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
  33. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  34. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  35. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -43
  36. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  37. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  38. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  39. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -192
  40. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  41. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  42. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
  43. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2267 -2270
  44. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  45. package/lib/cjs/map-layers-formats.d.ts +8 -8
  46. package/lib/cjs/map-layers-formats.js +28 -24
  47. package/lib/cjs/map-layers-formats.js.map +1 -1
  48. package/lib/cjs/mapLayersFormats.d.ts +10 -10
  49. package/lib/cjs/mapLayersFormats.js +28 -28
  50. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  51. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
  52. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  53. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
  54. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  55. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
  56. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  57. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -680
  58. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  59. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  60. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
  61. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  62. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
  63. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  64. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
  65. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  66. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  67. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
  68. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
  69. package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
  70. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  71. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
  72. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
  73. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  74. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  75. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
  76. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
  77. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  78. package/lib/cjs/test/coverage/.nyc_output/cd866071-e986-4027-89f6-9a70b6e25ed3.json +1 -0
  79. package/lib/cjs/test/coverage/.nyc_output/processinfo/4c93adb3-7e95-4a63-9814-a25d79ab4680.json +1 -0
  80. package/lib/cjs/test/coverage/.nyc_output/processinfo/cd866071-e986-4027-89f6-9a70b6e25ed3.json +1 -0
  81. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
  82. package/lib/cjs/test/coverage/cobertura-coverage.xml +72 -72
  83. package/lib/cjs/test/coverage/lcov-report/index.html +5 -5
  84. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
  85. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +10 -10
  86. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +7 -7
  87. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +10 -10
  88. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
  89. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
  90. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
  91. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +4 -4
  92. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +8 -8
  93. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +13 -13
  94. package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
  95. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
  96. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
  97. package/lib/cjs/test/coverage/lcov.info +355 -531
  98. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  99. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  100. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  103. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -130
  104. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  105. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  106. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -198
  107. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  108. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  109. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -418
  110. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  111. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  112. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  113. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
  114. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  115. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
  116. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  117. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
  118. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  119. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  120. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -39
  121. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  122. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  123. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  124. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -185
  125. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  126. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  127. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
  128. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2264 -2267
  129. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  130. package/lib/esm/map-layers-formats.d.ts +8 -8
  131. package/lib/esm/map-layers-formats.js +12 -12
  132. package/lib/esm/mapLayersFormats.d.ts +10 -10
  133. package/lib/esm/mapLayersFormats.js +24 -24
  134. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  135. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
  136. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  137. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
  138. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  139. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
  140. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  141. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -678
  142. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  143. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  144. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
  145. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  146. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
  147. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  148. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
  149. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  150. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  151. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
  152. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
  153. package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
  154. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  155. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
  156. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
  157. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  158. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  159. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
  160. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
  161. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  162. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  163. package/lib/test/junit_results.xml +44 -44
  164. package/map-layers-formats.build.log +2 -2
  165. package/package.json +17 -17
  166. package/src/ArcGisFeature/esriPBuffer.gen.ts +1 -4
  167. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
  168. package/src/test/ArcGisFeature/NewYorkDataset.ts +187 -187
  169. package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +4 -4
  170. package/tsconfig.json +1 -2
  171. package/.rush/temp/operation/build_ci/state.json +0 -3
  172. package/lib/cjs/test/coverage/.nyc_output/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
  173. package/lib/cjs/test/coverage/.nyc_output/processinfo/5901bdfe-760d-4ca3-9674-876be7ed11b1.json +0 -1
  174. package/lib/cjs/test/coverage/.nyc_output/processinfo/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
  175. /package/lib/cjs/test/coverage/.nyc_output/{5901bdfe-760d-4ca3-9674-876be7ed11b1.json → 4c93adb3-7e95-4a63-9814-a25d79ab4680.json} +0 -0
@@ -1,86 +1,86 @@
1
- import { ColorDef } from "@itwin/core-common";
2
- import { ArcGisFeatureGeometryType } from "./ArcGisFeatureQuery";
3
- /** @internal */
4
- export declare type EsriSymbolType = "esriSFS" | "esriPMS" | "esriSLS" | "esriSMS" | "esriTS" | "CIMSymbolReference";
5
- interface EsriSymbol {
6
- type: EsriSymbolType;
7
- }
8
- /** @internal */
9
- export declare type EsriSLSStyle = "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" | "esriSLSLongDash" | "esriSLSLongDashDot" | "esriSLSNull" | "esriSLSShortDash" | "esriSLSShortDashDot" | "esriSLSShortDashDotDot" | "esriSLSShortDot" | "esriSLSSolid";
10
- interface EsriSLSProps {
11
- color: number[];
12
- type: EsriSymbolType;
13
- width: number;
14
- style: EsriSLSStyle;
15
- }
16
- /** @internal */
17
- export declare class EsriSLS implements EsriSymbol {
18
- readonly props: EsriSLSProps;
19
- get color(): ColorDef | undefined;
20
- get type(): EsriSymbolType;
21
- get width(): number;
22
- get style(): EsriSLSStyle;
23
- constructor(json: EsriSLSProps);
24
- static fromJSON(json: EsriSLSProps): EsriSLS;
25
- }
26
- interface EsriPMSProps {
27
- type: EsriSymbolType;
28
- url: string;
29
- imageData: string;
30
- contentType: string;
31
- width?: number;
32
- height?: number;
33
- xoffset?: number;
34
- yoffset?: number;
35
- angle?: number;
36
- }
37
- /** @internal */
38
- export declare class EsriPMS implements EsriSymbol {
39
- readonly props: EsriPMSProps;
40
- private _image;
41
- get type(): EsriSymbolType;
42
- get url(): string;
43
- get imageData(): string;
44
- get imageUrl(): string;
45
- get image(): HTMLImageElement;
46
- get contentType(): string;
47
- get width(): number | undefined;
48
- get height(): number | undefined;
49
- get xoffset(): number | undefined;
50
- get yoffset(): number | undefined;
51
- get angle(): number | undefined;
52
- constructor(json: EsriPMSProps);
53
- static fromJSON(json: EsriPMSProps): EsriPMS;
54
- }
55
- /** @internal */
56
- export declare type EsriSFSStyleProps = "esriSFSBackwardDiagonal" | "esriSFSCross" | "esriSFSDiagonalCross" | "esriSFSForwardDiagonal" | "esriSFSHorizontal" | "esriSFSNull" | "esriSFSSolid" | "esriSFSVertical";
57
- interface EsriSFSProps {
58
- color?: number[];
59
- type: EsriSymbolType;
60
- style: EsriSFSStyleProps;
61
- outline?: EsriSLSProps;
62
- }
63
- /** @internal */
64
- export declare class EsriSFS implements EsriSymbol {
65
- readonly props: EsriSFSProps;
66
- private _outline;
67
- get color(): ColorDef | undefined;
68
- get type(): EsriSymbolType;
69
- get style(): EsriSFSStyleProps;
70
- get outline(): EsriSLS | undefined;
71
- constructor(json: EsriSFSProps);
72
- static fromJSON(json: EsriSFSProps): EsriSFS;
73
- }
74
- /** @internal */
75
- export declare class ArcGisSymbologyRenderer {
76
- private _symbol;
77
- private static readonly defaultPMS;
78
- private static readonly defaultSLS;
79
- private static readonly defaultSFS;
80
- constructor(geometryType: ArcGisFeatureGeometryType, rendererDefinition: any);
81
- applyFillStyle(context: CanvasRenderingContext2D): void;
82
- applyStrokeStyle(context: CanvasRenderingContext2D): void;
83
- drawPoint(context: CanvasRenderingContext2D, ptX: number, ptY: number): void;
84
- }
85
- export {};
1
+ import { ColorDef } from "@itwin/core-common";
2
+ import { ArcGisFeatureGeometryType } from "./ArcGisFeatureQuery";
3
+ /** @internal */
4
+ export type EsriSymbolType = "esriSFS" | "esriPMS" | "esriSLS" | "esriSMS" | "esriTS" | "CIMSymbolReference";
5
+ interface EsriSymbol {
6
+ type: EsriSymbolType;
7
+ }
8
+ /** @internal */
9
+ export type EsriSLSStyle = "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" | "esriSLSLongDash" | "esriSLSLongDashDot" | "esriSLSNull" | "esriSLSShortDash" | "esriSLSShortDashDot" | "esriSLSShortDashDotDot" | "esriSLSShortDot" | "esriSLSSolid";
10
+ interface EsriSLSProps {
11
+ color: number[];
12
+ type: EsriSymbolType;
13
+ width: number;
14
+ style: EsriSLSStyle;
15
+ }
16
+ /** @internal */
17
+ export declare class EsriSLS implements EsriSymbol {
18
+ readonly props: EsriSLSProps;
19
+ get color(): ColorDef | undefined;
20
+ get type(): EsriSymbolType;
21
+ get width(): number;
22
+ get style(): EsriSLSStyle;
23
+ constructor(json: EsriSLSProps);
24
+ static fromJSON(json: EsriSLSProps): EsriSLS;
25
+ }
26
+ interface EsriPMSProps {
27
+ type: EsriSymbolType;
28
+ url: string;
29
+ imageData: string;
30
+ contentType: string;
31
+ width?: number;
32
+ height?: number;
33
+ xoffset?: number;
34
+ yoffset?: number;
35
+ angle?: number;
36
+ }
37
+ /** @internal */
38
+ export declare class EsriPMS implements EsriSymbol {
39
+ readonly props: EsriPMSProps;
40
+ private _image;
41
+ get type(): EsriSymbolType;
42
+ get url(): string;
43
+ get imageData(): string;
44
+ get imageUrl(): string;
45
+ get image(): HTMLImageElement;
46
+ get contentType(): string;
47
+ get width(): number | undefined;
48
+ get height(): number | undefined;
49
+ get xoffset(): number | undefined;
50
+ get yoffset(): number | undefined;
51
+ get angle(): number | undefined;
52
+ constructor(json: EsriPMSProps);
53
+ static fromJSON(json: EsriPMSProps): EsriPMS;
54
+ }
55
+ /** @internal */
56
+ export type EsriSFSStyleProps = "esriSFSBackwardDiagonal" | "esriSFSCross" | "esriSFSDiagonalCross" | "esriSFSForwardDiagonal" | "esriSFSHorizontal" | "esriSFSNull" | "esriSFSSolid" | "esriSFSVertical";
57
+ interface EsriSFSProps {
58
+ color?: number[];
59
+ type: EsriSymbolType;
60
+ style: EsriSFSStyleProps;
61
+ outline?: EsriSLSProps;
62
+ }
63
+ /** @internal */
64
+ export declare class EsriSFS implements EsriSymbol {
65
+ readonly props: EsriSFSProps;
66
+ private _outline;
67
+ get color(): ColorDef | undefined;
68
+ get type(): EsriSymbolType;
69
+ get style(): EsriSFSStyleProps;
70
+ get outline(): EsriSLS | undefined;
71
+ constructor(json: EsriSFSProps);
72
+ static fromJSON(json: EsriSFSProps): EsriSFS;
73
+ }
74
+ /** @internal */
75
+ export declare class ArcGisSymbologyRenderer {
76
+ private _symbol;
77
+ private static readonly defaultPMS;
78
+ private static readonly defaultSLS;
79
+ private static readonly defaultSFS;
80
+ constructor(geometryType: ArcGisFeatureGeometryType, rendererDefinition: any);
81
+ applyFillStyle(context: CanvasRenderingContext2D): void;
82
+ applyStrokeStyle(context: CanvasRenderingContext2D): void;
83
+ drawPoint(context: CanvasRenderingContext2D, ptX: number, ptY: number): void;
84
+ }
85
+ export {};
86
86
  //# sourceMappingURL=ArcGisSymbologyRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArcGisSymbologyRenderer.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisSymbologyRenderer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAajE,gBAAgB;AAChB,oBAAY,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,oBAAoB,CAAC;AAC7G,UAAU,UAAU;IAClB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,gBAAgB;AAChB,oBAAY,YAAY,GAAG,aAAa,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,YAAY,GAAG,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AO,CAAyB;IAExC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAShC;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAKhC;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAIhC;gBAEU,YAAY,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,GAAG;IAmCrE,cAAc,CAAC,OAAO,EAAE,wBAAwB;IAchD,gBAAgB,CAAC,OAAO,EAAE,wBAAwB;IAqBlD,SAAS,CAAC,OAAO,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CA0B7E"}
@@ -1,193 +1,190 @@
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.ArcGisSymbologyRenderer = exports.EsriSFS = exports.EsriPMS = exports.EsriSLS = void 0;
8
- const core_bentley_1 = require("@itwin/core-bentley");
9
- const core_common_1 = require("@itwin/core-common");
10
- // Convert a channel array [r, g, b, a] to ColorDef
11
- function colorFromArray(channels) {
12
- if (channels && channels.length === 4) {
13
- // Alpha channel is reversed, 255 = opaque
14
- return core_common_1.ColorDef.from(channels[0], channels[1], channels[2], 255 - channels[3]);
15
- }
16
- return undefined;
17
- }
18
- const loggerCategory = "MapLayersFormats.ArcGISFeature";
19
- /** @internal */
20
- class EsriSLS {
21
- constructor(json) {
22
- this.props = json;
23
- }
24
- get color() { return colorFromArray(this.props.color); }
25
- get type() { return this.props.type; }
26
- get width() { return this.props.width; }
27
- get style() { return this.props.style; }
28
- static fromJSON(json) {
29
- return new EsriSLS(json);
30
- }
31
- }
32
- exports.EsriSLS = EsriSLS;
33
- /** @internal */
34
- class EsriPMS {
35
- constructor(json) {
36
- this.props = json;
37
- this._image = new Image();
38
- this._image.src = this.imageUrl;
39
- }
40
- get type() { return this.props.type; }
41
- get url() { return this.props.url; }
42
- get imageData() { return this.props.imageData; }
43
- get imageUrl() { return `data:${this.contentType};base64,${this.imageData}`; }
44
- get image() { return this._image; }
45
- get contentType() { return this.props.contentType; }
46
- get width() { return this.props.width; }
47
- get height() { return this.props.height; }
48
- get xoffset() { return this.props.xoffset; }
49
- get yoffset() { return this.props.yoffset; }
50
- get angle() { return this.props.angle; }
51
- static fromJSON(json) {
52
- return new EsriPMS(json);
53
- }
54
- }
55
- exports.EsriPMS = EsriPMS;
56
- /** @internal */
57
- class EsriSFS {
58
- constructor(json) {
59
- this.props = json;
60
- if (json.outline)
61
- this._outline = EsriSLS.fromJSON(json.outline);
62
- }
63
- get color() { return colorFromArray(this.props.color); }
64
- get type() { return this.props.type; }
65
- get style() { return this.props.style; }
66
- get outline() { return this._outline; }
67
- static fromJSON(json) {
68
- return new EsriSFS(json);
69
- }
70
- }
71
- exports.EsriSFS = EsriSFS;
72
- /** @internal */
73
- class ArcGisSymbologyRenderer {
74
- constructor(geometryType, rendererDefinition) {
75
- let symbol;
76
- if ((rendererDefinition === null || rendererDefinition === void 0 ? void 0 : rendererDefinition.symbol) !== undefined) {
77
- symbol = rendererDefinition.symbol;
78
- }
79
- else if ((rendererDefinition === null || rendererDefinition === void 0 ? void 0 : rendererDefinition.defaultSymbol) !== undefined) {
80
- symbol = rendererDefinition === null || rendererDefinition === void 0 ? void 0 : rendererDefinition.defaultSymbol;
81
- }
82
- if (symbol !== undefined) {
83
- if (symbol.type === "esriSFS") {
84
- this._symbol = EsriSFS.fromJSON(symbol);
85
- }
86
- else if (symbol.type === "esriSLS") {
87
- this._symbol = EsriSLS.fromJSON(symbol);
88
- }
89
- else if (symbol.type === "esriPMS") {
90
- this._symbol = EsriPMS.fromJSON(symbol);
91
- }
92
- }
93
- // If '_symbol' is still undefined at this point, that means we could not find
94
- // any symbology definition from the metadata, let's use some default symbology
95
- // so that we display at least something.
96
- if (this._symbol === undefined) {
97
- core_bentley_1.Logger.logWarning(loggerCategory, "Symbology definition not supported, using default symbology");
98
- if (geometryType === "esriGeometryPoint" || geometryType === "esriGeometryMultipoint") {
99
- this._symbol = EsriPMS.fromJSON(ArcGisSymbologyRenderer.defaultPMS);
100
- }
101
- else if (geometryType === "esriGeometryLine" || geometryType === "esriGeometryPolyline") {
102
- this._symbol = EsriSLS.fromJSON(ArcGisSymbologyRenderer.defaultSLS);
103
- }
104
- else if (geometryType === "esriGeometryPolygon") {
105
- this._symbol = EsriSFS.fromJSON(ArcGisSymbologyRenderer.defaultSFS);
106
- }
107
- else {
108
- core_bentley_1.Logger.logError(loggerCategory, "Could not determine default symbology: geometry type not supported");
109
- }
110
- }
111
- }
112
- applyFillStyle(context) {
113
- var _a;
114
- if (!context)
115
- return;
116
- if (((_a = this._symbol) === null || _a === void 0 ? void 0 : _a.type) === "esriSFS") {
117
- const sfs = this._symbol;
118
- if (sfs.style === "esriSFSSolid" && sfs.color) {
119
- context.fillStyle = sfs.color.toRgbaString();
120
- }
121
- else {
122
- context.fillStyle = core_common_1.ColorDef.from(200, 0, 0, 100).toRgbaString(); // default color is red?
123
- }
124
- }
125
- }
126
- applyStrokeStyle(context) {
127
- var _a, _b;
128
- if (!context)
129
- return;
130
- let sls;
131
- if (((_a = this._symbol) === null || _a === void 0 ? void 0 : _a.type) === "esriSFS") {
132
- const sfs = this._symbol;
133
- if (sfs.outline && sfs.outline.style === "esriSLSSolid") {
134
- sls = sfs.outline;
135
- }
136
- }
137
- else if (((_b = this._symbol) === null || _b === void 0 ? void 0 : _b.type) === "esriSLS") {
138
- sls = this._symbol;
139
- }
140
- if (sls) {
141
- if (sls.color)
142
- context.strokeStyle = sls.color.toRgbaString();
143
- context.lineWidth = sls.width; // TODO: Should we scale this value here?
144
- }
145
- }
146
- drawPoint(context, ptX, ptY) {
147
- var _a;
148
- if (!context)
149
- return;
150
- if (((_a = this._symbol) === null || _a === void 0 ? void 0 : _a.type) === "esriPMS") {
151
- const pms = this._symbol;
152
- let xOffset = 0, yOffset = 0;
153
- if (pms.xoffset)
154
- xOffset = pms.xoffset;
155
- else if (pms.width)
156
- xOffset = pms.width * -0.5; // if no offset center in the middle
157
- if (pms.yoffset)
158
- yOffset = pms.yoffset;
159
- else if (pms.height)
160
- yOffset = pms.height * -0.5; // if no offset center in the middle
161
- if (pms.width && pms.height) {
162
- context.drawImage(pms.image, ptX + xOffset, ptY + yOffset, pms.width, pms.height);
163
- }
164
- else {
165
- context.drawImage(pms.image, ptX + xOffset, ptY + yOffset);
166
- }
167
- // TODO: marker rotation angle
168
- }
169
- }
170
- }
171
- exports.ArcGisSymbologyRenderer = ArcGisSymbologyRenderer;
172
- ArcGisSymbologyRenderer.defaultPMS = {
173
- type: "esriPMS",
174
- url: "",
175
- contentType: "image/png",
176
- imageData: "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAmBJREFUOE+Nk01IVFEUx//n3jfvOZOaJkMtiiJ7o9RG3LgoqKhFSFJBTS1ahFBBi0ijfJXCIyQr+hBbSIsoW7iQoKKFCw2CkAI3tZAgy8Ei+xhoTCbnje/NPfHGnA816KzuPR+/c8/HJRQJE7o+VUhym0DcCOYGgBQEXjOLlyqo+nHanCkMoaL4rslKjZwOQLT4ek3Mmz3FACFNLB67ut6M1nWphbg8wI6VyJK5KEH0EQFVJRKbwzokAW++p/ErraAYSQK3u47bC3vLnA+ZB9i2gHF0oyQMCfCGNaUa+vauxs71wWz2V18cnBj8gQ8J1/eeBnHUa4sMFQDGdGno+4gwEAoQzjVUon3rqlx1KY9x7+0MWobjAPg3QJ2eZV4tAEyFNCN5FkSXyw2B3j1hRGvLcgBXMV5MptA4MOXr0gT0u5bZnAf0jBsyiSgJPAxqhON1K3FlRxUMvwFAtv7u0Wl0jvwEmJNEuOhakTt5wKEBifr6Oo14BIBRpgt07w6jcVMIngKGY7NofR5HwlF+zDcpsC193vyYB/innvHywCzdZfAR/+onX1segBTAxHzzfPE7/8yzzIPLjJE1LTixHZx5CtCK4gXLzovBiDPUsYxVM7gUkB3nWKlm6DYEnQGzXARxCOK+a1WfKtQXb6LNAvr7iCboCUA1Ocdsdv5KLPe7F6pH/w3wLbc+BwOuc5IZ1wEE/jonQbjptZn24tKKX7BgvR2r0NKZRwDvAqCI+Z30VJPTURv7P4A9psuQcYAUPwAoReBLrmX2Lmls7i8sZ7kWLwuoxA1FVJGxzMPLufi6P2r+2xFbOUjGAAAAAElFTkSuQmCC",
177
- width: 16,
178
- height: 16,
179
- xoffset: -8,
180
- yoffset: -16,
181
- };
182
- ArcGisSymbologyRenderer.defaultSLS = {
183
- type: "esriSLS",
184
- color: [0, 0, 0, 255],
185
- width: 1,
186
- style: "esriSLSSolid",
187
- };
188
- ArcGisSymbologyRenderer.defaultSFS = {
189
- type: "esriSFS",
190
- color: [0, 0, 0, 255],
191
- style: "esriSFSSolid",
192
- };
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.ArcGisSymbologyRenderer = exports.EsriSFS = exports.EsriPMS = exports.EsriSLS = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const core_common_1 = require("@itwin/core-common");
10
+ // Convert a channel array [r, g, b, a] to ColorDef
11
+ function colorFromArray(channels) {
12
+ if (channels && channels.length === 4) {
13
+ // Alpha channel is reversed, 255 = opaque
14
+ return core_common_1.ColorDef.from(channels[0], channels[1], channels[2], 255 - channels[3]);
15
+ }
16
+ return undefined;
17
+ }
18
+ const loggerCategory = "MapLayersFormats.ArcGISFeature";
19
+ /** @internal */
20
+ class EsriSLS {
21
+ get color() { return colorFromArray(this.props.color); }
22
+ get type() { return this.props.type; }
23
+ get width() { return this.props.width; }
24
+ get style() { return this.props.style; }
25
+ constructor(json) {
26
+ this.props = json;
27
+ }
28
+ static fromJSON(json) {
29
+ return new EsriSLS(json);
30
+ }
31
+ }
32
+ exports.EsriSLS = EsriSLS;
33
+ /** @internal */
34
+ class EsriPMS {
35
+ get type() { return this.props.type; }
36
+ get url() { return this.props.url; }
37
+ get imageData() { return this.props.imageData; }
38
+ get imageUrl() { return `data:${this.contentType};base64,${this.imageData}`; }
39
+ get image() { return this._image; }
40
+ get contentType() { return this.props.contentType; }
41
+ get width() { return this.props.width; }
42
+ get height() { return this.props.height; }
43
+ get xoffset() { return this.props.xoffset; }
44
+ get yoffset() { return this.props.yoffset; }
45
+ get angle() { return this.props.angle; }
46
+ constructor(json) {
47
+ this.props = json;
48
+ this._image = new Image();
49
+ this._image.src = this.imageUrl;
50
+ }
51
+ static fromJSON(json) {
52
+ return new EsriPMS(json);
53
+ }
54
+ }
55
+ exports.EsriPMS = EsriPMS;
56
+ /** @internal */
57
+ class EsriSFS {
58
+ get color() { return colorFromArray(this.props.color); }
59
+ get type() { return this.props.type; }
60
+ get style() { return this.props.style; }
61
+ get outline() { return this._outline; }
62
+ constructor(json) {
63
+ this.props = json;
64
+ if (json.outline)
65
+ this._outline = EsriSLS.fromJSON(json.outline);
66
+ }
67
+ static fromJSON(json) {
68
+ return new EsriSFS(json);
69
+ }
70
+ }
71
+ exports.EsriSFS = EsriSFS;
72
+ /** @internal */
73
+ class ArcGisSymbologyRenderer {
74
+ constructor(geometryType, rendererDefinition) {
75
+ let symbol;
76
+ if (rendererDefinition?.symbol !== undefined) {
77
+ symbol = rendererDefinition.symbol;
78
+ }
79
+ else if (rendererDefinition?.defaultSymbol !== undefined) {
80
+ symbol = rendererDefinition?.defaultSymbol;
81
+ }
82
+ if (symbol !== undefined) {
83
+ if (symbol.type === "esriSFS") {
84
+ this._symbol = EsriSFS.fromJSON(symbol);
85
+ }
86
+ else if (symbol.type === "esriSLS") {
87
+ this._symbol = EsriSLS.fromJSON(symbol);
88
+ }
89
+ else if (symbol.type === "esriPMS") {
90
+ this._symbol = EsriPMS.fromJSON(symbol);
91
+ }
92
+ }
93
+ // If '_symbol' is still undefined at this point, that means we could not find
94
+ // any symbology definition from the metadata, let's use some default symbology
95
+ // so that we display at least something.
96
+ if (this._symbol === undefined) {
97
+ core_bentley_1.Logger.logWarning(loggerCategory, "Symbology definition not supported, using default symbology");
98
+ if (geometryType === "esriGeometryPoint" || geometryType === "esriGeometryMultipoint") {
99
+ this._symbol = EsriPMS.fromJSON(ArcGisSymbologyRenderer.defaultPMS);
100
+ }
101
+ else if (geometryType === "esriGeometryLine" || geometryType === "esriGeometryPolyline") {
102
+ this._symbol = EsriSLS.fromJSON(ArcGisSymbologyRenderer.defaultSLS);
103
+ }
104
+ else if (geometryType === "esriGeometryPolygon") {
105
+ this._symbol = EsriSFS.fromJSON(ArcGisSymbologyRenderer.defaultSFS);
106
+ }
107
+ else {
108
+ core_bentley_1.Logger.logError(loggerCategory, "Could not determine default symbology: geometry type not supported");
109
+ }
110
+ }
111
+ }
112
+ applyFillStyle(context) {
113
+ if (!context)
114
+ return;
115
+ if (this._symbol?.type === "esriSFS") {
116
+ const sfs = this._symbol;
117
+ if (sfs.style === "esriSFSSolid" && sfs.color) {
118
+ context.fillStyle = sfs.color.toRgbaString();
119
+ }
120
+ else {
121
+ context.fillStyle = core_common_1.ColorDef.from(200, 0, 0, 100).toRgbaString(); // default color is red?
122
+ }
123
+ }
124
+ }
125
+ applyStrokeStyle(context) {
126
+ if (!context)
127
+ return;
128
+ let sls;
129
+ if (this._symbol?.type === "esriSFS") {
130
+ const sfs = this._symbol;
131
+ if (sfs.outline && sfs.outline.style === "esriSLSSolid") {
132
+ sls = sfs.outline;
133
+ }
134
+ }
135
+ else if (this._symbol?.type === "esriSLS") {
136
+ sls = this._symbol;
137
+ }
138
+ if (sls) {
139
+ if (sls.color)
140
+ context.strokeStyle = sls.color.toRgbaString();
141
+ context.lineWidth = sls.width; // TODO: Should we scale this value here?
142
+ }
143
+ }
144
+ drawPoint(context, ptX, ptY) {
145
+ if (!context)
146
+ return;
147
+ if (this._symbol?.type === "esriPMS") {
148
+ const pms = this._symbol;
149
+ let xOffset = 0, yOffset = 0;
150
+ if (pms.xoffset)
151
+ xOffset = pms.xoffset;
152
+ else if (pms.width)
153
+ xOffset = pms.width * -0.5; // if no offset center in the middle
154
+ if (pms.yoffset)
155
+ yOffset = pms.yoffset;
156
+ else if (pms.height)
157
+ yOffset = pms.height * -0.5; // if no offset center in the middle
158
+ if (pms.width && pms.height) {
159
+ context.drawImage(pms.image, ptX + xOffset, ptY + yOffset, pms.width, pms.height);
160
+ }
161
+ else {
162
+ context.drawImage(pms.image, ptX + xOffset, ptY + yOffset);
163
+ }
164
+ // TODO: marker rotation angle
165
+ }
166
+ }
167
+ }
168
+ ArcGisSymbologyRenderer.defaultPMS = {
169
+ type: "esriPMS",
170
+ url: "",
171
+ contentType: "image/png",
172
+ imageData: "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAmBJREFUOE+Nk01IVFEUx//n3jfvOZOaJkMtiiJ7o9RG3LgoqKhFSFJBTS1ahFBBi0ijfJXCIyQr+hBbSIsoW7iQoKKFCw2CkAI3tZAgy8Ei+xhoTCbnje/NPfHGnA816KzuPR+/c8/HJRQJE7o+VUhym0DcCOYGgBQEXjOLlyqo+nHanCkMoaL4rslKjZwOQLT4ek3Mmz3FACFNLB67ut6M1nWphbg8wI6VyJK5KEH0EQFVJRKbwzokAW++p/ErraAYSQK3u47bC3vLnA+ZB9i2gHF0oyQMCfCGNaUa+vauxs71wWz2V18cnBj8gQ8J1/eeBnHUa4sMFQDGdGno+4gwEAoQzjVUon3rqlx1KY9x7+0MWobjAPg3QJ2eZV4tAEyFNCN5FkSXyw2B3j1hRGvLcgBXMV5MptA4MOXr0gT0u5bZnAf0jBsyiSgJPAxqhON1K3FlRxUMvwFAtv7u0Wl0jvwEmJNEuOhakTt5wKEBifr6Oo14BIBRpgt07w6jcVMIngKGY7NofR5HwlF+zDcpsC193vyYB/innvHywCzdZfAR/+onX1segBTAxHzzfPE7/8yzzIPLjJE1LTixHZx5CtCK4gXLzovBiDPUsYxVM7gUkB3nWKlm6DYEnQGzXARxCOK+a1WfKtQXb6LNAvr7iCboCUA1Ocdsdv5KLPe7F6pH/w3wLbc+BwOuc5IZ1wEE/jonQbjptZn24tKKX7BgvR2r0NKZRwDvAqCI+Z30VJPTURv7P4A9psuQcYAUPwAoReBLrmX2Lmls7i8sZ7kWLwuoxA1FVJGxzMPLufi6P2r+2xFbOUjGAAAAAElFTkSuQmCC",
173
+ width: 16,
174
+ height: 16,
175
+ xoffset: -8,
176
+ yoffset: -16,
177
+ };
178
+ ArcGisSymbologyRenderer.defaultSLS = {
179
+ type: "esriSLS",
180
+ color: [0, 0, 0, 255],
181
+ width: 1,
182
+ style: "esriSLSSolid",
183
+ };
184
+ ArcGisSymbologyRenderer.defaultSFS = {
185
+ type: "esriSFS",
186
+ color: [0, 0, 0, 255],
187
+ style: "esriSFSSolid",
188
+ };
189
+ exports.ArcGisSymbologyRenderer = ArcGisSymbologyRenderer;
193
190
  //# sourceMappingURL=ArcGisSymbologyRenderer.js.map