@arcgis/core 4.34.0-next.98 → 4.34.0
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/ElevationProfile/ElevationProfileLineInput.js +1 -1
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
- package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00c77f03dd511c6dbff2.js +1 -0
- package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → 0461ac6ddd44f8da2eec.js} +1 -1
- package/assets/esri/core/workers/chunks/0f735b0dec173142f3b6.js +2 -0
- package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{f5d89b48f62fba78fd10.js → 151defe707bceb3a56a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 1847e8ac559085949f6d.js} +1 -1
- package/assets/esri/core/workers/chunks/1ae3d331da5baa8e4b6a.js +1 -0
- package/assets/esri/core/workers/chunks/1d807057327ba90ab770.js +1 -0
- package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
- package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c72e185b780bbbb1c9f.js → 21f1e12d4e703b59c31c.js} +1 -1
- package/assets/esri/core/workers/chunks/2248c3040e2f9a8b5cbc.js +1 -0
- package/assets/esri/core/workers/chunks/292403693cba4562a02d.js +1 -0
- package/assets/esri/core/workers/chunks/297b11752f9c251cd7be.js +1 -0
- package/assets/esri/core/workers/chunks/2d834d33b73a55a98ba8.js +1 -0
- package/assets/esri/core/workers/chunks/2dce02d199a9625abbd9.js +1 -0
- package/assets/esri/core/workers/chunks/37897186bfbfa1319ff5.js +1 -0
- package/assets/esri/core/workers/chunks/378bed624605fe8f62b1.js +1 -0
- package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
- package/assets/esri/core/workers/chunks/4470a3fff217f2bfeec5.js +1 -0
- package/assets/esri/core/workers/chunks/44e40484acb577039c82.js +1 -0
- package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 458e87902abc24b375da.js} +1 -1
- package/assets/esri/core/workers/chunks/4a38b1402cd48ced5d0f.js +1 -0
- package/assets/esri/core/workers/chunks/4b7c99f9a716a929178d.js +1 -0
- package/assets/esri/core/workers/chunks/524293f92791c55f6e2c.js +1 -0
- package/assets/esri/core/workers/chunks/594761a526629f9aa165.js +1 -0
- package/assets/esri/core/workers/chunks/5e60542f80bdacb6e7af.js +1 -0
- package/assets/esri/core/workers/chunks/616e3d1947eda575a25a.js +1 -0
- package/assets/esri/core/workers/chunks/{86b978a48b539e9fc5b8.js → 618ccc5d922f40fb6597.js} +1 -1
- package/assets/esri/core/workers/chunks/6c96997ca5ea1affa7af.js +1 -0
- package/assets/esri/core/workers/chunks/6d5f36fdd6ff081f30e8.js +1 -0
- package/assets/esri/core/workers/chunks/7010d1eb303a13c72f81.js +1 -0
- package/assets/esri/core/workers/chunks/740e6d2831dcb01ee96a.js +1 -0
- package/assets/esri/core/workers/chunks/75535e2e487ed2616acf.js +1 -0
- package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
- package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{40b81d1c2d53cf598b8e.js → 7786fc1b3779df832e0a.js} +1 -1
- package/assets/esri/core/workers/chunks/7a5c276652e7edf42e73.js +1 -0
- package/assets/esri/core/workers/chunks/{c941d15190fc08523d0d.js → 7a9a0fcf78a1863c5dea.js} +1 -1
- package/assets/esri/core/workers/chunks/80d2182dac1a49cfd923.js +1 -0
- package/assets/esri/core/workers/chunks/81501abaabf10e9bef1b.js +1 -0
- package/assets/esri/core/workers/chunks/{e032f3d2ee19790f8c79.js → 881df4fd1dc594576457.js} +1 -1
- package/assets/esri/core/workers/chunks/8862e6ceabc990ca0031.js +1 -0
- package/assets/esri/core/workers/chunks/8cf2669900bb45cb094a.js +1 -0
- package/assets/esri/core/workers/chunks/8ec6ad6d76b4755a4cf6.js +1 -0
- package/assets/esri/core/workers/chunks/9786e854ae9f40975cee.js +1 -0
- package/assets/esri/core/workers/chunks/98739414c107ad78e4d8.js +1 -0
- package/assets/esri/core/workers/chunks/98ccd88bdb9cb96a7610.js +1 -0
- package/assets/esri/core/workers/chunks/9dc6eeaac94aff385cf9.js +1 -0
- package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
- package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
- package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/af0f82f7efa6e983eca5.js +1 -0
- package/assets/esri/core/workers/chunks/b113d4f6a014863aaf66.js +1 -0
- package/assets/esri/core/workers/chunks/{773d76253588bcf14eaa.js → bd02e9d6c7ba491dd35f.js} +1 -1
- package/assets/esri/core/workers/chunks/be1b8e5ff2b1be26845a.js +1 -0
- package/assets/esri/core/workers/chunks/{142c45ad68eecaf3fc7c.js → bf9b2949894cc2a1e6b3.js} +1 -1
- package/assets/esri/core/workers/chunks/c91ce5fcdd4d0a6514d3.js +1 -0
- package/assets/esri/core/workers/chunks/{ad3e18c4c65aa2cd1ceb.js → cd3b843ffd4010038c74.js} +1 -1
- package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/d0767001601412f17ada.js +1 -0
- package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → d391bfbaf0e790cd10d6.js} +2 -2
- package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d5fa879de92da4441771.js +1 -0
- package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/d9aee7ee4ab75b446ef1.js +1 -0
- package/assets/esri/core/workers/chunks/{9027f22a04ac2076ff0e.js → dd37db3f2d1072e250d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{dfc37c2ce51e6a34fd87.js → dec0ed841f9ff1ceff43.js} +1 -1
- package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
- package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
- package/assets/esri/core/workers/chunks/e97bffa614ad89105f38.js +1 -0
- package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
- package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
- package/assets/esri/core/workers/chunks/f06d185e7defc4272ae7.js +1 -0
- package/assets/esri/core/workers/chunks/f18fdfcb3d5d7851e6fc.js +1 -0
- package/assets/esri/core/workers/chunks/f2f3ce7a0f3e394d27c4.js +1 -0
- package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → f619ab4a3ff3036641a9.js} +1 -1
- package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
- package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fa6e59e72c6e1fa79cf8.js} +1 -1
- package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
- package/assets/esri/core/workers/chunks/{4a2bf3c8da24abd8b9e2.js → fd410a56286f9b8a5903.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
- package/assets/esri/themes/base/widgets/_Editor.scss +36 -2
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -1
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -0
- package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
- package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
- package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ar.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bg.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bs.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ca.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_cs.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_da.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_de.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_el.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_es.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_et.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fi.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fr.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_he.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hr.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hu.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_id.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_it.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ja.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ko.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lt.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lv.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_nl.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_no.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pl.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-BR.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-PT.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ro.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ru.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sk.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sl.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sr.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sv.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_th.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_tr.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_uk.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_vi.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-CN.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-HK.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-TW.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_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/GlowComposition.glsl.js +46 -46
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OITBlend.glsl.js +3 -3
- package/chunks/Point2D.js +1 -1
- package/chunks/ShadedColorMaterial.glsl.js +10 -10
- package/chunks/UnitFactory.js +1 -1
- package/chunks/bundle.js +1 -1
- package/config.js +1 -1
- package/copyright.txt +0 -60
- package/core/has.js +1 -1
- package/core/sanitizerUtils.js +1 -1
- package/core/workers/utils.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/editing/fieldUtils.js +5 -0
- package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
- package/editing/templateUtils.js +1 -1
- package/form/FormTemplate.js +1 -1
- package/form/elements/Element.js +1 -1
- package/form/elements/FieldElement.js +1 -1
- package/form/elements/GroupElement.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/graphic/graphicOriginUtils.js +1 -1
- package/interfaces.d.ts +2069 -253
- package/intl/date.js +1 -1
- package/intl.d.ts +2 -0
- package/intl.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/SceneService.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/support/NumberFieldFormat.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/fieldConfigUtils.js +1 -1
- package/layers/support/fieldFormatUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/layers/support/rasterFieldUtils.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/networks/CircuitManager.d.ts +4 -0
- package/networks/UnitIdentifierManager.d.ts +4 -0
- package/networks/support/Circuit.d.ts +4 -0
- package/networks/support/CircuitLocation.d.ts +4 -0
- package/networks/support/CircuitPath.d.ts +4 -0
- package/networks/support/CircuitPathConnectivityElement.d.ts +4 -0
- package/networks/support/CircuitSection.d.ts +4 -0
- package/networks/support/Subcircuit.d.ts +4 -0
- package/package.json +5 -5
- package/popup/FieldInfo.js +1 -1
- package/portal/Portal.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/rest/knowledgeGraphService.d.ts +1 -0
- package/rest/networks/circuits/support/CircuitTraceResult.d.ts +4 -0
- package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +4 -0
- package/rest/networks/support/TelecomNetworkElement.d.ts +4 -0
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +4 -0
- package/rest/print.js +1 -1
- package/rest/versionManagement/getVersionInfos.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/support/basemapDefinitions.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/popupUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/undoredo/support/ServiceVersionInfo.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
- package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/schema/ExceedsLimitCache.js +5 -0
- package/views/2d/layers/features/schema/SourceSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/sources/strategies/constants.js +5 -0
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/FlowWorker.js +1 -1
- package/views/3d/support/flow/FlowWorkerHandle.js +1 -1
- package/views/3d/support/flow/StreamlineResources3D.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/support/flow/constants.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/flow/loadUtils.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +10 -4
- package/views/SceneView.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
- package/views/analysis/ElevationProfile/types.d.ts +5 -0
- package/views/analysis/ElevationProfile/types.js +5 -0
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/support/PromiseQueue.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/Attachments/AttachmentsViewModel.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Directions/css.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
- package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
- package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
- package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflowData.js +1 -1
- package/widgets/Editor/VisibleElements.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/MergeFeaturesList.js +5 -0
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/PanelContent.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
- package/widgets/Editor/css.js +1 -1
- package/widgets/Editor/support/EditorItem.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/support/errors.js +5 -0
- package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
- package/widgets/Editor/support/splitFeatureUtils.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/InputBase.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
- package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
- package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
- package/widgets/Print.js +1 -1
- package/widgets/Search/LayerSearchSource.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/VisibleElements.js +1 -1
- package/widgets/support/SelectionList/selectionListUtils.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/widgets/support/jsxWidgetSupport.js +1 -1
- package/assets/esri/core/workers/chunks/02bc183e30e3392bb76d.js +0 -1
- package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
- package/assets/esri/core/workers/chunks/14ace5dc4b8984212a57.js +0 -1
- package/assets/esri/core/workers/chunks/1762ff76350065750c75.js +0 -1
- package/assets/esri/core/workers/chunks/1b85967d1178956ee36b.js +0 -1
- package/assets/esri/core/workers/chunks/1fd459234917a51b6ae1.js +0 -1
- package/assets/esri/core/workers/chunks/22bb877b85ae250d7819.js +0 -1
- package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
- package/assets/esri/core/workers/chunks/24b97ba933324aea6a07.js +0 -1
- package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +0 -1
- package/assets/esri/core/workers/chunks/2795a2817ebe3298c350.js +0 -1
- package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
- package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
- package/assets/esri/core/workers/chunks/37d05d9796917c3d4b7a.js +0 -1
- package/assets/esri/core/workers/chunks/3b65d6a78fbffca37fbd.js +0 -1
- package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
- package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
- package/assets/esri/core/workers/chunks/48646f3d95a3f2b17e78.js +0 -1
- package/assets/esri/core/workers/chunks/50a5caa96c111dda5c60.js +0 -1
- package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
- package/assets/esri/core/workers/chunks/5a527a47285a5995cff9.js +0 -1
- package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
- package/assets/esri/core/workers/chunks/5cb92abb1f0f38bd0eab.js +0 -1
- package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
- package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
- package/assets/esri/core/workers/chunks/630efe10c871425b6a95.js +0 -1
- package/assets/esri/core/workers/chunks/65111858957f43eacd8c.js +0 -1
- package/assets/esri/core/workers/chunks/6f4bd0ee85e7e5a74340.js +0 -1
- package/assets/esri/core/workers/chunks/701a1835684cf815bcb7.js +0 -1
- package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
- package/assets/esri/core/workers/chunks/7633537dc0c65d655baf.js +0 -1
- package/assets/esri/core/workers/chunks/78b35a19332e58c8c279.js +0 -1
- package/assets/esri/core/workers/chunks/7fa324900c147ba51019.js +0 -1
- package/assets/esri/core/workers/chunks/83ab8c8bc9e6990114a8.js +0 -1
- package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
- package/assets/esri/core/workers/chunks/a19063456ce21b471b69.js +0 -1
- package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
- package/assets/esri/core/workers/chunks/ae8c387d59be87457567.js +0 -1
- package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
- package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
- package/assets/esri/core/workers/chunks/b54202dcab8df080e991.js +0 -1
- package/assets/esri/core/workers/chunks/ba212ba895ccf573eedf.js +0 -1
- package/assets/esri/core/workers/chunks/bcff6178e9d16b1b6191.js +0 -1
- package/assets/esri/core/workers/chunks/cf13625a033f9903655f.js +0 -1
- package/assets/esri/core/workers/chunks/deb2854bb7d082a26f52.js +0 -1
- package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
- package/assets/esri/core/workers/chunks/eb1a7bb8b14e651bc241.js +0 -1
- package/assets/esri/core/workers/chunks/f09242e97196ad177c10.js +0 -1
- package/assets/esri/core/workers/chunks/f154336b4af011cd0c56.js +0 -1
- package/assets/esri/core/workers/chunks/f1be3a177328a169128f.js +0 -1
- package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
- package/assets/esri/core/workers/chunks/f7a9d2da07196a0989ae.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../request.js";import r from"../../../../core/Accessor.js";import{splitIntoChunks as s}from"../../../../core/arrayUtils.js";import{createTask as i,resultOrAbort as o,result as n}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as d}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import c from"../../../../core/Logger.js";import{abortMaybe as h,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateStringMemory as u,estimateNumberMemory as m}from"../../../../core/memoryEstimations.js";import{whenOrAbort as p,createResolver as g}from"../../../../core/promiseUtils.js";import y from"../../../../core/ReactiveSet.js";import{watch as f,sync as _}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as O}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as j}from"../../../../intl/number.js";import{getMaximumQuerySize as C,queryAllJSON as w}from"../../../../layers/support/featureQueryAll.js";import{isTimeoutError as I}from"../../../../support/requestUtils.js";let F=class extends r{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=E,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new y,this._geometryChangedObjectIds=new y,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new x(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(f(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,this._pendingFetchChangedObjectIds||(this._applyGeometryOverridesTask=h(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=i(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise)},_)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})}destroy(){this._set("layer",null),this._memCache=l(this._memCache),this._pendingFetchAbortController=h(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return!!this.is3DOFL&&!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished)}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=this._interactiveEditingSessions,r=new A(e,()=>{t.remove(r)});return t.unshift(r),r}async applyAttributeOverrides(e,t,r,s=[]){if(this._pendingFetchChangedObjectIds&&await p(this._pendingFetchChangedObjectIds,r),null==t)return;const{attributeData:i,loadedAttributes:o}=t;if(null==o||null==i||0===this._attributeChangedObjectIds.size)return;const n=new Set;for(const d of o)n.add(d.index);for(const d of s)n.has(d.index)||(o.push(d),i[d.name]=new Array(e.length));const a=await this._lockFeatureIds(e);try{const t={attributeData:i,loadedAttributes:o},s=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds),{objectIds:n,fieldNames:a}=s;if(0===n.length||0===a.length)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(n,a,r);if(null==d)return;this._processOverridesFromAssociatedLayer(e,d,a,t)}finally{a.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const r=this._clientGeometryCache.get(e);if(null!=r&&(this.geometryOverrides.remove(r),this._clientGeometryCache.delete(e)),null!=t){const r={oid:e,mesh:t};this.geometryOverrides.add(r),this._clientGeometryCache.set(e,r)}}updateAttributeValue(e,t,r){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,r)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,r){this._memCache.put(e,t,r)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:r},s){const i=new Array;for(const a of t)i[a.index]=r[a.name];const o=new Set,n=new Set;for(let a=0;a<e.length;a++){const r=e[a];if(s.has(r))for(const e of t){const t=this._attributeFromCache(r,e.index);void 0===t?(o.add(r),n.add(e.name)):i[e.index][a]=t}}return{objectIds:Array.from(o),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const r=this._fromInteractiveEditingSession(e,t);return void 0!==r?r:this._memCache.get(e,t)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const r of this._interactiveEditingSessions){if(r.objectId!==e)continue;const s=r.getAttribute(t);if(void 0!==s)return s}}async _queryAttributeOverridesFromAssociatedLayer(e,t,r){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:s}=this.layer;if(null==s)return null;const i=s.createQuery(),{objectIdField:o}=s,n=[o,...t];i.where=this.layer.definitionExpression||"1=1",i.returnGeometry=!1,i.outFields=n,i.cacheHint=!0;const a=await this._executeBatchQuery(s,e,i,r),d=[];for(const c of a)if(c.ok)for(const e of c.value.features)d.push(e);return d}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL)return null;const r=this.layer.associatedLayer,s=r.infoFor3D,{spatialReference:i}=r,{state:{viewingMode:o},spatialReference:n}=this.view,a=1===o,d=i.isGeographic;if(a&&!d)return c.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,S(i,n,this.view.viewingMode,0)),null;if(!a&&d)return c.getLogger(this).warn("unsupported-gcs-edits-in-local-view",this.layer.title,S(i,n,this.view.viewingMode,0)),null;if(!(O(i,n)||a&&n.isWebMercator&&i.isWGS84))return c.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,S(i,n,this.view.viewingMode,1)),null;this._logWarningIfMaximumObjectsExceeded();const{objectIdField:h,globalIdField:l}=r,u=[h,...null!=l?[l]:[]],m=r.createQuery();m.where=this.layer.definitionExpression||"1=1",m.returnGeometry=!0,m.outFields=u,m.cacheHint=!0,m.returnZ=r.hasZ,m.returnM=r.hasM;const{assetMapFromAssetMapsJSON:p,extractMesh:g}=await import("../../../../rest/support/meshFeatureSet.js"),y=await this._executeBatchQuery(r,e,m,t),f=[];for(const c of y){if(!c.ok)continue;const e=c.value,{assetMaps:t,features:r,globalIdFieldName:o}=e;if(null==t)continue;const n=p(s,t);for(const a of r){const e=g(a,o,i,s,n),t=a;null!=e?(t.geometry=e,f.push(t)):t.geometry=null}}return f}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${j(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;e+=t?.loaded?` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:` (${this.layer.parsedUrl.path})`,c.getLogger(this).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,i){if(0===t.length)return[];const n=C(e);t=[...t].sort((e,t)=>e-t);const a=s(t,n).map(t=>{const s=r.clone();return s.objectIds=t,o(w(e,s,{signal:i}))});return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,r,{loadedAttributes:s,attributeData:i}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=r.map(t=>(t in i||(i[t]=new Array(e.length)),i[t])),d=new Map(s.map(e=>[e.name,e.index])),c=r.map(e=>d.get(e)),h=new Map(Array.from(e,(e,t)=>[e,t]));for(const l of t){const e=l.attributes[n];for(let t=0;t<r.length;t++){const s=c[t],i=h.get(e),o=l.attributes[r[t]];a[t][i]=o,this._cacheAttributeValue(e,s,o)}}}async _fetchChangedObjectIds(e){const r=this.layer;await r.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:s}=r;if(null==s||!s.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const o=s.layerId,a=this.is3DOFL,d={...s.customParameters,f:"json",returnIdsOnly:!0,layers:`[${o}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:o,serverGen:i}])};if(null!=s.apiKey&&(d.token=s.apiKey),a){const e=s.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await n(t(`${s.url}/extractChanges`,{method:"post",query:d,timeout:L,signal:e}));if(!h.ok&&I(h.error)){const e=this.layer.title;c.getLogger(this).warn("extractChanges:timeout",e,`${e} could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.`)}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],r=t?.objectIds,s=t?.fieldUpdates,i=r?.adds??[],o=r?.updates??[],n=r?.deletes??[],d=[...i,...o,...n],c=a?[...i,...s??o,...n]:[],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort((e,t)=>e-t);for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of c)this._geometryChangedObjectIds.add(e);for(;this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;const t=this.layer,{associatedLayer:r}=t;if(null!=r&&r.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp?.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t?.serverGens?.minServerGen?t.serverGens.minServerGen:null}async _lockFeatureIds(e){const t=this._featureIdLocks;let r=!0;for(;r;){const s=new Array;for(const r of e){const e=t.get(r);e&&s.push(e)}0===s.length?r=!1:await Promise.all(s)}const s=g(),i=s.promise;for(const o of e)t.set(o,i);return d(()=>{for(const r of e)t.delete(r);s.resolve()})}get test(){}};e([b({constructOnly:!0})],F.prototype,"view",void 0),e([b({constructOnly:!0})],F.prototype,"layer",void 0),e([b({readOnly:!0})],F.prototype,"is3DOFL",null),e([b()],F.prototype,"_interactiveEditingSessions",void 0),e([b({readOnly:!0})],F.prototype,"sortedGeometryChangedObjectIds",null),e([b({readOnly:!0})],F.prototype,"geometryOverrides",void 0),e([b()],F.prototype,"_clientGeometryCache",void 0),e([b()],F.prototype,"_associatedLayer",null),e([b({constructOnly:!0})],F.prototype,"memoryController",void 0),e([b()],F.prototype,"_attributeChangedObjectIds",void 0),e([b()],F.prototype,"_geometryChangedObjectIds",void 0),e([b()],F.prototype,"hasGeometryChanges",null),e([b()],F.prototype,"_pendingFetchChangedObjectIds",void 0),e([b()],F.prototype,"_pendingFetchAbortController",void 0),e([b()],F.prototype,"_applyGeometryOverridesTask",void 0),e([b()],F.prototype,"updating",null),e([b()],F.prototype,"isEmpty",null),F=e([v("esri.views.3d.layers.i3s.I3SOverrides")],F);class A{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class x{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,r){this._cache.put(this._getKey(e,t),new G(r))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class G{constructor(e){this.value=e,this.usedMemory="string"==typeof e?u(e):m}}const L=1e4,E=5e4;function S(e,t,r,s){return`Displaying the edits of a SceneLayer with a${0===s?e.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${e.wkid}) in ${r} viewing mode${1===s?` with spatial reference (wkid:${t.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${0===s?"viewing mode":"view spatial reference"} to display edits.`}export{F as I3SOverrides};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../request.js";import r from"../../../../core/Accessor.js";import{splitIntoChunks as s}from"../../../../core/arrayUtils.js";import{createTask as i,resultOrAbort as o,result as n}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as d}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import c from"../../../../core/Logger.js";import{abortMaybe as h,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateStringMemory as u,estimateNumberMemory as m}from"../../../../core/memoryEstimations.js";import{whenOrAbort as p,createResolver as g}from"../../../../core/promiseUtils.js";import y from"../../../../core/ReactiveSet.js";import{watch as f,sync as _}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as O}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as j}from"../../../../intl/number.js";import{getMaximumQuerySize as C,queryAllJSON as w}from"../../../../layers/support/featureQueryAll.js";let I=class extends r{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=L,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new y,this._geometryChangedObjectIds=new y,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new A(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(f(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,this._pendingFetchChangedObjectIds||(this._applyGeometryOverridesTask=h(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=i(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise)},_)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})}destroy(){this._set("layer",null),this._memCache=l(this._memCache),this._pendingFetchAbortController=h(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return!!this.is3DOFL&&!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished)}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=this._interactiveEditingSessions,r=new F(e,()=>{t.remove(r)});return t.unshift(r),r}async applyAttributeOverrides(e,t,r,s=[]){if(this._pendingFetchChangedObjectIds&&await p(this._pendingFetchChangedObjectIds,r),null==t)return;const{attributeData:i,loadedAttributes:o}=t;if(null==o||null==i||0===this._attributeChangedObjectIds.size)return;const n=new Set;for(const d of o)n.add(d.index);for(const d of s)n.has(d.index)||(o.push(d),i[d.name]=new Array(e.length));const a=await this._lockFeatureIds(e);try{const t={attributeData:i,loadedAttributes:o},s=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds),{objectIds:n,fieldNames:a}=s;if(0===n.length||0===a.length)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(n,a,r);if(null==d)return;this._processOverridesFromAssociatedLayer(e,d,a,t)}finally{a.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const r=this._clientGeometryCache.get(e);if(null!=r&&(this.geometryOverrides.remove(r),this._clientGeometryCache.delete(e)),null!=t){const r={oid:e,mesh:t};this.geometryOverrides.add(r),this._clientGeometryCache.set(e,r)}}updateAttributeValue(e,t,r){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,r)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,r){this._memCache.put(e,t,r)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:r},s){const i=new Array;for(const a of t)i[a.index]=r[a.name];const o=new Set,n=new Set;for(let a=0;a<e.length;a++){const r=e[a];if(s.has(r))for(const e of t){const t=this._attributeFromCache(r,e.index);void 0===t?(o.add(r),n.add(e.name)):i[e.index][a]=t}}return{objectIds:Array.from(o),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const r=this._fromInteractiveEditingSession(e,t);return void 0!==r?r:this._memCache.get(e,t)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const r of this._interactiveEditingSessions){if(r.objectId!==e)continue;const s=r.getAttribute(t);if(void 0!==s)return s}}async _queryAttributeOverridesFromAssociatedLayer(e,t,r){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:s}=this.layer;if(null==s)return null;const i=s.createQuery(),{objectIdField:o}=s,n=[o,...t];i.where=this.layer.definitionExpression||"1=1",i.returnGeometry=!1,i.outFields=n,i.cacheHint=!0;const a=await this._executeBatchQuery(s,e,i,r),d=[];for(const c of a)if(c.ok)for(const e of c.value.features)d.push(e);return d}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL)return null;const r=this.layer.associatedLayer,s=r.infoFor3D,{spatialReference:i}=r,{state:{viewingMode:o},spatialReference:n}=this.view,a=1===o,d=i.isGeographic;if(a&&!d)return c.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,E(i,n,this.view.viewingMode,0)),null;if(!a&&d)return c.getLogger(this).warn("unsupported-gcs-edits-in-local-view",this.layer.title,E(i,n,this.view.viewingMode,0)),null;if(!(O(i,n)||a&&n.isWebMercator&&i.isWGS84))return c.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,E(i,n,this.view.viewingMode,1)),null;this._logWarningIfMaximumObjectsExceeded();const{objectIdField:h,globalIdField:l}=r,u=[h,...null!=l?[l]:[]],m=r.createQuery();m.where=this.layer.definitionExpression||"1=1",m.returnGeometry=!0,m.outFields=u,m.cacheHint=!0,m.returnZ=r.hasZ,m.returnM=r.hasM;const{assetMapFromAssetMapsJSON:p,extractMesh:g}=await import("../../../../rest/support/meshFeatureSet.js"),y=await this._executeBatchQuery(r,e,m,t),f=[];for(const c of y){if(!c.ok)continue;const e=c.value,{assetMaps:t,features:r,globalIdFieldName:o}=e;if(null==t)continue;const n=p(s,t);for(const a of r){const e=g(a,o,i,s,n),t=a;null!=e?(t.geometry=e,f.push(t)):t.geometry=null}}return f}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${j(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;e+=t?.loaded?` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:` (${this.layer.parsedUrl.path})`,c.getLogger(this).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,i){if(0===t.length)return[];const n=C(e);t=[...t].sort((e,t)=>e-t);const a=s(t,n).map(t=>{const s=r.clone();return s.objectIds=t,o(w(e,s,{signal:i}))});return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,r,{loadedAttributes:s,attributeData:i}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=r.map(t=>(t in i||(i[t]=new Array(e.length)),i[t])),d=new Map(s.map(e=>[e.name,e.index])),c=r.map(e=>d.get(e)),h=new Map(Array.from(e,(e,t)=>[e,t]));for(const l of t){const e=l.attributes[n];for(let t=0;t<r.length;t++){const s=c[t],i=h.get(e),o=l.attributes[r[t]];a[t][i]=o,this._cacheAttributeValue(e,s,o)}}}async _fetchChangedObjectIds(e){const r=this.layer;await r.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:s}=r;if(null==s||!s.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const o=s.layerId,a=this.is3DOFL,d={...s.customParameters,f:"json",returnIdsOnly:!0,layers:`[${o}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:o,serverGen:i}])};if(null!=s.apiKey&&(d.token=s.apiKey),a){const e=s.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await n(t(`${s.url}/extractChanges`,{method:"post",query:d,timeout:G,signal:e}));if(!h.ok){const e=this.layer.title;c.getLogger(this).warn("extractChanges:timeout",e,": could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.")}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],r=t?.objectIds,s=t?.fieldUpdates,i=r?.adds??[],o=r?.updates??[],n=r?.deletes??[],d=[...i,...o,...n],c=a?[...i,...s??o,...n]:[],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort((e,t)=>e-t);for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of c)this._geometryChangedObjectIds.add(e);for(;this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;const t=this.layer,{associatedLayer:r}=t;if(null!=r&&r.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp?.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t?.serverGens?.minServerGen?t.serverGens.minServerGen:null}async _lockFeatureIds(e){const t=this._featureIdLocks;let r=!0;for(;r;){const s=new Array;for(const r of e){const e=t.get(r);e&&s.push(e)}0===s.length?r=!1:await Promise.all(s)}const s=g(),i=s.promise;for(const o of e)t.set(o,i);return d(()=>{for(const r of e)t.delete(r);s.resolve()})}get test(){}};e([b({constructOnly:!0})],I.prototype,"view",void 0),e([b({constructOnly:!0})],I.prototype,"layer",void 0),e([b({readOnly:!0})],I.prototype,"is3DOFL",null),e([b()],I.prototype,"_interactiveEditingSessions",void 0),e([b({readOnly:!0})],I.prototype,"sortedGeometryChangedObjectIds",null),e([b({readOnly:!0})],I.prototype,"geometryOverrides",void 0),e([b()],I.prototype,"_clientGeometryCache",void 0),e([b()],I.prototype,"_associatedLayer",null),e([b({constructOnly:!0})],I.prototype,"memoryController",void 0),e([b()],I.prototype,"_attributeChangedObjectIds",void 0),e([b()],I.prototype,"_geometryChangedObjectIds",void 0),e([b()],I.prototype,"hasGeometryChanges",null),e([b()],I.prototype,"_pendingFetchChangedObjectIds",void 0),e([b()],I.prototype,"_pendingFetchAbortController",void 0),e([b()],I.prototype,"_applyGeometryOverridesTask",void 0),e([b()],I.prototype,"updating",null),e([b()],I.prototype,"isEmpty",null),I=e([v("esri.views.3d.layers.i3s.I3SOverrides")],I);class F{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class A{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,r){this._cache.put(this._getKey(e,t),new x(r))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class x{constructor(e){this.value=e,this.usedMemory="string"==typeof e?u(e):m}}const G=1e4,L=5e4;function E(e,t,r,s){return`Displaying the edits of a SceneLayer with a${0===s?e.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${e.wkid}) in ${r} viewing mode${1===s?` with spatial reference (wkid:${t.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${0===s?"viewing mode":"view spatial reference"} to display edits.`}export{I as I3SOverrides};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{shuffle as t}from"../../../../core/arrayUtils.js";import{baseObjectMemory as e}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{diameter as i,create as r}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as a,create as u,intersects as h,copy as n,positiveInfinity as
|
|
5
|
+
import{shuffle as t}from"../../../../core/arrayUtils.js";import{baseObjectMemory as e}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{diameter as i,create as r}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as a,create as u,intersects as h,copy as n,positiveInfinity as l,intersection as m}from"../../../../geometry/support/aaBoundingRect.js";import{numVertices as f,estimateSize as o,getObjectId as d,computeAABB as c}from"../../../../layers/graphics/dehydratedFeatures.js";import{computeMaxZ as _}from"../graphics/graphicUtils.js";import{SampledGeometryMaxDistanceRatio as g}from"./SampledGeometryMaxDistanceRatio.js";const F=16438;class p{constructor(t){this.descriptor=t,this._numVertices=0,this.exceededTransferLimit=s(!1),this._fetchFailed=s(!1),this._sorted=!1,this._numFeatures=s(y),this._emptyFeatureRatio=s(0),this._estimatedSize=-1,this._estimatedUnusedSize=0,this._estimatedUnusedSizeDirty=!1,this._sampledDensityEstimate=-1,this._displayingFeatures=null,this.alive=!0,this.filtered=!1,this._features=null,this._featuresLength=s(0),this._featureLimit=s(0),this._fetchStatus=0,this.fetchInformation=s(""),this.fetchingResolution=this.displayingResolution=t.resolution}get featuresMissing(){return this.fetchFailed||(this.hasPreciseFeatureCount?this._featuresLength.value<this.numFeatures:this.exceededTransferLimit.value)}get showsAllFeatures(){return!this.fetchFailed&&null!=this.displayingFeatures&&(this.hasPreciseFeatureCount?this.displayingFeatures.length===this.numFeatures:!this.exceededTransferLimit.value)}get missingAttributes(){return this._missingAttributes}get fetchFailed(){return this._fetchFailed.value}set fetchFailed(t){this._fetchFailed.value=t}get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(t){this._displayingFeatures=t,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){const t=this.isFetched&&this.featuresMissing;return!this.filtered&&(t||this.hasFeatureLimit)}get features(){return this._features}get featureLimit(){return this._featureLimit.value}set featureLimit(t){this._featureLimit.value!==t&&(this._featureLimit.value=t,this._estimatedUnusedSizeDirty=!0)}get hasFeatureLimit(){return this.featureLimit!==this._featuresLength.value}get availableFields(){return this._availableFields}setFeatures(t,e,s,i){this._availableFields=s,this._features=t,this._featuresLength.value=t?.length??0,this._sorted=!1,this._estimatedSize=-1,this._estimatedUnusedSizeDirty=!0,this._sampledDensityEstimate=-1,this._missingAttributes=i,t&&t.length>0?(this._emptyFeatureRatio.value=e/(t.length+e),this._numVertices=t.reduce((t,e)=>t+f(e.geometry),0)):(this._emptyFeatureRatio.value=0,this._numVertices=0)}computeZQuantizationFactor(){if(this._features&&this._features.length>0){const t=this._features.reduce((t,{geometry:e})=>Math.max(t,_(e)??0),0);return Math.floor(t/this.descriptor.planetRadius)+1}return 1}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures.value:this._features?this._featuresLength.value:0}set numFeatures(t){this._numFeatures.value=t}get hasPreciseFeatureCount(){return this._numFeatures.value>y}get needsFeatureCount(){return this._numFeatures.value===y}get numVertices(){return this._numVertices}get id(){return this.descriptor.id}get estimatedSize(){return this.updateEstimates(),this._estimatedSize}get sampledDensityEstimate(){return this._sampledDensityEstimate}get estimatedUnusedSize(){return this._estimatedUnusedSize}updateEstimates(){if(this._estimatedSize<0||this._sampledDensityEstimate<0){this._estimatedSize=0,this._estimatedUnusedSize=0,this._sampledDensityEstimate=0;const t=Math.floor(Math.sqrt(z));if(this._features){let e=null;const s=new g(z,R*this.fetchingResolution),i=this._features.length;for(let r=0;r<i;++r){const a=this._features[r],u=o(a);if(this._estimatedSize+=u,r>=this.featureLimit&&(this._estimatedUnusedSize+=u),!s.done){const u=i-r;if(r%Math.ceil(u/Math.max(1,Math.floor(Math.sqrt(s.numRemainingSamples))))===0){const i=Math.max(Math.floor(s.numRemainingSamples/u),t);s.sampleGeometry(a.geometry,e,i)}}e=a.geometry}s.numSamples>=x?this._sampledDensityEstimate=s.ratio:this._sampledDensityEstimate=0}return!0}if(this._estimatedUnusedSizeDirty){if(this._estimatedUnusedSize=0,this._estimatedUnusedSizeDirty=!1,this._features)for(let t=this.featureLimit;t<this._features.length;++t)this._estimatedUnusedSize+=o(this._features[t]);return!0}return!1}get fetchStatus(){return this._fetchStatus}requestFetch(){this._fetchStatus=0}requestRefetch(){this._fetchStatus=1}startFetch(){this._fetchStatus=this.needsRefetch?3:2}fetchDone(t){this._fetchStatus=t}get isFetching(){return 2===this._fetchStatus||3===this._fetchStatus}get isRefetching(){return 3===this._fetchStatus}get needsFetch(){return 0===this._fetchStatus||1===this._fetchStatus}get needsRefetch(){return 1===this._fetchStatus}get isFetched(){return 4===this._fetchStatus||5===this._fetchStatus}isFullyFetched(t){return!!this.features&&(this.features.length>=t||5===this.fetchStatus)}resetFetching(){this._fetchStatus=this.isRefetching?1:0}get needsDisplayUpdate(){return!!this._features&&!L(this._features,this.displayingFeatures,this.featureLimit)}intersects(t){return null==t||!this.descriptor.extent||(a(t,D),h(this.descriptor.extent,D))}intersectionIncludingBorrowed(t,e){const s=null!=this.extentIncludingBorrowedFeatures?this.extentIncludingBorrowedFeatures:this.descriptor.extent;return t||s?(null!=t?(a(t,e),m(e,s,e)):n(e,s),e):(n(e,l),e)}_shuffle(e){this._features?.sort((t,s)=>d(t,e)-d(s,e)),t(this._features,F)}_sortBySize(t){this._features?.sort((e,s)=>i(c(s.geometry,M))-i(c(e.geometry,M))||d(e,t)-d(s,t))}reduceFeatures(t,e,s,i){if(t<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let r=!1;this.featureLimit=Math.ceil(this.numFeatures*t),this.featureLimit>this._features.length&&4===this._fetchStatus&&this._features.length>0&&(this._fetchStatus=1,r=!0),!this._sorted&&t<1&&(1===i?this._shuffle(s):this._sortBySize(s),this._sorted=!0,this._estimatedUnusedSizeDirty=!0);const a=Math.max(this.featureLimit,Math.ceil(e*this.numFeatures));return this._features.length>a&&(this._features.length=this._featuresLength.value=a,this.exceededTransferLimit.value=!1,5===this._fetchStatus&&(this._fetchStatus=4)),r}get cache(){return new v(this,this._features,this._numFeatures.value,this._emptyFeatureRatio.value)}set cache(t){this.requestController=null,this._availableFields=t.availableFields,this._features=t.features,this._featuresLength.value=t.features?.length??0,this._numFeatures.value=t.numFeatures,this._emptyFeatureRatio.value=t.emptyFeatureRatio,this._fetchStatus=t.fetchStatus,this.exceededTransferLimit.value=t.exceededTransferLimit,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._estimatedUnusedSizeDirty=!0,this.fetchInformation.value=t.fetchInformation}}const y=-1,S=-2;class v{constructor(t,s,i,r){this.features=s,this.numFeatures=i,this.emptyFeatureRatio=r,this.usedMemory=e+t.estimatedSize,this.resolution=t.displayingResolution,this.availableFields=t.availableFields,this.fetchStatus=t.fetchStatus,this.exceededTransferLimit=t.exceededTransferLimit.value,this.fetchInformation=t.fetchInformation.value}}function L(t,e,s){if(null==e||null==t||s!==e.length||s>t.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}const z=150,x=100,R=2,D=u(),M=r();export{p as FeatureTile,v as FeatureTileCacheItem,S as failedFeatureCount};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{filterInPlace as s}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{isAbortError as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import o from"../../../../core/ReactiveMap.js";import{on as l,watch as u}from"../../../../core/reactiveUtils.js";import{schedule as h}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{sqlAnd as c}from"../../../../core/sql.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{getEpsilon as _}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as m,equals as g,clone as y,expand as F,toExtent as T,width as x,height as v}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as R,hasVertices as b,computeAABR as E}from"../../../../layers/graphics/dehydratedFeatures.js";import C from"../../../../rest/support/QuantizationParameters.js";import D from"../../../../rest/support/Query.js";import{MultiFeatureReference as w,SingleFeatureReference as M}from"./featureReference.js";import{failedFeatureCount as U,FeatureTile as j}from"./FeatureTile.js";import{virtualDisplayFilterHighlightTileId as A,virtualSnapshotTileId as I}from"./FeatureTileDescriptor.js";import{tilesAreRelated as O}from"../../terrain/tileUtils.js";import{ImmediateTask as P,TaskPriority as z}from"../../../support/Scheduler.js";let q=class extends t{set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get readyToRun(){return this._dirty}get memoryForUnusedFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.estimatedUnusedSize),e}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}get showsAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(const e of this._featureTiles.values())if(!this.hasFullGeometries&&0!==e.emptyFeatureRatio||!e.showsAllFeatures)return!1;return!0}get hasFullGeometries(){if(!this._supportsResolution)return!0;const e=this.tileDescriptors?.some(Q);return e||!this.context.capabilities.supportsQuantization&&"polyline"!==this.context.geometryType}set filterExtent(e){if(null!=e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void i.getLogger(this).error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||null!=t&&e&&t.equals(e))return;const s=null!=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}_updateTileZQuantization(e){if(1===this.context.viewingMode){const t=e.computeZQuantizationFactor();this._zQuantizationFactor.value<t&&(this._zQuantizationFactor.value=t)}}get _tileZQuantization(){return this.context.isDraped?1:this._zQuantizationFactor.value}constructor(e){super(e),this._useTileCount=!1,this.dataUpdating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._zQuantizationFactor=d(1),this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._featureTiles=new o,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._dirty=!1,this._suspended=!0,this._pendingEdits=null,this._applyEditsTilesUpdated=!1,this._isFetching=!1;const t=e.context;this._frameTask=t.scheduler?.registerTask(z.FEATURE_TILE_FETCHER,this)??P,this.FeatureReferenceClass=t.capabilities.supportsMultipleResolutions?w:M,this._objectIdField=t.objectIdField}initialize(){this.addHandles([l(()=>this.tileDescriptors,"change",()=>this._setDirty(),{onListenerAdd:()=>this._setDirty(),onListenerRemove:()=>this._setDirty()}),u(()=>this._tileZQuantization,()=>this.refetch())]),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._removeTile(e)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetchDisplayFilterHighlightTile(){const e=this._featureTiles.get(A);e&&(this._cancelFetchTile(e),this._resetFetchTile(e),this._setDirty())}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(e){for(const t of this._featureTiles.values()){const s=t.missingAttributes?.get(e);if(null!=s)return s}}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{null!=t.displayingFeatures&&0!==t.displayingFeatures.length&&(null==e?e=new Set(t.availableFields):e.forEach(s=>{t.availableFields?.has(s)||e.delete(s)}))}),null!=e?e:new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const s=t.edits.then(()=>e.result.catch(e=>{if(a(e))throw e;return null}).then(e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then(()=>e)):e).then(e=>(0===--t.count&&(this._pendingEdits===t&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause()),e)));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),r=new Set,a=this._objectIdField;e.forEach(({objectId:e,globalId:n})=>{(!e||e<0)&&t&&n&&(s||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(n,a,t)),null!=e&&e>=0&&r.add(e)}),this._featureTiles.forEach(e=>{if(!e.features)return;const t=e.features.filter(e=>!r.has(R(e,this._objectIdField)));t.length!==e.features.length&&(this._applyEditsTileUpdated(),e.setFeatures(t,0,e.availableFields,e.missingAttributes),this._updateTileZQuantization(e),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,s){if(null==e)return null;const i=this.features.find(t=>t.attributes?.[s]===e);return i?R(i,t):null}async _applyEditsAddUpdateFeatures(e,t,s){const{objectIdField:r,globalIdField:a}=this.context,n=a&&this.availableFields.has(a),o=new Set,l=new Set;for(const i of e){const e=i.objectId;null!=e&&o.add(e)}for(const{objectId:h,globalId:d}of t){let e=h;(null==e||e<0)&&a&&(n||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(d,r,a)),null!=e&&e>=0&&(o.add(e),l.add(e))}if(0===o.size)return;const u=[];this._featureTiles.forEach(e=>{const t=this._applyEditsAddUpdateTile(e,o,l,s);u.push(t)}),this._updated(),await Promise.allSettled(u)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;e.fetchingResolution=e.descriptor.resolution;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=Array.from(t);const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter(e=>!s.has(R(e,this._objectIdField)));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),this._applyEditsTileUpdated(),e.setFeatures(n,0,Z(e.availableFields,a.fields),V(e.missingAttributes,a.missingAttributes)),this._updateTileZQuantization(e),this._invalidateCounts())}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:J})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){const t=this._frameTask.processQueue(e);if(!this._dirty||!this.initialized)return t;this._dirty=!1;const s=this._featureTilesArray;if(this._markTilesNotAlive(s),!e.run(()=>this._addTiles(s,e))||!e.run(()=>this._filterExtentTiles(s,e))||!e.run(()=>this._removeTiles(s,e))||e.done)return void this._setDirty();const i=this._sortTiles(s);e.run(()=>this._showTiles(i,e))&&e.run(()=>this._fetchTiles(i,e))&&e.run(()=>this._updateMemoryEstimates(i,e))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!(this._suspended||!this.tileDescriptors)&&(this.tileDescriptors.forEach(s=>{const i=this._featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority),e}_showTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;e.reduceFeatures(t,this.memoryFactor,this._objectIdField,this._reduceMode)&&this._setDirty();const{numFeatures:i,fetchingResolution:r,descriptor:a,isFetched:n}=e;return this._supportsResolution&&i>0&&r!==a.resolution&&n&&(e.requestRefetch(),this._setDirty()),this._showTile(e)};for(const r of e)if(!t.run(()=>i(r))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let s=!1;for(const i of e){if(!i.needsFetch)continue;const e=null!=this.context.memoryCache?this.context.memoryCache.pop(i.id):null;if(e?.resolution!==i.displayingResolution){if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,()=>i.resetFetching(),()=>i.numFeatures=U),s=!0,t.madeProgress()}if(t.done)return!0}else i.cache=e,i.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(s)return t.hasProgressed;for(const r of e){if(!r.needsFetch)continue;const e=new AbortController,s=this._fetchTile(r,e.signal);if(this._handleRequest(r,s,e,e=>r.fetchDone(e),e=>{r.fetchFailed=!0,this.context.logFetchError(i.getLogger(this),e)}),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(e=>!t.run(()=>e.updateMemoryEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const s=new Array;this._featureTiles.forEach(i=>{null!=i.displayingFeatures&&0!==i.displayingFeatures.length&&(i.intersectionIncludingBorrowed(t,B),i.intersectionIncludingBorrowed(e,G),g(B,G)||s.push(i))}),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this._changes.updates;for(const i of e)if(null!=i.displayingFeatures)for(const e of i.displayingFeatures){const i=R(e,this._objectIdField);if(t.has(i))continue;t.add(i);const r=this._displayingFeatureReferences.get(i).feature;s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;if(this._paused||this._featureTiles.forEach(t=>t.isFetching?++e:0),this._isFetching=e>0,e>0||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set("dataUpdating",!1),this.updating){let t=0,s=0,i=0,r=0,a=0;const n=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=null!=e.displayingFeatures?e.displayingFeatures.length*n:0;a+=t-s}e.needsFetch?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)}),r+=e;let o=0,l=0;t?(l=t,o=Math.min(r*t/i,t)):(l=s,o=r),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set("updatingTotal",l),this._set("updatingRemaining",o),this._set("expectedFeatureDiff",a)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger?.update()}_updateMaximumNumberOfFeaturesExceeded(){for(const{perTileMaximumNumberOfFeaturesExceeded:e}of this._featureTiles.values())if(e)return void this._set("maximumNumberOfFeaturesExceeded",!0);this._set("maximumNumberOfFeaturesExceeded",!1)}_updateRatio(e){const t=L(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach(e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.isFullyFetched(t)||(this._cancelFetchTile(e),this._resetFetchTile(e))}),this._setDirty())}_addTile(e){const t=new j(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.displayingResolution;this._featureTiles.forEach(s=>{if(null!=s.displayingFeatures&&e!==s&&O(e.descriptor.lij,s.descriptor.lij)){null==e.displayingFeatures&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(e.extentIncludingBorrowedFeatures??=y(e.descriptor.extent),F(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this._displayingFeatureReferences.get(R(i,this._objectIdField));s.ref(s.feature,t),this._numDisplayingFeatureReferences++}}})}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetch&&e.fetchDone(4):e.requestFetch()}_cancelFetchTile(e){const t=e.requestController;null!=t&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._featureTilesArray)}async _fetchTile(e,t){e.fetchFailed=!1;const s=this._maximumFeaturesForTile(e);if(s<=0)return e.hasPreciseFeatureCount&&0===e.numFeatures||(e.fetchFailed=!0),k(e),e.fetchInformation.value="Empty tile",4;const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(e.fetchingResolution=e.descriptor.resolution,N(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>D.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const a=this._createQuery(e);if(a.maxRecordCountFactor=r,e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}e.fetchInformation.value=`Single fetch\n${s} features`;const{features:o,exceededTransferLimit:l,fields:u,missingAttributes:h}=await this._queryFeatures(a,t),d=l||a.maxRecordCountFactor>=D.MAX_MAX_RECORD_COUNT_FACTOR||s===this._totalFeaturesForTile(e)?5:4,c=await this._frameTask.schedule(()=>{e.exceededTransferLimit.value=!!l;const t=this._removeEmptyFeatures(o,this._getEffectiveTileResolution(e));return e.fetchInformation.value=`Single fetch\n${o.length}/${s} features`,e.setFeatures(o,t,H(u),V(void 0,h)),this._updateTileZQuantization(e),this._maximumFeaturesForTile(e)>s?1:d},t);return n(t),this._invalidateCounts(),c}async _fetchCount(e,t){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t})}async _fetchPagedTile(e,t){let s,i=0,r=0,a=0,o=this._maximumFeaturesForTile(e)-a;const l=this._getMaxRecordCount(e);let u,h=null;for(;;){const d=this._createQuery(e),c=this._setPagingParameters(d,i,o,l);e.fetchInformation.value=`Paged fetch\n${e.features?.length}/${o} features`;const{features:p,exceededTransferLimit:f,fields:_,missingAttributes:m}=await this._queryFeatures(d,t);if(await this._frameTask.schedule(()=>{c&&(i+=d.num),a+=p.length,r+=this._removeEmptyFeatures(p,this._getEffectiveTileResolution(e)),e.exceededTransferLimit.value=!!f,s=s?.concat(p)??p,h=Z(h,_),u=V(u,m),e.setFeatures(s,r,h,u),this._updateTileZQuantization(e),this._invalidateCounts(),this._setDirty()},t),n(t),o=this._maximumFeaturesForTile(e)-(s?.length??0),!c||!f||o<=0)return f?4:5}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery();if(t.resultType=this._resultType(e),!N(e)&&e.descriptor.extent&&this.context.tilingScheme&&(t.geometry=T(e.descriptor.extent,this.context.tilingScheme.spatialReference)),this._setResolutionParams(t,e),"tile"!==t.resultType&&this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),S(e)){const{highlightIds:e}=this.context;e&&e.length>$&&i.getLogger(this).warn("highlight-too-many-features",`highlight is limited to ${$} features on large layers configured with a display filter to avoid performance issues`),t.objectIds=e?.slice(0,$)}else!Q(e)&&this.context.effectiveDisplayFilter&&(t.where=c(t.where,this.context.effectiveDisplayFilter.where));return t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(N(e)||!this._supportsResolution)return null;const t=1===this.context.viewingMode&&this.context.tilingScheme?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.fetchingResolution,t)/this.lodFactor/this._tileZQuantization}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new C({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e,t){const i=e.length;if(t&&this._supportsResolution){const i=t*(1+_());s(e,({geometry:e})=>!(!e||!b(e))&&(E(e,X),x(X)>i||v(X)>i))}else s(e,({geometry:e})=>b(e));return i-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!Q(e)}_getMaxRecordCount(e){switch(this._resultType(e)){case"tile":if(this.context.tileMaxRecordCount)return this.context.tileMaxRecordCount;break;case"standard":if(this.context.standardMaxRecordCount)return this.context.standardMaxRecordCount}return this.context.maxRecordCount||$}_resultType(e){if(this.context.capabilities.supportsResultType)return Q(e)?"standard":"tile"}get _reduceMode(){const e=this.context.geometryType;return"polygon"===e||"polyline"===e?0:1}_handleRequest(e,t,s,i,r){e.startFetch(),e.requestController=s;let n=!1;t.then(t=>{e.requestController=null,i(t)}).catch(t=>{e.requestController===s&&(e.requestController=null,e.fetchDone(4)),a(t)?n=!0:r(t)}).then(()=>{n||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(h(()=>{this.removeHandles("scheduleUpdated"),this._updated()}),"scheduleUpdated")}_showTile(e){if(e.displayingFeatures&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=null!=e.displayingFeatures&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.fetchingResolution,{adds:i,updates:r}=this._changes,a=Math.min(e.featureLimit,t.length);for(let n=0;n<a;++n){const e=t[n],a=R(e,this._objectIdField),o=this._displayingFeatureReferences.get(a);if(o){const{oldVersion:t,newVersion:i}=o.ref(e,s);t!==i&&(t&&r.removes.push(t),i&&r.adds.push(i))}else this._displayingFeatureReferences.set(a,new this.FeatureReferenceClass(e,s)),i.push(e);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),e.displayingResolution=e.fetchingResolution,this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(null==e.displayingFeatures)return;const{updates:t,removes:s}=this._changes;for(const i of e.displayingFeatures){const r=R(i,this._objectIdField),a=this._displayingFeatureReferences.get(r);if(!a)continue;const{oldVersion:n,newVersion:o}=a.unref(e.displayingResolution);this._numDisplayingFeatureReferences--,n!==o&&(null==o?(this._displayingFeatureReferences.delete(r),n&&s.push(n)):(t.adds.push(o),n&&t.removes.push(n)))}this._applyChanges(),e.displayingFeatures=null}_notifyDataUpdating(){this._get("dataUpdating")||this._set("dataUpdating",!0)}_applyChanges(){const e=this._changes.updates;e.removes.length>0&&(this._notifyDataUpdating(),this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this._notifyDataUpdating(),this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,s=this._changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+K,i);this._notifyDataUpdating(),this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&(this._notifyDataUpdating(),this.features.addMany(0===r?t:t.slice(r))),s.length>i&&(this._notifyDataUpdating(),this.features.removeMany(0===r?s:s.slice(r))),t.length=0,s.length=0}_clearTile(e){this._hideTile(e),e.features&&null!=this.context.memoryCache&&this.context.memoryCache.put(e.id,e.cache),e.setFeatures(null,0,null,void 0),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}get _featureTilesArray(){return Array.from(this._featureTiles.values())}get featureTiles(){return this._featureTiles}get storedFeatures(){return this._featureTilesArray.reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce((e,t)=>e+(t.needsFetch||t.isFetching?1:0),0)}_totalFeaturesForTile(e){return e.hasPreciseFeatureCount?e.numFeatures:this.maximumNumberOfFeatures}_maximumFeaturesForTile(e){const t=this._totalFeaturesForTile(e),s=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(t*s/(1-e.emptyFeatureRatio)),t)}get test(){}};function Q(e){return e.id===I}function S(e){return e.id===A}function N(e){return Q(e)||S(e)}function L(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function k(e){e.setFeatures([],0,null,void 0)}function H(e){return null==e?new Set:new Set(e.map(e=>e.name))}function Z(e,t){if(null==e||null==t)return H(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}function V(e,t){if(!t?.length)return e;e??=new Map;const s=()=>new Set;for(const{objectId:i,attribute:a}of t)r(e,i,s).add(a);return e}e([p({constructOnly:!0})],q.prototype,"features",void 0),e([p()],q.prototype,"tileDescriptors",void 0),e([p({value:1/0})],q.prototype,"maximumNumberOfFeatures",null),e([p({value:1})],q.prototype,"memoryFactor",null),e([p({value:1})],q.prototype,"lodFactor",null),e([p()],q.prototype,"useTileCount",null),e([p({readOnly:!0})],q.prototype,"updating",null),e([p({readOnly:!0})],q.prototype,"dataUpdating",void 0),e([p({readOnly:!0})],q.prototype,"updatingTotal",void 0),e([p({readOnly:!0})],q.prototype,"updatingRemaining",void 0),e([p({readOnly:!0})],q.prototype,"expectedFeatureDiff",void 0),e([p({readOnly:!0})],q.prototype,"memoryForUnusedFeatures",null),e([p({readOnly:!0})],q.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([p({readOnly:!0})],q.prototype,"totalVertices",null),e([p({readOnly:!0})],q.prototype,"totalFeatures",null),e([p({readOnly:!0})],q.prototype,"showsAllFeatures",null),e([p({readOnly:!0})],q.prototype,"hasFullGeometries",null),e([p()],q.prototype,"filterExtent",null),e([p({constructOnly:!0})],q.prototype,"context",void 0),e([p()],q.prototype,"_dirty",void 0),e([p()],q.prototype,"_suspended",void 0),e([p()],q.prototype,"_pendingEdits",void 0),e([p()],q.prototype,"_applyEditsTilesUpdated",void 0),e([p()],q.prototype,"_paused",null),e([p()],q.prototype,"_isFetching",void 0),q=e([f("esri.views.3d.layers.support.FeatureTileFetcher3D")],q);const $=2e3,B=m(),G=m(),X=m(),J=6e5,K=200;export{q as FeatureTileFetcher3D};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{filterInPlace as s}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{isAbortError as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import o from"../../../../core/ReactiveMap.js";import{on as l,watch as u}from"../../../../core/reactiveUtils.js";import{schedule as h}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{sqlAnd as c}from"../../../../core/sql.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{getEpsilon as _}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as m,equals as g,clone as y,expand as F,toExtent as T,width as x,height as v}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as R,hasVertices as E,computeAABR as b}from"../../../../layers/graphics/dehydratedFeatures.js";import C from"../../../../rest/support/QuantizationParameters.js";import D from"../../../../rest/support/Query.js";import{MultiFeatureReference as w,SingleFeatureReference as M}from"./featureReference.js";import{failedFeatureCount as U,FeatureTile as j}from"./FeatureTile.js";import{virtualDisplayFilterHighlightTileId as A,virtualSnapshotTileId as I}from"./FeatureTileDescriptor.js";import{tilesAreRelated as O}from"../../terrain/tileUtils.js";import{ImmediateTask as P,TaskPriority as z}from"../../../support/Scheduler.js";let q=class extends t{set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get readyToRun(){return this._dirty}get memoryForUnusedFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.estimatedUnusedSize),e}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}get showsAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(const e of this._featureTiles.values())if(!this.hasFullGeometries&&0!==e.emptyFeatureRatio||!e.showsAllFeatures)return!1;return!0}get hasFullGeometries(){if(!this._supportsResolution)return!0;const e=this.tileDescriptors?.some(Q);return e||!this.context.capabilities.supportsQuantization&&"polyline"!==this.context.geometryType}set filterExtent(e){if(null!=e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void i.getLogger(this).error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||null!=t&&e&&t.equals(e))return;const s=null!=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}_updateTileZQuantization(e){if(1===this.context.viewingMode){const t=e.computeZQuantizationFactor();this._zQuantizationFactor.value<t&&(this._zQuantizationFactor.value=t)}}get _tileZQuantization(){return this.context.isDraped?1:this._zQuantizationFactor.value}constructor(e){super(e),this._useTileCount=!1,this.dataUpdating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._zQuantizationFactor=d(1),this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._featureTiles=new o,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._dirty=!1,this._suspended=!0,this._pendingEdits=null,this._applyEditsTilesUpdated=!1,this.snappingComplexityExceeded=!0,this._isFetching=!1;const t=e.context;this._frameTask=t.scheduler?.registerTask(z.FEATURE_TILE_FETCHER,this)??P,this.FeatureReferenceClass=t.capabilities.supportsMultipleResolutions?w:M,this._objectIdField=t.objectIdField}initialize(){this.addHandles([l(()=>this.tileDescriptors,"change",()=>this._setDirty(),{onListenerAdd:()=>this._setDirty(),onListenerRemove:()=>this._setDirty()}),u(()=>this._tileZQuantization,()=>this.refetch())]),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._removeTile(e)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetchDisplayFilterHighlightTile(){const e=this._featureTiles.get(A);e&&(this._cancelFetchTile(e),this._resetFetchTile(e),this._setDirty())}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(e){for(const t of this._featureTiles.values()){const s=t.missingAttributes?.get(e);if(null!=s)return s}}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{null!=t.displayingFeatures&&0!==t.displayingFeatures.length&&(null==e?e=new Set(t.availableFields):e.forEach(s=>{t.availableFields?.has(s)||e.delete(s)}))}),null!=e?e:new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const s=t.edits.then(()=>e.result.catch(e=>{if(a(e))throw e;return null}).then(e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then(()=>e)):e).then(e=>(0===--t.count&&(this._pendingEdits===t&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause()),e)));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),r=new Set,a=this._objectIdField;e.forEach(({objectId:e,globalId:n})=>{(!e||e<0)&&t&&n&&(s||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(n,a,t)),null!=e&&e>=0&&r.add(e)}),this._featureTiles.forEach(e=>{if(!e.features)return;const t=e.features.filter(e=>!r.has(R(e,this._objectIdField)));t.length!==e.features.length&&(this._applyEditsTileUpdated(),e.setFeatures(t,0,e.availableFields,e.missingAttributes),this._updateTileZQuantization(e),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,s){if(null==e)return null;const i=this.features.find(t=>t.attributes?.[s]===e);return i?R(i,t):null}async _applyEditsAddUpdateFeatures(e,t,s){const{objectIdField:r,globalIdField:a}=this.context,n=a&&this.availableFields.has(a),o=new Set,l=new Set;for(const i of e){const e=i.objectId;null!=e&&o.add(e)}for(const{objectId:h,globalId:d}of t){let e=h;(null==e||e<0)&&a&&(n||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(d,r,a)),null!=e&&e>=0&&(o.add(e),l.add(e))}if(0===o.size)return;const u=[];this._featureTiles.forEach(e=>{const t=this._applyEditsAddUpdateTile(e,o,l,s);u.push(t)}),this._updated(),await Promise.allSettled(u)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;e.fetchingResolution=e.descriptor.resolution;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=Array.from(t);const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter(e=>!s.has(R(e,this._objectIdField)));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),this._applyEditsTileUpdated(),e.setFeatures(n,0,Z(e.availableFields,a.fields),V(e.missingAttributes,a.missingAttributes)),this._updateTileZQuantization(e),this._invalidateCounts())}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:J})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){const t=this._frameTask.processQueue(e);if(!this._dirty||!this.initialized)return t;this._dirty=!1;const s=this._featureTilesArray;if(this._markTilesNotAlive(s),!e.run(()=>this._addTiles(s,e))||!e.run(()=>this._filterExtentTiles(s,e))||!e.run(()=>this._removeTiles(s,e))||e.done)return void this._setDirty();const i=this._sortTiles(s);e.run(()=>this._showTiles(i,e))&&e.run(()=>this._fetchTiles(i,e))&&e.run(()=>this._updateMemoryEstimates(i,e))||this._setDirty(),this._updated(),this.updating||(this._updateMaximumNumberOfFeaturesExceeded(),this._updateSnappingComplexityExceeded(i))}_updateSnappingComplexityExceeded(e){let t=Y;for(const s of e){if(Q(s)||t<=0)break;if(!S(s)&&(t--,s.sampledDensityEstimate>W))return void(this.snappingComplexityExceeded=!0)}this.snappingComplexityExceeded=0===this._featureTiles.size}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!(this._suspended||!this.tileDescriptors)&&(this.tileDescriptors.forEach(s=>{const i=this._featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority),e}_showTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;e.reduceFeatures(t,this.memoryFactor,this._objectIdField,this._reduceMode)&&this._setDirty();const{numFeatures:i,fetchingResolution:r,descriptor:a,isFetched:n}=e;return this._supportsResolution&&i>0&&r!==a.resolution&&n&&(e.requestRefetch(),this._setDirty()),this._showTile(e)};for(const r of e)if(!t.run(()=>i(r))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let s=!1;for(const i of e){if(!i.needsFetch)continue;const e=null!=this.context.memoryCache?this.context.memoryCache.pop(i.id):null;if(e?.resolution!==i.displayingResolution){if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,()=>i.resetFetching(),()=>i.numFeatures=U),s=!0,t.madeProgress()}if(t.done)return!0}else i.cache=e,i.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(s)return t.hasProgressed;for(const r of e){if(!r.needsFetch)continue;const e=new AbortController,s=this._fetchTile(r,e.signal);if(this._handleRequest(r,s,e,e=>r.fetchDone(e),e=>{r.fetchFailed=!0,this.context.logFetchError(i.getLogger(this),e)}),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(e=>!t.run(()=>e.updateEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const s=new Array;this._featureTiles.forEach(i=>{null!=i.displayingFeatures&&0!==i.displayingFeatures.length&&(i.intersectionIncludingBorrowed(t,B),i.intersectionIncludingBorrowed(e,G),g(B,G)||s.push(i))}),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this._changes.updates;for(const i of e)if(null!=i.displayingFeatures)for(const e of i.displayingFeatures){const i=R(e,this._objectIdField);if(t.has(i))continue;t.add(i);const r=this._displayingFeatureReferences.get(i).feature;s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;if(this._paused||this._featureTiles.forEach(t=>t.isFetching?++e:0),this._isFetching=e>0,e>0||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set("dataUpdating",!1),this.updating){let t=0,s=0,i=0,r=0,a=0;const n=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=null!=e.displayingFeatures?e.displayingFeatures.length*n:0;a+=t-s}e.needsFetch?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)}),r+=e;let o=0,l=0;t?(l=t,o=Math.min(r*t/i,t)):(l=s,o=r),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set("updatingTotal",l),this._set("updatingRemaining",o),this._set("expectedFeatureDiff",a)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger?.update()}_updateMaximumNumberOfFeaturesExceeded(){for(const{perTileMaximumNumberOfFeaturesExceeded:e}of this._featureTiles.values())if(e)return void this._set("maximumNumberOfFeaturesExceeded",!0);this._set("maximumNumberOfFeaturesExceeded",!1)}_updateRatio(e){const t=L(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach(e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.isFullyFetched(t)||(this._cancelFetchTile(e),this._resetFetchTile(e))}),this._setDirty())}_addTile(e){const t=new j(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.displayingResolution;this._featureTiles.forEach(s=>{if(null!=s.displayingFeatures&&e!==s&&O(e.descriptor.lij,s.descriptor.lij)){null==e.displayingFeatures&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(e.extentIncludingBorrowedFeatures??=y(e.descriptor.extent),F(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this._displayingFeatureReferences.get(R(i,this._objectIdField));s.ref(s.feature,t),this._numDisplayingFeatureReferences++}}})}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetch&&e.fetchDone(4):e.requestFetch()}_cancelFetchTile(e){const t=e.requestController;null!=t&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._featureTilesArray)}async _fetchTile(e,t){e.fetchFailed=!1;const s=this._maximumFeaturesForTile(e);if(s<=0)return e.hasPreciseFeatureCount&&0===e.numFeatures||(e.fetchFailed=!0),k(e),e.fetchInformation.value="Empty tile",4;const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(e.fetchingResolution=e.descriptor.resolution,N(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>D.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const a=this._createQuery(e);if(a.maxRecordCountFactor=r,e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}e.fetchInformation.value=`Single fetch\n${s} features`;const{features:o,exceededTransferLimit:l,fields:u,missingAttributes:h}=await this._queryFeatures(a,t),d=l||a.maxRecordCountFactor>=D.MAX_MAX_RECORD_COUNT_FACTOR||s===this._totalFeaturesForTile(e)?5:4,c=await this._frameTask.schedule(()=>{e.exceededTransferLimit.value=!!l;const t=this._removeEmptyFeatures(o,this._getEffectiveTileResolution(e));return e.fetchInformation.value=`Single fetch\n${o.length}/${s} features`,e.setFeatures(o,t,H(u),V(void 0,h)),this._updateTileZQuantization(e),this._maximumFeaturesForTile(e)>s?1:d},t);return n(t),this._invalidateCounts(),c}async _fetchCount(e,t){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t})}async _fetchPagedTile(e,t){let s,i=0,r=0,a=0,o=this._maximumFeaturesForTile(e)-a;const l=this._getMaxRecordCount(e);let u,h=null;for(;;){const d=this._createQuery(e),c=this._setPagingParameters(d,i,o,l);e.fetchInformation.value=`Paged fetch\n${e.features?.length}/${o} features`;const{features:p,exceededTransferLimit:f,fields:_,missingAttributes:m}=await this._queryFeatures(d,t);if(await this._frameTask.schedule(()=>{c&&(i+=d.num),a+=p.length,r+=this._removeEmptyFeatures(p,this._getEffectiveTileResolution(e)),e.exceededTransferLimit.value=!!f,s=s?.concat(p)??p,h=Z(h,_),u=V(u,m),e.setFeatures(s,r,h,u),this._updateTileZQuantization(e),this._invalidateCounts(),this._setDirty()},t),n(t),o=this._maximumFeaturesForTile(e)-(s?.length??0),!c||!f||o<=0)return f?4:5}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery();if(t.resultType=this._resultType(e),!N(e)&&e.descriptor.extent&&this.context.tilingScheme&&(t.geometry=T(e.descriptor.extent,this.context.tilingScheme.spatialReference)),this._setResolutionParams(t,e),"tile"!==t.resultType&&this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),S(e)){const{highlightIds:e}=this.context;e&&e.length>$&&i.getLogger(this).warn("highlight-too-many-features",`highlight is limited to ${$} features on large layers configured with a display filter to avoid performance issues`),t.objectIds=e?.slice(0,$)}else!Q(e)&&this.context.effectiveDisplayFilter&&(t.where=c(t.where,this.context.effectiveDisplayFilter.where));return t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(N(e)||!this._supportsResolution)return null;const t=1===this.context.viewingMode&&this.context.tilingScheme?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.fetchingResolution,t)/this.lodFactor/this._tileZQuantization}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new C({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e,t){const i=e.length;if(t&&this._supportsResolution){const i=t*(1+_());s(e,({geometry:e})=>!(!e||!E(e))&&(b(e,X),x(X)>i||v(X)>i))}else s(e,({geometry:e})=>E(e));return i-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!Q(e)}_getMaxRecordCount(e){switch(this._resultType(e)){case"tile":if(this.context.tileMaxRecordCount)return this.context.tileMaxRecordCount;break;case"standard":if(this.context.standardMaxRecordCount)return this.context.standardMaxRecordCount}return this.context.maxRecordCount||$}_resultType(e){if(this.context.capabilities.supportsResultType)return Q(e)?"standard":"tile"}get _reduceMode(){const e=this.context.geometryType;return"polygon"===e||"polyline"===e?0:1}_handleRequest(e,t,s,i,r){e.startFetch(),e.requestController=s;let n=!1;t.then(t=>{e.requestController=null,i(t)}).catch(t=>{e.requestController===s&&(e.requestController=null,e.fetchDone(4)),a(t)?n=!0:r(t)}).then(()=>{n||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(h(()=>{this.removeHandles("scheduleUpdated"),this._updated()}),"scheduleUpdated")}_showTile(e){if(e.displayingFeatures&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=null!=e.displayingFeatures&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.fetchingResolution,{adds:i,updates:r}=this._changes,a=Math.min(e.featureLimit,t.length);for(let n=0;n<a;++n){const e=t[n],a=R(e,this._objectIdField),o=this._displayingFeatureReferences.get(a);if(o){const{oldVersion:t,newVersion:i}=o.ref(e,s);t!==i&&(t&&r.removes.push(t),i&&r.adds.push(i))}else this._displayingFeatureReferences.set(a,new this.FeatureReferenceClass(e,s)),i.push(e);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),e.displayingResolution=e.fetchingResolution,this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(null==e.displayingFeatures)return;const{updates:t,removes:s}=this._changes;for(const i of e.displayingFeatures){const r=R(i,this._objectIdField),a=this._displayingFeatureReferences.get(r);if(!a)continue;const{oldVersion:n,newVersion:o}=a.unref(e.displayingResolution);this._numDisplayingFeatureReferences--,n!==o&&(null==o?(this._displayingFeatureReferences.delete(r),n&&s.push(n)):(t.adds.push(o),n&&t.removes.push(n)))}this._applyChanges(),e.displayingFeatures=null}_notifyDataUpdating(){this._get("dataUpdating")||this._set("dataUpdating",!0)}_applyChanges(){const e=this._changes.updates;e.removes.length>0&&(this._notifyDataUpdating(),this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this._notifyDataUpdating(),this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,s=this._changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+K,i);this._notifyDataUpdating(),this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&(this._notifyDataUpdating(),this.features.addMany(0===r?t:t.slice(r))),s.length>i&&(this._notifyDataUpdating(),this.features.removeMany(0===r?s:s.slice(r))),t.length=0,s.length=0}_clearTile(e){this._hideTile(e),e.features&&null!=this.context.memoryCache&&this.context.memoryCache.put(e.id,e.cache),e.setFeatures(null,0,null,void 0),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}get _featureTilesArray(){return Array.from(this._featureTiles.values())}get featureTiles(){return this._featureTiles}get storedFeatures(){return this._featureTilesArray.reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce((e,t)=>e+(t.needsFetch||t.isFetching?1:0),0)}_totalFeaturesForTile(e){return e.hasPreciseFeatureCount?e.numFeatures:this.maximumNumberOfFeatures}_maximumFeaturesForTile(e){const t=this._totalFeaturesForTile(e),s=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(t*s/(1-e.emptyFeatureRatio)),t)}get test(){}};function Q(e){return e.id===I}function S(e){return e.id===A}function N(e){return Q(e)||S(e)}function L(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function k(e){e.setFeatures([],0,null,void 0)}function H(e){return null==e?new Set:new Set(e.map(e=>e.name))}function Z(e,t){if(null==e||null==t)return H(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}function V(e,t){if(!t?.length)return e;e??=new Map;const s=()=>new Set;for(const{objectId:i,attribute:a}of t)r(e,i,s).add(a);return e}e([p({constructOnly:!0})],q.prototype,"features",void 0),e([p()],q.prototype,"tileDescriptors",void 0),e([p({value:1/0})],q.prototype,"maximumNumberOfFeatures",null),e([p({value:1})],q.prototype,"memoryFactor",null),e([p({value:1})],q.prototype,"lodFactor",null),e([p()],q.prototype,"useTileCount",null),e([p({readOnly:!0})],q.prototype,"updating",null),e([p({readOnly:!0})],q.prototype,"dataUpdating",void 0),e([p({readOnly:!0})],q.prototype,"updatingTotal",void 0),e([p({readOnly:!0})],q.prototype,"updatingRemaining",void 0),e([p({readOnly:!0})],q.prototype,"expectedFeatureDiff",void 0),e([p({readOnly:!0})],q.prototype,"memoryForUnusedFeatures",null),e([p({readOnly:!0})],q.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([p({readOnly:!0})],q.prototype,"totalVertices",null),e([p({readOnly:!0})],q.prototype,"totalFeatures",null),e([p({readOnly:!0})],q.prototype,"showsAllFeatures",null),e([p({readOnly:!0})],q.prototype,"hasFullGeometries",null),e([p()],q.prototype,"filterExtent",null),e([p({constructOnly:!0})],q.prototype,"context",void 0),e([p()],q.prototype,"_dirty",void 0),e([p()],q.prototype,"_suspended",void 0),e([p()],q.prototype,"_pendingEdits",void 0),e([p()],q.prototype,"_applyEditsTilesUpdated",void 0),e([p()],q.prototype,"_paused",null),e([p()],q.prototype,"snappingComplexityExceeded",void 0),e([p()],q.prototype,"_isFetching",void 0),q=e([f("esri.views.3d.layers.support.FeatureTileFetcher3D")],q);const $=2e3,B=m(),G=m(),X=m(),J=6e5,K=200,W=.95,Y=10;export{q as FeatureTileFetcher3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{destroyMaybe as e}from"../../../../core/maybe.js";import{createFeatureTileQuery3D as t}from"./featureTileQuery3D.js";class r{constructor(e){this._memoryCache=null;const r=e.layerView.layer;this._layerView=e.layerView,this.objectIdField=r.objectIdField,this.globalIdField="globalIdField"in r?r.globalIdField:null,this._returnZ=e.returnZ,this._returnM=e.returnM;const i=this._layerView.view.resourceController;this.query=t(this._layerView,i.normal),i&&this._memoryCacheEnabled&&(this._memoryCache=i.memoryController.newCache(`fl-${r.uid}`))}get _memoryCacheEnabled(){switch(this._layerView.layer.source.type){case"feature-layer":case"ogc-feature":case"oriented-imagery":return!0;case"csv":case"parquet":case"geojson":case"memory":case"wfs":return!1}}destroy(){this._memoryCache=e(this._memoryCache),this.query.destroy()}createQuery(){const e=this._layerView.layer.createQuery();return e.outFields=this._layerView.
|
|
5
|
+
import{destroyMaybe as e}from"../../../../core/maybe.js";import{createFeatureTileQuery3D as t}from"./featureTileQuery3D.js";class r{constructor(e){this._memoryCache=null;const r=e.layerView.layer;this._layerView=e.layerView,this.objectIdField=r.objectIdField,this.globalIdField="globalIdField"in r?r.globalIdField:null,this._returnZ=e.returnZ,this._returnM=e.returnM;const i=this._layerView.view.resourceController;this.query=t(this._layerView,i.normal),i&&this._memoryCacheEnabled&&(this._memoryCache=i.memoryController.newCache(`fl-${r.uid}`))}get _memoryCacheEnabled(){switch(this._layerView.layer.source.type){case"feature-layer":case"ogc-feature":case"oriented-imagery":return!0;case"csv":case"parquet":case"geojson":case"memory":case"wfs":return!1}}destroy(){this._memoryCache=e(this._memoryCache),this.query.destroy()}createQuery(){const e=this._layerView.layer.createQuery();return e.outFields=this._layerView.availableFieldsForQuery,e.returnZ=this._returnZ,e.returnM=this._returnM,e.outSpatialReference=this.tilingScheme?.spatialReference??this._layerView.view.spatialReference,e}get memoryCache(){return this._memoryCache}get viewingMode(){return this._layerView.view.state.viewingMode}get tilingScheme(){return this._layerView.view.featureTiles?.tilingScheme}get scheduler(){return this._layerView.view.resourceController?.scheduler}get geometryType(){return this._layerView.layer.geometryType}get fullExtent(){return this._layerView.layer.fullExtent}get tileMaxRecordCount(){return this._layerView.layer.capabilities.query.tileMaxRecordCount}get standardMaxRecordCount(){return this._layerView.layer.capabilities.query.standardMaxRecordCount}get maxRecordCount(){return this._layerView.layer.capabilities.query.maxRecordCount}get isDraped(){return"on-the-ground"===this._layerView.layer.elevationInfo?.mode}get effectiveDisplayFilter(){return this._layerView.displayFilterEnabled?this._layerView.effectiveDisplayFilter:null}get highlightIds(){return this._layerView.displayFilterEnabled?this._layerView.highlightIds:null}get capabilities(){return this._capabilities??=i(this._layerView.layer),this._capabilities}logFetchError(e,t){e.error("#fetchTile()",this._layerView.layer,t?.message??t)}}function i(e){const t=e.capabilities.query;return{supportsMultipleResolutions:a(e),supportsPagination:!(!t||!t.supportsPagination),supportsResultType:!(!t||!t.supportsResultType),supportsCacheHint:!(!t||!t.supportsCacheHint),supportsQuantization:!(!t||!t.supportsQuantization),supportsQuantizationEditMode:!(!t||!t.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!t||!t.supportsMaxRecordCountFactor),supportsFormatPBF:!(!t||!t.supportsFormatPBF)}}function a(e){switch(e.geometryType){case"polyline":return!0;case"polygon":return e.capabilities&&e.capabilities.query&&e.capabilities.query.supportsQuantization;default:return!1}}export{r as FeatureTileFetcher3DContext,i as contextCapabilitiesFromLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as
|
|
5
|
+
import{__decorate as i}from"tslib";import e from"../../../../Color.js";import t from"../../../../core/Accessor.js";import{isSome as r}from"../../../../core/arrayUtils.js";import{makeHandle as s,destroyHandle as o}from"../../../../core/handleUtils.js";import{watch as h,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{initializeProjection as n,project as c}from"../../../../geometry/projectionUtils.js";import{GraphicsCollection as g}from"../../../../support/GraphicsCollection.js";import m from"../../../../symbols/SimpleFillSymbol.js";import d from"../../../../symbols/SimpleLineSymbol.js";import u from"../../../../symbols/SimpleMarkerSymbol.js";import{getHighlightGraphics as y}from"../../../layers/support/highlightUtils.js";let w=class extends t{get updating(){return this.graphicsView?.updating??!1}constructor(i){super(i),this._highlightCounts=new Map,this._graphicsViewLoader=null,this.graphics=new g,this.graphicsView=null,this.suspended=!1;const t=new e([255,255,255,1/255]);this._symbols=new Map([["point",new u({size:"2px",style:"square",color:t})],["polyline",new d({width:"2px",color:t})],["polygon",new m({outline:null,color:t})]])}highlight(i,e){const t=y(i);if(0===t.length)return s();let r,o=!1;return this.updatingHandles.addPromise(Promise.all([this._createHighlightGraphics(t),this._ensureGraphicsView3D()]).then(([i,t])=>{!o&&t&&(r=this._addHighlightGraphics(t,i,e))})),s(()=>{o=!0,r?.remove()})}preload(){this._ensureGraphicsView3D()}_addHighlightGraphics(i,e,t){for(const s of e)this._highlightCounts.set(s,(this._highlightCounts.get(s)??0)+1);this.graphics.addMany(e);const r=i.highlight(e,t);return s(()=>{this._removeHighlightGraphics(e),r.remove()})}_removeHighlightGraphics(i){this.graphics.removeMany(i.filter(i=>{const e=Math.max(0,(this._highlightCounts.get(i)??0)-1);return 0===e?(this._highlightCounts.delete(i),!0):(this._highlightCounts.set(i,e),!1)}))}async _ensureGraphicsView3D(){if(this.graphicsView)return this.graphicsView;this._graphicsViewLoader||(this._graphicsViewLoader=import("../GraphicsView3D.js"));const{default:i}=await this._graphicsViewLoader;if(this.destroyed)return null;const e=new i({view:this.view,layer:{type:"graphics-view-3d-dummy",id:this.layer.id,uid:this.layer.uid,elevationInfo:{mode:"on-the-ground"}},getGraphics:()=>this.graphics,drapeSourcePriorityOffset:.5});return this._set("graphicsView",e),this.addHandles([o(this.graphicsView),h(()=>this.suspended,i=>{e.suspended=i},p)]),e}async _createHighlightGraphics(i){const e=i.map(({geometry:i})=>i?.spatialReference).filter(r).reduce((i,e)=>(0!==i.length&&i.at(-1)?.equals(e)||i.push(e),i),[]),t=this.view.spatialReference,s=e.map(i=>({source:i,dest:t}));try{await n(s)}catch{return[]}return i.map(i=>{const{geometry:e}=i;try{const r=e?c(e,t):null,s=i.cloneShallow();return s.geometry=r,s.symbol=this._symbols.get(r?.type),s}catch{return i}})}};i([a()],w.prototype,"graphics",void 0),i([a()],w.prototype,"graphicsView",void 0),i([a()],w.prototype,"view",void 0),i([a()],w.prototype,"layer",void 0),i([a()],w.prototype,"updatingHandles",void 0),i([a()],w.prototype,"suspended",void 0),i([a()],w.prototype,"updating",null),w=i([l("esri.views.3d.layers.support.ImageHighlightHelper3D")],w);export{w as ImageHighlightHelper3D};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
class t{constructor(t,s){this._maxTotalSamples=t,this._maxDistance=s,this.count=0,this.numSamples=0}get done(){return 0===this.numRemainingSamples}get numRemainingSamples(){return Math.max(0,this._maxTotalSamples-this.numSamples)}get ratio(){return this.numSamples?this.count/this.numSamples:0}sampleGeometry(t,s,e){switch(t?.type){case"point":if("point"!==s?.type)return;this._withinDistance(t.x-s.x,t.y-s.y)&&this.count++,this.numSamples++;break;case"polyline":case"polygon":{const s="polyline"===t.type?t.paths:t.rings;for(let t=0;t<s.length;t++){const a=s[t],n=e/(s.length-t),i=Math.max(1,Math.ceil(a.length/n));for(let t=Math.floor(i/2);t<a.length-1;t+=i){const s=a[t],n=a[t+1],i=n[0]-s[0],h=n[1]-s[1];if(this._withinDistance(i,h)&&this.count++,this.numSamples++,--e<=0||this.numSamples>=this._maxTotalSamples)return}}}}}_withinDistance(t,s){return Math.abs(t)<=this._maxDistance||Math.abs(s)<=this._maxDistance}}export{t as SampledGeometryMaxDistanceRatio};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{createScreenPoint as c}from"../../../core/screenUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as v}from"../../../chunks/vec32.js";import{fromArray as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as w}from"../../../chunks/vec42.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import _ from"../../../geometry/Extent.js";import y from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as C,requiresLoad as x}from"../../../geometry/projectionUtils.js";import{fromRenderCamera as R,toRenderCamera as P}from"../webgl.js";import{applyAll as S}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as O,surfaceElevationBelowRenderLocation as b}from"../camera/intersectionUtils.js";import{ConstraintsManager as T}from"./ConstraintsManager.js";import{Frustum as j}from"./Frustum.js";import{GoToOperation as z}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as M}from"./controllers/SurfaceCollisionCorrectionController.js";import{toArea as I,toExtent as H,applyTiltAdjustToScale as B,scaleToZoom as E,fromExtentSync as L,getObserverForPointAtDistanceSync as V,viewScaleToCameraDistance as A,zoomToScale as U}from"../support/cameraUtils.js";import{fromCamera as k,toCameraSync as D}from"../support/viewpointUtils.js";import F from"../webgl/RenderCamera.js";import{PropertiesPool as G}from"../../support/PropertiesPool.js";import{ensureAttachmentMaxSize as N}from"../../webgl/FramebufferObject.js";let q=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=te,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,getDevicePixelRatioOverride:()=>this._devicePixelRatioOverride,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?te:0}},this._propertiesPool=new G({frustum:()=>new j(null)},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new W}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n(()=>this.view.state.events,"before-camera-change",({camera:e})=>e&&this._updateElevation(e)),o(()=>this.view.state?.camera,(e,t)=>this._cameraChangedHandler(e,t),h)]),l(()=>this.view.state?.camera,e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([p({prepare:()=>this._prepareFrame()}),o(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles($)}),n(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const t=R(this.view,this.view.state.camera,Q);return t&&e&&t.equals(e)?e:t.clone()}set camera(e){this._updatePropertyBeforeReady("camera",e)||(this.view.elevationProvider.enableCache(!0),this.setStateCamera(P(this.view,e),{applyConstraints:!1})||a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableCache(!1))}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const t=R(this.view,this.view.state.contentCamera,Q);return t&&e&&t.equals(e)?e:t.clone()}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=P(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(ee),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=u(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(ee),this.test.contentCameraResetState.clear())}),o(()=>this.zoom,e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))}),o(()=>this.view.state.camera,e=>{const t=v(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})],ee),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?f.fromExtent(e):null}return I(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=H(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?B(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[0]/i),s=Math.round(t[1]/i),n=Math.round(t[2]/i),o=Math.round(t[3]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,Y),this.view.state.updateCamera(e=>e.padding=Y))}_paddingToArray(e,t,i){e?w(i,e.top||0,e.right||0,e.bottom||0,e.left||0):w(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return c((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?k(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e){if(!this.isCompatible(e)){const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;return void a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?E(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&N(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){return this.view?.stage?.renderer.isFeatureEnabled(8)??!1}get _usePhysicalPixelRenderingAny(){const e=this.view?.stage?.renderer;return e&&(e.isFeatureEnabled(8,2)||e.isFeatureEnabled(8,1)||e.isFeatureEnabled(8,0))}preinit(e){return!(this._isOverridden("center")&&!C(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!C(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!C(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||C(this.viewpoint.targetGeometry?.spatialReference,e)&&C(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new T({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):2===this.view.state.viewingMode&&this.addHandles(l(()=>this.view.basemapTerrain.ready,()=>{this.removeHandles($),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),$)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles($),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:!0,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new z(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(O(this.view),{applyConstraints:!1})}step(e){const t=this.view.state?.cameraController;t?.stepController&&this.view.state.updateCamera(i=>t.stepController(e,i))}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of J){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach(t=>e.add(t))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(P(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof _){const t=L(this.view,e.targetGeometry,0,.5,0);return void(null!=t&&this.setStateCamera(P(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=L(this.view,e,0,.5,0);null!=r&&this.setStateCamera(P(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&Z.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!x(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=K){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=X){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=V(this.view,r,a,e,t,1);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=L(this.view,e,t,i,1,Q);return r?P(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=A(t,e,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(U(this.view,e))}_viewpointToCamera(e){return P(this.view,D(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&S(this.view,i)}),t.applyConstraints||(this.view.state.cameraController=new M({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:t,stage:i}=this.view;if(!e||!t||!i||i.destroyed||i.destroying)return;this._windowDevicePixelRatio=window.devicePixelRatio;const r=this._computeCanvasSize();if(0!==r.width&&0!==r.height&&(t.width===r.width&&t.height===r.height||(t.width=r.width,t.height=r.height),this.view.state)){const e=this.view.state.camera;e.fullWidth===r.width&&e.fullHeight===r.height&&e.pixelRatio===r.pixelRatio||(X.copyFrom(e),X.pixelRatio!==r.pixelRatio&&(this._paddingToArray(this.padding,r.pixelRatio,Y),X.padding=Y),X.fullWidth=r.width,X.fullHeight=r.height,X.pixelRatio=r.pixelRatio,this.view.state.camera=X),this._updateState()}}_updateElevation(e){const t=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,i=this.view.basemapTerrain?.spatialReference,r=i?b(this.view,e.eye):0;e.relativeElevation=t-r}_updateState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=0:this.view.interacting?this.view.state.mode=1:(0===this.view.state.mode&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=1:this.view.state.mode=2),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateState())}};e([m({type:t,dependsOn:["view.state.camera","ready"]})],q.prototype,"camera",null),e([m({type:t,dependsOn:["view.state.contentCamera","ready"]})],q.prototype,"contentCamera",null),e([m({type:y})],q.prototype,"center",null),e([m()],q.prototype,"visibleArea",null),e([m({type:_})],q.prototype,"extent",null),e([m({readOnly:!0})],q.prototype,"frustum",null),e([m()],q.prototype,"_constraintsManager",void 0),e([m({readOnly:!0})],q.prototype,"constraintsManager",null),e([m()],q.prototype,"_initialViewpoint",null),e([m({readOnly:!0})],q.prototype,"hasInitialView",null),e([m({readOnly:!0,type:Boolean})],q.prototype,"ready",void 0),e([m({type:Number})],q.prototype,"scale",null),e([m()],q.prototype,"padding",null),e([m({readOnly:!0})],q.prototype,"screenCenter",null),e([m({constructOnly:!0})],q.prototype,"view",void 0),e([m({type:i})],q.prototype,"viewpoint",null),e([m({type:Number})],q.prototype,"zoom",null),e([m({readOnly:!0})],q.prototype,"_rasterPixelRatio",null),e([m({readOnly:!0})],q.prototype,"_usePhysicalPixelRendering",null),e([m({readOnly:!0})],q.prototype,"_usePhysicalPixelRenderingAny",null),e([m()],q.prototype,"_windowDevicePixelRatio",void 0),e([m()],q.prototype,"_devicePixelRatioOverride",void 0),q=e([d("esri.views.3d.state.ViewStateManager")],q);class W{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const Z=new Set(["camera","viewpoint","extent","scale","center","zoom"]),J=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],K={heading:0,tilt:0};let Q=new t,X=new F;const Y=g(),$="pending-initial-view",ee="content-camera-reset",te=300,ie=100;function re(){Q=new t,X=new F}export{q as ViewStateManager,re as cleanupViewStateManager,ie as interactingTimeout};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../core/scheduling.js";import{createScreenPoint as p}from"../../../core/screenUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as v}from"../../../chunks/vec32.js";import{fromArray as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as w}from"../../../chunks/vec42.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import y from"../../../geometry/Extent.js";import _ from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as C,requiresLoad as x}from"../../../geometry/projectionUtils.js";import{fromRenderCamera as R,toRenderCamera as P}from"../webgl.js";import{applyAll as S}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as O,surfaceElevationBelowRenderLocation as b}from"../camera/intersectionUtils.js";import{ConstraintsManager as T}from"./ConstraintsManager.js";import{Frustum as j}from"./Frustum.js";import{GoToOperation as z}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as M}from"./controllers/SurfaceCollisionCorrectionController.js";import{toArea as I,toExtent as H,applyTiltAdjustToScale as L,scaleToZoom as B,fromExtentSync as E,getObserverForPointAtDistanceSync as V,viewScaleToCameraDistance as A,zoomToScale as U}from"../support/cameraUtils.js";import{fromCamera as k,toCameraSync as D}from"../support/viewpointUtils.js";import F from"../webgl/RenderCamera.js";import{PropertiesPool as G}from"../../support/PropertiesPool.js";import{ensureAttachmentMaxSize as N}from"../../webgl/FramebufferObject.js";let q=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=te,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,getDevicePixelRatioOverride:()=>this._devicePixelRatioOverride,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?te:0}},this._propertiesPool=new G({frustum:()=>new j(null)},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new W}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n(()=>this.view.state.events,"before-camera-change",({camera:e})=>e&&this._updateElevation(e)),o(()=>this.view.state?.camera,(e,t)=>this._cameraChangedHandler(e,t),h)]),l(()=>this.view.state?.camera,e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([c({prepare:()=>this._prepareFrame()}),o(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles($)}),n(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const t=R(this.view,this.view.state.camera,Q);return t&&e&&t.equals(e)?e:t.clone()}set camera(e){if(this._updatePropertyBeforeReady("camera",e))return;this.view.elevationProvider.enableCache(!0);const t=P(this.view,e);t?this.setStateCamera(t,{applyConstraints:!1})||a.getLogger(this).warnOnce("#camera=","There is a currently active camera controller that has priority."):a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableCache(!1)}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const t=R(this.view,this.view.state.contentCamera,Q);return t&&e&&t.equals(e)?e:t.clone()}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=P(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(ee),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=u(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(ee),this.test.contentCameraResetState.clear())}),o(()=>this.zoom,e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))}),o(()=>this.view.state.camera,e=>{const t=v(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})],ee),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?f.fromExtent(e):null}return I(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=H(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?L(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[0]/i),s=Math.round(t[1]/i),n=Math.round(t[2]/i),o=Math.round(t[3]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,Y),this.view.state.updateCamera(e=>e.padding=Y))}_paddingToArray(e,t,i){e?w(i,e.top||0,e.right||0,e.bottom||0,e.left||0):w(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return p((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?k(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e){if(!this.isCompatible(e)){const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;return void a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?B(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&N(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){return this.view?.stage?.renderer.isFeatureEnabled(8)??!1}get _usePhysicalPixelRenderingAny(){const e=this.view?.stage?.renderer;return e&&(e.isFeatureEnabled(8,2)||e.isFeatureEnabled(8,1)||e.isFeatureEnabled(8,0))}preinit(e){return!(this._isOverridden("center")&&!C(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!C(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!C(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||C(this.viewpoint.targetGeometry?.spatialReference,e)&&C(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new T({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):2===this.view.state.viewingMode&&this.addHandles(l(()=>this.view.basemapTerrain.ready,()=>{this.removeHandles($),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),$)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles($),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:!0,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new z(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(O(this.view),{applyConstraints:!1})}step(e){const t=this.view.state?.cameraController;t?.stepController&&this.view.state.updateCamera(i=>t.stepController(e,i))}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of J){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach(t=>e.add(t))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(P(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof y){const t=E(this.view,e.targetGeometry,0,.5,0);return void(null!=t&&this.setStateCamera(P(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=E(this.view,e,0,.5,0);null!=r&&this.setStateCamera(P(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&Z.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!x(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=K){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=X){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=V(this.view,r,a,e,t,1);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=E(this.view,e,t,i,1,Q);return r?P(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=A(t,e,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(U(this.view,e))}_viewpointToCamera(e){return P(this.view,D(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&S(this.view,i)}),t.applyConstraints||(this.view.state.cameraController=new M({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:t,stage:i}=this.view;if(!e||!t||!i||i.destroyed||i.destroying)return;this._windowDevicePixelRatio=window.devicePixelRatio;const r=this._computeCanvasSize();if(0!==r.width&&0!==r.height&&(t.width===r.width&&t.height===r.height||(t.width=r.width,t.height=r.height),this.view.state)){const e=this.view.state.camera;e.fullWidth===r.width&&e.fullHeight===r.height&&e.pixelRatio===r.pixelRatio||(X.copyFrom(e),X.pixelRatio!==r.pixelRatio&&(this._paddingToArray(this.padding,r.pixelRatio,Y),X.padding=Y),X.fullWidth=r.width,X.fullHeight=r.height,X.pixelRatio=r.pixelRatio,this.view.state.camera=X),this._updateState()}}_updateElevation(e){const t=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,i=this.view.basemapTerrain?.spatialReference,r=i?b(this.view,e.eye):0;e.relativeElevation=t-r}_updateState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=0:this.view.interacting?this.view.state.mode=1:(0===this.view.state.mode&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=1:this.view.state.mode=2),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateState())}};e([m({type:t,dependsOn:["view.state.camera","ready"]})],q.prototype,"camera",null),e([m({type:t,dependsOn:["view.state.contentCamera","ready"]})],q.prototype,"contentCamera",null),e([m({type:_})],q.prototype,"center",null),e([m()],q.prototype,"visibleArea",null),e([m({type:y})],q.prototype,"extent",null),e([m({readOnly:!0})],q.prototype,"frustum",null),e([m()],q.prototype,"_constraintsManager",void 0),e([m({readOnly:!0})],q.prototype,"constraintsManager",null),e([m()],q.prototype,"_initialViewpoint",null),e([m({readOnly:!0})],q.prototype,"hasInitialView",null),e([m({readOnly:!0,type:Boolean})],q.prototype,"ready",void 0),e([m({type:Number})],q.prototype,"scale",null),e([m()],q.prototype,"padding",null),e([m({readOnly:!0})],q.prototype,"screenCenter",null),e([m({constructOnly:!0})],q.prototype,"view",void 0),e([m({type:i})],q.prototype,"viewpoint",null),e([m({type:Number})],q.prototype,"zoom",null),e([m({readOnly:!0})],q.prototype,"_rasterPixelRatio",null),e([m({readOnly:!0})],q.prototype,"_usePhysicalPixelRendering",null),e([m({readOnly:!0})],q.prototype,"_usePhysicalPixelRenderingAny",null),e([m()],q.prototype,"_windowDevicePixelRatio",void 0),e([m()],q.prototype,"_devicePixelRatioOverride",void 0),q=e([d("esri.views.3d.state.ViewStateManager")],q);class W{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const Z=new Set(["camera","viewpoint","extent","scale","center","zoom"]),J=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],K={heading:0,tilt:0};let Q=new t,X=new F;const Y=g(),$="pending-initial-view",ee="content-camera-reset",te=300,ie=100;function re(){Q=new t,X=new F}export{q as ViewStateManager,re as cleanupViewStateManager,ie as interactingTimeout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as r,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{d as m,u as h,b as c,e as _,n as p,g as u,h as l,f as d}from"../../../../chunks/vec32.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as P}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as C,fromPositionAndNormal as w,getNormal as M}from"../../../../geometry/support/plane.js";import{c as b,n as S,a as f}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as A}from"../../input/util.js";import{InteractiveController as O}from"./InteractiveController.js";import{PanPlanarMomentumController as R}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as x}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as k}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as z}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as F}from"./momentum/ZoomSphericalMomentumController.js";import{pickPointAndInitSphere as H,excludeTerrain as D,navigationMode as T,sphereOrPlanePointFromScreenPoint as U,maxPanDistanceModifier as G,minPinchAndPanCameraHeight as I,pivotSearchAreaSize as Z,intersectPlaneFromScreenPointAtEye as L,applyZoomOnSphere as V,shouldPreserveHeading as q,applyPanSphericalPreserveHeading as B,applyPanSphericalDirectRotation as J,normalizeRotationDelta as K,applyRotation as N,applyPanPlanar as Q,applyZoomToPoint as W}from"../utils/navigationUtils.js";import X from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as Y}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as $}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as tt}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as it}from"../../../navigation/ZoomMomentumEstimator.js";let et=class extends O{constructor(){super(...arguments),this._smoothRotation=new A(.05),this._rotationAxis=g(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=C(),this._beginRadius=0,this._smoothScaling=new A(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new it,this._rotationMomentumEstimator=new tt,this._panSphericalMomentumEstimator=new $,this._panPlanarMomentumEstimator=new Y,this._adjustedSphere=b(),this._tmp3d=g(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=g(),this._screenPickPoint=n(),this._scenePickPoint=g(),this._navMode=1,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=g(),this._beginCamera=new X,this._constraintOptions=new y(15,0,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),r(this._beginScreenPoint,this._screenPickPoint);const n=H(this._intersectionHelper,this.startCamera,this._screenPickPoint,P(this.view.spatialReference).radius,1,this.view.basemapTerrain.invisible?D:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),this._navMode=T(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),0===this._navMode&&this._preparePlanarPanMode(t,n.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navMode?new F({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new z({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new k({view:this.view,momentum:e,center:S(this._sphere,g()),axis:this._rotationAxis});if(1===this._navMode){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new R({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=h(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const o=n(this._screenPickPoint[0],0),r=g(),a=c(this.startCamera.eye);this._adjustedSphere[3]=a<this._sphere[3]?a-100:this._sphere[3],U(this._adjustedSphere,this.startCamera,o,r);const P=g(),v=g(),C=g();_(P,this._scenePickPoint,this.currentCamera.eye);const b=c(P);p(P,P);const S=G*Math.max(Math.abs(this.view.camera.position.z),I),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,Z);let j=null!=f?f:S;i&&(j=Math.min(j,b)),m(C,u(v,this.currentCamera.eye,l(v,P,j))),this._panningPlane[3]=-d(M(this._panningPlane),C),this.startCamera.center=u(v,this.startCamera.eye,l(v,this.startCamera.viewForward,j));const E=s(t.center,this._tmpScreenPointArray);L(this._panningPlane,this.startCamera,E,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),V(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);U(this._sphere,this.currentCamera,i,this._tmp3d),q(this._beginScenePoint,d(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(B(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(J(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=j(a(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){p(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+K(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),N(this.currentCamera,f(this._sphere),v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);L(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(Q(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=j(a(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),W(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=K(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),N(this.currentCamera,f(this._sphere),v(this._rotationAxis,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};et=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],et);export{et as PinchAndPanControllerGlobal};
|
|
5
|
+
import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as r,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{d as m,u as h,b as c,e as _,n as p,g as u,h as l,f as g}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as P}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as C,fromPositionAndNormal as w,getNormal as M}from"../../../../geometry/support/plane.js";import{c as b,n as S,a as f}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as A}from"../../input/util.js";import{InteractiveController as O}from"./InteractiveController.js";import{PanPlanarMomentumController as R}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as x}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as k}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as z}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as F}from"./momentum/ZoomSphericalMomentumController.js";import{pickPointAndInitSphere as H,excludeTerrain as D,inferNavigationMode as T,sphereOrPlanePointFromScreenPoint as U,maxPanDistanceModifier as G,minPinchAndPanCameraHeight as I,pivotSearchAreaSize as Z,intersectPlaneFromScreenPointAtEye as L,applyZoomOnSphere as V,shouldPreserveHeading as q,applyPanSphericalPreserveHeading as B,applyPanSphericalDirectRotation as J,normalizeRotationDelta as K,applyRotation as N,applyPanPlanar as Q,applyZoomToPoint as W}from"../utils/navigationUtils.js";import X from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as Y}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as $}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as tt}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as it}from"../../../navigation/ZoomMomentumEstimator.js";let et=class extends O{constructor(){super(...arguments),this._smoothRotation=new A(.05),this._rotationAxis=d(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=C(),this._beginRadius=0,this._smoothScaling=new A(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new it,this._rotationMomentumEstimator=new tt,this._panSphericalMomentumEstimator=new $,this._panPlanarMomentumEstimator=new Y,this._adjustedSphere=b(),this._tmp3d=d(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=d(),this._screenPickPoint=n(),this._scenePickPoint=d(),this._navigationMode=1,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=d(),this._beginCamera=new X,this._constraintOptions=new y(15,0,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),r(this._beginScreenPoint,this._screenPickPoint);const n=H(this._intersectionHelper,this.startCamera,this._screenPickPoint,P(this.view.spatialReference).radius,1,this.view.basemapTerrain.invisible?D:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),this._navigationMode=T(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),0===this._navigationMode&&this._preparePlanarPanMode(t,n.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navigationMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navigationMode?new F({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new z({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new k({view:this.view,momentum:e,center:S(this._sphere,d()),axis:this._rotationAxis});if(1===this._navigationMode){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new R({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=h(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const o=n(this._screenPickPoint[0],0),r=d(),a=c(this.startCamera.eye);this._adjustedSphere[3]=a<this._sphere[3]?a-100:this._sphere[3],U(this._adjustedSphere,this.startCamera,o,r);const P=d(),v=d(),C=d();_(P,this._scenePickPoint,this.currentCamera.eye);const b=c(P);p(P,P);const S=G*Math.max(Math.abs(this.view.camera.position.z),I),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,Z);let j=null!=f?f:S;i&&(j=Math.min(j,b)),m(C,u(v,this.currentCamera.eye,l(v,P,j))),this._panningPlane[3]=-g(M(this._panningPlane),C),this.startCamera.center=u(v,this.startCamera.eye,l(v,this.startCamera.viewForward,j));const E=s(t.center,this._tmpScreenPointArray);L(this._panningPlane,this.startCamera,E,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),V(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);U(this._sphere,this.currentCamera,i,this._tmp3d),q(this._beginScenePoint,g(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(B(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(J(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=j(a(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){p(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+K(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),N(this.currentCamera,f(this._sphere),v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);L(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(Q(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=j(a(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),W(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=K(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),N(this.currentCamera,f(this._sphere),v(this._rotationAxis,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};et=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],et);export{et as PinchAndPanControllerGlobal};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{u as o,d as r,f as a,e as m,b as h,n as l,h as c,g as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as
|
|
5
|
+
import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{u as o,d as r,f as a,e as m,b as h,n as l,h as c,g as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as g}from"../../../../geometry/support/axisAngle.js";import{create as d,fromNormalAndOffset as C,setOffsetFromPoint as v,negate as b,getNormal as w}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as M,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as P}from"../../input/util.js";import{getVoxelWasm as V}from"../../layers/VoxelWasm.js";import{InteractiveController as z}from"./InteractiveController.js";import{PanPlanarMomentumController as S}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as E}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as H}from"./momentum/ZoomPlanarMomentumController.js";import{excludeTerrain as y,inferNavigationMode as x,getTiltScaleFactor as O,maxPanDistanceModifier as F,minPinchAndPanCameraHeight as R,pivotSearchAreaSize as A,centroid as T,applyZoomToPoint as U,applyPanPlanar as L,normalizeRotationDelta as k,applyRotation as D,intersectPlaneFromScreenPointAtEye as G}from"../utils/navigationUtils.js";import I from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as Z}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as W}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as q}from"../../../navigation/ZoomMomentumEstimator.js";const B=u(0,0,1);let J=class extends z{constructor(){super(...arguments),this._rotationValueSmooth=new P(.05),this._scalingValueSmooth=new P(.05),this._planeHorizontal=d(),this._planeVertical=d(),this._rotationMomentumEstimator=new W,this._panMomentumEstimator=new Z(300,12,.9),this._zoomMomentumEstimator=new q,this._beginRadius=0,this._beginCenter=_(),this._beginAngle=0,this._tmpPoints=[],this._navigationMode=1,this._beginCenterScreen=i(),this._tmpCentroid3d=_(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._pointerCount=0,this._beginCamera=new I,this._constraintOptions=new j(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),C(B,0,this._planeHorizontal);const n=_(),s=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,n,this.view.basemapTerrain.invisible?y:{}),u=_();o(u,this.startCamera.viewForward);const g=_();r(g,B);const d=a(u,g);this._navigationMode=x(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);const M=O(g,this.startCamera.viewForward,F)*Math.max(Math.abs(this.view.camera.position.z),R);v(this._planeHorizontal,this._planeHorizontal,n),this.startCamera.aboveGround||b(this._planeHorizontal,this._planeHorizontal);const f=_(),j=_(),P=_();m(f,n,this.currentCamera.eye);const z=h(f);if(l(f,f),0===this._navigationMode){c(g,g,d),m(w(this._planeVertical),u,g),l(w(this._planeVertical),w(this._planeVertical)),v(this._planeVertical,this._planeVertical,n);const i=this.view.stage.renderView.getMinimalDepthForArea(V(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,A);let e=null!=i?i:M;s&&(e=Math.min(e,z)),r(P,p(j,this.currentCamera.eye,c(j,f,e))),this._planeVertical[3]=-a(w(this._planeVertical),P),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}else{const i=s?z:M;r(P,p(j,this.currentCamera.eye,c(j,f,i))),this._planeHorizontal[3]=-a(w(this._planeHorizontal),P),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=1===this._navigationMode?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),U(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=M(Math.abs(t.radius-this._beginRadius)),f(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),T(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d),L(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=M(s(this._beginCenterScreen,this._tmpCentroid2d)),f(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+k(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const r=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(r,.001*t.timestamp);const a=w(this._planeHorizontal);D(this.currentCamera,i,g(a,r)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=M(Math.abs(t.radius*r)),f(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return new H({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new E({view:this.view,momentum:e,center:this._beginCenter,axis:w(this._planeHorizontal)});const n=this._panMomentumEstimator.evaluateMomentum();return n?new S({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const s=this._tmp2d;let o=0;return t.forEach(t=>{s[0]=t.x,s[1]=t.y,void 0===n[o]&&(n[o]=_()),G(i,e,s,n[o]),o+=1}),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};J=t([n("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],J);export{J as PinchAndPanControllerLocal};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as c,e as l,b as _,n as v,g as f,h as P,f as u,i as w,t as C}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as x}from"../../layers/VoxelWasm.js";import{TiltRange as y}from"../Constraints.js";import{InteractiveController as b}from"./InteractiveController.js";import{excludeTerrain as R,normalizeCoordinate as M,getTiltScaleFactor as U,maxRotatePivotDistanceModifier as V,minRotatePivotDistance as D,
|
|
5
|
+
import{__decorate as t}from"tslib";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as c,e as l,b as _,n as v,g as f,h as P,f as u,i as w,t as C}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as x}from"../../layers/VoxelWasm.js";import{TiltRange as y}from"../Constraints.js";import{InteractiveController as b}from"./InteractiveController.js";import{excludeTerrain as R,normalizeCoordinate as M,getTiltScaleFactor as U,maxRotatePivotDistanceModifier as V,minRotatePivotDistance as D,inferNavigationMode as O,rotatePivotSearchAreaSize as T}from"../utils/navigationUtils.js";let A=class extends b{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.pivot=0,this._rotScale=0,this._lastPoint=m(),this._tmpWorldUp=d(),this._tmpViewDir=d(),this._tmpRotCurPoint=m(),this._tmpTransf=h(),this._tmpAxis=d(),this._tmpPivotPoint=d(),this._pivotPos=d(),this._constraintOptions=new j(15,2,0,this.startCamera)}initialize(){this._rotScale=0===this.pivot?3:1.5}begin(t){if(this.running){switch(this.pivot){case 1:c(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=3,this._constraintOptions.tiltMode=1,this._constraintOptions.selection=0;break;case 0:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,this.view.basemapTerrain.invisible?R:{});i||c(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(t,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=2,this._constraintOptions.tiltMode=0,this._constraintOptions.selection=11;break}}M(this.startCamera,t,this._lastPoint)}}_constrainPivotPoint(t,i){const s=this.startCamera,o=d();l(o,this._pivotPos,s.eye);const e=_(o),a=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(s.eye,S);let n=Math.max(U(S,s.viewForward,V)*a,D);i&&(n=Math.min(e,n));const h=r(s.width/s.pixelRatio*.5,s.height/s.pixelRatio*.5),p=O(this.startCamera,h,this.view.renderCoordsHelper,this.view.viewingMode);let m=this.view.stage.renderView.getMinimalDepthForArea(x(this.view),s.fullWidth/s.pixelRatio*.5,s.fullHeight/s.pixelRatio*.5,s,2.5*T,T),u=this.view.stage.renderView.getMinimalDepthForArea(x(this.view),t[0],t[1],s,T);null==m&&null==u||(m=m??u??0,u=null==u||1===p?m:u,n=m>u?u:m,n=i?Math.min(n,e):n),v(o,o),c(this._pivotPos,f(this._tmpPivotPoint,s.eye,P(this._tmpPivotPoint,o,n)))}update(t){if(this.running){switch(this.pivot){case 1:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this._pivotPos);break;case 0:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this._pivotPos)}g(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.running&&this.finishController()}_applyRotation(t,r,o,e){this.view.renderCoordsHelper.worldUpAtPosition(e,this._tmpWorldUp),M(t,r,this._tmpRotCurPoint);let h=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,m=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;l(this._tmpViewDir,o,e);const c=_(this._tmpViewDir),v=i(u(this._tmpViewDir,this._tmpWorldUp)/c);if(1===this.pivot){h*=-.5;const t=.5*Math.PI-v,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+v,y.min,y.max)-v,w(this._tmpAxis,t.up,this._tmpViewDir),0===this.pivot&&(m=-m),a(this._tmpTransf,m,this._tmpWorldUp),n(this._tmpTransf,this._tmpTransf,h,this._tmpAxis),C(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),t.up=C(H,t.up,this._tmpTransf),f(H,e,this._tmpViewDir),p(this._lastPoint,this._tmpRotCurPoint),H}};t([o()],A.prototype,"pivot",void 0),A=t([e("esri.views.3d.state.controllers.RotateController")],A);const H=d(),S=d();export{A as RotateController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as
|
|
5
|
+
import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{n as o,e as h,b as c,h as m,g as p}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../../geometry/ellipsoidUtils.js";import{create as u,fromPoints as P}from"../../../../geometry/support/axisAngle.js";import{c as C,a as g}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as y,applyAll as d}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as R}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as v}from"./InteractiveController.js";import{normalizeCoordinate as j,pickPointAndInitSphere as D,excludeTerrain as k,inferNavigationMode as w,zoomPivotDistanceClamp as b,getTiltScaleFactor as A,maxZoomPivotDistanceModifier as M,pivotSearchAreaSize as O,distanceComparisonTolerance as x,sphereOrPlanePointFromScreenPoint as U,applyRotation as z}from"../utils/navigationUtils.js";import{fromScreenAtEye as H}from"../../support/geometryUtils/ray.js";const B=12;let S=class extends v{constructor(){super(...arguments),this._pickPoint=_(),this._tmpP0=n(),this._panAxisAngle=u(),this._tmpRayDir=_(),this._tmpRayDirPick=_(),this._targetOnSphere=_(),this._navigationMode=1,this._tmpRay={origin:_(),direction:_()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new f(7,1,0,this.startCamera),this._sphere=C(),this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;e(this.dragBeginPoint,t),j(this.startCamera,t,this._normalizedAnchorPoint);const r=l(this.view.spatialReference),s=D(this._intersectionHelper,this.startCamera,t,r.radius,0,this.view.basemapTerrain.invisible?k:{});if(this._navigationMode=w(this.startCamera,t,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode)this._hasPickPoint=!!s.scenePickPoint,this._pickPoint=s.scenePickPoint??this._pickPoint,this._sphere=s.sphere;else{let r;H(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=s.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,s.scenePickPoint),r=c(this._tmpRayDirPick));const e=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,G);const a=i(A(G,this._tmpRay.direction,M)*e,b[0],b[1]),n=this.view.stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,O);let _=null!=n?n:a;null!=r&&(_=Math.min(_,r)),this._hasPickPoint=!0,m(this._tmpRay.direction,this._tmpRay.direction,_),p(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.running){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,1===this._navigationMode){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);j(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*B;let s=i*2**r;const e=this.view.state.constraints.minimumPoiDistance;if(r<0&&s<e&&(s=e),Math.abs(i-s)<x)return;if(this._hasPickPoint&&s<i){const t=1-(1-s/i)*(1-this._sphere[3]/c(this.currentCamera.center));this.currentCamera.center=m(F,this.currentCamera.center,t)}m(this._tmpRayDir,this._tmpRayDir,-s/i),this.currentCamera.eye=p(F,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=y(a(this.dragBeginPoint,t)),d(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(U(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),P(this._pickPoint,this._targetOnSphere,this._panAxisAngle),z(this.currentCamera,g(this._sphere),this._panAxisAngle))}else{const i=c(this._tmpRay.direction);j(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*B;let s=i*2**r;const e=this.view.state.constraints.minimumPoiDistance;if(r<0&&s<e&&(s=e),Math.abs(i-s)<x)return;m(this._tmpRayDir,this._tmpRay.direction,1-s/i),this.currentCamera.eye=p(F,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=p(F,this.currentCamera.center,this._tmpRayDir),o(this._tmpRayDir,this._tmpRayDir),this._constraintOptions.interactionDirection=this._tmpRayDir,d(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}R(this.view,this.currentCamera),this.commitCamera()}}finish(){this.running&&this.finishController()}};S=t([s("esri.views.3d.state.controllers.ZoomControllerGlobal")],S);const F=_(),G=_();export{S as ZoomControllerGlobal};
|