@itwin/map-layers-formats 4.6.0-dev.9 → 4.7.0-dev.3

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/CHANGELOG.md +13 -1
  2. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +1 -1
  3. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  4. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +15 -6
  5. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  6. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +64 -54
  7. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  8. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  9. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +7 -11
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +3 -19
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  14. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +3 -3
  15. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
  16. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js +3 -4
  17. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  18. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +3 -3
  19. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
  20. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js +2 -3
  21. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  22. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +35 -15
  23. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  24. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +54 -48
  25. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  26. package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts +2 -1
  27. package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts.map +1 -1
  28. package/lib/cjs/ArcGisFeature/EsriSymbology.js +2 -1
  29. package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -1
  30. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +1 -1
  31. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  32. package/lib/cjs/Feature/DefaultMarkerIcon.d.ts +10 -0
  33. package/lib/cjs/Feature/DefaultMarkerIcon.d.ts.map +1 -0
  34. package/lib/cjs/Feature/DefaultMarkerIcon.js +31 -0
  35. package/lib/cjs/Feature/DefaultMarkerIcon.js.map +1 -0
  36. package/lib/cjs/Feature/FeatureCanvasRenderer.d.ts +20 -0
  37. package/lib/cjs/Feature/FeatureCanvasRenderer.d.ts.map +1 -0
  38. package/lib/cjs/{ArcGisFeature/ArcGisCanvasRenderer.js → Feature/FeatureCanvasRenderer.js} +7 -6
  39. package/lib/cjs/Feature/FeatureCanvasRenderer.js.map +1 -0
  40. package/lib/cjs/Feature/FeatureInfoReader.d.ts +11 -0
  41. package/lib/cjs/Feature/FeatureInfoReader.d.ts.map +1 -0
  42. package/lib/cjs/Feature/FeatureInfoReader.js +35 -0
  43. package/lib/cjs/Feature/FeatureInfoReader.js.map +1 -0
  44. package/lib/cjs/Feature/FeatureSymbology.d.ts +8 -0
  45. package/lib/cjs/Feature/FeatureSymbology.d.ts.map +1 -0
  46. package/lib/cjs/Feature/FeatureSymbology.js +12 -0
  47. package/lib/cjs/Feature/FeatureSymbology.js.map +1 -0
  48. package/lib/cjs/Feature/RandomMapColor.d.ts +8 -0
  49. package/lib/cjs/Feature/RandomMapColor.d.ts.map +1 -0
  50. package/lib/cjs/Feature/RandomMapColor.js +29 -0
  51. package/lib/cjs/Feature/RandomMapColor.js.map +1 -0
  52. package/lib/cjs/GeoJSON/GeoJSONGeometry.d.ts +18 -0
  53. package/lib/cjs/GeoJSON/GeoJSONGeometry.d.ts.map +1 -0
  54. package/lib/cjs/GeoJSON/GeoJSONGeometry.js +11 -0
  55. package/lib/cjs/GeoJSON/GeoJSONGeometry.js.map +1 -0
  56. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.d.ts +11 -0
  57. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.d.ts.map +1 -0
  58. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js +83 -0
  59. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js.map +1 -0
  60. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.d.ts +9 -0
  61. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.d.ts.map +1 -0
  62. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js +94 -0
  63. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -0
  64. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.d.ts +54 -0
  65. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.d.ts.map +1 -0
  66. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js +477 -0
  67. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -0
  68. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.d.ts +23 -0
  69. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.d.ts.map +1 -0
  70. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js +139 -0
  71. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -0
  72. package/lib/cjs/Tools/GeometryTerrainDraper.d.ts +20 -0
  73. package/lib/cjs/Tools/GeometryTerrainDraper.d.ts.map +1 -0
  74. package/lib/cjs/Tools/GeometryTerrainDraper.js +153 -0
  75. package/lib/cjs/Tools/GeometryTerrainDraper.js.map +1 -0
  76. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts +15 -10
  77. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts.map +1 -1
  78. package/lib/cjs/Tools/MapFeatureInfoDecorator.js +191 -150
  79. package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -1
  80. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts.map +1 -1
  81. package/lib/cjs/Tools/MapFeatureInfoTool.js +7 -4
  82. package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -1
  83. package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
  84. package/lib/cjs/mapLayersFormats.js +5 -2
  85. package/lib/cjs/mapLayersFormats.js.map +1 -1
  86. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +1 -2
  87. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  88. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +15 -6
  89. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  90. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +63 -55
  91. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  92. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  93. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +7 -11
  94. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  95. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +3 -19
  96. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  97. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  98. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +3 -3
  99. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
  100. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js +3 -4
  101. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  102. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +3 -3
  103. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
  104. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js +2 -3
  105. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  106. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +35 -15
  107. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  108. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +52 -47
  109. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  110. package/lib/esm/ArcGisFeature/EsriSymbology.d.ts +2 -1
  111. package/lib/esm/ArcGisFeature/EsriSymbology.d.ts.map +1 -1
  112. package/lib/esm/ArcGisFeature/EsriSymbology.js +2 -1
  113. package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -1
  114. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  115. package/lib/esm/Feature/DefaultMarkerIcon.d.ts +10 -0
  116. package/lib/esm/Feature/DefaultMarkerIcon.d.ts.map +1 -0
  117. package/lib/esm/Feature/DefaultMarkerIcon.js +27 -0
  118. package/lib/esm/Feature/DefaultMarkerIcon.js.map +1 -0
  119. package/lib/esm/Feature/FeatureCanvasRenderer.d.ts +20 -0
  120. package/lib/esm/Feature/FeatureCanvasRenderer.d.ts.map +1 -0
  121. package/lib/esm/{ArcGisFeature/ArcGisCanvasRenderer.js → Feature/FeatureCanvasRenderer.js} +6 -5
  122. package/lib/esm/Feature/FeatureCanvasRenderer.js.map +1 -0
  123. package/lib/esm/Feature/FeatureInfoReader.d.ts +11 -0
  124. package/lib/esm/Feature/FeatureInfoReader.d.ts.map +1 -0
  125. package/lib/esm/Feature/FeatureInfoReader.js +31 -0
  126. package/lib/esm/Feature/FeatureInfoReader.js.map +1 -0
  127. package/lib/esm/Feature/FeatureSymbology.d.ts +8 -0
  128. package/lib/esm/Feature/FeatureSymbology.d.ts.map +1 -0
  129. package/lib/esm/Feature/FeatureSymbology.js +8 -0
  130. package/lib/esm/Feature/FeatureSymbology.js.map +1 -0
  131. package/lib/esm/Feature/RandomMapColor.d.ts +8 -0
  132. package/lib/esm/Feature/RandomMapColor.d.ts.map +1 -0
  133. package/lib/esm/Feature/RandomMapColor.js +25 -0
  134. package/lib/esm/Feature/RandomMapColor.js.map +1 -0
  135. package/lib/esm/GeoJSON/GeoJSONGeometry.d.ts +18 -0
  136. package/lib/esm/GeoJSON/GeoJSONGeometry.d.ts.map +1 -0
  137. package/lib/esm/GeoJSON/GeoJSONGeometry.js +7 -0
  138. package/lib/esm/GeoJSON/GeoJSONGeometry.js.map +1 -0
  139. package/lib/esm/GeoJSON/GeoJSONGeometryReader.d.ts +11 -0
  140. package/lib/esm/GeoJSON/GeoJSONGeometryReader.d.ts.map +1 -0
  141. package/lib/esm/GeoJSON/GeoJSONGeometryReader.js +79 -0
  142. package/lib/esm/GeoJSON/GeoJSONGeometryReader.js.map +1 -0
  143. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.d.ts +9 -0
  144. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.d.ts.map +1 -0
  145. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js +90 -0
  146. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -0
  147. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.d.ts +54 -0
  148. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.d.ts.map +1 -0
  149. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js +472 -0
  150. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -0
  151. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.d.ts +23 -0
  152. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.d.ts.map +1 -0
  153. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js +135 -0
  154. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -0
  155. package/lib/esm/Tools/GeometryTerrainDraper.d.ts +20 -0
  156. package/lib/esm/Tools/GeometryTerrainDraper.d.ts.map +1 -0
  157. package/lib/esm/Tools/GeometryTerrainDraper.js +149 -0
  158. package/lib/esm/Tools/GeometryTerrainDraper.js.map +1 -0
  159. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts +15 -10
  160. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts.map +1 -1
  161. package/lib/esm/Tools/MapFeatureInfoDecorator.js +193 -152
  162. package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -1
  163. package/lib/esm/Tools/MapFeatureInfoTool.d.ts.map +1 -1
  164. package/lib/esm/Tools/MapFeatureInfoTool.js +7 -5
  165. package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -1
  166. package/lib/esm/mapLayersFormats.d.ts.map +1 -1
  167. package/lib/esm/mapLayersFormats.js +5 -3
  168. package/lib/esm/mapLayersFormats.js.map +1 -1
  169. package/package.json +18 -15
  170. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts +0 -19
  171. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +0 -1
  172. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js.map +0 -1
  173. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +0 -19
  174. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +0 -1
  175. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ import { ColorDef } from "@itwin/core-common";
