@itwin/map-layers-formats 4.1.0-dev.6 → 4.1.0-dev.63

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 (269) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts +17 -0
  3. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
  4. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js +42 -0
  5. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -0
  6. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts.map +1 -1
  7. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +3 -0
  8. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  9. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +7 -5
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +88 -35
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +5 -0
  14. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  15. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +4 -0
  16. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  17. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +15 -6
  18. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  19. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +6 -4
  20. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  21. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +13 -0
  22. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
  23. package/lib/cjs/ArcGisFeature/{ArcGisFeatureJSON.js → ArcGisJsonFeatureReader.js} +36 -58
  24. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
  25. package/lib/cjs/ArcGisFeature/{ArcGisFeaturePBF.d.ts → ArcGisPbfFeatureReader.d.ts} +6 -7
  26. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
  27. package/lib/cjs/ArcGisFeature/{ArcGisFeaturePBF.js → ArcGisPbfFeatureReader.js} +46 -32
  28. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
  29. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +4 -4
  30. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  31. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts +34 -0
  32. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
  33. package/lib/cjs/Tools/MapFeatureInfoDecorator.js +281 -0
  34. package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -0
  35. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts +38 -0
  36. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts.map +1 -0
  37. package/lib/cjs/Tools/MapFeatureInfoTool.js +113 -0
  38. package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -0
  39. package/lib/cjs/map-layers-formats.d.ts +1 -0
  40. package/lib/cjs/map-layers-formats.d.ts.map +1 -1
  41. package/lib/cjs/map-layers-formats.js +1 -0
  42. package/lib/cjs/map-layers-formats.js.map +1 -1
  43. package/lib/cjs/mapLayersFormats.d.ts +12 -1
  44. package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
  45. package/lib/cjs/mapLayersFormats.js +11 -1
  46. package/lib/cjs/mapLayersFormats.js.map +1 -1
  47. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +17 -0
  48. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
  49. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js +38 -0
  50. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -0
  51. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts.map +1 -1
  52. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +4 -1
  53. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  54. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +7 -5
  55. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  56. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +89 -36
  57. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  58. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +5 -0
  59. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  60. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +4 -0
  61. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  62. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +15 -6
  63. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  64. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +4 -2
  65. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  66. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +13 -0
  67. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
  68. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js +107 -0
  69. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
  70. package/lib/esm/ArcGisFeature/{ArcGisFeaturePBF.d.ts → ArcGisPbfFeatureReader.d.ts} +6 -7
  71. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
  72. package/lib/esm/ArcGisFeature/{ArcGisFeaturePBF.js → ArcGisPbfFeatureReader.js} +44 -30
  73. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
  74. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +4 -4
  75. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  76. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts +34 -0
  77. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
  78. package/lib/esm/Tools/MapFeatureInfoDecorator.js +277 -0
  79. package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -0
  80. package/lib/esm/Tools/MapFeatureInfoTool.d.ts +38 -0
  81. package/lib/esm/Tools/MapFeatureInfoTool.d.ts.map +1 -0
  82. package/lib/esm/Tools/MapFeatureInfoTool.js +110 -0
  83. package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -0
  84. package/lib/esm/map-layers-formats.d.ts +1 -0
  85. package/lib/esm/map-layers-formats.d.ts.map +1 -1
  86. package/lib/esm/map-layers-formats.js +1 -0
  87. package/lib/esm/map-layers-formats.js.map +1 -1
  88. package/lib/esm/mapLayersFormats.d.ts +12 -1
  89. package/lib/esm/mapLayersFormats.d.ts.map +1 -1
  90. package/lib/esm/mapLayersFormats.js +13 -2
  91. package/lib/esm/mapLayersFormats.js.map +1 -1
  92. package/lib/public/locales/en/mapLayersFormats.json +12 -0
  93. package/package.json +18 -15
  94. package/.nycrc +0 -10
  95. package/.rush/temp/operation/build/all.log +0 -3
  96. package/.rush/temp/operation/build/state.json +0 -3
  97. package/.rush/temp/operation/cover/all.log +0 -98
  98. package/.rush/temp/operation/cover/state.json +0 -3
  99. package/.rush/temp/operation/docs/all.log +0 -30
  100. package/.rush/temp/operation/docs/state.json +0 -3
  101. package/.rush/temp/package-deps_build.json +0 -36
  102. package/.rush/temp/package-deps_cover.json +0 -36
  103. package/.rush/temp/package-deps_docs.json +0 -36
  104. package/.rush/temp/shrinkwrap-deps.json +0 -505
  105. package/CHANGELOG.json +0 -119
  106. package/config/rush-project.json +0 -6
  107. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
  108. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
  109. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
  110. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
  111. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
  112. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
  113. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
  114. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +0 -143
  115. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
  116. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
  117. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
  118. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -35
  119. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
  120. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
  121. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
  122. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -162
  123. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
  124. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
  125. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
  126. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -168
  127. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
  128. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
  129. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
  130. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -680
  131. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
  132. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
  133. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
  134. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -104
  135. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
  136. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
  137. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
  138. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -215
  139. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
  140. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
  141. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
  142. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -95
  143. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
  144. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
  145. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
  146. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -60
  147. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
  148. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +0 -7
  149. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts.map +0 -1
  150. package/lib/cjs/test/ArcGisFeature/Mocks.js +0 -19
  151. package/lib/cjs/test/ArcGisFeature/Mocks.js.map +0 -1
  152. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
  153. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
  154. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +0 -420
  155. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
  156. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
  157. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
  158. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -427
  159. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
  160. package/lib/cjs/test/coverage/.nyc_output/abd3af4c-9bb0-47fb-a670-3c609e62305c.json +0 -1
  161. package/lib/cjs/test/coverage/.nyc_output/b444582a-0db5-4b2b-949d-8c71645890c8.json +0 -1
  162. package/lib/cjs/test/coverage/.nyc_output/processinfo/abd3af4c-9bb0-47fb-a670-3c609e62305c.json +0 -1
  163. package/lib/cjs/test/coverage/.nyc_output/processinfo/b444582a-0db5-4b2b-949d-8c71645890c8.json +0 -1
  164. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +0 -1
  165. package/lib/cjs/test/coverage/cobertura-coverage.xml +0 -1169
  166. package/lib/cjs/test/coverage/lcov-report/base.css +0 -224
  167. package/lib/cjs/test/coverage/lcov-report/block-navigation.js +0 -87
  168. package/lib/cjs/test/coverage/lcov-report/favicon.png +0 -0
  169. package/lib/cjs/test/coverage/lcov-report/index.html +0 -131
  170. package/lib/cjs/test/coverage/lcov-report/prettify.css +0 -1
  171. package/lib/cjs/test/coverage/lcov-report/prettify.js +0 -2
  172. package/lib/cjs/test/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  173. package/lib/cjs/test/coverage/lcov-report/sorter.js +0 -196
  174. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +0 -133
  175. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +0 -550
  176. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +0 -730
  177. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +0 -1546
  178. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +0 -763
  179. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +0 -223
  180. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +0 -598
  181. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +0 -301
  182. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +0 -832
  183. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +0 -236
  184. package/lib/cjs/test/coverage/lcov-report/src/index.html +0 -131
  185. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +0 -130
  186. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +0 -163
  187. package/lib/cjs/test/coverage/lcov.info +0 -1358
  188. package/lib/cjs/tsconfig.tsbuildinfo +0 -1
  189. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
  190. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
  191. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +0 -129
  192. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
  193. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
  194. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
  195. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
  196. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
  197. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +0 -139
  198. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
  199. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
  200. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
  201. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -33
  202. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
  203. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
  204. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
  205. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -160
  206. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
  207. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
  208. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
  209. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -166
  210. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
  211. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
  212. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
  213. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -678
  214. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
  215. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
  216. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
  217. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -102
  218. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
  219. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
  220. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
  221. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -213
  222. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
  223. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
  224. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
  225. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -93
  226. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
  227. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
  228. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
  229. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -58
  230. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
  231. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +0 -7
  232. package/lib/esm/test/ArcGisFeature/Mocks.d.ts.map +0 -1
  233. package/lib/esm/test/ArcGisFeature/Mocks.js +0 -16
  234. package/lib/esm/test/ArcGisFeature/Mocks.js.map +0 -1
  235. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
  236. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
  237. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +0 -417
  238. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
  239. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
  240. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
  241. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -424
  242. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
  243. package/lib/esm/tsconfig.tsbuildinfo +0 -1
  244. package/lib/test/junit_results.xml +0 -159
  245. package/map-layers-formats.build.log +0 -30
  246. package/src/ArcGisFeature/ArcGisFeatureFormat.ts +0 -16
  247. package/src/ArcGisFeature/ArcGisFeatureJSON.ts +0 -155
  248. package/src/ArcGisFeature/ArcGisFeaturePBF.ts +0 -215
  249. package/src/ArcGisFeature/ArcGisFeatureProvider.ts +0 -487
  250. package/src/ArcGisFeature/ArcGisFeatureQuery.ts +0 -226
  251. package/src/ArcGisFeature/ArcGisFeatureReader.ts +0 -46
  252. package/src/ArcGisFeature/ArcGisFeatureRenderer.ts +0 -171
  253. package/src/ArcGisFeature/ArcGisFeatureResponse.ts +0 -72
  254. package/src/ArcGisFeature/ArcGisSymbologyRenderer.ts +0 -249
  255. package/src/ArcGisFeature/esriPBuffer.gen.ts +0 -2612
  256. package/src/map-layers-formats.ts +0 -15
  257. package/src/mapLayersFormats.ts +0 -26
  258. package/src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts +0 -46
  259. package/src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts +0 -202
  260. package/src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts +0 -227
  261. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +0 -805
  262. package/src/test/ArcGisFeature/ArcGisFeatureQuery.test.ts +0 -117
  263. package/src/test/ArcGisFeature/ArcGisFeatureRenderer.test.ts +0 -296
  264. package/src/test/ArcGisFeature/ArcGisFeatureResponse.test.ts +0 -109
  265. package/src/test/ArcGisFeature/ArcGisSymbologyRenderer.test.ts +0 -77
  266. package/src/test/ArcGisFeature/Mocks.ts +0 -19
  267. package/src/test/ArcGisFeature/NewYorkDataset.ts +0 -423
  268. package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +0 -455
  269. package/tsconfig.json +0 -20
