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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.rush/temp/operation/build_ci/state.json +1 -1
  2. package/.rush/temp/operation/cover/state.json +1 -1
  3. package/.rush/temp/operation/docs/state.json +1 -1
  4. package/.rush/temp/package-deps_build_ci.json +6 -6
  5. package/.rush/temp/package-deps_cover.json +6 -6
  6. package/.rush/temp/package-deps_docs.json +6 -6
  7. package/.rush/temp/shrinkwrap-deps.json +180 -22
  8. package/CHANGELOG.json +21 -0
  9. package/CHANGELOG.md +14 -1
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  14. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +132 -134
  15. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  16. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  17. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -202
  18. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  19. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  20. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -422
  21. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  22. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  23. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  24. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
  25. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  26. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
  27. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  28. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
  29. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  30. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  31. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -43
  32. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  33. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  34. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  35. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -192
  36. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  37. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  38. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2270 -2270
  39. package/lib/cjs/map-layers-formats.d.ts +8 -8
  40. package/lib/cjs/map-layers-formats.js +28 -24
  41. package/lib/cjs/map-layers-formats.js.map +1 -1
  42. package/lib/cjs/mapLayersFormats.d.ts +10 -10
  43. package/lib/cjs/mapLayersFormats.js +28 -28
  44. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  45. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
  46. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  47. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
  48. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  49. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
  50. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  51. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -680
  52. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  53. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  54. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
  55. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  56. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
  57. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  58. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
  59. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  60. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  61. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
  62. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
  63. package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
  64. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  65. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
  66. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  67. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  68. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
  69. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  70. package/lib/cjs/test/coverage/.nyc_output/3f025032-ec3e-4471-b05c-cd145bff9ba2.json +1 -0
  71. package/lib/cjs/test/coverage/.nyc_output/processinfo/2cc62aaf-7bdd-43fe-84af-17ff34118ab9.json +1 -0
  72. package/lib/cjs/test/coverage/.nyc_output/processinfo/{5c2897a9-bc6a-4e12-9b66-4c2a6ef8f467.json → 3f025032-ec3e-4471-b05c-cd145bff9ba2.json} +1 -1
  73. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
  74. package/lib/cjs/test/coverage/cobertura-coverage.xml +71 -71
  75. package/lib/cjs/test/coverage/lcov-report/index.html +5 -5
  76. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
  77. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +10 -10
  78. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +7 -7
  79. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +10 -10
  80. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
  81. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
  82. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
  83. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +4 -4
  84. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +8 -8
  85. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +13 -13
  86. package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
  87. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
  88. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
  89. package/lib/cjs/test/coverage/lcov.info +355 -531
  90. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  91. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  92. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
  93. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  94. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  95. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -130
  96. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  97. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  98. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -198
  99. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  100. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -418
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  103. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  104. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  105. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
  106. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  107. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
  108. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  109. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
  110. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  111. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
  112. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -39
  113. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  114. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  115. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  116. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -185
  117. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  118. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  119. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2267 -2267
  120. package/lib/esm/map-layers-formats.d.ts +8 -8
  121. package/lib/esm/map-layers-formats.js +12 -12
  122. package/lib/esm/mapLayersFormats.d.ts +10 -10
  123. package/lib/esm/mapLayersFormats.js +24 -24
  124. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  125. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
  126. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  127. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
  128. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  129. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
  130. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  131. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -678
  132. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  133. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  134. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
  135. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  136. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
  137. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  138. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
  139. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  140. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  141. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
  142. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
  143. package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
  144. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  145. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
  146. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  147. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  148. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
  149. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  150. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  151. package/lib/test/junit_results.xml +51 -51
  152. package/package.json +13 -13
  153. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
  154. package/tsconfig.json +1 -2
  155. package/lib/cjs/test/coverage/.nyc_output/5c2897a9-bc6a-4e12-9b66-4c2a6ef8f467.json +0 -1
  156. package/lib/cjs/test/coverage/.nyc_output/processinfo/703fc6cd-b118-4918-beb4-7b470ccb986a.json +0 -1
  157. /package/lib/cjs/test/coverage/.nyc_output/{703fc6cd-b118-4918-beb4-7b470ccb986a.json → 2cc62aaf-7bdd-43fe-84af-17ff34118ab9.json} +0 -0