2
+ /** @internal */
3
+ export declare class DefaultMarkerIcon {
4
+ private static getSvgContent;
5
+ static getContent(color?: ColorDef): {
6
+ contentType: string;
7
+ imageData: string;
8
+ };
9
+ }
10
+ //# sourceMappingURL=DefaultMarkerIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultMarkerIcon.d.ts","sourceRoot":"","sources":["../../../src/Feature/DefaultMarkerIcon.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnE,gBAAgB;AAChB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,aAAa;WAad,UAAU,CAAC,KAAK,CAAC,EAAE,QAAQ;;;;CAM1C"}
@@ -0,0 +1,31 @@
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.DefaultMarkerIcon = void 0;
8
+ const core_common_1 = require("@itwin/core-common");
9
+ /** @internal */
10
+ class DefaultMarkerIcon {
11
+ static getSvgContent(color = core_common_1.ColorDef.fromString("#00AEEF")) {
12
+ return `<?xml version="1.0" encoding="utf-8"?>
13
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
14
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
15
+ viewBox="0 0 365 560" enable-background="new 0 0 365 560" xml:space="preserve">
16
+ <g>
17
+ <path fill="${color.toHexString()}" d="M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9
18
+ C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8
19
+ c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z"/>
20
+ </g>
21
+ </svg>`;
22
+ }
23
+ static getContent(color) {
24
+ return {
25
+ contentType: "image/svg+xml",
26
+ imageData: core_common_1.Base64EncodedString.encode(DefaultMarkerIcon.getSvgContent(color)),
27
+ };
28
+ }
29
+ }
30
+ exports.DefaultMarkerIcon = DefaultMarkerIcon;
31
+ //# sourceMappingURL=DefaultMarkerIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultMarkerIcon.js","sourceRoot":"","sources":["../../../src/Feature/DefaultMarkerIcon.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAAmE;AAEnE,gBAAgB;AAChB,MAAa,iBAAiB;IACpB,MAAM,CAAC,aAAa,CAAC,QAAkB,sBAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAC3E,OAAO;;;;;oBAKS,KAAK,CAAC,WAAW,EAAE;;;;WAI5B,CAAC;IACV,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,KAAgB;QACvC,OAAO;YACL,WAAW,EAAE,eAAe;YAC5B,SAAS,EAAE,iCAAmB,CAAC,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF;AApBD,8CAoBC","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 { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\r\n\r\n/** @internal */\r\nexport class DefaultMarkerIcon {\r\n private static getSvgContent(color: ColorDef = ColorDef.fromString(\"#00AEEF\")) {\r\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n <svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\r\n viewBox=\"0 0 365 560\" enable-background=\"new 0 0 365 560\" xml:space=\"preserve\">\r\n <g>\r\n <path fill=\"${color.toHexString()}\" d=\"M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9\r\n C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8\r\n c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z\"/>\r\n </g>\r\n </svg>`;\r\n }\r\n\r\n public static getContent(color?: ColorDef) {\r\n return {\r\n contentType: \"image/svg+xml\",\r\n imageData: Base64EncodedString.encode(DefaultMarkerIcon.getSvgContent(color)),\r\n };\r\n }\r\n}\r\n\r\n"]}
@@ -0,0 +1,20 @@
1
+ import { Transform } from "@itwin/core-geometry";
2
+ import { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from "@itwin/core-frontend";
3
+ import { ArcGisSymbologyCanvasRenderer } from "../ArcGisFeature/ArcGisSymbologyRenderer";
4
+ /** @internal */
5
+ export declare class FeatureCanvasRenderer extends FeatureGeometryBaseRenderer implements FeatureSymbolizedRenderer {
6
+ private _context;
7
+ private _symbol;
8
+ get symbolRenderer(): FeatureSymbologyRenderer;
9
+ hasSymbologyRenderer(): this is FeatureSymbolizedRenderer;
10
+ constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyCanvasRenderer, world2PixelTransform?: Transform);
11
+ protected beginPath(): void;
12
+ protected closePath(): void;
13
+ protected lineTo(x: number, y: number): void;
14
+ protected moveTo(x: number, y: number): void;
15
+ protected fill(): Promise<void>;
16
+ protected stroke(): Promise<void>;
17
+ protected finishPoints(): Promise<void>;
18
+ protected drawPoint(x: number, y: number): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=FeatureCanvasRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeatureCanvasRenderer.d.ts","sourceRoot":"","sources":["../../../src/Feature/FeatureCanvasRenderer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACxH,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AAEzF,gBAAgB;AAChB,qBAAa,qBAAsB,SAAQ,2BAA4B,YAAW,yBAAyB;IACzG,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,OAAO,CAAgC;IAE/C,IAAY,cAAc,IAAI,wBAAwB,CAErD;IACe,oBAAoB,IAAI,IAAI,IAAI,yBAAyB;gBAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,6BAA6B,EAAE,oBAAoB,CAAC,EAAE,SAAS;IAMtH,SAAS,CAAC,SAAS;IAInB,SAAS,CAAC,SAAS;IAInB,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAIrC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;cAIrB,IAAI;cAKJ,MAAM;cAKN,YAAY;cAGZ,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;CAG/C"}
@@ -4,13 +4,14 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ArcGisCanvasRenderer = void 0;
7
+ exports.FeatureCanvasRenderer = void 0;
8
8
  const core_frontend_1 = require("@itwin/core-frontend");
9
9
  /** @internal */
10
- class ArcGisCanvasRenderer extends core_frontend_1.ArcGisGeometryBaseRenderer {
11
- get attributeSymbology() {
12
- return this._symbol.isAttributeDriven() ? this._symbol : undefined;
10
+ class FeatureCanvasRenderer extends core_frontend_1.FeatureGeometryBaseRenderer {
11
+ get symbolRenderer() {
12
+ return this._symbol;
13
13
  }
14
+ hasSymbologyRenderer() { return true; }
14
15
  constructor(context, symbol, world2PixelTransform) {
15
16
  super(world2PixelTransform);
16
17
  this._symbol = symbol;
@@ -42,5 +43,5 @@ class ArcGisCanvasRenderer extends core_frontend_1.ArcGisGeometryBaseRenderer {
42
43
  this._symbol.drawPoint(this._context, x, y);
43
44
  }
44
45
  }
45
- exports.ArcGisCanvasRenderer = ArcGisCanvasRenderer;
46
- //# sourceMappingURL=ArcGisCanvasRenderer.js.map
46
+ exports.FeatureCanvasRenderer = FeatureCanvasRenderer;
47
+ //# sourceMappingURL=FeatureCanvasRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeatureCanvasRenderer.js","sourceRoot":"","sources":["../../../src/Feature/FeatureCanvasRenderer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,wDAAwH;AAGxH,gBAAgB;AAChB,MAAa,qBAAsB,SAAQ,2CAA2B;IAIpE,IAAY,cAAc;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACe,oBAAoB,KAAuC,OAAO,IAAI,CAAC,CAAA,CAAC;IAExF,YAAY,OAAiC,EAAE,MAAqC,EAAE,oBAAgC;QACpH,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAES,MAAM,CAAC,CAAS,EAAE,CAAS;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,MAAM,CAAC,CAAS,EAAE,CAAS;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,KAAK,CAAC,IAAI;QAClB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAES,KAAK,CAAC,MAAM;QACpB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAES,KAAK,CAAC,YAAY;IAC5B,CAAC;IAES,KAAK,CAAC,SAAS,CAAC,CAAS,EAAE,CAAS;QAC5C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA/CD,sDA+CC","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 { Transform } from \"@itwin/core-geometry\";\r\nimport { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from \"@itwin/core-frontend\";\r\nimport { ArcGisSymbologyCanvasRenderer } from \"../ArcGisFeature/ArcGisSymbologyRenderer\";\r\n\r\n/** @internal */\r\nexport class FeatureCanvasRenderer extends FeatureGeometryBaseRenderer implements FeatureSymbolizedRenderer {\r\n private _context: CanvasRenderingContext2D;\r\n private _symbol: ArcGisSymbologyCanvasRenderer;\r\n\r\n public get symbolRenderer(): FeatureSymbologyRenderer {\r\n return this._symbol;\r\n }\r\n public override hasSymbologyRenderer(): this is FeatureSymbolizedRenderer {return true;}\r\n\r\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyCanvasRenderer, world2PixelTransform?: Transform) {\r\n super(world2PixelTransform);\r\n this._symbol = symbol;\r\n this._context = context;\r\n }\r\n\r\n protected beginPath() {\r\n this._context.beginPath();\r\n }\r\n\r\n protected closePath() {\r\n this._context.closePath();\r\n }\r\n\r\n protected lineTo(x: number, y: number) {\r\n this._context.lineTo(x, y);\r\n }\r\n\r\n protected moveTo(x: number, y: number) {\r\n this._context.moveTo(x, y);\r\n }\r\n\r\n protected async fill() {\r\n this._symbol.applyFillStyle(this._context);\r\n this._context.fill();\r\n }\r\n\r\n protected async stroke() {\r\n this._symbol.applyStrokeStyle(this._context);\r\n this._context.stroke();\r\n }\r\n\r\n protected async finishPoints() {\r\n }\r\n\r\n protected async drawPoint(x: number, y: number) {\r\n this._symbol.drawPoint(this._context, x, y);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,11 @@
1
+ import { Primitives, StandardTypeNames } from "@itwin/appui-abstract";
2
+ /** Base feature infos reader
3
+ * @internal
4
+ */
5
+ export declare abstract class FeatureInfoReader {
6
+ floatPrecision: number | undefined;
7
+ forceDateDisplayValueToIso: boolean;
8
+ protected toFixedWithoutPadding: (value: number) => number;
9
+ protected getDisplayValue: (typename: StandardTypeNames, value: Primitives.Value | undefined) => string;
10
+ }
11
+ //# sourceMappingURL=FeatureInfoReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeatureInfoReader.d.ts","sourceRoot":"","sources":["../../../src/Feature/FeatureInfoReader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEtE;;GAEG;AACH,8BAAsB,iBAAiB;IAG9B,cAAc,EAAE,MAAM,GAAC,SAAS,CAAC;IAIjC,0BAA0B,UAAS;IAE1C,SAAS,CAAC,qBAAqB,UAAW,MAAM,YAE9C;IAEF,SAAS,CAAC,eAAe,aAAc,iBAAiB,SAAS,WAAW,KAAK,GAAC,SAAS,YASzF;CAEH"}
@@ -0,0 +1,35 @@
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.FeatureInfoReader = void 0;
8
+ const appui_abstract_1 = require("@itwin/appui-abstract");
9
+ /** Base feature infos reader
10
+ * @internal
11
+ */
12
+ class FeatureInfoReader {
13
+ constructor() {
14
+ // Force display value of date to ISO 8601 format.
15
+ // Turning this ON, will disable display value in end-user's locale
16
+ this.forceDateDisplayValueToIso = false;
17
+ this.toFixedWithoutPadding = (value) => {
18
+ return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));
19
+ };
20
+ this.getDisplayValue = (typename, value) => {
21
+ if (value === undefined) {
22
+ return "";
23
+ }
24
+ else if (typename === appui_abstract_1.StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {
25
+ return value.toISOString();
26
+ }
27
+ else {
28
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
29
+ return `${value}`;
30
+ }
31
+ };
32
+ }
33
+ }
34
+ exports.FeatureInfoReader = FeatureInfoReader;
35
+ //# sourceMappingURL=FeatureInfoReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeatureInfoReader.js","sourceRoot":"","sources":["../../../src/Feature/FeatureInfoReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAAsE;AAEtE;;GAEG;AACH,MAAsB,iBAAiB;IAAvC;QAKE,kDAAkD;QAClD,mEAAmE;QAC5D,+BAA0B,GAAG,KAAK,CAAC;QAEhC,0BAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;YAClD,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,CAAC;gBACxB,OAAQ,EAAE,CAAC;YACb,CAAC;iBAAM,IAAK,QAAQ,KAAK,kCAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;gBACvF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,gEAAgE;gBAChE,OAAO,GAAG,KAAK,EAAE,CAAC;YACpB,CAAC;QACH,CAAC,CAAC;IAEJ,CAAC;CAAA;AAxBD,8CAwBC","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\n\r\n/** Base feature infos reader\r\n * @internal\r\n */\r\nexport abstract class FeatureInfoReader {\r\n\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 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 // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n return `${value}`;\r\n }\r\n };\r\n\r\n}\r\n"]}
@@ -0,0 +1,8 @@
1
+ /** @internal */
2
+ export declare abstract class FeatureSymbology {
3
+ }
4
+ /** @internal */
5
+ export interface FeatureDefaultSymbology {
6
+ getSymbology: (geometryType: string) => FeatureSymbology;
7
+ }
8
+ //# sourceMappingURL=FeatureSymbology.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeatureSymbology.d.ts","sourceRoot":"","sources":["../../../src/Feature/FeatureSymbology.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,8BAAsB,gBAAgB;CAErC;AAED,gBAAgB;AAChB,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,gBAAgB,CAAC;CAC1D"}
@@ -0,0 +1,12 @@
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.FeatureSymbology = void 0;
8
+ /** @internal */
9
+ class FeatureSymbology {
10
+ }
11
+ exports.FeatureSymbology = FeatureSymbology;
12
+ //# sourceMappingURL=FeatureSymbology.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/Feature/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,gBAAgB;AAChB,MAAsB,gBAAgB;CAErC;AAFD,4CAEC","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\n/** @internal */\r\nexport abstract class FeatureSymbology {\r\n\r\n}\r\n\r\n/** @internal */\r\nexport interface FeatureDefaultSymbology {\r\n getSymbology: (geometryType: string) => FeatureSymbology;\r\n}\r\n"]}
@@ -0,0 +1,8 @@
1
+ import { ColorDef } from "@itwin/core-common";
2
+ /** @internal */
3
+ export declare class RandomMapColor {
4
+ private static readonly randomColorPalette;
5
+ getColor(): string;
6
+ getColorDef(): ColorDef;
7
+ }
8
+ //# sourceMappingURL=RandomMapColor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RandomMapColor.d.ts","sourceRoot":"","sources":["../../../src/Feature/RandomMapColor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,gBAAgB;AAChB,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CASxC;IAEK,QAAQ;IAIR,WAAW;CAGnB"}
@@ -0,0 +1,29 @@
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.RandomMapColor = void 0;
8
+ const core_common_1 = require("@itwin/core-common");
9
+ /** @internal */
10
+ class RandomMapColor {
11
+ getColor() {
12
+ return RandomMapColor.randomColorPalette[Math.floor(Math.random() * RandomMapColor.randomColorPalette.length)];
13
+ }
14
+ getColorDef() {
15
+ return core_common_1.ColorDef.fromString(this.getColor());
16
+ }
17
+ }
18
+ exports.RandomMapColor = RandomMapColor;
19
+ RandomMapColor.randomColorPalette = [
20
+ "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e",
21
+ "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac",
22
+ "#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4",
23
+ "#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31c2c", "#fdbf6f", "#ff7f00", "#cab2d6",
24
+ "#fbb4ae", "#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff2000", "#ffff33", "#a65628", "#999999",
25
+ "#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#ffa07a",
26
+ "#b15928", "#6a3d9a", "#ffed6f", "#9e0142", "#5e4fa2", "#999900", "#1a9850", "#4d4d4d", "#6baed6",
27
+ "#71c671", "#388e8e", "#7d9ec0", "#7171c6", "#8e388e", "#8e8e38", "#00c957", "#cc3333", "#d1dbdd",
28
+ ];
29
+ //# sourceMappingURL=RandomMapColor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RandomMapColor.js","sourceRoot":"","sources":["../../../src/Feature/RandomMapColor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAA8C;AAE9C,gBAAgB;AAChB,MAAa,cAAc;IAYlB,QAAQ;QACb,OAAO,cAAc,CAAC,kBAAkB,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,CAAC;IAEM,WAAW;QAChB,OAAO,sBAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC;;AAlBH,wCAmBC;AAlByB,iCAAkB,GAAG;IAC3C,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;CAClG,CAAC","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 { ColorDef } from \"@itwin/core-common\";\r\n\r\n/** @internal */\r\nexport class RandomMapColor {\r\n private static readonly randomColorPalette = [\r\n \"#8c510a\", \"#bf812d\", \"#dfc27d\", \"#f6e8c3\", \"#f5f5f5\", \"#c7eae5\", \"#80cdc1\", \"#35978f\", \"#01665e\",\r\n \"#b2182b\", \"#d6604d\", \"#f4a582\", \"#fddbc7\", \"#f7f7f7\", \"#d1e5f0\", \"#92c5de\", \"#4393c3\", \"#2166ac\",\r\n \"#d73027\", \"#f46d43\", \"#fdae61\", \"#fee090\", \"#ffffbf\", \"#e0f3f8\", \"#abd9e9\", \"#74add1\", \"#4575b4\",\r\n \"#a6cee3\", \"#1f78b4\", \"#b2df8a\", \"#33a02c\", \"#fb9a99\", \"#e31c2c\", \"#fdbf6f\", \"#ff7f00\", \"#cab2d6\",\r\n \"#fbb4ae\", \"#e41a1c\", \"#377eb8\", \"#4daf4a\", \"#984ea3\", \"#ff2000\", \"#ffff33\", \"#a65628\", \"#999999\",\r\n \"#8dd3c7\", \"#ffffb3\", \"#bebada\", \"#fb8072\", \"#80b1d3\", \"#fdb462\", \"#b3de69\", \"#fccde5\", \"#ffa07a\",\r\n \"#b15928\", \"#6a3d9a\", \"#ffed6f\", \"#9e0142\", \"#5e4fa2\", \"#999900\", \"#1a9850\", \"#4d4d4d\", \"#6baed6\",\r\n \"#71c671\", \"#388e8e\", \"#7d9ec0\", \"#7171c6\", \"#8e388e\", \"#8e8e38\", \"#00c957\", \"#cc3333\", \"#d1dbdd\",\r\n ];\r\n\r\n public getColor() {\r\n return RandomMapColor.randomColorPalette[ Math.floor(Math.random() * RandomMapColor.randomColorPalette.length)];\r\n }\r\n\r\n public getColorDef() {\r\n return ColorDef.fromString(this.getColor());\r\n }\r\n}\r\n\r\n"]}
@@ -0,0 +1,18 @@
1
+ import * as GeoJson from "geojson";
2
+ /** @internal */
3
+ export type Coord = number[];
4
+ /** @internal */ export type RingCoords = Coord[];
5
+ /** @internal */
6
+ export type MultiRingCoords = RingCoords[];
7
+ /** @internal */
8
+ export interface MultiPath {
9
+ lengths: number[];
10
+ coords: number[];
11
+ }
12
+ /** @internal */
13
+ export declare class GeoJSONGeometryUtils {
14
+ static isRingOrPath(geom: GeoJson.Geometry): boolean;
15
+ static isFilled(geom: GeoJson.Geometry): boolean;
16
+ static isPoint(geom: GeoJson.Geometry): boolean;
17
+ }
18
+ //# sourceMappingURL=GeoJSONGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeoJSONGeometry.d.ts","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,gBAAgB;AAChB,MAAM,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;AAE7B,gBAAgB,CAChB,MAAM,MAAM,UAAU,GAAG,KAAK,EAAE,CAAC;AAEjC,gBAAgB;AAChB,MAAM,MAAM,eAAe,GAAG,UAAU,EAAE,CAAC;AAE3C,gBAAgB;AAChB,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,gBAAgB;AAChB,qBAAa,oBAAoB;WACjB,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ;WACnC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ;WAC/B,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ;CAC7C"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeoJSONGeometryUtils = void 0;
4
+ /** @internal */
5
+ class GeoJSONGeometryUtils {
6
+ static isRingOrPath(geom) { return geom.type === "LineString" || geom.type === "MultiLineString" || geom.type === "Polygon" || geom.type === "MultiPolygon"; }
7
+ static isFilled(geom) { return geom.type === "Polygon" || geom.type === "MultiPolygon"; }
8
+ static isPoint(geom) { return geom.type === "Point" || geom.type === "MultiPoint"; }
9
+ }
10
+ exports.GeoJSONGeometryUtils = GeoJSONGeometryUtils;
11
+ //# sourceMappingURL=GeoJSONGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeoJSONGeometry.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometry.ts"],"names":[],"mappings":";;;AAqBA,gBAAgB;AAChB,MAAa,oBAAoB;IACxB,MAAM,CAAC,YAAY,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC9K,MAAM,CAAC,QAAQ,CAAC,IAAsB,IAAG,OAAQ,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC1G,MAAM,CAAC,OAAO,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,CAAA,CAAC;CAC5G;AAJD,oDAIC","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 * as GeoJson from \"geojson\";\r\n\r\n/** @internal */\r\nexport type Coord = number[];\r\n\r\n/** @internal */ // Array of 2 or 3 numbers\r\nexport type RingCoords = Coord[];\r\n\r\n/** @internal */\r\nexport type MultiRingCoords = RingCoords[];\r\n\r\n/** @internal */\r\nexport interface MultiPath {\r\n lengths: number[];\r\n coords: number[];\r\n}\r\n\r\n/** @internal */\r\nexport class GeoJSONGeometryUtils {\r\n public static isRingOrPath(geom: GeoJson.Geometry) {return geom.type === \"LineString\" || geom.type === \"MultiLineString\" || geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\r\n public static isFilled(geom: GeoJson.Geometry) {return geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\r\n public static isPoint(geom: GeoJson.Geometry) {return geom.type === \"Point\" || geom.type === \"MultiPoint\";}\r\n}\r\n"]}
@@ -0,0 +1,11 @@
1
+ import { FeatureGeometryRenderer } from "@itwin/core-frontend";
2
+ import * as GeoJson from "geojson";
3
+ /** @internal */
4
+ export declare class GeoJSONGeometryReader {
5
+ private _renderer;
6
+ constructor(renderer: FeatureGeometryRenderer);
7
+ readGeometry(geometry: GeoJson.Geometry): Promise<void>;
8
+ private readRingsAndPaths;
9
+ private readPoints;
10
+ }
11
+ //# sourceMappingURL=GeoJSONGeometryReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeoJSONGeometryReader.d.ts","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometryReader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAInC,gBAAgB;AAChB,qBAAa,qBAAqB;IAChC,OAAO,CAAC,SAAS,CAA0B;gBAExB,QAAQ,EAAE,uBAAuB;IAIvC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAWtC,iBAAiB;YAwCjB,UAAU;CAkBzB"}
@@ -0,0 +1,83 @@
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.GeoJSONGeometryReader = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const core_frontend_1 = require("@itwin/core-frontend");
10
+ const GeoJSONGeometry_1 = require("./GeoJSONGeometry");
11
+ const loggerCategory = "MapLayersFormats.GeoJSONGeometryReader";
12
+ /** @internal */
13
+ class GeoJSONGeometryReader {
14
+ constructor(renderer) {
15
+ this._renderer = renderer;
16
+ }
17
+ async readGeometry(geometry) {
18
+ if (GeoJSONGeometry_1.GeoJSONGeometryUtils.isRingOrPath(geometry)) {
19
+ await this.readRingsAndPaths(geometry, this._renderer, GeoJSONGeometry_1.GeoJSONGeometryUtils.isFilled(geometry), false /* relativeCoords*/);
20
+ }
21
+ else if (GeoJSONGeometry_1.GeoJSONGeometryUtils.isPoint(geometry)) {
22
+ await this.readPoints(geometry, this._renderer, false /* relativeCoords*/);
23
+ }
24
+ else {
25
+ core_bentley_1.Logger.logError(loggerCategory, `GeoJSONGeometryReader:readGeometry - Unknown geometry type '${geometry.type}'`);
26
+ }
27
+ }
28
+ async readRingsAndPaths(geometry, renderer, fill, relativeCoords) {
29
+ const multiPath = { coords: [], lengths: [] };
30
+ let polys;
31
+ const readPath = (ring, offset, result) => {
32
+ const newOffset = (0, core_frontend_1.deflateCoordinates)(ring, result.coords, 2, offset);
33
+ result.lengths.push(ring.length);
34
+ return newOffset;
35
+ };
36
+ const readMultiPath = (multiRings, result) => {
37
+ let offset = 0;
38
+ for (const ring of multiRings) {
39
+ offset = readPath(ring, offset, result);
40
+ }
41
+ };
42
+ if (geometry.type === "LineString") {
43
+ readPath(geometry.coordinates, 0, multiPath);
44
+ }
45
+ else if (geometry.type === "MultiLineString" || geometry.type === "Polygon") {
46
+ readMultiPath(geometry.coordinates, multiPath);
47
+ }
48
+ else if (geometry.type === "MultiPolygon") {
49
+ polys = [];
50
+ for (const poly of geometry.coordinates) {
51
+ const tmpMultiPath = { coords: [], lengths: [] };
52
+ readMultiPath(poly, tmpMultiPath);
53
+ polys.push(tmpMultiPath);
54
+ }
55
+ }
56
+ if (polys) {
57
+ for (const poly of polys) {
58
+ await renderer.renderPath(poly.lengths, poly.coords, fill, 2, relativeCoords);
59
+ }
60
+ }
61
+ else {
62
+ await renderer.renderPath(multiPath.lengths, multiPath.coords, fill, 2, relativeCoords);
63
+ }
64
+ }
65
+ async readPoints(geom, renderer, relativeCoords) {
66
+ const lengths = [];
67
+ const coords = [];
68
+ const readPoint = (coord) => {
69
+ lengths.push(1);
70
+ coords.push(coord[0]);
71
+ coords.push(coord[1]);
72
+ };
73
+ if (geom.type === "MultiPoint") {
74
+ geom.coordinates.forEach(readPoint);
75
+ }
76
+ else if (geom.type === "Point") {
77
+ readPoint(geom.coordinates);
78
+ }
79
+ await renderer.renderPoint(lengths, coords, 2, relativeCoords);
80
+ }
81
+ }
82
+ exports.GeoJSONGeometryReader = GeoJSONGeometryReader;
83
+ //# sourceMappingURL=GeoJSONGeometryReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeoJSONGeometryReader.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometryReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAA6C;AAC7C,wDAAmF;AACnF,uDAAwG;AAGxG,MAAM,cAAc,GAAG,wCAAwC,CAAC;AAEhE,gBAAgB;AAChB,MAAa,qBAAqB;IAGhC,YAAmB,QAAiC;QAClD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,QAA0B;QAElD,IAAI,sCAAoB,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,sCAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC7H,CAAC;aAAM,IAAI,sCAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAA,mBAAmB,CAAC,CAAC;QAC5E,CAAC;aAAM,CAAC;YACN,qBAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,+DAA+D,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC;QACnH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,QAA0B,EAAE,QAAiC,EAAE,IAAa,EAAE,cAAuB;QACnI,MAAM,SAAS,GAAc,EAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC;QACvD,IAAI,KAA8B,CAAC;QAEnC,MAAM,QA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AC;YACV,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,MAAM,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;YAChF,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;QAC1F,CAAC;IAEH,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,IAAsB,EAAE,QAAiC,EAAE,cAAuB;QAEzG,MAAM,OAAO,GAAU,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,EAAE;YACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC;QAEF,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACjC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QAED,MAAM,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IACjE,CAAC;CACF;AA5ED,sDA4EC","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 { Logger } from \"@itwin/core-bentley\";\r\nimport { deflateCoordinates, FeatureGeometryRenderer } from \"@itwin/core-frontend\";\r\nimport { Coord, GeoJSONGeometryUtils, MultiPath, MultiRingCoords, RingCoords } from \"./GeoJSONGeometry\";\r\nimport * as GeoJson from \"geojson\";\r\n\r\nconst loggerCategory = \"MapLayersFormats.GeoJSONGeometryReader\";\r\n\r\n/** @internal */\r\nexport class GeoJSONGeometryReader {\r\n private _renderer: FeatureGeometryRenderer;\r\n\r\n public constructor(renderer: FeatureGeometryRenderer) {\r\n this._renderer = renderer;\r\n }\r\n\r\n public async readGeometry(geometry: GeoJson.Geometry) {\r\n\r\n if (GeoJSONGeometryUtils.isRingOrPath(geometry)) {\r\n await this.readRingsAndPaths(geometry, this._renderer, GeoJSONGeometryUtils.isFilled(geometry), false /* relativeCoords*/);\r\n } else if (GeoJSONGeometryUtils.isPoint(geometry)) {\r\n await this.readPoints(geometry, this._renderer, false/* relativeCoords*/);\r\n } else {\r\n Logger.logError(loggerCategory, `GeoJSONGeometryReader:readGeometry - Unknown geometry type '${geometry.type}'`);\r\n }\r\n }\r\n\r\n private async readRingsAndPaths(geometry: GeoJson.Geometry, renderer: FeatureGeometryRenderer, fill: boolean, relativeCoords: boolean) {\r\n const multiPath: MultiPath = {coords: [], lengths: []};\r\n let polys: MultiPath[] | undefined;\r\n\r\n const readPath = (ring: RingCoords, offset: number, result: MultiPath) => {\r\n const newOffset = deflateCoordinates(ring, result.coords, 2, offset);\r\n result.lengths.push(ring.length);\r\n return newOffset;\r\n };\r\n\r\n const readMultiPath = (multiRings: MultiRingCoords, result: MultiPath) => {\r\n let offset = 0;\r\n for (const ring of multiRings) {\r\n offset = readPath(ring, offset, result);\r\n }\r\n };\r\n\r\n if (geometry.type === \"LineString\") {\r\n readPath(geometry.coordinates, 0, multiPath);\r\n } else if (geometry.type === \"MultiLineString\" || geometry.type === \"Polygon\") {\r\n readMultiPath(geometry.coordinates, multiPath);\r\n } else if (geometry.type === \"MultiPolygon\") {\r\n polys = [];\r\n for (const poly of geometry.coordinates) {\r\n const tmpMultiPath: MultiPath = {coords: [], lengths: [] };\r\n readMultiPath(poly, tmpMultiPath);\r\n polys.push(tmpMultiPath);\r\n }\r\n }\r\n\r\n if (polys) {\r\n for (const poly of polys) {\r\n await renderer.renderPath(poly.lengths, poly.coords, fill, 2, relativeCoords);\r\n }\r\n } else {\r\n await renderer.renderPath(multiPath.lengths, multiPath.coords, fill, 2, relativeCoords);\r\n }\r\n\r\n }\r\n\r\n private async readPoints(geom: GeoJson.Geometry, renderer: FeatureGeometryRenderer, relativeCoords: boolean) {\r\n\r\n const lengths: Coord = [];\r\n const coords: Coord = [];\r\n const readPoint = (coord: Coord) => {\r\n lengths.push(1);\r\n coords.push(coord[0]);\r\n coords.push(coord[1]);\r\n };\r\n\r\n if (geom.type === \"MultiPoint\") {\r\n geom.coordinates.forEach(readPoint);\r\n } else if (geom.type === \"Point\") {\r\n readPoint(geom.coordinates);\r\n }\r\n\r\n await renderer.renderPoint(lengths, coords, 2, relativeCoords);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,9 @@
1
+ import { ImageMapLayerSettings } from "@itwin/core-common";
2
+ import { ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSourceValidation, ValidateSourceArgs } from "@itwin/core-frontend";
3
+ /** @internal */
4
+ export declare class OgcApiFeaturesMapLayerFormat extends ImageryMapLayerFormat {
5
+ static formatId: string;
6
+ static createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined;
7
+ static validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation>;
8
+ }
9
+ //# sourceMappingURL=OgcApiFeaturesFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OgcApiFeaturesFormat.d.ts","sourceRoot":"","sources":["../../../src/OgcApiFeatures/OgcApiFeaturesFormat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAoB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAqB,qBAAqB,EAAE,uBAAuB,EAAwB,wBAAwB,EAAyB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGpM,gBAAgB;AAChB,qBAAa,4BAA6B,SAAQ,qBAAqB;IACrE,OAAuB,QAAQ,SAAoB;WAC5B,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,uBAAuB,GAAG,SAAS;WAErF,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAuFnG"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OgcApiFeaturesMapLayerFormat = void 0;
4
+ const core_frontend_1 = require("@itwin/core-frontend");
5
+ const OgcApiFeaturesProvider_1 = require("./OgcApiFeaturesProvider");
6
+ /** @internal */
7
+ class OgcApiFeaturesMapLayerFormat extends core_frontend_1.ImageryMapLayerFormat {
8
+ static createImageryProvider(settings) { return new OgcApiFeaturesProvider_1.OgcApiFeaturesProvider(settings); }
9
+ static async validate(args) {
10
+ const { source } = args;
11
+ const { userName, password } = source;
12
+ let status = core_frontend_1.MapLayerSourceStatus.InvalidUrl;
13
+ try {
14
+ let headers;
15
+ if (userName && password) {
16
+ headers = new Headers();
17
+ (0, core_frontend_1.setBasicAuthorization)(headers, userName, password);
18
+ }
19
+ const opts = {
20
+ method: "GET",
21
+ headers,
22
+ };
23
+ let url = (0, core_frontend_1.appendQueryParams)(source.url, source.savedQueryParams);
24
+ url = (0, core_frontend_1.appendQueryParams)(url, source.unsavedQueryParams);
25
+ let response = await fetch(url, opts);
26
+ let json = await response.json();
27
+ if (!json) {
28
+ return { status };
29
+ }
30
+ const createCollectionsList = (data) => {
31
+ let array;
32
+ for (const collection of data.collections) {
33
+ if (collection.itemType === "feature") {
34
+ const subLayerProps = {
35
+ id: collection.id,
36
+ name: collection.id,
37
+ title: collection.title,
38
+ visible: true,
39
+ parent: undefined,
40
+ children: undefined,
41
+ };
42
+ if (array)
43
+ array.push(subLayerProps);
44
+ else
45
+ array = [subLayerProps];
46
+ }
47
+ }
48
+ return array;
49
+ };
50
+ let subLayers;
51
+ if (Array.isArray(json.collections)) {
52
+ subLayers = createCollectionsList(json);
53
+ status = core_frontend_1.MapLayerSourceStatus.Valid;
54
+ }
55
+ else if (json.itemType === "feature" || json.type === "FeatureCollection") {
56
+ // We expect one of the following URL:
57
+ // http://server/collections/<collectionName>
58
+ // http://server/collections/<collectionName>/items
59
+ subLayers = [{
60
+ id: json.id,
61
+ name: json.id,
62
+ title: json.title,
63
+ visible: true,
64
+ parent: undefined,
65
+ children: undefined,
66
+ }];
67
+ status = core_frontend_1.MapLayerSourceStatus.Valid;
68
+ }
69
+ else if (Array.isArray(json.links)) {
70
+ // This might be the main landing page
71
+ const collectionsLink = json.links.find((link) => link.rel.includes("data") && link.type === "application/json");
72
+ let collectionsUrl = (0, core_frontend_1.appendQueryParams)(collectionsLink.href, source.savedQueryParams);
73
+ collectionsUrl = (0, core_frontend_1.appendQueryParams)(collectionsUrl, source.unsavedQueryParams);
74
+ response = await fetch(collectionsUrl, opts);
75
+ json = await response.json();
76
+ if (Array.isArray(json.collections)) {
77
+ subLayers = createCollectionsList(json);
78
+ status = core_frontend_1.MapLayerSourceStatus.Valid;
79
+ }
80
+ }
81
+ return { status, subLayers };
82
+ }
83
+ catch (err) {
84
+ status = core_frontend_1.MapLayerSourceStatus.InvalidUrl;
85
+ if (err?.status === 401) {
86
+ status = ((userName && password) ? core_frontend_1.MapLayerSourceStatus.InvalidCredentials : core_frontend_1.MapLayerSourceStatus.RequireAuth);
87
+ }
88
+ return { status };
89
+ }
90
+ }
91
+ }
92
+ exports.OgcApiFeaturesMapLayerFormat = OgcApiFeaturesMapLayerFormat;
93
+ OgcApiFeaturesMapLayerFormat.formatId = "OgcApiFeatures";
94
+ //# sourceMappingURL=OgcApiFeaturesFormat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"O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------------------------------------------------------\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 { ImageMapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\r\nimport { appendQueryParams, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSourceStatus, MapLayerSourceValidation, setBasicAuthorization, ValidateSourceArgs } from \"@itwin/core-frontend\";\r\nimport { OgcApiFeaturesProvider } from \"./OgcApiFeaturesProvider\";\r\n\r\n/** @internal */\r\nexport class OgcApiFeaturesMapLayerFormat extends ImageryMapLayerFormat {\r\n public static override formatId = \"OgcApiFeatures\";\r\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined { return new OgcApiFeaturesProvider(settings); }\r\n\r\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\r\n\r\n const {source} = args;\r\n const { userName, password } = source;\r\n let status = MapLayerSourceStatus.InvalidUrl;\r\n try {\r\n\r\n let headers: Headers | undefined;\r\n if (userName && password) {\r\n headers = new Headers();\r\n setBasicAuthorization(headers, userName, password);\r\n }\r\n const opts: RequestInit = {\r\n method: \"GET\",\r\n headers,\r\n };\r\n\r\n let url = appendQueryParams(source.url, source.savedQueryParams);\r\n url = appendQueryParams(url, source.unsavedQueryParams);\r\n let response = await fetch(url, opts);\r\n let json = await response.json();\r\n if (!json) {\r\n return { status };\r\n }\r\n\r\n const createCollectionsList = (data: any) => {\r\n let array: MapSubLayerProps[] | undefined;\r\n for (const collection of data.collections) {\r\n if (collection.itemType === \"feature\") {\r\n const subLayerProps = {\r\n id: collection.id,\r\n name: collection.id,\r\n title: collection.title,\r\n visible: true,\r\n parent: undefined,\r\n children: undefined,\r\n };\r\n if (array)\r\n array.push(subLayerProps);\r\n else\r\n array = [subLayerProps];\r\n }\r\n }\r\n return array;\r\n };\r\n\r\n let subLayers: MapSubLayerProps[] | undefined;\r\n if (Array.isArray(json.collections)) {\r\n subLayers = createCollectionsList(json);\r\n status = MapLayerSourceStatus.Valid;\r\n } else if (json.itemType === \"feature\" || json.type === \"FeatureCollection\") {\r\n // We expect one of the following URL:\r\n // http://server/collections/<collectionName>\r\n // http://server/collections/<collectionName>/items\r\n subLayers = [{\r\n id: json.id,\r\n name: json.id,\r\n title: json.title,\r\n visible: true,\r\n parent: undefined,\r\n children: undefined,\r\n }];\r\n status = MapLayerSourceStatus.Valid;\r\n } else if (Array.isArray(json.links)) {\r\n // This might be the main landing page\r\n const collectionsLink = json.links.find((link: any)=> link.rel.includes(\"data\") && link.type === \"application/json\");\r\n let collectionsUrl = appendQueryParams(collectionsLink.href, source.savedQueryParams);\r\n collectionsUrl = appendQueryParams(collectionsUrl, source.unsavedQueryParams);\r\n response = await fetch(collectionsUrl, opts);\r\n json = await response.json();\r\n if (Array.isArray(json.collections)) {\r\n subLayers = createCollectionsList(json);\r\n status = MapLayerSourceStatus.Valid;\r\n }\r\n\r\n }\r\n\r\n return { status, subLayers };\r\n\r\n } catch (err: any) {\r\n status = MapLayerSourceStatus.InvalidUrl;\r\n if (err?.status === 401) {\r\n status = ((userName && password) ? MapLayerSourceStatus.InvalidCredentials : MapLayerSourceStatus.RequireAuth);\r\n }\r\n return { status};\r\n }\r\n }\r\n}\r\n"]}
@@ -0,0 +1,54 @@
1
+ import { HitDetail, ImageryMapTileTree, MapFeatureInfoOptions, MapLayerFeatureInfo, MapLayerImageryProvider, QuadId } from "@itwin/core-frontend";
2
+ import { EsriSymbol } from "../ArcGisFeature/EsriSymbology";
3
+ import { Cartographic, ImageMapLayerSettings, ImageSource } from "@itwin/core-common";
4
+ import { FeatureDefaultSymbology } from "../Feature/FeatureSymbology";
5
+ import { RandomMapColor } from "../Feature/RandomMapColor";
6
+ /** Provide tiles from a ESRI ArcGIS Feature service
7
+ * @internal
8
+ */
9
+ export declare class DefaultOgcSymbology implements FeatureDefaultSymbology {
10
+ private static readonly _defaultPMSProps;
11
+ private _defaultPMS;
12
+ private static readonly _defaultSLSProps;
13
+ private _defaultSLS;
14
+ private static readonly _defaultSFSProps;
15
+ private _defaultSFS;
16
+ constructor(randomColor?: RandomMapColor);
17
+ initialize(): Promise<void>;
18
+ getSymbology(geometryType: string): EsriSymbol;
19
+ }
20
+ /** @internal */
21
+ export declare class OgcApiFeaturesProvider extends MapLayerImageryProvider {
22
+ private readonly _drawDebugInfo;
23
+ private readonly _limitParamMaxValue;
24
+ private readonly _tiledModeMinLod;
25
+ private readonly _staticModeFetchTimeout;
26
+ private readonly _tileModeFetchTimeout;
27
+ private readonly _forceTileMode;
28
+ private _spatialIdx;
29
+ private _defaultSymbol;
30
+ private _renderer;
31
+ private _collectionUrl;
32
+ private _itemsUrl;
33
+ private readonly _itemsCrs;
34
+ private _queryables;
35
+ serviceJson: any;
36
+ private _staticData;
37
+ constructor(settings: ImageMapLayerSettings);
38
+ get supportsMapFeatureInfo(): boolean;
39
+ get minimumZoomLevel(): number;
40
+ get staticMode(): boolean;
41
+ initialize(): Promise<void>;
42
+ private fetchMetadata;
43
+ private fetchAllItems;
44
+ private fetchItems;
45
+ private indexStaticData;
46
+ get tileSize(): number;
47
+ constructUrl(_row: number, _column: number, _zoomLevel: number): Promise<string>;
48
+ drawTileDebugInfo(row: number, column: number, zoomLevel: number, context: CanvasRenderingContext2D): void;
49
+ computeTileWorld2CanvasTransform(row: number, column: number, zoomLevel: number): import("@itwin/core-geometry").Transform | undefined;
50
+ loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined>;
51
+ private createImageSourceFromDataURL;
52
+ getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void>;
53
+ }
54
+ //# sourceMappingURL=OgcApiFeaturesProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OgcApiFeaturesProvider.d.ts","sourceRoot":"","sources":["../../../src/OgcApiFeatures/OgcApiFe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