@itwin/map-layers-formats 4.1.0-dev.54 → 4.1.0-dev.56

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 (272) hide show
  1. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts +17 -0
  2. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
  3. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js +42 -0
  4. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -0
  5. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  6. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +4 -5
  7. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  8. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +39 -24
  9. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +5 -0
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +4 -0
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  14. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +15 -6
  15. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  16. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +6 -4
  17. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  18. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  19. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +13 -0
  20. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
  21. package/lib/cjs/ArcGisFeature/{ArcGisFeatureJSON.js → ArcGisJsonFeatureReader.js} +36 -58
  22. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
  23. package/lib/cjs/ArcGisFeature/{ArcGisFeaturePBF.d.ts → ArcGisPbfFeatureReader.d.ts} +6 -7
  24. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
  25. package/lib/cjs/ArcGisFeature/{ArcGisFeaturePBF.js → ArcGisPbfFeatureReader.js} +46 -32
  26. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
  27. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +1 -1
  28. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  29. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  30. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts +34 -0
  31. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
  32. package/lib/cjs/Tools/MapFeatureInfoDecorator.js +281 -0
  33. package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -0
  34. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts +38 -0
  35. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts.map +1 -0
  36. package/lib/cjs/Tools/MapFeatureInfoTool.js +113 -0
  37. package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -0
  38. package/lib/cjs/map-layers-formats.d.ts +1 -0
  39. package/lib/cjs/map-layers-formats.d.ts.map +1 -1
  40. package/lib/cjs/map-layers-formats.js +1 -0
  41. package/lib/cjs/map-layers-formats.js.map +1 -1
  42. package/lib/cjs/mapLayersFormats.d.ts +12 -1
  43. package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
  44. package/lib/cjs/mapLayersFormats.js +11 -1
  45. package/lib/cjs/mapLayersFormats.js.map +1 -1
  46. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +17 -0
  47. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
  48. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js +38 -0
  49. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -0
  50. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  51. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +4 -5
  52. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  53. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +40 -25
  54. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  55. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +5 -0
  56. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  57. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +4 -0
  58. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  59. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +15 -6
  60. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  61. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +4 -2
  62. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  63. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  64. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +13 -0
  65. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
  66. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js +107 -0
  67. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
  68. package/lib/esm/ArcGisFeature/{ArcGisFeaturePBF.d.ts → ArcGisPbfFeatureReader.d.ts} +6 -7
  69. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
  70. package/lib/esm/ArcGisFeature/{ArcGisFeaturePBF.js → ArcGisPbfFeatureReader.js} +44 -30
  71. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
  72. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +1 -1
  73. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  74. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  75. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts +34 -0
  76. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
  77. package/lib/esm/Tools/MapFeatureInfoDecorator.js +277 -0
  78. package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -0
  79. package/lib/esm/Tools/MapFeatureInfoTool.d.ts +38 -0
  80. package/lib/esm/Tools/MapFeatureInfoTool.d.ts.map +1 -0
  81. package/lib/esm/Tools/MapFeatureInfoTool.js +110 -0
  82. package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -0
  83. package/lib/esm/map-layers-formats.d.ts +1 -0
  84. package/lib/esm/map-layers-formats.d.ts.map +1 -1
  85. package/lib/esm/map-layers-formats.js +1 -0
  86. package/lib/esm/map-layers-formats.js.map +1 -1
  87. package/lib/esm/mapLayersFormats.d.ts +12 -1
  88. package/lib/esm/mapLayersFormats.d.ts.map +1 -1
  89. package/lib/esm/mapLayersFormats.js +13 -2
  90. package/lib/esm/mapLayersFormats.js.map +1 -1
  91. package/lib/public/locales/en/mapLayersFormats.json +12 -0
  92. package/package.json +15 -12
  93. package/.nycrc +0 -10
  94. package/.rush/temp/operation/build/all.log +0 -1
  95. package/.rush/temp/operation/build/state.json +0 -3
  96. package/.rush/temp/operation/cover/all.log +0 -103
  97. package/.rush/temp/operation/cover/state.json +0 -3
  98. package/.rush/temp/operation/docs/all.log +0 -30
  99. package/.rush/temp/operation/docs/state.json +0 -3
  100. package/.rush/temp/package-deps_build.json +0 -36
  101. package/.rush/temp/package-deps_cover.json +0 -36
  102. package/.rush/temp/package-deps_docs.json +0 -36
  103. package/.rush/temp/shrinkwrap-deps.json +0 -495
  104. package/CHANGELOG.json +0 -176
  105. package/config/rush-project.json +0 -6
  106. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
  107. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
  108. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
  109. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
  110. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
  111. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
  112. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
  113. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +0 -143
  114. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
  115. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
  116. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
  117. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -35
  118. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
  119. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
  120. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
  121. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -162
  122. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
  123. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
  124. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
  125. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -168
  126. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
  127. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
  128. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
  129. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -812
  130. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
  131. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
  132. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
  133. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -104
  134. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
  135. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
  136. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
  137. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -215
  138. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
  139. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
  140. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
  141. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -95
  142. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
  143. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
  144. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
  145. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -60
  146. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
  147. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +0 -7
  148. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts.map +0 -1
  149. package/lib/cjs/test/ArcGisFeature/Mocks.js +0 -19
  150. package/lib/cjs/test/ArcGisFeature/Mocks.js.map +0 -1
  151. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
  152. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
  153. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +0 -420
  154. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
  155. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
  156. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
  157. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -427
  158. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
  159. package/lib/cjs/test/coverage/.nyc_output/329513f2-7069-4b0e-a487-c3b48366153a.json +0 -1
  160. package/lib/cjs/test/coverage/.nyc_output/a1ec61a9-c1af-46dd-9c85-a6f85693894b.json +0 -1
  161. package/lib/cjs/test/coverage/.nyc_output/processinfo/329513f2-7069-4b0e-a487-c3b48366153a.json +0 -1
  162. package/lib/cjs/test/coverage/.nyc_output/processinfo/a1ec61a9-c1af-46dd-9c85-a6f85693894b.json +0 -1
  163. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +0 -1
  164. package/lib/cjs/test/coverage/cobertura-coverage.xml +0 -1206
  165. package/lib/cjs/test/coverage/lcov-report/base.css +0 -224
  166. package/lib/cjs/test/coverage/lcov-report/block-navigation.js +0 -87
  167. package/lib/cjs/test/coverage/lcov-report/favicon.png +0 -0
  168. package/lib/cjs/test/coverage/lcov-report/index.html +0 -131
  169. package/lib/cjs/test/coverage/lcov-report/prettify.css +0 -1
  170. package/lib/cjs/test/coverage/lcov-report/prettify.js +0 -2
  171. package/lib/cjs/test/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  172. package/lib/cjs/test/coverage/lcov-report/sorter.js +0 -196
  173. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +0 -145
  174. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +0 -550
  175. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +0 -730
  176. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +0 -1672
  177. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +0 -763
  178. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +0 -223
  179. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +0 -598
  180. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +0 -301
  181. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +0 -832
  182. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +0 -236
  183. package/lib/cjs/test/coverage/lcov-report/src/index.html +0 -131
  184. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +0 -130
  185. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +0 -163
  186. package/lib/cjs/test/coverage/lcov.info +0 -1399
  187. package/lib/cjs/tsconfig.tsbuildinfo +0 -1
  188. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
  189. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
  190. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +0 -129
  191. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
  192. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
  193. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
  194. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
  195. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
  196. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +0 -139
  197. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
  198. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
  199. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
  200. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -33
  201. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
  202. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
  203. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
  204. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -160
  205. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
  206. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
  207. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
  208. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -166
  209. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
  210. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
  211. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
  212. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -810
  213. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
  214. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
  215. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
  216. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -102
  217. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
  218. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
  219. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
  220. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -213
  221. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
  222. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
  223. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
  224. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -93
  225. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
  226. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
  227. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
  228. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -58
  229. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
  230. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +0 -7
  231. package/lib/esm/test/ArcGisFeature/Mocks.d.ts.map +0 -1
  232. package/lib/esm/test/ArcGisFeature/Mocks.js +0 -16
  233. package/lib/esm/test/ArcGisFeature/Mocks.js.map +0 -1
  234. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
  235. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
  236. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +0 -417
  237. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
  238. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
  239. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
  240. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -424
  241. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
  242. package/lib/esm/tsconfig.tsbuildinfo +0 -1
  243. package/lib/test/junit_results.xml +0 -169
  244. package/map-layers-formats.build.cache.log +0 -2
  245. package/map-layers-formats.cover.log +0 -103
  246. package/map-layers-formats.docs.log +0 -30
  247. package/map-layers-formats.lint.error.log +0 -1
  248. package/map-layers-formats.lint.log +0 -2
  249. package/src/ArcGisFeature/ArcGisFeatureFormat.ts +0 -20
  250. package/src/ArcGisFeature/ArcGisFeatureJSON.ts +0 -155
  251. package/src/ArcGisFeature/ArcGisFeaturePBF.ts +0 -215
  252. package/src/ArcGisFeature/ArcGisFeatureProvider.ts +0 -529
  253. package/src/ArcGisFeature/ArcGisFeatureQuery.ts +0 -226
  254. package/src/ArcGisFeature/ArcGisFeatureReader.ts +0 -46
  255. package/src/ArcGisFeature/ArcGisFeatureRenderer.ts +0 -171
  256. package/src/ArcGisFeature/ArcGisFeatureResponse.ts +0 -72
  257. package/src/ArcGisFeature/ArcGisSymbologyRenderer.ts +0 -249
  258. package/src/ArcGisFeature/esriPBuffer.gen.ts +0 -2612
  259. package/src/map-layers-formats.ts +0 -15
  260. package/src/mapLayersFormats.ts +0 -26
  261. package/src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts +0 -46
  262. package/src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts +0 -202
  263. package/src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts +0 -227
  264. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +0 -977
  265. package/src/test/ArcGisFeature/ArcGisFeatureQuery.test.ts +0 -117
  266. package/src/test/ArcGisFeature/ArcGisFeatureRenderer.test.ts +0 -296
  267. package/src/test/ArcGisFeature/ArcGisFeatureResponse.test.ts +0 -109
  268. package/src/test/ArcGisFeature/ArcGisSymbologyRenderer.test.ts +0 -77
  269. package/src/test/ArcGisFeature/Mocks.ts +0 -19
  270. package/src/test/ArcGisFeature/NewYorkDataset.ts +0 -423
  271. package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +0 -455
  272. package/tsconfig.json +0 -20