@@ -1,805 +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
-
6
- import { Base64EncodedString, Cartographic, ImageMapLayerSettings, ImageSourceFormat, ServerError } from "@itwin/core-common";
7
- import * as chai from "chai";
8
- import * as chaiAsPromised from "chai-as-promised";
9
- import { ArcGisFeatureMapLayerFormat } from "../../ArcGisFeature/ArcGisFeatureFormat";
10
- import { ArcGisFeatureProvider } from "../../map-layers-formats";
11
- import * as sinon from "sinon";
12
- import { ArcGISImageryProvider, ArcGisUtilities, ImageryMapTileTree, MapLayerFeatureInfo, MapLayerImageryProviderStatus, QuadId } from "@itwin/core-frontend";
13
- import { NewYorkDataset } from "./NewYorkDataset";
14
- import { base64StringToUint8Array, ByteStream, Logger } from "@itwin/core-bentley";
15
- import { ArcGisExtent, ArcGisFeatureFormat, ArcGisGeometry } from "../../ArcGisFeature/ArcGisFeatureQuery";
16
- import { PhillyLandmarksDataset } from "./PhillyLandmarksDataset";
17
- import { ArcGisFeatureResponse } from "../../ArcGisFeature/ArcGisFeatureResponse";
18
- import { Point3d, Transform } from "@itwin/core-geometry";
19
- import { ArcGisFeaturePBF } from "../../ArcGisFeature/ArcGisFeaturePBF";
20
- import { ArcGisFeatureJSON } from "../../ArcGisFeature/ArcGisFeatureJSON";
21
-
22
- const expect = chai.expect;
23
- chai.use(chaiAsPromised);
24
-
25
- const esriFeatureSampleSource = {name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureMapLayerFormat.formatId};
26
- const pngTransparent1x1 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
27
-
28
- describe("ArcGisFeatureProvider", () => {
29
- const sandbox = sinon.createSandbox();
30
-
31
- afterEach(async () => {
32
- sandbox.restore();
33
- });
34
-
35
- it("should initialize with valid data", async () => {
36
-
37
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
38
- return {accessTokenRequired: false, content:NewYorkDataset.serviceCapabilities};
39
- });
40
-
41
- sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata" as any).callsFake(async function _(_layerId: unknown) {
42
- return NewYorkDataset.streetsLayerCapabilities;
43
- });
44
-
45
- const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
46
- const provider = new ArcGisFeatureProvider(settings);
47
- await provider.initialize();
48
-
49
- expect((provider as any)._minDepthFromLod).to.equals(11);
50
- expect((provider as any)._maxDepthFromLod).to.equals(22);
51
- });
52
-
53
- it("should not initialize with no service metadata", async () => {
54
-
55
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
56
- return undefined;
57
- });
58
-
59
- const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
60
- const provider = new ArcGisFeatureProvider(settings);
61
-
62
- await expect(provider.initialize()).to.be.rejectedWith(ServerError);
63
-
64
- });
65
-
66
- it("should update status when invalid token error from service", async () => {
67
-
68
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
69
- return {accessTokenRequired: false, content:{error: {code: 499}}};
70
- });
71
-
72
- const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
73
- const provider = new ArcGisFeatureProvider(settings);
74
- const raiseEventSpy = sandbox.spy(provider.onStatusChanged, "raiseEvent");
75
- await provider.initialize();
76
-
77
- expect(provider.status).to.equals(MapLayerImageryProviderStatus.RequireAuth);
78
- expect(raiseEventSpy.calledOnceWith(provider)).to.be.true;
79
- });
80
-
81
- it("should throw query capability not supported", async () => {
82
-
83
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
84
- return {accessTokenRequired: false, content:{capabilities: "Test"}};
85
- });
86
-
87
- const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
88
- const provider = new ArcGisFeatureProvider(settings);
89
- await expect(provider.initialize()).to.be.rejectedWith(ServerError);
90
- });
91
-
92
- it("should pick the first visible sub-layer when multiple visible sub-layers", async () => {
93
-
94
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
95
- return {accessTokenRequired: false, content: {capabilities: "Query"}};
96
- });
97
-
98
- const settings = ImageMapLayerSettings.fromJSON({
99
- ...esriFeatureSampleSource,
100
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
101
- );
102
- const provider = new ArcGisFeatureProvider(settings);
103
- (provider as any)._format = "JSON";
104
- await provider.initialize();
105
- expect((provider as any)._layerId ).to.equals(settings.subLayers[0].id);
106
- });
107
-
108
- it("should pick sub-layers from service metadata if none provided on layer settings", async () => {
109
-
110
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
111
- return {accessTokenRequired: false, content: {capabilities: "Query",
112
- layers: [
113
- {
114
- id : 0,
115
-
116
- },
117
- {
118
- id : 1,
119
- },
120
- ]},
121
- };
122
- });
123
-
124
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (id: unknown) {
125
- if (id === 1 ) {
126
- return {defaultVisibility:true};
127
- }
128
- return undefined;
129
- });
130
-
131
- const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
132
- const provider = new ArcGisFeatureProvider(settings);
133
- (provider as any)._format = "JSON";
134
- await provider.initialize();
135
- expect((provider as any)._layerId ).to.equals(1);
136
- expect((provider as any)._layerMetadata ).to.eql({defaultVisibility:true});
137
- });
138
-
139
- it("should throw error if no layers in capabilities", async () => {
140
-
141
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
142
- return {accessTokenRequired: false, content: {capabilities: "Query", layers: []}};
143
- });
144
-
145
- const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
146
- const provider = new ArcGisFeatureProvider(settings);
147
- await expect(provider.initialize()).to.be.rejectedWith(ServerError);
148
- });
149
-
150
- it("should throw if no layer metadata from service", async () => {
151
-
152
- const settings = ImageMapLayerSettings.fromJSON({
153
- ...esriFeatureSampleSource,
154
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
155
- );
156
-
157
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
158
- return {accessTokenRequired: false, content:{capabilities: "Query"}};
159
- });
160
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
161
- return undefined;
162
- });
163
-
164
- const provider = new ArcGisFeatureProvider(settings);
165
- await expect(provider.initialize()).to.be.rejectedWith(ServerError);
166
- });
167
-
168
- it("should read supported supported format", async () => {
169
-
170
- const settings = ImageMapLayerSettings.fromJSON({
171
- ...esriFeatureSampleSource,
172
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
173
- );
174
-
175
- let getLayerMetadataStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
176
- return {defaultVisibility:true, supportedQueryFormats:"PBF, JSON"};
177
- });
178
-
179
- const getServiceJsonStub = sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
180
- return {accessTokenRequired: false, content: {capabilities: "Query"}};
181
- });
182
-
183
- let provider = new ArcGisFeatureProvider(settings);
184
- await provider.initialize();
185
- expect(provider.format).to.equals("JSON");
186
-
187
- // PBF requires 'supportsCoordinatesQuantization'
188
- getServiceJsonStub.restore();
189
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
190
- return {accessTokenRequired: false, content: { currentVersion: 11, capabilities: "Query"}};
191
- });
192
- getLayerMetadataStub.restore();
193
- getLayerMetadataStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
194
- return {defaultVisibility:true, supportsCoordinatesQuantization:true, supportedQueryFormats:"PBF, JSON"};
195
- });
196
-
197
- provider = new ArcGisFeatureProvider(settings);
198
- await provider.initialize();
199
- expect(provider.format).to.equals("PBF");
200
-
201
- getLayerMetadataStub.restore();
202
- getLayerMetadataStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
203
- return {defaultVisibility:true, supportedQueryFormats:"JSON"};
204
- });
205
-
206
- getServiceJsonStub.restore();
207
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
208
- return {accessTokenRequired: false, content: { currentVersion: 10.91, capabilities: "Query", supportsCoordinatesQuantization:true}};
209
- });
210
-
211
- provider = new ArcGisFeatureProvider(settings);
212
- await provider.initialize();
213
- expect(provider.format).to.equals("JSON");
214
-
215
- getLayerMetadataStub.restore();
216
- getLayerMetadataStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
217
- return {defaultVisibility:true, supportedQueryFormats:"JSON"};
218
- });
219
-
220
- provider = new ArcGisFeatureProvider(settings);
221
- await provider.initialize();
222
- expect(provider.format).to.equals("JSON");
223
-
224
- getLayerMetadataStub.restore();
225
- getLayerMetadataStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
226
- return {defaultVisibility:true, supportedQueryFormats:""};
227
- });
228
-
229
- provider = new ArcGisFeatureProvider(settings);
230
- await expect(provider.initialize()).to.be.rejectedWith(ServerError);
231
- });
232
-
233
- it("should compute minLod/maxLod", async () => {
234
-
235
- const settings = ImageMapLayerSettings.fromJSON({
236
- ...esriFeatureSampleSource,
237
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
238
- );
239
-
240
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
241
- return {
242
- defaultVisibility:true,
243
- supportedQueryFormats:"PBF, JSON",
244
- minScale: 600000,
245
- maxScale: 5000,
246
- };
247
- });
248
-
249
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
250
- return {accessTokenRequired: false, content:{capabilities: "Query"}};
251
- });
252
-
253
- const provider = new ArcGisFeatureProvider(settings);
254
- await provider.initialize();
255
-
256
- expect((provider as any)._minDepthFromLod ).to.equals(9);
257
- expect((provider as any)._maxDepthFromLod ).to.equals(15);
258
- });
259
-
260
- it("should construct empty url", async () => {
261
-
262
- const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
263
- const provider = new ArcGisFeatureProvider(settings);
264
- const url = await provider.constructUrl(0,0,0);
265
- expect(url).to.equals("");
266
-
267
- });
268
-
269
- it("should construct feature query url", async () => {
270
- const settings = ImageMapLayerSettings.fromJSON({
271
- ...esriFeatureSampleSource,
272
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
273
- );
274
-
275
- let getLayerMetadataStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
276
- return {
277
- defaultVisibility: true,
278
- supportedQueryFormats:"PBF, JSON",
279
- };
280
- });
281
-
282
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
283
- return {accessTokenRequired: false, content:{currentVersion: 11, capabilities: "Query"}};
284
- });
285
-
286
- const provider = new ArcGisFeatureProvider(settings);
287
- await provider.initialize();
288
-
289
- let url = provider.constructFeatureUrl(0,0,0, "PBF");
290
- const extent = {
291
- xmin: -20037508.34,
292
- ymin: -20037508.33,
293
- xmax: 20037508.34,
294
- ymax: 20037508.34,
295
- spatialReference: {
296
- wkid: 102100,
297
- latestWkid: 3857,
298
- },
299
- };
300
- expect(url?.url).to.equals(`https://dummy.com/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100`);
301
- expect(url?.envelope?.xmin).to.be.closeTo(extent.xmin, 0.01);
302
- expect(url?.envelope?.ymin).to.be.closeTo(extent.ymin, 0.01);
303
- expect(url?.envelope?.xmax).to.be.closeTo(extent.xmax, 0.01);
304
- expect(url?.envelope?.ymax).to.be.closeTo(extent.ymax, 0.01);
305
- expect(url?.envelope?.spatialReference.wkid).to.be.equal(102100);
306
- expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(3857);
307
-
308
- // Now turn ON 'supportsCoordinatesQuantization' to ON
309
- getLayerMetadataStub.restore();
310
- getLayerMetadataStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
311
- return {
312
- defaultVisibility: true,
313
- supportedQueryFormats:"PBF, JSON",
314
- supportsCoordinatesQuantization: true,
315
- };
316
- });
317
-
318
- const provider2 = new ArcGisFeatureProvider(settings);
319
- await provider2.initialize();
320
- url = provider2.constructFeatureUrl(0,0,0, "PBF");
321
- expect(url?.url).to.equals(`https://dummy.com/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D`);
322
- expect(url?.envelope?.xmin).to.be.closeTo(extent.xmin, 0.01);
323
- expect(url?.envelope?.ymin).to.be.closeTo(extent.ymin, 0.01);
324
- expect(url?.envelope?.xmax).to.be.closeTo(extent.xmax, 0.01);
325
- expect(url?.envelope?.ymax).to.be.closeTo(extent.ymax, 0.01);
326
- expect(url?.envelope?.spatialReference.wkid).to.be.equal(extent.spatialReference.wkid);
327
- expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(extent.spatialReference.latestWkid);
328
-
329
- // Test passing an override geometry
330
- const overrideGeom: ArcGisGeometry = {
331
- type: "esriGeometryEnvelope",
332
- geom: {
333
- xmin: -50,
334
- ymin: -50,
335
- xmax: 50,
336
- ymax: 50,
337
- spatialReference: {
338
- wkid: 102100,
339
- latestWkid: 3857,
340
- },
341
- },
342
- };
343
- const provider3 = new ArcGisFeatureProvider(settings);
344
- await provider3.initialize();
345
- url = provider3.constructFeatureUrl(0,0,0, "PBF", overrideGeom);
346
- expect(url?.url).to.equals(`https://dummy.com/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-50%2C%22ymin%22%3A-50%2C%22xmax%22%3A50%2C%22ymax%22%3A50%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D`);
347
- expect(url?.envelope?.xmin).to.be.closeTo((overrideGeom.geom as ArcGisExtent).xmin, 0.01);
348
- expect(url?.envelope?.ymin).to.be.closeTo((overrideGeom.geom as ArcGisExtent).ymin, 0.01);
349
- expect(url?.envelope?.xmax).to.be.closeTo((overrideGeom.geom as ArcGisExtent).xmax, 0.01);
350
- expect(url?.envelope?.ymax).to.be.closeTo((overrideGeom.geom as ArcGisExtent).ymax, 0.01);
351
- expect(url?.envelope?.spatialReference.wkid).to.be.equal(overrideGeom.geom.spatialReference.wkid);
352
- expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(overrideGeom.geom.spatialReference.latestWkid);
353
-
354
- // Now test with a different tolerance value
355
- url = provider3.constructFeatureUrl(0,0,0, "PBF", overrideGeom, undefined, 10);
356
- expect(url?.url).to.equals(`https://dummy.com/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-50%2C%22ymin%22%3A-50%2C%22xmax%22%3A50%2C%22ymax%22%3A50%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D&distance=782715.16953125`);
357
- expect(url?.envelope?.xmin).to.be.closeTo((overrideGeom.geom as ArcGisExtent).xmin, 0.01);
358
- expect(url?.envelope?.ymin).to.be.closeTo((overrideGeom.geom as ArcGisExtent).ymin, 0.01);
359
- expect(url?.envelope?.xmax).to.be.closeTo((overrideGeom.geom as ArcGisExtent).xmax, 0.01);
360
- expect(url?.envelope?.ymax).to.be.closeTo((overrideGeom.geom as ArcGisExtent).ymax, 0.01);
361
- expect(url?.envelope?.spatialReference.wkid).to.be.equal(overrideGeom.geom.spatialReference.wkid);
362
- expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(overrideGeom.geom.spatialReference.latestWkid);
363
-
364
- });
365
-
366
- it("should log error when getFeatureInfo cannot be performed", async () => {
367
-
368
- const settings = ImageMapLayerSettings.fromJSON({
369
- ...esriFeatureSampleSource,
370
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
371
- );
372
-
373
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
374
- return {
375
- defaultVisibility:true,
376
- supportedQueryFormats:"PBF, JSON",
377
- minScale: 600000,
378
- maxScale: 5000,
379
- };
380
- });
381
-
382
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
383
- return {accessTokenRequired: false, content:{currentVersion: 11, capabilities: "Query"}};
384
- });
385
- sandbox.stub(ArcGisFeatureProvider.prototype, "constructFeatureUrl").callsFake(function _(_row: number, _column: number, _zoomLevel: number, _format: ArcGisFeatureFormat, _geomOverride?: ArcGisGeometry, _outFields?: string, _tolerance?: number, _returnGeometry?: boolean) {
386
- return undefined;
387
- });
388
-
389
- const provider = new ArcGisFeatureProvider(settings);
390
- await provider.initialize();
391
- const featureInfos: MapLayerFeatureInfo[] = [];
392
- const logErrorSpy = sandbox.spy(Logger, "logError");
393
- await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({latitude: 46, longitude:-71}), (undefined as unknown) as ImageryMapTileTree);
394
- expect(featureInfos.length).to.equals(0);
395
- expect(logErrorSpy.called).to.be.true;
396
-
397
- });
398
-
399
- it("should process data in getFeatureInfo", async () => {
400
-
401
- const settings = ImageMapLayerSettings.fromJSON({
402
- ...esriFeatureSampleSource,
403
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
404
- );
405
-
406
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
407
- return {
408
- defaultVisibility:true,
409
- supportedQueryFormats:"PBF, JSON",
410
- supportsCoordinatesQuantization:true,
411
- minScale: 600000,
412
- maxScale: 5000,
413
- };
414
- });
415
-
416
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
417
- return {accessTokenRequired: false, content:{currentVersion: 11, capabilities: "Query"}};
418
- });
419
- sandbox.stub((ArcGISImageryProvider.prototype as any), "fetch").callsFake(async function _(_url: unknown, _options?: unknown) {
420
- const test = {
421
- headers: { "content-type" : "pbf"},
422
- arrayBuffer: async () => {
423
- const byteArray = Base64EncodedString.toUint8Array(PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryEncodedPbf);
424
- return Promise.resolve(byteArray ? ByteStream.fromUint8Array(byteArray).arrayBuffer : undefined);
425
- },
426
- status: 200,
427
- } as unknown; // By using unknown type, I can define parts of Response I really need
428
- return (test as Response );
429
- });
430
-
431
- const provider = new ArcGisFeatureProvider(settings);
432
- await provider.initialize();
433
- const featureInfos: MapLayerFeatureInfo[] = [];
434
- const logErrorSpy = sandbox.spy(Logger, "logError");
435
- await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({latitude: 46, longitude:-71}), (undefined as unknown) as ImageryMapTileTree);
436
- expect(featureInfos.length).to.equals(1);
437
- expect(logErrorSpy.calledOnce).to.be.false;
438
-
439
- });
440
-
441
- it("should log error when exceed transfert limit", async () => {
442
-
443
- const settings = ImageMapLayerSettings.fromJSON({
444
- ...esriFeatureSampleSource,
445
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
446
- );
447
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
448
- return {
449
- defaultVisibility:true,
450
- supportedQueryFormats:"PBF, JSON",
451
- minScale: 600000,
452
- maxScale: 5000,
453
- };
454
- });
455
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
456
- return {accessTokenRequired: false, content:{capabilities: "Query"}};
457
- });
458
-
459
- sandbox.stub((ArcGisFeatureResponse.prototype as any), "getResponseData").callsFake(async function _() {
460
- return {exceedTransferLimit: true, data:undefined};
461
- });
462
-
463
- const provider = new ArcGisFeatureProvider(settings);
464
- await provider.initialize();
465
- const featureInfos: MapLayerFeatureInfo[] = [];
466
- const logErrorSpy = sandbox.spy(Logger, "logError");
467
- await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({latitude: 46, longitude:-71}), (undefined as unknown) as ImageryMapTileTree);
468
- expect(featureInfos.length).to.equals(0);
469
- expect(logErrorSpy.calledOnce).to.be.true;
470
-
471
- });
472
-
473
- it("should log error when exceed exception thrown limit", async () => {
474
-
475
- const settings = ImageMapLayerSettings.fromJSON({
476
- ...esriFeatureSampleSource,
477
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
478
- );
479
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
480
- return {
481
- defaultVisibility:true,
482
- supportedQueryFormats:"PBF, JSON",
483
- minScale: 600000,
484
- maxScale: 5000,
485
- };
486
- });
487
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
488
- return {accessTokenRequired: false, content:{capabilities: "Query"}};
489
- });
490
-
491
- sandbox.stub((ArcGisFeatureResponse.prototype as any), "getResponseData").callsFake(async function _() {
492
- throw new Error();
493
- });
494
-
495
- const provider = new ArcGisFeatureProvider(settings);
496
- await provider.initialize();
497
- const featureInfos: MapLayerFeatureInfo[] = [];
498
- const logErrorSpy = sandbox.spy(Logger, "logError");
499
- await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({latitude: 46, longitude:-71}), (undefined as unknown) as ImageryMapTileTree);
500
- expect(featureInfos.length).to.equals(0);
501
- expect(logErrorSpy.calledOnce).to.be.true;
502
-
503
- });
504
-
505
- it("should debug Feature Geom", async () => {
506
-
507
- const settings = ImageMapLayerSettings.fromJSON({
508
- ...esriFeatureSampleSource,
509
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
510
- );
511
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
512
- return {
513
- defaultVisibility:true,
514
- supportedQueryFormats:"PBF, JSON",
515
- minScale: 600000,
516
- maxScale: 5000,
517
- };
518
- });
519
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
520
- return {accessTokenRequired: false, content:{capabilities: "Query"}};
521
- });
522
-
523
- sandbox.stub((ArcGisFeatureResponse.prototype as any), "getResponseData").callsFake(async function _() {
524
- return {data: {
525
- toObject: () => undefined,
526
- }};
527
- });
528
-
529
- const provider = new ArcGisFeatureProvider(settings);
530
- await provider.initialize();
531
- (provider as any)._debugFeatureGeom = true;
532
- const featureInfos: MapLayerFeatureInfo[] = [];
533
- const logInfoSpy = sandbox.spy(Logger, "logInfo");
534
- await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({latitude: 46, longitude:-71}), (undefined as unknown) as ImageryMapTileTree);
535
- expect(featureInfos.length).to.equals(0);
536
- expect(logInfoSpy.callCount).to.equals(2);
537
-
538
- });
539
-
540
- it("should compute computeTileWorld2CanvasTransform", async () => {
541
- const settings = ImageMapLayerSettings.fromJSON({
542
- ...esriFeatureSampleSource,
543
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
544
- );
545
- const worldSize = 100;
546
- const canvasSize = 10;
547
-
548
- const provider = new ArcGisFeatureProvider(settings);
549
- const getEPSG3857ExtentStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getEPSG3857Extent").callsFake(function (_row: number, _column: number, _zoomLevel: number) {
550
- return { left:0, right:worldSize, bottom:0, top:worldSize };
551
- });
552
-
553
- sandbox.stub(provider, "tileSize").get(function () {
554
- return canvasSize; // return a size of 10 to simplicity
555
- });
556
- let transform = ((provider as any).computeTileWorld2CanvasTransform(0,0,0) as Transform | undefined);
557
- let worldPoint = Point3d.createFrom({x: worldSize*0.5, y:worldSize*0.5, z:0});
558
- let transformedPoint = transform?.multiplyPoint3d(worldPoint);
559
-
560
- // Make sure center point remains in the center
561
- expect(transformedPoint).to.not.undefined;
562
- expect(transformedPoint!.x).to.equals(canvasSize*0.5);
563
- expect(transformedPoint!.y).to.equals(canvasSize*0.5);
564
- expect(transformedPoint!.z).to.equals(0);
565
-
566
- // Check that y-axis get flipped
567
- worldPoint = Point3d.createFrom({x: 0, y:10, z:0});
568
- transformedPoint = transform?.multiplyPoint3d(worldPoint);
569
- expect(transformedPoint!.x).to.equals(0);
570
- expect(transformedPoint!.y).to.equals(9);
571
- expect(transformedPoint!.z).to.equals(0);
572
-
573
- // Now check translation has been applied (origin shift)
574
- getEPSG3857ExtentStub.restore();
575
- sandbox.stub(ArcGisFeatureProvider.prototype, "getEPSG3857Extent").callsFake(function (_row: number, _column: number, _zoomLevel: number) {
576
- return { left:worldSize, right:worldSize*2, bottom:worldSize, top:worldSize*2 };
577
- });
578
- worldPoint = Point3d.createFrom({x: worldSize, y:worldSize, z:0});
579
- transform = ((provider as any).computeTileWorld2CanvasTransform(0,0,0) as Transform | undefined);
580
- transformedPoint = transform?.multiplyPoint3d(worldPoint);
581
- expect(transformedPoint).to.not.undefined;
582
- expect(transformedPoint!.x).to.equals(0);
583
- expect(transformedPoint!.y).to.equals(10);
584
- expect(transformedPoint!.z).to.equals(0);
585
-
586
- });
587
-
588
- it("should loadTile from PBF request", async () => {
589
- const settings = ImageMapLayerSettings.fromJSON({
590
- ...esriFeatureSampleSource,
591
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
592
- );
593
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
594
- return {
595
- defaultVisibility:true,
596
- supportedQueryFormats:"PBF",
597
- supportsCoordinatesQuantization:true,
598
- };
599
- });
600
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
601
- return {accessTokenRequired: false, content:{currentVersion: 11, capabilities: "Query"}};
602
- });
603
- sandbox.stub(HTMLCanvasElement.prototype, "getContext").callsFake( function _(_contextId: any, _options?: any) {
604
- return {} as RenderingContext;
605
- });
606
-
607
- sandbox.stub(HTMLCanvasElement.prototype, "toDataURL").callsFake( function _(_type?: string, _quality?: any) {
608
- return `data:image/png;base64,${pngTransparent1x1}`;
609
- });
610
-
611
- const providerStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "fetchTile").callsFake(async function _() {
612
- return new ArcGisFeatureResponse("PBF", Promise.resolve({} as Response));
613
- });
614
-
615
- sandbox.stub((ArcGisFeatureResponse.prototype as any), "getResponseData").callsFake(async function _() {
616
- return {
617
- exceedTransferLimit: false,
618
- data: {toObject: () => undefined},
619
- };
620
- });
621
-
622
- // toDataURL string;
623
- const readAndRenderSpy = sandbox.spy(ArcGisFeaturePBF.prototype, "readAndRender");
624
- const computeTransfoSpy = sandbox.spy(ArcGisFeatureProvider.prototype as any, "computeTileWorld2CanvasTransform");
625
- const provider = new ArcGisFeatureProvider(settings);
626
- await provider.initialize();
627
- const tileData = await provider.loadTile(0,0,0);
628
- expect (tileData).to.not.undefined;
629
- expect (tileData?.data instanceof Uint8Array).to.be.true;
630
- expect(tileData?.data).to.eqls(base64StringToUint8Array(pngTransparent1x1));
631
- expect(tileData?.format).to.equals(ImageSourceFormat.Png);
632
- expect (providerStub.calledOnce).to.be.true;
633
- expect (readAndRenderSpy.calledOnce).to.be.true;
634
- expect (computeTransfoSpy.calledOnce).to.be.false; // Should not be called since we have supportsCoordinatesQuantization in layer metadata
635
-
636
- });
637
-
638
- it("should loadTile from JSON request", async () => {
639
- const settings = ImageMapLayerSettings.fromJSON({
640
- ...esriFeatureSampleSource,
641
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
642
- );
643
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
644
- return {
645
- defaultVisibility:true,
646
- supportedQueryFormats:"JSON",
647
- };
648
- });
649
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
650
- return {accessTokenRequired: false, content:{capabilities: "Query"}};
651
- });
652
- sandbox.stub(HTMLCanvasElement.prototype, "getContext").callsFake( function _(_contextId: any, _options?: any) {
653
- return {} as RenderingContext;
654
- });
655
-
656
- sandbox.stub(HTMLCanvasElement.prototype, "toDataURL").callsFake( function _(_type?: string, _quality?: any) {
657
- return `data:image/png;base64,${pngTransparent1x1}`;
658
- });
659
-
660
- const providerStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "fetchTile").callsFake(async function _() {
661
- return new ArcGisFeatureResponse("JSON", Promise.resolve({} as Response));
662
- });
663
-
664
- sandbox.stub((ArcGisFeatureResponse.prototype as any), "getResponseData").callsFake(async function _() {
665
- return {
666
- exceedTransferLimit: false,
667
- data: {toObject: () => undefined},
668
- };
669
- });
670
-
671
- const readAndRenderSpy = sandbox.spy(ArcGisFeatureJSON.prototype, "readAndRender");
672
- const computeTransfoSpy = sandbox.spy(ArcGisFeatureProvider.prototype as any, "computeTileWorld2CanvasTransform");
673
- const provider = new ArcGisFeatureProvider(settings);
674
- await provider.initialize();
675
- const tileData = await provider.loadTile(0,0,0);
676
- expect (tileData).to.not.undefined;
677
- expect (tileData?.data instanceof Uint8Array).to.be.true;
678
- expect(tileData?.data).to.eqls(base64StringToUint8Array(pngTransparent1x1));
679
- expect(tileData?.format).to.equals(ImageSourceFormat.Png);
680
- expect (providerStub.calledOnce).to.be.true;
681
- expect (readAndRenderSpy.calledOnce).to.be.true;
682
- expect (computeTransfoSpy.calledOnce).to.be.true; // Should be called since we dont have _supportsCoordinatesQuantization in layer metadata
683
- });
684
-
685
- it("should make sub request if loadtile request return 'exceedTransferLimit'", async () => {
686
- const settings = ImageMapLayerSettings.fromJSON({
687
- ...esriFeatureSampleSource,
688
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
689
- );
690
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
691
- return {
692
- defaultVisibility:true,
693
- supportedQueryFormats:"JSON",
694
- };
695
- });
696
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
697
- return {accessTokenRequired: false, content:{capabilities: "Query"}};
698
- });
699
- sandbox.stub(HTMLCanvasElement.prototype, "getContext").callsFake( function _(_contextId: any, _options?: any) {
700
- return {} as RenderingContext;
701
- });
702
-
703
- sandbox.stub(HTMLCanvasElement.prototype, "toDataURL").callsFake( function _(_type?: string, _quality?: any) {
704
- return `data:image/png;base64,${pngTransparent1x1}`;
705
- });
706
-
707
- const extentSize = 100;
708
- const fetchTileStub = sandbox.stub((ArcGisFeatureProvider.prototype as any), "fetchTile").callsFake(async function _() {
709
- const envelope: ArcGisExtent = {
710
- xmin : 0,
711
- ymin : 0,
712
- xmax : extentSize,
713
- ymax : extentSize,
714
- spatialReference : {
715
- wkid : 102100,
716
- latestWkid : 3857,
717
- }};
718
- return new ArcGisFeatureResponse("JSON", Promise.resolve({} as Response), envelope);
719
- });
720
-
721
- let firstCall = true;
722
- sandbox.stub((ArcGisFeatureResponse.prototype as any), "getResponseData").callsFake(async function _() {
723
-
724
- const exceed = firstCall === true;
725
- firstCall = false;
726
- return {
727
- exceedTransferLimit: exceed,
728
- data: {toObject: () => undefined},
729
- };
730
- });
731
-
732
- const readAndRenderSpy = sandbox.spy(ArcGisFeatureJSON.prototype, "readAndRender");
733
- const provider = new ArcGisFeatureProvider(settings);
734
- await provider.initialize();
735
- await provider.loadTile(0,0,0);
736
-
737
- // We should have 5 calls:
738
- // Call #1 : initial call for 0,0,0 and it returns 'exceedTransferLimit'
739
- // Calls #2-5: Four calls which represent a call for each sub-envelope (initial extent divided by 4)
740
- expect (fetchTileStub.getCalls().length).to.equals(5);
741
- expect (fetchTileStub.getCalls()[1].args[3]).to.eqls( {
742
- xmin : 0, ymin : 0, xmax : extentSize*0.5, ymax : extentSize*0.5,
743
- spatialReference : { wkid : 102100, latestWkid : 3857,
744
- }});
745
- expect (fetchTileStub.getCalls()[2].args[3]).to.eqls( {
746
- xmin : 0, ymin : extentSize*0.5, xmax : extentSize*0.5, ymax : extentSize,
747
- spatialReference : { wkid : 102100, latestWkid : 3857,
748
- }});
749
- expect (fetchTileStub.getCalls()[3].args[3]).to.eqls( {
750
- xmin : extentSize*0.5, ymin : 0, xmax : extentSize, ymax : extentSize*0.5,
751
- spatialReference : { wkid : 102100, latestWkid : 3857,
752
- }});
753
- expect (fetchTileStub.getCalls()[4].args[3]).to.eqls( {
754
- xmin : extentSize*0.5, ymin : extentSize*0.5, xmax : extentSize, ymax : extentSize,
755
- spatialReference : { wkid : 102100, latestWkid : 3857,
756
- }});
757
- expect (readAndRenderSpy.getCalls().length).to.equals(4);
758
- });
759
-
760
- it("fetchTile should return undefined when to format defined", async () => {
761
-
762
- const settings = ImageMapLayerSettings.fromJSON({
763
- ...esriFeatureSampleSource,
764
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
765
- );
766
-
767
- const provider = new ArcGisFeatureProvider(settings);
768
- // make a first request with init, should return undefined because of missing format
769
- const tileData = await (provider as any).fetchTile(0,0,0);
770
- expect(tileData).to.be.undefined;
771
- });
772
-
773
- it("fetchTile should call fetch with the proper URL", async () => {
774
-
775
- const settings = ImageMapLayerSettings.fromJSON({
776
- ...esriFeatureSampleSource,
777
- subLayers: [{id: 0, name: "layer1", visible:true}, {id:2, name: "layer2", visible:true}]}
778
- );
779
-
780
- sandbox.stub((ArcGisFeatureProvider.prototype as any), "getLayerMetadata").callsFake(async function (_id: unknown) {
781
- return {
782
- defaultVisibility:true,
783
- supportedQueryFormats:"JSON",
784
- };
785
- });
786
- sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url: string, _formatId: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _requireToken?: boolean) {
787
- return {accessTokenRequired: false, content:{capabilities: "Query"}};
788
- });
789
- const fetchStub = sandbox.stub((ArcGISImageryProvider.prototype as any), "fetch");
790
-
791
- sandbox.stub(ArcGisFeatureProvider.prototype, "constructFeatureUrl").callsFake(function _(_row: number, _column: number, _zoomLevel: number, _format: ArcGisFeatureFormat, _geomOverride?: ArcGisGeometry, _outFields?: string, _tolerance?: number, _returnGeometry?: boolean) {
792
- return {url: settings.url};
793
- });
794
-
795
- const provider = new ArcGisFeatureProvider(settings);
796
- await provider.initialize();
797
- const response = await (provider as any).fetchTile(0,0,0);
798
- expect(response).to.not.undefined;
799
- expect(fetchStub.calledOnce).to.be.true;
800
- const test1 = fetchStub.getCall(0).firstArg;
801
- expect(test1.toString()).to.equals(new URL(settings.url).toString());
802
-
803
- });
804
-
805
- });