@arcgis/core 5.2.0-next.127 → 5.2.0-next.129

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 (405) hide show
  1. package/WebScene.js +1 -1
  2. package/applications/Components/imageryUtils.js +1 -1
  3. package/applications/SceneViewer/sceneViewerUtils.d.ts +14 -1
  4. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  5. package/applications/WebEditor/sketchUtils.js +1 -1
  6. package/arcade/batchExec.js +1 -1
  7. package/arcade/geometry/adapters/dehydrated.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/06da350b4ea25732f52b.js +1 -0
  10. package/assets/esri/core/workers/chunks/{67dcf9b873cb037b2647.js → 081c9ccaa5884c730a91.js} +1 -1
  11. package/assets/esri/core/workers/chunks/094102031cc77b20db74.js +1 -0
  12. package/assets/esri/core/workers/chunks/0b85c844af97b2fb0ba8.js +1 -0
  13. package/assets/esri/core/workers/chunks/{86d7a3ae672a51b75fcc.js → 0d44f793d3b0d33153ac.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0de140199161fcd15a0c.js +1 -0
  15. package/assets/esri/core/workers/chunks/0deceece4b465f653f58.js +1 -0
  16. package/assets/esri/core/workers/chunks/111dc5653daa7f3e1001.js +1 -0
  17. package/assets/esri/core/workers/chunks/139e3da8ea081e21539e.js +1 -0
  18. package/assets/esri/core/workers/chunks/142bedebd37d747f84ba.js +1 -0
  19. package/assets/esri/core/workers/chunks/15dc28b4fa5b5110472b.js +1 -0
  20. package/assets/esri/core/workers/chunks/{dd02cc18ebebb90778c6.js → 17e2bfc7468c23e43bef.js} +1 -1
  21. package/assets/esri/core/workers/chunks/196d33f4d8e3a256ad94.js +1 -0
  22. package/assets/esri/core/workers/chunks/1a02c68de65a67ab6a67.js +1 -0
  23. package/assets/esri/core/workers/chunks/{4165eb86471ea3bbf364.js → 1aecf7106a21320e054e.js} +1 -1
  24. package/assets/esri/core/workers/chunks/1bc03b8065cbbbb06c87.js +1 -0
  25. package/assets/esri/core/workers/chunks/1beb32170d659bc43977.js +1 -0
  26. package/assets/esri/core/workers/chunks/20ee32fee219afbcfee3.js +1 -0
  27. package/assets/esri/core/workers/chunks/{9467744cb7d094a5067a.js → 21d2f5324db0b199060c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/22abb9a74f6594f9db2a.js +1 -0
  29. package/assets/esri/core/workers/chunks/237795866c075880531b.js +1 -0
  30. package/assets/esri/core/workers/chunks/25e4da9c6837ab0fa585.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a5fde737dc99627142e.js +1 -0
  32. package/assets/esri/core/workers/chunks/3412050ae63ff7dcaf36.js +1 -0
  33. package/assets/esri/core/workers/chunks/35316724c8d3cc39cf80.js +1 -0
  34. package/assets/esri/core/workers/chunks/354cc6cd2a56937f1747.js +1 -0
  35. package/assets/esri/core/workers/chunks/365ae479765ca9e47de4.js +1 -0
  36. package/assets/esri/core/workers/chunks/{8190fcb1dd10ad20feed.js → 36ef86701883a20dd6f6.js} +1 -1
  37. package/assets/esri/core/workers/chunks/3759e272a1d43534a190.js +1 -0
  38. package/assets/esri/core/workers/chunks/397ddcf0b8e858a17b70.js +1 -0
  39. package/assets/esri/core/workers/chunks/3a7a558e30b5cb81c801.js +1 -0
  40. package/assets/esri/core/workers/chunks/3c9405d310a1b08c901e.js +1 -0
  41. package/assets/esri/core/workers/chunks/{e10fe4c77b8dc4492092.js → 3ce53562926b05e71af5.js} +1 -1
  42. package/assets/esri/core/workers/chunks/3d174a84b785fc633a5a.js +1 -0
  43. package/assets/esri/core/workers/chunks/3d67fed3e53993c38b58.js +1 -0
  44. package/assets/esri/core/workers/chunks/42bdeeff55fb1a3f735f.js +1 -0
  45. package/assets/esri/core/workers/chunks/48f1532520b76fa7f0c2.js +1 -0
  46. package/assets/esri/core/workers/chunks/{00d9e41deecf5828975c.js → 4adc3822ed9f498f5653.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{d5f0fed415b5b155d57c.js → 51741ef8225d470716fe.js} +1 -1
  48. package/assets/esri/core/workers/chunks/5191e481d0e19a7f3888.js +1 -0
  49. package/assets/esri/core/workers/chunks/{7fcee3a1b900ddc9a5e3.js → 540acf6abdee9dbd453e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{d9b63cf111035b05cd2e.js → 5484b89adc53430226d5.js} +1 -1
  51. package/assets/esri/core/workers/chunks/55361b50ecfc98db2ffb.js +1 -0
  52. package/assets/esri/core/workers/chunks/58da7c41c1bcef2f4141.js +1 -0
  53. package/assets/esri/core/workers/chunks/5979bbefb09d132c008f.js +1 -0
  54. package/assets/esri/core/workers/chunks/{84db05e872dbf35c80a2.js → 5982c6a8459c1237b298.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{0a20f84b5f004a77a9f9.js → 5abfc4f447b01d6bf287.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{4c0dba437de0969a5b63.js → 5b9f88194433410bad5b.js} +1 -1
  57. package/assets/esri/core/workers/chunks/5f794f4e0113d5dd50ba.js +1 -0
  58. package/assets/esri/core/workers/chunks/62a30692e2a7612bafc1.js +1 -0
  59. package/assets/esri/core/workers/chunks/62aa7daad4ca7332854e.js +1 -0
  60. package/assets/esri/core/workers/chunks/66926c3686d5ef2d4692.js +29 -0
  61. package/assets/esri/core/workers/chunks/6994ba168465b77a36af.js +1 -0
  62. package/assets/esri/core/workers/chunks/6d0c6fda9100fe89f3cb.js +1 -0
  63. package/assets/esri/core/workers/chunks/72a898894438f177cd62.js +1 -0
  64. package/assets/esri/core/workers/chunks/78d4455237120103f639.js +1 -0
  65. package/assets/esri/core/workers/chunks/7fccf53aa751cd9dae57.js +1 -0
  66. package/assets/esri/core/workers/chunks/{26995de0c18bef8db590.js → 81327e10200065a0ccef.js} +1 -1
  67. package/assets/esri/core/workers/chunks/84a3fbe5d85a357f4e82.js +1 -0
  68. package/assets/esri/core/workers/chunks/862479729f2d036f606b.js +1 -0
  69. package/assets/esri/core/workers/chunks/89dad6c1bfd81e4d7f8e.js +1 -0
  70. package/assets/esri/core/workers/chunks/8a9aa6db11d0f643961c.js +1 -0
  71. package/assets/esri/core/workers/chunks/8dfea65341991e13ab71.js +1 -0
  72. package/assets/esri/core/workers/chunks/8e92925043dc49ed1018.js +1 -0
  73. package/assets/esri/core/workers/chunks/8f0b2b0ca239b01f44d0.js +1 -0
  74. package/assets/esri/core/workers/chunks/93a89168c18db88f60e7.js +1 -0
  75. package/assets/esri/core/workers/chunks/991c854a4459c82d4d93.js +1 -0
  76. package/assets/esri/core/workers/chunks/{f90cad9f007a11154c0d.js → 9b080d07699b56f06c5f.js} +1 -1
  77. package/assets/esri/core/workers/chunks/9cd69aa3880838a834f8.js +1 -0
  78. package/assets/esri/core/workers/chunks/{2ca49fb4590cc34a02bd.js → 9d87f38b16dda1ff7978.js} +1 -1
  79. package/assets/esri/core/workers/chunks/9fd1e5a2c0a261ed2a33.js +1 -0
  80. package/assets/esri/core/workers/chunks/a0a9c41400ae98df1912.js +1 -0
  81. package/assets/esri/core/workers/chunks/a189e520da39919cdcca.js +1 -0
  82. package/assets/esri/core/workers/chunks/a3a5cb664bdb1db190dd.js +1 -0
  83. package/assets/esri/core/workers/chunks/a63c456ecf018ec06778.js +1 -0
  84. package/assets/esri/core/workers/chunks/{842f993fa60b410cb613.js → a8322a978e33c7349fdf.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{f479b4a4cee4bb2e046c.js → aa96eea0899757ab38c7.js} +1 -1
  86. package/assets/esri/core/workers/chunks/ab0b2a76247dfd56b92d.js +1 -0
  87. package/assets/esri/core/workers/chunks/ab7337b076d152a8eb9e.js +1 -0
  88. package/assets/esri/core/workers/chunks/ac0de274853a42d518a1.js +1 -0
  89. package/assets/esri/core/workers/chunks/ad372e399e20d5a3262d.js +1 -0
  90. package/assets/esri/core/workers/chunks/ae75b3e5320d03dff64c.js +1 -0
  91. package/assets/esri/core/workers/chunks/ae98530d5816306216b3.js +1 -0
  92. package/assets/esri/core/workers/chunks/afc94c4b9bc007fe310f.js +1 -0
  93. package/assets/esri/core/workers/chunks/afe54923339e957b71b9.js +1 -0
  94. package/assets/esri/core/workers/chunks/bbcac00362fef5e3956d.js +1 -0
  95. package/assets/esri/core/workers/chunks/{1302bf9718747cd9fdd9.js → bcee161dd1c4781d1998.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{d1f54b0079fb71a15612.js → bd231bc0624eb889ac14.js} +1 -1
  97. package/assets/esri/core/workers/chunks/c0075715fbe7bec10fc3.js +1 -0
  98. package/assets/esri/core/workers/chunks/c4e1e864fb8c119b2520.js +1 -0
  99. package/assets/esri/core/workers/chunks/c93cedf9e53da5aaa35b.js +1 -0
  100. package/assets/esri/core/workers/chunks/{2d592c935571de80a2e2.js → c9690810b198a97bc16d.js} +1 -1
  101. package/assets/esri/core/workers/chunks/cada517cc25fa37f778c.js +1 -0
  102. package/assets/esri/core/workers/chunks/cd1821bf601949674e02.js +1 -0
  103. package/assets/esri/core/workers/chunks/{1b42d163ef22e3565bb7.js → cf7b7e54cd87422ca62a.js} +1 -1
  104. package/assets/esri/core/workers/chunks/d1187ad6cc4959683819.js +1 -0
  105. package/assets/esri/core/workers/chunks/d195c57fc6de3560653d.js +1 -0
  106. package/assets/esri/core/workers/chunks/d7f830a06ded11f2fc80.js +1 -0
  107. package/assets/esri/core/workers/chunks/d877783815afd21dbe98.js +1 -0
  108. package/assets/esri/core/workers/chunks/db5181fcea96cc2ede3e.js +1 -0
  109. package/assets/esri/core/workers/chunks/{6e8187a77846239ed112.js → de28a86775235bd5d3c4.js} +2 -2
  110. package/assets/esri/core/workers/chunks/df6992416cba9539f1ed.js +1 -0
  111. package/assets/esri/core/workers/chunks/e4005d95a396e1af9ac2.js +1 -0
  112. package/assets/esri/core/workers/chunks/{668ec0bdfb2095e90c9e.js → e495697860f7207da4c7.js} +1 -1
  113. package/assets/esri/core/workers/chunks/ec187933b42fe65594b7.js +1 -0
  114. package/assets/esri/core/workers/chunks/eec5a93dbc258a90b6de.js +1 -0
  115. package/assets/esri/core/workers/chunks/f163502c513205c892e7.js +1 -0
  116. package/assets/esri/core/workers/chunks/f287ec0fcb611f82ebb0.js +1 -0
  117. package/assets/esri/core/workers/chunks/{37ae52c71bf9c70fbb92.js → f2d45d15d0ba2537a4eb.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{d507d7d7a7282fc38e8d.js → f652d1db26fbdea1a79b.js} +1 -1
  119. package/assets/esri/core/workers/chunks/f6b38ed75baae198c19b.js +1 -0
  120. package/assets/esri/core/workers/chunks/{168b45c5d8233f23793e.js → f6cfc901267a229de7a1.js} +2 -2
  121. package/assets/esri/core/workers/chunks/f6d04d14323b926f1025.js +1 -0
  122. package/assets/esri/core/workers/chunks/f7ab606be37373312ebe.js +1 -0
  123. package/assets/esri/core/workers/chunks/{3b7dff15a0058ea29886.js → f92178ac6dc9abff304f.js} +1 -1
  124. package/assets/esri/core/workers/chunks/fc39593febef74a036f1.js +1 -0
  125. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  126. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-arabic.woff2 +0 -0
  127. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-cyrillic.woff2 +0 -0
  128. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-ext.woff2 +0 -0
  129. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-georgian.woff2 +0 -0
  130. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-greek.woff2 +0 -0
  131. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-hebrew.woff2 +0 -0
  132. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-math.woff2 +0 -0
  133. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-thai.woff2 +0 -0
  134. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-vietnamese.woff2 +0 -0
  135. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02.woff2 +0 -0
  136. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-arabic.woff2 +0 -0
  137. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-cyrillic.woff2 +0 -0
  138. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-ext.woff2 +0 -0
  139. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-georgian.woff2 +0 -0
  140. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-greek.woff2 +0 -0
  141. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-hebrew.woff2 +0 -0
  142. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-math.woff2 +0 -0
  143. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-thai.woff2 +0 -0
  144. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-vietnamese.woff2 +0 -0
  145. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7.woff2 +0 -0
  146. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-arabic.woff2 +0 -0
  147. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-cyrillic.woff2 +0 -0
  148. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-ext.woff2 +0 -0
  149. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-georgian.woff2 +0 -0
  150. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-greek.woff2 +0 -0
  151. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-hebrew.woff2 +0 -0
  152. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-math.woff2 +0 -0
  153. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-thai.woff2 +0 -0
  154. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-vietnamese.woff2 +0 -0
  155. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688.woff2 +0 -0
  156. package/assets/esri/themes/base/fonts/fonts/3ae1e25e-3aa6-4061-a016-a079159f9d65.woff2 +0 -0
  157. package/assets/esri/themes/base/fonts/fonts/41331c3c-3759-4462-8695-33c9a21b6a5b.woff2 +0 -0
  158. package/assets/esri/themes/base/fonts/fonts/94aa531e-7746-4df0-bb6e-349891f2eda5.woff2 +0 -0
  159. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-arabic.woff2 +0 -0
  160. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-cyrillic.woff2 +0 -0
  161. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-ext.woff2 +0 -0
  162. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-georgian.woff2 +0 -0
  163. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-greek.woff2 +0 -0
  164. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-hebrew.woff2 +0 -0
  165. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-math.woff2 +0 -0
  166. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-thai.woff2 +0 -0
  167. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-vietnamese.woff2 +0 -0
  168. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939.woff2 +0 -0
  169. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-cyrillic.woff2 +0 -0
  170. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-ext.woff2 +0 -0
  171. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-greek.woff2 +0 -0
  172. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-hebrew.woff2 +0 -0
  173. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-math.woff2 +0 -0
  174. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-vietnamese.woff2 +0 -0
  175. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d.woff2 +0 -0
  176. package/assets/esri/themes/base/fonts/fonts.scss +0 -0
  177. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +7 -0
  178. package/assets/esri/themes/base/widgets/_Tooltip.scss +5 -3
  179. package/assets/esri/themes/dark/main.css +1 -1
  180. package/assets/esri/themes/light/main.css +1 -1
  181. package/assets/esri/themes/light/view.css +1 -1
  182. package/assets/esri/views/interactive/tooltip/t9n/messages.ar.json +1 -1
  183. package/assets/esri/views/interactive/tooltip/t9n/messages.bg.json +1 -1
  184. package/assets/esri/views/interactive/tooltip/t9n/messages.bs.json +1 -1
  185. package/assets/esri/views/interactive/tooltip/t9n/messages.ca.json +1 -1
  186. package/assets/esri/views/interactive/tooltip/t9n/messages.cs.json +1 -1
  187. package/assets/esri/views/interactive/tooltip/t9n/messages.da.json +1 -1
  188. package/assets/esri/views/interactive/tooltip/t9n/messages.de.json +1 -1
  189. package/assets/esri/views/interactive/tooltip/t9n/messages.el.json +1 -1
  190. package/assets/esri/views/interactive/tooltip/t9n/messages.es.json +1 -1
  191. package/assets/esri/views/interactive/tooltip/t9n/messages.et.json +1 -1
  192. package/assets/esri/views/interactive/tooltip/t9n/messages.fi.json +1 -1
  193. package/assets/esri/views/interactive/tooltip/t9n/messages.fr.json +1 -1
  194. package/assets/esri/views/interactive/tooltip/t9n/messages.he.json +1 -1
  195. package/assets/esri/views/interactive/tooltip/t9n/messages.hr.json +1 -1
  196. package/assets/esri/views/interactive/tooltip/t9n/messages.hu.json +1 -1
  197. package/assets/esri/views/interactive/tooltip/t9n/messages.id.json +1 -1
  198. package/assets/esri/views/interactive/tooltip/t9n/messages.it.json +1 -1
  199. package/assets/esri/views/interactive/tooltip/t9n/messages.ja.json +1 -1
  200. package/assets/esri/views/interactive/tooltip/t9n/messages.ko.json +1 -1
  201. package/assets/esri/views/interactive/tooltip/t9n/messages.lt.json +1 -1
  202. package/assets/esri/views/interactive/tooltip/t9n/messages.lv.json +1 -1
  203. package/assets/esri/views/interactive/tooltip/t9n/messages.nl.json +1 -1
  204. package/assets/esri/views/interactive/tooltip/t9n/messages.no.json +1 -1
  205. package/assets/esri/views/interactive/tooltip/t9n/messages.pl.json +1 -1
  206. package/assets/esri/views/interactive/tooltip/t9n/messages.pt-BR.json +1 -1
  207. package/assets/esri/views/interactive/tooltip/t9n/messages.pt-PT.json +1 -1
  208. package/assets/esri/views/interactive/tooltip/t9n/messages.ro.json +1 -1
  209. package/assets/esri/views/interactive/tooltip/t9n/messages.ru.json +1 -1
  210. package/assets/esri/views/interactive/tooltip/t9n/messages.sk.json +1 -1
  211. package/assets/esri/views/interactive/tooltip/t9n/messages.sl.json +1 -1
  212. package/assets/esri/views/interactive/tooltip/t9n/messages.sr.json +1 -1
  213. package/assets/esri/views/interactive/tooltip/t9n/messages.sv.json +1 -1
  214. package/assets/esri/views/interactive/tooltip/t9n/messages.th.json +1 -1
  215. package/assets/esri/views/interactive/tooltip/t9n/messages.tr.json +1 -1
  216. package/assets/esri/views/interactive/tooltip/t9n/messages.uk.json +1 -1
  217. package/assets/esri/views/interactive/tooltip/t9n/messages.vi.json +1 -1
  218. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-CN.json +1 -1
  219. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-HK.json +1 -1
  220. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-TW.json +1 -1
  221. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
  222. package/chunks/batchExec.js +2 -0
  223. package/config.js +1 -1
  224. package/core/units.js +1 -1
  225. package/geometry/HeightModelInfo.js +1 -1
  226. package/geometry/ellipsoidUtils.js +1 -1
  227. package/geometry/support/heightModelInfoUtils.js +1 -1
  228. package/geometry/support/intersects.js +1 -1
  229. package/geometry/support/intersectsBase.js +1 -1
  230. package/interfaces.d.ts +1 -0
  231. package/kernel.js +1 -1
  232. package/layers/ElevationLayer.js +1 -1
  233. package/layers/GeospatialPDFLayer.js +1 -1
  234. package/layers/ImageryTileLayer.js +1 -1
  235. package/layers/OrientedImageryLayer.js +1 -1
  236. package/layers/graphics/dehydratedFeatures.js +1 -1
  237. package/layers/graphics/hydrateGeometryJSON.js +2 -0
  238. package/layers/graphics/hydratedFeatures.js +1 -1
  239. package/layers/graphics/hydratedSpatialReference.js +2 -0
  240. package/layers/graphics/transferFeatures.js +2 -0
  241. package/layers/mixins/FeatureLayerBase.js +1 -1
  242. package/layers/mixins/HeightModelInfoMixin.js +2 -0
  243. package/layers/mixins/SceneService.js +1 -1
  244. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  245. package/layers/raster/datasets/DBFParser.js +1 -1
  246. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  247. package/layers/raster/datasets/RasterFactory.js +1 -1
  248. package/layers/raster/datasets/TIFFRaster.js +1 -1
  249. package/layers/raster/formats/JpgPlus.js +1 -1
  250. package/layers/raster/formats/RasterCodec.js +1 -1
  251. package/layers/raster/formats/Raw.js +1 -1
  252. package/layers/support/arcadeUtils.js +1 -1
  253. package/package.json +3 -3
  254. package/popup/FeatureContent.js +1 -1
  255. package/popup/FeatureContentCollection.d.ts +2 -0
  256. package/popup/FeatureContentCollection.js +1 -1
  257. package/popup/support/featureUtils.js +1 -1
  258. package/rest/imageService.js +1 -1
  259. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  260. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  261. package/support/arcadeUtils.js +1 -1
  262. package/support/loadArcade.js +1 -1
  263. package/support/revision.js +1 -1
  264. package/symbols/cim/cimAnalyzer.js +1 -1
  265. package/views/2d/engine/vectorTiles/GeometryUtils.js +1 -1
  266. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  267. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  268. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  269. package/views/2d/engine/vectorTiles/decluttering/util.js +1 -1
  270. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  271. package/views/2d/layerViewModuleImportUtils.js +1 -1
  272. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  273. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  274. package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
  275. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  276. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  277. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  278. package/views/2d/support/hitTestUtils.js +1 -1
  279. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  280. package/views/3d/camera/intersectionUtils.js +1 -1
  281. package/views/3d/interactive/Manipulator3D.js +1 -1
  282. package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
  283. package/views/3d/layers/I3SMeshView3D.js +1 -1
  284. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  285. package/views/3d/layers/support/featureReference.js +1 -1
  286. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  287. package/views/3d/state/Constraints.js +1 -1
  288. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  289. package/views/3d/support/PBFDecoder.js +1 -1
  290. package/views/3d/support/PBFDecoderWorker.js +1 -1
  291. package/views/3d/support/QualityProfile.js +1 -1
  292. package/views/3d/terrain/TerrainRenderer.js +1 -1
  293. package/views/3d/terrain/TileCompositor.js +1 -1
  294. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  295. package/views/DOMContainer.d.ts +18 -8
  296. package/views/SceneView.js +1 -1
  297. package/views/ToolViewManager.js +1 -1
  298. package/views/VideoView.d.ts +38 -0
  299. package/views/VideoView.js +1 -1
  300. package/views/View.d.ts +20 -2
  301. package/views/View.js +1 -1
  302. package/views/input/types.d.ts +19 -6
  303. package/views/interactive/dragEventPipeline.js +1 -1
  304. package/views/interactive/options/TooltipVisibleElements.d.ts +11 -1
  305. package/views/interactive/options/TooltipVisibleElements.js +1 -1
  306. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  307. package/views/layers/ImageryTileLayerView.js +1 -1
  308. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  309. package/widgets/BatchAttributeForm.js +1 -1
  310. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  311. package/widgets/OrientedImageryViewer/utils.js +1 -1
  312. package/widgets/Search/SearchViewModel.js +1 -1
  313. package/widgets/Search/support/layerSearchUtils.js +1 -1
  314. package/assets/esri/core/workers/chunks/025da54eef112d7e8f66.js +0 -1
  315. package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +0 -1
  316. package/assets/esri/core/workers/chunks/04d4cd66485b622403d0.js +0 -1
  317. package/assets/esri/core/workers/chunks/05afa8c2b5929ce0545a.js +0 -1
  318. package/assets/esri/core/workers/chunks/09676cfa99b90fe0cc63.js +0 -1
  319. package/assets/esri/core/workers/chunks/0a2b7c691a577cb3d189.js +0 -1
  320. package/assets/esri/core/workers/chunks/0aadee0437fa061e4ff5.js +0 -1
  321. package/assets/esri/core/workers/chunks/0ccd4200c5a2a5de6e16.js +0 -1
  322. package/assets/esri/core/workers/chunks/1262918b2161d79851c0.js +0 -1
  323. package/assets/esri/core/workers/chunks/1406a884241809b62bff.js +0 -1
  324. package/assets/esri/core/workers/chunks/1c33aa349beea9a3792f.js +0 -1
  325. package/assets/esri/core/workers/chunks/1f135269aea3931e11b2.js +0 -1
  326. package/assets/esri/core/workers/chunks/2146c25c01c9fc11b16c.js +0 -1
  327. package/assets/esri/core/workers/chunks/24014f3701c31ee74bc2.js +0 -1
  328. package/assets/esri/core/workers/chunks/25a2e02677a74834c8b5.js +0 -1
  329. package/assets/esri/core/workers/chunks/2afce71e8b6ae86e0792.js +0 -1
  330. package/assets/esri/core/workers/chunks/2c7bb5c9751524687002.js +0 -1
  331. package/assets/esri/core/workers/chunks/2c7fc24649d91552e68a.js +0 -1
  332. package/assets/esri/core/workers/chunks/2ebad7e588b26e74cefe.js +0 -1
  333. package/assets/esri/core/workers/chunks/319434415d2c0561bc59.js +0 -1
  334. package/assets/esri/core/workers/chunks/39d71e83261bff46f6bf.js +0 -1
  335. package/assets/esri/core/workers/chunks/3aceedec9abfb2fdfa18.js +0 -1
  336. package/assets/esri/core/workers/chunks/3c6ee445e49da0076ac1.js +0 -1
  337. package/assets/esri/core/workers/chunks/4327d2c39a660bd89da7.js +0 -1
  338. package/assets/esri/core/workers/chunks/462fd57af8ed7921d6ba.js +0 -1
  339. package/assets/esri/core/workers/chunks/4678a8170d8a3ccd1a7b.js +0 -1
  340. package/assets/esri/core/workers/chunks/474d9541d387b31ad275.js +0 -1
  341. package/assets/esri/core/workers/chunks/48a2f68e06a2e90b77d0.js +0 -1
  342. package/assets/esri/core/workers/chunks/4a73f73f1698fad2df20.js +0 -1
  343. package/assets/esri/core/workers/chunks/4f464047c6f6c9486efd.js +0 -1
  344. package/assets/esri/core/workers/chunks/50c29d10ec53f0e48e8a.js +0 -1
  345. package/assets/esri/core/workers/chunks/526cc64ae46dec3fbeda.js +0 -1
  346. package/assets/esri/core/workers/chunks/550d4df0732352fa48b5.js +0 -1
  347. package/assets/esri/core/workers/chunks/56e97b98dcb8a3f2bcb7.js +0 -1
  348. package/assets/esri/core/workers/chunks/581285e4d7bbe1b7c27a.js +0 -1
  349. package/assets/esri/core/workers/chunks/58fb92775d668cfd295c.js +0 -1
  350. package/assets/esri/core/workers/chunks/5adf2792416b22cd602f.js +0 -1
  351. package/assets/esri/core/workers/chunks/5aee7739afb5160d4ace.js +0 -1
  352. package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +0 -1
  353. package/assets/esri/core/workers/chunks/64ee22134fda2f09c094.js +0 -1
  354. package/assets/esri/core/workers/chunks/66ef6c034455abd61f39.js +0 -1
  355. package/assets/esri/core/workers/chunks/67678054342178b601cf.js +0 -1
  356. package/assets/esri/core/workers/chunks/6c82cbcd504c711a7450.js +0 -1
  357. package/assets/esri/core/workers/chunks/6e75f09fb9452bd5f9fb.js +0 -1
  358. package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +0 -1
  359. package/assets/esri/core/workers/chunks/75879ae88fd87b089a87.js +0 -1
  360. package/assets/esri/core/workers/chunks/76548469fe1b9c3b2051.js +0 -1
  361. package/assets/esri/core/workers/chunks/78085f804969c9282700.js +0 -1
  362. package/assets/esri/core/workers/chunks/7d6da4e89aa951e6523f.js +0 -1
  363. package/assets/esri/core/workers/chunks/80f16f5f15518013f7d0.js +0 -1
  364. package/assets/esri/core/workers/chunks/82ce034b5ba54de9b970.js +0 -29
  365. package/assets/esri/core/workers/chunks/8465e2c7221125fd3cc4.js +0 -1
  366. package/assets/esri/core/workers/chunks/87aaed3dfa903bdf853c.js +0 -1
  367. package/assets/esri/core/workers/chunks/892dc038d569cffd26dc.js +0 -1
  368. package/assets/esri/core/workers/chunks/8daed13400d9e63e65ae.js +0 -1
  369. package/assets/esri/core/workers/chunks/8f1c5f5e70d4b33d021d.js +0 -1
  370. package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +0 -1
  371. package/assets/esri/core/workers/chunks/9d6a96e4c7ccedcb0c13.js +0 -1
  372. package/assets/esri/core/workers/chunks/9ec04faad97be55309b8.js +0 -1
  373. package/assets/esri/core/workers/chunks/a08385ebf1715414c1a6.js +0 -1
  374. package/assets/esri/core/workers/chunks/a3a33ffa34f4d645ddfe.js +0 -1
  375. package/assets/esri/core/workers/chunks/b396c4b4bb144200acc7.js +0 -1
  376. package/assets/esri/core/workers/chunks/b9c834e3c0701e9b14a2.js +0 -1
  377. package/assets/esri/core/workers/chunks/ba435cc73956d9c64a11.js +0 -1
  378. package/assets/esri/core/workers/chunks/bbfb80a6983574007ce5.js +0 -1
  379. package/assets/esri/core/workers/chunks/bcf2e5cf6b9c6d0442bb.js +0 -1
  380. package/assets/esri/core/workers/chunks/c35e9dee87937f483a3d.js +0 -1
  381. package/assets/esri/core/workers/chunks/c5b733c3a5b2680042a2.js +0 -1
  382. package/assets/esri/core/workers/chunks/c77496c350004ee66eb2.js +0 -1
  383. package/assets/esri/core/workers/chunks/cbeba973ef5593ffbba3.js +0 -1
  384. package/assets/esri/core/workers/chunks/ccaeabc3be07f3c96f50.js +0 -1
  385. package/assets/esri/core/workers/chunks/d25fb32a233d2128afbe.js +0 -1
  386. package/assets/esri/core/workers/chunks/d371d9279b30548efa02.js +0 -1
  387. package/assets/esri/core/workers/chunks/d5ef269ab0ee3744b05d.js +0 -1
  388. package/assets/esri/core/workers/chunks/dc92710a8fdfb9135e55.js +0 -1
  389. package/assets/esri/core/workers/chunks/dd4ecf81250cc001d040.js +0 -1
  390. package/assets/esri/core/workers/chunks/e0894a308c84d5c158b0.js +0 -1
  391. package/assets/esri/core/workers/chunks/e4016ae9cb8f16e3efc3.js +0 -1
  392. package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +0 -1
  393. package/assets/esri/core/workers/chunks/e6637f9176566382ed3e.js +0 -1
  394. package/assets/esri/core/workers/chunks/e6a4cef0af9be30ffe3d.js +0 -1
  395. package/assets/esri/core/workers/chunks/eaa7cb3ffa8c11706a09.js +0 -1
  396. package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +0 -1
  397. package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +0 -1
  398. package/assets/esri/core/workers/chunks/f2fca9a3a40170996ea2.js +0 -1
  399. package/assets/esri/core/workers/chunks/f5d06cd6d30a5f742f73.js +0 -1
  400. package/assets/esri/core/workers/chunks/f71ec8a260405ed07958.js +0 -1
  401. package/assets/esri/core/workers/chunks/f91cab9904020cf25d50.js +0 -1
  402. package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +0 -1
  403. package/assets/esri/core/workers/chunks/ff0e9f8d323eb1729650.js +0 -1
  404. /package/assets/esri/core/workers/chunks/{6e8187a77846239ed112.js.LICENSE.txt → de28a86775235bd5d3c4.js.LICENSE.txt} +0 -0
  405. /package/assets/esri/core/workers/chunks/{168b45c5d8233f23793e.js.LICENSE.txt → f6cfc901267a229de7a1.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{UniqueSymbol as e}from"./core.js";import{isSearchCircleOverlapingSymbol as t,tileCoordChangeX as s,tileCoordChangeY as i,GridIndex as l}from"./util.js";class o{static fromSymbols(e,t){let s=e.length;if(s>=r){let i=t;do{i/=2,s/=4}while(s>n&&i>y);const r=new l(t,t,i);for(const t of e)r.getCell(t.xTile,t.yTile)?.push(t);return new o(t,e,r)}return new o(t,e,null)}constructor(e,t,s){this.tileCoordRange=e,this._symbols=t,this._index=s}addSymbols(e){for(const t of e)this._symbols.push(t);if(this._index)for(const t of e)this._index.getCell(t.xTile,t.yTile).push(t)}removeSymbols(e){const t=new Set(e);if(this._symbols=this._symbols.filter(e=>!t.has(e)),this._index)for(const s of this._index.cells)for(let e=0;e<s.length;e++)s[e]=s[e].filter(e=>!t.has(e))}getSymbols(){return this._symbols}getCandidate(e,t,s,i){if(!this._index){for(const l of this._symbols)if(s===l.hash&&Math.abs(e-l.xTile)<=i&&Math.abs(t-l.yTile)<=i)return l;return null}const l=this._index.getCellSpan(e-i,t-i,e+i,t+i),[o,r,n,y]=l;for(let a=r;a<=y;a++)for(let l=o;l<=n;l++){const o=this._index.cells[a][l];for(const l of o)if(s===l.hash&&Math.abs(e-l.xTile)<=i&&Math.abs(t-l.yTile)<=i)return l}return null}}const r=32,n=8,y=64,a=20;class u{constructor(e,t){this.tileCoordRange=e,this._visibleTiles=t,this._indexMapByTile=new Map,this._uniqueSymbolsByStyleLayerId=new Map,this._featureMetricUpdates=[]}get uniqueSymbols(){return null==this._uniqueSymbolLayerArray&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}registerVectorTile(e,t){const s=this._ensureIndexMap(e),i=t?.values()??s.keys();for(const l of i){const e=s.get(l);e&&(this._removeSymbols(l,e.getSymbols()),s.delete(l))}this._addSymbols(e.key,s,e.symbols),this._invalidate()}unregisterVectorTile(e){this._removeTile(e),this._invalidate()}flushFeatureTileUpdateMessages(){for(const e of this._featureMetricUpdates)switch(e.type){case"tile-add":this._ensureIndexMap(e.tile);break;case"tile-remove":this._removeTile(e.tile);break;case"metrics-add":{const{tile:t,metrics:s}=e,i=this._indexMapByTile.get(t);if(!i)throw new Error(`tile ${t.id} not registered!`);this._addSymbols(t.key,i,h(s));break}case"metrics-remove":{const{tile:t,metrics:s}=e,i=this._indexMapByTile.get(t);if(!i)continue;const l=h(s);for(const[e,o]of i.entries()){const t=l.get(e);t&&(o.removeSymbols(t),this._removeSymbols(e,t))}break}}this._featureMetricUpdates.length=0,this._invalidate()}registerFeatureTile(e){this._featureMetricUpdates.push({type:"tile-add",tile:e})}unregisterFeatureTile(e){this._featureMetricUpdates.push({type:"tile-remove",tile:e})}insertFeatureTileMetrics(e,t){this._featureMetricUpdates.push({type:"metrics-add",tile:e,metrics:t})}removeFeatureTileMetrics(e,t){this._featureMetricUpdates.push({type:"metrics-remove",tile:e,metrics:t})}deleteStyleLayers(e){for(const t of this._indexMapByTile.values())for(const s of e){const e=t.get(s);e&&(this._removeSymbols(s,e.getSymbols()),t.delete(s))}this._invalidate()}querySymbols(e,s,i,l){const o=[];for(const[r,n]of this._uniqueSymbolsByStyleLayerId.entries())for(const l of n){const n=l.tileSymbols.find(e=>e.selectedForRendering);n&&t(n,e,s,i)&&o.push({vtlSymbol:n,styleLayerUID:r,tileKey:n.tile.key})}return o}_ensureIndexMap(e){let t=this._indexMapByTile.get(e);return t||(t=new Map,this._indexMapByTile.set(e,t)),t}_invalidate(){this._uniqueSymbolLayerArray=null}_addSymbols(e,t,s){for(const[i,l]of s){let e=t.get(i);e?e.addSymbols(l):(e=o.fromSymbols(l,this.tileCoordRange),t.set(i,e))}this._updateUniqueSymbols(e,s)}_removeTile(e){const t=this._indexMapByTile.get(e);if(t){for(const[e,s]of t.entries())this._removeSymbols(e,s.getSymbols());this._indexMapByTile.delete(e),this._invalidate()}}_removeSymbols(e,t){for(const s of t){const t=s.uniqueSymbol;if(t){if(t.tileSymbols=t.tileSymbols.filter(e=>e!==s),0===t.tileSymbols.length){const s=this._uniqueSymbolsByStyleLayerId.get(e);s.delete(t),0===s.size&&this._uniqueSymbolsByStyleLayerId.delete(e)}s.uniqueSymbol=null}}}_updateUniqueSymbols(t,s){if(0!==s.size){for(const e of this._visibleTiles)e.parentTile||e.key.world!==t.world||e.key.level===t.level&&!e.key.equals(t)||this._matchSymbols(e,t,s);for(const[t,i]of s)for(const s of i)if(!s.uniqueSymbol){s.uniqueSymbol=new e(s);let i=this._uniqueSymbolsByStyleLayerId.get(t);i||(i=new Set,this._uniqueSymbolsByStyleLayerId.set(t,i)),i.add(s.uniqueSymbol)}}}_matchSymbols(e,t,l){if(e.key.level>t.level){const s=e.key.level-t.level;if(e.key.row>>s!==t.row||e.key.col>>s!==t.col)return}if(t.level>e.key.level){const s=t.level-e.key.level;if(t.row>>s!==e.key.row||t.col>>s!==e.key.col)return}const o=new Map;for(const[r,n]of l){const l=[],y=Math.abs(e.key.level-t.level),u=e.key.level<t.level?1:1<<y,h=this._indexMapByTile.get(e),c=h?.get(r);if(c)for(const o of n){if(o.uniqueSymbol)continue;const r=s(this.tileCoordRange,o.xTile,t,e.key),n=i(this.tileCoordRange,o.yTile,t,e.key),y=-a,h=this.tileCoordRange+a;if(!(r>=y&&r<h&&n>=y&&n<h)){l.push(o);continue}const m=c.getCandidate(r,n,o.hash,u),f=m?.uniqueSymbol;f?(o.uniqueSymbol=f,f.tileSymbols.push(o)):l.push(o)}l.length>0&&o.set(r,l)}for(const s of e.childrenTiles||[])this._matchSymbols(s,t,o)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsByStyleLayerId,t=new Array(e.size);let s,i=0;for(const[l,o]of e){const e=new Array(o.size);s=0;for(const t of o)e[s++]=t;t[i]={styleLayerUID:l,uniqueSymbols:e},i++}return t}}function h(e){const t=new Map;for(const s of e){const e=s.labelClassId;let i=t.get(e);i||(i=[],t.set(e,i)),i.push(s)}return t}export{u as SymbolRepository};
2
+ import{UniqueSymbol as e}from"./core.js";import{tileCoordChangeX as t,tileCoordChangeY as s,GridIndex as i}from"./util.js";class l{static fromSymbols(e,t){let s=e.length;if(s>=o){let o=t;do{o/=2,s/=4}while(s>r&&o>n);const y=new i(t,t,o);for(const t of e)y.getCell(t.xTile,t.yTile)?.push(t);return new l(t,e,y)}return new l(t,e,null)}constructor(e,t,s){this.tileCoordRange=e,this._symbols=t,this._index=s}addSymbols(e){for(const t of e)this._symbols.push(t);if(this._index)for(const t of e)this._index.getCell(t.xTile,t.yTile).push(t)}removeSymbols(e){const t=new Set(e);if(this._symbols=this._symbols.filter(e=>!t.has(e)),this._index)for(const s of this._index.cells)for(let e=0;e<s.length;e++)s[e]=s[e].filter(e=>!t.has(e))}getSymbols(){return this._symbols}getCandidate(e,t,s,i){if(!this._index){for(const l of this._symbols)if(s===l.hash&&Math.abs(e-l.xTile)<=i&&Math.abs(t-l.yTile)<=i)return l;return null}const l=this._index.getCellSpan(e-i,t-i,e+i,t+i),[o,r,n,y]=l;for(let a=r;a<=y;a++)for(let l=o;l<=n;l++){const o=this._index.cells[a][l];for(const l of o)if(s===l.hash&&Math.abs(e-l.xTile)<=i&&Math.abs(t-l.yTile)<=i)return l}return null}}const o=32,r=8,n=64,y=20;class a{constructor(e,t){this.tileCoordRange=e,this._visibleTiles=t,this._indexMapByTile=new Map,this._uniqueSymbolsByStyleLayerId=new Map,this._featureMetricUpdates=[]}get uniqueSymbols(){return null==this._uniqueSymbolLayerArray&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}registerVectorTile(e,t){const s=this._ensureIndexMap(e),i=t?.values()??s.keys();for(const l of i){const e=s.get(l);e&&(this._removeSymbols(l,e.getSymbols()),s.delete(l))}this._addSymbols(e.key,s,e.symbols),this._invalidate()}unregisterVectorTile(e){this._removeTile(e),this._invalidate()}flushFeatureTileUpdateMessages(){for(const e of this._featureMetricUpdates)switch(e.type){case"tile-add":this._ensureIndexMap(e.tile);break;case"tile-remove":this._removeTile(e.tile);break;case"metrics-add":{const{tile:t,metrics:s}=e,i=this._indexMapByTile.get(t);if(!i)throw new Error(`tile ${t.id} not registered!`);this._addSymbols(t.key,i,u(s));break}case"metrics-remove":{const{tile:t,metrics:s}=e,i=this._indexMapByTile.get(t);if(!i)continue;const l=u(s);for(const[e,o]of i.entries()){const t=l.get(e);t&&(o.removeSymbols(t),this._removeSymbols(e,t))}break}}this._featureMetricUpdates.length=0,this._invalidate()}registerFeatureTile(e){this._featureMetricUpdates.push({type:"tile-add",tile:e})}unregisterFeatureTile(e){this._featureMetricUpdates.push({type:"tile-remove",tile:e})}insertFeatureTileMetrics(e,t){this._featureMetricUpdates.push({type:"metrics-add",tile:e,metrics:t})}removeFeatureTileMetrics(e,t){this._featureMetricUpdates.push({type:"metrics-remove",tile:e,metrics:t})}deleteStyleLayers(e){for(const t of this._indexMapByTile.values())for(const s of e){const e=t.get(s);e&&(this._removeSymbols(s,e.getSymbols()),t.delete(s))}this._invalidate()}querySymbols(){const e=[];for(const[t,s]of this._uniqueSymbolsByStyleLayerId.entries())for(const i of s){const s=i.tileSymbols.find(e=>e.selectedForRendering);s&&e.push({vtlSymbol:s,styleLayerUID:t,tileKey:s.tile.key})}return e}_ensureIndexMap(e){let t=this._indexMapByTile.get(e);return t||(t=new Map,this._indexMapByTile.set(e,t)),t}_invalidate(){this._uniqueSymbolLayerArray=null}_addSymbols(e,t,s){for(const[i,o]of s){let e=t.get(i);e?e.addSymbols(o):(e=l.fromSymbols(o,this.tileCoordRange),t.set(i,e))}this._updateUniqueSymbols(e,s)}_removeTile(e){const t=this._indexMapByTile.get(e);if(t){for(const[e,s]of t.entries())this._removeSymbols(e,s.getSymbols());this._indexMapByTile.delete(e),this._invalidate()}}_removeSymbols(e,t){for(const s of t){const t=s.uniqueSymbol;if(t){if(t.tileSymbols=t.tileSymbols.filter(e=>e!==s),0===t.tileSymbols.length){const s=this._uniqueSymbolsByStyleLayerId.get(e);s.delete(t),0===s.size&&this._uniqueSymbolsByStyleLayerId.delete(e)}s.uniqueSymbol=null}}}_updateUniqueSymbols(t,s){if(0!==s.size){for(const e of this._visibleTiles)e.parentTile||e.key.world!==t.world||e.key.level===t.level&&!e.key.equals(t)||this._matchSymbols(e,t,s);for(const[t,i]of s)for(const s of i)if(!s.uniqueSymbol){s.uniqueSymbol=new e(s);let i=this._uniqueSymbolsByStyleLayerId.get(t);i||(i=new Set,this._uniqueSymbolsByStyleLayerId.set(t,i)),i.add(s.uniqueSymbol)}}}_matchSymbols(e,i,l){if(e.key.level>i.level){const t=e.key.level-i.level;if(e.key.row>>t!==i.row||e.key.col>>t!==i.col)return}if(i.level>e.key.level){const t=i.level-e.key.level;if(i.row>>t!==e.key.row||i.col>>t!==e.key.col)return}const o=new Map;for(const[r,n]of l){const l=[],a=Math.abs(e.key.level-i.level),u=e.key.level<i.level?1:1<<a,h=this._indexMapByTile.get(e),c=h?.get(r);if(c)for(const o of n){if(o.uniqueSymbol)continue;const r=t(this.tileCoordRange,o.xTile,i,e.key),n=s(this.tileCoordRange,o.yTile,i,e.key),a=-y,h=this.tileCoordRange+y;if(!(r>=a&&r<h&&n>=a&&n<h)){l.push(o);continue}const m=c.getCandidate(r,n,o.hash,u),f=m?.uniqueSymbol;f?(o.uniqueSymbol=f,f.tileSymbols.push(o)):l.push(o)}l.length>0&&o.set(r,l)}for(const t of e.childrenTiles||[])this._matchSymbols(t,i,o)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsByStyleLayerId,t=new Array(e.size);let s,i=0;for(const[l,o]of e){const e=new Array(o.size);s=0;for(const t of o)e[s++]=t;t[i]={styleLayerUID:l,uniqueSymbols:e},i++}return t}}function u(e){const t=new Map;for(const s of e){const e=s.labelClassId;let i=t.get(e);i||(i=[],t.set(e,i)),i.push(s)}return t}export{a as SymbolRepository};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isCircleOverlapingRect as t}from"../GeometryUtils.js";import{VTLSymbol as e}from"./core.js";function o(t,e,o,l){return s(t,e,o.level,o.col,l.key.level,l.key.col)}function l(t,e,o,l){return s(t,e,o.level,o.row,l.level,l.row)}function s(t,e,o,l,s,r){const i=o-s;if(i>=0)return(e>>i)+(l-(r<<i))*(t>>i);const n=-i;return e-(r-(l<<n))*(t>>n)<<n}class r{constructor(t,e,o){this._rows=Math.ceil(e/o),this._columns=Math.ceil(t/o),this._cellSize=o,this.cells=new Array(this._rows);for(let l=0;l<this._rows;l++){this.cells[l]=new Array(this._columns);for(let t=0;t<this._columns;t++)this.cells[l][t]=[]}}getCell(t,e){const o=Math.min(Math.max(Math.floor(e/this._cellSize),0),this._rows-1),l=Math.min(Math.max(Math.floor(t/this._cellSize),0),this._columns-1);return this.cells[o]&&this.cells[o][l]||null}getCellSpan(t,e,o,l){return[Math.min(Math.max(Math.floor(t/this._cellSize),0),this.columns-1),Math.min(Math.max(Math.floor(e/this._cellSize),0),this.rows-1),Math.min(Math.max(Math.floor(o/this._cellSize),0),this.columns-1),Math.min(Math.max(Math.floor(l/this._cellSize),0),this.rows-1)]}get cellSize(){return this._cellSize}get columns(){return this._columns}get rows(){return this._rows}}function i(t,o,l,s,r,i,n){const c=o[s++];for(let a=0;a<c;a++){const c=new e(i,n);c.xTile=o[s++],c.yTile=o[s++],c.hash=o[s++],c.priority=o[s++],c.featureIndex=o[s++];const a=o[s++],h=c.colliders();for(let t=0;t<a;t++){const t=o[s++],e=o[s++],r=o[s++],i=o[s++],n=!!o[s++],c=o[s++],a=l[s++],u=l[s++],f=o[s++],m=o[s++];h.push({xTile:t,yTile:e,dxPixels:r,dyPixels:i,hard:n,partIndex:c,width:f,height:m,minLod:a,maxLod:u})}const u=t[s++];for(let e=0;e<u;e++)c.textVertexRanges.push([t[s++],t[s++]]);const f=t[s++];for(let e=0;e<f;e++)c.iconVertexRanges.push([t[s++],t[s++]]);r.push(c)}return s}function n(t,e,o){for(const[l,s]of t.symbols)c(t,e,o,s,l)}function c(t,e,o,l,s){const r=t.layerData.get(s);if(3===r.type){for(const e of l){const l=e.uniqueSymbol;let s;if(e.selectedForRendering){const e=l.parts[0],r=e.startOpacity,i=e.targetOpacity;t.allSymbolsFadingOut=t.allSymbolsFadingOut&&0===i;const n=o?Math.floor(127*r)|i<<7:i?255:0;s=n<<24|n<<16|n<<8|n}else s=0;for(const[t,o]of e.iconVertexRanges)for(let e=t;e<t+o;e+=4)r.iconOpacity[e/4]=s;if(e.selectedForRendering){const e=l.parts[1],r=e.startOpacity,i=e.targetOpacity;t.allSymbolsFadingOut=t.allSymbolsFadingOut&&0===i;const n=o?Math.floor(127*r)|i<<7:i?255:0;s=n<<24|n<<16|n<<8|n}else s=0;for(const[t,o]of e.textVertexRanges)for(let e=t;e<t+o;e+=4)r.textOpacity[e/4]=s}r.lastOpacityUpdate=e,r.opacityChanged=!0}}function a(e,o,l,s){const r=e.colliders();let i,n,c,a;for(const h of r){if(e.uniqueSymbol?.show&&e.uniqueSymbol.parts[h.partIndex].show&&(i=h.xScreen-s[0]+h.dxScreen,n=h.yScreen-s[1]+h.dyScreen,c=i+h.width,a=n+h.height,t(l,o.x,o.y,i,n,c,a)))return!0}return!1}export{r as GridIndex,i as deserializeSymbols,a as isSearchCircleOverlapingSymbol,o as tileCoordChangeX,l as tileCoordChangeY,n as writeOpacityToBuffers};
2
+ import{isClosedPath as t,targetIntersectsPolygon as e}from"../../../../../geometry/support/intersectsBase.js";import{isCircleOverlappingRect as o}from"../GeometryUtils.js";import{VTLSymbol as s}from"./core.js";function r(t,e,o,s){return n(t,e,o.level,o.col,s.key.level,s.key.col)}function l(t,e,o,s){return n(t,e,o.level,o.row,s.level,s.row)}function n(t,e,o,s,r,l){const n=o-r;if(n>=0)return(e>>n)+(s-(l<<n))*(t>>n);const i=-n;return e-(l-(s<<i))*(t>>i)<<i}class i{constructor(t,e,o){this._rows=Math.ceil(e/o),this._columns=Math.ceil(t/o),this._cellSize=o,this.cells=new Array(this._rows);for(let s=0;s<this._rows;s++){this.cells[s]=new Array(this._columns);for(let t=0;t<this._columns;t++)this.cells[s][t]=[]}}getCell(t,e){const o=Math.min(Math.max(Math.floor(e/this._cellSize),0),this._rows-1),s=Math.min(Math.max(Math.floor(t/this._cellSize),0),this._columns-1);return this.cells[o]&&this.cells[o][s]||null}getCellSpan(t,e,o,s){return[Math.min(Math.max(Math.floor(t/this._cellSize),0),this.columns-1),Math.min(Math.max(Math.floor(e/this._cellSize),0),this.rows-1),Math.min(Math.max(Math.floor(o/this._cellSize),0),this.columns-1),Math.min(Math.max(Math.floor(s/this._cellSize),0),this.rows-1)]}get cellSize(){return this._cellSize}get columns(){return this._columns}get rows(){return this._rows}}function c(t,e,o,r,l,n,i){const c=e[r++];for(let a=0;a<c;a++){const c=new s(n,i);c.xTile=e[r++],c.yTile=e[r++],c.hash=e[r++],c.priority=e[r++],c.featureIndex=e[r++];const a=e[r++],h=c.colliders();for(let t=0;t<a;t++){const t=e[r++],s=e[r++],l=e[r++],n=e[r++],i=!!e[r++],c=e[r++],a=o[r++],u=o[r++],f=e[r++],m=e[r++];h.push({xTile:t,yTile:s,dxPixels:l,dyPixels:n,hard:i,partIndex:c,width:f,height:m,minLod:a,maxLod:u})}const u=t[r++];for(let e=0;e<u;e++)c.textVertexRanges.push([t[r++],t[r++]]);const f=t[r++];for(let e=0;e<f;e++)c.iconVertexRanges.push([t[r++],t[r++]]);l.push(c)}return r}function a(t,e,o){for(const[s,r]of t.symbols)h(t,e,o,r,s)}function h(t,e,o,s,r){const l=t.layerData.get(r);if(3===l.type){for(const e of s){const s=e.uniqueSymbol;let r;if(e.selectedForRendering){const e=s.parts[0],l=e.startOpacity,n=e.targetOpacity;t.allSymbolsFadingOut=t.allSymbolsFadingOut&&0===n;const i=o?Math.floor(127*l)|n<<7:n?255:0;r=i<<24|i<<16|i<<8|i}else r=0;for(const[t,o]of e.iconVertexRanges)for(let e=t;e<t+o;e+=4)l.iconOpacity[e/4]=r;if(e.selectedForRendering){const e=s.parts[1],l=e.startOpacity,n=e.targetOpacity;t.allSymbolsFadingOut=t.allSymbolsFadingOut&&0===n;const i=o?Math.floor(127*l)|n<<7:n?255:0;r=i<<24|i<<16|i<<8|i}else r=0;for(const[t,o]of e.textVertexRanges)for(let e=t;e<t+o;e+=4)l.textOpacity[e/4]=r}l.lastOpacityUpdate=e,l.opacityChanged=!0}}function u(t,e,s,r){const l=t.colliders();let n,i,c,a;for(const h of l){if(t.uniqueSymbol?.show&&t.uniqueSymbol.parts[h.partIndex].show&&(n=h.xScreen-r[0]+h.dxScreen,i=h.yScreen-r[1]+h.dyScreen,c=n+h.width,a=i+h.height,o(s,e.x,e.y,n,i,c,a)))return!0}return!1}function f(o,s,r){const l=o.colliders();let n,i,c,a;for(const h of l){if(!(o.uniqueSymbol?.show&&o.uniqueSymbol.parts[h.partIndex].show))continue;n=h.xScreen-r[0]+h.dxScreen,i=h.yScreen-r[1]+h.dyScreen,c=n+h.width,a=i+h.height;const l=[[[n,i],[c,i],[c,a],[n,a],[n,i]]];let u=s.map(t=>[t.x,t.y]);if(t(u)&&(u=[...u,u[0]]),e(u,l))return!0}return!1}export{i as GridIndex,c as deserializeSymbols,u as isSearchCircleOverlappingSymbol,f as isSearchPolygonOverlappingSymbol,r as tileCoordChangeX,l as tileCoordChangeY,a as writeOpacityToBuffers};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fromValues as t}from"../../../../../geometry/support/aaBoundingRect.js";import{tilePixelRatio as i}from"../constants.js";import{translateAnchor as e,offsetLine as a,distanceFromToPolylineWithinThreshold as o,pointInPolygon as r}from"../GeometryUtils.js";import{VTLBackgroundMaterial as n}from"../shaders/VTLBackgroundMaterial.js";import{VTLCircleMaterial as s}from"../shaders/VTLCircleMaterial.js";import{VTLFillMaterial as l,VTLOutlineMaterial as h}from"../shaders/VTLFillMaterial.js";import{VTLLineMaterial as u}from"../shaders/VTLLineMaterial.js";import{VTLIconMaterial as p,VTLTextMaterial as c}from"../shaders/VTLSymbolMaterial.js";import g from"./Filter.js";import{StyleDefinition as y}from"./StyleDefinition.js";import P from"./StyleProperty.js";import{thinLineHalfWidthThreshold as f}from"../../webgl/definitions.js";class D{constructor(t,i,e,a,o,r){this.layer=t,this.feature=i,this.bounds=e,this.normalizationRatio=a,this.normalizationOffsetX=o,this.normalizationOffsetY=r}}class m{constructor(t,i,e,a,o=null){switch(this.type=t,this.typeName=i.type,this.id=i.id,this.source=i.source,this.sourceLayer=i["source-layer"]??i.source,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,this.filter=i.filter,this.layout=i.layout,this.paint=i.paint,this.z=e,this.uid=a,this.sourceType=o,t){case 0:this._layoutDefinition=y.backgroundLayoutDefinition,this._paintDefinition=y.backgroundPaintDefinition;break;case 1:this._layoutDefinition=y.fillLayoutDefinition,this._paintDefinition=y.fillPaintDefinition;break;case 2:this._layoutDefinition=y.lineLayoutDefinition,this._paintDefinition=y.linePaintDefinition;break;case 3:this._layoutDefinition=y.symbolLayoutDefinition,this._paintDefinition=y.symbolPaintDefinition;break;case 4:this._layoutDefinition=y.circleLayoutDefinition,this._paintDefinition=y.circlePaintDefinition}this._layoutProperties=this._parseLayout(this.layout),this._paintProperties=this._parsePaint(this.paint)}getFeatureFilter(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=g.createFilter(this.filter)}getLayoutProperty(t){return this._layoutProperties[t]}getPaintProperty(t){return this._paintProperties[t]}getLayoutValue(t,i,e){let a;const o=this._layoutProperties[t];return o&&(a=o.getValue(i,e)),void 0===a&&(a=this._layoutDefinition[t].default),a}getPaintValue(t,i,e){let a;const o=this._paintProperties[t];return o&&(a=o.getValue(i,e)),void 0===a&&(a=this._paintDefinition[t].default),a}isPainterDataDriven(){const t=this._paintProperties;if(t)for(const i in t)if(t[i].isDataDriven)return!0;return!1}isIntersectingFeature(t,i,e,a,o,r,n,s){return!1}getFeatureInflatedBounds(t,i,e,a){return null}_parseLayout(t){const i={};for(const e in t){const a=this._layoutDefinition[e];a&&(i[e]=new P(a,t[e]))}return i}_parsePaint(t){const i={};for(const e in t){const a=this._paintDefinition[e];a&&(i[e]=new P(a,t[e]))}return i}computeAttributesKey(t,i,e,a){let o=0,r=0;for(const n of i){let t=3;if(n&&n!==a){const i=e[n],{isLayout:a,isOptional:o}=i,r=a?this.getLayoutProperty(n):this.getPaintProperty(n);t=r?.interpolator?2:r?.isDataDriven?1:o&&!r?3:0}r|=t<<o,o+=2}return r<<3|t}}class d extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.backgroundMaterial=new n(this.computeAttributesKey(0,n.ATTRIBUTES,n.ATTRIBUTES_INFO))}}class _ extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o);const r=this.getPaintProperty("fill-color"),n=this.getPaintProperty("fill-opacity"),s=this.getPaintProperty("fill-pattern");this.hasDataDrivenColor=r?.isDataDriven,this.hasDataDrivenOpacity=n?.isDataDriven,this.hasDataDrivenFill=this.hasDataDrivenColor||this.hasDataDrivenOpacity||s?.isDataDriven;const u=this.getPaintProperty("fill-outline-color");this.outlineUsesFillColor=!u,this.hasDataDrivenOutlineColor=u?.isDataDriven,this.hasDataDrivenOutline=u?u.isDataDriven:!!r&&r.isDataDriven,this.hasDataDrivenOutline=(u?this.hasDataDrivenOutlineColor:this.hasDataDrivenColor)||this.hasDataDrivenOpacity,this.fillMaterial=new l(this.computeAttributesKey(1,l.ATTRIBUTES,l.ATTRIBUTES_INFO)),this.outlineMaterial=new h(this.computeAttributesKey(2,this.outlineUsesFillColor?h.ATTRIBUTES_FILL:h.ATTRIBUTES_OUTLINE,this.outlineUsesFillColor?h.ATTRIBUTES_INFO_FILL:h.ATTRIBUTES_INFO_OUTLINE),this.outlineUsesFillColor)}getFeatureInflatedBounds(t,i,e,a){const o=z(t);if(!o)return null;const r=this.getPaintValue("fill-translate",i,t),n=a*Math.max(r[0],r[1]);return o[0]-=n,o[2]-=n,o[1]+=n,o[3]+=n,o}isIntersectingFeature(t,a,n,s,l,h,u,p){const c=s.getGeometry();if(!c)return!1;const g=i/p.normalizationRatio,y=g/u;t=t/p.normalizationRatio+p.normalizationOffsetX,a=a/p.normalizationRatio+p.normalizationOffsetY;const P=e(this.getPaintValue("fill-translate",l,s),this.getPaintValue("fill-translate-anchor",l,s),h,y);t-=g*P.x,a-=g*P.y;return!!r(t,a,c)||o(t,a,c,n)}}class L extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o);const r=this.getPaintProperty("line-pattern");if(this.lineMaterial=new u(this.computeAttributesKey(3,u.ATTRIBUTES,u.ATTRIBUTES_INFO,r?"line-dasharray":"")),this.hasDataDrivenLine=this.getPaintProperty("line-blur")?.isDataDriven||this.getPaintProperty("line-color")?.isDataDriven||this.getPaintProperty("line-gap-width")?.isDataDriven||this.getPaintProperty("line-offset")?.isDataDriven||this.getPaintProperty("line-opacity")?.isDataDriven||this.getPaintProperty("line-pattern")?.isDataDriven||this.getPaintProperty("line-dasharray")?.isDataDriven||this.getLayoutProperty("line-cap")?.isDataDriven||this.getPaintProperty("line-width")?.isDataDriven,this.canUseThinTessellation=!1,!this.hasDataDrivenLine){const t=this.getPaintProperty("line-width");if(!t||"number"==typeof t&&.5*t<f){const t=this.getPaintProperty("line-offset");(!t||"number"==typeof t&&0===t)&&(this.canUseThinTessellation=!0)}}}getDashKey(t,i){let e;switch(i){case 0:default:e="Butt";break;case 1:e="Round";break;case 2:e="Square"}return`dasharray-[${t.toString()}]-${e}`}getFeatureInflatedBounds(t,i,e,a){const o=z(t);if(!o)return null;const r=this.getPaintValue("line-translate",i,t),n=a*Math.max(r[0],r[1]);o[0]-=n,o[2]-=n,o[1]+=n,o[3]+=n;const s=a*Math.abs(this.getPaintValue("line-offset",i,t)||0),l=a*(this.getPaintValue("line-width",i,t)/2);return o[0]-=s+l,o[1]-=s+l,o[2]+=s+l,o[3]+=s+l,o}isIntersectingFeature(t,r,n,s,l,h,u,p){let c=s.getGeometry();if(!c)return!1;const g=i/p.normalizationRatio,y=g/u;t=t/p.normalizationRatio+p.normalizationOffsetX,r=r/p.normalizationRatio+p.normalizationOffsetY;const P=e(this.getPaintValue("line-translate",l,s),this.getPaintValue("line-translate-anchor",l,s),h,y);t-=g*P.x,r-=g*P.y;const f=y*this.getPaintValue("line-offset",l,s)||0;0!==f&&(c=a(c,-f));const D=this.getPaintValue("line-width",l,s);return o(t,r,c,y*(D/2)+n)}}class v extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.iconMaterial=new p(this.computeAttributesKey(4,p.ATTRIBUTES,p.ATTRIBUTES_INFO)),this.textMaterial=new c(this.computeAttributesKey(6,c.ATTRIBUTES,c.ATTRIBUTES_INFO)),this.hasDataDrivenIcon=this.getPaintProperty("icon-color")?.isDataDriven||this.getPaintProperty("icon-halo-blur")?.isDataDriven||this.getPaintProperty("icon-halo-color")?.isDataDriven||this.getPaintProperty("icon-halo-width")?.isDataDriven||this.getPaintProperty("icon-opacity")?.isDataDriven||this.getLayoutProperty("icon-size")?.isDataDriven,this.hasDataDrivenText=this.getPaintProperty("text-color")?.isDataDriven||this.getPaintProperty("text-halo-blur")?.isDataDriven||this.getPaintProperty("text-halo-color")?.isDataDriven||this.getPaintProperty("text-halo-width")?.isDataDriven||this.getPaintProperty("text-opacity")?.isDataDriven||this.getLayoutProperty("text-size")?.isDataDriven}}class x extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.circleMaterial=new s(this.computeAttributesKey(5,s.ATTRIBUTES,s.ATTRIBUTES_INFO))}getFeatureInflatedBounds(t,e,a,o){const r=z(t);if(!r)return null;const n=this.getPaintValue("circle-translate",e,t),s=Math.max(n[0],n[1]);r[0]-=s,r[2]-=s,r[1]+=s,r[3]+=s;const l=o*(i*(this.getPaintValue("circle-radius",e,t)+this.getPaintValue("circle-stroke-width",e,t))/2);return r[0]-=l,r[1]-=l,r[2]+=l,r[3]+=l,r}isIntersectingFeature(t,a,o,r,n,s,l,h){const u=r.getGeometry();if(!u)return!1;const p=i/h.normalizationRatio/l;t=t/h.normalizationRatio+h.normalizationOffsetX,a=a/h.normalizationRatio+h.normalizationOffsetY;const c=e(this.getPaintValue("circle-translate",n,r),this.getPaintValue("circle-translate-anchor",n,r),s,p),g=p*(this.getPaintValue("circle-radius",n,r)+this.getPaintValue("circle-stroke-width",n,r));let y,P;for(const i of u)if(i)for(const e of i){y=e.x+c.x,P=e.y+c.y;if(Math.sqrt((t-y)*(t-y)+(a-P)*(a-P))-o<=g)return!0}return!1}}class V{constructor(t,i,e){let a;this.allowOverlap=t.getLayoutValue("icon-allow-overlap",i),this.ignorePlacement=t.getLayoutValue("icon-ignore-placement",i),this.keepUpright=t.getLayoutValue("icon-keep-upright",i),this.optional=t.getLayoutValue("icon-optional",i),this.rotationAlignment=t.getLayoutValue("icon-rotation-alignment",i),2===this.rotationAlignment&&(this.rotationAlignment=e?0:1),a=t.getLayoutProperty("icon-anchor"),a?.isDataDriven?this._anchorProp=a:this.anchor=t.getLayoutValue("icon-anchor",i),a=t.getLayoutProperty("icon-offset"),a?.isDataDriven?this._offsetProp=a:this.offset=t.getLayoutValue("icon-offset",i),a=t.getLayoutProperty("icon-padding"),a?.isDataDriven?this._paddingProp=a:this.padding=t.getLayoutValue("icon-padding",i),a=t.getLayoutProperty("icon-rotate"),a?.isDataDriven?this._rotateProp=a:this.rotate=t.getLayoutValue("icon-rotate",i),a=t.getLayoutProperty("icon-size"),a?.isDataDriven?this._sizeProp=a:this.size=t.getLayoutValue("icon-size",i)}update(t,i){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,i)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,i)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,i)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,i)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,i))}}class T{constructor(t,i,e){let a;this.allowOverlap=t.getLayoutValue("text-allow-overlap",i),this.ignorePlacement=t.getLayoutValue("text-ignore-placement",i),this.keepUpright=t.getLayoutValue("text-keep-upright",i),this.optional=t.getLayoutValue("text-optional",i),this.rotationAlignment=t.getLayoutValue("text-rotation-alignment",i),2===this.rotationAlignment&&(this.rotationAlignment=e?0:1),a=t.getLayoutProperty("text-anchor"),a?.isDataDriven?this._anchorProp=a:this.anchor=t.getLayoutValue("text-anchor",i),a=t.getLayoutProperty("text-justify"),a?.isDataDriven?this._justifyProp=a:this.justify=t.getLayoutValue("text-justify",i),a=t.getLayoutProperty("text-letter-spacing"),a?.isDataDriven?this._letterSpacingProp=a:this.letterSpacing=t.getLayoutValue("text-letter-spacing",i),a=t.getLayoutProperty("text-line-height"),a?.isDataDriven?this._lineHeightProp=a:this.lineHeight=t.getLayoutValue("text-line-height",i),a=t.getLayoutProperty("text-max-angle"),a?.isDataDriven?this._maxAngleProp=a:this.maxAngle=t.getLayoutValue("text-max-angle",i),a=t.getLayoutProperty("text-max-width"),a?.isDataDriven?this._maxWidthProp=a:this.maxWidth=t.getLayoutValue("text-max-width",i),a=t.getLayoutProperty("text-offset"),a?.isDataDriven?this._offsetProp=a:this.offset=t.getLayoutValue("text-offset",i),a=t.getLayoutProperty("text-padding"),a?.isDataDriven?this._paddingProp=a:this.padding=t.getLayoutValue("text-padding",i),a=t.getLayoutProperty("text-rotate"),a?.isDataDriven?this._rotateProp=a:this.rotate=t.getLayoutValue("text-rotate",i),a=t.getLayoutProperty("text-size"),a?.isDataDriven?this._sizeProp=a:this.size=t.getLayoutValue("text-size",i),a=t.getLayoutProperty("text-writing-mode"),a?.isDataDriven?this._writingModeProp=a:this.writingMode=t.getLayoutValue("text-writing-mode",i)}update(t,i){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,i)),this._justifyProp&&(this.justify=this._justifyProp.getValue(t,i)),this._letterSpacingProp&&(this.letterSpacing=this._letterSpacingProp.getValue(t,i)),this._lineHeightProp&&(this.lineHeight=this._lineHeightProp.getValue(t,i)),this._maxAngleProp&&(this.maxAngle=this._maxAngleProp.getValue(t,i)),this._maxWidthProp&&(this.maxWidth=this._maxWidthProp.getValue(t,i)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,i)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,i)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,i)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,i)),this._writingModeProp&&(this.writingMode=this._writingModeProp.getValue(t,i))}}function z(i){const e=i?.getGeometry();if(null==e)return null;let a=1/0,o=1/0,r=-1/0,n=-1/0;for(const t of e)if(t)for(const i of t)a=Math.min(a,i.x),o=Math.min(o,i.y),r=Math.max(r,i.x),n=Math.max(n,i.y);return t(a,o,r,n)}export{d as BackgroundStyleLayer,x as CircleStyleLayer,_ as FillStyleLayer,V as IconLayout,D as IndexItem,L as LineStyleLayer,m as StyleLayer,v as SymbolStyleLayer,T as TextLayout};
2
+ import{fromValues as t}from"../../../../../geometry/support/aaBoundingRect.js";import{targetIntersectsPolygon as i,nearLine as e,pointInPolygon as a}from"../../../../../geometry/support/intersectsBase.js";import{tilePixelRatio as o}from"../constants.js";import{translateAnchor as r,offsetLine as n}from"../GeometryUtils.js";import{VTLBackgroundMaterial as s}from"../shaders/VTLBackgroundMaterial.js";import{VTLCircleMaterial as l}from"../shaders/VTLCircleMaterial.js";import{VTLFillMaterial as h,VTLOutlineMaterial as u}from"../shaders/VTLFillMaterial.js";import{VTLLineMaterial as p}from"../shaders/VTLLineMaterial.js";import{VTLIconMaterial as c,VTLTextMaterial as g}from"../shaders/VTLSymbolMaterial.js";import f from"./Filter.js";import{StyleDefinition as y}from"./StyleDefinition.js";import P from"./StyleProperty.js";import{thinLineHalfWidthThreshold as D}from"../../webgl/definitions.js";class m{constructor(t,i,e,a,o,r){this.layer=t,this.feature=i,this.bounds=e,this.normalizationRatio=a,this.normalizationOffsetX=o,this.normalizationOffsetY=r}}class d{constructor(t,i,e,a,o=null){switch(this.type=t,this.typeName=i.type,this.id=i.id,this.source=i.source,this.sourceLayer=i["source-layer"]??i.source,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,this.filter=i.filter,this.layout=i.layout,this.paint=i.paint,this.z=e,this.uid=a,this.sourceType=o,t){case 0:this._layoutDefinition=y.backgroundLayoutDefinition,this._paintDefinition=y.backgroundPaintDefinition;break;case 1:this._layoutDefinition=y.fillLayoutDefinition,this._paintDefinition=y.fillPaintDefinition;break;case 2:this._layoutDefinition=y.lineLayoutDefinition,this._paintDefinition=y.linePaintDefinition;break;case 3:this._layoutDefinition=y.symbolLayoutDefinition,this._paintDefinition=y.symbolPaintDefinition;break;case 4:this._layoutDefinition=y.circleLayoutDefinition,this._paintDefinition=y.circlePaintDefinition}this._layoutProperties=this._parseLayout(this.layout),this._paintProperties=this._parsePaint(this.paint)}getFeatureFilter(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=f.createFilter(this.filter)}getLayoutProperty(t){return this._layoutProperties[t]}getPaintProperty(t){return this._paintProperties[t]}getLayoutValue(t,i,e){let a;const o=this._layoutProperties[t];return o&&(a=o.getValue(i,e)),void 0===a&&(a=this._layoutDefinition[t].default),a}getPaintValue(t,i,e){let a;const o=this._paintProperties[t];return o&&(a=o.getValue(i,e)),void 0===a&&(a=this._paintDefinition[t].default),a}isPainterDataDriven(){const t=this._paintProperties;if(t)for(const i in t)if(t[i].isDataDriven)return!0;return!1}isIntersectingFeature(t,i,e,a,o,r,n,s){return!1}getFeatureInflatedBounds(t,i,e,a){return null}_parseLayout(t){const i={};for(const e in t){const a=this._layoutDefinition[e];a&&(i[e]=new P(a,t[e]))}return i}_parsePaint(t){const i={};for(const e in t){const a=this._paintDefinition[e];a&&(i[e]=new P(a,t[e]))}return i}computeAttributesKey(t,i,e,a){let o=0,r=0;for(const n of i){let t=3;if(n&&n!==a){const i=e[n],{isLayout:a,isOptional:o}=i,r=a?this.getLayoutProperty(n):this.getPaintProperty(n);t=r?.interpolator?2:r?.isDataDriven?1:o&&!r?3:0}r|=t<<o,o+=2}return r<<3|t}}class _ extends d{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.backgroundMaterial=new s(this.computeAttributesKey(0,s.ATTRIBUTES,s.ATTRIBUTES_INFO))}}class x extends d{constructor(t,i,e,a,o=null){super(t,i,e,a,o);const r=this.getPaintProperty("fill-color"),n=this.getPaintProperty("fill-opacity"),s=this.getPaintProperty("fill-pattern");this.hasDataDrivenColor=r?.isDataDriven,this.hasDataDrivenOpacity=n?.isDataDriven,this.hasDataDrivenFill=this.hasDataDrivenColor||this.hasDataDrivenOpacity||s?.isDataDriven;const l=this.getPaintProperty("fill-outline-color");this.outlineUsesFillColor=!l,this.hasDataDrivenOutlineColor=l?.isDataDriven,this.hasDataDrivenOutline=l?l.isDataDriven:!!r&&r.isDataDriven,this.hasDataDrivenOutline=(l?this.hasDataDrivenOutlineColor:this.hasDataDrivenColor)||this.hasDataDrivenOpacity,this.fillMaterial=new h(this.computeAttributesKey(1,h.ATTRIBUTES,h.ATTRIBUTES_INFO)),this.outlineMaterial=new u(this.computeAttributesKey(2,this.outlineUsesFillColor?u.ATTRIBUTES_FILL:u.ATTRIBUTES_OUTLINE,this.outlineUsesFillColor?u.ATTRIBUTES_INFO_FILL:u.ATTRIBUTES_INFO_OUTLINE),this.outlineUsesFillColor)}getFeatureInflatedBounds(t,i,e,a){const o=I(t);if(!o)return null;const r=this.getPaintValue("fill-translate",i,t),n=a*Math.max(r[0],r[1]);return o[0]-=n,o[2]-=n,o[1]+=n,o[3]+=n,o}isIntersectingFeature(t,n,s,l,h,u,p,c){const g=s.getGeometry();if(!g)return!1;const f=[...g.map(t=>t.map(t=>[t.x,t.y]))],y=o/p.normalizationRatio,P=y/u,D=r(this.getPaintValue("fill-translate",l,s),this.getPaintValue("fill-translate-anchor",l,s),h,P);if("point"===c){let[i,o]=t[0];i=i/p.normalizationRatio+p.normalizationOffsetX,o=o/p.normalizationRatio+p.normalizationOffsetY,i-=y*D.x,o-=y*D.y;return!!a([i,o],f)||e([i,o],f,n)}const m=[];for(const i of t){let[t,e]=i;t=t/p.normalizationRatio+p.normalizationOffsetX,e=e/p.normalizationRatio+p.normalizationOffsetY,t-=y*D.x,e-=y*D.y,m.push([t,e])}return i(m,f)}}class L extends d{constructor(t,i,e,a,o=null){super(t,i,e,a,o);const r=this.getPaintProperty("line-pattern");if(this.lineMaterial=new p(this.computeAttributesKey(3,p.ATTRIBUTES,p.ATTRIBUTES_INFO,r?"line-dasharray":"")),this.hasDataDrivenLine=this.getPaintProperty("line-blur")?.isDataDriven||this.getPaintProperty("line-color")?.isDataDriven||this.getPaintProperty("line-gap-width")?.isDataDriven||this.getPaintProperty("line-offset")?.isDataDriven||this.getPaintProperty("line-opacity")?.isDataDriven||this.getPaintProperty("line-pattern")?.isDataDriven||this.getPaintProperty("line-dasharray")?.isDataDriven||this.getLayoutProperty("line-cap")?.isDataDriven||this.getPaintProperty("line-width")?.isDataDriven,this.canUseThinTessellation=!1,!this.hasDataDrivenLine){const t=this.getPaintProperty("line-width");if(!t||"number"==typeof t&&.5*t<D){const t=this.getPaintProperty("line-offset");(!t||"number"==typeof t&&0===t)&&(this.canUseThinTessellation=!0)}}}getDashKey(t,i){let e;switch(i){case 0:default:e="Butt";break;case 1:e="Round";break;case 2:e="Square"}return`dasharray-[${t.toString()}]-${e}`}getFeatureInflatedBounds(t,i,e,a){const o=I(t);if(!o)return null;const r=this.getPaintValue("line-translate",i,t),n=a*Math.max(r[0],r[1]);o[0]-=n,o[2]-=n,o[1]+=n,o[3]+=n;const s=a*Math.abs(this.getPaintValue("line-offset",i,t)||0),l=a*(this.getPaintValue("line-width",i,t)/2);return o[0]-=s+l,o[1]-=s+l,o[2]+=s+l,o[3]+=s+l,o}isIntersectingFeature(t,a,s,l,h,u,p,c){let g=s.getGeometry();if(!g)return!1;const f=o/p.normalizationRatio,y=f/u,P=r(this.getPaintValue("line-translate",l,s),this.getPaintValue("line-translate-anchor",l,s),h,y);if("point"===c){let[i,o]=t[0];i=i/p.normalizationRatio+p.normalizationOffsetX,o=o/p.normalizationRatio+p.normalizationOffsetY,i-=f*P.x,o-=f*P.y;const r=y*(this.getPaintValue("line-width",l,s)/2)+a,n=[...g.map(t=>t.map(t=>[t.x,t.y]))];return e([i,o],n,r)}const D=[];for(const i of t){let[t,e]=i;t=t/p.normalizationRatio+p.normalizationOffsetX,e=e/p.normalizationRatio+p.normalizationOffsetY,t-=f*P.x,e-=f*P.y,D.push([t,e])}const m=y*this.getPaintValue("line-offset",l,s)||0;0!==m&&(g=n(g,-m));const d=[...g.map(t=>t.map(t=>[t.x,t.y]))];return i(D,d)}}class v extends d{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.iconMaterial=new c(this.computeAttributesKey(4,c.ATTRIBUTES,c.ATTRIBUTES_INFO)),this.textMaterial=new g(this.computeAttributesKey(6,g.ATTRIBUTES,g.ATTRIBUTES_INFO)),this.hasDataDrivenIcon=this.getPaintProperty("icon-color")?.isDataDriven||this.getPaintProperty("icon-halo-blur")?.isDataDriven||this.getPaintProperty("icon-halo-color")?.isDataDriven||this.getPaintProperty("icon-halo-width")?.isDataDriven||this.getPaintProperty("icon-opacity")?.isDataDriven||this.getLayoutProperty("icon-size")?.isDataDriven,this.hasDataDrivenText=this.getPaintProperty("text-color")?.isDataDriven||this.getPaintProperty("text-halo-blur")?.isDataDriven||this.getPaintProperty("text-halo-color")?.isDataDriven||this.getPaintProperty("text-halo-width")?.isDataDriven||this.getPaintProperty("text-opacity")?.isDataDriven||this.getLayoutProperty("text-size")?.isDataDriven}}class V extends d{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.circleMaterial=new l(this.computeAttributesKey(5,l.ATTRIBUTES,l.ATTRIBUTES_INFO))}getFeatureInflatedBounds(t,i,e,a){const r=I(t);if(!r)return null;const n=this.getPaintValue("circle-translate",i,t),s=Math.max(n[0],n[1]);r[0]-=s,r[2]-=s,r[1]+=s,r[3]+=s;const l=a*(o*(this.getPaintValue("circle-radius",i,t)+this.getPaintValue("circle-stroke-width",i,t))/2);return r[0]-=l,r[1]-=l,r[2]+=l,r[3]+=l,r}isIntersectingFeature(t,e,a,n,s,l,h,u){const p=a.getGeometry();if(!p)return!1;const c=o/h.normalizationRatio/l,g=r(this.getPaintValue("circle-translate",n,a),this.getPaintValue("circle-translate-anchor",n,a),s,c),f=o*(this.getPaintValue("circle-radius",n,a)+this.getPaintValue("circle-stroke-width",n,a));if("point"===u){let i,a,[o,r]=t[0];o=o/h.normalizationRatio+h.normalizationOffsetX,r=r/h.normalizationRatio+h.normalizationOffsetY;for(const t of p)if(t)for(const n of t){i=n.x+g.x,a=n.y+g.y;const t=Math.sqrt((o-i)*(o-i)+(r-a)*(r-a))-e;if(t<=0)return!0;if(t<=f)return!0}}const y=t.map(t=>{let[i,e]=t;return i=i/h.normalizationRatio+h.normalizationOffsetX,e=e/h.normalizationRatio+h.normalizationOffsetY,[i,e]});for(const o of p)if(o)for(const t of o){const e=t.x+g.x,a=t.y+g.y;if(i(y,[[[e-f,a-f],[e-f,a+f],[e+f,a+f],[e+f,a-f],[e-f,a-f]]]))return!0}return!1}}class T{constructor(t,i,e){let a;this.allowOverlap=t.getLayoutValue("icon-allow-overlap",i),this.ignorePlacement=t.getLayoutValue("icon-ignore-placement",i),this.keepUpright=t.getLayoutValue("icon-keep-upright",i),this.optional=t.getLayoutValue("icon-optional",i),this.rotationAlignment=t.getLayoutValue("icon-rotation-alignment",i),2===this.rotationAlignment&&(this.rotationAlignment=e?0:1),a=t.getLayoutProperty("icon-anchor"),a?.isDataDriven?this._anchorProp=a:this.anchor=t.getLayoutValue("icon-anchor",i),a=t.getLayoutProperty("icon-offset"),a?.isDataDriven?this._offsetProp=a:this.offset=t.getLayoutValue("icon-offset",i),a=t.getLayoutProperty("icon-padding"),a?.isDataDriven?this._paddingProp=a:this.padding=t.getLayoutValue("icon-padding",i),a=t.getLayoutProperty("icon-rotate"),a?.isDataDriven?this._rotateProp=a:this.rotate=t.getLayoutValue("icon-rotate",i),a=t.getLayoutProperty("icon-size"),a?.isDataDriven?this._sizeProp=a:this.size=t.getLayoutValue("icon-size",i)}update(t,i){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,i)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,i)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,i)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,i)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,i))}}class z{constructor(t,i,e){let a;this.allowOverlap=t.getLayoutValue("text-allow-overlap",i),this.ignorePlacement=t.getLayoutValue("text-ignore-placement",i),this.keepUpright=t.getLayoutValue("text-keep-upright",i),this.optional=t.getLayoutValue("text-optional",i),this.rotationAlignment=t.getLayoutValue("text-rotation-alignment",i),2===this.rotationAlignment&&(this.rotationAlignment=e?0:1),a=t.getLayoutProperty("text-anchor"),a?.isDataDriven?this._anchorProp=a:this.anchor=t.getLayoutValue("text-anchor",i),a=t.getLayoutProperty("text-justify"),a?.isDataDriven?this._justifyProp=a:this.justify=t.getLayoutValue("text-justify",i),a=t.getLayoutProperty("text-letter-spacing"),a?.isDataDriven?this._letterSpacingProp=a:this.letterSpacing=t.getLayoutValue("text-letter-spacing",i),a=t.getLayoutProperty("text-line-height"),a?.isDataDriven?this._lineHeightProp=a:this.lineHeight=t.getLayoutValue("text-line-height",i),a=t.getLayoutProperty("text-max-angle"),a?.isDataDriven?this._maxAngleProp=a:this.maxAngle=t.getLayoutValue("text-max-angle",i),a=t.getLayoutProperty("text-max-width"),a?.isDataDriven?this._maxWidthProp=a:this.maxWidth=t.getLayoutValue("text-max-width",i),a=t.getLayoutProperty("text-offset"),a?.isDataDriven?this._offsetProp=a:this.offset=t.getLayoutValue("text-offset",i),a=t.getLayoutProperty("text-padding"),a?.isDataDriven?this._paddingProp=a:this.padding=t.getLayoutValue("text-padding",i),a=t.getLayoutProperty("text-rotate"),a?.isDataDriven?this._rotateProp=a:this.rotate=t.getLayoutValue("text-rotate",i),a=t.getLayoutProperty("text-size"),a?.isDataDriven?this._sizeProp=a:this.size=t.getLayoutValue("text-size",i),a=t.getLayoutProperty("text-writing-mode"),a?.isDataDriven?this._writingModeProp=a:this.writingMode=t.getLayoutValue("text-writing-mode",i)}update(t,i){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,i)),this._justifyProp&&(this.justify=this._justifyProp.getValue(t,i)),this._letterSpacingProp&&(this.letterSpacing=this._letterSpacingProp.getValue(t,i)),this._lineHeightProp&&(this.lineHeight=this._lineHeightProp.getValue(t,i)),this._maxAngleProp&&(this.maxAngle=this._maxAngleProp.getValue(t,i)),this._maxWidthProp&&(this.maxWidth=this._maxWidthProp.getValue(t,i)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,i)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,i)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,i)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,i)),this._writingModeProp&&(this.writingMode=this._writingModeProp.getValue(t,i))}}function I(i){const e=i?.getGeometry();if(null==e)return null;let a=1/0,o=1/0,r=-1/0,n=-1/0;for(const t of e)if(t)for(const i of t)a=Math.min(a,i.x),o=Math.min(o,i.y),r=Math.max(r,i.x),n=Math.max(n,i.y);return t(a,o,r,n)}export{_ as BackgroundStyleLayer,V as CircleStyleLayer,x as FillStyleLayer,T as IconLayout,m as IndexItem,L as LineStyleLayer,d as StyleLayer,v as SymbolStyleLayer,z as TextLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";let r=null;function t(){return r??=Promise.all([import("./webglDeps.js"),import("./mapViewDeps.js")]),r}const a=()=>t().then(()=>import("./layers/TileLayerView2D.js")),i={"annotation-feature":()=>t().then(()=>import("./layers/AnnotationFeatureLayerView2D.js")),"base-dynamic":()=>t().then(()=>import("./layers/BaseDynamicLayerView2D.js")),"base-tile":a,"bing-maps":a,catalog:()=>t().then(()=>import("./layers/CatalogLayerView2D.js")),"catalog-dynamic-group":()=>t().then(()=>import("./layers/CatalogDynamicGroupLayerView2D.js")),"catalog-footprint":()=>t().then(()=>import("./layers/CatalogFootprintLayerView2D.js")),csv:()=>t().then(()=>import("./layers/CSVLayerView2D.js")),"geospatial-pdf":()=>t().then(()=>import("./layers/GeospatialPDFLayerView2D.js")),"geo-rss":()=>t().then(()=>import("./layers/GeoRSSLayerView2D.js")),feature:()=>t().then(()=>import("./layers/FeatureLayerView2D.js")),"dimension-feature":()=>t().then(()=>import("./layers/DimensionFeatureLayerView2D.js")),geojson:()=>t().then(()=>import("./layers/GeoJSONLayerView2D.js")),graphics:()=>t().then(()=>import("./layers/GraphicsLayerView2D.js")),group:()=>t().then(()=>import("./layers/GroupLayerView2D.js")),imagery:()=>t().then(()=>import("./layers/ImageryLayerView2D.js")),"imagery-tile":()=>t().then(()=>import("./layers/ImageryTileLayerView2D.js")),kml:()=>t().then(()=>import("./layers/KMLLayerView2D.js")),"knowledge-graph":()=>t().then(()=>import("./layers/KnowledgeGraphLayerView2D.js")),"link-chart":()=>t().then(()=>import("./layers/KnowledgeGraphLayerView2D.js")),"knowledge-graph-sublayer":()=>t().then(()=>import("./layers/KnowledgeGraphSublayerView2D.js")),"map-image":()=>t().then(()=>import("./layers/MapImageLayerView2D.js")),"map-notes":()=>t().then(()=>import("./layers/MapNotesLayerView2D.js")),media:()=>t().then(()=>import("./layers/MediaLayerView2D.js")),"ogc-feature":()=>t().then(()=>import("./layers/OGCFeatureLayerView2D.js")),"open-street-map":a,"oriented-imagery":()=>t().then(()=>import("./layers/OrientedImageryLayerView2D.js")),parquet:()=>t().then(()=>import("./layers/ParquetLayerView2D.js")),route:()=>t().then(()=>import("./layers/RouteLayerView2D.js")),stream:()=>t().then(()=>import("./layers/StreamLayerView2D.js")),"subtype-group":()=>t().then(()=>import("./layers/SubtypeGroupLayerView2D.js")),tile:a,"vector-tile":()=>t().then(()=>import("./layers/VectorTileLayerView2D.js")),video:()=>t().then(()=>import("./layers/VideoLayerView2D.js")),wcs:()=>t().then(()=>import("./layers/ImageryTileLayerView2D.js")),"web-tile":a,wfs:()=>t().then(()=>import("./layers/WFSLayerView2D.js")),wms:()=>t().then(()=>import("./layers/WMSLayerView2D.js")),wmts:()=>t().then(()=>import("./layers/WMTSLayerView2D.js")),"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"gaussian-splat":null,"integrated-mesh-3dtiles":null,"integrated-mesh":null,"line-of-sight":null,"point-cloud":null,scene:null,unknown:null,unsupported:null,viewshed:null,voxel:null};function s(r){const t=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",a=t.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${a}:view-not-supported`,`${t} is not supported in 2D`)}const l=new Map,n={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=l.get(e.type);if(r)return r;const t=i[e.type];if(null==t)throw s(e);const a=t(e);return l.set(e.type,a),a}};export{n as layerView2DImporter};
2
+ import e from"../../core/Error.js";let r=null;function a(){return r??=Promise.all([import("./webglDeps.js"),import("./mapViewDeps.js")]),r}const t=()=>a().then(()=>import("./layers/TileLayerView2D.js")),i={"annotation-feature":async()=>(await a(),await(import("./layers/FeatureLayerView2D.js")),import("./layers/AnnotationFeatureLayerView2D.js")),"base-dynamic":()=>a().then(()=>import("./layers/BaseDynamicLayerView2D.js")),"base-tile":t,"bing-maps":t,catalog:()=>a().then(()=>import("./layers/CatalogLayerView2D.js")),"catalog-dynamic-group":()=>a().then(()=>import("./layers/CatalogDynamicGroupLayerView2D.js")),"catalog-footprint":()=>a().then(()=>import("./layers/CatalogFootprintLayerView2D.js")),csv:()=>a().then(()=>import("./layers/CSVLayerView2D.js")),"geospatial-pdf":()=>a().then(()=>import("./layers/GeospatialPDFLayerView2D.js")),"geo-rss":()=>a().then(()=>import("./layers/GeoRSSLayerView2D.js")),feature:()=>a().then(()=>import("./layers/FeatureLayerView2D.js")),"dimension-feature":async()=>(await a(),await(import("./layers/FeatureLayerView2D.js")),import("./layers/DimensionFeatureLayerView2D.js")),geojson:()=>a().then(()=>import("./layers/GeoJSONLayerView2D.js")),graphics:()=>a().then(()=>import("./layers/GraphicsLayerView2D.js")),group:()=>a().then(()=>import("./layers/GroupLayerView2D.js")),imagery:()=>a().then(()=>import("./layers/ImageryLayerView2D.js")),"imagery-tile":()=>a().then(()=>import("./layers/ImageryTileLayerView2D.js")),kml:()=>a().then(()=>import("./layers/KMLLayerView2D.js")),"knowledge-graph":()=>a().then(()=>import("./layers/KnowledgeGraphLayerView2D.js")),"link-chart":()=>a().then(()=>import("./layers/KnowledgeGraphLayerView2D.js")),"knowledge-graph-sublayer":()=>a().then(()=>import("./layers/KnowledgeGraphSublayerView2D.js")),"map-image":()=>a().then(()=>import("./layers/MapImageLayerView2D.js")),"map-notes":()=>a().then(()=>import("./layers/MapNotesLayerView2D.js")),media:()=>a().then(()=>import("./layers/MediaLayerView2D.js")),"ogc-feature":()=>a().then(()=>import("./layers/OGCFeatureLayerView2D.js")),"open-street-map":t,"oriented-imagery":()=>a().then(()=>import("./layers/OrientedImageryLayerView2D.js")),parquet:()=>a().then(()=>import("./layers/ParquetLayerView2D.js")),route:()=>a().then(()=>import("./layers/RouteLayerView2D.js")),stream:()=>a().then(()=>import("./layers/StreamLayerView2D.js")),"subtype-group":()=>a().then(()=>import("./layers/SubtypeGroupLayerView2D.js")),tile:t,"vector-tile":()=>a().then(()=>import("./layers/VectorTileLayerView2D.js")),video:()=>a().then(()=>import("./layers/VideoLayerView2D.js")),wcs:()=>a().then(()=>import("./layers/ImageryTileLayerView2D.js")),"web-tile":t,wfs:()=>a().then(()=>import("./layers/WFSLayerView2D.js")),wms:()=>a().then(()=>import("./layers/WMSLayerView2D.js")),wmts:()=>a().then(()=>import("./layers/WMTSLayerView2D.js")),"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"gaussian-splat":null,"integrated-mesh-3dtiles":null,"integrated-mesh":null,"line-of-sight":null,"point-cloud":null,scene:null,unknown:null,unsupported:null,viewshed:null,voxel:null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",t=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${t}:view-not-supported`,`${a} is not supported in 2D`)}const l=new Map,n={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=l.get(e.type);if(r)return r;const a=i[e.type];if(null==a)throw s(e);const t=a(e);return l.set(e.type,t),t}};export{n as layerView2DImporter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{watch as s}from"../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import{LayerView2D as o}from"./LayerView2D.js";import h from"./imagery/ImageryTileView2D.js";import d from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as l}from"../../layers/RefreshableLayerView.js";let n=class extends(l(o(d))){constructor(){super(...arguments),this.subview=null}get displayParameters(){const{layer:e}=this,t=this._get("displayParameters");return e.renderer&&e.visible?{renderer:e.renderer,interpolation:e.interpolation,clipToNeatline:e.clippedToNeatline}:t}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage();const e=new h({layer:this.layer,layerView:this,scheduler:this.scheduler});e.useWebGLForProcessing=!0,e.useProgressiveUpdate=!0,this._attachSubview(e),this.subview=e,this.requestUpdate(),this.addAttachHandles([s(()=>this.layer.clippedToNeatline,()=>{const e=this.subview.redrawOrRefetch({refetch:!0,reprocess:!1}).catch(e=>{r(e)||t.getLogger(this).error(e)});this._updatingHandles.addPromise(e)})])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};e([i()],n.prototype,"subview",void 0),e([i({readOnly:!0})],n.prototype,"displayParameters",null),n=e([a("esri.views.2d.layers.GeospatialPDFLayerView2D")],n);const c=n;export{c as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{property as r,subclass as a}from"../../../core/accessorSupport/decorators.js";import{LayerView2D as o}from"./LayerView2D.js";import h from"./imagery/ImageryTileView2D.js";import d from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as l}from"../../layers/RefreshableLayerView.js";let c=class extends(l(o(d))){constructor(){super(...arguments),this.subview=null}get displayParameters(){const{layer:e}=this,t=this._get("displayParameters");return e.visible?{interpolation:e.interpolation,clipToNeatline:e.clippedToNeatline}:t}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage();const e=new h({layer:this.layer,layerView:this,scheduler:this.scheduler});e.useWebGLForProcessing=!0,e.useProgressiveUpdate=!0,this._attachSubview(e),this.subview=e,this.requestUpdate(),this.addAttachHandles([i(()=>this.layer.clippedToNeatline,()=>{const e=this.subview.redrawOrRefetch({refetch:!0,reprocess:!1}).catch(e=>{s(e)||t.getLogger(this).error(e)});this._updatingHandles.addPromise(e)})])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};e([r()],c.prototype,"subview",void 0),e([r({readOnly:!0})],c.prototype,"displayParameters",null),c=e([a("esri.views.2d.layers.GeospatialPDFLayerView2D")],c);const n=c;export{n as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{clone as t}from"../../../core/lang.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{createScreenPoint as a,isScreenRect as l,pt2px as n}from"../../../core/screenUtils.js";import{property as o,subclass as h}from"../../../core/accessorSupport/decorators.js";import{diff as y,hasDiff as u}from"../../../core/accessorSupport/diffUtils.js";import c from"../../../geometry/Point.js";import{create as d}from"../../../geometry/support/aaBoundingRect.js";import{equals as p}from"../../../geometry/support/spatialReferenceUtils.js";import{isVectorTileGraphicOrigin as _}from"../../../graphic/isVectorTileGraphicOrigin.js";import{tileSizeInTileUnits as f,tileSizeInPixels as g}from"../engine/vectorTiles/constants.js";import{TileHandler as m}from"../engine/vectorTiles/TileHandler.js";import{TileManager as T}from"../engine/vectorTiles/TileManager.js";import{VectorTile as C}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as v}from"../engine/vectorTiles/VectorTileContainer.js";import w from"../engine/vectorTiles/VectorTileFeatureIndex.js";import R from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2D as H}from"./LayerView2D.js";import I from"../tiling/TileInfoViewPOT.js";import Q from"../tiling/TileQueue.js";import S from"../../layers/VectorTileLayerView.js";import{TaskPriority as P}from"../../support/Scheduler.js";const b=2.5;let V=class extends(H(S)){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return(this._vectorTileContainer?.fading||this._tileManager?.isFading())??!1}get hasVisibleFeatures(){const e=this._vectorTileContainer.children;for(const t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){const i=this._tileHandlerPromise,s=this._vectorTileContainer?.symbolFader;if(!i||!this._isTileHandlerReady||!s)return;await i;let r=[];if(l(t)){const e=t;r=[a(e.x,e.y+e.height),a(e.x+e.width,e.y+e.height),a(e.x+e.width,e.y),a(e.x,e.y)]}else r=[t];const o=has("esri-vtl-search-tolerance")??0,h=o>0?o:b,y=this.view.state,{rotation:u,pixelRatio:c}=this.view.state,d=n(h)*c;let p=null;const _=this._vectorTileContainer?.symbolRepository;_&&(p=_.querySymbols(r[0],d,s.decluttererOffset,{}));const f=this._tileManager.getIntersectingTiles(r[0].x,r[0].y,d,y,p);if(p=p?.filter(e=>this._styleRepository.getStyleLayerVisibility(e.styleLayerUID)),(!f||0===f.length)&&0===p?.length)return null;e=e.clone().normalize();const g=[],m=[];for(const a of f)g.push(this._queryTile(m,e,d,u,a,p?.filter(e=>e.tileKey.id===a.id)));return await Promise.all(g),m}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._tileHandler.devicePixelRatio=e.pixelRatio,void this._loadStyle()):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new R(e),this._tileInfoView=new I(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new v(this._tileInfoView),this._tileHandler=new m(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1,this.view.glyphMosaic()),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:0,data:e}),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=3===i.type;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;this._styeChanged=!0;const s=y(i.layout,e.layout);if(null!=s){if(u(s,"visibility")&&1===D(s))return t.setLayoutProperties(e.layer,e.layout),3===i.type&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:1,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),3===i.type&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:2,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:3,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:4,data:e});const t=this._styleRepository.layers;for(const i of t)switch(i.type){case 3:i.getLayoutProperty("icon-image")&&this._styleChanges.push({type:1,data:{layer:i.id,layout:i.layout}});break;case 2:i.getPaintProperty("line-pattern")&&this._styleChanges.push({type:0,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}});break;case 1:i.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:0,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=s(this._vectorTileContainer),this._tileHandler=s(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return p(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t?.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){return this.fading||!this._isTileHandlerReady}acquireTile(e){const t=this._createVectorTile(e);return this._updatingHandles.consumePromise(this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once("attach",()=>this.requestUpdate()),t.setData(e),this.requestUpdate()}).catch(e=>{r(e)||i.getLogger(this).error(e)})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const e=this._vectorTileContainer.children,t=[];try{for(const i of e){const e=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then(e=>this._parseQueue.push({key:i.key,data:e})).then(e=>i.setData(e)).finally(()=>i.featureIndex=null));t.push(e)}await Promise.all(t)}catch(s){i.getLogger(this).error("error refreshing vector-tiles layer-view",s),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new T({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new Q({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:P.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new Q({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:P.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=s(this._fetchQueue),this._parseQueue=s(this._parseQueue),this._tileManager=s(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(o){i.getLogger(this).error("error applying vector-tiles style update",o.message),this._resumeQueues(),this._isTileHandlerReady=!0}const t=this._styleRepository,s=new Set,r=new Set;for(const i of e){if(3!==i.type&&2!==i.type)continue;const e=2===i.type?i.data.layer.id:i.data.layer,a=t.getLayerById(e);a&&(s.add(a.uid),3===a.type&&r.add(a.uid))}const a=this._vectorTileContainer.children,l=this._vectorTileContainer?.symbolFader?.symbolRepository;l&&r.size>0&&l.deleteStyleLayers(Array.from(r));const n=new Set;if(e.forEach(e=>{let i;switch(e.type){case 0:t.setPaintProperties(e.data.layer,e.data.paint),i=e.data.layer;break;case 1:t.setLayoutProperties(e.data.layer,e.data.layout),i=e.data.layer;break;case 3:return void t.deleteStyleLayer(e.data.layer);case 2:t.setStyleLayer(e.data.layer,e.data.index),i=e.data.layer.id;break;case 4:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(i){const e=t.getLayerById(i);e&&n.add(e.uid)}}),s.size>0){const e=Array.from(s);this._vectorTileContainer.deleteStyleLayers(e);for(const t of a)t.deleteLayerData(e)}if(this._resumeQueues(),n.size>0){const e=Array.from(n),t=[];for(const i of a){const s=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then(t=>this._parseQueue.push({key:i.key,data:t,styleLayerUIDs:e})).then(e=>i.setData(e)).finally(()=>i.featureIndex=null));t.push(s)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,i=t(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new R(i),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,i,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(n){if(!r(n))throw n}if(s.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const a=await this._tileHandler.spriteMosaic,l=this._vectorTileContainer;this._tileInfoView=new I(this.layer.tileInfo,this.layer.fullExtent),l.setStyleResources(a,this.view.glyphMosaic(),this._styleRepository,this._tileInfoView),this._tileManager=new T({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(d(),e),i=this._tileInfoView.getTileResolution(e.level);return new C(e,i,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,t,i,s,r,a){if(0===r.layerData.size)return;const l=this._ensureTileIndex(r),[n,o,h,y]=this._tileInfoView.getTileBounds(d(),r.key,!0),u=f*((t.x-n)/(h-n)),c=f*(1-(t.y-o)/(y-o)),p=this.view.featuresTilingScheme.tileInfo.scaleToZoom(this.view.state.scale)-r.key.level,m=p>0?2**p:1,T=i/m*(f/g),C=await l.queryAttributes(u,c,T,s,a,m);for(const d of C)d.graphic.geometry=this._tileToMapPoint(d.tilePoint,r.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:d.graphic,mapPoint:t.clone()});e.sort((e,t)=>(_(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(_(e.graphic.origin)?e.graphic.origin.layerIndex:0))}_tileToMapPoint(e,t){if(!e)return null;const i=e[0]*t[0]+e[1]*t[3]+t[6],s=e[0]*t[1]+e[1]*t[4]+t[7],r=this.view.state,a=[0,0];return r.toMap(a,[i,s]),new c({x:a[0],y:a[1],spatialReference:r.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=w.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function D(e){if(null==e)return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([o()],V.prototype,"_isTileHandlerReady",void 0),V=e([h("esri.views.2d.layers.VectorTileLayerView2D")],V);const j=V;export{j as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import has from"../../../core/has.js";import{clone as i}from"../../../core/lang.js";import s from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{createScreenPoint as l,isScreenPoint as n,isScreenRect as o,isScreenPolygon as h,pt2px as y}from"../../../core/screenUtils.js";import{property as u,subclass as c}from"../../../core/accessorSupport/decorators.js";import{diff as d,hasDiff as p}from"../../../core/accessorSupport/diffUtils.js";import _ from"../../../geometry/Point.js";import{fromValues as f,create as g}from"../../../geometry/support/aaBoundingRect.js";import{equals as m}from"../../../geometry/support/spatialReferenceUtils.js";import{isVectorTileGraphicOrigin as T}from"../../../graphic/isVectorTileGraphicOrigin.js";import v from"../../../graphic/VectorTileGraphicOrigin.js";import{tileSizeInTileUnits as C,tileSizeInPixels as w}from"../engine/vectorTiles/constants.js";import{TileHandler as R}from"../engine/vectorTiles/TileHandler.js";import{TileManager as H}from"../engine/vectorTiles/TileManager.js";import{VectorTile as I}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as S}from"../engine/vectorTiles/VectorTileContainer.js";import b from"../engine/vectorTiles/VectorTileFeatureIndex.js";import{isSearchCircleOverlappingSymbol as Q,isSearchPolygonOverlappingSymbol as P}from"../engine/vectorTiles/decluttering/util.js";import V from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2D as D}from"./LayerView2D.js";import{getBbox as j,getMapPointsFromScreen as x}from"../support/hitTestUtils.js";import U from"../tiling/TileInfoViewPOT.js";import M from"../tiling/TileQueue.js";import q from"../../layers/VectorTileLayerView.js";import{TaskPriority as L}from"../../support/Scheduler.js";const k=2.5;let A=class extends(D(q)){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return(this._vectorTileContainer?.fading||this._tileManager?.isFading())??!1}get hasVisibleFeatures(){const e=this._vectorTileContainer.children;for(const t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){const i=this._tileHandlerPromise,s=this._vectorTileContainer?.symbolFader;if(!i||!this._isTileHandlerReady||!s)return;await i;let r,a=[];const u=o(t),c=h(t);if(u){const e=t;a=[l(e.x,e.y+e.height),l(e.x+e.width,e.y+e.height),l(e.x+e.width,e.y),l(e.x,e.y)],r="rect"}else c?(a=t.map(e=>e),r="polygon"):(a=[t],r="point");const d=has("esri-vtl-search-tolerance")??0,p=d>0?d:k,_=this.view.state,{rotation:g,pixelRatio:m}=this.view.state,T=y(p)*m;let v=null;const C=this._vectorTileContainer?.symbolRepository;C&&(v=C.querySymbols());let w,R=[];if(v)for(const l of v){const{styleLayerUID:e,vtlSymbol:t,tileKey:i}=l;"point"===r&&Q(t,a[0],T,s.decluttererOffset)&&R.push({vtlSymbol:t,styleLayerUID:e,tileKey:i}),P(t,a,s.decluttererOffset)&&R.push({vtlSymbol:t,styleLayerUID:e,tileKey:i})}if(n(t)){const e=[0,0],i=[0,0];_.toMap(e,t.x-T,t.y+T),_.toMap(i,t.x+T,t.y-T),w=f(Math.min(e[0],i[0]),Math.min(e[1],i[1]),Math.max(e[0],i[0]),Math.max(e[1],i[1]))}else{const e=a.map(({x:e,y:t})=>{const i=[0,0];return _.toMap(i,e,t),i});w=j([e])}const H=this._tileManager.getIntersectingTiles(w,R);if(R=R?.filter(e=>this._styleRepository.getStyleLayerVisibility(e.styleLayerUID)),(!H||0===H.length)&&0===R?.length)return null;const I=x(this.view,a),S=[],b=[];for(const l of H)S.push(this._queryTile(b,I,T,g,l,R?.filter(e=>e.tileKey.id===l.id),u?"rect":c?"polygon":"point"));return await Promise.all(S),b}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._tileHandler.devicePixelRatio=e.pixelRatio,void this._loadStyle()):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new V(e),this._tileInfoView=new U(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new S(this._tileInfoView),this._tileHandler=new R(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1,this.view.glyphMosaic()),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:0,data:e}),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=3===i.type;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;this._styeChanged=!0;const s=d(i.layout,e.layout);if(null!=s){if(p(s,"visibility")&&1===E(s))return t.setLayoutProperties(e.layer,e.layout),3===i.type&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:1,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),3===i.type&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:2,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:3,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:4,data:e});const t=this._styleRepository.layers;for(const i of t)switch(i.type){case 3:i.getLayoutProperty("icon-image")&&this._styleChanges.push({type:1,data:{layer:i.id,layout:i.layout}});break;case 2:i.getPaintProperty("line-pattern")&&this._styleChanges.push({type:0,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}});break;case 1:i.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:0,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=r(this._vectorTileContainer),this._tileHandler=r(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return m(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t?.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){return this.fading||!this._isTileHandlerReady}acquireTile(e){const t=this._createVectorTile(e);return this._updatingHandles.consumePromise(this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once("attach",()=>this.requestUpdate()),t.setData(e),this.requestUpdate()}).catch(e=>{a(e)||s.getLogger(this).error(e)})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const e=this._vectorTileContainer.children,t=[];try{for(const i of e){const e=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then(e=>this._parseQueue.push({key:i.key,data:e})).then(e=>i.setData(e)).finally(()=>i.featureIndex=null));t.push(e)}await Promise.all(t)}catch(i){s.getLogger(this).error("error refreshing vector-tiles layer-view",i),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new H({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new M({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:L.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new M({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:L.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=r(this._fetchQueue),this._parseQueue=r(this._parseQueue),this._tileManager=r(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(o){s.getLogger(this).error("error applying vector-tiles style update",o.message),this._resumeQueues(),this._isTileHandlerReady=!0}const t=this._styleRepository,i=new Set,r=new Set;for(const s of e){if(3!==s.type&&2!==s.type)continue;const e=2===s.type?s.data.layer.id:s.data.layer,a=t.getLayerById(e);a&&(i.add(a.uid),3===a.type&&r.add(a.uid))}const a=this._vectorTileContainer.children,l=this._vectorTileContainer?.symbolFader?.symbolRepository;l&&r.size>0&&l.deleteStyleLayers(Array.from(r));const n=new Set;if(e.forEach(e=>{let i;switch(e.type){case 0:t.setPaintProperties(e.data.layer,e.data.paint),i=e.data.layer;break;case 1:t.setLayoutProperties(e.data.layer,e.data.layout),i=e.data.layer;break;case 3:return void t.deleteStyleLayer(e.data.layer);case 2:t.setStyleLayer(e.data.layer,e.data.index),i=e.data.layer.id;break;case 4:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(i){const e=t.getLayerById(i);e&&n.add(e.uid)}}),i.size>0){const e=Array.from(i);this._vectorTileContainer.deleteStyleLayers(e);for(const t of a)t.deleteLayerData(e)}if(this._resumeQueues(),n.size>0){const e=Array.from(n),t=[];for(const i of a){const s=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then(t=>this._parseQueue.push({key:i.key,data:t,styleLayerUIDs:e})).then(e=>i.setData(e)).finally(()=>i.featureIndex=null));t.push(s)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,t=i(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new V(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(n){if(!a(n))throw n}if(s.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const r=await this._tileHandler.spriteMosaic,l=this._vectorTileContainer;this._tileInfoView=new U(this.layer.tileInfo,this.layer.fullExtent),l.setStyleResources(r,this.view.glyphMosaic(),this._styleRepository,this._tileInfoView),this._tileManager=new H({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(g(),e),i=this._tileInfoView.getTileResolution(e.level);return new I(e,i,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,i,s,r,a,l,n){if(0===a.layerData.size)return;const o=this._ensureTileIndex(a),h=this._tileInfoView.getTileBounds(g(),a.key,!0),y=i.map(e=>{const[t,i,s,r]=h;return[C*((e.x-t)/(s-t)),C*(1-(e.y-i)/(r-i))]}),u=this.view.featuresTilingScheme.tileInfo.scaleToZoom(this.view.state.scale)-a.key.level,c=u>0?2**u:1,d=s/c*(C/w),p=await o.queryAttributes(y,d,n);for(const f of p){const{layer:s,feature:a}=f;this._styleRepository.getStyleLayerVisibility(s.uid)&&s.isIntersectingFeature(y,d,a,o.tileKey.level,r,c,f,n)&&e.push({type:"graphic",layer:this.layer,graphic:new t({attributes:a.values,origin:new v(this.layer,f.layer.id,f.layer.uid)}),mapPoint:"point"===n?i[0].clone():null})}const _=[];(await o.getSymbolHitResults(_,l)).map(t=>{t.graphic.geometry=this._tileToMapPoint(t.tilePoint,a.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:t.graphic,mapPoint:"point"===n?i[0].clone():null})}),e.sort((e,t)=>(T(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(T(e.graphic.origin)?e.graphic.origin.layerIndex:0))}_tileToMapPoint(e,t){if(!e)return null;const i=e[0]*t[0]+e[1]*t[3]+t[6],s=e[0]*t[1]+e[1]*t[4]+t[7],r=this.view.state,a=[0,0];return r.toMap(a,[i,s]),new _({x:a[0],y:a[1],spatialReference:r.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=b.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function E(e){if(null==e)return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([u()],A.prototype,"_isTileHandlerReady",void 0),A=e([c("esri.views.2d.layers.VectorTileLayerView2D")],A);const O=A;export{O as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{diff as e}from"../../../../../../core/accessorSupport/diffUtils.js";import{createVisualVariableUniforms as a,noVisualVariables as i}from"./VisualVariablesSchema.js";import{createPieChartMeshSchemas as t,createHeatmapMeshSchemas as n,createSymbolMeshSchemas as l,createDotDensityMeshSchemas as s}from"./symbols/SymbolSchema.js";async function r(e,a){return(await Promise.all((e??[]).map((e,i)=>l(e,{path:`${a.path}.alternateSymbols.${i}`,schemaOptions:a.schemaOptions,uniforms:a.uniforms,rotationVariable:a.rotationVariable})))).flat()}async function o(e,a){if(!a)return{type:"simple",meshes:[]};switch(a.type){case"simple":return c(e,a);case"dot-density":return d(e,a);case"class-breaks":if(null!=a.defaultSymbol){const i=await m(e,a);if(i)return i.symbology}return h(e,a);case"unique-value":return S(e,a);case"dictionary":return v(a);case"heatmap":return w(e,a);case"pie-chart":return O(e,a)}}async function u(e,a){return await m(e,a)??{symbology:await h(e,a),matcherFilter:null}}async function m(e,i){if(!f(i))return null;const t=a(i),n=V(i);return{symbology:{type:"simple",meshes:await l(i.classBreakInfos[0].symbol,{schemaOptions:e,uniforms:t,rotationVariable:n})},matcherFilter:null==i.defaultSymbol?p(i):null}}async function c(e,i){const t=i.symbols,n=t.length?t[0]:null,s=a(i),r=V(i);return{type:"simple",meshes:await l(n,{schemaOptions:e,uniforms:s,rotationVariable:r})}}function f(e){const a=1===e.classBreakInfos.length?e.classBreakInfos[0]:null;return!(!a?.symbol||a.alternateSymbols?.length||a.minValue!==-Number.MAX_SAFE_INTEGER||a.maxValue!==Number.MAX_SAFE_INTEGER||!e.isMaxInclusive||null!=e.backgroundFillSymbol)&&(null==e.defaultSymbol?!(!e.valueExpression&&!e.field):y(a.symbol,e.defaultSymbol,e))}function p(e){const a="log"===e.normalizationType?"esriNormalizeByLog":"percent-of-total"===e.normalizationType?"esriNormalizeByPercentOfTotal":"field"===e.normalizationType?"esriNormalizeByField":null;return{expression:e.valueExpression,field:e.field,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,normalizationType:a}}function y(a,i,t){if(a.type!==i.type)return!1;if("picture-fill"===a.type&&"picture-fill"===i.type||"simple-fill"===a.type&&"simple-fill"===i.type){const n=e(a,i);if(null==n)return!0;if(b(t)&&"partial"===n.type){const e=n.diff.outline;return 1===Object.keys(n.diff).length&&"partial"===e?.type&&null!=e.diff&&1===Object.keys(e.diff).length&&null!=e.diff.width}return!1}return null==e(a,i)}function b(e){return e.visualVariables?.some(e=>"size"===e.type&&"outline"===e.target)??!1}async function d(e,i){const t=a(i);return{type:"dot-density",meshes:await s(i,{schemaOptions:e,uniforms:t})}}async function h(e,t){const n=a(t),s=V(t),o=t.backgroundFillSymbol,u=t.classBreakInfos.map(async a=>{const i=`renderer-stop-${a.minValue}-${a.maxValue}`;return{meshes:await l(a.symbol,{schemaOptions:e,uniforms:n,rotationVariable:s}),alternateMeshes:await r(a.alternateSymbols,{path:i,schemaOptions:e,uniforms:n,rotationVariable:s}),min:a.minValue,max:a.maxValue}}),m=(await Promise.all(u)).sort((e,a)=>e.min-a.min),c=await l(o,{schemaOptions:e,uniforms:{...i,visualVariableSizeOutlineScaleStops:n.visualVariableSizeOutlineScaleStops}}),f=await l(t.defaultSymbol,{schemaOptions:e,uniforms:n,rotationVariable:s});return{type:"interval",...p(t),backgroundFill:c,defaultSymbol:f,intervals:m,isMaxInclusive:t.isMaxInclusive}}async function S(e,t){const n=[],s=a(t),o=V(t),u=await l(t.backgroundFillSymbol,{schemaOptions:e,uniforms:{...i,visualVariableSizeOutlineScaleStops:s.visualVariableSizeOutlineScaleStops}}),m=await l(t.defaultSymbol,{schemaOptions:e,uniforms:s,rotationVariable:o});for(const a of t.uniqueValueInfos??[]){const i=`renderer-unique-value-${a.value}`,t=await l(a.symbol,{schemaOptions:e,uniforms:s,rotationVariable:o}),u=await r(a.alternateSymbols,{path:i,schemaOptions:e,uniforms:s,rotationVariable:o});n.push({value:""+a.value,meshes:t,alternateMeshes:u})}return{type:"map",field:t.field,expression:t.valueExpression,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,backgroundFill:u,defaultSymbol:m,map:n}}function V(e){if(!("visualVariables"in e))return null;const a=e.visualVariables?.find(e=>"rotation"===e.type);return"rotation"===a?.type?a:null}async function v(e){const i=a(e),t=await e.getDictionaryInfo(),n=e.scaleExpression,l=null!=n&&"1"!==n?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",dictionaryInfo:t,userConfig:e.config??{},fieldMap:e.fieldMap??{},scaleExpression:l,visualVariableUniforms:i}}async function w(e,a){return{type:"heatmap",meshes:await n(a,e)}}async function O(e,a){return{type:"pie-chart",meshes:await t(a,e)}}export{u as createClassBreaksMatcherSchema,o as createMatcherSchema};
2
+ import{diff as e}from"../../../../../../core/accessorSupport/diffUtils.js";import{createVisualVariableUniforms as a,noVisualVariables as i}from"./VisualVariablesSchema.js";import{createPieChartMeshSchemas as t,createHeatmapMeshSchemas as n,createSymbolMeshSchemas as l,createDotDensityMeshSchemas as s}from"./symbols/SymbolSchema.js";async function r(e,a){return(await Promise.all((e??[]).map((e,i)=>l(e,{path:`${a.path}.alternateSymbols.${i}`,schemaOptions:a.schemaOptions,uniforms:a.uniforms,rotationVariable:a.rotationVariable})))).flat()}async function o(e,a){if(!a)return{type:"simple",meshes:[]};switch(a.type){case"simple":return c(e,a);case"dot-density":return d(e,a);case"class-breaks":if(null!=a.defaultSymbol){const i=await m(e,a);if(i)return i.symbology}return h(e,a);case"unique-value":return S(e,a);case"dictionary":return v(a);case"heatmap":return w(e,a);case"pie-chart":return O(e,a)}}async function u(e,a){return await m(e,a)??{symbology:await h(e,a),matcherFilter:null}}async function m(e,i){if(!f(i))return null;const t=a(i),n=V(i);return{symbology:{type:"simple",meshes:await l(i.classBreakInfos[0].symbol,{schemaOptions:e,uniforms:t,rotationVariable:n})},matcherFilter:null==i.defaultSymbol?p(i):null}}async function c(e,i){const t=i.symbols,n=t.length?t[0]:null,s=a(i),r=V(i);return{type:"simple",meshes:await l(n,{schemaOptions:e,uniforms:s,rotationVariable:r})}}function f(e){const a=1===e.classBreakInfos.length?e.classBreakInfos[0]:null;return!(!a?.symbol||a.alternateSymbols?.length||a.minValue!==-Number.MAX_SAFE_INTEGER||a.maxValue!==Number.MAX_SAFE_INTEGER||!e.isMaxInclusive||null!=e.backgroundFillSymbol)&&(null==e.defaultSymbol?!(!e.valueExpression&&!e.field):y(a.symbol,e.defaultSymbol,e))}function p(e){const a="log"===e.normalizationType?"esriNormalizeByLog":"percent-of-total"===e.normalizationType?"esriNormalizeByPercentOfTotal":"field"===e.normalizationType?"esriNormalizeByField":null;return{expression:e.valueExpression,field:e.field,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,normalizationType:a}}function y(a,i,t){if(a.type!==i.type)return!1;if("picture-fill"===a.type&&"picture-fill"===i.type||"simple-fill"===a.type&&"simple-fill"===i.type){const n=e(a,i);if(null==n)return!0;if(b(t)&&"partial"===n.type){const e=n.diff.outline;return 1===Object.keys(n.diff).length&&"partial"===e?.type&&null!=e.diff&&1===Object.keys(e.diff).length&&null!=e.diff.width}return!1}return null==e(a,i)}function b(e){return e.visualVariables?.some(e=>"size"===e.type&&"outline"===e.target)??!1}async function d(e,i){const t=a(i);return{type:"dot-density",meshes:await s(i,{schemaOptions:e,uniforms:t})}}async function h(e,t){const n=a(t),s=V(t),o=t.backgroundFillSymbol,u=t.classBreakInfos.map(async a=>{const i=`renderer-stop-${a.minValue}-${a.maxValue}`;return{meshes:await l(a.symbol,{schemaOptions:e,uniforms:n,rotationVariable:s}),alternateMeshes:await r(a.alternateSymbols,{path:i,schemaOptions:e,uniforms:n,rotationVariable:s}),min:a.minValue,max:a.maxValue}}),m=(await Promise.all(u)).sort((e,a)=>e.min-a.min),c=await l(o,{schemaOptions:e,uniforms:{...i,visualVariableSizeOutlineScaleStops:n.visualVariableSizeOutlineScaleStops}}),f=await l(t.defaultSymbol,{schemaOptions:e,uniforms:n,rotationVariable:s});return{type:"interval",...p(t),backgroundFill:c,defaultSymbol:f,intervals:m,isMaxInclusive:t.isMaxInclusive}}async function S(e,t){const n=a(t),s=V(t),o=await l(t.backgroundFillSymbol,{schemaOptions:e,uniforms:{...i,visualVariableSizeOutlineScaleStops:n.visualVariableSizeOutlineScaleStops}}),u=await l(t.defaultSymbol,{schemaOptions:e,uniforms:n,rotationVariable:s}),m=(t.uniqueValueInfos??[]).map(async a=>{const i=`renderer-unique-value-${a.value}`,t=await l(a.symbol,{schemaOptions:e,uniforms:n,rotationVariable:s}),o=await r(a.alternateSymbols,{path:i,schemaOptions:e,uniforms:n,rotationVariable:s});return{value:""+a.value,meshes:t,alternateMeshes:o}}),c=await Promise.all(m);return{type:"map",field:t.field,expression:t.valueExpression,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,backgroundFill:o,defaultSymbol:u,map:c}}function V(e){if(!("visualVariables"in e))return null;const a=e.visualVariables?.find(e=>"rotation"===e.type);return"rotation"===a?.type?a:null}async function v(e){const i=a(e),t=await e.getDictionaryInfo(),n=e.scaleExpression,l=null!=n&&"1"!==n?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",dictionaryInfo:t,userConfig:e.config??{},fieldMap:e.fieldMap??{},scaleExpression:l,visualVariableUniforms:i}}async function w(e,a){return{type:"heatmap",meshes:await n(a,e)}}async function O(e,a){return{type:"pie-chart",meshes:await t(a,e)}}export{u as createClassBreaksMatcherSchema,o as createMatcherSchema};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{r as e}from"../../../../chunks/rbush.js";import s from"../../../../geometry/Point.js";import{create as i,fromValues as o,intersects as n,copy as r}from"../../../../geometry/support/aaBoundingRect.js";import{normalizeMapX as m}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as l}from"../../../../geometry/support/spatialReferenceUtils.js";import{HittestDrawHelper as a}from"../../../../symbols/cim/CIMSymbolDrawHelper.js";import{CIMSymbolInflatedSizeHelper as h}from"../../../../symbols/cim/CIMSymbolHelper.js";import{hittestToleranceSmallSymbol as c,hittestToleranceMobile as u,hittestToleranceDesktop as p}from"../../engine/webgl/definitions.js";import{GraphicStoreItem as d}from"./GraphicStoreItem.js";import{pixelBuffer as f}from"./graphicsUtils.js";import{GraphicUpdateMessage as y}from"./GraphicUpdateMessage.js";import{getMapPointsFromScreen as _,getBbox as b,createHittestQuery as I}from"../../support/hitTestUtils.js";const g=1e-5;function x(t,e){return e.zOrder-t.zOrder}class w{constructor(t,e,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=t,this._cimResourceManager=e,this._hittestDrawHelper=new a(e),this._tileInfoView=s,this._store=o;const n=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(n.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(t){return this._items.get(t)}async update(t,e,s){const i=[],o=[],n=[],r=new Set,m=[];let l=0;const a=new Set;for(const h of t.items){const t=h.uid;if(a.has(t))continue;a.add(t),l++;const n=this._items.get(t),c=e(h);if(r.add(t),n){const t=n.update(h,c,l),e=n.updateDensificationResolution(this._resolution);t&&m.push(this._updateItem(n,s)),(t||e)&&o.push(n);continue}const u=this._store.createDisplayIdForObjectId(t),p=d.fromGraphic(h,c,l,u);p.updateDensificationResolution(this._resolution),m.push(this._updateItem(p,s)),this._items.set(p.objectId,p),i.push(p)}for(const[h,c]of this._items.entries())r.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),n.push(c));return await Promise.all(m),this._index=null,new y(i,o,n)}updateLevel(t){if(this._resolution===t)return!1;this._index=null,this._boundsDirty=!0,this._resolution=t;for(const e of this.items())if(e.hasCurvedGeoemtry)return!0;return!1}hitTest(t,e,r,l){let a=i(),h=i();const d=I(e,null);if(!d)return console.warn("Unexpected hittest input:",e),[];let y=0,g=_(t,d.input);if(g=g.map(t=>new s(m(t.x,this._tileInfoView.spatialReference),t.y,this._tileInfoView.spatialReference)),"rect"===d.hittestType||"polygon"===d.hittestType){const{xmin:t,ymin:e,xmax:s,ymax:i}=b([g.map(t=>[t.x,t.y])]);a=o(t,e,s,i),h=a}else if("point"===d.hittestType){const t=has("esri-mobile"),e=t?u:p,s=e+(t?0:c),i=g[0].x,n=g[0].y,m=r*window.devicePixelRatio*s;a=o(i-m,n-m,i+m,n+m);const l=r*window.devicePixelRatio*e,d=o(i-l,n-l,i+l,n+l),_=.5*r*(s+f);h=o(i-_,n-_,i+_,n+_),y=d[2]-d[0]}const w=this._searchIndex(h[0],h[1],h[2],h[3]);if(!w||0===w.length)return[];const j=[],R=i(),S=i();for(const s of w){if(!s.visible)continue;const{geometryBounds:t,symbolResource:e}=s;this._getSymbolBounds(R,e,t,S,l),S[3]=S[2]=S[1]=S[0]=0,n(R,a)&&j.push(s)}if(0===j.length)return[];const B=this._hittestDrawHelper,D=[];for(const s of j){const{projectedGeometry:t,symbolResource:e}=s;if(!e)continue;const{textInfo:i,symbolInfo:o}=e,n=o.cimSymbol,m=o.linearCIM.some(t=>"alignment"in t&&0===t.alignment),a={hittestType:d.hittestType,textInfo:i,mapRotation:l,resolution:r,searchDist:y,isScreenAligned:m};B.hitTest(g,n.symbol,t,a)&&D.push(s)}return D.sort(x),D.map(t=>t.objectId)}queryItems(t){return 0===this._items.size?[]:this._searchForItems(t)}clear(){this._items.clear(),this._index=null}async _updateItem(t,e){await t.projectAndNormalize(this._outSpatialReference),await e(t);const{size:s}=t;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(t.symbolBounds,t.symbolResource,t.geometryBounds,t.size,0)}_searchIndex(t,s,i,o){return this._boundsDirty&&(this._items.forEach(t=>this._getSymbolBounds(t.symbolBounds,t.symbolResource,t.geometryBounds,t.size,0)),this._boundsDirty=!1),this._index||(this._index=e(9,t=>({minX:t.symbolBounds[0],minY:t.symbolBounds[1],maxX:t.symbolBounds[2],maxY:t.symbolBounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:t,minY:s,maxX:i,maxY:o})}_searchForItems(t){const e=this._tileInfoView.spatialReference,s=t.bounds,o=l(e);if(o&&e.isWrappable){const[e,n]=o.valid,r=Math.abs(s[2]-n)<g,m=Math.abs(s[0]-e)<g;if((!r||!m)&&(r||m)){const o=t.resolution;let m;m=i(r?[e,s[1],e+o*f,s[3]]:[n-o*f,s[1],n,s[3]]);const l=this._searchIndex(s[0],s[1],s[2],s[3]),a=this._searchIndex(m[0],m[1],m[2],m[3]);return[...new Set([...l,...a])]}}return this._searchIndex(s[0],s[1],s[2],s[3])}_getSymbolBounds(e,s,o,n,m){if(!s||!s.symbolInfo.linearCIM)return null;if(e||(e=i()),r(e,o),!n||0===n[0]&&0===n[1]&&0===n[2]&&0===n[3]){const{textInfo:e,symbolInfo:i}=s,o=i.cimSymbol;n||(n=[0,0,0,0]);const r=h.getSymbolInflateSize(n,o.symbol,this._cimResourceManager,m,e);n[0]=t(r[0]),n[1]=t(r[1]),n[2]=t(r[2]),n[3]=t(r[3])}const l=this._resolution,a=h.safeSize(n);return e[0]-=a*l,e[1]-=a*l,e[2]+=a*l,e[3]+=a*l,e}}export{w as default};
2
+ import has from"../../../../core/has.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{r as e}from"../../../../chunks/rbush.js";import s from"../../../../geometry/Point.js";import{create as i,fromValues as o,intersects as r,copy as n}from"../../../../geometry/support/aaBoundingRect.js";import{normalizeMapX as m}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as l}from"../../../../geometry/support/spatialReferenceUtils.js";import{HittestDrawHelper as a}from"../../../../symbols/cim/CIMSymbolDrawHelper.js";import{CIMSymbolInflatedSizeHelper as h}from"../../../../symbols/cim/CIMSymbolHelper.js";import{hittestToleranceSmallSymbol as c,hittestToleranceMobile as u,hittestToleranceDesktop as p}from"../../engine/webgl/definitions.js";import{GraphicStoreItem as d}from"./GraphicStoreItem.js";import{pixelBuffer as f}from"./graphicsUtils.js";import{GraphicUpdateMessage as _}from"./GraphicUpdateMessage.js";import{getMapPointsFromScreen as y,getBbox as b,createHittestQuery as I}from"../../support/hitTestUtils.js";const g=1e-5;function x(t,e){return e.zOrder-t.zOrder}class w{constructor(t,e,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=t,this._cimResourceManager=e,this._hittestDrawHelper=new a(e),this._tileInfoView=s,this._store=o;const r=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(r.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(t){return this._items.get(t)}async update(t,e,s){const i=[],o=[],r=[],n=new Set,m=[];let l=0;const a=new Set;for(const h of t.items){const t=h.uid;if(a.has(t))continue;a.add(t),l++;const r=this._items.get(t),c=e(h);if(n.add(t),r){const t=r.update(h,c,l),e=r.updateDensificationResolution(this._resolution);t&&m.push(this._updateItem(r,s)),(t||e)&&o.push(r);continue}const u=this._store.createDisplayIdForObjectId(t),p=d.fromGraphic(h,c,l,u);p.updateDensificationResolution(this._resolution),m.push(this._updateItem(p,s)),this._items.set(p.objectId,p),i.push(p)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),r.push(c));return await Promise.all(m),this._index=null,new _(i,o,r)}updateLevel(t){if(this._resolution===t)return!1;this._index=null,this._boundsDirty=!0,this._resolution=t;for(const e of this.items())if(e.hasCurvedGeoemtry)return!0;return!1}hitTest(t,e,n,l){let a=i(),h=i();const d=I(e,null);if(!d)return console.warn("Unexpected hittest input:",e),[];let _=0,g=y(t,d.input);if(g=g.map(t=>new s(m(t.x,this._tileInfoView.spatialReference),t.y,this._tileInfoView.spatialReference)),"rect"===d.hittestType||"polygon"===d.hittestType){a=b([g.map(t=>[t.x,t.y])]),h=a}else if("point"===d.hittestType){const t=has("esri-mobile"),e=t?u:p,s=e+(t?0:c),i=g[0].x,r=g[0].y,m=n*window.devicePixelRatio*s;a=o(i-m,r-m,i+m,r+m);const l=n*window.devicePixelRatio*e,d=o(i-l,r-l,i+l,r+l),y=.5*n*(s+f);h=o(i-y,r-y,i+y,r+y),_=d[2]-d[0]}const w=this._searchIndex(h[0],h[1],h[2],h[3]);if(!w||0===w.length)return[];const j=[],R=i(),S=i();for(const s of w){if(!s.visible)continue;const{geometryBounds:t,symbolResource:e}=s;this._getSymbolBounds(R,e,t,S,l),S[3]=S[2]=S[1]=S[0]=0,r(R,a)&&j.push(s)}if(0===j.length)return[];const B=this._hittestDrawHelper,D=[];for(const s of j){const{projectedGeometry:t,symbolResource:e}=s;if(!e)continue;const{textInfo:i,symbolInfo:o}=e,r=o.cimSymbol,m=o.linearCIM.some(t=>"alignment"in t&&0===t.alignment),a={hittestType:d.hittestType,textInfo:i,mapRotation:l,resolution:n,searchDist:_,isScreenAligned:m};B.hitTest(g,r.symbol,t,a)&&D.push(s)}return D.sort(x),D.map(t=>t.objectId)}queryItems(t){return 0===this._items.size?[]:this._searchForItems(t)}clear(){this._items.clear(),this._index=null}async _updateItem(t,e){await t.projectAndNormalize(this._outSpatialReference),await e(t);const{size:s}=t;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(t.symbolBounds,t.symbolResource,t.geometryBounds,t.size,0)}_searchIndex(t,s,i,o){return this._boundsDirty&&(this._items.forEach(t=>this._getSymbolBounds(t.symbolBounds,t.symbolResource,t.geometryBounds,t.size,0)),this._boundsDirty=!1),this._index||(this._index=e(9,t=>({minX:t.symbolBounds[0],minY:t.symbolBounds[1],maxX:t.symbolBounds[2],maxY:t.symbolBounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:t,minY:s,maxX:i,maxY:o})}_searchForItems(t){const e=this._tileInfoView.spatialReference,s=t.bounds,o=l(e);if(o&&e.isWrappable){const[e,r]=o.valid,n=Math.abs(s[2]-r)<g,m=Math.abs(s[0]-e)<g;if((!n||!m)&&(n||m)){const o=t.resolution;let m;m=i(n?[e,s[1],e+o*f,s[3]]:[r-o*f,s[1],r,s[3]]);const l=this._searchIndex(s[0],s[1],s[2],s[3]),a=this._searchIndex(m[0],m[1],m[2],m[3]);return[...new Set([...l,...a])]}}return this._searchIndex(s[0],s[1],s[2],s[3])}_getSymbolBounds(e,s,o,r,m){if(!s||!s.symbolInfo.linearCIM)return null;if(e||(e=i()),n(e,o),!r||0===r[0]&&0===r[1]&&0===r[2]&&0===r[3]){const{textInfo:e,symbolInfo:i}=s,o=i.cimSymbol;r||(r=[0,0,0,0]);const n=h.getSymbolInflateSize(r,o.symbol,this._cimResourceManager,m,e);r[0]=t(n[0]),r[1]=t(n[1]),r[2]=t(n[2]),r[3]=t(n[3])}const l=this._resolution,a=h.safeSize(r);return e[0]-=a*l,e[1]-=a*l,e[2]+=a*l,e[3]+=a*l,e}}export{w as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{assertIsSome as s}from"../../../../core/maybe.js";import{debounce as r,isAbortError as a}from"../../../../core/promiseUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import h from"../../../../geometry/Extent.js";import c from"../../../../geometry/Point.js";import{isFunctionRaster as u}from"../../../../layers/raster/datasets/datasetUtils.js";import{update as d,unregister as p,getRasterId as y,register as m}from"../../../../layers/raster/datasets/RawBlockCache.js";import{getWorldWidth as g,computeProjectedScales as f}from"../../../../layers/raster/functions/rasterProjectionHelper.js";import{getStretchCutoff as _}from"../../../../layers/raster/functions/stretchUtils.js";import b from"../../../../layers/support/PixelBlock.js";import R from"../../../../layers/support/TileInfo.js";import w from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import P from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{tileSize as U}from"../../engine/webgl/definitions.js";import{readFromTiledRasterData as C}from"../../../support/rasterHitTestUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{getWebGLCapabilities as x}from"../../../webgl/capabilities.js";const v=[0,0];function F(e){return"geospatial-pdf"!==e.type}let D=class extends t{constructor(){super(...arguments),this._updatingHandles=new l,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.refreshDRAFunctionOnce=r(async()=>{const{fullExtent:e,view:t}=this.layerView;if(e?.intersects(t.extent))try{await this._updateDRAStatistics(this._abortController?.signal)&&await this.doRefresh()}catch{}}),this.redrawOrRefetch=r(async(e={})=>{if(!("rasterFunction"in this.layer))return this._updatingHandles.addPromise(e.refetch?this.doRefresh():this._redrawImage(e.signal));const t=this._rasterFunctionState,i=e.reprocess||"gpu"===t&&!this.canUseWebGLForProcessing||"cpu"===t&&this.canUseWebGLForProcessing;if(i&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const s=this._rasterFunctionState,{type:r}=this;return e.refetch||"raster"!==r&&!!i||"cpu"===s||"cpu"===t?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))})}destroy(){this._updatingHandles.destroy()}get canUseWebGLForProcessing(){return!1}get canUseLocalSymbolizerParams(){return(this.canUseWebGLForProcessing||"rasterVF"===this.type)&&!this.layerView.hasTilingEffects}get hasDRAInRasterFunction(){if(!("rasterFunction"in this.layer))return!1;const{rasterFunction:e}=this.layer;return!!e&&JSON.stringify(e,null,0).includes('"dra":true')}get isCPUBasedDRA(){const{renderer:e}=this.layer;return"raster-stretch"===e?.type&&e.dynamicRangeAdjustment&&(!this.canUseWebGLForProcessing||!("min-max"===e.stretchType||"standard-deviation"===e.stretchType))}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s="toJSON"in t?t:h.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null!=this._symbolizerParams&&this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){(this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate)&&(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&(this.hasDRAInRasterFunction?(this._globalUpdateRequested=!1,this.refreshDRAFunctionOnce()):this.isCPUBasedDRA&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const e=x();this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new w(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new P({tileInfoView:this._tileInfoView,concurrency:t,process:(e,t)=>this._fetchTile(e,t),priority:S.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,p(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}async hitTest(e){if(!F(this.layer))return null;const t=this._locateSourceData(e);if(!t)return null;const{layer:i}=this,s="vector-field"===i.renderer?.type,r=this.canUseWebGLForProcessing&&u(this.layer.raster);return C({mapPoint:e,layer:i,sourceData:t,processRasterFunction:r,sourceIsUV:s})}acquireTile(e){const t=this.container.createTile(e);return this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.size.join(",");if(t&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;e=e||this._tileInfoView.size;const[i,s]=e,r=new b({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_getBandIds(){if(!("bandIds"in this.layer))return this.layer.getRawDisplayBandIds();if(this.container&&(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain))return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,i="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):"rasterFunction"in t?i:e}updateRasterFunctionParameters(){}_fetchTile(e,t){const i=this._getFetchOptions(e.level,t.signal);return this.fetchTile(e,i)}_getFetchOptions(e,t){const{canUseWebGLForProcessing:i}=this,{layerView:s}=this,{tileInfo:r}=s,a=!r.isWrappable&&null!=g(s.view.spatialReference),o=i&&this.layer.raster.hasUniqueSourceStorageInfo,{layer:n}=this.layerView,l=n.serviceRasterInfo?.storageInfo.isBsqTile?n.getRawDisplayBandIds():void 0;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:i?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:o,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:t,srcResolution:this._srcResolutions[e],timeExtent:s.timeExtent,tileInfo:r,bandIds:l,disableWrapAround:a}}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:i,lods:s}=this.layer.tileInfo,r=s.map(({scale:e})=>e),a=R.create({spatialReference:t,size:U,scales:r,origin:i});return e.set("tileInfo",a),void(this._srcResolutions=s.map(({resolution:e})=>({x:e,y:e})))}const{scales:i,srcResolutions:r,isCustomTilingScheme:a}=f(this.layer.serviceRasterInfo,t,{tileSize:U,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),o=R.create({spatialReference:t,size:U,scales:i}),n=0===o.origin.x;s(e.fullExtent);const{xmin:l,ymax:h}=e.fullExtent;(n||a&&o.origin.x>l)&&(o.origin=new c({x:l,y:h,spatialReference:t})),this._isCustomTilingScheme=a,e.set("tileInfo",o),this._srcResolutions=r??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if("Map"!==e.raster.tileType)return!1;const{lods:i}=e.tileInfo,s=t.view.constraints?.effectiveLODs;return s?.length===i.length&&s.every(({scale:e},t)=>Math.abs(e-i[t].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.serviceRasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{let t=e.once("detach",()=>t=void 0);const r=await this._fetchQueue.push(e.key),o=this._getBandIds(),n=this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.stretchCutoff;let l=!this.useProgressiveUpdate||n||this.isCPUBasedDRA&&!this._globalSymbolizerParams;const h=this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length;if(h){if(l=!1,!this.hasDRAInRasterFunction)try{await this._redrawImage(this._abortController?.signal)}catch(s){a(s)&&i.getLogger(this).error(s)}this._globalUpdateRequested=!1}if(!t)return;this.canUseLocalSymbolizerParams&&null==this._symbolizerParams&&this._updateSymbolizerParams();const c=this._tileInfoView.getTileCoords(v,e.key),d=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:l,bandIds:o,coords:c,resolution:d}),t&&(e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e),t.remove()),h&&this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.extent?.equals(this.layerView.view.extent)&&this.refreshDRAFunctionOnce()}catch(s){a(s)||i.getLogger(this).error(s)}this.layerView.requestUpdate()}}async _updateDRAStatistics(e){if(!F(this.layer))return!1;if(!u(this.layer.raster))return!1;const t=await this.layer.getDynamicRangeInputRaster();if(!t)return!1;const{raster:i,functionArguments:s}=t,r=this._getFetchOptions(this.previousLOD.level,e),{extent:a,width:o,height:n}=this.layerView.view,{pixelBlock:l}=await i.fetchPixels(a,o,n,{...r,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1}),h=_(s,{rasterInfo:i.rasterInfo,pixelBlock:l});return this.layer.raster.processParameters={stretchCutoff:h,extent:a},!0}_locateSourceData(e){if(!this.layer.loaded||!this.attached)return null;const t=new Map,i=this.container.children.find(i=>{if(!i.visible)return!1;const s="bitmap"in i?i.bitmap?.rawPixelData:i.tileData?.rawPixelData;if(!s?.pixelBlock)return!1;const{key:r}=i,{level:a}=r;if(!t.has(a)){const i=this._tileInfoView.getLODInfoAt(a);if(!i)return!1;const s=Math.floor(i.getColumnForX(e.x)),r=Math.floor(i.getRowForY(e.y));t.set(a,[r,s])}const[o,n]=t.get(a);return o===r.row&&n===r.col});if(null==i)return null;if("tileData"in i){const{rawPixelData:e}=i.tileData;return e?.pixelBlock?{rawPixelData:e,tileSize:{width:i.width,height:i.height}}:null}const{rawPixelData:s,transformGrid:r,width:a,height:o}=i.bitmap;return s?.pixelBlock?{rawPixelData:s,transformGrid:r,tileSize:{width:a,height:o}}:null}async _redrawImage(e){if(!this.attached||0===this.container.children.length)return;if("updateRenderer"in this.layer&&await this.layer.updateRenderer(),this.isCPUBasedDRA?await this._updateGlobalSymbolizerParams(e):(this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._globalSymbolizerParams=null),!this.attached||e?.aborted)return;const t=this.container.children.map(async t=>this.updateTileSymbolizerParameters(t,{local:this._symbolizerParams,global:this._globalSymbolizerParams},e));await Promise.allSettled(t),this.attached&&!e?.aborted&&this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const{fullExtent:t,view:i}=this.layerView;if(!t?.intersects(i.extent))return;const s=this._getFetchOptions(this.previousLOD.level,e),r=await this.layer.fetchPixels(i.extent,i.width,i.height,{...s,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:a}=this.previousLOD,{isBsqTile:o}=this.layer.raster.rasterInfo.storageInfo,n=o?null:this._getBandIds(),l=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(n),isGCS:i.spatialReference.isGeographic,resolution:{x:a,y:a},bandIds:n});!this.canUseWebGLForProcessing&&l&&"stretch"===l.type&&"raster-stretch"===this.layer.renderer?.type&&(l.factor=l.factor.map(e=>255*e),l.minOutput=Math.round(255*l.minOutput),l.maxOutput=Math.round(255*l.maxOutput)),this._globalSymbolizerParams=l}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:i}=this,{raster:s}=t;let r=null,a=null,o=s;if("multidimensionalDefinition"in t){const{multidimensionalDefinition:e}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:i.timeExtent});r=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(e)??null:null,a=s.rasterInfo.storageInfo.isBsqTile?t.getRawDisplayBandIds():null,o=u(s)?s.primaryRasters.rasters[0]??s:s}const n=y(o.rasterId,r,a);if(n!==this._blockCacheRegistryUrl){null!=this._blockCacheRegistryUrl&&p(this._blockCacheRegistryUrl,this._blockCacheRegistryId);const t=o.rawBlockRegistryIds.indexOf(this._blockCacheRegistryId);if(t>-1&&o.rawBlockRegistryIds.splice(t,1),this._blockCacheRegistryId=m(n,o.rasterInfo),o.rawBlockRegistryIds.push(this._blockCacheRegistryId),e){const{view:e}=i,t=this._tileInfoView.getClosestInfoForScale(e.scale),r=this._srcResolutions[t.level];d(n,this._blockCacheRegistryId,e.extent,e.resolution,r,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;"updateRenderer"in this.layer&&await this._updatingHandles.addPromise(this.layer.updateRenderer()),this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,this._tileStrategy.refresh(t=>e.push(this._enqueueTileFetch(t))),await this._updatingHandles.addPromise(Promise.allSettled(e))}};e([o()],D.prototype,"_globalUpdateRequested",void 0),e([o()],D.prototype,"attached",void 0),e([o()],D.prototype,"canUseWebGLForProcessing",null),e([o()],D.prototype,"canUseLocalSymbolizerParams",null),e([o()],D.prototype,"hasDRAInRasterFunction",null),e([o()],D.prototype,"isCPUBasedDRA",null),e([o()],D.prototype,"container",void 0),e([o()],D.prototype,"layer",void 0),e([o()],D.prototype,"layerView",void 0),e([o()],D.prototype,"scheduler",void 0),e([o()],D.prototype,"type",void 0),e([o()],D.prototype,"useWebGLForProcessing",null),e([o()],D.prototype,"useProgressiveUpdate",null),e([o()],D.prototype,"timeExtent",void 0),e([o()],D.prototype,"updating",null),D=e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],D);export{D as BaseImageryTileSubView2D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{assertIsSome as s}from"../../../../core/maybe.js";import{debounce as r,isAbortError as a}from"../../../../core/promiseUtils.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import h from"../../../../geometry/Extent.js";import c from"../../../../geometry/Point.js";import{isFunctionRaster as u}from"../../../../layers/raster/datasets/datasetUtils.js";import{update as d,unregister as p,getRasterId as y,register as m}from"../../../../layers/raster/datasets/RawBlockCache.js";import{getWorldWidth as g,computeProjectedScales as f}from"../../../../layers/raster/functions/rasterProjectionHelper.js";import{getStretchCutoff as _}from"../../../../layers/raster/functions/stretchUtils.js";import b from"../../../../layers/support/PixelBlock.js";import R from"../../../../layers/support/TileInfo.js";import w from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import P from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{tileSize as U}from"../../engine/webgl/definitions.js";import{readFromTiledRasterData as C}from"../../../support/rasterHitTestUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{getWebGLCapabilities as x}from"../../../webgl/capabilities.js";const v=[0,0];function F(e){return"geospatial-pdf"!==e.type}let D=class extends t{constructor(){super(...arguments),this._updatingHandles=new l,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.refreshDRAFunctionOnce=r(async()=>{const{fullExtent:e,view:t}=this.layerView;if(e?.intersects(t.extent))try{await this._updateDRAStatistics(this._abortController?.signal)&&await this.doRefresh()}catch{}}),this.redrawOrRefetch=r(async(e={})=>{if(!("rasterFunction"in this.layer))return this._updatingHandles.addPromise(e.refetch?this.doRefresh():this._redrawImage(e.signal));const t=this._rasterFunctionState,i=e.reprocess||"gpu"===t&&!this.canUseWebGLForProcessing||"cpu"===t&&this.canUseWebGLForProcessing;if(i&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const s=this._rasterFunctionState,{type:r}=this;return e.refetch||"raster"!==r&&!!i||"cpu"===s||"cpu"===t?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))})}destroy(){this._updatingHandles.destroy()}get canUseWebGLForProcessing(){return!1}get canUseLocalSymbolizerParams(){return(this.canUseWebGLForProcessing||"rasterVF"===this.type)&&!this.layerView.hasTilingEffects}get hasDRAInRasterFunction(){if(!("rasterFunction"in this.layer))return!1;const{rasterFunction:e}=this.layer;return!!e&&JSON.stringify(e,null,0).includes('"dra":true')}get isCPUBasedDRA(){if(!("renderer"in this.layer))return!1;const{renderer:e}=this.layer;return"raster-stretch"===e?.type&&e.dynamicRangeAdjustment&&(!this.canUseWebGLForProcessing||!("min-max"===e.stretchType||"standard-deviation"===e.stretchType))}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s="toJSON"in t?t:h.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null!=this._symbolizerParams&&this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){(this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate)&&(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&(this.hasDRAInRasterFunction?(this._globalUpdateRequested=!1,this.refreshDRAFunctionOnce()):this.isCPUBasedDRA&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const e=x();this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new w(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new P({tileInfoView:this._tileInfoView,concurrency:t,process:(e,t)=>this._fetchTile(e,t),priority:S.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,p(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}async hitTest(e){if(!F(this.layer))return null;const t=this._locateSourceData(e);if(!t)return null;const{layer:i}=this,s="vector-field"===i.renderer?.type,r=this.canUseWebGLForProcessing&&u(this.layer.raster);return C({mapPoint:e,layer:i,sourceData:t,processRasterFunction:r,sourceIsUV:s})}acquireTile(e){const t=this.container.createTile(e);return this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.size.join(",");if(t&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;e=e||this._tileInfoView.size;const[i,s]=e,r=new b({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_getBandIds(){if(!("bandIds"in this.layer))return this.layer.getRawDisplayBandIds();if(this.container&&(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain))return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,i="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):"rasterFunction"in t?i:e}updateRasterFunctionParameters(){}_fetchTile(e,t){const i=this._getFetchOptions(e.level,t.signal);return this.fetchTile(e,i)}_getFetchOptions(e,t){const{canUseWebGLForProcessing:i}=this,{layerView:s}=this,{tileInfo:r}=s,a=!r.isWrappable&&null!=g(s.view.spatialReference),n=i&&this.layer.raster.hasUniqueSourceStorageInfo,{layer:o}=this.layerView,l=o.serviceRasterInfo?.storageInfo.isBsqTile?o.getRawDisplayBandIds():void 0;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:i?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:n,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:t,srcResolution:this._srcResolutions[e],timeExtent:s.timeExtent,tileInfo:r,bandIds:l,disableWrapAround:a}}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:i,lods:s}=this.layer.tileInfo,r=s.map(({scale:e})=>e),a=R.create({spatialReference:t,size:U,scales:r,origin:i});return e.set("tileInfo",a),void(this._srcResolutions=s.map(({resolution:e})=>({x:e,y:e})))}const{scales:i,srcResolutions:r,isCustomTilingScheme:a}=f(this.layer.serviceRasterInfo,t,{tileSize:U,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),n=R.create({spatialReference:t,size:U,scales:i}),o=0===n.origin.x;s(e.fullExtent);const{xmin:l,ymax:h}=e.fullExtent;(o||a&&n.origin.x>l)&&(n.origin=new c({x:l,y:h,spatialReference:t})),this._isCustomTilingScheme=a,e.set("tileInfo",n),this._srcResolutions=r??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if("Map"!==e.raster.tileType)return!1;const{lods:i}=e.tileInfo,s=t.view.constraints?.effectiveLODs;return s?.length===i.length&&s.every(({scale:e},t)=>Math.abs(e-i[t].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.serviceRasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{let t=e.once("detach",()=>t=void 0);const r=await this._fetchQueue.push(e.key),n=this._getBandIds(),o=this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.stretchCutoff;let l=!this.useProgressiveUpdate||o||this.isCPUBasedDRA&&!this._globalSymbolizerParams;const h=this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length;if(h){if(l=!1,!this.hasDRAInRasterFunction)try{await this._redrawImage(this._abortController?.signal)}catch(s){a(s)&&i.getLogger(this).error(s)}this._globalUpdateRequested=!1}if(!t)return;this.canUseLocalSymbolizerParams&&null==this._symbolizerParams&&this._updateSymbolizerParams();const c=this._tileInfoView.getTileCoords(v,e.key),d=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:l,bandIds:n,coords:c,resolution:d}),t&&(e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e),t.remove()),h&&this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.extent?.equals(this.layerView.view.extent)&&this.refreshDRAFunctionOnce()}catch(s){a(s)||i.getLogger(this).error(s)}this.layerView.requestUpdate()}}async _updateDRAStatistics(e){if(!F(this.layer))return!1;if(!u(this.layer.raster))return!1;const t=await this.layer.getDynamicRangeInputRaster();if(!t)return!1;const{raster:i,functionArguments:s}=t,r=this._getFetchOptions(this.previousLOD.level,e),{extent:a,width:n,height:o}=this.layerView.view,{pixelBlock:l}=await i.fetchPixels(a,n,o,{...r,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1}),h=_(s,{rasterInfo:i.rasterInfo,pixelBlock:l});return this.layer.raster.processParameters={stretchCutoff:h,extent:a},!0}_locateSourceData(e){if(!this.layer.loaded||!this.attached)return null;const t=new Map,i=this.container.children.find(i=>{if(!i.visible)return!1;const s="bitmap"in i?i.bitmap?.rawPixelData:i.tileData?.rawPixelData;if(!s?.pixelBlock)return!1;const{key:r}=i,{level:a}=r;if(!t.has(a)){const i=this._tileInfoView.getLODInfoAt(a);if(!i)return!1;const s=Math.floor(i.getColumnForX(e.x)),r=Math.floor(i.getRowForY(e.y));t.set(a,[r,s])}const[n,o]=t.get(a);return n===r.row&&o===r.col});if(null==i)return null;if("tileData"in i){const{rawPixelData:e}=i.tileData;return e?.pixelBlock?{rawPixelData:e,tileSize:{width:i.width,height:i.height}}:null}const{rawPixelData:s,transformGrid:r,width:a,height:n}=i.bitmap;return s?.pixelBlock?{rawPixelData:s,transformGrid:r,tileSize:{width:a,height:n}}:null}async _redrawImage(e){if(!this.attached||0===this.container.children.length)return;if("updateRenderer"in this.layer&&await this.layer.updateRenderer(),this.isCPUBasedDRA?await this._updateGlobalSymbolizerParams(e):(this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._globalSymbolizerParams=null),!this.attached||e?.aborted)return;const t=this.container.children.map(async t=>this.updateTileSymbolizerParameters(t,{local:this._symbolizerParams,global:this._globalSymbolizerParams},e));await Promise.allSettled(t),this.attached&&!e?.aborted&&this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const{fullExtent:t,view:i}=this.layerView;if(!t?.intersects(i.extent))return;if(!("symbolizer"in this.layer))return;const s=this._getFetchOptions(this.previousLOD.level,e),r=await this.layer.fetchPixels(i.extent,i.width,i.height,{...s,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:a}=this.previousLOD,{isBsqTile:n}=this.layer.raster.rasterInfo.storageInfo,o=n?null:this._getBandIds(),l=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(o),isGCS:i.spatialReference.isGeographic,resolution:{x:a,y:a},bandIds:o});!this.canUseWebGLForProcessing&&l&&"stretch"===l.type&&"raster-stretch"===this.layer.renderer?.type&&(l.factor=l.factor.map(e=>255*e),l.minOutput=Math.round(255*l.minOutput),l.maxOutput=Math.round(255*l.maxOutput)),this._globalSymbolizerParams=l}_updateSymbolizerParams(){if(!("symbolizer"in this.layer))return;const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:i}=this,{raster:s}=t;let r=null,a=null,n=s;if("multidimensionalDefinition"in t){const{multidimensionalDefinition:e}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:i.timeExtent});r=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(e)??null:null,a=s.rasterInfo.storageInfo.isBsqTile?t.getRawDisplayBandIds():null,n=u(s)?s.primaryRasters.rasters[0]??s:s}const o=y(n.rasterId,r,a);if(o!==this._blockCacheRegistryUrl){null!=this._blockCacheRegistryUrl&&p(this._blockCacheRegistryUrl,this._blockCacheRegistryId);const t=n.rawBlockRegistryIds.indexOf(this._blockCacheRegistryId);if(t>-1&&n.rawBlockRegistryIds.splice(t,1),this._blockCacheRegistryId=m(o,n.rasterInfo),n.rawBlockRegistryIds.push(this._blockCacheRegistryId),e){const{view:e}=i,t=this._tileInfoView.getClosestInfoForScale(e.scale),r=this._srcResolutions[t.level];d(o,this._blockCacheRegistryId,e.extent,e.resolution,r,s.ioConfig.sampling)}this._blockCacheRegistryUrl=o}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;"updateRenderer"in this.layer&&await this._updatingHandles.addPromise(this.layer.updateRenderer()),this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,this._tileStrategy.refresh(t=>e.push(this._enqueueTileFetch(t))),await this._updatingHandles.addPromise(Promise.allSettled(e))}};e([n()],D.prototype,"_globalUpdateRequested",void 0),e([n()],D.prototype,"attached",void 0),e([n()],D.prototype,"canUseWebGLForProcessing",null),e([n()],D.prototype,"canUseLocalSymbolizerParams",null),e([n()],D.prototype,"hasDRAInRasterFunction",null),e([n()],D.prototype,"isCPUBasedDRA",null),e([n()],D.prototype,"container",void 0),e([n()],D.prototype,"layer",void 0),e([n()],D.prototype,"layerView",void 0),e([n()],D.prototype,"scheduler",void 0),e([n()],D.prototype,"type",void 0),e([n()],D.prototype,"useWebGLForProcessing",null),e([n()],D.prototype,"useProgressiveUpdate",null),e([n()],D.prototype,"timeExtent",void 0),e([n()],D.prototype,"updating",null),D=e([o("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],D);export{D as BaseImageryTileSubView2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import has from"../../../../core/has.js";import{numberMaxFloat32 as t}from"../../../../core/mathUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{isFunctionRaster as s}from"../../../../layers/raster/datasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/raster/formats/pixelRangeUtils.js";import{convertGeometryToMask as o}from"../../../../layers/raster/functions/clipUtils.js";import{maxMapSizeGpu as a}from"../../../../layers/raster/functions/pixelUtils.js";import{RasterTileContainer as l}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as c}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as h}from"../support/util.js";import{defaultColor as d}from"../../../support/HighlightDefaults.js";import{getHighlightName as p}from"../../../support/highlightOptionsUtils.js";const u=[1024,1024];let g=class extends c{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t||this.hasDRAInRasterFunction)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo),o=has("ios")&&s>4,a="geospatial-pdf"!==this.layer.type&&"majority"===this.layer.interpolation&&h(this.layer);return!o&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!a}attach(){super.attach(),this.container=new l(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t||"geospatial-pdf"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:n}=e,o=s.supportsGPU&&(!n||n.rasters.length<=1),a=o?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!o||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const h=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",d=i===h||"na"===i&&"cpu"===h&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!d,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=h}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{source:a,globalSymbolizerParams:l,suspended:c,coords:h,resolution:d}=t,p=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:u}=e;if([u.x,u.y]=h,u.resolution=d,null!=a?.pixelBlock){const e={extent:a.extent,pixelBlock:a.pixelBlock,srcExtent:a.srcExtent,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=e,n)u.source=a.pixelBlock,u.isRenderedSource=!1;else{const t=await this._renderTileData(e,l);u.source=t,u.isRenderedSource=!0}u.symbolizerParameters=n?p:null,u.transformGrid=n?a.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();u.source=e,u.symbolizerParameters=n?p:null,u.transformGrid=null}const{isBsqTile:g}=this.layer.raster.rasterInfo.storageInfo;u.bandIds=n&&!g?r:null,u.width=this._tileInfoView.size[0],u.height=this._tileInfoView.size[1],u.interpolation=i,u.suspended=c;const{raster:m}=this.layer;if(s(m)){const t=m.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=m.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(u.mask=o({srcExtent:r,geometry:t,size:[u.width,u.height]}))}}u.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:i,global:s}=t,n=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;if(a||null==c)l.isRenderedSource&&null!=c&&(l.source=c.pixelBlock),l.isRenderedSource=!1;else{const e=await this._renderTileData(c,s,r);l.source=e,l.isRenderedSource=!0}l.symbolizerParameters=a?this.layerView.hasTilingEffects?s:i:null;const{isBsqTile:h}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!h?n:null,l.interpolation=o,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const r=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===p(t.options))-i.findIndex(({name:t})=>t===p(e.options)));for(const{target:s,options:n}of e){const{pixelRanges:e}=s,l=p(n),c=(i.find(e=>e.name===l)?.color??d).toUnitRGBA();if(0===c[3]&&(c[3]=.01),Array.isArray(e)){const i=Array.from({length:2*a},()=>0);for(let t=0;t<e.length;t++)i[2*t]=e[t][0],i[2*t+1]=e[t][1];for(let r=e.length;r<a;r++)i[2*r]=t,i[2*r+1]=-t;const n=s.bandId??0;r.push({ranges:i,bandId:n,color:c,type:"single-band"})}else{const t="extent"===e.type?e:e.extent;if(!t)continue;const i=[t.xmin,t.xmax],n=[t.ymin,t.ymax],{xBandId:a,yBandId:l}=s,h={xRange:i,yRange:n,bandIds:[a,l],color:c,type:"xy-band"};"polygon"===e.type&&(h.maskSize=u,h.mask=o({srcExtent:t,geometry:e,size:u})),r.push(h)}}this.container.pixelHighlights=r,this.canUseWebGLForProcessing||this.doRefresh()}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}_convertPixelHighlights(){return this.container?.pixelHighlights?.map(e=>{const r=e.color.map(e=>Math.round(255*e));if("single-band"===e.type){const i=e.ranges.indexOf(t),s=[],n=-1===i?e.ranges.length/2:i/2;for(let t=0;t<n;t++)s.push([e.ranges[2*t],e.ranges[2*t+1]]);return{bandId:e.bandId,color:r,ranges:s}}return{color:r,xBandId:e.bandIds[0],yBandId:e.bandIds[1],xBandRange:e.xRange,yBandRange:e.yRange,width:e.maskSize?.[0],height:e.maskSize?.[1],xyMask:e.mask}})}async _renderTileData(e,t,r){if(!e.pixelBlock)return null;if("geospatial-pdf"===this.layer.type)return e.pixelBlock;const i=await this.layer.applyRenderer(e,"stretch"===t?.type?t:void 0,{signal:r}),s=this._convertPixelHighlights();return i&&s&&await this.layer.highlightPixels({pixelBlock:e.pixelBlock.extractBands(this.layer.bandIds),renderedPixelBlock:i,highlightOptions:s},{signal:r}),i}};e([r()],g.prototype,"canUseWebGLForProcessing",null),e([r()],g.prototype,"container",void 0),e([r()],g.prototype,"layer",void 0),e([r()],g.prototype,"type",void 0),g=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],g);export{g as default};
2
+ import{__decorate as e}from"tslib";import has from"../../../../core/has.js";import{numberMaxFloat32 as t}from"../../../../core/mathUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{isFunctionRaster as s}from"../../../../layers/raster/datasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/raster/formats/pixelRangeUtils.js";import{convertGeometryToMask as o}from"../../../../layers/raster/functions/clipUtils.js";import{maxMapSizeGpu as a}from"../../../../layers/raster/functions/pixelUtils.js";import{RasterTileContainer as l}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as c}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as h}from"../support/util.js";import{defaultColor as d}from"../../../support/HighlightDefaults.js";import{getHighlightName as p}from"../../../support/highlightOptionsUtils.js";const u=[1024,1024];let m=class extends c{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){if(!("symbolizer"in this.layer))return!0;const{loaded:e,symbolizer:t}=this.layer;if(!e||!t||this.hasDRAInRasterFunction)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo),o=has("ios")&&s>4,a="majority"===this.layer.interpolation&&h(this.layer);return!o&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!a}attach(){super.attach(),this.container=new l(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t||"geospatial-pdf"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:n}=e,o=s.supportsGPU&&(!n||n.rasters.length<=1),a=o?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!o||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const h=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",d=i===h||"na"===i&&"cpu"===h&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!d,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=h}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{source:a,globalSymbolizerParams:l,suspended:c,coords:h,resolution:d}=t,p=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:u}=e;if([u.x,u.y]=h,u.resolution=d,null!=a?.pixelBlock){const e={extent:a.extent,pixelBlock:a.pixelBlock,srcExtent:a.srcExtent,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=e,n)u.source=a.pixelBlock,u.isRenderedSource=!1;else{const t=await this._renderTileData(e,l);u.source=t,u.isRenderedSource=!0}u.symbolizerParameters=n?p:null,u.transformGrid=n?a.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();u.source=e,u.symbolizerParameters=n?p:null,u.transformGrid=null}const{isBsqTile:m}=this.layer.raster.rasterInfo.storageInfo;u.bandIds=n&&!m?r:null,u.width=this._tileInfoView.size[0],u.height=this._tileInfoView.size[1],u.interpolation=i,u.suspended=c;const{raster:g}=this.layer;if(s(g)){const t=g.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=g.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(u.mask=o({srcExtent:r,geometry:t,size:[u.width,u.height]}))}}u.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:i,global:s}=t,n=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;if(a||null==c)l.isRenderedSource&&null!=c&&(l.source=c.pixelBlock),l.isRenderedSource=!1;else{const e=await this._renderTileData(c,s,r);l.source=e,l.isRenderedSource=!0}l.symbolizerParameters=a?this.layerView.hasTilingEffects?s:i:null;const{isBsqTile:h}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!h?n:null,l.interpolation=o,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const r=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===p(t.options))-i.findIndex(({name:t})=>t===p(e.options)));for(const{target:s,options:n}of e){const{pixelRanges:e}=s,l=p(n),c=(i.find(e=>e.name===l)?.color??d).toUnitRGBA();if(0===c[3]&&(c[3]=.01),Array.isArray(e)){const i=Array.from({length:2*a},()=>0);for(let t=0;t<e.length;t++)i[2*t]=e[t][0],i[2*t+1]=e[t][1];for(let r=e.length;r<a;r++)i[2*r]=t,i[2*r+1]=-t;const n=s.bandId??0;r.push({ranges:i,bandId:n,color:c,type:"single-band"})}else{const t="extent"===e.type?e:e.extent;if(!t)continue;const i=[t.xmin,t.xmax],n=[t.ymin,t.ymax],{xBandId:a,yBandId:l}=s,h={xRange:i,yRange:n,bandIds:[a,l],color:c,type:"xy-band"};"polygon"===e.type&&(h.maskSize=u,h.mask=o({srcExtent:t,geometry:e,size:u})),r.push(h)}}this.container.pixelHighlights=r,this.canUseWebGLForProcessing||this.doRefresh()}_getLayerInterpolation(){if(!("renderer"in this.layer))return"bilinear";const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}_convertPixelHighlights(){return this.container?.pixelHighlights?.map(e=>{const r=e.color.map(e=>Math.round(255*e));if("single-band"===e.type){const i=e.ranges.indexOf(t),s=[],n=-1===i?e.ranges.length/2:i/2;for(let t=0;t<n;t++)s.push([e.ranges[2*t],e.ranges[2*t+1]]);return{bandId:e.bandId,color:r,ranges:s}}return{color:r,xBandId:e.bandIds[0],yBandId:e.bandIds[1],xBandRange:e.xRange,yBandRange:e.yRange,width:e.maskSize?.[0],height:e.maskSize?.[1],xyMask:e.mask}})}async _renderTileData(e,t,r){if(!e.pixelBlock)return null;if("geospatial-pdf"===this.layer.type)return e.pixelBlock;const i=await this.layer.applyRenderer(e,"stretch"===t?.type?t:void 0,{signal:r}),s=this._convertPixelHighlights();return i&&s&&await this.layer.highlightPixels({pixelBlock:e.pixelBlock.extractBands(this.layer.bandIds),renderedPixelBlock:i,highlightOptions:s},{signal:r}),i}};e([r()],m.prototype,"canUseWebGLForProcessing",null),e([r()],m.prototype,"container",void 0),e([r()],m.prototype,"layer",void 0),e([r()],m.prototype,"type",void 0),m=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../Graphic.js";import{isSome as t}from"../../../core/arrayUtils.js";import{isIterable as r}from"../../../core/iteratorUtils.js";import{isScreenPolygon as i,isScreenRect as n,isScreenPoint as o,createScreenPoint as a,clipRectToView as s,createScreenRect as l}from"../../../core/screenUtils.js";import p from"../../../geometry/Point.js";import{fromValues as c}from"../../../geometry/support/aaBoundingRect.js";import{targetIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{clipPolygonToExtent as u}from"../../../geometry/support/polygonExtentClipping.js";import{calculateArea2D as y}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{clipContainsPoint as m,createScreenExtent as h}from"./clippingUtils.js";import{isSupportedScreenPointEvent as d,createScreenPointFromSupportedEvent as g}from"../../support/screenUtils.js";function x(e,t){if(i(e))return{hittestType:"polygon",polygonMesh:null,input:e,options:t};if(n(e)){return{hittestType:"rect",input:e,options:t}}return o(e)?{hittestType:"point",input:e,options:t}:null}async function w(e,r,o){const a=!d(r)&&n(r),l=!d(r)&&i(r),c=a||l,f=a?s(r,e.width,e.height):d(r)?g(e,r):r,u=i(f)?f.length<3||f.some(({x:e,y:t})=>isNaN(e)||isNaN(t)):isNaN(f.x)||isNaN(f.y);let y=new p;if(c||(y=e.toMap(f)),!e.ready||u)return{screenPoint:null,results:[]};let m=new Set;const h=new Set;let x=!1,w=null,L=null;o?.include?j(o.include,M(e,e=>{m.add(e),V(e,e=>h.add(e))},(e,t)=>{h.add(e),m.add(t)},e=>{w||(w=new Set),w.add(e)},e=>m.add(e),()=>x=!0)):(x=!0,m=new Set(e.allLayerViews),m.forEach(e=>{V(e,e=>h.add(e))})),o?.exclude&&j(o.exclude,M(e,e=>{m.delete(e),V(e,e=>h.delete(e))},e=>h.delete(e),e=>{L||(L=new Set),L.add(e)}));const P=e.allLayerViews.filter(e=>!e.suspended&&m.has(e)).reverse(),S=x?e.graphicsView.hitTest(e,f).map(e=>({type:"graphic",graphic:e,layer:null,mapPoint:c?null:y})):[],T=Array.from(P).flatMap(t=>b(e,t,f).map(e=>t.hitTest(y,e,o)));let U=[...S,...await Promise.all(T)].filter(t).flat().filter(t);U=U.filter(e=>"graphic"!==e.type||"subtype-group"!==e.layer?.type||h.has(e.graphic.layer));const E=new Set;return U=U.filter(e=>{if("graphic"!==e.type||!e.graphic)return!0;const t=N(e.graphic);return!E.has(t)&&(E.add(t),!0)}),w&&(U=U.filter(e=>!("graphic"in e)||!e.graphic||w?.has(N(e.graphic)))),L&&(U=U.filter(e=>!("graphic"in e)||!e.graphic||!L?.has(N(e.graphic)))),{screenPoint:c?null:f,results:U}}function M(t,r,i,n,o,a){return s=>{if(s instanceof e){if(s.layer===t)a?.();else{const e=t.allLayerViews.find(e=>e.layer===s.layer);e&&o?.(e)}n(N(s))}else if("layer"in s&&"element"in s);else if("subtype-sublayer"===s.type){const e=t.allLayerViews.find(e=>e.layer===s.parent);e&&i(s,e)}else{const e=t.allLayerViews.find(e=>e.layer===s);e&&r(e)}}}function j(e,t){if(e)if(r(e))for(const i of e)if(r(i))for(const e of i)t(e);else t(i);else t(e)}function N(e){const t=e.getObjectId();return t?`${e.layer?.uid??e.sourceLayer?.uid??"MapView"}/${t}`:`"MapView/${e.uid}`}function V(e,t){const r=e.layer;"subtype-group"===r?.type&&r.sublayers.forEach(e=>{t(e)})}function b(e,t,r){const{clips:s}=t;if(!s.length)return[r];if(o(r)){const t=e.toMap(r);return s.some(i=>m(e,i,r,t))?[r]:[]}if(s.some(e=>"rect"!==e.type))return[r];const p=s.filter(e=>"rect"===e.type),d=T(r),g=[];for(const o of p){const{xmin:t,xmax:s,ymin:p,ymax:m}=h(o,e.width,e.height);if(f(d,[[[t,p],[t,m],[s,m],[s,p],[t,p]]])){const e=u(d,c(t,p,s,m));if(!(y([e.map(e=>[e[0],e[1]])])>0))continue;if(n(r)){const t=S(e.map(e=>[e]));g.push(l(t.xmin,t.ymin,t.xmax-t.xmin,t.ymax-t.ymin))}else i(r)&&g.push(e.map(e=>a(e[0],e[1])))}}return g}function L(e,t){if(i(t))return t.map(t=>e.toMap(t));if(n(t)){const r=t;return[e.toMap(a(r.x,r.y)),e.toMap(a(r.x,r.y+r.height)),e.toMap(a(r.x+r.width,r.y+r.height)),e.toMap(a(r.x+r.width,r.y))]}return[e.toMap(t)]}function P(e){return i(e)?"polygon":n(e)?"rect":o(e)?"point":null}function S(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const o of e)for(const[e,a]of o)t=Math.min(t,e),r=Math.min(r,a),i=Math.max(i,e),n=Math.max(n,a);return{xmin:t,ymin:r,xmax:i,ymax:n}}function T(e){let t=[];if(n(e)){const{x:r,y:i,width:n,height:o}=e;t=[[r,i],[r+n,i],[r+n,i+o],[r,i+o]]}else i(e)?t=e.map(e=>[e.x,e.y]):o(e)&&(t=[[e.x,e.y]]);return t}export{x as createHittestQuery,S as getBbox,P as getHittestType,b as getLayerViewHitTargets,L as getMapPointsFromScreen,w as hitTest,T as screenTargetToPointArray};
2
+ import e from"../../../Graphic.js";import{isSome as t}from"../../../core/arrayUtils.js";import{isIterable as r}from"../../../core/iteratorUtils.js";import{isScreenPolygon as i,isScreenRect as n,isScreenPoint as o,createScreenPoint as s,clipRectToView as a,createScreenRect as l}from"../../../core/screenUtils.js";import p from"../../../geometry/Point.js";import{fromValues as c}from"../../../geometry/support/aaBoundingRect.js";import{targetIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{clipPolygonToExtent as u}from"../../../geometry/support/polygonExtentClipping.js";import{calculateArea2D as y}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{clipContainsPoint as h,createScreenExtent as m}from"./clippingUtils.js";import{isSupportedScreenPointEvent as d,createScreenPointFromSupportedEvent as g}from"../../support/screenUtils.js";function w(e,t){if(i(e))return{hittestType:"polygon",polygonMesh:null,input:e,options:t};if(n(e)){return{hittestType:"rect",input:e,options:t}}return o(e)?{hittestType:"point",input:e,options:t}:null}async function x(e,r,o){const s=!d(r)&&n(r),l=!d(r)&&i(r),c=s||l,f=s?a(r,e.width,e.height):d(r)?g(e,r):r,u=i(f)?f.length<3||f.some(({x:e,y:t})=>isNaN(e)||isNaN(t)):isNaN(f.x)||isNaN(f.y);let y=new p;if(c||(y=e.toMap(f)),!e.ready||u)return{screenPoint:null,results:[]};let h=new Set;const m=new Set;let w=!1,x=null,L=null;o?.include?j(o.include,M(e,e=>{h.add(e),V(e,e=>m.add(e))},(e,t)=>{m.add(e),h.add(t)},e=>{x||(x=new Set),x.add(e)},e=>h.add(e),()=>w=!0)):(w=!0,h=new Set(e.allLayerViews),h.forEach(e=>{V(e,e=>m.add(e))})),o?.exclude&&j(o.exclude,M(e,e=>{h.delete(e),V(e,e=>m.delete(e))},e=>m.delete(e),e=>{L||(L=new Set),L.add(e)}));const P=e.allLayerViews.filter(e=>!e.suspended&&h.has(e)).reverse(),S=w?e.graphicsView.hitTest(e,f).map(e=>({type:"graphic",graphic:e,layer:null,mapPoint:c?null:y})):[],T=Array.from(P).flatMap(t=>b(e,t,f).map(e=>t.hitTest(y,e,o)));let U=[...S,...await Promise.all(T)].filter(t).flat().filter(t);U=U.filter(e=>"graphic"!==e.type||"subtype-group"!==e.layer?.type||m.has(e.graphic.layer));const E=new Set;return U=U.filter(e=>{if("graphic"!==e.type||!e.graphic)return!0;const t=N(e.graphic);return!E.has(t)&&(E.add(t),!0)}),x&&(U=U.filter(e=>!("graphic"in e)||!e.graphic||x?.has(N(e.graphic)))),L&&(U=U.filter(e=>!("graphic"in e)||!e.graphic||!L?.has(N(e.graphic)))),{screenPoint:c?null:f,results:U}}function M(t,r,i,n,o,s){return a=>{if(a instanceof e){if(a.layer===t)s?.();else{const e=t.allLayerViews.find(e=>e.layer===a.layer);e&&o?.(e)}n(N(a))}else if("layer"in a&&"element"in a);else if("subtype-sublayer"===a.type){const e=t.allLayerViews.find(e=>e.layer===a.parent);e&&i(a,e)}else{const e=t.allLayerViews.find(e=>e.layer===a);e&&r(e)}}}function j(e,t){if(e)if(r(e))for(const i of e)if(r(i))for(const e of i)t(e);else t(i);else t(e)}function N(e){const t=e.getObjectId();return t?`${e.layer?.uid??e.sourceLayer?.uid??"MapView"}/${t}`:`"MapView/${e.uid}`}function V(e,t){const r=e.layer;"subtype-group"===r?.type&&r.sublayers.forEach(e=>{t(e)})}function b(e,t,r){const{clips:a}=t;if(!a.length)return[r];if(o(r)){const t=e.toMap(r);return a.some(i=>h(e,i,r,t))?[r]:[]}if(a.some(e=>"rect"!==e.type))return[r];const p=a.filter(e=>"rect"===e.type),d=T(r),g=[];for(const o of p){const{xmin:t,xmax:a,ymin:p,ymax:h}=m(o,e.width,e.height);if(f(d,[[[t,p],[t,h],[a,h],[a,p],[t,p]]])){const e=u(d,c(t,p,a,h));if(!(y([e.map(e=>[e[0],e[1]])])>0))continue;if(n(r)){const t=S(e.map(e=>[e]));g.push(l(t[0],t[1],t[2]-t[0],t[3]-t[1]))}else i(r)&&g.push(e.map(e=>s(e[0],e[1])))}}return g}function L(e,t){if(i(t))return t.map(t=>e.toMap(t));if(n(t)){const r=t;return[e.toMap(s(r.x,r.y)),e.toMap(s(r.x,r.y+r.height)),e.toMap(s(r.x+r.width,r.y+r.height)),e.toMap(s(r.x+r.width,r.y))]}return[e.toMap(t)]}function P(e){return i(e)?"polygon":n(e)?"rect":o(e)?"point":null}function S(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const o of e)for(const[e,s]of o)t=Math.min(t,e),r=Math.min(r,s),i=Math.max(i,e),n=Math.max(n,s);return c(t,r,i,n)}function T(e){let t=[];if(n(e)){const{x:r,y:i,width:n,height:o}=e;t=[[r,i],[r+n,i],[r+n,i+o],[r,i+o]]}else i(e)?t=e.map(e=>[e.x,e.y]):o(e)&&(t=[[e.x,e.y]]);return t}export{w as createHittestQuery,S as getBbox,P as getHittestType,b as getLayerViewHitTargets,L as getMapPointsFromScreen,x as hitTest,T as screenTargetToPointArray};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{length as e,subtract as t,add as r,scale as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{surfaceElevationBelowRenderLocation as n}from"../intersectionUtils.js";function s(i,s,a,f=0){const m=i.state.constraints.collision;if(!m.enabled)return!1;const y=s||a,d=n(i,y.eye),p=i.renderCoordsHelper.getAltitude(y.eye),u=d+m.elevationMargin;if(p>=u)return!(!s||a.equalsView(s))&&(a.copyViewFrom(s),!0);const g=e(y.eye);if(t(c,y.center,y.eye),a.eye=i.renderCoordsHelper.setAltitude(l,u,y.eye),1===f)a.center=r(c,a.eye,c);else if(2===f){const e=(g-p+u)/g;a.center=o(c,y.center,e)}return!0}const c=i(),l=i();export{s as applySurfaceCollisionConstraint};
2
+ import{length as e,subtract as t,add as r,scale as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{surfaceElevationBelowRenderLocation as n}from"../intersectionUtils.js";function s(i,s,a,f=0){if(!i.state.constraints.collision.enabled)return!1;const m=s||a,y=n(i,m.eye),d=i.renderCoordsHelper.getAltitude(m.eye),p=y+i.state.constraints.elevationMargin;if(d>=p)return!(!s||a.equalsView(s))&&(a.copyViewFrom(s),!0);const u=e(m.eye);if(t(c,m.center,m.eye),a.eye=i.renderCoordsHelper.setAltitude(l,p,m.eye),1===f)a.center=r(c,a.eye,c);else if(2===f){const e=(u-d+p)/u;a.center=o(c,m.center,e)}return!0}const c=i(),l=i();export{s as applySurfaceCollisionConstraint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{copy as e,squaredDistance as r,scale as t,subtract as n,add as i,length as o,dot as s,distance as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function g(e,r,t,n){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,H,n)&&u(t,H)}function m(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function p(o,s,a,c,l){const u=o.state.camera.clone();if(s&&a&&c&&(u.eye=s,u.center=a,u.up=c),l){const e=d(o,u,l);i(R,u.eye,t(R,u.viewForward,e))}else b(o,u.ray,R)||e(R,u.center);const f=o.state.constraints,g=f.minimumPoiDistance;if(r(u.eye,R)<g){const r=f.collision.enabled;e(C,u.viewForward),t(C,C,g),r?u.eye=n(H,R,C):i(R,u.eye,C);const s=o.renderCoordsHelper,a=s.getAltitude(u.eye),c=f.collision.elevationMargin;r&&a<c&&(n(C,R,u.eye),u.eye=s.setAltitude(H,c,u.eye),i(R,u.eye,C))}return u.center=R,u}function y(e,r,t){const{origin:n,direction:i}=r;if(o(n)<e)return!0;const c=-s(i,n)/o(i);return c<0||c>=a(t,n)}function v(e,t,n){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=m(e,t),o=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(t,i,e.stage.renderer.sceneDepthRange.value.far),s=o*o;return r(t,n)>s}function b(e,r,t){let n=w[e.viewingMode];n||(n=new f(e.state.viewingMode),n.options.backfacesTerrain=!e.state.isGlobal,n.options.invisibleTerrain=!0,w[e.viewingMode]=n);const{isGlobal:i}=e.state,o=i?l(e.spatialReference).radius:0;return!(!e.sceneIntersectionHelper.intersectRay(r,n,t)||v(e,r.origin,t)||i&&!y(o,n.ray,t))||(!(!e.renderCoordsHelper.intersectManifold(r,0,t)||v(e,r.origin,t)||i&&!y(o,n.ray,t))||!!i&&M(r,t,o))}function M(e,r,n){const a=s(e.origin,e.origin)-n*n,c=a>0?Math.sqrt(a)/3:1;return t(r,e.direction,c/o(e.direction)),i(r,r,e.origin),!0}let w={};function j(){w={}}const H=c(),R=c(),C=c();export{p as cameraOnContentAlongViewDirection,j as cleanupIntersectionUtils,g as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
2
+ import{copy as e,squaredDistance as r,scale as t,subtract as n,add as i,length as o,dot as s,distance as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function g(e,r,t,n){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,H,n)&&u(t,H)}function m(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function p(o,s,a,c,l){const u=o.state.camera.clone();if(s&&a&&c&&(u.eye=s,u.center=a,u.up=c),l){const e=d(o,u,l);i(R,u.eye,t(R,u.viewForward,e))}else b(o,u.ray,R)||e(R,u.center);const f=o.state.constraints,g=f.minimumPoiDistance;if(r(u.eye,R)<g){const r=f.collision.enabled;e(C,u.viewForward),t(C,C,g),r?u.eye=n(H,R,C):i(R,u.eye,C);const s=o.renderCoordsHelper,a=s.getAltitude(u.eye),c=f.elevationMargin;r&&a<c&&(n(C,R,u.eye),u.eye=s.setAltitude(H,c,u.eye),i(R,u.eye,C))}return u.center=R,u}function y(e,r,t){const{origin:n,direction:i}=r;if(o(n)<e)return!0;const c=-s(i,n)/o(i);return c<0||c>=a(t,n)}function v(e,t,n){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=m(e,t),o=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(t,i,e.stage.renderer.sceneDepthRange.value.far),s=o*o;return r(t,n)>s}function b(e,r,t){let n=w[e.viewingMode];n||(n=new f(e.state.viewingMode),n.options.backfacesTerrain=!e.state.isGlobal,n.options.invisibleTerrain=!0,w[e.viewingMode]=n);const{isGlobal:i}=e.state,o=i?l(e.spatialReference).radius:0;return!(!e.sceneIntersectionHelper.intersectRay(r,n,t)||v(e,r.origin,t)||i&&!y(o,n.ray,t))||(!(!e.renderCoordsHelper.intersectManifold(r,0,t)||v(e,r.origin,t)||i&&!y(o,n.ray,t))||!!i&&M(r,t,o))}function M(e,r,n){const a=s(e.origin,e.origin)-n*n,c=a>0?Math.sqrt(a)/3:1;return t(r,e.direction,c/o(e.direction)),i(r,r,e.origin),!0}let w={};function j(){w={}}const H=c(),R=c(),C=c();export{p as cameraOnContentAlongViewDirection,j as cleanupIntersectionUtils,g as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};