@@ -1,15 +0,0 @@
1
- import { ImageMapLayerSettings } from "@itwin/core-common";
2
- import { MapLayerFeatureInfo } from "@itwin/core-frontend";
3
- import { Transform } from "@itwin/core-geometry";
4
- import { ArcGisFeatureReader } from "./ArcGisFeatureReader";
5
- import { ArcGisFeatureRenderer } from "./ArcGisFeatureRenderer";
6
- import { ArcGisResponseData } from "./ArcGisFeatureResponse";
7
- /** @internal */
8
- export declare class ArcGisFeatureJSON extends ArcGisFeatureReader {
9
- transform: Transform | undefined;
10
- constructor(settings: ImageMapLayerSettings, layerMetadata: any);
11
- readAndRender(response: ArcGisResponseData, renderer: ArcGisFeatureRenderer): void;
12
- protected static deflateCoordinates(coordinates: number[][], flatCoordinates: number[], stride: number, offset: number): number;
13
- readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]): void;
14
- }
15
- //# sourceMappingURL=ArcGisFeatureJSON.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcGisFeatureJSON.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureJSON.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAwB,mBAAmB,EAA0B,MAAM,sBAAsB,CAAC;AACzG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAmB,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,gBAAgB;AAChB,qBAAa,iBAAmB,SAAQ,mBAAmB;IAClD,SAAS,EAAE,SAAS,GAAC,SAAS,CAAC;gBAEnB,QAAQ,EAAE,qBAAqB,EAAE,aAAa,EAAE,GAAG;IAI/D,aAAa,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,qBAAqB;IAuClF,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAUhH,eAAe,CAAC,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE;CAoFzF"}
@@ -1,129 +0,0 @@
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 { PropertyValueFormat, StandardTypeNames } from "@itwin/appui-abstract";
6
- import { MapFeatureInfoRecord } from "@itwin/core-frontend";
7
- import { ArcGisFeatureReader } from "./ArcGisFeatureReader";
8
- /** @internal */
9
- export class ArcGisFeatureJSON extends ArcGisFeatureReader {
10
- constructor(settings, layerMetadata) {
11
- super(settings, layerMetadata);
12
- }
13
- readAndRender(response, renderer) {
14
- const responseObj = response.data;
15
- if (responseObj?.geometryType === "esriGeometryPolyline" || responseObj?.geometryType === "esriGeometryPolygon") {
16
- const fill = (responseObj.geometryType === "esriGeometryPolygon");
17
- for (const feature of responseObj.features) {
18
- let offset = 0;
19
- const lengths = [];
20
- const coords = [];
21
- if (feature?.geometry?.rings) {
22
- for (const ring of feature?.geometry?.rings) {
23
- offset = ArcGisFeatureJSON.deflateCoordinates(ring, coords, 2, offset);
24
- lengths.push(ring.length);
25
- }
26
- }
27
- else if (feature?.geometry?.paths) {
28
- for (const path of feature?.geometry?.paths) {
29
- offset = ArcGisFeatureJSON.deflateCoordinates(path, coords, 2, offset);
30
- lengths.push(path.length);
31
- }
32
- }
33
- renderer.renderPath(lengths, coords, fill, 2, renderer.transform === undefined);
34
- }
35
- }
36
- else if (responseObj?.geometryType === "esriGeometryPoint" || responseObj?.geometryType === "esriGeometryMultiPoint") {
37
- for (const feature of responseObj.features) {
38
- // TODO: Add support for multipoint
39
- if (feature.geometry) {
40
- const lengths = [];
41
- const coords = [feature.geometry.x, feature.geometry.y];
42
- renderer.renderPoint(lengths, coords, 2, renderer.transform === undefined);
43
- }
44
- }
45
- }
46
- }
47
- // Converts an [[x1,y1], [x2,y2], ...] to [x1,y1,x2,y2, ...]
48
- // stride is the number of dimensions
49
- // https://github.com/openlayers/openlayers/blob/7a2f87caca9ddc1912d910f56eb5637445fc11f6/src/ol/geom/flat/deflate.js#L26
50
- static deflateCoordinates(coordinates, flatCoordinates, stride, offset) {
51
- for (let i = 0, ii = coordinates.length; i < ii; ++i) {
52
- const coordinate = coordinates[i];
53
- for (let j = 0; j < stride; ++j)
54
- flatCoordinates[offset++] = coordinate[j];
55
- }
56
- return offset;
57
- }
58
- readFeatureInfo(response, featureInfos) {
59
- const responseObj = response.data;
60
- if (responseObj === undefined || !Array.isArray(responseObj.features))
61
- return;
62
- const layerInfo = { layerName: this._settings.name };
63
- // Create a signature index for every field name / type.
64
- const fieldsType = {};
65
- for (const fieldInfo of responseObj.fields) {
66
- fieldsType[fieldInfo.name] = fieldInfo.type;
67
- }
68
- const getStandardTypeName = (fieldType) => {
69
- switch (fieldType) {
70
- case "esriFieldTypeInteger":
71
- case "esriFieldTypeSmallInteger":
72
- case "esriFieldTypeOID":
73
- return StandardTypeNames.Integer;
74
- case "esriFieldTypeDouble":
75
- return StandardTypeNames.Double;
76
- case "esriFieldTypeSingle":
77
- return StandardTypeNames.Float;
78
- case "esriFieldTypeDate":
79
- return StandardTypeNames.DateTime;
80
- default:
81
- return StandardTypeNames.String;
82
- }
83
- };
84
- const getRecordInfo = (fieldName, value) => {
85
- const propertyValue = { valueFormat: PropertyValueFormat.Primitive };
86
- if (value === null) {
87
- value = undefined;
88
- }
89
- const strValue = `${value}`;
90
- const fieldType = fieldsType[fieldName];
91
- switch (fieldType) {
92
- case "esriFieldTypeInteger":
93
- case "esriFieldTypeSmallInteger":
94
- case "esriFieldTypeOID":
95
- propertyValue.value = value;
96
- break;
97
- case "esriFieldTypeDouble":
98
- case "esriFieldTypeSingle":
99
- propertyValue.value = this.toFixedWithoutPadding(value);
100
- break;
101
- case "esriFieldTypeDate":
102
- propertyValue.value = new Date(value);
103
- break;
104
- default:
105
- if (value !== undefined)
106
- propertyValue.value = strValue;
107
- break;
108
- }
109
- const typename = getStandardTypeName(fieldType);
110
- propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
111
- return new MapFeatureInfoRecord(propertyValue, { name: fieldName, displayLabel: fieldName, typename });
112
- };
113
- for (const feature of responseObj.features) {
114
- const subLayerInfo = {
115
- subLayerName: this._layerMetadata.name,
116
- displayFieldName: this._layerMetadata.name,
117
- records: [],
118
- };
119
- for (const [key, value] of Object.entries(feature.attributes))
120
- subLayerInfo.records?.push(getRecordInfo(key, value));
121
- if (layerInfo.info === undefined)
122
- layerInfo.info = [];
123
- if (!(layerInfo.info instanceof HTMLElement))
124
- layerInfo.info.push(subLayerInfo);
125
- }
126
- featureInfos.push(layerInfo);
127
- }
128
- }
129
- //# sourceMappingURL=ArcGisFeatureJSON.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcGisFeatureJSON.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureJSON.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAkB,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,oBAAoB,EAA+C,MAAM,sBAAsB,CAAC;AAEzG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,gBAAgB;AAChB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ED,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CACF","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 { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { MapFeatureInfoRecord, MapLayerFeatureInfo, MapSubLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { ArcGisFeatureReader } from \"./ArcGisFeatureReader\";\r\nimport { ArcGisFeatureRenderer } from \"./ArcGisFeatureRenderer\";\r\nimport { ArcGisFieldType, ArcGisResponseData } from \"./ArcGisFeatureResponse\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureJSON extends ArcGisFeatureReader {\r\n public transform: Transform|undefined;\r\n\r\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\r\n super(settings, layerMetadata);\r\n }\r\n\r\n public readAndRender(response: ArcGisResponseData, renderer: ArcGisFeatureRenderer) {\r\n const responseObj = response.data;\r\n\r\n if (responseObj?.geometryType === \"esriGeometryPolyline\" || responseObj?.geometryType === \"esriGeometryPolygon\") {\r\n const fill = (responseObj.geometryType === \"esriGeometryPolygon\");\r\n for (const feature of responseObj.features) {\r\n let offset = 0;\r\n const lengths: number[] = [];\r\n const coords: number[] = [];\r\n\r\n if (feature?.geometry?.rings) {\r\n for (const ring of feature?.geometry?.rings) {\r\n offset = ArcGisFeatureJSON.deflateCoordinates(ring, coords, 2, offset);\r\n lengths.push(ring.length);\r\n }\r\n } else if (feature?.geometry?.paths) {\r\n for (const path of feature?.geometry?.paths) {\r\n offset = ArcGisFeatureJSON.deflateCoordinates(path, coords, 2, offset);\r\n lengths.push(path.length);\r\n }\r\n }\r\n renderer.renderPath(lengths, coords, fill, 2, renderer.transform === undefined);\r\n\r\n }\r\n } else if (responseObj?.geometryType === \"esriGeometryPoint\" || responseObj?.geometryType === \"esriGeometryMultiPoint\") {\r\n for (const feature of responseObj.features) {\r\n // TODO: Add support for multipoint\r\n if (feature.geometry) {\r\n const lengths: number[] = [];\r\n const coords: number[] = [feature.geometry.x, feature.geometry.y];\r\n renderer.renderPoint(lengths, coords, 2, renderer.transform === undefined);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Converts an [[x1,y1], [x2,y2], ...] to [x1,y1,x2,y2, ...]\r\n // stride is the number of dimensions\r\n // https://github.com/openlayers/openlayers/blob/7a2f87caca9ddc1912d910f56eb5637445fc11f6/src/ol/geom/flat/deflate.js#L26\r\n protected static deflateCoordinates( coordinates: number[][], flatCoordinates: number[], stride: number, offset: number) {\r\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\r\n const coordinate = coordinates[i];\r\n for (let j = 0; j < stride; ++j)\r\n flatCoordinates[offset++] = coordinate[j];\r\n }\r\n\r\n return offset;\r\n }\r\n\r\n public readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]) {\r\n const responseObj = response.data;\r\n if (responseObj === undefined || !Array.isArray(responseObj.features))\r\n return;\r\n\r\n const layerInfo: MapLayerFeatureInfo = {layerName: this._settings.name};\r\n\r\n // Create a signature index for every field name / type.\r\n const fieldsType: {[key: string]: ArcGisFieldType} = {};\r\n for (const fieldInfo of responseObj.fields) {\r\n fieldsType[fieldInfo.name] = fieldInfo.type;\r\n }\r\n\r\n const getStandardTypeName = (fieldType: ArcGisFieldType) => {\r\n switch (fieldType) {\r\n case \"esriFieldTypeInteger\":\r\n case \"esriFieldTypeSmallInteger\":\r\n case \"esriFieldTypeOID\":\r\n return StandardTypeNames.Integer;\r\n case \"esriFieldTypeDouble\":\r\n return StandardTypeNames.Double;\r\n case \"esriFieldTypeSingle\":\r\n return StandardTypeNames.Float;\r\n case \"esriFieldTypeDate\":\r\n return StandardTypeNames.DateTime;\r\n default:\r\n return StandardTypeNames.String;\r\n }\r\n };\r\n\r\n const getRecordInfo = (fieldName: string, value: any) => {\r\n const propertyValue: PrimitiveValue = {valueFormat: PropertyValueFormat.Primitive};\r\n\r\n if (value === null) {\r\n value = undefined;\r\n }\r\n\r\n const strValue = `${value}`;\r\n const fieldType = fieldsType[fieldName];\r\n switch (fieldType) {\r\n case \"esriFieldTypeInteger\":\r\n case \"esriFieldTypeSmallInteger\":\r\n case \"esriFieldTypeOID\":\r\n propertyValue.value = value as number;\r\n break;\r\n case \"esriFieldTypeDouble\":\r\n case \"esriFieldTypeSingle\":\r\n propertyValue.value = this.toFixedWithoutPadding(value);\r\n break;\r\n case \"esriFieldTypeDate\":\r\n propertyValue.value = new Date(value);\r\n break;\r\n default:\r\n if (value !== undefined)\r\n propertyValue.value = strValue;\r\n\r\n break;\r\n }\r\n\r\n const typename = getStandardTypeName(fieldType);\r\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\r\n\r\n return new MapFeatureInfoRecord (propertyValue, {name: fieldName, displayLabel: fieldName, typename});\r\n };\r\n\r\n for (const feature of responseObj.features) {\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: this._layerMetadata.name,\r\n displayFieldName: this._layerMetadata.name,\r\n records : [],\r\n };\r\n\r\n for (const [key, value] of Object.entries(feature.attributes))\r\n subLayerInfo.records?.push(getRecordInfo(key,value));\r\n\r\n if (layerInfo.info === undefined)\r\n layerInfo.info = [];\r\n\r\n if (!(layerInfo.info instanceof HTMLElement))\r\n layerInfo.info.push(subLayerInfo);\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n}\r\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcGisFeaturePBF.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeaturePBF.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,W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AAI,CAAC,GAAG,CAAC,CAAC;YAEV,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE;gBAC1C,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;oBACrB,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,6DAA6D,CAAC,CAAC;oBAC/F,MAAM;iBACP;gBACD,uCAAuC;gBACvC,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;gBACjD,IAAI,IAAI,EAAE;oBACR,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;iBAClC;gBAED,CAAC,EAAE,CAAC;aACL;YACD,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE;gBAChC,SAAS,CAAC,IAAI,GAAG,EAAE,CAAC;aACrB;YACD,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,WAAW,CAAC,EAAE;gBAC5C,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACnC;SACF;QAED,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CACF","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 { ArcGisFeatureRenderer } from \"./ArcGisFeatureRenderer\";\r\nimport { esriPBuffer } from \"../ArcGisFeature/esriPBuffer.gen\";\r\nimport { MapFeatureInfoRecord, MapLayerFeatureInfo, MapSubLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisFeatureReader } from \"./ArcGisFeatureReader\";\r\nimport { ArcGisResponseData } from \"./ArcGisFeatureResponse\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { ArcGisFeatureGeometryType } from \"./ArcGisFeatureQuery\";\r\n\r\nconst esriGeometryType = esriPBuffer.FeatureCollectionPBuffer.GeometryType;\r\nconst loggerCategory = \"MapLayersFormats.ArcGISFeature\";\r\n\r\ninterface PbfFieldInfo {\r\n name: string;\r\n type: esriPBuffer.FeatureCollectionPBuffer.FieldType;\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGisFeaturePBF extends ArcGisFeatureReader {\r\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\r\n super(settings, layerMetadata);\r\n }\r\n\r\n public static getArcGisFeatureGeometryType(geomType: esriPBuffer.FeatureCollectionPBuffer.GeometryType): ArcGisFeatureGeometryType {\r\n switch (geomType) {\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:\r\n return \"esriGeometryMultiPatch\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:\r\n return \"esriGeometryMultipoint\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:\r\n return \"esriGeometryPoint\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:\r\n return \"esriGeometryPolygon\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:\r\n return \"esriGeometryPolyline\";\r\n default:\r\n return \"esriGeometryNull\";\r\n }\r\n }\r\n\r\n public readAndRender(response: ArcGisResponseData, renderer: ArcGisFeatureRenderer) {\r\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\r\n const msg = \"Response was not in PBF format\";\r\n Logger.logError(loggerCategory, msg);\r\n return;\r\n }\r\n\r\n const collection = response.data;\r\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\r\n return;\r\n\r\n const geomType = collection.queryResult.featureResult.geometryType;\r\n const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;\r\n\r\n // console.log(`Nb Feature: ${collection.queryResult.featureResult.features.length}`);\r\n if (geomType === esriGeometryType.esriGeometryTypePoint ||\r\n geomType === esriGeometryType.esriGeometryTypeMultipoint) {\r\n for (const feature of collection.queryResult.featureResult.features)\r\n renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, renderer.transform === undefined);\r\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\r\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\r\n for (const feature of collection.queryResult.featureResult.features)\r\n if (feature?.has_geometry)\r\n renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);\r\n }\r\n }\r\n\r\n public readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]) {\r\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\r\n\r\n Logger.logError(loggerCategory, \"Response was not in PBF format\");\r\n }\r\n\r\n const collection = response.data as esriPBuffer.FeatureCollectionPBuffer;\r\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\r\n return;\r\n\r\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, info: [] };\r\n\r\n // Fields metadata is stored outside feature results, create dedicated array first\r\n const fields: PbfFieldInfo[] = [];\r\n for (const field of collection.queryResult.featureResult.fields)\r\n fields.push({name: field.name, type:field.fieldType});\r\n\r\n const getNumericValue = (attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) => {\r\n const propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\r\n let typename = StandardTypeNames.Number;\r\n if (attrValue.has_double_value) {\r\n const value = this.toFixedWithoutPadding(attrValue.double_value);\r\n propertyValue.value = value;\r\n typename = StandardTypeNames.Double;\r\n } else if (attrValue.has_float_value) {\r\n const value = this.toFixedWithoutPadding(attrValue.float_value);\r\n propertyValue.value = value;\r\n typename = StandardTypeNames.Float;\r\n } else if (attrValue.has_int64_value) {\r\n propertyValue.value = attrValue.int64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_sint64_value) {\r\n propertyValue.value = attrValue.sint64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_sint_value) {\r\n propertyValue.value = attrValue.sint_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_uint64_value) {\r\n propertyValue.value = attrValue.uint64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_uint_value) {\r\n propertyValue.value = attrValue.uint_value;\r\n typename = StandardTypeNames.Integer;\r\n } else {\r\n propertyValue.value = undefined;\r\n }\r\n\r\n return { propertyValue, typename };\r\n };\r\n\r\n const getRecordInfo = (fieldInfo: PbfFieldInfo, attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) => {\r\n let propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\r\n\r\n let typename = StandardTypeNames.String;\r\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate\r\n ) {\r\n const value = getNumericValue(attrValue);\r\n if (value.propertyValue === undefined) {\r\n Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n\r\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {\r\n const test = (value.propertyValue.value as unknown) as number;\r\n propertyValue.value = new Date(test);\r\n typename = StandardTypeNames.DateTime;\r\n } else {\r\n typename = value.typename;\r\n propertyValue = value.propertyValue;\r\n }\r\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {\r\n if (attrValue.has_string_value) {\r\n propertyValue.value = attrValue.string_value;\r\n typename = StandardTypeNames.String;\r\n }\r\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {\r\n if (attrValue.has_string_value) {\r\n propertyValue.value = attrValue.string_value;\r\n typename = StandardTypeNames.String;\r\n } else {\r\n const value = getNumericValue(attrValue);\r\n if (value.propertyValue === undefined) {\r\n Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n }\r\n } else if (attrValue.has_string_value) {\r\n // If we reach this case that probably mean we don't support the field type, simply try to output string value\r\n typename = StandardTypeNames.String;\r\n propertyValue.value = attrValue.string_value;\r\n } else if (attrValue.value_type === \"none\") {\r\n // Sometimes fields are just empty, use an empty string\r\n typename = StandardTypeNames.String;\r\n propertyValue.value = undefined;\r\n } else {\r\n Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n\r\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\r\n\r\n return new MapFeatureInfoRecord(propertyValue, { name: fieldInfo.name, displayLabel: fieldInfo.name, typename });\r\n };\r\n\r\n // Read feature values\r\n for (const feature of collection.queryResult.featureResult.features) {\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: this._layerMetadata.name,\r\n displayFieldName: this._layerMetadata.name,\r\n records: [],\r\n };\r\n let i = 0;\r\n\r\n for (const attrValue of feature.attributes) {\r\n if (i > fields.length) {\r\n Logger.logError(loggerCategory, \"Error while read feature info data: fields metadata missing\");\r\n break;\r\n }\r\n // Convert everything to string for now\r\n const info = getRecordInfo(fields[i], attrValue);\r\n if (info) {\r\n subLayerInfo.records?.push(info);\r\n }\r\n\r\n i++;\r\n }\r\n if (layerInfo.info === undefined) {\r\n layerInfo.info = [];\r\n }\r\n if (!(layerInfo.info instanceof HTMLElement)) {\r\n layerInfo.info.push(subLayerInfo);\r\n }\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n}\r\n"]}
@@ -1,33 +0,0 @@
1
- import { Transform } from "@itwin/core-geometry";
2
- import { ArcGisSymbologyRenderer } from "./ArcGisSymbologyRenderer";
3
- /** @internal */
4
- export declare class ArcGisFeatureRenderer {
5
- private _symbol;
6
- private _transform;
7
- private _context;
8
- constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform);
9
- get transform(): Transform | undefined;
10
- private closePath;
11
- private lineTo;
12
- private moveTo;
13
- private fill;
14
- private stroke;
15
- /**
16
- * Render a path on the renderer's context.
17
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
18
- * @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
19
- * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
20
- * @param fill Indicates if the path should be filled or not.
21
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
22
- */
23
- renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean): void;
24
- /**
25
- * Render a point on the renderer's context.
26
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
27
- * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
28
- * @param geometryCoords Array that linearly encodes vertices.
29
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
30
- */
31
- renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean): void;
32
- }
33
- //# sourceMappingURL=ArcGisFeatureRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcGisFeatureRenderer.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureRenderer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,gBAAgB;AAChB,qBAAa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,UAAU,CAAsB;IACxC,OAAO,CAAC,QAAQ,CAA2B;gBAE/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,uBAAuB,EAAE,oBAAoB,CAAC,EAAE,SAAS;IAMhH,IAAW,SAAS,0BAA4B;IAGhD,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,MAAM;IAId;;;;;;;MAOE;IACK,UAAU,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAmE7H;;;;;;MAME;IACK,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;CA8ChH"}
@@ -1,139 +0,0 @@
1
- /** @internal */
2
- export class ArcGisFeatureRenderer {
3
- constructor(context, symbol, world2PixelTransform) {
4
- this._symbol = symbol;
5
- this._context = context;
6
- this._transform = world2PixelTransform;
7
- }
8
- get transform() { return this._transform; }
9
- // Utility functions to make ease testing.
10
- closePath() {
11
- this._context.closePath();
12
- }
13
- lineTo(x, y) {
14
- this._context.lineTo(x, y);
15
- }
16
- moveTo(x, y) {
17
- this._context.moveTo(x, y);
18
- }
19
- fill() {
20
- this._context.fill();
21
- }
22
- stroke() {
23
- this._context.stroke();
24
- }
25
- /**
26
- * Render a path on the renderer's context.
27
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
28
- * @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
29
- * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
30
- * @param fill Indicates if the path should be filled or not.
31
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
32
- */
33
- renderPath(geometryLengths, geometryCoords, fill, stride, relativeCoords) {
34
- if (stride < 2 || stride > 3) {
35
- return;
36
- }
37
- // Keep track of our position in the in the 'coords' array:
38
- // Every time we loop on the 'lengths' array, the position
39
- // to start reading vertices in the 'coords' must be the sum of all previously read vertices.
40
- let coordsOffset = 0;
41
- // Begin the path here.
42
- // Note: Even though path is closed inside the 'geometryLengths' loop,
43
- // it's import to begin the path only once.
44
- this._context.beginPath();
45
- for (const vertexCount of geometryLengths) {
46
- let lastPtX = 0, lastPtY = 0;
47
- for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
48
- let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
49
- let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
50
- if (vertexIdx === 0) {
51
- // first vertex is always "absolute" and must be drawn as 'moveTo' (i.e. not lineTo)
52
- if (relativeCoords) {
53
- lastPtX = pX;
54
- lastPtY = pY;
55
- }
56
- if (this._transform) {
57
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
58
- pX = transformedPoint.x;
59
- pY = transformedPoint.y;
60
- }
61
- this.moveTo(pX, pY);
62
- }
63
- else {
64
- // Following vertices are relative to the previous one (sadly not really well documented by ESRI)
65
- // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)
66
- if (relativeCoords) {
67
- pX = lastPtX = lastPtX + pX;
68
- pY = lastPtY = lastPtY + pY;
69
- }
70
- if (this._transform) {
71
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
72
- pX = transformedPoint.x;
73
- pY = transformedPoint.y;
74
- }
75
- this.lineTo(pX, pY);
76
- }
77
- }
78
- coordsOffset += stride * vertexCount;
79
- if (fill) {
80
- // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)
81
- this.closePath();
82
- }
83
- }
84
- if (fill) {
85
- this._symbol.applyFillStyle(this._context);
86
- this.fill();
87
- }
88
- this._symbol.applyStrokeStyle(this._context);
89
- this.stroke(); // draw line path or polygon outline
90
- }
91
- /**
92
- * Render a point on the renderer's context.
93
- * Note: Inputs are designed based on the PBF format, to avoid any data transformation.
94
- * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
95
- * @param geometryCoords Array that linearly encodes vertices.
96
- * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
97
- */
98
- renderPoint(geometryLengths, geometryCoords, stride, relativeCoords) {
99
- if (stride < 2 || stride > 3) {
100
- return;
101
- }
102
- let coordsOffset = 0;
103
- if (geometryLengths.length === 0) {
104
- // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.
105
- if (geometryCoords.length >= stride) {
106
- if (this._transform) {
107
- const transformedPoint = this._transform.multiplyPoint2d({ x: geometryCoords[0], y: geometryCoords[1] });
108
- this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);
109
- }
110
- else {
111
- this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);
112
- }
113
- }
114
- }
115
- else {
116
- // MULTI-POINTS: Needs testing
117
- // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.
118
- for (const vertexCount of geometryLengths) {
119
- let lastPtX = 0, lastPtY = 0;
120
- for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
121
- let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
122
- let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
123
- if (relativeCoords) {
124
- pX = lastPtX = lastPtX + pX;
125
- pY = lastPtY = lastPtY + pY;
126
- }
127
- if (this._transform) {
128
- const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
129
- pX = transformedPoint.x;
130
- pY = transformedPoint.y;
131
- }
132
- this._symbol.drawPoint(this._context, pX, pY);
133
- }
134
- coordsOffset += stride * vertexCount;
135
- }
136
- }
137
- }
138
- }
139
- //# sourceMappingURL=ArcGisFeatureRenderer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcGisFeatureRenderer.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureRenderer.ts"],"names":[],"mappings":"AAOA,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IAKhC,YAAY,OAAiC,EAAE,MAA+B,EAAE,oBAAgC;QAC9G,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC;IACzC,CAAC;IAED,IAAW,SAAS,KAAI,OAAO,IAAI,CAAC,UAAU,CAAC,CAAA,CAAC;IAEhD,0CAA0C;IAClC,SAAS;QACf,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,CAAS,EAAE,CAAS;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,CAAS,EAAE,CAAS;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEO,IAAI;QACV,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAEO,MAAM;QACZ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;;MAOE;IACK,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;wBACxB,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC;qBACzB;oBAED,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;iBAE/C;gBACD,YAAY,IAAE,MAAM,GAAC,WAAW,CAAC;aAClC;SACF;IAEH,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { ArcGisSymbologyRenderer } from \"./ArcGisSymbologyRenderer\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureRenderer {\r\n private _symbol: ArcGisSymbologyRenderer;\r\n private _transform: Transform|undefined;\r\n private _context: CanvasRenderingContext2D;\r\n\r\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform) {\r\n this._symbol = symbol;\r\n this._context = context;\r\n this._transform = world2PixelTransform;\r\n }\r\n\r\n public get transform() {return this._transform;}\r\n\r\n // Utility functions to make ease testing.\r\n private closePath() {\r\n this._context.closePath();\r\n }\r\n\r\n private lineTo(x: number, y: number) {\r\n this._context.lineTo(x,y);\r\n }\r\n\r\n private moveTo(x: number, y: number) {\r\n this._context.moveTo(x,y);\r\n }\r\n\r\n private fill() {\r\n this._context.fill();\r\n }\r\n\r\n private stroke() {\r\n this._context.stroke();\r\n }\r\n\r\n /**\r\n * Render a path on the renderer's context.\r\n * Note: Inputs are designed based on the PBF format, to avoid any data transformation.\r\n * @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)\r\n * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon\r\n * @param fill Indicates if the path should be filled or not.\r\n * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.\r\n */\r\n public renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean) {\r\n if (stride < 2 || stride > 3) {\r\n return;\r\n }\r\n\r\n // Keep track of our position in the in the 'coords' array:\r\n // Every time we loop on the 'lengths' array, the position\r\n // to start reading vertices in the 'coords' must be the sum of all previously read vertices.\r\n let coordsOffset = 0;\r\n\r\n // Begin the path here.\r\n // Note: Even though path is closed inside the 'geometryLengths' loop,\r\n // it's import to begin the path only once.\r\n this._context.beginPath();\r\n for (const vertexCount of geometryLengths) {\r\n let lastPtX = 0, lastPtY = 0;\r\n for (let vertexIdx=0 ; vertexIdx <vertexCount; vertexIdx++) {\r\n let pX = geometryCoords[coordsOffset+(vertexIdx*stride)];\r\n let pY = geometryCoords[coordsOffset+(vertexIdx*stride)+1];\r\n if (vertexIdx === 0) {\r\n // first vertex is always \"absolute\" and must be drawn as 'moveTo' (i.e. not lineTo)\r\n if (relativeCoords) {\r\n lastPtX = pX;\r\n lastPtY = pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n\r\n this.moveTo(pX, pY);\r\n } else {\r\n\r\n // Following vertices are relative to the previous one (sadly not really well documented by ESRI)\r\n // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)\r\n if (relativeCoords) {\r\n pX = lastPtX = lastPtX+pX;\r\n pY = lastPtY = lastPtY+pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n this.lineTo(pX, pY);\r\n }\r\n\r\n }\r\n coordsOffset+=stride*vertexCount;\r\n if (fill) {\r\n // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)\r\n this.closePath();\r\n }\r\n }\r\n\r\n if (fill) {\r\n this._symbol.applyFillStyle(this._context);\r\n this.fill();\r\n }\r\n\r\n this._symbol.applyStrokeStyle(this._context);\r\n this.stroke(); // draw line path or polygon outline\r\n }\r\n\r\n /**\r\n * Render a point on the renderer's context.\r\n * Note: Inputs are designed based on the PBF format, to avoid any data transformation.\r\n * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.\r\n * @param geometryCoords Array that linearly encodes vertices.\r\n * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.\r\n */\r\n public renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean) {\r\n\r\n if (stride < 2 || stride > 3) {\r\n return;\r\n }\r\n let coordsOffset = 0;\r\n if (geometryLengths.length === 0) {\r\n // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.\r\n if (geometryCoords.length >= stride) {\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: geometryCoords[0], y:geometryCoords[1]});\r\n this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);\r\n } else {\r\n this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);\r\n }\r\n }\r\n } else {\r\n // MULTI-POINTS: Needs testing\r\n // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.\r\n for (const vertexCount of geometryLengths) {\r\n let lastPtX = 0, lastPtY = 0;\r\n for (let vertexIdx=0 ; vertexIdx <vertexCount; vertexIdx++) {\r\n let pX = geometryCoords[coordsOffset+(vertexIdx*stride)];\r\n let pY = geometryCoords[coordsOffset+(vertexIdx*stride)+1];\r\n\r\n if (relativeCoords) {\r\n pX = lastPtX = lastPtX+pX;\r\n pY = lastPtY = lastPtY+pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n\r\n this._symbol.drawPoint(this._context, pX, pY);\r\n\r\n }\r\n coordsOffset+=stride*vertexCount;\r\n }\r\n }\r\n\r\n }\r\n\r\n}\r\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ArcGisFeatureFeatureFormats.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcGisFeatureFeatureFormats.test.d.ts","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts"],"names":[],"mappings":""}
@@ -1,33 +0,0 @@
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 { ImageMapLayerSettings } from "@itwin/core-common";
6
- import { ArcGisUtilities, MapLayerSourceStatus, } from "@itwin/core-frontend";
7
- import { expect } from "chai";
8
- import { ArcGisFeatureMapLayerFormat } from "../../ArcGisFeature/ArcGisFeatureFormat";
9
- import { esriFeatureSampleSource } from "./Mocks";
10
- import * as sinon from "sinon";
11
- describe("ArcGisFeaturePBF", () => {
12
- const sandbox = sinon.createSandbox();
13
- afterEach(async () => {
14
- sandbox.restore();
15
- });
16
- it("should createImageryProvider", async () => {
17
- const provider = ArcGisFeatureMapLayerFormat.createImageryProvider(ImageMapLayerSettings.fromJSON(esriFeatureSampleSource));
18
- expect(provider).to.not.undefined;
19
- });
20
- it("should validateSource", async () => {
21
- const fakeMethod = async (_url, _formatId, _filter, _userName, _password, _ignoreCache) => {
22
- return { status: MapLayerSourceStatus.Valid };
23
- };
24
- const validateSourceStub = sinon.stub(ArcGisUtilities, "validateSource").callsFake(fakeMethod);
25
- await ArcGisFeatureMapLayerFormat.validateSource(esriFeatureSampleSource.url);
26
- expect(validateSourceStub.calledOnce).to.be.true;
27
- const firstCall = validateSourceStub.getCalls()[0];
28
- expect(firstCall.args[0]).to.equals(esriFeatureSampleSource.url);
29
- expect(firstCall.args[1]).to.equals(ArcGisFeatureMapLayerFormat.formatId);
30
- expect(firstCall.args[2]).to.eqls(["query"]);
31
- });
32
- });
33
- //# sourceMappingURL=ArcGisFeatureFeatureFormats.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcGisFeatureFeatureFormats.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAEhC,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IAEtC,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,QAAQ,GAAG,2BAA2B,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC5H,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QAErC,MAAM,UAAU,GAAG,KAAK,EAAE,IAAY,EAAE,SAAiB,EAAC,OAAiB,EAAE,SAAkB,EAAE,SAAkB,EAAE,YAAsB,EAAE,EAAE;YAC7I,OAAO,EAAC,MAAM,EAAE,oBAAoB,CAAC,KAAK,EAAC,CAAC;QAE9C,CAAC,CAAC;QACF,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAE/F,MAAM,2BAA2B,CAAC,cAAc,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;QAE9E,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACjD,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;QAC1E,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,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 { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport {\r\n ArcGisUtilities,\r\n MapLayerSourceStatus,\r\n} from \"@itwin/core-frontend\";\r\nimport { expect } from \"chai\";\r\nimport { ArcGisFeatureMapLayerFormat } from \"../../ArcGisFeature/ArcGisFeatureFormat\";\r\nimport { esriFeatureSampleSource } from \"./Mocks\";\r\nimport * as sinon from \"sinon\";\r\n\r\ndescribe(\"ArcGisFeaturePBF\", () => {\r\n\r\n const sandbox = sinon.createSandbox();\r\n\r\n afterEach(async () => {\r\n sandbox.restore();\r\n });\r\n\r\n it(\"should createImageryProvider\", async () => {\r\n const provider = ArcGisFeatureMapLayerFormat.createImageryProvider(ImageMapLayerSettings.fromJSON(esriFeatureSampleSource));\r\n expect(provider).to.not.undefined;\r\n });\r\n\r\n it(\"should validateSource\", async () => {\r\n\r\n const fakeMethod = async (_url: string, _formatId: string,_filter: string[], _userName?: string, _password?: string, _ignoreCache?: boolean) => {\r\n return {status: MapLayerSourceStatus.Valid};\r\n\r\n };\r\n const validateSourceStub = sinon.stub(ArcGisUtilities, \"validateSource\").callsFake(fakeMethod);\r\n\r\n await ArcGisFeatureMapLayerFormat.validateSource(esriFeatureSampleSource.url);\r\n\r\n expect(validateSourceStub.calledOnce).to.be.true;\r\n const firstCall = validateSourceStub.getCalls()[0];\r\n expect(firstCall.args[0]).to.equals(esriFeatureSampleSource.url);\r\n expect(firstCall.args[1]).to.equals(ArcGisFeatureMapLayerFormat.formatId);\r\n expect(firstCall.args[2]).to.eqls([\"query\"]);\r\n });\r\n\r\n});\r\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ArcGisFeatureJSON.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArcGisFeatureJSON.test.d.ts","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts"],"names":[],"mappings":""}