@arcgis/core 5.1.0-next.80 → 5.1.0-next.82

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 (277) hide show
  1. package/analysis/ShadowCast/DiscreteOptions.d.ts +12 -0
  2. package/analysis/ShadowCast/TotalDurationOptions.d.ts +12 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/040884cec4b84dd1bb17.js +1 -0
  5. package/assets/esri/core/workers/chunks/05c5f68e117fc58ae801.js +1 -0
  6. package/assets/esri/core/workers/chunks/074f5e6aaeafca13bf72.js +1 -0
  7. package/assets/esri/core/workers/chunks/{7bd1d624f4f4a11a31e8.js → 086d7cdfa92a649c9f7b.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{0eed2b1b06355ab89013.js → 0c074c46d106ca4d3bad.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{d7324a00ed576e7a37b1.js → 1768f1a7e3caa6074d91.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{85d3475667c503ec4fc6.js → 186bfde8c552e3b42302.js} +1 -1
  11. package/assets/esri/core/workers/chunks/1a35121a0c2595a41fdb.js +1 -0
  12. package/assets/esri/core/workers/chunks/1ab66600579fa4232d7b.js +1 -0
  13. package/assets/esri/core/workers/chunks/{d5fd99ee40bba9b48a54.js → 1e2c0c6d724f7639d4c1.js} +27 -27
  14. package/assets/esri/core/workers/chunks/1e3fe89970c57a883fe5.js +1 -0
  15. package/assets/esri/core/workers/chunks/{824051af00e7a1f05ed0.js → 230e0e43f8e771950397.js} +1 -1
  16. package/assets/esri/core/workers/chunks/26f804c92077c11c626d.js +1 -0
  17. package/assets/esri/core/workers/chunks/28a45bd26eb5c9b3ec7c.js +1 -0
  18. package/assets/esri/core/workers/chunks/38f1a86b8dd9ee684ee5.js +596 -0
  19. package/assets/esri/core/workers/chunks/{c1d4110aa494a1dba3c4.js → 455d08294e0f5c5509ff.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{71fe127734f33d020a44.js → 475394218caaa4cd3e86.js} +1 -1
  21. package/assets/esri/core/workers/chunks/475409026288f0981ce2.js +1 -0
  22. package/assets/esri/core/workers/chunks/4e206957b28253ddc1a3.js +1 -0
  23. package/assets/esri/core/workers/chunks/{87d2021e91d025a2a142.js → 5c7ba4b8a9ec2e2e02b5.js} +1 -1
  24. package/assets/esri/core/workers/chunks/5cc38ac051d3d0557920.js +1 -0
  25. package/assets/esri/core/workers/chunks/{992cd87ba0ab6346f692.js → 64e268ebac0b62076f81.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{003fd7745966fe03510c.js → 65ac73de5bb133c6bf89.js} +1 -1
  27. package/assets/esri/core/workers/chunks/6675d56f49d07a97dc40.js +1 -0
  28. package/assets/esri/core/workers/chunks/{1f82a0f134ea912fc686.js → 66fe1634c6e8f72fc653.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{96b13b6042cdf5833d39.js → 67abbe81c16de26f61d8.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{484d6c1b0fe1633515b7.js → 72f8f4cfa0842d325fb0.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{283d39dfb1625b5a74db.js → 747e258f57f0543c836e.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{dd4f431511edd975a53b.js → 7acf82763aeba44049d0.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{5d8e944b192aad4cf986.js → 7b505112c7e6d9b7a239.js} +1 -1
  34. package/assets/esri/core/workers/chunks/7b8466f892a38a53c600.js +1 -0
  35. package/assets/esri/core/workers/chunks/{6a0352d20596ca3f4b64.js → 88eb1e4320c4ada01711.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{77dd719516138afb1a2a.js → 8af9a78cf316581ea482.js} +1 -1
  37. package/assets/esri/core/workers/chunks/97719271a3e4c9f2b2c9.js +1 -0
  38. package/assets/esri/core/workers/chunks/988e91cc6cf88c34c2de.js +1 -0
  39. package/assets/esri/core/workers/chunks/9c402657f63a4d5668d0.js +1 -0
  40. package/assets/esri/core/workers/chunks/9cac70164d8528c283af.js +1 -0
  41. package/assets/esri/core/workers/chunks/9ea23cd4b2664c08b670.js +1 -0
  42. package/assets/esri/core/workers/chunks/9f51a69b8f1937a8794a.js +1 -0
  43. package/assets/esri/core/workers/chunks/a28124bba6b43efd74cc.js +1 -0
  44. package/assets/esri/core/workers/chunks/ac5999c88c27b49cd760.js +1 -0
  45. package/assets/esri/core/workers/chunks/af762422a65c551dcd54.js +1 -0
  46. package/assets/esri/core/workers/chunks/{056fd7847caaff2c9514.js → af8bc56cf1404afc3028.js} +1 -1
  47. package/assets/esri/core/workers/chunks/b811d62284be95f4beb6.js +1 -0
  48. package/assets/esri/core/workers/chunks/b9e163f4a898e50cc854.js +1 -0
  49. package/assets/esri/core/workers/chunks/{444f0f51b3ee0b9845a5.js → bb2f6b0fcdfb8b158e26.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{3b9100c59a8050f4834e.js → bbc27d9285162696d089.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{5da2051f548c2942e01a.js → bc8a74da48b08309875f.js} +1 -1
  52. package/assets/esri/core/workers/chunks/bd8cb64b6e08839398f3.js +1 -0
  53. package/assets/esri/core/workers/chunks/{026d3fa331caec1ea3d2.js → bf4dd8e50704e4040966.js} +1 -1
  54. package/assets/esri/core/workers/chunks/c19e3f6027b6526de359.js +1 -0
  55. package/assets/esri/core/workers/chunks/c8ef80a7c46d7d2c5172.js +1 -0
  56. package/assets/esri/core/workers/chunks/cbf1a03f54bd8d2a2b47.js +1 -0
  57. package/assets/esri/core/workers/chunks/ce4dfc3a470230ddc9e4.js +1 -0
  58. package/assets/esri/core/workers/chunks/{8ea4584e07ccc85caabd.js → d11de13537b623739e14.js} +1 -1
  59. package/assets/esri/core/workers/chunks/d897412b99b9fba44bb4.js +1 -0
  60. package/assets/esri/core/workers/chunks/d9c3f14eee4db7a7137b.js +1 -0
  61. package/assets/esri/core/workers/chunks/{035dbb0217f83108fa89.js → db86a1119e4e58ecfbda.js} +1 -1
  62. package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +1 -0
  63. package/assets/esri/core/workers/chunks/{5fe97253f80c797fad7f.js → df8a3d3cac454d42e14d.js} +1 -1
  64. package/assets/esri/core/workers/chunks/dfe1139124fda0d6c059.js +1 -0
  65. package/assets/esri/core/workers/chunks/{8b8f391f27774aec6db9.js → e0b27bceb397482bd0e8.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{fb9e3e7cd532ac4353f1.js → e89dc473f46a5584d2ef.js} +32 -32
  67. package/assets/esri/core/workers/chunks/{01ee18782a50279f907e.js → f4220b6eab0865318033.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{42336e0d1ef88737b078.js → f468c6ea2818a1f97e19.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{3f242f8d092f601c3abf.js → f77d23ee60c876b01e4b.js} +1 -1
  70. package/assets/esri/core/workers/chunks/fce2306a1b31c6680f90.js +1 -0
  71. package/assets/esri/core/workers/chunks/fcf51697c361e0075cc2.js +1 -0
  72. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  73. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  74. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +15 -0
  75. package/assets/esri/themes/dark/main.css +1 -1
  76. package/assets/esri/themes/light/main.css +1 -1
  77. package/assets/esri/themes/light/view.css +1 -1
  78. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  79. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  80. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  81. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  82. package/chunks/ShadowCastVisualize.glsl.js +33 -15
  83. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  84. package/chunks/arcgis-knowledge-client-core.js +1 -1
  85. package/config.js +1 -1
  86. package/core/workers/registry.js +1 -1
  87. package/form/elements/inputs/MultipleChoiceInput.d.ts +6 -6
  88. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  89. package/form/elements/inputs.js +1 -1
  90. package/geometry/SpatialReference.js +1 -1
  91. package/geometry/support/coordsUtils.js +1 -1
  92. package/kernel.js +1 -1
  93. package/layers/BaseDynamicLayer.js +1 -1
  94. package/layers/BaseTileLayer.js +1 -1
  95. package/layers/ElevationLayer.js +1 -1
  96. package/layers/FeatureLayer.d.ts +2 -2
  97. package/layers/FeatureLayer.js +1 -1
  98. package/layers/MapImageLayer.js +1 -1
  99. package/layers/TileLayer.js +1 -1
  100. package/layers/WMSLayer.js +1 -1
  101. package/layers/WMTSLayer.js +1 -1
  102. package/layers/WebTileLayer.js +1 -1
  103. package/layers/graphics/data/QueryEngine.js +1 -1
  104. package/layers/graphics/data/QueryEngineResult.js +1 -1
  105. package/layers/graphics/sources/MemorySource.js +1 -1
  106. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  107. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  108. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  109. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  110. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  111. package/layers/mixins/ArcGISImageService.js +1 -1
  112. package/layers/mixins/FeatureLayerBase.js +1 -1
  113. package/layers/mixins/TiledImagery.js +1 -1
  114. package/layers/support/imageBitmapUtils.js +1 -1
  115. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  116. package/package.json +1 -1
  117. package/request/process.js +1 -1
  118. package/rest/knowledgeGraph/CreateReplicaResponse.d.ts +37 -0
  119. package/rest/knowledgeGraph/CreateReplicaResponse.js +2 -0
  120. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +91 -0
  121. package/rest/knowledgeGraph/ReplicaDefinition.js +2 -0
  122. package/rest/knowledgeGraph/ReplicasInformationResponse.d.ts +24 -0
  123. package/rest/knowledgeGraph/ReplicasInformationResponse.js +2 -0
  124. package/rest/knowledgeGraph/UnregisterReplicaResponse.d.ts +44 -0
  125. package/rest/knowledgeGraph/UnregisterReplicaResponse.js +2 -0
  126. package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +2 -0
  127. package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +2 -0
  128. package/rest/knowledgeGraphService.d.ts +50 -1
  129. package/rest/knowledgeGraphService.js +1 -1
  130. package/support/revision.js +1 -1
  131. package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
  132. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  133. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  134. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  136. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  140. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  146. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  147. package/views/2d/input/MapViewInputManager.js +1 -1
  148. package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
  149. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  150. package/views/2d/layers/MediaLayerView2D.js +1 -1
  151. package/views/2d/layers/TileLayerView2D.js +1 -1
  152. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  153. package/views/2d/layers/WMSLayerView2D.js +1 -1
  154. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  155. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  156. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  157. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  158. package/views/3d/input/SceneInputManager.js +1 -1
  159. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  160. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  161. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  162. package/views/3d/layers/IntegratedMesh3DTilesLayerWorker.js +2 -0
  163. package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +2 -0
  164. package/views/3d/layers/TileLayerView3D.js +1 -1
  165. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  167. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  168. package/views/3d/layers/support/IntegratedMesh3DTilesVertexProcessing.js +2 -0
  169. package/views/3d/layers/support/makeScheduleFunction.js +1 -1
  170. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  171. package/views/3d/terrain/TerrainData.js +1 -1
  172. package/views/3d/terrain/TerrainSurface.js +1 -1
  173. package/views/3d/terrain/Tile.js +1 -1
  174. package/views/3d/terrain/TileRenderer.js +1 -1
  175. package/views/3d/terrain/terrainUtils.js +1 -1
  176. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  177. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  178. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  179. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialInitParameters.js +2 -0
  180. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  181. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  182. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  183. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  184. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  185. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  186. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  187. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  188. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  189. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  190. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  191. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  192. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  193. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  194. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  195. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  196. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  197. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  198. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  199. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  200. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  201. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  202. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  203. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  204. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  205. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  206. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  207. package/views/3d/webgl-engine/lib/StencilUtils.js +1 -1
  208. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  209. package/views/3d/webgl-engine/materials/VisualVariablePassParameters.js +1 -1
  210. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  211. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechniqueConfiguration.js +1 -1
  212. package/views/3d/webgl-engine/shaders/ShadowCastMaskTechnique.js +2 -0
  213. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  214. package/views/3d/webgl-engine/shaders/colorRampParameters.js +2 -0
  215. package/views/VideoView.js +1 -1
  216. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  217. package/views/draw/support/createUtils.js +1 -1
  218. package/views/input/BrowserEventSource.js +1 -1
  219. package/views/input/InputManager.js +1 -1
  220. package/views/input/handlers/LatestPen.js +2 -0
  221. package/views/input/handlers/LatestPointer.js +1 -1
  222. package/views/input/types.d.ts +1 -1
  223. package/views/interactive/Tooltip.js +1 -1
  224. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  225. package/views/support/TextureCompressionWorker.js +1 -1
  226. package/views/support/TextureCompressionWorkerHandle.js +1 -1
  227. package/views/support/unnormalizationUtils.js +2 -0
  228. package/views/webgl/RenderingContext.js +1 -1
  229. package/views/webgl/Texture.js +1 -1
  230. package/views/webgl/renderState.js +1 -1
  231. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  232. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  233. package/widgets/FeatureTable.js +1 -1
  234. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  235. package/widgets/OrientedImageryViewer/css.js +1 -1
  236. package/widgets/OrientedImageryViewer.js +1 -1
  237. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  238. package/assets/esri/core/workers/chunks/05c3146d87d917606193.js +0 -1
  239. package/assets/esri/core/workers/chunks/0b77c124b743067e4155.js +0 -1
  240. package/assets/esri/core/workers/chunks/11241781baaed346af52.js +0 -1
  241. package/assets/esri/core/workers/chunks/1d9560eb8b21b9e76616.js +0 -1
  242. package/assets/esri/core/workers/chunks/2c87c3112a43db8624f6.js +0 -1
  243. package/assets/esri/core/workers/chunks/2da62687ff678b690839.js +0 -1
  244. package/assets/esri/core/workers/chunks/3a58708217a9c11836ab.js +0 -1
  245. package/assets/esri/core/workers/chunks/3bbf684ee2484eb44c9f.js +0 -1
  246. package/assets/esri/core/workers/chunks/49fb9c47070641bce9a9.js +0 -1
  247. package/assets/esri/core/workers/chunks/4eed175277eb0df3c821.js +0 -1
  248. package/assets/esri/core/workers/chunks/4f9d027055f3a616173c.js +0 -1
  249. package/assets/esri/core/workers/chunks/5417308eba30e668b1ee.js +0 -1
  250. package/assets/esri/core/workers/chunks/62b3e933f548ce354b99.js +0 -1
  251. package/assets/esri/core/workers/chunks/63381d81adce0a0d2089.js +0 -1
  252. package/assets/esri/core/workers/chunks/6dbddf5ab1867ac2ac80.js +0 -1
  253. package/assets/esri/core/workers/chunks/6e70e922331704b92a08.js +0 -1
  254. package/assets/esri/core/workers/chunks/7c7c11c0fde8b63e330b.js +0 -1
  255. package/assets/esri/core/workers/chunks/7f55eef696e9ed717bfc.js +0 -1
  256. package/assets/esri/core/workers/chunks/89dbea6f436d45a3b185.js +0 -1
  257. package/assets/esri/core/workers/chunks/8f6f5dad52747d252aac.js +0 -596
  258. package/assets/esri/core/workers/chunks/99c189e1de2b1f14799b.js +0 -1
  259. package/assets/esri/core/workers/chunks/9aa6b32cb65fbaa93218.js +0 -1
  260. package/assets/esri/core/workers/chunks/9d216e30d04ea21fc8a2.js +0 -1
  261. package/assets/esri/core/workers/chunks/9d434360dfce1e49b7b9.js +0 -1
  262. package/assets/esri/core/workers/chunks/a5d8d6f3c0c8de474efd.js +0 -1
  263. package/assets/esri/core/workers/chunks/a809b811121099a87a98.js +0 -1
  264. package/assets/esri/core/workers/chunks/c02ba921c0a32d2021e3.js +0 -1
  265. package/assets/esri/core/workers/chunks/c3c19b62d948d53118a8.js +0 -1
  266. package/assets/esri/core/workers/chunks/c46a4adea39636a96d03.js +0 -1
  267. package/assets/esri/core/workers/chunks/c5507480344176fad241.js +0 -1
  268. package/assets/esri/core/workers/chunks/c6030271bd6d39b6e1db.js +0 -1
  269. package/assets/esri/core/workers/chunks/d1a7d13e1d48abcd7bf1.js +0 -1
  270. package/assets/esri/core/workers/chunks/dcbc4072c18278c2b67d.js +0 -1
  271. package/assets/esri/core/workers/chunks/e610d24539a675fb054b.js +0 -1
  272. package/assets/esri/core/workers/chunks/ecb7ede6a8e6c05e4c6c.js +0 -1
  273. package/assets/esri/core/workers/chunks/f227b34cce6843df0fb6.js +0 -1
  274. package/assets/esri/core/workers/chunks/fb5a2205f05afc396119.js +0 -1
  275. package/request/ImageWithType.js +0 -2
  276. package/views/3d/layers/support/fetchTile.js +0 -2
  277. package/views/interactive/editGeometry/unnormalizationHelper.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/RandomLCG.js";import"../../../core/has.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/dimensions/effects/LinearDimensionArrowEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionExtensionLineEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionLeaderLineEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionLineEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionPointEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionTextEffect.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../webgl/enums.js";import"../../webgl/Program.js";import"../../webgl/Util.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../webgl/Texture.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../../../Graphic.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/checkWebGLError.js";import"../../webgl/renderState.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import n from"./graphics/GraphicsView2D.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as p}from"./BitmapTileLayerView2D.js";import{LayerView2D as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as G,MapServiceLayerViewHelper as q}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as T}from"../../support/drapedUtils.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";import{TaskPriority as S}from"../../support/Scheduler.js";const E=[0,0];let P=class extends(b(p(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:S.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),G(this,this.layer)){const e=this._highlightView=new n({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new q({createFetchPopupFeaturesQueryGeometry:(e,i)=>T(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=V(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(E,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,n=null;try{if(n=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.size);a=await this._fetchImage(h,o)}catch(p){if(s(p))throw p;if(this.resampling&&"unknown"===n&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate()),e.once("isReady",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const U=P;export{U as default};
2
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/RandomLCG.js";import"../../../core/has.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/dimensions/effects/LinearDimensionArrowEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionExtensionLineEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionLeaderLineEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionLineEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionPointEffect.js";import"../../../symbols/dimensions/effects/LinearDimensionTextEffect.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../webgl/enums.js";import"../../webgl/Program.js";import"../../webgl/Util.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../webgl/Texture.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../../../Graphic.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/checkWebGLError.js";import"../../webgl/renderState.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import n from"./graphics/GraphicsView2D.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as p}from"./BitmapTileLayerView2D.js";import{LayerView2D as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as G,MapServiceLayerViewHelper as q}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as T}from"../../support/drapedUtils.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";import{TaskPriority as S}from"../../support/Scheduler.js";const E=[0,0];let P=class extends(b(p(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:S.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),G(this,this.layer)){const e=this._highlightView=new n({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new q({createFetchPopupFeaturesQueryGeometry:(e,i)=>T(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=V(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(E,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,n=null;try{if(n=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.size);a=await this._fetchImage(h,o)}catch(p){if(s(p))throw p;if(this.resampling&&"unknown"===n&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate()),e.once("isReady",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i}).then(({bitmap:e})=>e)}};e([o()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const U=P;export{U as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/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,pt2px as l}from"../../../core/screenUtils.js";import{property as n,subclass as o}from"../../../core/accessorSupport/decorators.js";import{diff as h,hasDiff as u}from"../../../core/accessorSupport/diffUtils.js";import c from"../../../geometry/Point.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{equals as d}from"../../../geometry/support/spatialReferenceUtils.js";import{isVectorTileGraphicOrigin as p}from"../../../graphic/isVectorTileGraphicOrigin.js";import{tileSizeInTileUnits as _,tileSizeInPixels as f}from"../engine/vectorTiles/constants.js";import{TileHandler as g}from"../engine/vectorTiles/TileHandler.js";import{TileManager as m}from"../engine/vectorTiles/TileManager.js";import{VectorTile as T}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as C}from"../engine/vectorTiles/VectorTileContainer.js";import v from"../engine/vectorTiles/VectorTileFeatureIndex.js";import w from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2D as R}from"./LayerView2D.js";import{isScreenRect as H}from"../support/hitTestUtils.js";import I from"../tiling/TileInfoViewPOT.js";import Q from"../tiling/TileQueue.js";import P from"../../layers/VectorTileLayerView.js";import{TaskPriority as S}from"../../support/Scheduler.js";const b=2.5;let V=class extends(R(P)){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(H(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 n=has("esri-vtl-search-tolerance")??0,o=n>0?n:b,h=this.view.state,{rotation:u,pixelRatio:c}=this.view.state,y=l(o)*c;let d=null;const p=this._vectorTileContainer?.symbolRepository;p&&(d=p.querySymbols(r[0],y,s.decluttererOffset,{}));const _=this._tileManager.getIntersectingTiles(r[0].x,r[0].y,y,h,d);if((!_||0===_.length)&&0===d?.length)return null;e=e.clone().normalize();const f=[],g=[];for(const a of _)f.push(this._queryTile(g,e,y,u,a,d?.filter(e=>e.tileKey.id===a.id)));return await Promise.all(f),g}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 w(e),this._tileInfoView=new I(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new C(this._tileInfoView),this._tileHandler=new g(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),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=h(i.layout,e.layout);if(null!=s){if(u(s,"visibility")&&1===j(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 d(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}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 m({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:S.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new Q({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:S.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(l){i.getLogger(this).error("error applying vector-tiles style update",l.message),this._resumeQueues(),this._isTileHandlerReady=!0}const t=this._styleRepository,s=new Set;e.forEach(e=>{if(3!==e.type)return;const i=e.data,r=t.getLayerById(i.layer);r&&s.add(r.uid)});const r=new Set;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&&r.add(e.uid)}});const a=this._vectorTileContainer.children;if(s.size>0){const e=Array.from(s);this._vectorTileContainer.deleteStyleLayers(e);for(const t of a)t.deleteLayerData(e)}if(this._resumeQueues(),r.size>0){const e=Array.from(r),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 w(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._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new m({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(y(),e),i=this._tileInfoView.getTileResolution(e.level);return new T(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,u]=this._tileInfoView.getTileBounds(y(),r.key,!0),c=_*((t.x-n)/(h-n)),d=_*(1-(t.y-o)/(u-o)),g=i*(_/f),m=await l.queryAttributes(c,d,g,s,a);for(const y of m)y.graphic.geometry=this._tileToMapPoint(y.tilePoint,r.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:y.graphic,mapPoint:t.clone()});e.sort((e,t)=>(p(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(p(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=v.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 j(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([n()],V.prototype,"_isTileHandlerReady",void 0),V=e([o("esri.views.2d.layers.VectorTileLayerView2D")],V);const D=V;export{D as default};
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,pt2px as l}from"../../../core/screenUtils.js";import{property as n,subclass as o}from"../../../core/accessorSupport/decorators.js";import{diff as h,hasDiff as u}from"../../../core/accessorSupport/diffUtils.js";import y from"../../../geometry/Point.js";import{create as c}from"../../../geometry/support/aaBoundingRect.js";import{equals as d}from"../../../geometry/support/spatialReferenceUtils.js";import{isVectorTileGraphicOrigin as p}from"../../../graphic/isVectorTileGraphicOrigin.js";import{tileSizeInTileUnits as _,tileSizeInPixels as f}from"../engine/vectorTiles/constants.js";import{TileHandler as g}from"../engine/vectorTiles/TileHandler.js";import{TileManager as m}from"../engine/vectorTiles/TileManager.js";import{VectorTile as T}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as C}from"../engine/vectorTiles/VectorTileContainer.js";import v from"../engine/vectorTiles/VectorTileFeatureIndex.js";import w from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2D as R}from"./LayerView2D.js";import{isScreenRect as H}from"../support/hitTestUtils.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(R(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(H(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 n=has("esri-vtl-search-tolerance")??0,o=n>0?n:b,h=this.view.state,{rotation:u,pixelRatio:y}=this.view.state,c=l(o)*y;let d=null;const p=this._vectorTileContainer?.symbolRepository;p&&(d=p.querySymbols(r[0],c,s.decluttererOffset,{}));const _=this._tileManager.getIntersectingTiles(r[0].x,r[0].y,c,h,d);if((!_||0===_.length)&&0===d?.length)return null;e=e.clone().normalize();const f=[],g=[];for(const a of _)f.push(this._queryTile(g,e,c,u,a,d?.filter(e=>e.tileKey.id===a.id)));return await Promise.all(f),g}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 w(e),this._tileInfoView=new I(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new C(this._tileInfoView),this._tileHandler=new g(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),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=h(i.layout,e.layout);if(null!=s){if(u(s,"visibility")&&1===j(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 d(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}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 m({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 w(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._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new m({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(c(),e),i=this._tileInfoView.getTileResolution(e.level);return new T(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,u]=this._tileInfoView.getTileBounds(c(),r.key,!0),y=_*((t.x-n)/(h-n)),d=_*(1-(t.y-o)/(u-o)),g=i*(_/f),m=await l.queryAttributes(y,d,g,s,a);for(const c of m)c.graphic.geometry=this._tileToMapPoint(c.tilePoint,r.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:c.graphic,mapPoint:t.clone()});e.sort((e,t)=>(p(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(p(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 y({x:a[0],y:a[1],spatialReference:r.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=v.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 j(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([n()],V.prototype,"_isTileHandlerReady",void 0),V=e([o("esri.views.2d.layers.VectorTileLayerView2D")],V);const D=V;export{D as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../core/accessorSupport/decorators.js";import n from"../../../geometry/Extent.js";import{BitmapContainer as m}from"../engine/BitmapContainer.js";import{LayerView2D as h}from"./LayerView2D.js";import p from"./support/ExportStrategy.js";import c from"../../layers/LayerView.js";import{RefreshableLayerView as d}from"../../layers/RefreshableLayerView.js";import{WMSLayerView as u}from"../../layers/WMSLayerView.js";let g=class extends(u(d(h(c)))){constructor(){super(...arguments),this.bitmapContainer=new m}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(e=>{i(e)||t.getLogger(this).error(e)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:r}=e;this.bitmapContainer=new m,this.container.addChild(this.bitmapContainer),this.strategy=new p({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(a(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=r(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:r}=this,{x:i,y:a}=e,{spatialReference:s}=t;let o,m=0,h=0;if(r.children.some(e=>{const{width:t,height:r,resolution:p,x:c,y:d}=e,u=c+p*t,g=d-p*r;return i>=c&&i<=u&&a<=d&&a>=g&&(o=new n({xmin:c,ymin:g,xmax:u,ymax:d,spatialReference:s}),m=t,h=r,!0)}),!o)return null;const p=o.width/m,c=Math.round((i-o.xmin)/p),d=Math.round((o.ymax-a)/p);return{extent:o,width:m,height:h,x:c,y:d}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,i){return this.layer.fetchImageBitmap(e,t,r,{timeExtent:this.timeExtent,...i})}};e([s()],g.prototype,"strategy",void 0),g=e([o("esri.views.2d.layers.WMSLayerView2D")],g);const y=g;export{y as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../core/accessorSupport/decorators.js";import n from"../../../geometry/Extent.js";import{BitmapContainer as m}from"../engine/BitmapContainer.js";import{LayerView2D as p}from"./LayerView2D.js";import h from"./support/ExportStrategy.js";import c from"../../layers/LayerView.js";import{RefreshableLayerView as d}from"../../layers/RefreshableLayerView.js";import{WMSLayerView as u}from"../../layers/WMSLayerView.js";let g=class extends(u(d(p(c)))){constructor(){super(...arguments),this.bitmapContainer=new m}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}update(t){this.strategy.update(t).catch(t=>{i(t)||e.getLogger(this).error(t)})}attach(){const{layer:t}=this,{imageMaxHeight:e,imageMaxWidth:r}=t;this.bitmapContainer=new m,this.container.addChild(this.bitmapContainer),this.strategy=new h({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:e,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(a(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=r(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(t){const{view:e,bitmapContainer:r}=this,{x:i,y:a}=t,{spatialReference:s}=e;let o,m=0,p=0;if(r.children.some(t=>{const{width:e,height:r,resolution:h,x:c,y:d}=t,u=c+h*e,g=d-h*r;return i>=c&&i<=u&&a<=d&&a>=g&&(o=new n({xmin:c,ymin:g,xmax:u,ymax:d,spatialReference:s}),m=e,p=r,!0)}),!o)return null;const h=o.width/m,c=Math.round((i-o.xmin)/h),d=Math.round((o.ymax-a)/h);return{extent:o,width:m,height:p,x:c,y:d}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,e,r,i){return this.layer.fetchImageBitmap(t,e,r,{timeExtent:this.timeExtent,...i}).then(t=>t&&"bitmap"in t?t.bitmap:t)}};t([s()],g.prototype,"strategy",void 0),g=t([o("esri.views.2d.layers.WMSLayerView2D")],g);const y=g;export{y as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{BitmapTileLayerView2D as l}from"./BitmapTileLayerView2D.js";import{LayerView2D as h}from"./LayerView2D.js";import{resampleImage as o}from"./support/imageUtils.js";import n from"../tiling/TileInfoView.js";import c from"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import f from"../tiling/TileStrategy.js";import p from"../../layers/LayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";import{TaskPriority as d}from"../../support/Scheduler.js";const y=[0,0];let _=class extends(m(l(h(p)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:e}=this.layer,{tileMatrixSet:t}=e;if(t&&a(t.tileInfo?.spatialReference,this.view.spatialReference))return t;const i=this._getTileMatrixSetBySpatialReference(e);return i&&i.id!==e.tileMatrixSetId?(e.tileMatrixSetId=i.id,i):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){const e=this.tileMatrixSet?.tileInfo;e&&(this._tileInfoView=new n(e),this._fetchQueue=new u({tileInfoView:this._tileInfoView,concurrency:16,process:(e,t)=>this.fetchTile(e,t),scheduler:this.scheduler,priority:d.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new f({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets?.some(t=>a(t.tileInfo?.spatialReference,e))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(y,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!s)return this._fetchImage(e,r);const l=new c(0,0,0,0);let h;try{await s.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),h=await this._fetchImage(l,r)}catch(n){if(i(n))throw n;if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new c(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return o(this._tileInfoView,r,s,e)}}throw n}return o(this._tileInfoView,h,l,e)}canResume(){const e=super.canResume();return e?null!==this.tileMatrixSet:e}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate())}catch(s){i(s)||t.getLogger(this).error(s)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_getTileMatrixSetBySpatialReference(e){return e.tileMatrixSets?.find(e=>a(e.tileInfo?.spatialReference,this.view.spatialReference))}};e([s({readOnly:!0})],_.prototype,"tileMatrixSet",null),_=e([r("esri.views.2d.layers.WMTSLayerView2D")],_);const w=_;export{w as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{BitmapTileLayerView2D as l}from"./BitmapTileLayerView2D.js";import{LayerView2D as h}from"./LayerView2D.js";import{resampleImage as o}from"./support/imageUtils.js";import n from"../tiling/TileInfoView.js";import c from"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import p from"../tiling/TileStrategy.js";import f from"../../layers/LayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";import{TaskPriority as d}from"../../support/Scheduler.js";const y=[0,0];let _=class extends(m(l(h(f)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:e}=this.layer,{tileMatrixSet:t}=e;if(t&&a(t.tileInfo?.spatialReference,this.view.spatialReference))return t;const i=this._getTileMatrixSetBySpatialReference(e);return i&&i.id!==e.tileMatrixSetId?(e.tileMatrixSetId=i.id,i):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){const e=this.tileMatrixSet?.tileInfo;e&&(this._tileInfoView=new n(e),this._fetchQueue=new u({tileInfoView:this._tileInfoView,concurrency:16,process:(e,t)=>this.fetchTile(e,t),scheduler:this.scheduler,priority:d.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new p({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets?.some(t=>a(t.tileInfo?.spatialReference,e))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(y,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!s)return this._fetchImage(e,r);const l=new c(0,0,0,0);let h;try{await s.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),h=await this._fetchImage(l,r)}catch(n){if(i(n))throw n;if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new c(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return o(this._tileInfoView,r,s,e)}}throw n}return o(this._tileInfoView,h,l,e)}canResume(){const e=super.canResume();return e?null!==this.tileMatrixSet:e}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate())}catch(s){i(s)||t.getLogger(this).error(s)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t}).then(({bitmap:e})=>e)}_getTileMatrixSetBySpatialReference(e){return e.tileMatrixSets?.find(e=>a(e.tileInfo?.spatialReference,this.view.spatialReference))}};e([s({readOnly:!0})],_.prototype,"tileMatrixSet",null),_=e([r("esri.views.2d.layers.WMTSLayerView2D")],_);const w=_;export{w as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as o,createLabelVVEvaluator as a}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";function c(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class d{constructor(e){this.layer=e,this._cache=new s}openMessagePorts(){return c(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const r=this.layer,i=n(r,e)??o(r),s=t(r,e),l=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:a(r.renderer)},deconflictionEnabled:i,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:n,renderer:o,geometryType:a,labelingInfo:s,labelsVisible:l,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:n.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:a,labelingInfo:s,labelsVisible:l,objectIdField:c,orderBy:p??"default",trackInfo:d};return u(e,r,y,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:n}=r,o=r.fieldsIndex.toJSON(),a=i(r),s="timeInfo"in r?r.timeInfo?.toJSON():null,l=r.spatialReference.toJSON();c(r.source);const u=n,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:u,outSpatialReference:p,metadata:{fieldsIndex:o,geometryType:a,hasZ:"hasZ"in r&&r.hasZ,hasM:"hasM"in r&&r.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:s,spatialReference:l,outSpatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{d as InMemoryLayerAdapter};
2
+ import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{getServiceGeometryType as n}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as s,createLabelVVEvaluator as a}from"./labelingUtils.js";import{ExceedsLimitCache as l}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as p}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";function d(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class y{constructor(e){this.layer=e,this._cache=new l}openMessagePorts(){return d(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const r=this.layer,i=o(r,e)??s(r),n=t(r,e),l=[...r.labelingInfo||[],...n?.labelingInfo||[]];return[{vvEvaluators:{0:a(r.renderer)},deconflictionEnabled:i,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return u(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:n,renderer:o,geometryType:s,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:n.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:s,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default",trackInfo:d};return p(e,r,y,i)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:o}=r,s=r.fieldsIndex.toJSON(),a=n(r),l="timeInfo"in r?r.timeInfo?.toJSON():null,u=r.spatialReference.toJSON();d(r.source);const p=o,c=e.spatialReference.toJSON();return{type:"memory",orderByFields:p,outSpatialReference:c,metadata:{fieldsIndex:s,geometryType:a,featureIdInfo:i(r),hasZ:"hasZ"in r&&r.hasZ,hasM:"hasM"in r&&r.hasM,timeInfo:l,spatialReference:u,outSpatialReference:c,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{y as InMemoryLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t,equals as i}from"../../../core/arrayUtils.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Error.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{abortMaybe as a,destroyMaybe as o}from"../../../core/maybe.js";import{after as l,throwIfAborted as u,isPromiseLike as c}from"../../../core/promiseUtils.js";import{watch as p,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{offsetDateUTC as g,convertTime as _}from"../../../core/timeUtils.js";import{property as y,subclass as v}from"../../../core/accessorSupport/decorators.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as w}from"../../../core/support/UpdatingHandles.js";import{g as D}from"../../../chunks/boundedPlane.js";import{polygonToVolume as b}from"../focusAreaUtils.js";import C from"./AnalysisView3D.js";import{registerAnalysisView as V,hideOtherAnalysisViews as U}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as T}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as P}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as O}from"../support/earthUtils.js";import{computeDirectionsOverTime as x}from"../support/sunUtils.js";import{breadthFirstBinaryPartitioning as j}from"../../../widgets/support/traversalUtils.js";let z=class extends C{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._updatingHandles=new w,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([V(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{a(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=s(async e=>{await l(H,e),u(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>E(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&U(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},d),p(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{L(e,i,t)},d),p(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:s})=>{L(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{L(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{L(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new T({getDuration:this.getDurationAtScreen.bind(this),isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&L(this._renderer,!0,{enabled:!1}),this._tooltip=o(this._tooltip),this._stopPreviewingTask=a(this._stopPreviewingTask),this._updatingHandles=o(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||null!=this._stopPreviewingTask&&!this._stopPreviewingTask.finished||!0===this._tooltip?.updating||this._updatingHandles.updating}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){return this._updatedRecently||this._sceneUpdating}get _sceneUpdating(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,graphicsView:i}=e;return!t||this._shadowLayerViews.some(e=>e.updating)||!i?.suspended&&!!i?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?O(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=g(e,-e.getTimezoneOffset(),"minutes"),e=g(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){const e=this._totalDurationInterval;switch(this.analysis.mode){case"min-duration":return this._totalDuration>0?e:0;case"total-duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,minDurationOptions:t}=this.analysis;return"min-duration"===e&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?M:this._referencePosition;if(null==i)return[];const s=x(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,G),r=s.length;I.length=0;const n=j(0,r,I),a=new Array(r);for(let o=0;o<r;++o)a[o]=s[n[o]];return a}get _analysisVolume(){const{geometry:e}=this.analysis;if(null==e)return this._previousVolume=null,null;try{const t=b(e,this.view,q);return null==t?(this._previousVolume=null,null):c(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return n.getLogger(this).error(new r("shadowcastanalysisview3d:projection-failed","Failed to project analysis area geometry to view spatial reference",{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"min-duration":return this._minDurationVisualizationParameters;case"total-duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){const{color:e,minDuration:t}=this.analysis.minDurationOptions,i=this._totalDuration;return{visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){const{minDurationOptions:e}=this.analysis;return e.contextEnabled?{visualization:3,gradientColor:A(e.contextOptions.color,e.contextOptions.colorStops)}:{}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?R/s:0,n=A(e,t);return 0===r?{...this._discreteVisualizationParameters,gradientColor:n}:{bandedGradientColor:n,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions;return{gradientColor:A(e,t),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(k)}get _previewDependencies(){const{view:e}=this,i=e.slice.plane,s=this._shadowLayerViews,r=s.map(e=>e.layer).filter(t),n=s.map(e=>e.suspended),a=r.map(e=>e.visible),o=r.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=r.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),c=s.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:i,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:n,graphicsViewSuspended:l,layerVisibilities:a,layerOpacities:o,filters:c,definitionExpressions:u}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){const{_renderer:t,_totalDurationSampleCount:i}=this;if(null==t||0===i)return 0;const s=this.view.state.camera.screenToRender(h(e.x,e.y),m());return t.readAccumulatedShadow(s)*this._totalDuration}};e([y({readOnly:!0,type:["shadow-cast-view-3d"]})],z.prototype,"type",void 0),e([y({constructOnly:!0,nonNullable:!0})],z.prototype,"analysis",void 0),e([y({readOnly:!0})],z.prototype,"updating",null),e([y()],z.prototype,"_stopPreviewingTask",void 0),e([y()],z.prototype,"_updatedRecently",void 0),e([y()],z.prototype,"_tooltip",void 0),e([y()],z.prototype,"_sceneUpdating",null),e([y()],z.prototype,"_effectiveUtcOffset",null),e([y()],z.prototype,"_utcOffsetAuto",null),e([y()],z.prototype,"_dateUTCOffset",null),e([y()],z.prototype,"_startDateTimeUTC",null),e([y()],z.prototype,"_endDateTimeUTC",null),e([y()],z.prototype,"_referencePosition",null),e([y()],z.prototype,"_interval",null),e([y()],z.prototype,"_intervalContext",null),e([y()],z.prototype,"_totalDurationSampleCount",null),e([y()],z.prototype,"_totalDuration",null),e([y()],z.prototype,"_lightDirections",null),e([y()],z.prototype,"_lightDirectionsContext",null),e([y()],z.prototype,"_analysisVolume",null),e([y()],z.prototype,"_visualizationParameters",null),e([y()],z.prototype,"_minDurationVisualizationParameters",null),e([y()],z.prototype,"_minDurationContextVisualizationParameters",null),e([y()],z.prototype,"_durationVisualizationParameters",null),e([y()],z.prototype,"_discreteVisualizationParameters",null),e([y()],z.prototype,"_shadowLayerViews",null),e([y()],z.prototype,"_previewDependencies",null),e([y()],z.prototype,"_renderer",null),z=e([v("esri.views.3d.analysis.ShadowCastAnalysisView3D")],z);const S=z;function L(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function A(e,t){return(t?.[0]?.color??e).toUnitRGBA()}function k(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;case"base-dynamic-3d":case"catalog-3d":case"catalog-dynamic-group-3d":case"dimension-3d":case"gaussian-splat-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"viewshed-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":case"group":default:return!1;case"graphics-3d":return e.layer.graphics.some(e=>{const{symbol:t}=e;return null==t||"text"!==t.type&&!("symbolLayers"in t)||"text"!==t.type&&t.symbolLayers.some(e=>"text"!==e.type)})}}function E(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=D(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),n=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,a=i(e.layerVisibilities,t.layerVisibilities),o=i(e.layerOpacities,t.layerOpacities),l=i(e.filters,t.filters),u=i(e.definitionExpressions,t.definitionExpressions);return s&&r&&n&&a&&o&&l&&u}const R=_(1,"hours","milliseconds"),H=500,G=255,M=f(),I=[],q=new P;export{S as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t,equals as i}from"../../../core/arrayUtils.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as o}from"../../../core/maybe.js";import{after as l,throwIfAborted as u,isPromiseLike as c}from"../../../core/promiseUtils.js";import{watch as p,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{offsetDateUTC as g,convertTime as _}from"../../../core/timeUtils.js";import{property as f,subclass as y}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as D}from"../../../core/support/UpdatingHandles.js";import{g as C}from"../../../chunks/boundedPlane.js";import{polygonToVolume as b}from"../focusAreaUtils.js";import V from"./AnalysisView3D.js";import{registerAnalysisView as U,hideOtherAnalysisViews as T}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as P}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as O}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as x}from"../support/earthUtils.js";import{computeDirectionsOverTime as j}from"../support/sunUtils.js";import{maxColorRampSize as S}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as z}from"../../../widgets/support/traversalUtils.js";let R=class extends V{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._updatingHandles=new D,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([U(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{n(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=s(async e=>{await l(M,e),u(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&T(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},d),p(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{L(e,i,t)},d),p(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:s})=>{L(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{L(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{L(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new P({getDuration:this.getDurationAtScreen.bind(this),isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&L(this._renderer,!0,{enabled:!1}),this._tooltip=o(this._tooltip),this._stopPreviewingTask=n(this._stopPreviewingTask),this._updatingHandles=o(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||null!=this._stopPreviewingTask&&!this._stopPreviewingTask.finished||!0===this._tooltip?.updating||this._updatingHandles.updating}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){return this._updatedRecently||this._sceneUpdating}get _sceneUpdating(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,graphicsView:i}=e;return!t||this._shadowLayerViews.some(e=>e.updating)||!i?.suspended&&!!i?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?x(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=g(e,-e.getTimezoneOffset(),"minutes"),e=g(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(B-1)):B}get _interval(){const e=this._totalDurationInterval;switch(this.analysis.mode){case"min-duration":return this._totalDuration>0?e:0;case"total-duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,minDurationOptions:t}=this.analysis;return"min-duration"===e&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?I:this._referencePosition;if(null==i)return[];const s=j(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,B),r=s.length;q.length=0;const a=z(0,r,q),n=new Array(r);for(let o=0;o<r;++o)n[o]=s[a[o]];return n}get _analysisVolume(){const{geometry:e}=this.analysis;if(null==e)return this._previousVolume=null,null;try{const t=b(e,this.view,F);return null==t?(this._previousVolume=null,null):c(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return a.getLogger(this).error(new r("shadowcastanalysisview3d:projection-failed","Failed to project analysis area geometry to view spatial reference",{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"min-duration":return this._minDurationVisualizationParameters;case"total-duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){const{color:e,minDuration:t}=this.analysis.minDurationOptions,i=this._totalDuration;return{visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){const{minDurationOptions:e}=this.analysis;return e.contextEnabled?{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e.contextOptions.color,e.contextOptions.colorStops,1/this._lightDirectionsContext.length)}:{}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?G/s:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/s);return 0===r?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{bandedGradientColorRamp:a,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions;return{gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,1/this._lightDirections.length),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(k)}get _previewDependencies(){const{view:e}=this,i=e.slice.plane,s=this._shadowLayerViews,r=s.map(e=>e.layer).filter(t),a=s.map(e=>e.suspended),n=r.map(e=>e.visible),o=r.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=r.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),c=s.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:i,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:l,layerVisibilities:n,layerOpacities:o,filters:c,definitionExpressions:u}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){const{_renderer:t,_totalDurationSampleCount:i}=this;if(null==t||0===i)return 0;const s=this.view.state.camera.screenToRender(h(e.x,e.y),m());return t.readAccumulatedShadow(s)*this._totalDuration}_getEffectiveShadowCastColorRamp(e,t,i){if(null!=t){t.length>S&&a.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return E(e)}};e([f({readOnly:!0,type:["shadow-cast-view-3d"]})],R.prototype,"type",void 0),e([f({constructOnly:!0,nonNullable:!0})],R.prototype,"analysis",void 0),e([f({readOnly:!0})],R.prototype,"updating",null),e([f()],R.prototype,"_stopPreviewingTask",void 0),e([f()],R.prototype,"_updatedRecently",void 0),e([f()],R.prototype,"_tooltip",void 0),e([f()],R.prototype,"_sceneUpdating",null),e([f()],R.prototype,"_effectiveUtcOffset",null),e([f()],R.prototype,"_utcOffsetAuto",null),e([f()],R.prototype,"_dateUTCOffset",null),e([f()],R.prototype,"_startDateTimeUTC",null),e([f()],R.prototype,"_endDateTimeUTC",null),e([f()],R.prototype,"_referencePosition",null),e([f()],R.prototype,"_interval",null),e([f()],R.prototype,"_intervalContext",null),e([f()],R.prototype,"_totalDurationSampleCount",null),e([f()],R.prototype,"_totalDuration",null),e([f()],R.prototype,"_lightDirections",null),e([f()],R.prototype,"_lightDirectionsContext",null),e([f()],R.prototype,"_analysisVolume",null),e([f()],R.prototype,"_visualizationParameters",null),e([f()],R.prototype,"_minDurationVisualizationParameters",null),e([f()],R.prototype,"_minDurationContextVisualizationParameters",null),e([f()],R.prototype,"_durationVisualizationParameters",null),e([f()],R.prototype,"_discreteVisualizationParameters",null),e([f()],R.prototype,"_shadowLayerViews",null),e([f()],R.prototype,"_previewDependencies",null),e([f()],R.prototype,"_renderer",null),R=e([y("esri.views.3d.analysis.ShadowCastAnalysisView3D")],R);const A=R;function L(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function E(e){const t=e.toUnitRGBA();return[[0,w(t[0],t[1],t[2],0)],[1,t]]}function k(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;case"base-dynamic-3d":case"catalog-3d":case"catalog-dynamic-group-3d":case"dimension-3d":case"gaussian-splat-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"viewshed-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":case"group":default:return!1;case"graphics-3d":return e.layer.graphics.some(e=>{const{symbol:t}=e;return null==t||"text"!==t.type&&!("symbolLayers"in t)||"text"!==t.type&&t.symbolLayers.some(e=>"text"!==e.type)})}}function H(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=C(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,n=i(e.layerVisibilities,t.layerVisibilities),o=i(e.layerOpacities,t.layerOpacities),l=i(e.filters,t.filters),u=i(e.definitionExpressions,t.definitionExpressions);return s&&r&&a&&n&&o&&l&&u}const G=_(1,"hours","milliseconds"),M=500,B=255,I=v(),q=[],F=new O;export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as n}from"../../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{when as o,syncAndInitial as l,watch as r,sync as d,initial as c}from"../../../../core/reactiveUtils.js";import{property as h,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sub as g,len as m,set as v,angle as w,dot as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import f from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,projectPoint as y,create as S}from"../../../../geometry/support/plane.js";import{creationElevationInfo as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as M}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as H}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as I}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as j}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{AnalysisToolBase as P}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as E}from"../../../interactive/keybindings.js";import{newToolIntersector as L}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as k}from"../../../support/screenUtils.js";const A=Symbol("interactionVisuals");let O=class extends P{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=G,this._creationState=!1,this._interactionVisualElements=null,this._settings=new M({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=L(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s(()=>e,({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([o(()=>this._valid,()=>this.finishToolCreation(),l),r(()=>this._stagedViewshed,e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null},l),this.analysis.viewsheds.on("after-remove",e=>{const t=this._stagedViewshed;null!=t&&e.item===t&&this.analysis.viewsheds.add(t)}),r(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},d),r(()=>this.view.activeTool,e=>{e!==this&&null!=e&&(this.selectedViewshed=null)}),o(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)},c),r(()=>this.creating,()=>this.updateInteractionVisualsVisibility()),r(()=>this.selectedViewshed,e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)},c)])}destroy(){this.subToolHandles=a(this.subToolHandles),this.removeHandles(A)}onDeactivate(){this.removeStaged(),this._creationState=!1}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)}get _valid(){return this.analysisViewData.viewshedComputedDataHandles?.some(e=>e.viewshedComputedData.valid)??!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}place(e){this.selectedViewshed=null,this._placementMode=e,this._creationState="placing-observer",this._finishToolCreationIfValid()}onManipulatorSelectionChanged(){this.subToolHandles.forEach(e=>e.subTool.onManipulatorSelectionChanged())}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":E.cancel===e.key?this._cancelKeyHandler(e):E.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}onActivate(){this._placementMode=G}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){const e=new t({observer:i.mapPoint.clone(),elevationInfo:T,feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._stagedViewshed=null,"multiple"===this._placementMode?this._creationState="placing-observer":(this._creationState=!1,this._stagedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=null),this.selectedViewshed=e}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){this.creating?this._onCancelWhileCreating(e):this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_onCancelWhileCreating(e){const t=this.removeStaged();this._finishToolCreationIfValid(),t?(this._creationState="placing-observer",this.selectedViewshed=null,"multiple"===this._placementMode&&e.stopPropagation()):this._creationState=!1}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_finishToolCreationIfValid(){this._valid&&this.finishToolCreation()}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:n,farDistance:a}=x(this.view,i,e);t.farDistance=a,t.tilt=n,t.heading=s}removeStaged(){const e=this._stagedViewshed;return null!=e&&(this._stagedViewshed=null,this.analysis.viewsheds.remove(e),!0)}_intersectScreen(e,t){const i=k(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,n=t.scenePoint;if(!s.getIntersectionPoint(n))return null;const a=t.mapPoint;return a.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(n,a),null==a?null:(t.feature=j(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(A);const e=this._settings.visualElements,t=new I({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new H({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([r(()=>e.zVerticalLine,e=>e.apply(s),l),r(()=>e.heightPlane,e=>e.apply(t),l),i(()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null})],A)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,n=this.selectedViewshedComputedData,a=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void a(i,!1);if(null==s||null==n)return void a(!1,!1);const o=s.moveInteractionState,l=e?o.grabbing:o.dragging,r=s.scaleOrientInteractionState,d=e?r.grabbing:r.dragging,c=i&&(l||d);if(a(c,l),c){const e=l?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:n}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&n.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function x(e,t,i){const s=t.elevationAlignedObserverRenderSpace,a=g(W,i,s),o=m(a)*t.metersPerUnit,l=e.renderCoordsHelper.basisMatrixAtPosition(s,z),r=v(R,l[8],l[9],l[10]),d=b(s,r,F),c=y(d,i,U),h=g(c,c,s),u=(m(h)<1e-4?90:n(w(a,h)))*(_(r,a)<0?-1:1)+90,p=v(K,l[4],l[5],l[6]),V=n(w(p,h)),f=v(K,l[0],l[1],l[2]);return{heading:_(h,f)<0?360-V:V,tilt:u,farDistance:o}}e([h()],O.prototype,"updating",null),e([h({constructOnly:!0})],O.prototype,"view",void 0),e([h()],O.prototype,"analysisViewData",void 0),e([h()],O.prototype,"removeIncompleteOnCancel",void 0),e([h()],O.prototype,"automaticManipulatorSelection",void 0),e([h()],O.prototype,"multiTouchEnabled",void 0),e([h({constructOnly:!0})],O.prototype,"analysis",void 0),e([h()],O.prototype,"subToolHandles",void 0),e([h()],O.prototype,"_stagedViewshed",void 0),e([h()],O.prototype,"_stagedViewshedComputedData",void 0),e([h()],O.prototype,"_placementMode",void 0),e([h()],O.prototype,"_creationState",void 0),e([h()],O.prototype,"_valid",null),e([h({readOnly:!0})],O.prototype,"cursor",null),e([h()],O.prototype,"_selectedManipulator",void 0),e([h()],O.prototype,"_selectedSubTool",null),e([h()],O.prototype,"selectedViewshed",null),e([h()],O.prototype,"selectedViewshedComputedData",null),e([h()],O.prototype,"stagedViewshed",null),e([h()],O.prototype,"grabbing",null),e([h()],O.prototype,"creating",null),e([h()],O.prototype,"isPlacingTarget",null),O=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],O);const W=V(),R=V(),U=V(),K=V(),z=p(),F=S(),B={mapPoint:new f,scenePoint:V(),feature:null},G="multiple";export{O as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as n}from"../../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{when as o,syncAndInitial as l,watch as r,sync as d,initial as c}from"../../../../core/reactiveUtils.js";import{property as h,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sub as g,len as m,set as v,angle as w,dot as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import f from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,projectPoint as y,create as S}from"../../../../geometry/support/plane.js";import{creationElevationInfo as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as M}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as H}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as I}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as j}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{AnalysisToolBase as P}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as E}from"../../../interactive/keybindings.js";import{newToolIntersector as L}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as k}from"../../../support/screenUtils.js";const A=Symbol("interactionVisuals");let O=class extends P{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=G,this._creationState=!1,this._interactionVisualElements=null,this._settings=new M({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=L(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s(()=>e,({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([o(()=>this._valid,()=>this.finishToolCreation(),l),r(()=>this._stagedViewshed,e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null},l),this.analysis.viewsheds.on("after-remove",e=>{const t=this._stagedViewshed;null!=t&&e.item===t&&this.analysis.viewsheds.add(t)}),r(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},d),r(()=>this.view.activeTool,e=>{e!==this&&null!=e&&(this.selectedViewshed=null)}),o(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)},c),r(()=>this.creating,()=>this.updateInteractionVisualsVisibility()),r(()=>this.selectedViewshed,e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)},c)])}destroy(){this.subToolHandles=a(this.subToolHandles),this.removeHandles(A)}onDeactivate(){this.removeStaged(),this._creationState=!1}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)}get _valid(){return this.analysisViewData.viewshedComputedDataHandles?.some(e=>e.viewshedComputedData.valid)??!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}place(e){this.selectedViewshed=null,this._placementMode=e,this._creationState="placing-observer",this._finishToolCreationIfValid()}onManipulatorSelectionChanged(){this.subToolHandles.forEach(e=>e.subTool.onManipulatorSelectionChanged())}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":E.cancel===e.key?this._cancelKeyHandler(e):E.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}onActivate(){this._placementMode=G}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){const e=new t({observer:i.mapPoint.clone(),elevationInfo:T.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._stagedViewshed=null,"multiple"===this._placementMode?this._creationState="placing-observer":(this._creationState=!1,this._stagedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=null),this.selectedViewshed=e}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){this.creating?this._onCancelWhileCreating(e):this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_onCancelWhileCreating(e){const t=this.removeStaged();this._finishToolCreationIfValid(),t?(this._creationState="placing-observer",this.selectedViewshed=null,"multiple"===this._placementMode&&e.stopPropagation()):this._creationState=!1}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_finishToolCreationIfValid(){this._valid&&this.finishToolCreation()}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:n,farDistance:a}=x(this.view,i,e);t.farDistance=a,t.tilt=n,t.heading=s}removeStaged(){const e=this._stagedViewshed;return null!=e&&(this._stagedViewshed=null,this.analysis.viewsheds.remove(e),!0)}_intersectScreen(e,t){const i=k(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,n=t.scenePoint;if(!s.getIntersectionPoint(n))return null;const a=t.mapPoint;return a.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(n,a),null==a?null:(t.feature=j(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(A);const e=this._settings.visualElements,t=new I({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new H({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([r(()=>e.zVerticalLine,e=>e.apply(s),l),r(()=>e.heightPlane,e=>e.apply(t),l),i(()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null})],A)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,n=this.selectedViewshedComputedData,a=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void a(i,!1);if(null==s||null==n)return void a(!1,!1);const o=s.moveInteractionState,l=e?o.grabbing:o.dragging,r=s.scaleOrientInteractionState,d=e?r.grabbing:r.dragging,c=i&&(l||d);if(a(c,l),c){const e=l?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:n}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&n.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function x(e,t,i){const s=t.elevationAlignedObserverRenderSpace,a=g(W,i,s),o=m(a)*t.metersPerUnit,l=e.renderCoordsHelper.basisMatrixAtPosition(s,z),r=v(R,l[8],l[9],l[10]),d=b(s,r,F),c=y(d,i,U),h=g(c,c,s),u=(m(h)<1e-4?90:n(w(a,h)))*(_(r,a)<0?-1:1)+90,p=v(K,l[4],l[5],l[6]),V=n(w(p,h)),f=v(K,l[0],l[1],l[2]);return{heading:_(h,f)<0?360-V:V,tilt:u,farDistance:o}}e([h()],O.prototype,"updating",null),e([h({constructOnly:!0})],O.prototype,"view",void 0),e([h()],O.prototype,"analysisViewData",void 0),e([h()],O.prototype,"removeIncompleteOnCancel",void 0),e([h()],O.prototype,"automaticManipulatorSelection",void 0),e([h()],O.prototype,"multiTouchEnabled",void 0),e([h({constructOnly:!0})],O.prototype,"analysis",void 0),e([h()],O.prototype,"subToolHandles",void 0),e([h()],O.prototype,"_stagedViewshed",void 0),e([h()],O.prototype,"_stagedViewshedComputedData",void 0),e([h()],O.prototype,"_placementMode",void 0),e([h()],O.prototype,"_creationState",void 0),e([h()],O.prototype,"_valid",null),e([h({readOnly:!0})],O.prototype,"cursor",null),e([h()],O.prototype,"_selectedManipulator",void 0),e([h()],O.prototype,"_selectedSubTool",null),e([h()],O.prototype,"selectedViewshed",null),e([h()],O.prototype,"selectedViewshedComputedData",null),e([h()],O.prototype,"stagedViewshed",null),e([h()],O.prototype,"grabbing",null),e([h()],O.prototype,"creating",null),e([h()],O.prototype,"isPlacingTarget",null),O=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],O);const W=V(),R=V(),U=V(),K=V(),z=p(),F=S(),B={mapPoint:new f,scenePoint:V(),feature:null},G="multiple";export{O as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as e,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as g}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as h}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as l}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as v,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as A}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as j}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as b}from"../../input/recognizers/VerticalTwoFingerDrag.js";let T=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:o,dragPrimary:r,dragSecondary:t,dragTertiary:e})=>{"pro"===o&&(t="zoom",e="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:t,dragTertiary:e};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(o){const{actionMap:r}=this.view.navigation;r.dragPrimary=o,r.dragSecondary="pan"===o?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=t(this._inputManager),this._source=t(this._source)}connect(){const o=this.view;this._source=new f(this.view.surface,o.input);const r=[new j,new P,new M,new A(this.view.navigation),new b],t=new v({eventSource:this._source,recognizers:r});this._inputManager=t,t.installHandlers("prevent-context-menu",[new _],y.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new h(o,["primary"]),this._modeDragRotate=new m(o,["secondary"],0),this._modeDragZoom=new p(o,["tertiary"],a.fov),this._modeKeyboardNavigation=new c(o,a),t.installHandlers("navigation",[new l(o),new d(o),new g(o),new u(o,a.fov),new m(o,["primary"],1,[a.lookAround.modifier]),new h(o,["secondary"],[a.lookAround.modifier],!0),new h(o,["tertiary"],[a.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(o)],y.INTERNAL),this.view.viewEvents.connect(t),this.addHandles([e(()=>this.view.navigation?.browserTouchPanEnabled,o=>{this._source.browserTouchPanningEnabled=!o},i),e(()=>{const{actionMap:o}=this.view.navigation,{dragPrimary:r,dragSecondary:t,dragTertiary:e}=o;return{mode:this.mode,dragPrimary:r,dragSecondary:t,dragTertiary:e}},this._updateMode,n)])}isModifierKeyDown(o){return this._inputManager?.isModifierKeyDown(o)??!1}get test(){}};o([a()],T.prototype,"view",void 0),o([a({type:["default","pro"]})],T.prototype,"mode",void 0),o([a({readOnly:!0})],T.prototype,"updating",null),o([a()],T.prototype,"latestPointerInfo",null),o([a()],T.prototype,"multiTouchActive",null),o([a()],T.prototype,"_inputManager",void 0),T=o([s("esri.views.3d.input.SceneInputManager")],T);const S=T;export{S as default};
2
+ import{__decorate as o}from"tslib";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as e,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as g}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as l}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as v,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as A}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as P}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as j}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as b}from"../../input/recognizers/VerticalTwoFingerDrag.js";let T=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:o,dragPrimary:r,dragSecondary:t,dragTertiary:e})=>{"pro"===o&&(t="zoom",e="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:t,dragTertiary:e};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(o){const{actionMap:r}=this.view.navigation;r.dragPrimary=o,r.dragSecondary="pan"===o?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=t(this._inputManager),this._source=t(this._source)}connect(){const o=this.view;this._source=new f(this.view.surface,o.input);const r=[new P,new j,new M,new A(this.view.navigation),new b],t=new v({eventSource:this._source,recognizers:r});this._inputManager=t,t.installHandlers("prevent-context-menu",[new _],y.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new l(o,["primary"]),this._modeDragRotate=new m(o,["secondary"],0),this._modeDragZoom=new p(o,["tertiary"],a.fov),this._modeKeyboardNavigation=new c(o,a),t.installHandlers("navigation",[new h(o),new d(o),new g(o),new u(o,a.fov),new m(o,["primary"],1,[a.lookAround.modifier]),new l(o,["secondary"],[a.lookAround.modifier],!0),new l(o,["tertiary"],[a.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(o)],y.INTERNAL),this.view.viewEvents.connect(t),this.addHandles([e(()=>this.view.navigation?.browserTouchPanEnabled,o=>{this._source.browserTouchPanningEnabled=!o},i),e(()=>{const{actionMap:o}=this.view.navigation,{dragPrimary:r,dragSecondary:t,dragTertiary:e}=o;return{mode:this.mode,dragPrimary:r,dragSecondary:t,dragTertiary:e}},this._updateMode,n)])}isModifierKeyDown(o){return this._inputManager?.isModifierKeyDown(o)??!1}get test(){}};o([a()],T.prototype,"view",void 0),o([a({type:["default","pro"]})],T.prototype,"mode",void 0),o([a({readOnly:!0})],T.prototype,"updating",null),o([a()],T.prototype,"latestPointerInfo",null),o([a()],T.prototype,"latestPenInfo",null),o([a()],T.prototype,"multiTouchActive",null),o([a()],T.prototype,"_inputManager",void 0),T=o([s("esri.views.3d.input.SceneInputManager")],T);const I=T;export{I as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import o from"../../../request.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{releaseMaybe as r}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{property as a,subclass as n}from"../../../core/accessorSupport/decorators.js";import l from"../../../layers/support/ElevationTileData.js";import{acquireDecoder as c}from"../../../layers/support/LercDecoder.js";import{queueHighPriority as m}from"../../../request/queue.js";import{ElevationLayerView3DModifications as p,ElevationLayerView3DModification as d}from"./ElevationLayerView3DModifications.js";import{LayerView3D as f}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{elevationNoDataValue as h}from"../terrain/TerrainConst.js";import{useFetchTileForLayer as g}from"../terrain/terrainUtils.js";import u from"../../layers/LayerView.js";let w=class extends(y(f(u))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new p}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,o=e.map?.allLayers,i=o&&o.includes(this.layer),r=e.map?.ground?.layers,s=r&&r.includes(this.layer);if(i&&!s){const e=new t("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._lercDecoder=c(e.resourceController),this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=r(this._lercDecoder)}async fetchElevationTile(e,o){const t=await this._fetchTileData(e.lij,o);if(!s(o))return t&&await this.modifications.apply(t,e,o.signal),t}async _fetchTileData(e,t){const r=this.layer;if(g(r)){const o=await r.fetchTile(e[0],e[1],e[2],{noDataValue:h,signal:t.signal});return s(t)?void i.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."):l.from(o)}t={...m,responseType:"array-buffer",...t};const a=this.getTileUrl(e),n=(await o(a,t)).data,c=await this._lercDecoder.decode(n,{noDataValue:h},t.signal);if(c)return new l({values:c.pixelData,width:c.width,height:c.height,noDataValue:c.noDataValue});throw new Error("LERC decoding failed")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const o=await this._simplifyOperatorPromise;for(const t of e){const e=t.geometry;if("polygon"===e?.type){const r=o.execute(e);if("polygon"===r?.type){const e=new d(t.type,r);this.modifications.modifications.push(e)}else i.getLogger(this).warn("Failed to simplify modification polygon")}else i.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([a()],w.prototype,"layer",void 0),e([a()],w.prototype,"tileInfo",null),e([a()],w.prototype,"modifications",void 0),w=e([n("esri.views.3d.layers.ElevationLayerView3D")],w);const v=w;export{v as default};
2
+ import{__decorate as e}from"tslib";import i from"../../../core/Error.js";import o from"../../../core/Logger.js";import{isAborted as t}from"../../../core/promiseUtils.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import a from"../../../layers/support/ElevationTileData.js";import{ElevationLayerView3DModifications as n,ElevationLayerView3DModification as l}from"./ElevationLayerView3DModifications.js";import{LayerView3D as m}from"./LayerView3D.js";import{TiledLayerView3D as p}from"./TiledLayerView3D.js";import{elevationNoDataValue as c}from"../terrain/TerrainConst.js";import y from"../../layers/LayerView.js";let f=class extends(p(m(y))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new n}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,o=e.map?.allLayers,t=o&&o.includes(this.layer),r=e.map?.ground?.layers,s=r&&r.includes(this.layer);if(t&&!s){const e=new i("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._addTilingSchemeMatchPromise()}async fetchElevationTile(e,i){const o=await this._fetchTileData(e.lij,i);if(!t(i))return o&&await this.modifications.apply(o,e,i.signal),o}async _fetchTileData(e,i){const r=this.layer,s=await r.fetchTile(e[0],e[1],e[2],{noDataValue:c,signal:i.signal,useQueue:i.useQueue,priority:i.priority});if(!t(i))return a.from(s);o.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true.")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const i=await this._simplifyOperatorPromise;for(const t of e){const e=t.geometry;if("polygon"===e?.type){const r=i.execute(e);if("polygon"===r?.type){const e=new l(t.type,r);this.modifications.modifications.push(e)}else o.getLogger(this).warn("Failed to simplify modification polygon")}else o.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([r()],f.prototype,"layer",void 0),e([r()],f.prototype,"tileInfo",null),e([r()],f.prototype,"modifications",void 0),f=e([s("esri.views.3d.layers.ElevationLayerView3D")],f);const d=f;export{d as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as i,watch as r,sync as s}from"../../../core/reactiveUtils.js";import{property as l,subclass as a}from"../../../core/accessorSupport/decorators.js";import{computeSrcResolutions as n,projectDatasetExtent as o}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{LayerView3D as h}from"./LayerView3D.js";import{TiledLayerView3D as m}from"./TiledLayerView3D.js";import u from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as d}from"../terrain/RasterTile.js";import p from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as c}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as y}from"../../support/drapedUtils.js";import{getWebGLCapabilities as f}from"../../webgl/capabilities.js";let b=class extends(c(m(h(p)))){constructor(){super(...arguments),this._srcResolutions=[],this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._srcResolutions=n(this.layer.serviceRasterInfo,this.tileInfo),this.addHandles([r(()=>this.layer.renderer,e=>{this._setSubView(e),this._updatingHandles.consumePromise(this.doRefresh())},s),r(()=>[this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),s)])});this._setSubView(this.layer.renderer),this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,i=this._flowSubView;t&&null!=i||(i?.destroy(),this._flowSubView=t?new u({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[i,r]=this.tileInfo.size;return e.width=i,e.height=r,t.clearRect(0,0,i,r),t.getImageData(0,0,i,r)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,i=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,i)}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return o(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const i=this.tileInfo,r=this._canSymbolizeInWebGL(),s={tileInfo:i,requestRawData:r&&!this._hasFlow,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,srcResolution:this._srcResolutions[e[0]],noClip:!1},{layer:l}=this,[a,n,o]=e,h=await l.fetchTile(a,n,o,s);if(h instanceof HTMLImageElement)return h;let m=h?.pixelBlock;if(null==m)return this._blankTile;if(!r&&!this._hasFlow&&(m=await l.applyRenderer(h),null==m))return this._blankTile;const u=new d([a,n,o],m,i.size[0],i.size[1]);return r?(u.symbolizerRenderer=l.symbolizer.rendererJSON,u.symbolizerParameters=l.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(a)),u.transformGrid=h.transformGrid,u.bandIds=l.bandIds):(u.isRenderedSource=!0,u.bandIds=null),u.interpolation=l.interpolation,u}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return y(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=f(),{symbolizer:t}=this.layer,i=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,s=i&&i.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!r}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([l()],b.prototype,"fullExtent",null),e([l({readOnly:!0})],b.prototype,"_blankTile",null),e([l()],b.prototype,"_hasFlow",null),e([l({readOnly:!0})],b.prototype,"imageFormatIsOpaque",null),e([l({readOnly:!0})],b.prototype,"hasMixedImageFormats",null),e([l()],b.prototype,"_flowSubView",void 0),e([l({readOnly:!0})],b.prototype,"dataLevelRange",null),e([l({readOnly:!0})],b.prototype,"visibleAtCurrentScale",null),b=e([a("esri.views.3d.layers.ImageryTileLayerView3D")],b);const g=b;export{g as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as i,watch as r,sync as s}from"../../../core/reactiveUtils.js";import{property as l,subclass as a}from"../../../core/accessorSupport/decorators.js";import{computeSrcResolutions as n,projectDatasetExtent as o}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{createBitmapResult as h}from"../../../layers/support/imageBitmapUtils.js";import{LayerView3D as m}from"./LayerView3D.js";import{TiledLayerView3D as p}from"./TiledLayerView3D.js";import u from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as d}from"../terrain/RasterTile.js";import c from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as f}from"../../support/drapedUtils.js";import{getWebGLCapabilities as b}from"../../webgl/capabilities.js";let g=class extends(y(p(m(c)))){constructor(){super(...arguments),this._srcResolutions=[],this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._srcResolutions=n(this.layer.serviceRasterInfo,this.tileInfo),this.addHandles([r(()=>this.layer.renderer,e=>{this._setSubView(e),this._updatingHandles.consumePromise(this.doRefresh())},s),r(()=>[this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),s)])});this._setSubView(this.layer.renderer),this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,i=this._flowSubView;t&&null!=i||(i?.destroy(),this._flowSubView=t?new u({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[i,r]=this.tileInfo.size;return e.width=i,e.height=r,t.clearRect(0,0,i,r),h(e,{type:"image/png"})}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,i=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,i)}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return o(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,i){if(this._isAlignedMapTile)return this.layer.fetchImageBitmapTile(e[0],e[1],e[2],{...i,allowDeriveTypeFromData:!0,imageOrientation:"flipY"});const r=this.tileInfo,s=this._canSymbolizeInWebGL(),l={tileInfo:r,requestRawData:s&&!this._hasFlow,signal:i.signal,timeExtent:this.timeExtent,requestProjectedLocalDirections:this._hasFlow,srcResolution:this._srcResolutions[e[0]],noClip:!1},{layer:a}=this,[n,o,h]=e,m=await a.fetchTile(n,o,h,l);if(m instanceof HTMLImageElement||m instanceof ImageBitmap)throw new t("layerview:unexpected-tile-data","Expected fetchTile to return raster data, but received an image element. This may indicate a problem with the layer's fetchTile implementation.");let p=m?.pixelBlock;if(null==p)return this._blankTile;if(!s&&!this._hasFlow&&(p=await a.applyRenderer(m),null==p))return this._blankTile;const u=new d([n,o,h],p,r.size[0],r.size[1]);return s?(u.symbolizerRenderer=a.symbolizer.rendererJSON,u.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(n)),u.transformGrid=m.transformGrid,u.bandIds=a.bandIds):(u.isRenderedSource=!0,u.bandIds=null),u.interpolation=a.interpolation,u}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return f(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=b(),{symbolizer:t}=this.layer,i=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,s=i&&i.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!r}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([l()],g.prototype,"fullExtent",null),e([l()],g.prototype,"_blankTile",null),e([l()],g.prototype,"_hasFlow",null),e([l({readOnly:!0})],g.prototype,"imageFormatIsOpaque",null),e([l({readOnly:!0})],g.prototype,"hasMixedImageFormats",null),e([l()],g.prototype,"_flowSubView",void 0),e([l({readOnly:!0})],g.prototype,"dataLevelRange",null),e([l({readOnly:!0})],g.prototype,"visibleAtCurrentScale",null),g=e([a("esri.views.3d.layers.ImageryTileLayerView3D")],g);const w=g;export{w as default};