@arcgis/core 5.1.0-next.107 → 5.1.0-next.108
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.
- package/analysis/ShadowCastAnalysis.d.ts +2 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/4e13d639419ac64f7563.js +1 -0
- package/assets/esri/core/workers/chunks/4f9ea7544b2d0e88a05c.js +1 -0
- package/assets/esri/core/workers/chunks/{770611659b38066a6228.js → 5a85cbc04c64091d7f46.js} +1 -1
- package/assets/esri/core/workers/chunks/91c0de3950991d81b7f2.js +1 -0
- package/assets/esri/core/workers/chunks/{7ce60331f94ee0a5d674.js → beff5b4e15edee12bd4c.js} +33 -41
- package/assets/esri/core/workers/chunks/{740588250eaffb7301fd.js → e1340232962cf576d37e.js} +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +12 -12
- package/chunks/GlowComposition.glsl.js +1 -1
- package/chunks/OITBlend.glsl.js +7 -7
- package/chunks/OITBlendEmission.glsl.js +4 -4
- package/chunks/OITDimOpaque.glsl.js +3 -3
- package/config.js +1 -1
- package/core/workers/workers.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +3 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +2 -0
- package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/MapImageLayerView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
- package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -12
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITDimOpaque.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/WMSLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +26 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +5 -44
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +2 -0
- package/widgets/BatchAttributeForm/types.d.ts +7 -0
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/types.d.ts +21 -1
- package/widgets/FeatureTable.js +1 -1
- package/assets/esri/core/workers/chunks/2a2e97918524e0f436d7.js +0 -1
- package/assets/esri/core/workers/chunks/37c63570c0b4981cd519.js +0 -1
- package/assets/esri/core/workers/chunks/8557dd9ef336b23f768f.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{watch as o,syncAndInitial as a,initial as n}from"../../../core/reactiveUtils.js";import{property as h,subclass as p}from"../../../core/accessorSupport/decorators.js";import c from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import u from"../../../rest/support/PointBarrier.js";import d from"../../../rest/support/PolygonBarrier.js";import _ from"../../../rest/support/PolylineBarrier.js";import m from"../../../rest/support/RouteInfo.js";import g from"../../../rest/support/Stop.js";import{LayerView2D as w}from"./LayerView2D.js";import y from"./graphics/GraphicContainer.js";import f from"./graphics/GraphicsView2D.js";import{RouteLayerInteractiveOptions as v}from"./support/RouteLayerInteractiveOptions.js";import k from"../../layers/LayerView.js";import{getHighlightName as M}from"../../support/highlightOptionsUtils.js";const F=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],I={graphic:null,property:null,oldValue:null,newValue:null};function V(t){return t instanceof c||t instanceof l||t instanceof u||t instanceof d||t instanceof _||t instanceof m||t instanceof g}function G(t){return r.isCollection(t)&&t.length&&V(t.at(0))}function j(t){return Array.isArray(t)&&t.length>0&&V(t[0])}let P=class extends(w(k)){constructor(){super(...arguments),this._graphics=new r,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map,this._interaction=null,this._loadInteractionPromise=null,this.interactive=!1,this.interactiveOptions=new v}get _routeItems(){return new i({getCollections:()=>this.layer&&!this.destroyed?[this.layer.routeInfo?new r([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]:[]})}initialize(){this.addHandles(o(()=>{const{interactive:t,suspended:e}=this;return{interactive:t,suspended:e}},({interactive:t,suspended:e})=>{const r=t&&!e;r&&this._getInteractionLoadPromise().then(t=>{t.enabled=this.interactive&&!this.suspended}),this._interaction&&(this._interaction.enabled=r)},a)),this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),n)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView(),this._interaction?.enabled&&(this._interaction.enabled=!1)}get selectedNetworkFeatures(){return this._interaction?.selectedNetworkFeatures??null}async create(t){return this._interaction?.create(t)}delete(){this._interaction?.delete()}async
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{watch as o,syncAndInitial as a,initial as n}from"../../../core/reactiveUtils.js";import{property as h,subclass as p}from"../../../core/accessorSupport/decorators.js";import c from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import u from"../../../rest/support/PointBarrier.js";import d from"../../../rest/support/PolygonBarrier.js";import _ from"../../../rest/support/PolylineBarrier.js";import m from"../../../rest/support/RouteInfo.js";import g from"../../../rest/support/Stop.js";import{LayerView2D as w}from"./LayerView2D.js";import y from"./graphics/GraphicContainer.js";import f from"./graphics/GraphicsView2D.js";import{RouteLayerInteractiveOptions as v}from"./support/RouteLayerInteractiveOptions.js";import k from"../../layers/LayerView.js";import{getHighlightName as M}from"../../support/highlightOptionsUtils.js";const F=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],I={graphic:null,property:null,oldValue:null,newValue:null};function V(t){return t instanceof c||t instanceof l||t instanceof u||t instanceof d||t instanceof _||t instanceof m||t instanceof g}function G(t){return r.isCollection(t)&&t.length&&V(t.at(0))}function j(t){return Array.isArray(t)&&t.length>0&&V(t[0])}let P=class extends(w(k)){constructor(){super(...arguments),this._graphics=new r,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map,this._interaction=null,this._loadInteractionPromise=null,this.interactive=!1,this.interactiveOptions=new v}get _routeItems(){return new i({getCollections:()=>this.layer&&!this.destroyed?[this.layer.routeInfo?new r([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]:[]})}initialize(){this.addHandles(o(()=>{const{interactive:t,suspended:e}=this;return{interactive:t,suspended:e}},({interactive:t,suspended:e})=>{const r=t&&!e;r&&this._getInteractionLoadPromise().then(t=>{t.enabled=this.interactive&&!this.suspended}),this._interaction&&(this._interaction.enabled=r)},a)),this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),n)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView(),this._interaction?.enabled&&(this._interaction.enabled=!1)}get selectedNetworkFeatures(){return this._interaction?.selectedNetworkFeatures??null}async create(t){return this._interaction?.create(t)}delete(){this._interaction?.delete()}async fetchPopupFeaturesAtTarget(t,e){const r=this.view.toScreen(t);return r?this._graphicsView.hitTest(this.view,r).filter(({popupTemplate:t})=>!!t):(console.warn("Invalid screen point",t),[])}highlight(t,r){let i;i=V(t)?[this._getNetworkFeatureUid(t)]:j(t)?t.map(t=>this._getNetworkFeatureUid(t)):G(t)?t.map(t=>this._getNetworkFeatureUid(t)).toArray():[t.uid];const o=i.filter(e);if(!o.length)return s();const a=M(r);return this._addHighlights(o,a),s(()=>this._removeHighlights(o,a))}async hitTest(t,r){if(this.suspended)return null;const i=this._graphicsView.hitTest(this.view,r).filter(e).map(t=>this._networkGraphicMap.get(t));if(!i.length)return null;const{layer:s}=this;return i.reverse().map(e=>({type:"route",layer:s,mapPoint:t,networkFeature:e}))}isUpdating(){return this._graphicsView.updating}moveEnd(){}remove(t){this._interaction?.remove(t)}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),r=new y(t.featuresTilingScheme);this._graphicsView=new f({container:r,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(r),this._processHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return F.indexOf(e.type)}_getInteractionLoadPromise(){return this._loadInteractionPromise||(this._loadInteractionPromise=this._loadInteraction(),this._updatingHandles.consumePromise(this._loadInteractionPromise)),this._loadInteractionPromise}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}async _loadInteraction(){const{interactiveOptions:t,layer:e,view:r}=this,{RouteLayerInteraction:i}=await import("./support/RouteLayerInteraction.js");return this._interaction=new i({interactiveOptions:t,layer:e,view:r}),this._interaction}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(t=>{const e=this._networkFeatureMap.get(t);return this._networkFeatureMap.delete(t),this._networkGraphicMap.delete(e),e}));for(const e of t.removed)this.removeHandles(e)}if(t.added.length){this._graphics.addMany(t.added.map(t=>{const e=this._createGraphic(t);return null==e.symbol?null:(this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),e)}).filter(e));for(const e of t.added)this.addHandles([o(()=>e.geometry,(t,r)=>{this._updateGraphic(e,"geometry",t,r)}),o(()=>e.symbol,(t,r)=>{this._updateGraphic(e,"symbol",t,r)}),o(()=>e.popupTemplate,t=>{this._networkFeatureMap.has(e)&&(this._networkFeatureMap.get(e).popupTemplate=t)}),o(()=>e.toGraphic().attributes,t=>{this._networkFeatureMap.has(e)&&(this._networkFeatureMap.get(e).attributes=t)})],e);this._graphics.sort((t,e)=>this._getDrawOrder(t)-this._getDrawOrder(e))}}_updateGraphic(t,e,r,i){if(!this._networkFeatureMap.has(t)){const e=this._createGraphic(t);return this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),void this._graphics.add(e)}const s=this._networkFeatureMap.get(t);s[e]=r,I.graphic=s,I.property=e,I.oldValue=i,I.newValue=r,this._graphicsView.graphicUpdateHandler(I)}_processHighlight(){const t=this._getHighlights();this._graphicsView?.setHighlight(t)}};t([h()],P.prototype,"_routeItems",null),t([h()],P.prototype,"_interaction",void 0),t([h()],P.prototype,"interactive",void 0),t([h({readOnly:!0})],P.prototype,"interactiveOptions",void 0),t([h({readOnly:!0})],P.prototype,"selectedNetworkFeatures",null),P=t([p("esri.views.2d.layers.RouteLayerView2D")],P);const b=P;export{b 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{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 h,subclass as a}from"../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/Accessor.js";import"../../../core/has.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/RandomLCG.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.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 n}from"./BitmapTileLayerView2D.js";import{LayerView2D as c}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as u}from"./support/imageUtils.js";import d from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import y from"../tiling/TileQueue.js";import w from"../tiling/TileStrategy.js";import j from"../../layers/LayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as T}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as V}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as v}from"../../support/drapedUtils.js";import{getHighlightName as U}from"../../support/highlightOptionsUtils.js";import{TaskPriority as H}from"../../support/Scheduler.js";const I=[0,0];let q=class extends(_(n(c(j)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,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 d(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new y({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:H.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new w({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new V({createFetchPopupFeaturesQueryGeometry:(e,i)=>v(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
|
|
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 h,subclass as a}from"../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/Accessor.js";import"../../../core/has.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/RandomLCG.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.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 n}from"./BitmapTileLayerView2D.js";import{LayerView2D as c}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as u}from"./support/imageUtils.js";import d from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import y from"../tiling/TileQueue.js";import w from"../tiling/TileStrategy.js";import j from"../../layers/LayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as T}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as V}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as v}from"../../support/drapedUtils.js";import{getHighlightName as U}from"../../support/highlightOptionsUtils.js";import{TaskPriority as H}from"../../support/Scheduler.js";const I=[0,0];let q=class extends(_(n(c(j)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,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 d(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new y({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:H.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new w({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new V({createFetchPopupFeaturesQueryGeometry:(e,i)=>v(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 fetchPopupFeaturesAtTarget(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtTarget(e,i):[]}highlight(e,t){const s=T(e);if(0===s.length)return i();const r=U(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 o(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(I,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(h){if(s(h))throw h;if(!this.resampling)return m(this._tileInfoView.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new f(t),h=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return u(this._tileInfoView,h,s,e)}}return m(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:h,resamplingLevel:a=0}=i,o=new f(0,0,0,0);let l,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:h}),!this.resampling&&o.level!==e.level)return await r(i),m(this._tileInfoView.size);l=await this._fetchImage(o,h)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&a<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){o.set(t);try{l=await this._fetchTileWithTilemapCache(o,{...i,resamplingLevel:a+1})}catch{}}}}return l?this.resampling?u(this._tileInfoView,l,o,e):l:m(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([h()],q.prototype,"resampling",null),e([h()],q.prototype,"tilemapCache",null),q=e([a("esri.views.2d.layers.TileLayerView2D")],q);const S=q;export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import t from"../../../../../../../request.js";import e from"../../../../../../../core/Error.js";import has from"../../../../../../../core/has.js";import r from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as a}from"../../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as s,quantizeOptimizedFeatureSet as
|
|
2
|
+
import t from"../../../../../../../request.js";import e from"../../../../../../../core/Error.js";import has from"../../../../../../../core/has.js";import r from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as a}from"../../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as s,quantizeOptimizedFeatureSet as o}from"../../../../../../../layers/graphics/featureConversionUtils.js";import{queryOptimizedFeatureSet as i}from"../../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as n,getQueryParameters as u,executeQuery as c}from"../../../../../../../rest/query/operations/query.js";import{FeatureSetReaderJSON as m}from"../../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as l}from"../../../support/FeatureSetReaderPBF.js";class p{constructor(t,e){this.service=t,this._metadata=e}destroy(){}}function y(t,e,r){switch(t.type){case"memory":return new d(t,e,r);case"ogc":return new _(t,e);case"feature-service":return t.queryMetadata.supportsFormatPBF&&has("featurelayer-pbf")?new h(t,e):new w(t,e)}}async function f(t){const e=new r;return await e.open(t,{}),e}class d extends p{constructor(t,e,r){super(t,e),this._ports=[],this._loaded=this._load(r)}destroy(){this._loaded.finally(()=>{this._client.close(),this._client=null;for(const t of this._ports)t.close()}).catch(()=>{})}async _load(t){this._ports=await t.layerView.openMemoryPorts(),this._client=await f(this._ports)}async executeQuery(t,e){await this._loaded;const r=await this._client.invoke("queryFeatures",t.toJSON(),e);return m.fromFeatureSet(r,this._metadata)}}class h extends p{async executeQuery(r,a){const s=await n(this.service.source,r,a),o=!r.quantizationParameters;try{return l.fromBuffer(s,this._metadata,o)}catch(i){const s=await u(this.service.source,r,"pbf",a??{}),{data:{url:o}}=await t(s.url,{responseType:"native-request-init",...s.options});throw new e("featurelayer:query","Failed to parse response",{url:o,error:i,query:r.toJSON()})}}}class w extends p{async executeQuery(t,e){const{source:r,queryMetadata:i}=this.service,n=null;if(null!=t.quantizationParameters&&!i.supportsQuantization){const i=t.clone(),u=a(i.quantizationParameters);i.quantizationParameters=null;const l=await c(r,i,n,e),p=s(l,this._metadata.featureIdInfo);return o(u,p),m.fromOptimizedFeatureSet(p,this._metadata)}const u=await c(r,t,n,e);return"esriGeometryPoint"===this._metadata.geometryType&&(u.features=u.features?.filter(t=>{if(null!=t.geometry){const e=t.geometry;return Number.isFinite(e.x)&&Number.isFinite(e.y)}return!0})),m.fromFeatureSet(u,this._metadata)}}class _ extends p{async executeQuery(t,e){if(t.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=t.clone(),s=a(r.quantizationParameters);r.quantizationParameters=null;const n=await i(this.service.source,t,e);return o(s,n),m.fromOptimizedFeatureSet(n,this._metadata)}const r=await i(this.service.source,t,e);return m.fromOptimizedFeatureSet(r,this._metadata)}}export{p as SourceAdapter,y as createQueryAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as d,quantizeY as u}from"../../../../../geometry/support/quantizationUtils.js";import{getCentroidOptimizedGeometry as h}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as l,generalizeOptimizedGeometry as c,quantizeOptimizedGeometry as m,unquantizeOptimizedGeometryInPlace as y}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as f}from"../../../../../layers/graphics/OptimizedFeature.js";import p from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as g,unknown as _}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],D=x[0],T=x[1],F=x[2],I=x[3],A=has("featurelayer-simplify-payload-size-factors")??[1,2,4],S=A[0],B=A[1],j=A[2],C=has("featurelayer-simplify-mobile-factor")??2,G=has("esri-mobile"),M=4294967295;function v(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class O{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._postQueryFilteredIds=new Set,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._deleted=new Set,this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=G?C:1;t>4e6?r=j*s:t>1e6?r=B*s:t>5e5?r=S*s:t>1e5&&(r=s);let i=0;return e>4e3?i=I*r:e>2e3?i=F*r:e>100?i=T:e>15&&(i=D),i}getBounds(e){v(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===M||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(M),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,r,s,i,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new f(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return l(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=c(t,this.metadata.geometryType,e.scale[0])),t&&(t=m(t,this.metadata.geometryType,e,t.hasZ,t.hasM,!0)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=d(e,t.coords[0]),s=u(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&y(t,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&y(r,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}delete(){this._deleted.add(this.getObjectId())}getByReferenceVertexCount(){return null}get underlyingMemory(){let e=0;e+=t(this._boundsBuffer);for(const t of this._caches.values())e+=t.usedMemory;return e}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);if("esriGeometryPoint"===this.geometryType||!t)return t;const r=this.getInTransform();if(!t||!r)return t;const s=r.scale[2]??1,i=r.translate[2]??0,o=r.scale[3]??1,a=r.translate[3]??0,{hasZ:n,hasM:d,stride:u,size:h,coords:l}=t,c=n&&(1!==s||0!==i),m=d&&(1!==o||0!==a);if(c||m){const e=2,t=n?3:2;for(let r=0,n=u*h;r<n;r+=u)c&&(l[r+e]=s*l[r+e]+i),m&&(l[r+t]=o*l[r+t]+a)}return t.deltaDecode()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=l(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??g):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===_}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&null==this.geometry()}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;const t=this.getCursor();for(;t.next();){e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}const e=this.getObjectId();return this._deleted.has(e)||!this._postQueryFilteredIds.has(e)}_computeDisplayCentroid(e){if(null==this.getInTransform())return h(e);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?isNaN(r[0])||isNaN(r[1])?h(e):(r[1]*=-1,new p([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone,e._postQueryFilteredIds=this._postQueryFilteredIds,e._deleted=this._deleted}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return l(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new p([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new p([2],[e-1,t+1,1,-1])}}export{O as FeatureSetReader};
|
|
2
|
+
import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as d,quantizeY as u}from"../../../../../geometry/support/quantizationUtils.js";import{zScale as c}from"../../../../../geometry/support/zscale.js";import{getCentroidOptimizedGeometry as h}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as l,generalizeOptimizedGeometry as m,quantizeOptimizedGeometry as y,unquantizeOptimizedGeometryInPlace as f}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as p}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as _,unknown as b}from"../../../../../time/constants.js";import{FeatureSetCache as x}from"./FeatureSetCache.js";const T=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],D=T[0],F=T[1],I=T[2],S=T[3],A=has("featurelayer-simplify-payload-size-factors")??[1,2,4],j=A[0],B=A[1],C=A[2],G=has("featurelayer-simplify-mobile-factor")??2,M=has("esri-mobile"),v=4294967295;function O(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class w{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._postQueryFilteredIds=new Set,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._deleted=new Set,this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=M?G:1;t>4e6?r=C*s:t>1e6?r=B*s:t>5e5?r=j*s:t>1e5&&(r=s);let i=0;return e>4e3?i=S*r:e>2e3?i=I*r:e>100?i=F:e>15&&(i=D),i}getBounds(e){O(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===v||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(v),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,r,s,i,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new p(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return l(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=m(t,this.metadata.geometryType,e.scale[0])),t&&(t=y(t,this.metadata.geometryType,e,t.hasZ,t.hasM,!0)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=d(e,t.coords[0]),s=u(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}_transformToWorldSpace(e){if(!e)return null;e=e.clone();const t=this.getInTransform();t&&f(e,t);const r=c(this.metadata.spatialReference,this.metadata.outSpatialReference);if(e.hasZ&&1!==r){const{stride:t,coords:s}=e;for(let e=2;e<s.length;e+=t)s[e]*=r}return e}readGeometryWorldSpace(){let e=this._readGeometry();return e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),this._transformToWorldSpace(e)}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();return this._transformToWorldSpace(t)}setCache(e){let t=this._caches.get(e);null==t&&(t=new x(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}delete(){this._deleted.add(this.getObjectId())}getByReferenceVertexCount(){return null}get underlyingMemory(){let e=0;e+=t(this._boundsBuffer);for(const t of this._caches.values())e+=t.usedMemory;return e}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);if("esriGeometryPoint"===this.geometryType||!t)return t;const r=this.getInTransform();if(!t||!r)return t;const s=r.scale[2]??1,i=r.translate[2]??0,o=r.scale[3]??1,a=r.translate[3]??0,{hasZ:n,hasM:d,stride:u,size:c,coords:h}=t,l=n&&(1!==s||0!==i),m=d&&(1!==o||0!==a);if(l||m){const e=2,t=n?3:2;for(let r=0,n=u*c;r<n;r+=u)l&&(h[r+e]=s*h[r+e]+i),m&&(h[r+t]=o*h[r+t]+a)}return t.deltaDecode()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=l(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??_):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===b}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&null==this.geometry()}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;const t=this.getCursor();for(;t.next();){e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}const e=this.getObjectId();return this._deleted.has(e)||!this._postQueryFilteredIds.has(e)}_computeDisplayCentroid(e){if(null==this.getInTransform())return h(e);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?isNaN(r[0])||isNaN(r[1])?h(e):(r[1]*=-1,new g([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone,e._postQueryFilteredIds=this._postQueryFilteredIds,e._deleted=this._deleted}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return l(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new g([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new g([2],[e-1,t+1,1,-1])}}export{w as FeatureSetReader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{roundToNearest as e}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{initial as l}from"../../../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../../../core/screenUtils.js";import{throttle as h}from"../../../../core/throttle.js";import{convertTime as p}from"../../../../core/timeUtils.js";import{property as u,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as g}from"../../../../intl/locale.js";import{fetchMessageBundle as w}from"../../../../intl/messages.js";import{substitute as v}from"../../../../intl/substitute.js";let f=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=y(),this._tooltipContentElement=D(),this._updatingHandles=new m,this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this.shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const i=d(t,o);this._screenPoint=i,this._throttledUpdateShadowDuration?.(this.view,i)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=i(async i=>{const{results:s,ground:e}=await t.hitTest(o);if(n(i),0===s.length&&!e.mapPoint)return void(this.shadowDuration=null);const a=await this.getDuration(o,i);n(i),this.shadowDuration=a})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=i(()=>w("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([g(t),this._updatingHandles.add(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},l),this._updatingHandles.add(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},l),this._updatingHandles.add(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},l),this._updatingHandles.add(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=h(this._updateShadowDuration,t)},l),s(()=>{this._throttledUpdateShadowDuration=a(this._throttledUpdateShadowDuration)})])}destroy(){this._updatingHandles.destroy(),this._tooltipElement.remove()}get updating(){return this._updatingHandles.updating||null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||null!=this._messagesTask&&!this._messagesTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this.shadowDuration;if(null==t||null==o)return"";const i=e(o,o<U?j:U);return v(this.getVisualizeSunlight()?t.sunlightDuration:t.shadowDuration,{duration:_(i)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},i=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this.shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",i),t.on("pointer-down",i),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):i()}),t.on("click",o=>{const i=d(o.x,o.y);this._screenPoint=i,this._updateShadowDuration(t,i)}),s(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=r(this._shadowDurationTask)}};function y(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],f.prototype,"view",void 0),t([u()],f.prototype,"isVisible",void 0),t([u()],f.prototype,"getDuration",void 0),t([u()],f.prototype,"throttleDelay",void 0),t([u()],f.prototype,"updating",null),t([u()],f.prototype,"getVisualizeSunlight",void 0),t([u()],f.prototype,"_messagesTask",void 0),t([u()],f.prototype,"_screenPoint",void 0),t([u()],f.prototype,"_shadowDurationTask",void 0),t([u()],f.prototype,"shadowDuration",void 0),t([u()],f.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],f.prototype,"_formattedText",null),t([u()],f.prototype,"_styles",null),f=t([c("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],f);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=p(1,"minutes","milliseconds"),U=p(15,"minutes","milliseconds");export{f as ShadowCastTooltip};
|
|
2
|
+
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{roundToNearest as e}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{initial as l}from"../../../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../../../core/screenUtils.js";import{throttle as h}from"../../../../core/throttle.js";import{convertTime as p}from"../../../../core/timeUtils.js";import{property as u,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as g}from"../../../../intl/locale.js";import{fetchMessageBundle as w}from"../../../../intl/messages.js";import{substitute as v}from"../../../../intl/substitute.js";let f=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=y(),this._tooltipContentElement=D(),this._updatingHandles=new m,this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this.shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const i=d(t,o);this._screenPoint=i,this._throttledUpdateShadowDuration?.(this.view,i)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=i(async i=>{const{results:s,ground:e}=await t.hitTest(o);if(n(i),0===s.length&&!e.mapPoint)return void(this.shadowDuration=null);const a=await this.getDuration(o,i);n(i),this.shadowDuration=a<0?null:a})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=i(()=>w("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([g(t),this._updatingHandles.add(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},l),this._updatingHandles.add(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},l),this._updatingHandles.add(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},l),this._updatingHandles.add(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=h(this._updateShadowDuration,t)},l),s(()=>{this._throttledUpdateShadowDuration=a(this._throttledUpdateShadowDuration)})])}destroy(){this._updatingHandles.destroy(),this._tooltipElement.remove()}get updating(){return this._updatingHandles.updating||null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||null!=this._messagesTask&&!this._messagesTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this.shadowDuration;if(null==t||null==o)return"";const i=e(o,o<U?j:U);return v(this.getVisualizeSunlight()?t.sunlightDuration:t.shadowDuration,{duration:_(i)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},i=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this.shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",i),t.on("pointer-down",i),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):i()}),t.on("click",o=>{const i=d(o.x,o.y);this._screenPoint=i,this._updateShadowDuration(t,i)}),s(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=r(this._shadowDurationTask)}};function y(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],f.prototype,"view",void 0),t([u()],f.prototype,"isVisible",void 0),t([u()],f.prototype,"getDuration",void 0),t([u()],f.prototype,"throttleDelay",void 0),t([u()],f.prototype,"updating",null),t([u()],f.prototype,"getVisualizeSunlight",void 0),t([u()],f.prototype,"_messagesTask",void 0),t([u()],f.prototype,"_screenPoint",void 0),t([u()],f.prototype,"_shadowDurationTask",void 0),t([u()],f.prototype,"shadowDuration",void 0),t([u()],f.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],f.prototype,"_formattedText",null),t([u()],f.prototype,"_styles",null),f=t([c("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],f);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=p(1,"minutes","milliseconds"),U=p(15,"minutes","milliseconds");export{f as ShadowCastTooltip};
|
|
@@ -76,7 +76,9 @@ export default abstract class ShadowCastAnalysisView3D extends AnalysisView3D {
|
|
|
76
76
|
* [ShadowCastAnalysis.visualizeSunlight](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#visualizeSunlight) is `true`, this method returns the time spent in sunlight.
|
|
77
77
|
*
|
|
78
78
|
* @param point - The point on the screen for which the shadow or sunlight duration is calculated.
|
|
79
|
-
* @returns A promise that resolves to the duration (in milliseconds) spent in shadow or sunlight for the given
|
|
79
|
+
* @returns A promise that resolves to the duration (in milliseconds) spent in shadow or sunlight for the given
|
|
80
|
+
* screen point. Returns `-1` when the point is outside the [ShadowCastAnalysis.geometry](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#geometry) project
|
|
81
|
+
* area.
|
|
80
82
|
* @since 5.0
|
|
81
83
|
* @example
|
|
82
84
|
* ```js
|
|
@@ -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 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 y,subclass as v}from"../../../core/accessorSupport/decorators.js";import{create as f}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{n 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 S}from"../support/earthUtils.js";import{computeDirectionsOverTime as x}from"../support/sunUtils.js";import{maxColorRampSize as z}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as j}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(B,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),getVisualizeSunlight:()=>this.analysis.visualizeSunlight,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?S(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/(M-1)):M}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=x(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,M),r=s.length;q.length=0;const a=j(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,thresholdRendersSunlight:this.analysis.visualizeSunlight,...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,this.analysis.visualizeSunlight)}:{}}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,this.analysis.visualizeSunlight);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,this.analysis.visualizeSunlight),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()),r=t.readAccumulatedShadow(s);return(this.analysis.visualizeSunlight?1-r:r)*this._totalDuration}_getEffectiveShadowCastColorRamp(e,t,i,s){if(null!=t){t.length>z&&a.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(s?e=>[1-e.value*i,e.color.toUnitRGBA()]:e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return E(e,s)}};e([y({readOnly:!0,type:["shadow-cast-view-3d"]})],R.prototype,"type",void 0),e([y({constructOnly:!0,nonNullable:!0})],R.prototype,"analysis",void 0),e([y({readOnly:!0})],R.prototype,"updating",null),e([y()],R.prototype,"_stopPreviewingTask",void 0),e([y()],R.prototype,"_updatedRecently",void 0),e([y()],R.prototype,"_tooltip",void 0),e([y()],R.prototype,"_sceneUpdating",null),e([y()],R.prototype,"_effectiveUtcOffset",null),e([y()],R.prototype,"_utcOffsetAuto",null),e([y()],R.prototype,"_dateUTCOffset",null),e([y()],R.prototype,"_startDateTimeUTC",null),e([y()],R.prototype,"_endDateTimeUTC",null),e([y()],R.prototype,"_referencePosition",null),e([y()],R.prototype,"_interval",null),e([y()],R.prototype,"_intervalContext",null),e([y()],R.prototype,"_totalDurationSampleCount",null),e([y()],R.prototype,"_totalDuration",null),e([y()],R.prototype,"_lightDirections",null),e([y()],R.prototype,"_lightDirectionsContext",null),e([y()],R.prototype,"_analysisVolume",null),e([y()],R.prototype,"_visualizationParameters",null),e([y()],R.prototype,"_minDurationVisualizationParameters",null),e([y()],R.prototype,"_minDurationContextVisualizationParameters",null),e([y()],R.prototype,"_durationVisualizationParameters",null),e([y()],R.prototype,"_discreteVisualizationParameters",null),e([y()],R.prototype,"_shadowLayerViews",null),e([y()],R.prototype,"_previewDependencies",null),e([y()],R.prototype,"_renderer",null),R=e([v("esri.views.3d.analysis.ShadowCastAnalysisView3D")],R);const A=R;function L(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function E(e,t){const i=e.toUnitRGBA(),s=w(i[0],i[1],i[2],0),[r,a]=t?[i,s]:[s,i];return[[0,r],[1,a]]}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"),B=500,M=255,I=f(),q=[],F=new O;export{A 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 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 f}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{projectAsync as C}from"../../../geometry/projectionUtils.js";import{e as b}from"../../../chunks/containsOperator.js";import{n as V}from"../../../chunks/boundedPlane.js";import{polygonToVolume as U}from"../focusAreaUtils.js";import P from"./AnalysisView3D.js";import{registerAnalysisView as T,hideOtherAnalysisViews as S}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as O}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as x}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as j}from"../support/earthUtils.js";import{computeDirectionsOverTime as z}from"../support/sunUtils.js";import{maxColorRampSize as R}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as A}from"../../../widgets/support/traversalUtils.js";let L=class extends P{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([T(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{a(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)=>I(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&S(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})=>{k(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})=>{k(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{k(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{k(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new O({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&k(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?j(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/(q-1)):q}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?F:this._referencePosition;if(null==i)return[];const s=z(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,q),r=s.length;N.length=0;const n=A(0,r,N),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=U(e,this.view,J);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,thresholdRendersSunlight:this.analysis.visualizeSunlight,...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,this.analysis.visualizeSunlight)}:{}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?B/s:0,n=this._getEffectiveShadowCastColorRamp(e,t,1/s,this.analysis.visualizeSunlight);return 0===r?{...this._discreteVisualizationParameters,gradientColorRamp:n}:{bandedGradientColorRamp:n,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions;return{gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,1/this._lightDirections.length,this.analysis.visualizeSunlight),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(G)}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){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;const{_renderer:i,_totalDurationSampleCount:s}=this;if(null==i||0===s)return 0;const r=this.view.state.camera.screenToRender(h(e.x,e.y),m()),n=i.readAccumulatedShadow(r);return(this.analysis.visualizeSunlight?1-n:n)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){const{geometry:i}=this.analysis;if(!i)return!0;const s=await this.view.hitTest(e);u(t);const r=s.results.find(e=>e.mapPoint)?.mapPoint??s?.ground?.mapPoint;if(!r)return!1;const n=await C(r,i.spatialReference,{signal:t});return u(t),null!=n&&b(i,n)}_getEffectiveShadowCastColorRamp(e,t,i,s){if(null!=t){t.length>R&&n.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(s?e=>[1-e.value*i,e.color.toUnitRGBA()]:e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return H(e,s)}};e([y({readOnly:!0,type:["shadow-cast-view-3d"]})],L.prototype,"type",void 0),e([y({constructOnly:!0,nonNullable:!0})],L.prototype,"analysis",void 0),e([y({readOnly:!0})],L.prototype,"updating",null),e([y()],L.prototype,"_stopPreviewingTask",void 0),e([y()],L.prototype,"_updatedRecently",void 0),e([y()],L.prototype,"_tooltip",void 0),e([y()],L.prototype,"_sceneUpdating",null),e([y()],L.prototype,"_effectiveUtcOffset",null),e([y()],L.prototype,"_utcOffsetAuto",null),e([y()],L.prototype,"_dateUTCOffset",null),e([y()],L.prototype,"_startDateTimeUTC",null),e([y()],L.prototype,"_endDateTimeUTC",null),e([y()],L.prototype,"_referencePosition",null),e([y()],L.prototype,"_interval",null),e([y()],L.prototype,"_intervalContext",null),e([y()],L.prototype,"_totalDurationSampleCount",null),e([y()],L.prototype,"_totalDuration",null),e([y()],L.prototype,"_lightDirections",null),e([y()],L.prototype,"_lightDirectionsContext",null),e([y()],L.prototype,"_analysisVolume",null),e([y()],L.prototype,"_visualizationParameters",null),e([y()],L.prototype,"_minDurationVisualizationParameters",null),e([y()],L.prototype,"_minDurationContextVisualizationParameters",null),e([y()],L.prototype,"_durationVisualizationParameters",null),e([y()],L.prototype,"_discreteVisualizationParameters",null),e([y()],L.prototype,"_shadowLayerViews",null),e([y()],L.prototype,"_previewDependencies",null),e([y()],L.prototype,"_renderer",null),L=e([f("esri.views.3d.analysis.ShadowCastAnalysisView3D")],L);const E=L;function k(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function H(e,t){const i=e.toUnitRGBA(),s=w(i[0],i[1],i[2],0),[r,n]=t?[i,s]:[s,i];return[[0,r],[1,n]]}function G(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 I(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=V(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 B=_(1,"hours","milliseconds"),M=500,q=255,F=v(),N=[],J=new x;export{E 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/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as o,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as l,initial as r}from"../../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{ViewshedInteractionVisuals as c}from"./ViewshedInteractionVisuals.js";import{ViewshedObserverManipulatedObject3D as d}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedSnappingController as u}from"./ViewshedSnappingController.js";import{ViewshedSubTool as h}from"./ViewshedSubTool.js";import{findSubTool as b}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as v}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import g from"../../../interactive/sketch/SketchOptions.js";import{enterInputModeIfAvailable as m,makeTooltip as w}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as V}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";let y=class extends T{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.creating=!1,this.isPlacingTarget=!1,this._selectedManipulator=null,this._observerTooltipSketchOptions=new g({tooltips:{enabled:!0}}),this._observerTooltipConnectionHandle=null,this._observerTooltipObject=null}initialize(){const{view:e}=this;this._interactionVisuals=new c({view:e}),this._snappingController=new u({view:e}),this._initializeObserverTooltip(e);const t=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=i(()=>t,({viewshedComputedData:e})=>{const t=new h({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([n(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},l),n(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(null==e)return;const{subTool:t,observer:i,target:o}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(o,!1)},r),n(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),r),n(()=>this.selectedViewshed,e=>{const t=this._selectedManipulator,i=this._selectedSubTool;this._connectObserverTooltip(i),null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)},r)])}destroy(){this._selectManipulator(null),this._disconnectObserverTooltip(),o(this.subToolHandles),o(this._interactionVisuals),o(this._snappingController),o(this._observerTooltip)}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)||this._snappingController?.updating}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){const t=this._selectedSubTool,i=this.selectedViewshedComputedData;if(null==t||null==i)return void this._interactionVisuals?.setVisibility(!1);const o=t.moveInteractionState,s=e?o.grabbing:o.dragging,n=t.scaleOrientInteractionState,l=e?n.grabbing:n.dragging;if(!(this.analysisViewData.visible&&(s||l)))return void this._interactionVisuals?.setVisibility(!1);const r=s?i.elevationAlignedObserverRenderSpace:i.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:r,laserlineVisible:!0,verticalLineVisible:s,intersectsWorldUp:s})}createObserverMoveSnappingPipeline(e,t,i){return this._snappingController.createObserverMoveSnappingPipeline(e,t,i)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!m(e,this._observerTooltip))switch(e.type){case"key-down":this._onKeyDown(e);break;case"hold":this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_initializeObserverTooltip(e){const t=this._observerTooltipSketchOptions;this._observerTooltip=w(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new V({sketchOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),null==e)return void this._observerTooltip.clear();const t=new d({view:this.view,subTool:e});this._observerTooltipObject=t,this._observerTooltipConnectionHandle=v(this._observerTooltip,t,()=>({sketchOptions:this._observerTooltipSketchOptions,activeTooltipInfo:this._observerTooltipInfo,callbacks:{onBeforeUpdate:()=>this.updateInteractionVisualsVisibility(),onMoveStart:()=>{},onMove:()=>{},onMoveStop:()=>{},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}}}))}_disconnectObserverTooltip(){this._observerTooltipConnectionHandle=s(this._observerTooltipConnectionHandle),this._observerTooltipObject=o(this._observerTooltipObject)}_onKeyDown(e){_.cancel===e.key&&(this.grabbing||(this.selectedViewshed=null,e.stopPropagation()))}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return b(this.subToolHandles,e)}_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 test(){}};e([a({constructOnly:!0})],y.prototype,"analysis",void 0),e([a({constructOnly:!0})],y.prototype,"analysisViewData",void 0),e([a({constructOnly:!0})],y.prototype,"view",void 0),e([a()],y.prototype,"subToolHandles",void 0),e([a()],y.prototype,"removeIncompleteOnCancel",void 0),e([a()],y.prototype,"automaticManipulatorSelection",void 0),e([a()],y.prototype,"creating",void 0),e([a()],y.prototype,"isPlacingTarget",void 0),e([a()],y.prototype,"_selectedManipulator",void 0),e([a()],y.prototype,"_interactionVisuals",void 0),e([a()],y.prototype,"_snappingController",void 0),e([a()],y.prototype,"_observerTooltip",void 0),e([a()],y.prototype,"_observerTooltipInfo",void 0),e([a()],y.prototype,"updating",null),e([a()],y.prototype,"grabbing",null),e([a()],y.prototype,"cursor",null),e([a()],y.prototype,"selectedViewshed",null),e([a()],y.prototype,"selectedViewshedComputedData",null),e([a()],y.prototype,"_selectedSubTool",null),y=e([p("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],y);export{y as ViewshedEditTool};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../../../core/Evented.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as a}from"../../../../support/elevationInfoUtils.js";import{viewingModeFromString as m}from"../../../ViewingMode.js";import{EditGeometryOperations as p}from"../../../interactive/editGeometry/EditGeometryOperations.js";const d=Symbol("observerTooltipOperations");let l=class extends e{constructor(t){super(t),this._operations=null}initialize(){this.addHandles(i(()=>this.subTool.observer,t=>this._syncObserver(t),r))}destroy(){this.removeHandles(d),this._operations=o(this._operations)}get operations(){return this._operations}get elevationInfo(){return a}get visible(){return this.subTool.viewshedComputedData?.valid??!1}get isDraped(){return!1}get origin(){return this.subTool.observer}get updating(){return!1}toMap(t){return this.view.toMap(t)}_syncObserver(t){if(null==t)return this.removeHandles(d),this._operations=o(this._operations),void this.emit("committed");const e=this._operations?.data.geometry;if(e===t)return;if(this._operations?.trySetGeometry(t))return this.emit("modified-externally"),void this.emit("committed");this.removeHandles(d),this._operations=o(this._operations);const i=p.fromGeometry(t.clone(),m(this.view.viewingMode));this._operations=i,this.addHandles(i.data.on("change",()=>{const t=i.data.geometry;"point"===t.type&&(this.subTool.observer=t,this.emit("committed"))}),d),this.emit("committed")}};t([s({constructOnly:!0})],l.prototype,"view",void 0),t([s({constructOnly:!0})],l.prototype,"subTool",void 0),l=t([n("esri.views.3d.analysis.Viewshed.ViewshedObserverManipulatedObject3D")],l);export{l as ViewshedObserverManipulatedObject3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";function n(n,i){return i?n.find(i instanceof o?({subTool:o})=>o.hasManipulator(i):({subTool:o})=>o.viewshed===i)?.subTool
|
|
2
|
+
import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";function n(n,i){return i?n.find(i instanceof o?({subTool:o})=>o.hasManipulator(i):({subTool:o})=>o.viewshed===i)?.subTool:null}export{n as findSubTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import r from"../../../Graphic.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as l,throwIfAbortError as a}from"../../../core/promiseUtils.js";import{syncAndInitial as n,initial as o}from"../../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import p from"../../../core/sql/WhereClause.js";import{fallbackObjectIDAttribute as h}from"../../../layers/LayerConstants.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import y from"../../../layers/support/FeatureFilter.js";import{fixFields as c,unpackFieldNames as g,populateMissingFields as f}from"../../../layers/support/fieldUtils.js";import m from"../../../rest/support/Query.js";import{isNumber as F}from"../../../support/guards.js";import{BuildingSublayerView3DMixin as b}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as _}from"./I3SMeshView3D.js";import{applyFilterMode as w}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as E}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as x}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as S}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as j,I3SQueryFeature as v}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as I}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as Q,getIndexCrs as q}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as L}from"./support/DefinitionExpressionSceneLayerView.js";import{TemporalSceneLayerView as R}from"./support/TemporalSceneLayerView.js";import O from"../../layers/BuildingComponentSublayerView.js";import{hasPopupTemplate as V,getRequiredFields as U,getFetchPopupTemplate as C}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as A}from"../../support/layerViewUtils.js";import{TaskPriority as H}from"../../support/Scheduler.js";let D=class extends(R(L(_(b(O))))){constructor(e){super(e),this.type="building-component-sublayer-3d",this._elevationContext=2,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null,this.layer=e.sublayer}get layerViewUid(){return this.layerView.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){return this.sublayer.popupEnabled&&V(this.sublayer,this.layerView.view.popup?.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add(()=>this.mergedFilter,e=>{null!=e&&x.checkSupport(e)?null==this._i3sFilter?this._i3sFilter=new x({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,r)=>this.addSqlFilter(e,r,this.logError),addTimeFilter:(e,r)=>this.addTimeFilter(e,r)}):this._i3sFilter.viewFilter=e:this._i3sFilter=s(this._i3sFilter)},n),this._updatingHandles.add(()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields],()=>this._updateRequiredFields()),this._updatingHandles.add(()=>this.sublayer.renderer,e=>this._rendererChange(e),o);const e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this._i3sFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this._i3sFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>[this._i3sFilter?.parsedGeometry,this.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>this.parsedFilterExpressions,()=>this._updateSymbologyOverride(),o),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.objectLoDFactor}get parsedFilterExpressions(){return"Overview"===this.sublayer.modelName?[]:this.layerView.filterExpressions.map(([e,r])=>{let t;try{t=p.create(e,{fieldsIndex:this.sublayer.fieldsIndex})}catch(a){return i.getLogger(this).error("Failed to parse filterExpression: "+a),null}if(!t.isStandardized)return i.getLogger(this).error("filterExpression is using non standard function"),null;const s=[],l=t.fieldNames;return Q(l,this.sublayer.fieldsIndex,{missingFields:s}),s.length>0?(i.getLogger(this).error(`filterExpression references unknown fields: ${s.join(", ")}`),null):[t,r]}).filter(e=>null!=e)}get filter(){return this._get("filter")}set filter(e){this._set("filter",x.checkSupport(e)?e:null)}isUpdating(){return super.isUpdating()||(this._i3sFilter?.updating??!1)}_updateSymbologyOverride(){const e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride((r,t)=>{for(const[s,l]of e)try{if(s.testFeature(r))return w(t,l)}catch(i){this.logError(i)}return w(t,null)},this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return c(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce((e,[r])=>e.concat(r.fieldNames),new Array))}get availableFields(){const e=this.sublayer,r=e.fieldsIndex;let t=this.requiredFields;if(e.outFields||e.layer.outFields){const i=[...e.outFields||[],...e.layer.outFields||[]];t=[...g(r,i),...t]}return t=[...t,e.objectIdField??h],c(r,t)}get _graphicOrigin(){return this.sublayer.graphicOrigin}_createLayerGraphic(e){return new r({attributes:e,layer:this.sublayer.layer,sourceLayer:this.sublayer,origin:this._graphicOrigin})}canResume(){return super.canResume()&&A(this.sublayer.effectiveScaleRange,this.view.scale)&&(!this._controller||this._controller.rootNodeVisible)}async
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../../../Graphic.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as l,throwIfAbortError as a}from"../../../core/promiseUtils.js";import{syncAndInitial as n,initial as o}from"../../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import p from"../../../core/sql/WhereClause.js";import{fallbackObjectIDAttribute as h}from"../../../layers/LayerConstants.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import y from"../../../layers/support/FeatureFilter.js";import{fixFields as c,unpackFieldNames as g,populateMissingFields as f}from"../../../layers/support/fieldUtils.js";import m from"../../../rest/support/Query.js";import{isNumber as F}from"../../../support/guards.js";import{BuildingSublayerView3DMixin as b}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as _}from"./I3SMeshView3D.js";import{applyFilterMode as w}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as E}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as x}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as S}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as j,I3SQueryFeature as v}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as I}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as Q,getIndexCrs as q}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as L}from"./support/DefinitionExpressionSceneLayerView.js";import{TemporalSceneLayerView as R}from"./support/TemporalSceneLayerView.js";import O from"../../layers/BuildingComponentSublayerView.js";import{hasPopupTemplate as V,getRequiredFields as U,getFetchPopupTemplate as C}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as A}from"../../support/layerViewUtils.js";import{TaskPriority as H}from"../../support/Scheduler.js";let D=class extends(R(L(_(b(O))))){constructor(e){super(e),this.type="building-component-sublayer-3d",this._elevationContext=2,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null,this.layer=e.sublayer}get layerViewUid(){return this.layerView.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){return this.sublayer.popupEnabled&&V(this.sublayer,this.layerView.view.popup?.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add(()=>this.mergedFilter,e=>{null!=e&&x.checkSupport(e)?null==this._i3sFilter?this._i3sFilter=new x({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,r)=>this.addSqlFilter(e,r,this.logError),addTimeFilter:(e,r)=>this.addTimeFilter(e,r)}):this._i3sFilter.viewFilter=e:this._i3sFilter=s(this._i3sFilter)},n),this._updatingHandles.add(()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields],()=>this._updateRequiredFields()),this._updatingHandles.add(()=>this.sublayer.renderer,e=>this._rendererChange(e),o);const e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this._i3sFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this._i3sFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>[this._i3sFilter?.parsedGeometry,this.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>this.parsedFilterExpressions,()=>this._updateSymbologyOverride(),o),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.objectLoDFactor}get parsedFilterExpressions(){return"Overview"===this.sublayer.modelName?[]:this.layerView.filterExpressions.map(([e,r])=>{let t;try{t=p.create(e,{fieldsIndex:this.sublayer.fieldsIndex})}catch(a){return i.getLogger(this).error("Failed to parse filterExpression: "+a),null}if(!t.isStandardized)return i.getLogger(this).error("filterExpression is using non standard function"),null;const s=[],l=t.fieldNames;return Q(l,this.sublayer.fieldsIndex,{missingFields:s}),s.length>0?(i.getLogger(this).error(`filterExpression references unknown fields: ${s.join(", ")}`),null):[t,r]}).filter(e=>null!=e)}get filter(){return this._get("filter")}set filter(e){this._set("filter",x.checkSupport(e)?e:null)}isUpdating(){return super.isUpdating()||(this._i3sFilter?.updating??!1)}_updateSymbologyOverride(){const e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride((r,t)=>{for(const[s,l]of e)try{if(s.testFeature(r))return w(t,l)}catch(i){this.logError(i)}return w(t,null)},this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return c(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce((e,[r])=>e.concat(r.fieldNames),new Array))}get availableFields(){const e=this.sublayer,r=e.fieldsIndex;let t=this.requiredFields;if(e.outFields||e.layer.outFields){const i=[...e.outFields||[],...e.layer.outFields||[]];t=[...g(r,i),...t]}return t=[...t,e.objectIdField??h],c(r,t)}get _graphicOrigin(){return this.sublayer.graphicOrigin}_createLayerGraphic(e){return new r({attributes:e,layer:this.sublayer.layer,sourceLayer:this.sublayer,origin:this._graphicOrigin})}canResume(){return super.canResume()&&A(this.sublayer.effectiveScaleRange,this.view.scale)&&(!this._controller||this._controller.rootNodeVisible)}async patchFeaturesForPopup(e,r){const t=this._validateFetchPopupFeatures(r);if(t)throw t;if(0===e.length)return[];const s=[],n=[],o=null!=this.sublayer.associatedLayer?await this.sublayer.associatedLayer.load(r):this.sublayer,u=g(this.sublayer.fieldsIndex,await U(o,C(this.sublayer,r)));l(r);const d=new Set;for(const i of e)f(i,u,d)?n.push(i):s.push(i);return 0===n.length?s:(null!=this.sublayer.associatedLayer&&await this.sublayer.associatedLayer.load().catch(()=>i.getLogger(this).warn("Failed to load associated feature layer. Displaying popup attributes from cached attributes.")),this.whenGraphicAttributes(n,Array.from(d)).catch(e=>(a(e),n)).then(e=>s.concat(e)))}async _updateRequiredFields(){const e=c(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields,...this.filterExpressionFields]);this._set("requiredFields",e)}_validateFetchPopupFeatures(e){const{sublayer:r}=this,{popupEnabled:i}=r;return i?C(r,e)?void 0:new t("buildingscenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{sublayer:r}):new t("buildingscenelayerview3d:fetchPopupFeatures","Popups are disabled",{sublayer:r})}getFilters(){const e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this._i3sFilter?.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(e):new m(e)}queryExtent(e,r){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),r?.signal)}queryFeatureCount(e,r){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),r?.signal)}queryFeatures(e,r){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),r?.signal).then(e=>{if(!e?.features)return e;const r=this.sublayer,t=r.layer,i=this._graphicOrigin;for(const s of e.features)s.layer=t,s.sourceLayer=r,s.origin=i;return e})}async queryObjectIds(e,r){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),r?.signal)).filter(F)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){const e=E(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new S({layerView:this,priority:H.FEATURE_QUERY_ENGINE,spatialIndex:new I({featureAdapter:new j({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),forAllFeatures:(e,r)=>this._forAllFeatures((r,t,i)=>e(new v(r,t,i)),r,2),getFeatureExtent:e,sourceSpatialReference:q(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():m.from(e))}};e([u()],D.prototype,"layerView",void 0),e([u()],D.prototype,"lodFactor",null),e([u({readOnly:!0})],D.prototype,"parsedFilterExpressions",null),e([u({type:y})],D.prototype,"filter",null),e([u()],D.prototype,"_i3sFilter",void 0),e([u({type:[String],readOnly:!0})],D.prototype,"filterExpressionFields",null),e([u({type:[String],readOnly:!0})],D.prototype,"requiredFields",void 0),e([u({type:[String],readOnly:!0})],D.prototype,"availableFields",null),e([u()],D.prototype,"_graphicOrigin",null),D=e([d("esri.views.3d.layers.BuildingComponentSublayerView3D")],D);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 r from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import t from"../../../core/Error.js";import{handlesGroup as s}from"../../../core/handleUtils.js";import o from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{abortMaybe as l}from"../../../core/maybe.js";import{isAbortError as a,allSettledValues as u,throwIfAborted as p}from"../../../core/promiseUtils.js";import{watch as h,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as y,subclass as g}from"../../../core/accessorSupport/decorators.js";import{runUntracked as d}from"../../../core/accessorSupport/tracking.js";import{isBuildingGraphicOrigin as f}from"../../../graphic/isBuildingGraphicOrigin.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import{isGraphic as m}from"../../../support/graphicInstanceUtils.js";import w from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as b}from"./BuildingSublayerView3D.js";import{LayerView3D as V}from"./LayerView3D.js";import{parseFilterMode as j}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as S}from"./i3s/I3SUtil.js";import{normalizeHighlightTarget as _,emptyHighlightHandle as v}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as C}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as B}from"../support/updatingProperties.js";import M from"../../layers/BuildingSceneLayerView.js";import{isInEffectiveScaleRange as P}from"../../support/layerViewUtils.js";const E=b(r);let F=class extends(V(M)){constructor(e){super(e),this.type="building-scene-3d",this.sublayerViews=new i,this._rejectedSublayerViews=new Map,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get filterExpression(){const e=this.layer.activeFilterId,r=null!=e?this.layer.filters.find(r=>r.id===e):null,i=null!=r?r.filterBlocks?.find(e=>"solid"===e.filterMode.type):null;return i?i.filterExpression:null}get filterExpressions(){const e=this.layer.activeFilterId,r=null!=e?this.layer.filters.find(r=>r.id===e):null;return r?.filterBlocks?r.filterBlocks.toArray().map(e=>[e.filterExpression??"",j(e)]):[]}get updatingProgressValue(){return d(()=>{const e=this.sublayerViews,r=this._loadingComponents+(e?e.length:0);return e.reduce((e,r)=>e+r.updatingProgress,0)/r})}get visibleAtCurrentScale(){return P(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){S(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._initializeSublayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&(this.sublayerViews.forEach(e=>e.destroy()),this.sublayerViews=null),this._rejectedSublayerViews=null,this._abortController=l(this._abortController)}_initializeSublayerViews(e,r){const i=this,s=this.view;e.forEach(e=>{if(!e.isEmpty)if("building-group"===e.type){const i=new E({sublayer:e,view:s,parent:r});this._initializeSublayerViews(e.sublayers,i)}else"mesh"===e.geometryType?(this._loadingComponents++,e.load({signal:this._abortController.signal}).then(()=>{const t=new w({sublayer:e,layerView:i,view:s,parent:r});this.sublayerViews.push(t);const o=this._pendingWhenSublayerViews.get(e);if(o){for(const e of o)e.resolve(t);this._pendingWhenSublayerViews.delete(e)}this.addHandles([h(()=>t.updating,()=>this.notifyChange("updating"),c),h(()=>t.updatingProgress,()=>this.notifyChange("updatingProgressValue"),c)])}).catch(r=>{a(r)||o.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,r),this._rejectWhenSublayerView(e,r)}).then(()=>{this._loadingComponents--,this.notifyChange("updating"),this.notifyChange("updatingProgressValue")})):this._rejectWhenSublayerView(e,new t("view:no-layerview-for-sublayer",`No layerview created for sublayer ${e.id}`))})}getGraphicFromIntersectorTarget(e,r){for(const i of this.sublayerViews.items)if(i.sublayer.id===e.sublayerId)return i.getGraphicFromIntersectorTarget(e,r);return null}async
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import t from"../../../core/Error.js";import{handlesGroup as s}from"../../../core/handleUtils.js";import o from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{abortMaybe as l}from"../../../core/maybe.js";import{isAbortError as a,allSettledValues as u,throwIfAborted as p}from"../../../core/promiseUtils.js";import{watch as h,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as y,subclass as g}from"../../../core/accessorSupport/decorators.js";import{runUntracked as d}from"../../../core/accessorSupport/tracking.js";import{isBuildingGraphicOrigin as f}from"../../../graphic/isBuildingGraphicOrigin.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import{isGraphic as m}from"../../../support/graphicInstanceUtils.js";import w from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as b}from"./BuildingSublayerView3D.js";import{LayerView3D as V}from"./LayerView3D.js";import{parseFilterMode as j}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as S}from"./i3s/I3SUtil.js";import{normalizeHighlightTarget as _,emptyHighlightHandle as v}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as C}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as B}from"../support/updatingProperties.js";import M from"../../layers/BuildingSceneLayerView.js";import{isInEffectiveScaleRange as P}from"../../support/layerViewUtils.js";const E=b(r);let F=class extends(V(M)){constructor(e){super(e),this.type="building-scene-3d",this.sublayerViews=new i,this._rejectedSublayerViews=new Map,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get filterExpression(){const e=this.layer.activeFilterId,r=null!=e?this.layer.filters.find(r=>r.id===e):null,i=null!=r?r.filterBlocks?.find(e=>"solid"===e.filterMode.type):null;return i?i.filterExpression:null}get filterExpressions(){const e=this.layer.activeFilterId,r=null!=e?this.layer.filters.find(r=>r.id===e):null;return r?.filterBlocks?r.filterBlocks.toArray().map(e=>[e.filterExpression??"",j(e)]):[]}get updatingProgressValue(){return d(()=>{const e=this.sublayerViews,r=this._loadingComponents+(e?e.length:0);return e.reduce((e,r)=>e+r.updatingProgress,0)/r})}get visibleAtCurrentScale(){return P(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){S(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._initializeSublayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&(this.sublayerViews.forEach(e=>e.destroy()),this.sublayerViews=null),this._rejectedSublayerViews=null,this._abortController=l(this._abortController)}_initializeSublayerViews(e,r){const i=this,s=this.view;e.forEach(e=>{if(!e.isEmpty)if("building-group"===e.type){const i=new E({sublayer:e,view:s,parent:r});this._initializeSublayerViews(e.sublayers,i)}else"mesh"===e.geometryType?(this._loadingComponents++,e.load({signal:this._abortController.signal}).then(()=>{const t=new w({sublayer:e,layerView:i,view:s,parent:r});this.sublayerViews.push(t);const o=this._pendingWhenSublayerViews.get(e);if(o){for(const e of o)e.resolve(t);this._pendingWhenSublayerViews.delete(e)}this.addHandles([h(()=>t.updating,()=>this.notifyChange("updating"),c),h(()=>t.updatingProgress,()=>this.notifyChange("updatingProgressValue"),c)])}).catch(r=>{a(r)||o.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,r),this._rejectWhenSublayerView(e,r)}).then(()=>{this._loadingComponents--,this.notifyChange("updating"),this.notifyChange("updatingProgressValue")})):this._rejectWhenSublayerView(e,new t("view:no-layerview-for-sublayer",`No layerview created for sublayer ${e.id}`))})}getGraphicFromIntersectorTarget(e,r){for(const i of this.sublayerViews.items)if(i.sublayer.id===e.sublayerId)return i.getGraphicFromIntersectorTarget(e,r);return null}async patchFeaturesForPopup(e,r){if(0===e.length)return[];const i=I(e,e=>f(e.origin)?e.origin.sublayer:e.sourceLayer),t=[];for(const[o,n]of i){const e=this._findComponent(o);null!=e&&t.push(e.patchFeaturesForPopup(n,r))}const s=await u(t);return p(r),s.flat()}whenGraphicBounds(e){const r=this._findComponent(f(e.origin)?e.origin.sublayer:e.sourceLayer);return null==r?Promise.reject():r.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(const r of this.sublayerViews.items)if(r.sublayer.id===e.sublayerId)return r.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){const r=this._findComponent(e);if(null!=r)return r;const i=this._rejectedSublayerViews.get(e);if(null!=i)throw i;const t=this._pendingWhenSublayerViews.get(e),s=Promise.withResolvers();return t?t.push(s):this._pendingWhenSublayerViews.set(e,[s]),s.promise}_rejectWhenSublayerView(e,r){this._rejectedSublayerViews.set(e,r);const i=this._pendingWhenSublayerViews.get(e);if(i){for(const e of i)e.reject(r);this._pendingWhenSublayerViews.delete(e)}}_findComponent(e){return this.sublayerViews.find(r=>e===r.sublayer)}highlight(e,r){const i=_(e);if(0===i.length)return v;if(m(i[0])){const e=i,t=new Map;for(const r of e)n(t,f(r.origin)?r.origin.sublayer:r.sourceLayer,()=>[]).push(r);const o=[];return this.sublayerViews.forEach(e=>{const i=t.get(e.sublayer);i&&o.push(e.highlight(i,r))}),s(o)}return v}get usedMemory(){return this.sublayerViews.reduce((e,r)=>e+r.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((e,r)=>e+r.unloadedMemory,0)}get performanceInfo(){return new C(this.usedMemory)}};function I(e,r){const i=new Map,t=e.length;for(let s=0;s<t;s++){const t=e[s],o=r(t,s,e),n=i.get(o);n?n.push(t):i.set(o,[t])}return i}e([y()],F.prototype,"sublayerViews",void 0),e([y()],F.prototype,"_rejectedSublayerViews",void 0),e([y({readOnly:!0})],F.prototype,"filterExpression",null),e([y({readOnly:!0})],F.prototype,"filterExpressions",null),e([y(B)],F.prototype,"updatingProgress",void 0),e([y({readOnly:!0})],F.prototype,"updatingProgressValue",null),e([y({readOnly:!0})],F.prototype,"visibleAtCurrentScale",null),F=e([g("esri.views.3d.layers.BuildingSceneLayerView3D")],F);const L=F;export{L 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"../../../core/has.js";import t from"../../../core/Logger.js";import{removeMaybe as i}from"../../../core/maybe.js";import{watch as s,initial as r}from"../../../core/reactiveUtils.js";import{unitFromRESTJSON as a,convertUnit as n}from"../../../core/units.js";import{property as l,subclass as o}from"../../../core/accessorSupport/decorators.js";import{fromValues as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import u from"../../../geometry/HeightModelInfo.js";import{create as c}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as m}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as p,isWebMercator as f,equals as g,isGeographic as y}from"../../../geometry/support/spatialReferenceUtils.js";import _ from"../../../geometry/support/WKIDUnitConversion.js";import{getHeightModelInfoFromVCS as w}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as v}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as S}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as b}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as C}from"./LayerView3D.js";import{addLayerViewToWasm as M,getLyr3DWasm as x,removeLayerViewFromWasm as I}from"./Lyr3DWasm.js";import{LayerElevationProvider as T}from"./i3s/LayerElevationProvider.js";import{ElevationRange as H}from"../support/ElevationRange.js";import{projectToBoundingBox as A}from"../support/extentUtils.js";import{Obb as R}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as P,packedGaussianSizeInU32 as j,splatPageSizeInU32WithoutHeader as F,gaussiansPerSplatPage as O,elementsPerSplatPage as G,splatAtlasTextureWidth as U}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatDataStore as E}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as V}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as L}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTile as B}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatRenderNode as z}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import{GaussianSplatShadowRenderNode as k}from"../webgl-engine/lib/GaussianSplatShadowRenderNode.js";import N from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as q,isInEffectiveScaleRange as D}from"../../support/layerViewUtils.js";import{TaskPriority as W}from"../../support/Scheduler.js";var $;const X=()=>t.getLogger("esri.views.3d.layers.GaussianSplatLayerView3D"),Z=3,J=Z*Z,K=255,Y=(()=>{const e=new Int16Array(K+1);e[0]=-255;for(let t=1;t<e.length;t++)e[t]=Math.round(16*Math.log(t/K));return e})();let Q=class extends(C(N)){static{$=this}static{this.createRenderableBatchSize=64}constructor(e){super(e),this.type="gaussian-splat-3d",this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(P),this._tmpTilesWithChangedVisibility=new Array,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Map,this._tileFadeOutsAwaitingInitialSort=new Map,this._tmpSortedTileHandles=new Set,this._createRenderableAbortController=new AbortController,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(W.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;const e=c();return A(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderNode?.clippingBox??null}initialize(){if(!this._canProjectWithoutEngine())throw q("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=M(this).then(e=>{this._wasmLayerId=e,this._renderNode=new z({view:this.view,layerView:this}),this.data=new E(this._renderNode,(e,t)=>this._onSortComplete(e,t)),this._shadowRenderNode=new k({view:this.view,layerView:this}),this.fadeHelper=new V(this),this._intersectionHandler=new L(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._elevationProvider=new T({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this.view.elevationProvider.register(2,this._elevationProvider),this.addHandles([s(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),s(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),r)]),this._suspendedHandle=s(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),r),this.addHandles([s(()=>this._clippingBox,e=>this._renderNode.clippingBox=e,r)]),this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians)});this.addHandles([s(()=>this.view.qualitySettings.fadeDuration,e=>{this.fadeHelper.onFadeDurationChanged(e),this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}),s(()=>this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians,e=>this.setMaximumGaussianCount(e*this.view.quality)),s(()=>this.view.quality,e=>this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*e))]),this.addResolvingPromise(e)}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}get _wasm(){return x(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return v(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new H(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return D(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const i=t.desc.prims[0],s=i.vertexCount;if(0===s)return{memUsageBytes:0,numGaussians:0};const r=i.atrbs[0].view,a=i.atrbs[0].view.byteCount,n=i.atrbs[0].view.byteOffset;let l=null;if("U32"!==r.type)return X().warnOnce("unexpected meshData.data format"),{memUsageBytes:0,numGaussians:0};l=new Uint32Array(t.data.buffer,n,a/4);const o=this.extractHeader(l),u=2.048,c=o.tileOrigin.x*u,m=o.tileOrigin.y*u,p=o.tileOrigin.z*u;let f=null;if(t.desc.obb){const e=t.desc.obb.quaternion;f=new R(t.desc.obb.center,t.desc.obb.halfSize,h(...e))}f||(X().warnOnce("encountered tile without a bounding box"),f=new R);const g=this.view.state.isGlobal,y=g?d(this.view.spatialReference).radius:0,_={handle:e.handle,bufferView:l,totalGaussians:s,packedHeader:o.packedHeader,tileOrigin:{x:c,y:m,z:p},invPosScale:o.invPosScale,obb:f,origin:{x:f.centerX,y:f.centerY,z:f.centerZ},isGlobal:g,ellipsoidRadius:y};return this._frameTask.scheduleGenerator(e=>this._createRenderableTask(_,e),this._createRenderableAbortController.signal)}*_createRenderableTask(e,t){const{handle:i,bufferView:s,totalGaussians:r,packedHeader:a,tileOrigin:n,invPosScale:l,obb:o,origin:h,isGlobal:d,ellipsoidRadius:u}=e,c=n.x,m=n.y,p=n.z,f=h.x,g=h.y,y=h.z,_=new Uint32Array(r),w=new Float32Array(3*r),v=new Uint32Array(r),S=new Uint32Array(r),b=new Array,C=Math.ceil(r/O);for(let H=0;H<C;H++){let e=this.data.textureAtlas.requestPage();if(null===e&&(this._freeInvisibleTiles(),e=this.data.textureAtlas.requestPage()),null===e)return X().warnOnce("ran out of gaussian splat memory"),{memUsageBytes:0,numGaussians:0};b.push(e);const i=r-H*O,n=Math.min(i,O),l=H*O,o=G*e;for(let t=0;t<n;t++)_[l+t]=o+t;const h=H*F;this._pageBuffer.set(s.subarray(h,h+n*j)),this._pageBuffer.set(a,F);const d=e*G,u=d%U,c=Math.floor(d/U);this.data.textureAtlas.update(u,c,this._pageBuffer),t.madeProgress()&&(t=yield)}let M=1/0,x=-1/0,I=1/0,T=-1/0,A=0,R=-1,P=0;for(let H=0;H<r;H++){const e=H*j,i=s[e],r=s[e+1],a=s[e+2],n=s[e+3],o=16383&r,h=r>>>14&16383,u=r>>>28&15|(1023&a)<<4,_=Y[n>>>24],b=(a>>>10&255)+_,C=(a>>>18&255)+_,F=(a>>>26&63|(3&n)<<6)+_,O=b>0?b:0,G=C>0?C:0,U=F>0?F:0,E=O|G<<8|U<<16,V=Math.max(O,G,U),L=o*l+c,B=h*l+m,z=u*l+p;if(w[A]=L-f,w[A+1]=B-g,w[A+2]=z-y,d){const e=L*L+B*B+z*z;I=Math.min(I,e),T=Math.max(T,e)}else M=Math.min(M,z),x=Math.max(x,z);v[H]=i,S[H]=E,V>R&&(R=V),A+=3,P++,P===$.createRenderableBatchSize&&(P=0,t.madeProgress()&&(t=yield))}P>0&&t.madeProgress(),d&&(M=Math.sqrt(I)-u,x=Math.sqrt(T)-u);const E=this._extractGaussianSplatMbsRadiusSquared(R),{fullExtent:V}=this.layer;V?.hasZ&&V.zmax&&V.zmin&&(M=Math.max(M,V.zmin),x=Math.min(x,V.zmax));const L=new H(M,x),z=new B(i,o,_,b,w,v,S,r,E,L);return this._memCache.put(`${z.handle}`,z),this._tileHandles.set(i,z),this._cacheTileMemory+=z.usedMemory,{memUsageBytes:z.usedMemory,numGaussians:r}}_extractGaussianSplatMbsRadiusSquared(e){return Math.exp(e/8-20)*J}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._tileFadeOutsAwaitingInitialSort.delete(e);let t=!1;const i=this._tileHandles.get(e);if(i){0!==i.lifecycleState?(t=!0,this.fadeHelper.onTileDiscarded(i),this._usedTileMemory-=i.usedMemory,this._intersectionHandler.removeTile(i)):this._cacheTileMemory-=i.usedMemory,i.pageIds.forEach(e=>this.data.textureAtlas.freePage(e)),this.freeObject(i),this._tileHandles.delete(e)}t&&this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(t=>{for(const i of e)t(i.obb)})}setRenderableVisibility(e,t,i){const s=this._currentLyr3dVisibilityChange+1;let r=!1;for(let a=0;a<i;a++){const i=this._tileHandles.get(e[a]);if(!i)continue;const n=t[a]?this._prepareTileFadeIn(i,s):this._prepareTileFadeOut(i,s);r||=n}r&&(this._currentLyr3dVisibilityChange=s,this.updateGaussians())}_prepareTileFadeIn(e,t){const i=this._tileFadeOutsAwaitingInitialSort.delete(e.handle);return 2===e.lifecycleState?(this.fadeHelper.fadeTile(e,0),!1):this._tileFadeInsAwaitingInitialSort.get(e.handle)!==t?(0===e.lifecycleState&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.set(e.handle,t),!0):i}_prepareTileFadeOut(e,t){const i=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return i&&1===e.lifecycleState&&(this.moveTileToCache(e),e.lifecycleState=0),2!==e.lifecycleState?i:this._tileFadeOutsAwaitingInitialSort.get(e.handle)!==t?(this._tileFadeOutsAwaitingInitialSort.set(e.handle,t),!0):i}_onSortComplete(e,t){const i=this._tmpTilesWithChangedVisibility;i.length=0;const s=this._tmpSortedTileHandles;s.clear();for(let a=0;a<e.length;a++){const t=e[a];s.add(t.handle)}this._triggerFadeIns(t,s,i);const r=this._triggerFadeOuts(t,i);s.clear(),i.length>0&&this.notifyTileObbsChanged(i),r&&this.updateGaussians()}_triggerFadeIns(e,t,i){for(const[s,r]of this._tileFadeInsAwaitingInitialSort){if(r>e||!t.has(s))continue;const a=this._tileHandles.get(s);if(!a){this._tileFadeInsAwaitingInitialSort.delete(s);continue}const n=0===a.lifecycleState;2!==a.lifecycleState&&(a.lifecycleState=2,n&&this._popTileFromCache(a),i.push(a)),this.fadeHelper.fadeTile(a,0),this._tileFadeInsAwaitingInitialSort.delete(s)}}_triggerFadeOuts(e,t){let i=!1;for(const[s,r]of this._tileFadeOutsAwaitingInitialSort){if(r>e)continue;const a=this._tileHandles.get(s);if(a){const e=2===a.lifecycleState;this.fadeHelper.fadeTile(a,1),e&&0===a.lifecycleState&&(t.push(a),i=!0)}this._tileFadeOutsAwaitingInitialSort.delete(s)}return i}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(`${e.handle}`)}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(`${e.handle}`,e)}destroy(){this._createRenderableAbortController.abort(),I(this),this._suspendedHandle&&(this._suspendedHandle=i(this._suspendedHandle)),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(e=>{for(const t of this._tileHandles.values())e(t.obb)}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._shadowRenderNode.destroy(),this._renderNode.destroy(),this.data.destroy(),this._memCache.destroy()}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(p(this.view.renderSpatialReference)||f(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&g(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=w(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!y(t)&&t.wkid&&-1!==t.wkid&&(i=a(_.units[_[t.wkid]])),i&&(e=new u({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===m(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=n(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(e?.offset)if(this._useEsriCrs){const t=S(e?.unit)/this._metersPerVCSUnit,i=e?.offset??0;this._wasm?.setLayerOffset(this,i*t)}else this._wasm?.setLayerOffset(this,v(e));else this._wasm?.setLayerOffset(this,0)}_slicePlaneEnabledChanged(e){this._renderNode&&(this._renderNode.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateGaussians(){const e=new Array;for(const t of this._tileHandles.values())0!==t.lifecycleState&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange("updating")}setMaximumGaussianCount(e){this._wasm?.setMaximumGaussianSplatCount(e)}_freeInvisibleTiles(){for(const e of this._tileHandles.values())0===e.lifecycleState&&this._deleteTile(e)}extractHeader(e){const t=e.length-4,i=this.reinterpretU32AsFloat(e[t]),s=this.reinterpretU32AsFloat(e[t+1]),r=this.reinterpretU32AsFloat(e[t+2]),a=1/(1<<(255&e[t+3]));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:i,y:s,z:r},invPosScale:a}}_deleteTile(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(i=>{0===i.lifecycleState?t++:e++});const i=this.data?.textureAtlasMemory??0,s=this.data?.orderTextureMemory??0,r=this.data?.fadingTextureMemory??0,a=this.data?.sortBufferMemory??0;return new b(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,i,s,r,a)}get test(){}};e([l()],Q.prototype,"layer",void 0),e([l({readOnly:!0})],Q.prototype,"_clippingBox",null),e([l()],Q.prototype,"elevationOffset",null),e([l({readOnly:!0})],Q.prototype,"visibleAtCurrentScale",null),e([l()],Q.prototype,"fullExtentInLocalViewSpatialReference",void 0),Q=$=e([o("esri.views.3d.layers.GaussianSplatLayerView3D")],Q);const ee=Q;export{ee as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{removeMaybe as i}from"../../../core/maybe.js";import{watch as s,initial as r}from"../../../core/reactiveUtils.js";import{unitFromRESTJSON as a,convertUnit as n}from"../../../core/units.js";import{property as l,subclass as o}from"../../../core/accessorSupport/decorators.js";import{fromValues as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import u from"../../../geometry/HeightModelInfo.js";import{create as c}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as m}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as p,isWebMercator as f,equals as g,isGeographic as y}from"../../../geometry/support/spatialReferenceUtils.js";import _ from"../../../geometry/support/WKIDUnitConversion.js";import{getHeightModelInfoFromVCS as w}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as v}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as S}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as b}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as C}from"./LayerView3D.js";import{addLayerViewToWasm as M,getLyr3DWasm as x,removeLayerViewFromWasm as I}from"./Lyr3DWasm.js";import{LayerElevationProvider as T}from"./i3s/LayerElevationProvider.js";import{ElevationRange as H}from"../support/ElevationRange.js";import{projectToBoundingBox as A}from"../support/extentUtils.js";import{Obb as R}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as P,packedGaussianSizeInU32 as j,splatPageSizeInU32WithoutHeader as F,gaussiansPerSplatPage as O,elementsPerSplatPage as G,splatAtlasTextureWidth as U}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatDataStore as E}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as V}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as L}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTile as B}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatRenderNode as z}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import{GaussianSplatShadowRenderNode as k}from"../webgl-engine/lib/GaussianSplatShadowRenderNode.js";import N from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as q,isInEffectiveScaleRange as D}from"../../support/layerViewUtils.js";import{TaskPriority as W}from"../../support/Scheduler.js";var $;const X=()=>t.getLogger("esri.views.3d.layers.GaussianSplatLayerView3D"),Z=3,J=Z*Z,K=255,Y=(()=>{const e=new Int16Array(K+1);e[0]=-255;for(let t=1;t<e.length;t++)e[t]=Math.round(16*Math.log(t/K));return e})();let Q=class extends(C(N)){static{$=this}static{this.createRenderableBatchSize=64}constructor(e){super(e),this.type="gaussian-splat-3d",this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(P),this._tmpTilesWithChangedVisibility=new Array,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Map,this._tileFadeOutsAwaitingInitialSort=new Map,this._tmpSortedTileHandles=new Set,this._createRenderableAbortController=new AbortController,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(W.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;const e=c();return A(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderNode?.clippingBox??null}initialize(){if(!this._canProjectWithoutEngine())throw q("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=M(this).then(e=>{this._wasmLayerId=e,this._renderNode=new z({view:this.view,layerView:this}),this.data=new E(this._renderNode,(e,t)=>this._onSortComplete(e,t)),this._shadowRenderNode=new k({view:this.view,layerView:this}),this.fadeHelper=new V(this),this._intersectionHandler=new L(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._elevationProvider=new T({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this.view.elevationProvider.register(2,this._elevationProvider),this.addHandles([s(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),s(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),r)]),this._suspendedHandle=s(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),r),this.addHandles([s(()=>this._clippingBox,e=>this._renderNode.clippingBox=e,r)]),this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians)});this.addHandles([s(()=>this.view.qualitySettings.fadeDuration,e=>{this.fadeHelper.onFadeDurationChanged(e),this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}),s(()=>this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians,e=>this.setMaximumGaussianCount(e*this.view.quality)),s(()=>this.view.quality,e=>this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*e))]),this.addResolvingPromise(e)}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}get _wasm(){return x(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return v(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new H(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return D(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const i=t.desc.prims[0],s=i.vertexCount;if(0===s)return()=>({memUsageBytes:0,numGaussians:0});const r=i.atrbs[0].view,a=i.atrbs[0].view.byteCount,n=i.atrbs[0].view.byteOffset;let l=null;if("U32"!==r.type)return X().warnOnce("unexpected meshData.data format"),()=>({memUsageBytes:0,numGaussians:0});l=new Uint32Array(t.data.buffer,n,a/4);const o=this.extractHeader(l),u=2.048,c=o.tileOrigin.x*u,m=o.tileOrigin.y*u,p=o.tileOrigin.z*u;let f=null;if(t.desc.obb){const e=t.desc.obb.quaternion;f=new R(t.desc.obb.center,t.desc.obb.halfSize,h(...e))}f||(X().warnOnce("encountered tile without a bounding box"),f=new R);const g=this.view.state.isGlobal,y=g?d(this.view.spatialReference).radius:0,_={handle:e.handle,bufferView:l,totalGaussians:s,packedHeader:o.packedHeader,tileOrigin:{x:c,y:m,z:p},invPosScale:o.invPosScale,obb:f,origin:{x:f.centerX,y:f.centerY,z:f.centerZ},isGlobal:g,ellipsoidRadius:y},w=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(_,e),this._createRenderableAbortController.signal);return()=>w}*_createRenderableTask(e,t){const{handle:i,bufferView:s,totalGaussians:r,packedHeader:a,tileOrigin:n,invPosScale:l,obb:o,origin:h,isGlobal:d,ellipsoidRadius:u}=e,c=n.x,m=n.y,p=n.z,f=h.x,g=h.y,y=h.z,_=new Uint32Array(r),w=new Float32Array(3*r),v=new Uint32Array(r),S=new Uint32Array(r),b=new Array,C=Math.ceil(r/O);for(let H=0;H<C;H++){let e=this.data.textureAtlas.requestPage();if(null===e&&(this._freeInvisibleTiles(),e=this.data.textureAtlas.requestPage()),null===e)return X().warnOnce("ran out of gaussian splat memory"),{memUsageBytes:0,numGaussians:0};b.push(e);const i=r-H*O,n=Math.min(i,O),l=H*O,o=G*e;for(let t=0;t<n;t++)_[l+t]=o+t;const h=H*F;this._pageBuffer.set(s.subarray(h,h+n*j)),this._pageBuffer.set(a,F);const d=e*G,u=d%U,c=Math.floor(d/U);this.data.textureAtlas.update(u,c,this._pageBuffer),t.madeProgress()&&(t=yield)}let M=1/0,x=-1/0,I=1/0,T=-1/0,A=0,R=-1,P=0;for(let H=0;H<r;H++){const e=H*j,i=s[e],r=s[e+1],a=s[e+2],n=s[e+3],o=16383&r,h=r>>>14&16383,u=r>>>28&15|(1023&a)<<4,_=Y[n>>>24],b=(a>>>10&255)+_,C=(a>>>18&255)+_,F=(a>>>26&63|(3&n)<<6)+_,O=b>0?b:0,G=C>0?C:0,U=F>0?F:0,E=O|G<<8|U<<16,V=Math.max(O,G,U),L=o*l+c,B=h*l+m,z=u*l+p;if(w[A]=L-f,w[A+1]=B-g,w[A+2]=z-y,d){const e=L*L+B*B+z*z;I=Math.min(I,e),T=Math.max(T,e)}else M=Math.min(M,z),x=Math.max(x,z);v[H]=i,S[H]=E,V>R&&(R=V),A+=3,P++,P===$.createRenderableBatchSize&&(P=0,t.madeProgress()&&(t=yield))}P>0&&t.madeProgress(),d&&(M=Math.sqrt(I)-u,x=Math.sqrt(T)-u);const E=this._extractGaussianSplatMbsRadiusSquared(R),{fullExtent:V}=this.layer;V?.hasZ&&V.zmax&&V.zmin&&(M=Math.max(M,V.zmin),x=Math.min(x,V.zmax));const L=new H(M,x),z=new B(i,o,_,b,w,v,S,r,E,L);return this._memCache.put(`${z.handle}`,z),this._tileHandles.set(i,z),this._cacheTileMemory+=z.usedMemory,{memUsageBytes:z.usedMemory,numGaussians:r}}_extractGaussianSplatMbsRadiusSquared(e){return Math.exp(e/8-20)*J}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._tileFadeOutsAwaitingInitialSort.delete(e);let t=!1;const i=this._tileHandles.get(e);if(i){0!==i.lifecycleState?(t=!0,this.fadeHelper.onTileDiscarded(i),this._usedTileMemory-=i.usedMemory,this._intersectionHandler.removeTile(i)):this._cacheTileMemory-=i.usedMemory,i.pageIds.forEach(e=>this.data.textureAtlas.freePage(e)),this.freeObject(i),this._tileHandles.delete(e)}t&&this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(t=>{for(const i of e)t(i.obb)})}setRenderableVisibility(e,t,i){const s=this._currentLyr3dVisibilityChange+1;let r=!1;for(let a=0;a<i;a++){const i=this._tileHandles.get(e[a]);if(!i)continue;const n=t[a]?this._prepareTileFadeIn(i,s):this._prepareTileFadeOut(i,s);r||=n}r&&(this._currentLyr3dVisibilityChange=s,this.updateGaussians())}_prepareTileFadeIn(e,t){const i=this._tileFadeOutsAwaitingInitialSort.delete(e.handle);return 2===e.lifecycleState?(this.fadeHelper.fadeTile(e,0),!1):this._tileFadeInsAwaitingInitialSort.get(e.handle)!==t?(0===e.lifecycleState&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.set(e.handle,t),!0):i}_prepareTileFadeOut(e,t){const i=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return i&&1===e.lifecycleState&&(this.moveTileToCache(e),e.lifecycleState=0),2!==e.lifecycleState?i:this._tileFadeOutsAwaitingInitialSort.get(e.handle)!==t?(this._tileFadeOutsAwaitingInitialSort.set(e.handle,t),!0):i}_onSortComplete(e,t){const i=this._tmpTilesWithChangedVisibility;i.length=0;const s=this._tmpSortedTileHandles;s.clear();for(let a=0;a<e.length;a++){const t=e[a];s.add(t.handle)}this._triggerFadeIns(t,s,i);const r=this._triggerFadeOuts(t,i);s.clear(),i.length>0&&this.notifyTileObbsChanged(i),r&&this.updateGaussians()}_triggerFadeIns(e,t,i){for(const[s,r]of this._tileFadeInsAwaitingInitialSort){if(r>e||!t.has(s))continue;const a=this._tileHandles.get(s);if(!a){this._tileFadeInsAwaitingInitialSort.delete(s);continue}const n=0===a.lifecycleState;2!==a.lifecycleState&&(a.lifecycleState=2,n&&this._popTileFromCache(a),i.push(a)),this.fadeHelper.fadeTile(a,0),this._tileFadeInsAwaitingInitialSort.delete(s)}}_triggerFadeOuts(e,t){let i=!1;for(const[s,r]of this._tileFadeOutsAwaitingInitialSort){if(r>e)continue;const a=this._tileHandles.get(s);if(a){const e=2===a.lifecycleState;this.fadeHelper.fadeTile(a,1),e&&0===a.lifecycleState&&(t.push(a),i=!0)}this._tileFadeOutsAwaitingInitialSort.delete(s)}return i}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(`${e.handle}`)}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(`${e.handle}`,e)}destroy(){this._createRenderableAbortController.abort(),I(this),this._suspendedHandle&&(this._suspendedHandle=i(this._suspendedHandle)),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(e=>{for(const t of this._tileHandles.values())e(t.obb)}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._shadowRenderNode.destroy(),this._renderNode.destroy(),this.data.destroy(),this._memCache.destroy()}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(p(this.view.renderSpatialReference)||f(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&g(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=w(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!y(t)&&t.wkid&&-1!==t.wkid&&(i=a(_.units[_[t.wkid]])),i&&(e=new u({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===m(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=n(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(e?.offset)if(this._useEsriCrs){const t=S(e?.unit)/this._metersPerVCSUnit,i=e?.offset??0;this._wasm?.setLayerOffset(this,i*t)}else this._wasm?.setLayerOffset(this,v(e));else this._wasm?.setLayerOffset(this,0)}_slicePlaneEnabledChanged(e){this._renderNode&&(this._renderNode.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateGaussians(){const e=new Array;for(const t of this._tileHandles.values())0!==t.lifecycleState&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange("updating")}setMaximumGaussianCount(e){this._wasm?.setMaximumGaussianSplatCount(e)}_freeInvisibleTiles(){for(const e of this._tileHandles.values())0===e.lifecycleState&&this._deleteTile(e)}extractHeader(e){const t=e.length-4,i=this.reinterpretU32AsFloat(e[t]),s=this.reinterpretU32AsFloat(e[t+1]),r=this.reinterpretU32AsFloat(e[t+2]),a=1/(1<<(255&e[t+3]));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:i,y:s,z:r},invPosScale:a}}_deleteTile(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(i=>{0===i.lifecycleState?t++:e++});const i=this.data?.textureAtlasMemory??0,s=this.data?.orderTextureMemory??0,r=this.data?.fadingTextureMemory??0,a=this.data?.sortBufferMemory??0;return new b(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,i,s,r,a)}get test(){}};e([l()],Q.prototype,"layer",void 0),e([l({readOnly:!0})],Q.prototype,"_clippingBox",null),e([l()],Q.prototype,"elevationOffset",null),e([l({readOnly:!0})],Q.prototype,"visibleAtCurrentScale",null),e([l()],Q.prototype,"fullExtentInLocalViewSpatialReference",void 0),Q=$=e([o("esri.views.3d.layers.GaussianSplatLayerView3D")],Q);const ee=Q;export{ee as default};
|