@itwin/map-layers-formats 4.1.0-dev.7 → 4.1.0-dev.71

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 (284) hide show
  1. package/CHANGELOG.md +74 -1
  2. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts +19 -0
  3. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
  4. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js +46 -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 +16 -8
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +157 -45
  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 +14 -0
  22. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
  23. package/lib/cjs/ArcGisFeature/{ArcGisFeatureJSON.js → ArcGisJsonFeatureReader.js} +51 -55
  24. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
  25. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +22 -0
  26. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
  27. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js +249 -0
  28. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
  29. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +32 -77
  30. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  31. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +88 -128
  32. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  33. package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts +152 -0
  34. package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts.map +1 -0
  35. package/lib/cjs/ArcGisFeature/EsriSymbology.js +181 -0
  36. package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -0
  37. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts +34 -0
  38. package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
  39. package/lib/cjs/Tools/MapFeatureInfoDecorator.js +281 -0
  40. package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -0
  41. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts +38 -0
  42. package/lib/cjs/Tools/MapFeatureInfoTool.d.ts.map +1 -0
  43. package/lib/cjs/Tools/MapFeatureInfoTool.js +113 -0
  44. package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -0
  45. package/lib/cjs/map-layers-formats.d.ts +1 -0
  46. package/lib/cjs/map-layers-formats.d.ts.map +1 -1
  47. package/lib/cjs/map-layers-formats.js +1 -0
  48. package/lib/cjs/map-layers-formats.js.map +1 -1
  49. package/lib/cjs/mapLayersFormats.d.ts +12 -1
  50. package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
  51. package/lib/cjs/mapLayersFormats.js +11 -1
  52. package/lib/cjs/mapLayersFormats.js.map +1 -1
  53. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +19 -0
  54. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
  55. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js +42 -0
  56. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -0
  57. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts.map +1 -1
  58. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +4 -1
  59. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  60. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +16 -8
  61. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  62. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +158 -46
  63. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  64. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +5 -0
  65. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
  66. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +4 -0
  67. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  68. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +15 -6
  69. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  70. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +4 -2
  71. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  72. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +14 -0
  73. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
  74. package/lib/esm/ArcGisFeature/{ArcGisFeatureJSON.js → ArcGisJsonFeatureReader.js} +51 -55
  75. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
  76. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +22 -0
  77. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
  78. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js +245 -0
  79. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
  80. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +32 -77
  81. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  82. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +84 -124
  83. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  84. package/lib/esm/ArcGisFeature/EsriSymbology.d.ts +152 -0
  85. package/lib/esm/ArcGisFeature/EsriSymbology.d.ts.map +1 -0
  86. package/lib/esm/ArcGisFeature/EsriSymbology.js +170 -0
  87. package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -0
  88. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts +34 -0
  89. package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
  90. package/lib/esm/Tools/MapFeatureInfoDecorator.js +277 -0
  91. package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -0
  92. package/lib/esm/Tools/MapFeatureInfoTool.d.ts +38 -0
  93. package/lib/esm/Tools/MapFeatureInfoTool.d.ts.map +1 -0
  94. package/lib/esm/Tools/MapFeatureInfoTool.js +110 -0
  95. package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -0
  96. package/lib/esm/map-layers-formats.d.ts +1 -0
  97. package/lib/esm/map-layers-formats.d.ts.map +1 -1
  98. package/lib/esm/map-layers-formats.js +1 -0
  99. package/lib/esm/map-layers-formats.js.map +1 -1
  100. package/lib/esm/mapLayersFormats.d.ts +12 -1
  101. package/lib/esm/mapLayersFormats.d.ts.map +1 -1
  102. package/lib/esm/mapLayersFormats.js +13 -2
  103. package/lib/esm/mapLayersFormats.js.map +1 -1
  104. package/lib/public/locales/en/mapLayersFormats.json +12 -0
  105. package/package.json +19 -22
  106. package/.nycrc +0 -10
  107. package/.rush/temp/operation/build/all.log +0 -3
  108. package/.rush/temp/operation/build/state.json +0 -3
  109. package/.rush/temp/operation/cover/all.log +0 -98
  110. package/.rush/temp/operation/cover/state.json +0 -3
  111. package/.rush/temp/operation/docs/all.log +0 -30
  112. package/.rush/temp/operation/docs/state.json +0 -3
  113. package/.rush/temp/package-deps_build.json +0 -36
  114. package/.rush/temp/package-deps_cover.json +0 -36
  115. package/.rush/temp/package-deps_docs.json +0 -36
  116. package/.rush/temp/shrinkwrap-deps.json +0 -505
  117. package/CHANGELOG.json +0 -119
  118. package/config/rush-project.json +0 -6
  119. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
  120. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
  121. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
  122. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +0 -15
  123. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
  124. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +0 -201
  125. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
  126. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
  127. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
  128. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +0 -143
  129. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
  130. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
  131. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
  132. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -35
  133. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
  134. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
  135. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
  136. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -162
  137. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
  138. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
  139. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
  140. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -168
  141. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
  142. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
  143. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
  144. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -680
  145. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
  146. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
  147. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
  148. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -104
  149. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
  150. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
  151. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
  152. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -215
  153. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
  154. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
  155. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
  156. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -95
  157. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
  158. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
  159. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
  160. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -60
  161. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
  162. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +0 -7
  163. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts.map +0 -1
  164. package/lib/cjs/test/ArcGisFeature/Mocks.js +0 -19
  165. package/lib/cjs/test/ArcGisFeature/Mocks.js.map +0 -1
  166. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
  167. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
  168. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +0 -420
  169. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
  170. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
  171. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
  172. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -427
  173. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
  174. package/lib/cjs/test/coverage/.nyc_output/2a6113c3-018f-40b1-ae8f-f3d0cbe030ce.json +0 -1
  175. package/lib/cjs/test/coverage/.nyc_output/74410d89-cce2-4b2a-89c9-6d56490c73f1.json +0 -1
  176. package/lib/cjs/test/coverage/.nyc_output/processinfo/2a6113c3-018f-40b1-ae8f-f3d0cbe030ce.json +0 -1
  177. package/lib/cjs/test/coverage/.nyc_output/processinfo/74410d89-cce2-4b2a-89c9-6d56490c73f1.json +0 -1
  178. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +0 -1
  179. package/lib/cjs/test/coverage/cobertura-coverage.xml +0 -1169
  180. package/lib/cjs/test/coverage/lcov-report/base.css +0 -224
  181. package/lib/cjs/test/coverage/lcov-report/block-navigation.js +0 -87
  182. package/lib/cjs/test/coverage/lcov-report/favicon.png +0 -0
  183. package/lib/cjs/test/coverage/lcov-report/index.html +0 -131
  184. package/lib/cjs/test/coverage/lcov-report/prettify.css +0 -1
  185. package/lib/cjs/test/coverage/lcov-report/prettify.js +0 -2
  186. package/lib/cjs/test/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  187. package/lib/cjs/test/coverage/lcov-report/sorter.js +0 -196
  188. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +0 -133
  189. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +0 -550
  190. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +0 -730
  191. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +0 -1546
  192. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +0 -763
  193. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +0 -223
  194. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +0 -598
  195. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +0 -301
  196. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +0 -832
  197. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +0 -236
  198. package/lib/cjs/test/coverage/lcov-report/src/index.html +0 -131
  199. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +0 -130
  200. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +0 -163
  201. package/lib/cjs/test/coverage/lcov.info +0 -1358
  202. package/lib/cjs/tsconfig.tsbuildinfo +0 -1
  203. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
  204. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
  205. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
  206. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +0 -15
  207. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
  208. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +0 -197
  209. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
  210. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
  211. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
  212. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +0 -139
  213. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
  214. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
  215. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
  216. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -33
  217. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
  218. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
  219. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
  220. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -160
  221. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
  222. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
  223. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
  224. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -166
  225. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
  226. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
  227. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
  228. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -678
  229. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
  230. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
  231. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
  232. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -102
  233. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
  234. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
  235. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
  236. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -213
  237. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
  238. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
  239. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
  240. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -93
  241. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
  242. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
  243. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
  244. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -58
  245. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
  246. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +0 -7
  247. package/lib/esm/test/ArcGisFeature/Mocks.d.ts.map +0 -1
  248. package/lib/esm/test/ArcGisFeature/Mocks.js +0 -16
  249. package/lib/esm/test/ArcGisFeature/Mocks.js.map +0 -1
  250. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
  251. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
  252. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +0 -417
  253. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
  254. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
  255. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
  256. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -424
  257. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
  258. package/lib/esm/tsconfig.tsbuildinfo +0 -1
  259. package/lib/test/junit_results.xml +0 -159
  260. package/map-layers-formats.build.log +0 -30
  261. package/src/ArcGisFeature/ArcGisFeatureFormat.ts +0 -16
  262. package/src/ArcGisFeature/ArcGisFeatureJSON.ts +0 -155
  263. package/src/ArcGisFeature/ArcGisFeaturePBF.ts +0 -215
  264. package/src/ArcGisFeature/ArcGisFeatureProvider.ts +0 -487
  265. package/src/ArcGisFeature/ArcGisFeatureQuery.ts +0 -226
  266. package/src/ArcGisFeature/ArcGisFeatureReader.ts +0 -46
  267. package/src/ArcGisFeature/ArcGisFeatureRenderer.ts +0 -171
  268. package/src/ArcGisFeature/ArcGisFeatureResponse.ts +0 -72
  269. package/src/ArcGisFeature/ArcGisSymbologyRenderer.ts +0 -249
  270. package/src/ArcGisFeature/esriPBuffer.gen.ts +0 -2612
  271. package/src/map-layers-formats.ts +0 -15
  272. package/src/mapLayersFormats.ts +0 -26
  273. package/src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts +0 -46
  274. package/src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts +0 -202
  275. package/src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts +0 -227
  276. package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +0 -805
  277. package/src/test/ArcGisFeature/ArcGisFeatureQuery.test.ts +0 -117
  278. package/src/test/ArcGisFeature/ArcGisFeatureRenderer.test.ts +0 -296
  279. package/src/test/ArcGisFeature/ArcGisFeatureResponse.test.ts +0 -109
  280. package/src/test/ArcGisFeature/ArcGisSymbologyRenderer.test.ts +0 -77
  281. package/src/test/ArcGisFeature/Mocks.ts +0 -19
  282. package/src/test/ArcGisFeature/NewYorkDataset.ts +0 -423
  283. package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +0 -455
  284. 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
- });