@@ -1,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":"ArcG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AAE,cAAc,CAAC;IACrB,KAAK,EAAE,iBAAiB,CAAC;IACzB,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,gBAAgB;AAChB,qBAAa,OAAQ,YAAW,UAAU;IACxC,SAAgB,KAAK,EAAE,YAAY,CAAC;IACpC,OAAO,CAAC,QAAQ,CAAsB;IAEtC,IAAW,KAAK,yBAA+C;IAC/D,IAAW,IAAI,mBAA8B;IAC7C,IAAW,KAAK,sBAA+B;IAC/C,IAAW,OAAO,wBAA4B;gBAClC,IAAI,EAAE,YAAY;WAMhB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO;CAGpD;AAED,gBAAgB;AAChB,qBAAa,uBAAuB;IAClC,OAAO,CAAC,OAAO,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,186 +1,184 @@
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 { Logger } from "@itwin/core-bentley";
6
- import { ColorDef } from "@itwin/core-common";
7
- // Convert a channel array [r, g, b, a] to ColorDef
8
- function colorFromArray(channels) {
9
- if (channels && channels.length === 4) {
10
- // Alpha channel is reversed, 255 = opaque
11
- return ColorDef.from(channels[0], channels[1], channels[2], 255 - channels[3]);
12
- }
13
- return undefined;
14
- }
15
- const loggerCategory = "MapLayersFormats.ArcGISFeature";
16
- /** @internal */
17
- export class EsriSLS {
18
- constructor(json) {
19
- this.props = json;
20
- }
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
- static fromJSON(json) {
26
- return new EsriSLS(json);
27
- }
28
- }
29
- /** @internal */
30
- export class EsriPMS {
31
- constructor(json) {
32
- this.props = json;
33
- this._image = new Image();
34
- this._image.src = this.imageUrl;
35
- }
36
- get type() { return this.props.type; }
37
- get url() { return this.props.url; }
38
- get imageData() { return this.props.imageData; }
39
- get imageUrl() { return `data:${this.contentType};base64,${this.imageData}`; }
40
- get image() { return this._image; }
41
- get contentType() { return this.props.contentType; }
42
- get width() { return this.props.width; }
43
- get height() { return this.props.height; }
44
- get xoffset() { return this.props.xoffset; }
45
- get yoffset() { return this.props.yoffset; }
46
- get angle() { return this.props.angle; }
47
- static fromJSON(json) {
48
- return new EsriPMS(json);
49
- }
50
- }
51
- /** @internal */
52
- export class EsriSFS {
53
- constructor(json) {
54
- this.props = json;
55
- if (json.outline)
56
- this._outline = EsriSLS.fromJSON(json.outline);
57
- }
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
- static fromJSON(json) {
63
- return new EsriSFS(json);
64
- }
65
- }
66
- /** @internal */
67
- export class ArcGisSymbologyRenderer {
68
- constructor(geometryType, rendererDefinition) {
69
- let symbol;
70
- if ((rendererDefinition === null || rendererDefinition === void 0 ? void 0 : rendererDefinition.symbol) !== undefined) {
71
- symbol = rendererDefinition.symbol;
72
- }
73
- else if ((rendererDefinition === null || rendererDefinition === void 0 ? void 0 : rendererDefinition.defaultSymbol) !== undefined) {
74
- symbol = rendererDefinition === null || rendererDefinition === void 0 ? void 0 : rendererDefinition.defaultSymbol;
75
- }
76
- if (symbol !== undefined) {
77
- if (symbol.type === "esriSFS") {
78
- this._symbol = EsriSFS.fromJSON(symbol);
79
- }
80
- else if (symbol.type === "esriSLS") {
81
- this._symbol = EsriSLS.fromJSON(symbol);
82
- }
83
- else if (symbol.type === "esriPMS") {
84
- this._symbol = EsriPMS.fromJSON(symbol);
85
- }
86
- }
87
- // If '_symbol' is still undefined at this point, that means we could not find
88
- // any symbology definition from the metadata, let's use some default symbology
89
- // so that we display at least something.
90
- if (this._symbol === undefined) {
91
- Logger.logWarning(loggerCategory, "Symbology definition not supported, using default symbology");
92
- if (geometryType === "esriGeometryPoint" || geometryType === "esriGeometryMultipoint") {
93
- this._symbol = EsriPMS.fromJSON(ArcGisSymbologyRenderer.defaultPMS);
94
- }
95
- else if (geometryType === "esriGeometryLine" || geometryType === "esriGeometryPolyline") {
96
- this._symbol = EsriSLS.fromJSON(ArcGisSymbologyRenderer.defaultSLS);
97
- }
98
- else if (geometryType === "esriGeometryPolygon") {
99
- this._symbol = EsriSFS.fromJSON(ArcGisSymbologyRenderer.defaultSFS);
100
- }
101
- else {
102
- Logger.logError(loggerCategory, "Could not determine default symbology: geometry type not supported");
103
- }
104
- }
105
- }
106
- applyFillStyle(context) {
107
- var _a;
108
- if (!context)
109
- return;
110
- if (((_a = this._symbol) === null || _a === void 0 ? void 0 : _a.type) === "esriSFS") {
111
- const sfs = this._symbol;
112
- if (sfs.style === "esriSFSSolid" && sfs.color) {
113
- context.fillStyle = sfs.color.toRgbaString();
114
- }
115
- else {
116
- context.fillStyle = ColorDef.from(200, 0, 0, 100).toRgbaString(); // default color is red?
117
- }
118
- }
119
- }
120
- applyStrokeStyle(context) {
121
- var _a, _b;
122
- if (!context)
123
- return;
124
- let sls;
125
- if (((_a = this._symbol) === null || _a === void 0 ? void 0 : _a.type) === "esriSFS") {
126
- const sfs = this._symbol;
127
- if (sfs.outline && sfs.outline.style === "esriSLSSolid") {
128
- sls = sfs.outline;
129
- }
130
- }
131
- else if (((_b = this._symbol) === null || _b === void 0 ? void 0 : _b.type) === "esriSLS") {
132
- sls = this._symbol;
133
- }
134
- if (sls) {
135
- if (sls.color)
136
- context.strokeStyle = sls.color.toRgbaString();
137
- context.lineWidth = sls.width; // TODO: Should we scale this value here?
138
- }
139
- }
140
- drawPoint(context, ptX, ptY) {
141
- var _a;
142
- if (!context)
143
- return;
144
- if (((_a = this._symbol) === null || _a === void 0 ? void 0 : _a.type) === "esriPMS") {
145
- const pms = this._symbol;
146
- let xOffset = 0, yOffset = 0;
147
- if (pms.xoffset)
148
- xOffset = pms.xoffset;
149
- else if (pms.width)
150
- xOffset = pms.width * -0.5; // if no offset center in the middle
151
- if (pms.yoffset)
152
- yOffset = pms.yoffset;
153
- else if (pms.height)
154
- yOffset = pms.height * -0.5; // if no offset center in the middle
155
- if (pms.width && pms.height) {
156
- context.drawImage(pms.image, ptX + xOffset, ptY + yOffset, pms.width, pms.height);
157
- }
158
- else {
159
- context.drawImage(pms.image, ptX + xOffset, ptY + yOffset);
160
- }
161
- // TODO: marker rotation angle
162
- }
163
- }
164
- }
165
- ArcGisSymbologyRenderer.defaultPMS = {
166
- type: "esriPMS",
167
- url: "",
168
- contentType: "image/png",
169
- 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",
170
- width: 16,
171
- height: 16,
172
- xoffset: -8,
173
- yoffset: -16,
174
- };
175
- ArcGisSymbologyRenderer.defaultSLS = {
176
- type: "esriSLS",
177
- color: [0, 0, 0, 255],
178
- width: 1,
179
- style: "esriSLSSolid",
180
- };
181
- ArcGisSymbologyRenderer.defaultSFS = {
182
- type: "esriSFS",
183
- color: [0, 0, 0, 255],
184
- style: "esriSFSSolid",
185
- };
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 { Logger } from "@itwin/core-bentley";
6
+ import { ColorDef } from "@itwin/core-common";
7
+ // Convert a channel array [r, g, b, a] to ColorDef
8
+ function colorFromArray(channels) {
9
+ if (channels && channels.length === 4) {
10
+ // Alpha channel is reversed, 255 = opaque
11
+ return ColorDef.from(channels[0], channels[1], channels[2], 255 - channels[3]);
12
+ }
13
+ return undefined;
14
+ }
15
+ const loggerCategory = "MapLayersFormats.ArcGISFeature";
16
+ /** @internal */
17
+ export class EsriSLS {
18
+ get color() { return colorFromArray(this.props.color); }
19
+ get type() { return this.props.type; }
20
+ get width() { return this.props.width; }
21
+ get style() { return this.props.style; }
22
+ constructor(json) {
23
+ this.props = json;
24
+ }
25
+ static fromJSON(json) {
26
+ return new EsriSLS(json);
27
+ }
28
+ }
29
+ /** @internal */
30
+ export class EsriPMS {
31
+ get type() { return this.props.type; }
32
+ get url() { return this.props.url; }
33
+ get imageData() { return this.props.imageData; }
34
+ get imageUrl() { return `data:${this.contentType};base64,${this.imageData}`; }
35
+ get image() { return this._image; }
36
+ get contentType() { return this.props.contentType; }
37
+ get width() { return this.props.width; }
38
+ get height() { return this.props.height; }
39
+ get xoffset() { return this.props.xoffset; }
40
+ get yoffset() { return this.props.yoffset; }
41
+ get angle() { return this.props.angle; }
42
+ constructor(json) {
43
+ this.props = json;
44
+ this._image = new Image();
45
+ this._image.src = this.imageUrl;
46
+ }
47
+ static fromJSON(json) {
48
+ return new EsriPMS(json);
49
+ }
50
+ }
51
+ /** @internal */
52
+ export class EsriSFS {
53
+ get color() { return colorFromArray(this.props.color); }
54
+ get type() { return this.props.type; }
55
+ get style() { return this.props.style; }
56
+ get outline() { return this._outline; }
57
+ constructor(json) {
58
+ this.props = json;
59
+ if (json.outline)
60
+ this._outline = EsriSLS.fromJSON(json.outline);
61
+ }
62
+ static fromJSON(json) {
63
+ return new EsriSFS(json);
64
+ }
65
+ }
66
+ /** @internal */
67
+ class ArcGisSymbologyRenderer {
68
+ constructor(geometryType, rendererDefinition) {
69
+ let symbol;
70
+ if (rendererDefinition?.symbol !== undefined) {
71
+ symbol = rendererDefinition.symbol;
72
+ }
73
+ else if (rendererDefinition?.defaultSymbol !== undefined) {
74
+ symbol = rendererDefinition?.defaultSymbol;
75
+ }
76
+ if (symbol !== undefined) {
77
+ if (symbol.type === "esriSFS") {
78
+ this._symbol = EsriSFS.fromJSON(symbol);
79
+ }
80
+ else if (symbol.type === "esriSLS") {
81
+ this._symbol = EsriSLS.fromJSON(symbol);
82
+ }
83
+ else if (symbol.type === "esriPMS") {
84
+ this._symbol = EsriPMS.fromJSON(symbol);
85
+ }
86
+ }
87
+ // If '_symbol' is still undefined at this point, that means we could not find
88
+ // any symbology definition from the metadata, let's use some default symbology
89
+ // so that we display at least something.
90
+ if (this._symbol === undefined) {
91
+ Logger.logWarning(loggerCategory, "Symbology definition not supported, using default symbology");
92
+ if (geometryType === "esriGeometryPoint" || geometryType === "esriGeometryMultipoint") {
93
+ this._symbol = EsriPMS.fromJSON(ArcGisSymbologyRenderer.defaultPMS);
94
+ }
95
+ else if (geometryType === "esriGeometryLine" || geometryType === "esriGeometryPolyline") {
96
+ this._symbol = EsriSLS.fromJSON(ArcGisSymbologyRenderer.defaultSLS);
97
+ }
98
+ else if (geometryType === "esriGeometryPolygon") {
99
+ this._symbol = EsriSFS.fromJSON(ArcGisSymbologyRenderer.defaultSFS);
100
+ }
101
+ else {
102
+ Logger.logError(loggerCategory, "Could not determine default symbology: geometry type not supported");
103
+ }
104
+ }
105
+ }
106
+ applyFillStyle(context) {
107
+ if (!context)
108
+ return;
109
+ if (this._symbol?.type === "esriSFS") {
110
+ const sfs = this._symbol;
111
+ if (sfs.style === "esriSFSSolid" && sfs.color) {
112
+ context.fillStyle = sfs.color.toRgbaString();
113
+ }
114
+ else {
115
+ context.fillStyle = ColorDef.from(200, 0, 0, 100).toRgbaString(); // default color is red?
116
+ }
117
+ }
118
+ }
119
+ applyStrokeStyle(context) {
120
+ if (!context)
121
+ return;
122
+ let sls;
123
+ if (this._symbol?.type === "esriSFS") {
124
+ const sfs = this._symbol;
125
+ if (sfs.outline && sfs.outline.style === "esriSLSSolid") {
126
+ sls = sfs.outline;
127
+ }
128
+ }
129
+ else if (this._symbol?.type === "esriSLS") {
130
+ sls = this._symbol;
131
+ }
132
+ if (sls) {
133
+ if (sls.color)
134
+ context.strokeStyle = sls.color.toRgbaString();
135
+ context.lineWidth = sls.width; // TODO: Should we scale this value here?
136
+ }
137
+ }
138
+ drawPoint(context, ptX, ptY) {
139
+ if (!context)
140
+ return;
141
+ if (this._symbol?.type === "esriPMS") {
142
+ const pms = this._symbol;
143
+ let xOffset = 0, yOffset = 0;
144
+ if (pms.xoffset)
145
+ xOffset = pms.xoffset;
146
+ else if (pms.width)
147
+ xOffset = pms.width * -0.5; // if no offset center in the middle
148
+ if (pms.yoffset)
149
+ yOffset = pms.yoffset;
150
+ else if (pms.height)
151
+ yOffset = pms.height * -0.5; // if no offset center in the middle
152
+ if (pms.width && pms.height) {
153
+ context.drawImage(pms.image, ptX + xOffset, ptY + yOffset, pms.width, pms.height);
154
+ }
155
+ else {
156
+ context.drawImage(pms.image, ptX + xOffset, ptY + yOffset);
157
+ }
158
+ // TODO: marker rotation angle
159
+ }
160
+ }
161
+ }
162
+ ArcGisSymbologyRenderer.defaultPMS = {
163
+ type: "esriPMS",
164
+ url: "",
165
+ contentType: "image/png",
166
+ 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",
167
+ width: 16,
168
+ height: 16,
169
+ xoffset: -8,
170
+ yoffset: -16,
171
+ };
172
+ ArcGisSymbologyRenderer.defaultSLS = {
173
+ type: "esriSLS",
174
+ color: [0, 0, 0, 255],
175
+ width: 1,
176
+ style: "esriSLSSolid",
177
+ };
178
+ ArcGisSymbologyRenderer.defaultSFS = {
179
+ type: "esriSFS",
180
+ color: [0, 0, 0, 255],
181
+ style: "esriSFSSolid",
182
+ };
183
+ export { ArcGisSymbologyRenderer };
186
184
  //# sourceMappingURL=ArcGisSymbologyRenderer.js.map