@arcgis/core 4.33.0-next.20250521 → 4.33.0-next.20250523
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/Map.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/DimensionAnalysis.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/analysis/ViewshedAnalysis.js +1 -1
- package/applications/Components/analysisUtils.d.ts +2 -0
- package/applications/Components/analysisUtils.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{253bcc3cc7bc4c2dc6ea.js → 03db109e9b695528c35d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f74f8ed3f17713a208c3.js → 07e58dff44fcbb3b3539.js} +1 -1
- package/assets/esri/core/workers/chunks/09da6b3085fc84cd69d5.js +1 -0
- package/assets/esri/core/workers/chunks/09f76ca9b47b465c934f.js +1 -0
- package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +1 -0
- package/assets/esri/core/workers/chunks/0b70b2ee62904318a12c.js +1 -0
- package/assets/esri/core/workers/chunks/0dcab04dd1feeb5521cf.js +1 -0
- package/assets/esri/core/workers/chunks/{8a2cee726b7843c7408a.js → 0fb5de3f8a4d69b2d514.js} +1 -1
- package/assets/esri/core/workers/chunks/0fd826e7f64a37aaaa1e.js +1 -0
- package/assets/esri/core/workers/chunks/28b1819bf744ce957dfd.js +2 -0
- package/assets/esri/core/workers/chunks/28b1819bf744ce957dfd.js.LICENSE.txt +33 -0
- package/assets/esri/core/workers/chunks/{7c819b3e6d69c526f4b2.js → 28e31ac00dc95a1318e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{234117cc5cb7c6863313.js → 2d90806faa4269828948.js} +1 -1
- package/assets/esri/core/workers/chunks/{b53a7040a71b0f1f3854.js → 330f1996cfc3e9c952cc.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d23610475c85385fbff.js → 355e6bcdb401ada71f39.js} +1 -1
- package/assets/esri/core/workers/chunks/{bba6d7615d8f3862fe70.js → 36f0046ff6b46adce7b7.js} +1 -1
- package/assets/esri/core/workers/chunks/397b15d46f22718c9f38.js +1 -0
- package/assets/esri/core/workers/chunks/{b0522dffa5600345c07e.js → 3e85e63148b5e93d3074.js} +1 -1
- package/assets/esri/core/workers/chunks/40f54c4f8ae63c6f3df9.js +1 -0
- package/assets/esri/core/workers/chunks/4193c52799aa3b6337c9.js +2 -0
- package/assets/esri/core/workers/chunks/{9588328d4ed6b0f04166.js.LICENSE.txt → 4193c52799aa3b6337c9.js.LICENSE.txt} +0 -34
- package/assets/esri/core/workers/chunks/{14b3c18581b31c93af82.js → 41cbba9b286cf5558a9c.js} +1 -1
- package/assets/esri/core/workers/chunks/42bb9bb6fe44a47d9b81.js +1 -0
- package/assets/esri/core/workers/chunks/4dd0a5f327fa5fc7249d.js +1 -0
- package/assets/esri/core/workers/chunks/{e2cada6644c49b1b6e79.js → 51ba7345c31e6eb79060.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a6aac37b3133de74cce.js → 51c31e6d014005107d42.js} +1 -1
- package/assets/esri/core/workers/chunks/{66e79aa02b3aa12b3778.js → 5200be8bce60fa831026.js} +1 -1
- package/assets/esri/core/workers/chunks/{6b23ca6570357f9fb724.js → 52a57106a41b8c9483d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{585c7b485c42555ec554.js → 61f9747c960d959b571b.js} +2 -2
- package/assets/esri/core/workers/chunks/{9fc35ec8185beba96715.js → 632d1a1287dde980479e.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c8d52b72a3bea4202ac.js → 634a418310e44e2436e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{1d043965dcdc11b3aeaa.js → 63852887b3f07d50f7c9.js} +1 -1
- package/assets/esri/core/workers/chunks/{c16e0da7a19310c71e8b.js → 677af0281e4fc9f3bd98.js} +1 -1
- package/assets/esri/core/workers/chunks/{6ecc3a3737ae8622dfa4.js → 7b12607633bbdc318936.js} +1 -1
- package/assets/esri/core/workers/chunks/{83fcc6f770ad084b8ab9.js → 86023cc5ccbc7ac43479.js} +1 -1
- package/assets/esri/core/workers/chunks/{d839a237d5edc243d645.js → 8aa8f9986b966ccb64e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{12e99071f6582f6caeaf.js → 8b3d1973eb75b81b0fb4.js} +1 -1
- package/assets/esri/core/workers/chunks/{67338948e470c1251d8a.js → 8d14e957219364a81d5f.js} +3 -3
- package/assets/esri/core/workers/chunks/92a5dccb328229a9336b.js +1 -0
- package/assets/esri/core/workers/chunks/{631205dc4d73d49ec9ed.js → 95507ff0a243e451b99e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1051a5a57b2fb843a555.js → 9cd55043f3d789f41815.js} +1 -1
- package/assets/esri/core/workers/chunks/{2b1486a466760d2152f5.js → a0f2df8ca7cd14bfa013.js} +1 -1
- package/assets/esri/core/workers/chunks/{06eb4832b6c86744e52e.js → aba19485b6cdcb70dac6.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc4a6f4000cb6680be48.js → ac2607f1e8cd2e99907c.js} +2 -2
- package/assets/esri/core/workers/chunks/{9a06476b834584d00d5c.js → b160dcbea6256e0cf689.js} +1 -1
- package/assets/esri/core/workers/chunks/b2a6afa0cd537805b4b8.js +1 -0
- package/assets/esri/core/workers/chunks/{571252c9822d73cf7b01.js → b845586219f284a215b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{97c148adf0347c69a79c.js → c9604f8df909ec4fad46.js} +1 -1
- package/assets/esri/core/workers/chunks/{b87fec1753f164c845c5.js → ca76950d81ab4ebb65e1.js} +1 -1
- package/assets/esri/core/workers/chunks/{faa40ef04604c7cce706.js → cb63ea6a53d3c2fc3179.js} +1 -1
- package/assets/esri/core/workers/chunks/{55f087bca75c3f2a4515.js → d3c0d7799c92c6f0e7d3.js} +1 -1
- package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +1 -0
- package/assets/esri/core/workers/chunks/{ca60b34c3e1ed2ff5934.js → dd2b316baae02bbdddac.js} +1 -1
- package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +1 -0
- package/assets/esri/core/workers/chunks/e77371ddbaf4b2d9be8d.js +1 -0
- package/assets/esri/core/workers/chunks/{80b596496800e8d60eb8.js → ed75e0962358523f4439.js} +1 -1
- package/assets/esri/core/workers/chunks/{19a58adc75a34f84b0ef.js → ee6240636d04d7d37b7b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0cf979a093e9744d1e80.js → ef7955a2509be0f03ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/{b5d68d8460b7c15001dd.js → f1c6df5cf2ccb6ac47a1.js} +1 -1
- package/assets/esri/core/workers/chunks/{523046e04679e301797d.js → f3d97a4c4f433adbdab5.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c29a768f02dc7ce0ed6.js → fb9e9b9e567e32f37042.js} +1 -1
- package/assets/esri/themes/base/widgets/_Editor.scss +41 -2
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +4 -0
- package/assets/esri/themes/base/widgets/_SelectionList.scss +21 -15
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +1 -0
- 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/interactive/tooltip/t9n/Tooltip_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor.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_en.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/FeatureForm/t9n/FeatureForm.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_en.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_no.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/assets/esri/widgets/Home/t9n/Home_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.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_en.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/chunks/ComponentShader.glsl.js +24 -15
- package/chunks/FocusAreaColor.glsl.js +10 -8
- package/chunks/persistableUrlUtils.js +1 -1
- package/core/accessorSupport/decorators/persistable.js +1 -1
- package/core/sanitizerUtils.js +5 -0
- package/editing/sharedTemplates/SharedTemplate.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/GroupTemplatePart.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/PresetTemplatePart.js +1 -1
- package/geometry/projection/projectPointToVector.js +1 -1
- package/geometry/projection/projectVectorToPoint.js +1 -1
- package/geometry/projection/projectVectorToVector.js +1 -1
- package/geometry/projection.js +1 -1
- package/geometry/projectionUtils.js +5 -0
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/geometry/support/meshUtils/extent.js +1 -1
- package/interfaces.d.ts +436 -80
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/CornersGeoreference.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/ExtentAndRotationGeoreference.js +1 -1
- package/layers/support/GeoreferenceBase.js +1 -1
- package/layers/support/LocalMediaElementSource.js +1 -1
- package/layers/support/MediaElementView.js +1 -1
- package/layers/support/PolygonCollection.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/rasterFunctions/clipUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/libs/maquette/projection.js +1 -1
- package/networks/UnitIdentifierManager.js +5 -0
- package/networks/support/UNTraceConfiguration.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/webScene.js +1 -1
- package/portal/support/portalItemUtils.js +1 -1
- package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +4 -0
- package/rest/knowledgeGraphService.d.ts +2 -0
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
- package/rest/query/executeQuery.js +1 -1
- package/rest/query/executeQueryJSON.js +1 -1
- package/rest/query/executeQueryPBF.js +1 -1
- package/rest/query.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.d.ts +4 -0
- package/smartMapping/renderers/support/spikeUtils.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/statistics/summaryStatistics.js +1 -1
- package/support/persistableUrlUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/LabelManager.js +1 -1
- package/views/2d/ViewStateManager.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/engine/imagery/RasterBitmap.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/core.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/support/projectionUtils.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/support/Segment.js +1 -1
- package/views/3d/layers/FeatureLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/focusAreaStyle.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/enums.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/FeatureTileFetcher3DDebugger.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaEffect.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/RenderSlot.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +1 -1
- package/views/FocusArea.js +1 -1
- package/views/FocusAreaOutline.js +1 -1
- package/views/FocusAreas.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/snapping/GridSnappingEngine.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/geodesicAreaMeasurementUtils.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/views/ui/UI.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/support/analysisUtils.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.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/Upload.js +1 -1
- package/widgets/Editor/VisibleElements.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/css.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/TextElementInput.js +1 -1
- package/widgets/FeatureForm/css.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
- package/widgets/FeatureTable/support/exportUtils.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.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/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationAction.js +5 -0
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +5 -0
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/VisibleElements.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/widgets/support/tests.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0c50ee1f3cdd30d96479.js +0 -1
- package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +0 -1
- package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +0 -1
- package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +0 -1
- package/assets/esri/core/workers/chunks/5f4ca51b82daf0e51010.js +0 -1
- package/assets/esri/core/workers/chunks/6d1e1a4fcb90ea8b6848.js +0 -1
- package/assets/esri/core/workers/chunks/7e6141b5baae47682f97.js +0 -1
- package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +0 -1
- package/assets/esri/core/workers/chunks/8fda0a5b247385e68dc0.js +0 -1
- package/assets/esri/core/workers/chunks/938f1eebc48871be64e9.js +0 -1
- package/assets/esri/core/workers/chunks/9588328d4ed6b0f04166.js +0 -2
- package/assets/esri/core/workers/chunks/9839309d0cd804fe52c2.js +0 -1
- package/assets/esri/core/workers/chunks/9b610fbfcd47c3dde34d.js +0 -1
- package/assets/esri/core/workers/chunks/be2c8c0a8b2bce7979b6.js +0 -1
- package/assets/esri/core/workers/chunks/f218a190015de1444018.js +0 -1
- package/assets/esri/core/workers/chunks/f9567108862629f25c8b.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{rad2deg as o}from"../core/mathUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{on as n,sync as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{rad2deg as o}from"../core/mathUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{on as n,sync as l}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{persistable as f}from"../core/accessorSupport/decorators/persistable.js";import{d,f as h,t as u,c as y,A as x,z as g,a as v}from"../chunks/vec32.js";import{fromValues as j,create as S}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as b}from"../geometry/ellipsoidUtils.js";import _ from"../geometry/Extent.js";import A from"../geometry/SpatialReference.js";import{projectBuffer as w}from"../geometry/projection/projectBuffer.js";import L from"./Layer.js";import{APIKeyMixin as M}from"./mixins/APIKeyMixin.js";import{ArcGISService as E}from"./mixins/ArcGISService.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as U}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as N,url as O}from"./support/commonProperties.js";import z from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as D,elevationModeRequiredMessage as P,featureExpressionUnsupportedMessage as V}from"../support/elevationInfoUtils.js";import{f as k}from"../chunks/persistableUrlUtils.js";let X=class extends(E(T(R(U(s(I(M(L)))))))){readModifications(e,t,i){this._modificationsSource={url:k(e,i),context:i}}initialize(){this.addHandles(n((()=>this.modifications),"after-changes",(()=>this.modifications=this.modifications),l))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new A({wkid:4326,vcsWkid:115700}),this.fullExtent=new _(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this.rootTilesetJSON=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}_verifyArray(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(const i of e)if("number"!=typeof i)return!1;return!0}_initFullExtent(){const e=this.rootTilesetJSON?.root?.boundingVolume;if(!e)return;if(e.box){const t=e?.box;if(t[3]>7972671&&t[7]>7972671&&t[11]>7945940)return}const t=this.rootTilesetJSON?.root?.transform,i=S();if(e.region&&this._verifyArray(e.region,6)){const t=e.region,i=o(t[0]),r=o(t[1]),s=t[4],a=o(t[2]),n=o(t[3]),l=t[5];this.fullExtent=new _({xmin:i,ymin:r,zmin:s,xmax:a,ymax:n,zmax:l,spatialReference:this.spatialReference})}else if(e.sphere&&this._verifyArray(e.sphere,4)){const r=e.sphere,o=j(r[0],r[1],r[2]),s=r[3]/Math.sqrt(3),a=S();d(a,o,j(s,s,s));const n=S();if(h(n,o,j(s,s,s)),t&&this._verifyArray(t,16)){const e=t;u(i,a,e),y(a,i),u(i,n,e),y(n,i)}w(a,b,0,a,A.WGS84,0),w(n,b,0,n,A.WGS84,0);const l=S(),m=S();x(l,a,n),g(m,a,n),this.fullExtent=new _({xmin:l[0],ymin:l[1],zmin:l[2],xmax:m[0],ymax:m[1],zmax:m[2],spatialReference:this.spatialReference})}else if(e.box&&this._verifyArray(e.box,12)){const i=e.box,r=j(i[0],i[1],i[2]),o=j(i[3],i[4],i[5]),s=j(i[6],i[7],i[8]),a=j(i[9],i[10],i[11]),n=[];for(let e=0;e<8;++e)n.push(S());if(h(n[0],r,o),h(n[0],n[0],s),h(n[0],n[0],a),v(n[1],r,o),h(n[1],n[1],s),h(n[1],n[1],a),h(n[2],r,o),v(n[2],n[2],s),h(n[2],n[2],a),v(n[3],r,o),v(n[3],n[3],s),h(n[3],n[3],a),h(n[4],r,o),h(n[4],n[4],s),v(n[4],n[4],a),v(n[5],r,o),h(n[5],n[5],s),v(n[5],n[5],a),h(n[6],r,o),v(n[6],n[6],s),v(n[6],n[6],a),v(n[7],r,o),v(n[7],n[7],s),v(n[7],n[7],a),t&&this._verifyArray(t,16)){const e=t;for(let t=0;t<8;++t)u(n[t],n[t],e)}const l=j(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),m=j(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<8;++e)w(n[e],b,0,n[e],A.WGS84,0),x(m,m,n[e]),g(l,l,n[e]);this.fullExtent=new _({xmin:m[0],ymin:m[1],zmin:m[2],xmax:l[0],ymax:l[1],zmax:l[2],spatialReference:this.spatialReference})}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){a(o)}if(null!=this._modificationsSource){const t=await z.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then((e=>{this.rootTilesetJSON=e.data,this._initFullExtent()}),(e=>{a(e)}));await e}}beforeSave(){if(null!=this._modificationsSource)return this.load().then((()=>{}),(()=>{}))}async fetchAttributionData(){return this.load().then((()=>({})))}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";D(r.getLogger(this),P(t,"absolute-height",e)),D(r.getLogger(this),V(t,e))}};e([m({type:["IntegratedMesh3DTilesLayer"]})],X.prototype,"operationalLayerType",void 0),e([m({type:z,clonable:e=>e.clone()}),f({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],X.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],X.prototype,"readModifications",null),e([m({type:A})],X.prototype,"spatialReference",void 0),e([m({type:_})],X.prototype,"fullExtent",void 0),e([m(N)],X.prototype,"elevationInfo",null),e([m({type:["show","hide"]})],X.prototype,"listMode",void 0),e([m(O)],X.prototype,"url",void 0),e([m({readOnly:!0})],X.prototype,"type",void 0),e([m({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],X.prototype,"path",void 0),e([m({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],X.prototype,"minScale",void 0),e([m({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],X.prototype,"maxScale",void 0),X=e([c("esri.layers.IntegratedMesh3DTilesLayer")],X);const G=X;export{G as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as r}from"../core/promiseUtils.js";import{on as s,sync as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import l from"./Layer.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{PortalLayer as u}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{SceneService as g,SaveOperationType as S}from"./mixins/SceneService.js";import{elevationInfo as j}from"./support/commonProperties.js";import{I3SNodePageDefinition as w,I3SMaterialDefinition as x,I3STextureSetDefinition as L,I3SGeometryDefinition as _}from"./support/I3SLayerDefinitions.js";import I from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as r}from"../core/promiseUtils.js";import{on as s,sync as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import l from"./Layer.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{PortalLayer as u}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{SceneService as g,SaveOperationType as S}from"./mixins/SceneService.js";import{elevationInfo as j}from"./support/commonProperties.js";import{I3SNodePageDefinition as w,I3SMaterialDefinition as x,I3STextureSetDefinition as L,I3SGeometryDefinition as _}from"./support/I3SLayerDefinitions.js";import I from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as b,featureExpressionUnsupportedMessage as M}from"../support/elevationInfoUtils.js";import{f as O}from"../chunks/persistableUrlUtils.js";let A=class extends(g(y(f(u(v(i(h(c(l))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(s((()=>this.modifications),"after-changes",(()=>this.modifications=this.modifications),n))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:O(e,o),context:o}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){r(o)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await I.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then((()=>{}),(()=>{}))}async saveAs(e,t){return this._debouncedSaveOperations(S.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(S.SAVE,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new t("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new t("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new t("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";T(o.getLogger(this),b(t,"absolute-height",e)),T(o.getLogger(this),M(t,e))}};e([a({type:String,readOnly:!0})],A.prototype,"geometryType",void 0),e([a({type:["show","hide"]})],A.prototype,"listMode",void 0),e([a({type:["IntegratedMeshLayer"]})],A.prototype,"operationalLayerType",void 0),e([a({json:{read:!1},readOnly:!0})],A.prototype,"type",void 0),e([a({type:w,readOnly:!0})],A.prototype,"nodePages",void 0),e([a({type:[x],readOnly:!0})],A.prototype,"materialDefinitions",void 0),e([a({type:[L],readOnly:!0})],A.prototype,"textureSetDefinitions",void 0),e([a({type:[_],readOnly:!0})],A.prototype,"geometryDefinitions",void 0),e([a({readOnly:!0})],A.prototype,"serviceUpdateTimeStamp",void 0),e([a({type:I,clonable:e=>e.clone()}),d({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],A.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],A.prototype,"readModifications",null),e([a(j)],A.prototype,"elevationInfo",null),e([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),A=e([m("esri.layers.IntegratedMeshLayer")],A);const P=A;export{P as default};
|
package/layers/MapNotesLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import r from"../core/Collection.js";import o from"../core/Error.js";import{clone as i}from"../core/lang.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as a}from"../core/object.js";import n from"../core/Warning.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import u from"../geometry/Extent.js";import{projectOrLoad as c,canProjectWithoutEngine as f,isLoaded as d,load as g,project as b}from"../geometry/projection.js";import S from"../geometry/SpatialReference.js";import{empty as h,expand as O,equals as w,toExtent as j,negativeInfinity as N}from"../geometry/support/aaBoundingRect.js";import{normalizeCentralMeridian as L}from"../geometry/support/normalizeUtils.js";import{equals as x}from"../geometry/support/spatialReferenceUtils.js";import J from"./FeatureLayer.js";import v from"./GraphicsLayer.js";import T from"./Layer.js";import{findLastObjectIdFromFeatures as C}from"./graphics/objectIdUtils.js";import{BlendLayer as M}from"./mixins/BlendLayer.js";import{OperationalLayer as I}from"./mixins/OperationalLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import D from"./support/Field.js";import _ from"../symbols/SimpleFillSymbol.js";import G from"../symbols/SimpleLineSymbol.js";import P from"../symbols/SimpleMarkerSymbol.js";import F from"../symbols/TextSymbol.js";function B(e){return"markup"===e.featureCollectionType||e.layers.some((e=>null!=e.layerDefinition.visibilityField||!k(e)))}function k({layerDefinition:e,featureSet:t}){const r=e.geometryType??t.geometryType;return $.find((t=>r===t.geometryTypeJSON&&e.drawingInfo?.renderer?.symbol?.type===t.identifyingSymbol.type))}function z(){return new u({xmin:-180,ymin:-90,xmax:180,ymax:90})}const U=new D({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),W=new D({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let A=class extends v{constructor(e){super(e),this.visibilityMode="inherited"}initialize(){for(const e of this.graphics)e.sourceLayer=this.layer;this.graphics.on("after-add",(e=>{e.item.sourceLayer=this.layer})),this.graphics.on("after-remove",(e=>{e.item.sourceLayer=null}))}get fullExtent(){const e=this.layer?.spatialReference,t=this.fullBounds;return e?null==t?c(z(),e).geometry:j(t,e):null}get fullBounds(){const e=this.layer?.spatialReference;if(!e)return null;const t=h();return this.graphics.forEach((r=>{const o=null!=r.geometry?c(r.geometry,e).geometry:null;null!=o&&O(t,"point"===o.type?o:o.extent,t)})),w(t,N)?null:t}get sublayers(){return this.graphics}};e([s({readOnly:!0})],A.prototype,"fullExtent",null),e([s({readOnly:!0})],A.prototype,"fullBounds",null),e([s({readOnly:!0})],A.prototype,"sublayers",null),e([s()],A.prototype,"layer",void 0),e([s()],A.prototype,"layerId",void 0),e([s({readOnly:!0})],A.prototype,"visibilityMode",void 0),A=e([y("esri.layers.MapNotesLayer.MapNotesSublayer")],A);const $=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:(new _).toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:(new G).toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:(new P).toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:(new P).toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:(new F).toJSON()}];let q=class extends(M(E(I(R(l(T)))))){constructor(e){super(e),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=S.WGS84,this.sublayers=new r($.map((e=>new A({id:e.id,layerId:e.layerId,title:e.title,layer:this})))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(e,t,r){return{operations:{supportsMapNotesEditing:!B(t)&&"portal-item"!==r?.origin}}}readFeatureCollections(e,t,o){if(!B(t))return null;const i=t.layers.map((e=>{const t=new J;return t.read(e,o),t}));return new r({items:i})}readLegacyfeatureCollectionJSON(e,t){return B(t)?i(t.featureCollection):null}get fullExtent(){const e=this.spatialReference,t=h();if(null!=this.sublayers)this.sublayers.forEach((({fullBounds:e})=>null!=e?O(t,e,t):t),t);else if(this.featureCollectionJSON?.layers.some((e=>e.layerDefinition.extent))){this.featureCollectionJSON.layers.forEach((r=>{const o=c(r.layerDefinition.extent,e).geometry;null!=o&&O(t,o,t)}))}return w(t,N)?c(z(),e).geometry:j(t,e)}readMinScale(e,t){for(const r of t.layers)if(null!=r.layerDefinition.minScale)return r.layerDefinition.minScale;return 0}readMaxScale(e,t){for(const r of t.layers)if(null!=r.layerDefinition.maxScale)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(e,t){return t.layers.length?S.fromJSON(t.layers[0].layerDefinition.spatialReference):S.WGS84}readSublayers(e,o,i){if(B(o))return null;const l=[];let a=o.layers.reduce(((e,t)=>Math.max(e,t.layerDefinition.id??-1)),-1)+1;for(const r of o.layers){const{layerDefinition:e,featureSet:o}=r,i=e.id??a++,n=k(r);if(null!=n){const r=new A({id:n.id,title:e.name,layerId:i,layer:this,graphics:o.features.map((({geometry:e,symbol:r,attributes:o,popupInfo:i})=>t.fromJSON({attributes:o,geometry:e,symbol:r,popupTemplate:i})))});l.push(r)}}return new r(l)}writeSublayers(e,t,r,i){const{minScale:l,maxScale:n}=this;if(null==e)return;const s=e.some((e=>e.graphics.length>0));if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new o("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const p=[];let y=this.spatialReference.toJSON();e:for(const o of e)for(const e of o.graphics)if(null!=e.geometry){y=e.geometry.spatialReference.toJSON();break e}for(const o of $){const t=e.find((e=>o.id===e.id));this._writeMapNoteSublayer(p,t,o,l,n,y,i)}a("featureCollection.layers",p,t)}get textLayer(){return this._findSublayer("textLayer")}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}read(e,t){"featureCollection"in e&&(e=i(e),Object.assign(e,e.featureCollection)),super.read(e,t)}async beforeSave(){if(null==this.sublayers)return;let e=null;const t=[];for(const o of this.sublayers)for(const r of o.graphics)if(null!=r.geometry){const o=r.geometry;e?x(o.spatialReference,e)||(f(o.spatialReference,e)||d()||await g(),r.geometry=b(o,e)):e=o.spatialReference,t.push(r)}const r=await L(t.map((e=>e.geometry)));t.forEach(((e,t)=>e.geometry=r[t]))}_findSublayer(e){return null==this.sublayers?null:this.sublayers?.find((t=>t.id===e))??null}_writeMapNoteSublayer(e,t,r,o,l,a,n){const s=[];if(null!=t){for(const e of t.graphics)this._writeMapNote(s,e,r.geometryType,n);this._normalizeObjectIds(s,U),e.push({layerDefinition:{name:t.title,drawingInfo:{renderer:{type:"simple",symbol:i(r.identifyingSymbol)}},id:t.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:l,objectIdField:"OBJECTID",fields:[U.toJSON(),W.toJSON()],spatialReference:a},featureSet:{features:s,geometryType:r.geometryTypeJSON}})}}_writeMapNote(e,t,r,o){if(null==t)return;const{geometry:i,symbol:l,popupTemplate:a}=t;if(null==i)return;if(i.type!==r)return void o?.messages?.push(new n("map-notes-layer:invalid-geometry-type",`Geometry "${i.type}" cannot be saved in "${r}" layer`,{graphic:t}));if(null==l)return void o?.messages?.push(new n("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:t}));const s={attributes:{...t.attributes},geometry:i.toJSON(),symbol:l.toJSON()};null!=a&&(s.popupInfo=a.toJSON()),e.push(s)}_normalizeObjectIds(e,t){const r=t.name;let o=C(r,e)+1;const i=new Set;for(const l of e){l.attributes||(l.attributes={});const{attributes:e}=l;(null==e[r]||i.has(e[r]))&&(e[r]=o++),i.add(e[r])}}};e([s({readOnly:!0})],q.prototype,"capabilities",void 0),e([p(["portal-item","web-map"],"capabilities",["layers"])],q.prototype,"readCapabilities",null),e([s({readOnly:!0})],q.prototype,"featureCollections",void 0),e([p(["web-map","portal-item"],"featureCollections",["layers"])],q.prototype,"readFeatureCollections",null),e([s({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],q.prototype,"featureCollectionJSON",void 0),e([p(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],q.prototype,"readLegacyfeatureCollectionJSON",null),e([s({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],q.prototype,"featureCollectionType",void 0),e([s({readOnly:!0})],q.prototype,"fullExtent",null),e([s({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:null!=this.featureCollectionJSON}}}}}}})],q.prototype,"legendEnabled",void 0),e([s({type:["show","hide","hide-children"]})],q.prototype,"listMode",void 0),e([s({type:Number,nonNullable:!0,json:{write:!1}})],q.prototype,"minScale",void 0),e([p(["web-map","portal-item"],"minScale",["layers"])],q.prototype,"readMinScale",null),e([s({type:Number,nonNullable:!0,json:{write:!1}})],q.prototype,"maxScale",void 0),e([p(["web-map","portal-item"],"maxScale",["layers"])],q.prototype,"readMaxScale",null),e([s({readOnly:!0})],q.prototype,"multipointLayer",null),e([s({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],q.prototype,"operationalLayerType",void 0),e([s({readOnly:!0})],q.prototype,"pointLayer",null),e([s({readOnly:!0})],q.prototype,"polygonLayer",null),e([s({readOnly:!0})],q.prototype,"polylineLayer",null),e([s({type:S})],q.prototype,"spatialReference",void 0),e([p(["web-map","portal-item"],"spatialReference",["layers"])],q.prototype,"readSpatialReference",null),e([s({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],q.prototype,"sublayers",void 0),e([p("web-map","sublayers",["layers"])],q.prototype,"readSublayers",null),e([m("web-map","sublayers")],q.prototype,"writeSublayers",null),e([s({readOnly:!0})],q.prototype,"textLayer",null),e([s()],q.prototype,"title",void 0),e([s({readOnly:!0,json:{read:!1}})],q.prototype,"type",void 0),q=e([y("esri.layers.MapNotesLayer")],q);const H=q;export{H as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import r from"../core/Collection.js";import o from"../core/Error.js";import{clone as i}from"../core/lang.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as a}from"../core/object.js";import n from"../core/Warning.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import u from"../geometry/Extent.js";import{projectOrLoad as c,canProjectWithoutEngine as f,isLoaded as d,load as g,project as b}from"../geometry/projectionUtils.js";import S from"../geometry/SpatialReference.js";import{empty as h,expand as O,equals as w,toExtent as j,negativeInfinity as N}from"../geometry/support/aaBoundingRect.js";import{normalizeCentralMeridian as L}from"../geometry/support/normalizeUtils.js";import{equals as x}from"../geometry/support/spatialReferenceUtils.js";import J from"./FeatureLayer.js";import v from"./GraphicsLayer.js";import T from"./Layer.js";import{findLastObjectIdFromFeatures as C}from"./graphics/objectIdUtils.js";import{BlendLayer as M}from"./mixins/BlendLayer.js";import{OperationalLayer as I}from"./mixins/OperationalLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import D from"./support/Field.js";import _ from"../symbols/SimpleFillSymbol.js";import G from"../symbols/SimpleLineSymbol.js";import P from"../symbols/SimpleMarkerSymbol.js";import F from"../symbols/TextSymbol.js";function B(e){return"markup"===e.featureCollectionType||e.layers.some((e=>null!=e.layerDefinition.visibilityField||!k(e)))}function k({layerDefinition:e,featureSet:t}){const r=e.geometryType??t.geometryType;return $.find((t=>r===t.geometryTypeJSON&&e.drawingInfo?.renderer?.symbol?.type===t.identifyingSymbol.type))}function z(){return new u({xmin:-180,ymin:-90,xmax:180,ymax:90})}const U=new D({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),W=new D({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let A=class extends v{constructor(e){super(e),this.visibilityMode="inherited"}initialize(){for(const e of this.graphics)e.sourceLayer=this.layer;this.graphics.on("after-add",(e=>{e.item.sourceLayer=this.layer})),this.graphics.on("after-remove",(e=>{e.item.sourceLayer=null}))}get fullExtent(){const e=this.layer?.spatialReference,t=this.fullBounds;return e?null==t?c(z(),e).geometry:j(t,e):null}get fullBounds(){const e=this.layer?.spatialReference;if(!e)return null;const t=h();return this.graphics.forEach((r=>{const o=null!=r.geometry?c(r.geometry,e).geometry:null;null!=o&&O(t,"point"===o.type?o:o.extent,t)})),w(t,N)?null:t}get sublayers(){return this.graphics}};e([s({readOnly:!0})],A.prototype,"fullExtent",null),e([s({readOnly:!0})],A.prototype,"fullBounds",null),e([s({readOnly:!0})],A.prototype,"sublayers",null),e([s()],A.prototype,"layer",void 0),e([s()],A.prototype,"layerId",void 0),e([s({readOnly:!0})],A.prototype,"visibilityMode",void 0),A=e([y("esri.layers.MapNotesLayer.MapNotesSublayer")],A);const $=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:(new _).toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:(new G).toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:(new P).toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:(new P).toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:(new F).toJSON()}];let q=class extends(M(E(I(R(l(T)))))){constructor(e){super(e),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=S.WGS84,this.sublayers=new r($.map((e=>new A({id:e.id,layerId:e.layerId,title:e.title,layer:this})))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(e,t,r){return{operations:{supportsMapNotesEditing:!B(t)&&"portal-item"!==r?.origin}}}readFeatureCollections(e,t,o){if(!B(t))return null;const i=t.layers.map((e=>{const t=new J;return t.read(e,o),t}));return new r({items:i})}readLegacyfeatureCollectionJSON(e,t){return B(t)?i(t.featureCollection):null}get fullExtent(){const e=this.spatialReference,t=h();if(null!=this.sublayers)this.sublayers.forEach((({fullBounds:e})=>null!=e?O(t,e,t):t),t);else if(this.featureCollectionJSON?.layers.some((e=>e.layerDefinition.extent))){this.featureCollectionJSON.layers.forEach((r=>{const o=c(r.layerDefinition.extent,e).geometry;null!=o&&O(t,o,t)}))}return w(t,N)?c(z(),e).geometry:j(t,e)}readMinScale(e,t){for(const r of t.layers)if(null!=r.layerDefinition.minScale)return r.layerDefinition.minScale;return 0}readMaxScale(e,t){for(const r of t.layers)if(null!=r.layerDefinition.maxScale)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(e,t){return t.layers.length?S.fromJSON(t.layers[0].layerDefinition.spatialReference):S.WGS84}readSublayers(e,o,i){if(B(o))return null;const l=[];let a=o.layers.reduce(((e,t)=>Math.max(e,t.layerDefinition.id??-1)),-1)+1;for(const r of o.layers){const{layerDefinition:e,featureSet:o}=r,i=e.id??a++,n=k(r);if(null!=n){const r=new A({id:n.id,title:e.name,layerId:i,layer:this,graphics:o.features.map((({geometry:e,symbol:r,attributes:o,popupInfo:i})=>t.fromJSON({attributes:o,geometry:e,symbol:r,popupTemplate:i})))});l.push(r)}}return new r(l)}writeSublayers(e,t,r,i){const{minScale:l,maxScale:n}=this;if(null==e)return;const s=e.some((e=>e.graphics.length>0));if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new o("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const p=[];let y=this.spatialReference.toJSON();e:for(const o of e)for(const e of o.graphics)if(null!=e.geometry){y=e.geometry.spatialReference.toJSON();break e}for(const o of $){const t=e.find((e=>o.id===e.id));this._writeMapNoteSublayer(p,t,o,l,n,y,i)}a("featureCollection.layers",p,t)}get textLayer(){return this._findSublayer("textLayer")}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}read(e,t){"featureCollection"in e&&(e=i(e),Object.assign(e,e.featureCollection)),super.read(e,t)}async beforeSave(){if(null==this.sublayers)return;let e=null;const t=[];for(const o of this.sublayers)for(const r of o.graphics)if(null!=r.geometry){const o=r.geometry;e?x(o.spatialReference,e)||(f(o.spatialReference,e)||d()||await g(),r.geometry=b(o,e)):e=o.spatialReference,t.push(r)}const r=await L(t.map((e=>e.geometry)));t.forEach(((e,t)=>e.geometry=r[t]))}_findSublayer(e){return null==this.sublayers?null:this.sublayers?.find((t=>t.id===e))??null}_writeMapNoteSublayer(e,t,r,o,l,a,n){const s=[];if(null!=t){for(const e of t.graphics)this._writeMapNote(s,e,r.geometryType,n);this._normalizeObjectIds(s,U),e.push({layerDefinition:{name:t.title,drawingInfo:{renderer:{type:"simple",symbol:i(r.identifyingSymbol)}},id:t.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:l,objectIdField:"OBJECTID",fields:[U.toJSON(),W.toJSON()],spatialReference:a},featureSet:{features:s,geometryType:r.geometryTypeJSON}})}}_writeMapNote(e,t,r,o){if(null==t)return;const{geometry:i,symbol:l,popupTemplate:a}=t;if(null==i)return;if(i.type!==r)return void o?.messages?.push(new n("map-notes-layer:invalid-geometry-type",`Geometry "${i.type}" cannot be saved in "${r}" layer`,{graphic:t}));if(null==l)return void o?.messages?.push(new n("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:t}));const s={attributes:{...t.attributes},geometry:i.toJSON(),symbol:l.toJSON()};null!=a&&(s.popupInfo=a.toJSON()),e.push(s)}_normalizeObjectIds(e,t){const r=t.name;let o=C(r,e)+1;const i=new Set;for(const l of e){l.attributes||(l.attributes={});const{attributes:e}=l;(null==e[r]||i.has(e[r]))&&(e[r]=o++),i.add(e[r])}}};e([s({readOnly:!0})],q.prototype,"capabilities",void 0),e([p(["portal-item","web-map"],"capabilities",["layers"])],q.prototype,"readCapabilities",null),e([s({readOnly:!0})],q.prototype,"featureCollections",void 0),e([p(["web-map","portal-item"],"featureCollections",["layers"])],q.prototype,"readFeatureCollections",null),e([s({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],q.prototype,"featureCollectionJSON",void 0),e([p(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],q.prototype,"readLegacyfeatureCollectionJSON",null),e([s({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],q.prototype,"featureCollectionType",void 0),e([s({readOnly:!0})],q.prototype,"fullExtent",null),e([s({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:null!=this.featureCollectionJSON}}}}}}})],q.prototype,"legendEnabled",void 0),e([s({type:["show","hide","hide-children"]})],q.prototype,"listMode",void 0),e([s({type:Number,nonNullable:!0,json:{write:!1}})],q.prototype,"minScale",void 0),e([p(["web-map","portal-item"],"minScale",["layers"])],q.prototype,"readMinScale",null),e([s({type:Number,nonNullable:!0,json:{write:!1}})],q.prototype,"maxScale",void 0),e([p(["web-map","portal-item"],"maxScale",["layers"])],q.prototype,"readMaxScale",null),e([s({readOnly:!0})],q.prototype,"multipointLayer",null),e([s({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],q.prototype,"operationalLayerType",void 0),e([s({readOnly:!0})],q.prototype,"pointLayer",null),e([s({readOnly:!0})],q.prototype,"polygonLayer",null),e([s({readOnly:!0})],q.prototype,"polylineLayer",null),e([s({type:S})],q.prototype,"spatialReference",void 0),e([p(["web-map","portal-item"],"spatialReference",["layers"])],q.prototype,"readSpatialReference",null),e([s({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],q.prototype,"sublayers",void 0),e([p("web-map","sublayers",["layers"])],q.prototype,"readSublayers",null),e([m("web-map","sublayers")],q.prototype,"writeSublayers",null),e([s({readOnly:!0})],q.prototype,"textLayer",null),e([s()],q.prototype,"title",void 0),e([s({readOnly:!0,json:{read:!1}})],q.prototype,"type",void 0),q=e([y("esri.layers.MapNotesLayer")],q);const H=q;export{H as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"./FeatureLayer.js";import{useViewTimeProperty as s}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as p,orientedImageryTypeMap as m,timeIntervalUnitTypeMap as l,verticalMeasurementTypeMap as d,isOrientationAccuracy as y}from"./orientedImagery/core/utils.js";import u from"../tables/AttributeTableTemplate.js";import{T as c}from"../chunks/TimeExtent.js";import{SaveOperationType as h}from"../webdoc/interfaces.js";const
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"./FeatureLayer.js";import{useViewTimeProperty as s}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as p,orientedImageryTypeMap as m,timeIntervalUnitTypeMap as l,verticalMeasurementTypeMap as d,isOrientationAccuracy as y}from"./orientedImagery/core/utils.js";import u from"../tables/AttributeTableTemplate.js";import{T as c}from"../chunks/TimeExtent.js";import{SaveOperationType as h}from"../webdoc/interfaces.js";const f=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),g=(e,t)=>!f.has(t)&&e,v=(e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function j(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function P(e,t,i,r){const{name:o,write:a,read:n}=v(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:g(a,e),read:g(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let S=class extends n{constructor(){super(...arguments),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return p(e,t,i)}async save(e){return this._debouncedSaveOperations(h.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(h.SAVE_AS,t,e)}findFirstValidLayerId(e){return e.layers?.find((e=>this.supportedSourceTypes.has(e.type)))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:u,json:{write:!1,read:!1}})],S.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:P("cameraHeading")})],S.prototype,"cameraHeading",void 0),e([o({type:Number,json:P("cameraHeight")})],S.prototype,"cameraHeight",void 0),e([o({type:Number,json:P("cameraPitch")})],S.prototype,"cameraPitch",void 0),e([o({type:Number,json:P("cameraRoll")})],S.prototype,"cameraRoll",void 0),e([o({type:Number,json:P("coveragePercent")})],S.prototype,"coveragePercent",void 0),e([o({type:String,json:P("demPathPrefix")})],S.prototype,"demPathPrefix",void 0),e([o({type:String,json:P("demPathSuffix")})],S.prototype,"demPathSuffix",void 0),e([o({type:String,json:P("depthImagePathPrefix")})],S.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:P("depthImagePathSuffix")})],S.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:P("elevationSource")})],S.prototype,"elevationSource",void 0),e([o({readOnly:!0})],S.prototype,"effectiveElevationSource",null),e([o({type:Number,json:P("farDistance")})],S.prototype,"farDistance",void 0),e([o()],S.prototype,"geometryType",void 0),e([o({type:Number,json:P("horizontalFieldOfView")})],S.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:P("horizontalMeasurementUnit")})],S.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...P("imageGeometryField"),default:"ImageGeometry"}})],S.prototype,"imageGeometryField",void 0),e([o({type:String,json:P("imagePathPrefix")})],S.prototype,"imagePathPrefix",void 0),e([o({type:String,json:P("imagePathSuffix")})],S.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...P("imageReferenceField"),default:"OIObjectID"}})],S.prototype,"imageReferenceField",void 0),e([o({type:Number,json:P("imageRotation")})],S.prototype,"imageRotation",void 0),e([o({type:Number,json:P("maximumDistance")})],S.prototype,"maximumDistance",void 0),e([o({type:Number,json:P("nearDistance")})],S.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],S.prototype,"operationalLayerType",void 0),e([o({json:{...P("orientationAccuracy",((e,t,i)=>{r(i,e.join(";"),t)}),(e=>{const t=e?.split(";")?.map(Number);return y(t)?t:[0,0,0,0,0,0,0,0,0]}),String)}})],S.prototype,"orientationAccuracy",void 0),e([o({json:{...P("orientedImageryType",m.write,m.read,m.jsonValues.slice(1))}})],S.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...P("referenceIDField"),default:"OBJECTID"}})],S.prototype,"referenceIDField",void 0),e([o({type:String,json:{...P("sequenceOrderField"),default:"SequenceOrder"}})],S.prototype,"sequenceOrderField",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],S.prototype,"type",void 0),e([o({type:l.apiValues,json:{...P("timeIntervalUnit",l.write,l.read,l.jsonValues)}})],S.prototype,"timeIntervalUnit",void 0),e([o(j(i(s)))],S.prototype,"useViewTime",void 0),e([o({type:Number,json:P("verticalFieldOfView")})],S.prototype,"verticalFieldOfView",void 0),e([o({type:d.apiValues,json:{...P("verticalMeasurementUnit",d.write,d.read,d.jsonValues)}})],S.prototype,"verticalMeasurementUnit",void 0),e([o({type:String,json:P("videoPathPrefix")})],S.prototype,"videoPathPrefix",void 0),e([o({type:String,json:P("videoPathSuffix")})],S.prototype,"videoPathSuffix",void 0),e([o({type:c,json:{origins:{"web-scene":{write:!1,read:!1}}}})],S.prototype,"visibilityTimeExtent",void 0),S=e([a("esri.layers.OrientedImageryLayer")],S);const x=S;export{x as default};
|
package/layers/RouteLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import i from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as l}from"../core/object.js";import{isAbortError as u}from"../core/promiseUtils.js";import{on as p}from"../core/reactiveUtils.js";import{convertUnit as c}from"../core/unitUtils.js";import{urlToObject as m}from"../core/urlUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import{updateOrigins as w}from"../core/accessorSupport/originUtils.js";import g from"../geometry/Extent.js";import S from"../geometry/Multipoint.js";import{initializeProjection as b,project as v}from"../geometry/projection.js";import B from"../geometry/SpatialReference.js";import{wgs84 as P}from"../geometry/support/spatialReferenceUtils.js";import I from"./Layer.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{OperationalLayer as N}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{sanitizeUrl as _}from"./support/arcgisLayerUrl.js";import L from"./support/RouteSymbols.js";import O from"../portal/Portal.js";import R from"../portal/PortalItem.js";import{typeKeyword as T}from"../portal/support/portalItemUtils.js";import{read as F}from"../renderers/support/jsonUtils.js";import{fetchServiceDescription as A}from"../rest/networkService.js";import{solve as k}from"../rest/route.js";import x from"../rest/support/DirectionLine.js";import G from"../rest/support/DirectionPoint.js";import J from"../rest/support/PointBarrier.js";import M from"../rest/support/PolygonBarrier.js";import E from"../rest/support/PolylineBarrier.js";import U from"../rest/support/RouteInfo.js";import W from"../rest/support/RouteParameters.js";import q from"../rest/support/RouteSettings.js";import V from"../rest/support/Stop.js";function Y(e){if(!e.length)return;const t=e.toArray(),r=t.map((({objectId:e})=>e)).filter((e=>null!=e));let o=Math.max(...r,0);for(const i of t)null==i.objectId&&(i.objectId=++o)}function Z(e,t){return!!e.length&&e.length===t.length&&z(e)&&z(t)}function z(e){return e.every((({objectId:e})=>null!=e))}function K(e){return e.length?e:null}function X(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:X("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:X("esriGeometryPolyline")}}}function H(e){return"layers"in e}function Q(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function $(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function ee(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.addedCost=r.addedCost,e.barrierType=r.barrierType,e.costs=r.costs,e.curbApproach=r.curbApproach,e.fullEdge=r.fullEdge,e.geometry=r.geometry,e.name=r.name,e.sideOfEdge=r.sideOfEdge,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol)}}function te(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}function re(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}function oe(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.arriveCurbApproach=r.arriveCurbApproach,e.arriveTime=r.arriveTime,e.arriveTimeOffset=r.arriveTimeOffset,e.cumulativeCosts=r.cumulativeCosts,e.cumulativeDistance=r.cumulativeDistance,e.cumulativeDuration=r.cumulativeDuration,e.curbApproach=r.curbApproach,e.departCurbApproach=r.departCurbApproach,e.departTime=r.departTime,e.departTimeOffset=r.departTimeOffset,e.distanceToNetworkInMeters=r.distanceToNetworkInMeters,e.geometry=r.geometry,e.lateDuration=r.lateDuration,e.name=r.name,e.navLatency=r.navLatency,e.posAlong=r.posAlong,e.routeName=r.routeName,e.serviceCosts=r.serviceCosts,e.serviceDistance=r.serviceDistance,e.serviceDuration=r.serviceDuration,e.sequence=r.sequence,e.sideOfEdge=r.sideOfEdge,e.snapX=r.snapX,e.snapY=r.snapY,e.snapZ=r.snapZ,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol,e.timeWindowEnd=r.timeWindowEnd,e.timeWindowStart=r.timeWindowStart,e.violations=r.violations,e.waitDuration=r.waitDuration,e.wait=r.wait)}}async function ie(e){const t=B.WGS84;return await b(e.spatialReference,t),v(e,t)}function se(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function ne(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:c(e,t,"meters")}function ae(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}const le=i.ofType(x),ue=i.ofType(G),pe=i.ofType(J),ce=i.ofType(M),me=i.ofType(E),ye=i.ofType(V);let fe=class extends(j(C(N(D(a(I)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.checksum=null,this.defaultSymbols=new L,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new pe,this.polygonBarriers=new ce,this.polylineBarriers=new me,this.routeInfo=null,this.spatialReference=B.WGS84,this.stops=new ye,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles(p((()=>this.stops),"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=i.map(((e,t)=>t)),n="web-map"===o.origin?"featureCollection.layers":"layers";l(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>x.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>G.fromGraphic(e)))}get fullExtent(){const e=new g({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:B.WGS84});if(null!=this.routeInfo?.geometry)return this.routeInfo.geometry.extent??e;if(null==this.stops)return e;const t=this.stops.filter((e=>null!=e.geometry));if(t.length<2)return e;const{spatialReference:r}=t.at(0).geometry;if(null==r)return e;const o=t.toArray().map((e=>{const t=e.geometry;return[t.x,t.y]}));return new S({points:o,spatialReference:r}).extent}readMaxScale(e,t){const r=H(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.maxScale));return o?.layerDefinition.maxScale??0}readMinScale(e,t){const r=H(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.minScale));return o?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>J.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>M.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>E.fromGraphic(e)))}readRouteInfo(e,t){return this._getNetworkFeatures(t,"RouteInfo",(e=>U.fromGraphic(e))).at(0)??null}readSpatialReference(e,t){const r=H(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return B.WGS84;const{layerDefinition:o,featureSet:i}=r[0],s=i.features[0],n=s?.geometry?.spatialReference??i.spatialReference??o.spatialReference??o.extent.spatialReference??P;return B.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>V.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return t.routeServiceUrl}set url(e){null!=e?this._set("url",_(e,n.getLogger(this))):this._set("url",t.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){null!=this.directionLines&&(this.directionLines.removeAll(),this._set("directionLines",null)),null!=this.directionPoints&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),null!=this.routeInfo&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new s("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new s("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new s("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(null==this.routeInfo)throw new s("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;await r.signIn(),r.user||await t.reload();const{itemUrl:o,itemControl:i}=t;if("admin"!==i&&"update"!==i)throw new s("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const n={messages:[],origin:"portal-item",portal:r,url:o?m(o):void 0,writtenProperties:[]},a=this.write(void 0,n);return t.extent=await ie(e),t.title=this.title,await t.update({data:a}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new s("routelayer:route-unsolved","saveAs() requires a solved route");const r=R.from(e).clone();r.extent??=await ie(this.fullExtent),r.id=null,r.portal??=O.getDefault(),r.title??=this.title,r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",T.MULTI_LAYER,"Route Layer"];const{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o.signIn();const n=t?.folder,a=this.write(void 0,i);return await o.user.addItem({item:r,folder:n,data:a}),this.portalItem=r,w(i),i.portalItem=r,r}async solve(e,t){Y(this.stops),Y(this.pointBarriers),Y(this.polylineBarriers),Y(this.polygonBarriers);const r=e?.stops??this.stops,o=e?.pointBarriers??K(this.pointBarriers),n=e?.polylineBarriers??K(this.polylineBarriers),a=e?.polygonBarriers??K(this.polygonBarriers);if(null==r)throw new s("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((Q(r)||$(r))&&r.features.length<2||i.isCollection(r)&&r.length<2)throw new s("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(i.isCollection(r))for(const i of r)i.routeName=null;const l=e?.apiKey,{checksum:p,url:c}=this,m=await this._getServiceDescription(c,l,t),y=e?.travelMode??m.defaultTravelMode,f=e?.accumulateAttributes??[];y&&(f.push(y.distanceAttributeName),y.timeAttributeName&&f.push(y.timeAttributeName));const d={accumulateAttributes:f,checksum:p,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:n,polygonBarriers:a,preserveObjectID:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!a,returnPolylineBarriers:!!n,returnRoutes:!0,returnStops:!0,stops:r},h=W.from(e??{});let w;h.set(d);try{w=await k(c,h,t)}catch(S){throw u(S)?S:new s("routelayer:failed-route-request","the routing request failed",{error:S})}const g=this._toRouteLayerSolution(w);return this._isOverridden("title")||(this.title=g.routeInfo.name??"Route"),this._populatePortalFields(g,m,h),g}update(e){const{checksum:t,directionLines:r,directionPoints:o,pointBarriers:i,polygonBarriers:s,polylineBarriers:n,routeInfo:a,stops:l}=e;Z(l,this.stops)?oe(l,this.stops):this.set({stops:l}),Z(i,this.pointBarriers)?ee(i,this.pointBarriers):this.set({pointBarriers:i}),Z(n,this.polylineBarriers)?te(n,this.polylineBarriers):this.set({polylineBarriers:n}),Z(s,this.polygonBarriers)?re(s,this.polygonBarriers):this.set({polygonBarriers:s}),this.set({checksum:t}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",a),null!=a.geometry&&(this.spatialReference=a.geometry.spatialReference)}_getNetworkFeatures(e,t,s,n){const a=H(e)?e.layers:e.featureCollection?.layers,l=a?.find((e=>e.layerDefinition.name===t));if(null==l)return new i;const{layerDefinition:u,popupInfo:p,featureSet:c}=l,m=u.drawingInfo.renderer,{features:y}=c,f=c.spatialReference??u.spatialReference??u.extent.spatialReference??P,d=m&&F(m),h=B.fromJSON(f),w=y.map((e=>{const i=r.fromJSON(e);null!=i.geometry&&null!=e.geometry&&null==e.geometry.spatialReference&&(i.geometry.spatialReference=h);const n=s(i);return n.symbol??=d?.getSymbol(i)??this._getNetworkSymbol(t),n.popupTemplate??=p&&o.fromJSON(p),n}));return n&&w.some((({symbol:e})=>!e))&&n(w),new i(w)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(null!=this._cachedServiceDescription&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await A(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||!e.length||!this.defaultSymbols.stops||e.every((({symbol:e})=>!!e)))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops,a=e.map((({sequence:e})=>e)).filter((e=>null!=e)),l=e.length===a.length;if(!this.routeInfo&&!l||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const u=Math.min(...a),p=Math.max(...a);for(const c of e)c.sequence!==u?c.sequence!==p?this.routeInfo&&"ok"!==c.status&&"not-located-on-closest"!==c.status?c.symbol=i:"waypoint"!==c.locationType?"break"!==c.locationType?c.symbol=o:c.symbol=n:c.symbol=s:c.symbol=r:c.symbol=t}_toRouteLayerSolution(e){const{checksum:t,routeResults:r}=e,o=r[0].stops?.map((e=>V.fromJSON(e.toJSON())));this._setStopSymbol(o);const i=new ye(o),s=new ce(e.polygonBarriers?.map((e=>{const t=M.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),n=new me(e.polylineBarriers?.map((e=>{const t=E.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),a=new pe(e.pointBarriers?.map((e=>{const t=J.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),l=r[0].route?.toJSON(),u=U.fromJSON(l);u.symbol=this.defaultSymbols.routeInfo;const p=new ue(r[0].directionPoints?.features.map((e=>{const t=G.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{checksum:t,directionLines:new le(r[0].directionLines?.features.map((e=>{const t=x.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:p,pointBarriers:a,polygonBarriers:s,polylineBarriers:n,routeInfo:u,stops:i}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",x.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",G.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,o,i,s){if(!e?.length)return null;const n=this.spatialReference.toJSON(),{fullExtent:a,maxScale:l,minScale:u}=this;return{featureSet:{features:e.toArray().map((e=>ae(e))),geometryType:r,spatialReference:n},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:null!=t?t.toJSON():X(r)}},extent:a.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:l,minScale:u,name:i,objectIdField:"ObjectID",spatialReference:n,title:s,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",J.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",M.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",E.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new i([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",U.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",V.fields,"Stops","Stops");if(null==e)return null;const{stops:t}=this.defaultSymbols,r=t?.first?.toJSON(),o=t?.middle?.toJSON(),i=t?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:o,uniqueValueInfos:[{value:"1",symbol:r,label:"First Stop"},{value:`${this.stops.length}`,symbol:i,label:"Last Stop"}]},e}_populatePortalFields(e,t,r){const o=t.networkDataset?.networkAttributes,i=o?.filter((({usageType:e})=>"cost"===e))??[],a=r.travelMode??t.defaultTravelMode;if(null==a)return void n.getLogger(this).warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:l,distanceAttributeName:u}=a,p=i.find((({name:e})=>e===l)),c=i.find((({name:e})=>e===u)),m=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,y=p?.units,f=c?.units;if(!y||!f)throw new s("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const d=r.directionsLanguage??t.directionsLanguage,h=r.accumulateAttributes??t.accumulateAttributeNames??[],w=new Set(i.filter((({name:e})=>e===l||e===u||e===m||null!=e&&h.includes(e))).map((({name:e})=>e))),g=e=>{for(const t in e)w.has(t)||delete e[t]};for(const s of e.pointBarriers)null!=s.costs&&(s.addedCost=s.costs[m]??0,g(s.costs));for(const s of e.polygonBarriers)null!=s.costs&&(s.scaleFactor=s.costs[m]??1,g(s.costs));for(const s of e.polylineBarriers)null!=s.costs&&(s.scaleFactor=s.costs[m]??1,g(s.costs));const{routeInfo:S}=e,{findBestSequence:b,preserveFirstStop:v,preserveLastStop:B,startTimeIsUTC:P,timeWindowsAreUTC:I}=r;S.analysisSettings=new q({accumulateAttributes:h,directionsLanguage:d,findBestSequence:b,preserveFirstStop:v,preserveLastStop:B,startTimeIsUTC:P,timeWindowsAreUTC:I,travelMode:a}),S.totalDuration=se(S.totalCosts?.[l]??0,y),S.totalDistance=ne(S.totalCosts?.[u]??0,f),S.totalLateDuration=se(S.totalViolations?.[l]??0,y),S.totalWaitDuration=se(S.totalWait?.[l]??0,y),null!=S.totalCosts&&g(S.totalCosts),null!=S.totalViolations&&g(S.totalViolations),null!=S.totalWait&&g(S.totalWait);for(const s of e.stops)null!=s.serviceCosts&&(s.serviceDuration=se(s.serviceCosts[l]??0,y),s.serviceDistance=ne(s.serviceCosts[u]??0,f),g(s.serviceCosts)),null!=s.cumulativeCosts&&(s.cumulativeDuration=se(s.cumulativeCosts[l]??0,y),s.cumulativeDistance=ne(s.cumulativeCosts[u]??0,f),g(s.cumulativeCosts)),null!=s.violations&&(s.lateDuration=se(s.violations[l]??0,y),g(s.violations)),null!=s.wait&&(s.waitDuration=se(s.wait[l]??0,y),g(s.wait))}};e([y({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],fe.prototype,"_featureCollection",void 0),e([h(["web-map","portal-item"],"_featureCollection")],fe.prototype,"writeFeatureCollectionWebmap",null),e([y({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],fe.prototype,"_type",void 0),e([y({type:String})],fe.prototype,"checksum",void 0),e([y({nonNullable:!0,type:L})],fe.prototype,"defaultSymbols",void 0),e([y({readOnly:!0})],fe.prototype,"directionLines",void 0),e([f(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],fe.prototype,"readDirectionLines",null),e([y({readOnly:!0})],fe.prototype,"directionPoints",void 0),e([f(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],fe.prototype,"readDirectionPoints",null),e([y({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],fe.prototype,"featureCollectionType",void 0),e([y({readOnly:!0})],fe.prototype,"fullExtent",null),e([y({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],fe.prototype,"legendEnabled",void 0),e([y({type:["show","hide"]})],fe.prototype,"listMode",void 0),e([y({type:Number,nonNullable:!0,json:{write:!1}})],fe.prototype,"maxScale",void 0),e([f(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],fe.prototype,"readMaxScale",null),e([y({type:Number,nonNullable:!0,json:{write:!1}})],fe.prototype,"minScale",void 0),e([f(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],fe.prototype,"readMinScale",null),e([y({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],fe.prototype,"operationalLayerType",void 0),e([y({nonNullable:!0,type:i.ofType(J)})],fe.prototype,"pointBarriers",void 0),e([f(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPointBarriers",null),e([y({nonNullable:!0,type:i.ofType(M)})],fe.prototype,"polygonBarriers",void 0),e([f(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPolygonBarriers",null),e([y({nonNullable:!0,type:i.ofType(E)})],fe.prototype,"polylineBarriers",void 0),e([f(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPolylineBarriers",null),e([y({readOnly:!0})],fe.prototype,"routeInfo",void 0),e([f(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],fe.prototype,"readRouteInfo",null),e([y({type:B})],fe.prototype,"spatialReference",void 0),e([f(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],fe.prototype,"readSpatialReference",null),e([y({nonNullable:!0,type:i.ofType(V)})],fe.prototype,"stops",void 0),e([f(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],fe.prototype,"readStops",null),e([y()],fe.prototype,"title",null),e([y({readOnly:!0,json:{read:!1}})],fe.prototype,"type",void 0),e([y()],fe.prototype,"url",null),fe=e([d("esri.layers.RouteLayer")],fe);const de=fe;export{de as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import i from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as l}from"../core/object.js";import{isAbortError as u}from"../core/promiseUtils.js";import{on as p}from"../core/reactiveUtils.js";import{convertUnit as c}from"../core/unitUtils.js";import{urlToObject as m}from"../core/urlUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import{updateOrigins as w}from"../core/accessorSupport/originUtils.js";import g from"../geometry/Extent.js";import S from"../geometry/Multipoint.js";import{initializeProjection as b,project as v}from"../geometry/projectionUtils.js";import B from"../geometry/SpatialReference.js";import{wgs84 as P}from"../geometry/support/spatialReferenceUtils.js";import I from"./Layer.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{OperationalLayer as N}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{sanitizeUrl as _}from"./support/arcgisLayerUrl.js";import L from"./support/RouteSymbols.js";import O from"../portal/Portal.js";import R from"../portal/PortalItem.js";import{typeKeyword as T}from"../portal/support/portalItemUtils.js";import{read as F}from"../renderers/support/jsonUtils.js";import{fetchServiceDescription as A}from"../rest/networkService.js";import{solve as k}from"../rest/route.js";import x from"../rest/support/DirectionLine.js";import G from"../rest/support/DirectionPoint.js";import J from"../rest/support/PointBarrier.js";import M from"../rest/support/PolygonBarrier.js";import E from"../rest/support/PolylineBarrier.js";import U from"../rest/support/RouteInfo.js";import W from"../rest/support/RouteParameters.js";import q from"../rest/support/RouteSettings.js";import V from"../rest/support/Stop.js";function Y(e){if(!e.length)return;const t=e.toArray(),r=t.map((({objectId:e})=>e)).filter((e=>null!=e));let o=Math.max(...r,0);for(const i of t)null==i.objectId&&(i.objectId=++o)}function Z(e,t){return!!e.length&&e.length===t.length&&z(e)&&z(t)}function z(e){return e.every((({objectId:e})=>null!=e))}function K(e){return e.length?e:null}function X(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:X("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:X("esriGeometryPolyline")}}}function H(e){return"layers"in e}function Q(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function $(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function ee(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.addedCost=r.addedCost,e.barrierType=r.barrierType,e.costs=r.costs,e.curbApproach=r.curbApproach,e.fullEdge=r.fullEdge,e.geometry=r.geometry,e.name=r.name,e.sideOfEdge=r.sideOfEdge,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol)}}function te(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}function re(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}function oe(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.arriveCurbApproach=r.arriveCurbApproach,e.arriveTime=r.arriveTime,e.arriveTimeOffset=r.arriveTimeOffset,e.cumulativeCosts=r.cumulativeCosts,e.cumulativeDistance=r.cumulativeDistance,e.cumulativeDuration=r.cumulativeDuration,e.curbApproach=r.curbApproach,e.departCurbApproach=r.departCurbApproach,e.departTime=r.departTime,e.departTimeOffset=r.departTimeOffset,e.distanceToNetworkInMeters=r.distanceToNetworkInMeters,e.geometry=r.geometry,e.lateDuration=r.lateDuration,e.name=r.name,e.navLatency=r.navLatency,e.posAlong=r.posAlong,e.routeName=r.routeName,e.serviceCosts=r.serviceCosts,e.serviceDistance=r.serviceDistance,e.serviceDuration=r.serviceDuration,e.sequence=r.sequence,e.sideOfEdge=r.sideOfEdge,e.snapX=r.snapX,e.snapY=r.snapY,e.snapZ=r.snapZ,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol,e.timeWindowEnd=r.timeWindowEnd,e.timeWindowStart=r.timeWindowStart,e.violations=r.violations,e.waitDuration=r.waitDuration,e.wait=r.wait)}}async function ie(e){const t=B.WGS84;return await b(e.spatialReference,t),v(e,t)}function se(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function ne(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:c(e,t,"meters")}function ae(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}const le=i.ofType(x),ue=i.ofType(G),pe=i.ofType(J),ce=i.ofType(M),me=i.ofType(E),ye=i.ofType(V);let fe=class extends(j(C(N(D(a(I)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.checksum=null,this.defaultSymbols=new L,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new pe,this.polygonBarriers=new ce,this.polylineBarriers=new me,this.routeInfo=null,this.spatialReference=B.WGS84,this.stops=new ye,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles(p((()=>this.stops),"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=i.map(((e,t)=>t)),n="web-map"===o.origin?"featureCollection.layers":"layers";l(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>x.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>G.fromGraphic(e)))}get fullExtent(){const e=new g({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:B.WGS84});if(null!=this.routeInfo?.geometry)return this.routeInfo.geometry.extent??e;if(null==this.stops)return e;const t=this.stops.filter((e=>null!=e.geometry));if(t.length<2)return e;const{spatialReference:r}=t.at(0).geometry;if(null==r)return e;const o=t.toArray().map((e=>{const t=e.geometry;return[t.x,t.y]}));return new S({points:o,spatialReference:r}).extent}readMaxScale(e,t){const r=H(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.maxScale));return o?.layerDefinition.maxScale??0}readMinScale(e,t){const r=H(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.minScale));return o?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>J.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>M.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>E.fromGraphic(e)))}readRouteInfo(e,t){return this._getNetworkFeatures(t,"RouteInfo",(e=>U.fromGraphic(e))).at(0)??null}readSpatialReference(e,t){const r=H(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return B.WGS84;const{layerDefinition:o,featureSet:i}=r[0],s=i.features[0],n=s?.geometry?.spatialReference??i.spatialReference??o.spatialReference??o.extent.spatialReference??P;return B.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>V.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return t.routeServiceUrl}set url(e){null!=e?this._set("url",_(e,n.getLogger(this))):this._set("url",t.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){null!=this.directionLines&&(this.directionLines.removeAll(),this._set("directionLines",null)),null!=this.directionPoints&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),null!=this.routeInfo&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new s("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new s("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new s("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(null==this.routeInfo)throw new s("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;await r.signIn(),r.user||await t.reload();const{itemUrl:o,itemControl:i}=t;if("admin"!==i&&"update"!==i)throw new s("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const n={messages:[],origin:"portal-item",portal:r,url:o?m(o):void 0,writtenProperties:[]},a=this.write(void 0,n);return t.extent=await ie(e),t.title=this.title,await t.update({data:a}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new s("routelayer:route-unsolved","saveAs() requires a solved route");const r=R.from(e).clone();r.extent??=await ie(this.fullExtent),r.id=null,r.portal??=O.getDefault(),r.title??=this.title,r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",T.MULTI_LAYER,"Route Layer"];const{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o.signIn();const n=t?.folder,a=this.write(void 0,i);return await o.user.addItem({item:r,folder:n,data:a}),this.portalItem=r,w(i),i.portalItem=r,r}async solve(e,t){Y(this.stops),Y(this.pointBarriers),Y(this.polylineBarriers),Y(this.polygonBarriers);const r=e?.stops??this.stops,o=e?.pointBarriers??K(this.pointBarriers),n=e?.polylineBarriers??K(this.polylineBarriers),a=e?.polygonBarriers??K(this.polygonBarriers);if(null==r)throw new s("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((Q(r)||$(r))&&r.features.length<2||i.isCollection(r)&&r.length<2)throw new s("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(i.isCollection(r))for(const i of r)i.routeName=null;const l=e?.apiKey,{checksum:p,url:c}=this,m=await this._getServiceDescription(c,l,t),y=e?.travelMode??m.defaultTravelMode,f=e?.accumulateAttributes??[];y&&(f.push(y.distanceAttributeName),y.timeAttributeName&&f.push(y.timeAttributeName));const d={accumulateAttributes:f,checksum:p,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:n,polygonBarriers:a,preserveObjectID:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!a,returnPolylineBarriers:!!n,returnRoutes:!0,returnStops:!0,stops:r},h=W.from(e??{});let w;h.set(d);try{w=await k(c,h,t)}catch(S){throw u(S)?S:new s("routelayer:failed-route-request","the routing request failed",{error:S})}const g=this._toRouteLayerSolution(w);return this._isOverridden("title")||(this.title=g.routeInfo.name??"Route"),this._populatePortalFields(g,m,h),g}update(e){const{checksum:t,directionLines:r,directionPoints:o,pointBarriers:i,polygonBarriers:s,polylineBarriers:n,routeInfo:a,stops:l}=e;Z(l,this.stops)?oe(l,this.stops):this.set({stops:l}),Z(i,this.pointBarriers)?ee(i,this.pointBarriers):this.set({pointBarriers:i}),Z(n,this.polylineBarriers)?te(n,this.polylineBarriers):this.set({polylineBarriers:n}),Z(s,this.polygonBarriers)?re(s,this.polygonBarriers):this.set({polygonBarriers:s}),this.set({checksum:t}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",a),null!=a.geometry&&(this.spatialReference=a.geometry.spatialReference)}_getNetworkFeatures(e,t,s,n){const a=H(e)?e.layers:e.featureCollection?.layers,l=a?.find((e=>e.layerDefinition.name===t));if(null==l)return new i;const{layerDefinition:u,popupInfo:p,featureSet:c}=l,m=u.drawingInfo.renderer,{features:y}=c,f=c.spatialReference??u.spatialReference??u.extent.spatialReference??P,d=m&&F(m),h=B.fromJSON(f),w=y.map((e=>{const i=r.fromJSON(e);null!=i.geometry&&null!=e.geometry&&null==e.geometry.spatialReference&&(i.geometry.spatialReference=h);const n=s(i);return n.symbol??=d?.getSymbol(i)??this._getNetworkSymbol(t),n.popupTemplate??=p&&o.fromJSON(p),n}));return n&&w.some((({symbol:e})=>!e))&&n(w),new i(w)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(null!=this._cachedServiceDescription&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await A(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||!e.length||!this.defaultSymbols.stops||e.every((({symbol:e})=>!!e)))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops,a=e.map((({sequence:e})=>e)).filter((e=>null!=e)),l=e.length===a.length;if(!this.routeInfo&&!l||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const u=Math.min(...a),p=Math.max(...a);for(const c of e)c.sequence!==u?c.sequence!==p?this.routeInfo&&"ok"!==c.status&&"not-located-on-closest"!==c.status?c.symbol=i:"waypoint"!==c.locationType?"break"!==c.locationType?c.symbol=o:c.symbol=n:c.symbol=s:c.symbol=r:c.symbol=t}_toRouteLayerSolution(e){const{checksum:t,routeResults:r}=e,o=r[0].stops?.map((e=>V.fromJSON(e.toJSON())));this._setStopSymbol(o);const i=new ye(o),s=new ce(e.polygonBarriers?.map((e=>{const t=M.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),n=new me(e.polylineBarriers?.map((e=>{const t=E.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),a=new pe(e.pointBarriers?.map((e=>{const t=J.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),l=r[0].route?.toJSON(),u=U.fromJSON(l);u.symbol=this.defaultSymbols.routeInfo;const p=new ue(r[0].directionPoints?.features.map((e=>{const t=G.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{checksum:t,directionLines:new le(r[0].directionLines?.features.map((e=>{const t=x.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:p,pointBarriers:a,polygonBarriers:s,polylineBarriers:n,routeInfo:u,stops:i}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",x.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",G.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,o,i,s){if(!e?.length)return null;const n=this.spatialReference.toJSON(),{fullExtent:a,maxScale:l,minScale:u}=this;return{featureSet:{features:e.toArray().map((e=>ae(e))),geometryType:r,spatialReference:n},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:null!=t?t.toJSON():X(r)}},extent:a.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:l,minScale:u,name:i,objectIdField:"ObjectID",spatialReference:n,title:s,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",J.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",M.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",E.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new i([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",U.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",V.fields,"Stops","Stops");if(null==e)return null;const{stops:t}=this.defaultSymbols,r=t?.first?.toJSON(),o=t?.middle?.toJSON(),i=t?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:o,uniqueValueInfos:[{value:"1",symbol:r,label:"First Stop"},{value:`${this.stops.length}`,symbol:i,label:"Last Stop"}]},e}_populatePortalFields(e,t,r){const o=t.networkDataset?.networkAttributes,i=o?.filter((({usageType:e})=>"cost"===e))??[],a=r.travelMode??t.defaultTravelMode;if(null==a)return void n.getLogger(this).warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:l,distanceAttributeName:u}=a,p=i.find((({name:e})=>e===l)),c=i.find((({name:e})=>e===u)),m=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,y=p?.units,f=c?.units;if(!y||!f)throw new s("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const d=r.directionsLanguage??t.directionsLanguage,h=r.accumulateAttributes??t.accumulateAttributeNames??[],w=new Set(i.filter((({name:e})=>e===l||e===u||e===m||null!=e&&h.includes(e))).map((({name:e})=>e))),g=e=>{for(const t in e)w.has(t)||delete e[t]};for(const s of e.pointBarriers)null!=s.costs&&(s.addedCost=s.costs[m]??0,g(s.costs));for(const s of e.polygonBarriers)null!=s.costs&&(s.scaleFactor=s.costs[m]??1,g(s.costs));for(const s of e.polylineBarriers)null!=s.costs&&(s.scaleFactor=s.costs[m]??1,g(s.costs));const{routeInfo:S}=e,{findBestSequence:b,preserveFirstStop:v,preserveLastStop:B,startTimeIsUTC:P,timeWindowsAreUTC:I}=r;S.analysisSettings=new q({accumulateAttributes:h,directionsLanguage:d,findBestSequence:b,preserveFirstStop:v,preserveLastStop:B,startTimeIsUTC:P,timeWindowsAreUTC:I,travelMode:a}),S.totalDuration=se(S.totalCosts?.[l]??0,y),S.totalDistance=ne(S.totalCosts?.[u]??0,f),S.totalLateDuration=se(S.totalViolations?.[l]??0,y),S.totalWaitDuration=se(S.totalWait?.[l]??0,y),null!=S.totalCosts&&g(S.totalCosts),null!=S.totalViolations&&g(S.totalViolations),null!=S.totalWait&&g(S.totalWait);for(const s of e.stops)null!=s.serviceCosts&&(s.serviceDuration=se(s.serviceCosts[l]??0,y),s.serviceDistance=ne(s.serviceCosts[u]??0,f),g(s.serviceCosts)),null!=s.cumulativeCosts&&(s.cumulativeDuration=se(s.cumulativeCosts[l]??0,y),s.cumulativeDistance=ne(s.cumulativeCosts[u]??0,f),g(s.cumulativeCosts)),null!=s.violations&&(s.lateDuration=se(s.violations[l]??0,y),g(s.violations)),null!=s.wait&&(s.waitDuration=se(s.wait[l]??0,y),g(s.wait))}};e([y({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],fe.prototype,"_featureCollection",void 0),e([h(["web-map","portal-item"],"_featureCollection")],fe.prototype,"writeFeatureCollectionWebmap",null),e([y({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],fe.prototype,"_type",void 0),e([y({type:String})],fe.prototype,"checksum",void 0),e([y({nonNullable:!0,type:L})],fe.prototype,"defaultSymbols",void 0),e([y({readOnly:!0})],fe.prototype,"directionLines",void 0),e([f(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],fe.prototype,"readDirectionLines",null),e([y({readOnly:!0})],fe.prototype,"directionPoints",void 0),e([f(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],fe.prototype,"readDirectionPoints",null),e([y({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],fe.prototype,"featureCollectionType",void 0),e([y({readOnly:!0})],fe.prototype,"fullExtent",null),e([y({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],fe.prototype,"legendEnabled",void 0),e([y({type:["show","hide"]})],fe.prototype,"listMode",void 0),e([y({type:Number,nonNullable:!0,json:{write:!1}})],fe.prototype,"maxScale",void 0),e([f(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],fe.prototype,"readMaxScale",null),e([y({type:Number,nonNullable:!0,json:{write:!1}})],fe.prototype,"minScale",void 0),e([f(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],fe.prototype,"readMinScale",null),e([y({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],fe.prototype,"operationalLayerType",void 0),e([y({nonNullable:!0,type:i.ofType(J)})],fe.prototype,"pointBarriers",void 0),e([f(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPointBarriers",null),e([y({nonNullable:!0,type:i.ofType(M)})],fe.prototype,"polygonBarriers",void 0),e([f(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPolygonBarriers",null),e([y({nonNullable:!0,type:i.ofType(E)})],fe.prototype,"polylineBarriers",void 0),e([f(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPolylineBarriers",null),e([y({readOnly:!0})],fe.prototype,"routeInfo",void 0),e([f(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],fe.prototype,"readRouteInfo",null),e([y({type:B})],fe.prototype,"spatialReference",void 0),e([f(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],fe.prototype,"readSpatialReference",null),e([y({nonNullable:!0,type:i.ofType(V)})],fe.prototype,"stops",void 0),e([f(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],fe.prototype,"readStops",null),e([y()],fe.prototype,"title",null),e([y({readOnly:!0,json:{read:!1}})],fe.prototype,"type",void 0),e([y()],fe.prototype,"url",null),fe=e([d("esri.layers.RouteLayer")],fe);const de=fe;export{de as default};
|
package/layers/VideoLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import l from"../core/Error.js";import i from"../core/Logger.js";import{clamp as s}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{watch as a,initial as p,whenOnce as u}from"../core/reactiveUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import c from"../geometry/Extent.js";import h from"../geometry/Polyline.js";import f from"../geometry/SpatialReference.js";import v from"./Layer.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{parse as j}from"./support/arcgisLayerUrl.js";import{url as b}from"./support/commonProperties.js";import T from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as C}from"./support/serviceCapabilitiesUtils.js";import w from"./support/TelemetryData.js";import x from"./support/TelemetryDisplay.js";import I from"./support/VideoFrame.js";import L from"./support/VideoTimeExtent.js";import U from"./video/VideoController.js";import{getFrameHorizonPoints as E,getGroundControlPoints as N,getTelemetryData as P,getServiceLayersInfo as J,getSensorTrailPoints as M,readVideoTimeExtent as R}from"./video/videoUtils.js";import k from"../symbols/SimpleFillSymbol.js";import H from"../symbols/SimpleLineSymbol.js";import V from"../symbols/SimpleMarkerSymbol.js";let z=[];const F=new t([255,127,0]),q=new t([0,0,0,.05]),D=new V({angle:0,color:F,size:10,style:"cross"}),G=new k({color:q,outline:new H({color:F,width:2})}),_=new H({color:F,width:1}),B=new V({angle:0,color:F,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),W=new H({color:F,width:1});let A=class extends(g(O(n(S(v))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new U,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=D.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=G.clone(),this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbol=B.clone(),this.sensorSightLineSymbol=_.clone(),this.sensorTrailSymbol=W.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=f.WGS84,this.start=0,this.telemetryDisplay=null,this.telemetryColor=F,this.title=null,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.telemetryDisplay=new x({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([a((()=>this.metadata),(()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")})),a((()=>this.telemetry?.sensorLocation),(e=>this._setSensorTrail(e)),p)]),u((()=>this.loaded&&"can-play"===this.state&&this.duration>0)).then((()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)}))}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._fetchService(t)),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return C(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return E(this.metadata)}get groundControlPoints(){return N(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get state(){return this.controller.state}get telemetry(){return P(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return J(t)}get videoTimeExtent(){return o(i.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=s(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const t=j(this.parsedUrl?.path);if(null==t)throw new l("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let o=null;const{data:i,ssl:s}=await r(t.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e}),n=i;if(this.url=t.url.path,s&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let a=t?.sublayer;if(null==a&&n.layers?.length&&(a=n.layers[0].id),null==a)throw new l("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${t.url.path}/${a}`,o=await r(this.url,{query:{f:"json",...this.customParameters},signal:e});const p={...n,...o.data};this.sourceJSON=p,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=M(e,z);z=[...t];const r=z.map((e=>e.toArray())),o=new h({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([y()],A.prototype,"autoplay",null),e([y({readOnly:!0})],A.prototype,"buffered",null),e([y({readOnly:!0,json:{read:!1}})],A.prototype,"capabilities",void 0),e([m("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],A.prototype,"readCapabilitiesFromService",null),e([y({readOnly:!0})],A.prototype,"codecs",void 0),e([y({readOnly:!0})],A.prototype,"connectionInfo",void 0),e([m("connectionInfo",["connectionUrl"])],A.prototype,"readConnectionInfo",null),e([y()],A.prototype,"controller",void 0),e([y({type:String})],A.prototype,"copyright",void 0),e([y({readOnly:!0,type:Date})],A.prototype,"created",void 0),e([y({type:Number})],A.prototype,"currentTime",null),e([y({type:String})],A.prototype,"description",void 0),e([y({type:Number})],A.prototype,"duration",null),e([y({readOnly:!0})],A.prototype,"elevationSource",void 0),e([y({type:Boolean})],A.prototype,"ended",null),e([y({type:I})],A.prototype,"frame",void 0),e([y()],A.prototype,"frameCenterSymbol",void 0),e([y({readOnly:!0,type:Number})],A.prototype,"frameCount",void 0),e([y()],A.prototype,"frameEffect",void 0),e([y()],A.prototype,"frameOpacity",void 0),e([y()],A.prototype,"frameOutlineSymbol",void 0),e([y({type:c})],A.prototype,"fullExtent",void 0),e([y({readOnly:!0})],A.prototype,"frameHorizonPoints",null),e([y({readOnly:!0,nonNullable:!1,json:{read:{reader:R,source:"time"}},type:L})],A.prototype,"fullTimeExtent",void 0),e([y({readOnly:!0})],A.prototype,"groundControlPoints",null),e([y({type:c})],A.prototype,"initialExtent",void 0),e([y({readOnly:!0})],A.prototype,"isLive",null),e([y({readOnly:!0,json:{read:{source:"id"}}})],A.prototype,"layerId",void 0),e([y({readOnly:!0})],A.prototype,"livestreamStatus",null),e([y({type:Boolean})],A.prototype,"loop",null),e([y({readOnly:!0})],A.prototype,"metadata",null),e([y({readOnly:!0})],A.prototype,"mimeType",null),e([y({type:Boolean})],A.prototype,"muted",null),e([y({type:T})],A.prototype,"playbackInfo",void 0),e([y({type:Number})],A.prototype,"playbackRate",null),e([y({type:String})],A.prototype,"playerUrl",null),e([y({readOnly:!0})],A.prototype,"playing",null),e([y({readOnly:!0,json:{read:{source:"poster"}}})],A.prototype,"posterUrl",void 0),e([y({readOnly:!0})],A.prototype,"qualities",void 0),e([y()],A.prototype,"sensorSymbol",void 0),e([y()],A.prototype,"sensorSightLineSymbol",void 0),e([y()],A.prototype,"sensorTrailSymbol",void 0),e([y({readOnly:!0})],A.prototype,"serviceItemId",void 0),e([y()],A.prototype,"sourceJSON",void 0),e([y({readOnly:!0})],A.prototype,"sourceQuality",void 0),e([y({readOnly:!0,json:{name:"serviceType"}})],A.prototype,"sourceType",void 0),e([y()],A.prototype,"spatialReference",void 0),e([y()],A.prototype,"start",void 0),e([y({readOnly:!0,type:String})],A.prototype,"state",null),e([y({readOnly:!0,type:w})],A.prototype,"telemetry",null),e([y({type:x})],A.prototype,"telemetryDisplay",void 0),e([y({type:t})],A.prototype,"telemetryColor",void 0),e([y({readOnly:!1,json:{read:{source:"name"}}})],A.prototype,"title",void 0),e([y({readOnly:!0})],A.prototype,"type",void 0),e([y(b)],A.prototype,"url",void 0),e([y({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],A.prototype,"version",void 0),e([y({readOnly:!0})],A.prototype,"videoElement",null),e([y({readOnly:!0})],A.prototype,"videoHeight",null),e([y({readOnly:!0,json:{read:!1}})],A.prototype,"videoLayersInfo",void 0),e([m("service","videoLayersInfo",["id","name","poster","serviceType","type"])],A.prototype,"readLayerInfosFromService",null),e([y({type:L,nonNullable:!1,readOnly:!0})],A.prototype,"videoTimeExtent",null),e([y({readOnly:!0})],A.prototype,"videoWidth",null),e([y()],A.prototype,"volume",null),e([y({readOnly:!0})],A.prototype,"waiting",null),A=e([d("esri.layers.VideoLayer")],A);const Q=A;export{Q as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import l from"../core/Error.js";import i from"../core/Logger.js";import{clamp as s}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{watch as a,initial as p,whenOnce as u}from"../core/reactiveUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import c from"../geometry/Extent.js";import h from"../geometry/Polyline.js";import f from"../geometry/SpatialReference.js";import v from"./Layer.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{parse as j}from"./support/arcgisLayerUrl.js";import{url as b}from"./support/commonProperties.js";import T from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as C}from"./support/serviceCapabilitiesUtils.js";import w from"./support/TelemetryData.js";import x from"./support/TelemetryDisplay.js";import I from"./support/VideoFrame.js";import L from"./support/VideoTimeExtent.js";import U from"./video/VideoController.js";import{getFrameHorizonPoints as E,getGroundControlPoints as N,getTelemetryData as P,getServiceLayersInfo as J,getSensorTrailPoints as M,readVideoTimeExtent as R}from"./video/videoUtils.js";import k from"../symbols/SimpleFillSymbol.js";import H from"../symbols/SimpleLineSymbol.js";import V from"../symbols/SimpleMarkerSymbol.js";let z=[];const F=new t([255,127,0]),q=new t([0,0,0,.05]),D=new V({angle:0,color:F,size:10,style:"cross"}),G=new k({color:q,outline:new H({color:F,width:2})}),_=new H({color:F,width:1}),B=new V({angle:0,color:F,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),W=new H({color:F,width:1});let A=class extends(g(O(n(S(v))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new U,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=D.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=G.clone(),this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbol=B.clone(),this.sensorSightLineSymbol=_.clone(),this.sensorTrailSymbol=W.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=f.WGS84,this.start=0,this.telemetryDisplay=null,this.telemetryColor=F,this.title=null,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.telemetryDisplay=new x({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([a((()=>this.metadata),(()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")})),a((()=>this.telemetry?.sensorLocation),(e=>this._setSensorTrail(e)),p)]),u((()=>this.loaded&&"can-play"===this.state&&this.duration>0)).then((()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)}))}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._fetchService(t)),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return C(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return E(this.metadata)}get groundControlPoints(){return N(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return P(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return J(t)}get videoTimeExtent(){return o(i.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=s(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const t=j(this.parsedUrl?.path);if(null==t)throw new l("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let o=null;const{data:i,ssl:s}=await r(t.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e}),n=i;if(this.url=t.url.path,s&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let a=t?.sublayer;if(null==a&&n.layers?.length&&(a=n.layers[0].id),null==a)throw new l("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${t.url.path}/${a}`,o=await r(this.url,{query:{f:"json",...this.customParameters},signal:e});const p={...n,...o.data};this.sourceJSON=p,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=M(e,z);z=[...t];const r=z.map((e=>e.toArray())),o=new h({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([y()],A.prototype,"autoplay",null),e([y({readOnly:!0})],A.prototype,"buffered",null),e([y({readOnly:!0,json:{read:!1}})],A.prototype,"capabilities",void 0),e([m("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],A.prototype,"readCapabilitiesFromService",null),e([y({readOnly:!0})],A.prototype,"codecs",void 0),e([y({readOnly:!0})],A.prototype,"connectionInfo",void 0),e([m("connectionInfo",["connectionUrl"])],A.prototype,"readConnectionInfo",null),e([y()],A.prototype,"controller",void 0),e([y({type:String})],A.prototype,"copyright",void 0),e([y({readOnly:!0,type:Date})],A.prototype,"created",void 0),e([y({type:Number})],A.prototype,"currentTime",null),e([y({type:String})],A.prototype,"description",void 0),e([y({type:Number})],A.prototype,"duration",null),e([y({readOnly:!0})],A.prototype,"elevationSource",void 0),e([y({type:Boolean})],A.prototype,"ended",null),e([y({type:I})],A.prototype,"frame",void 0),e([y()],A.prototype,"frameCenterSymbol",void 0),e([y({readOnly:!0,type:Number})],A.prototype,"frameCount",void 0),e([y()],A.prototype,"frameEffect",void 0),e([y()],A.prototype,"frameOpacity",void 0),e([y()],A.prototype,"frameOutlineSymbol",void 0),e([y({type:c})],A.prototype,"fullExtent",void 0),e([y({readOnly:!0})],A.prototype,"frameHorizonPoints",null),e([y({readOnly:!0,nonNullable:!1,json:{read:{reader:R,source:"time"}},type:L})],A.prototype,"fullTimeExtent",void 0),e([y({readOnly:!0})],A.prototype,"groundControlPoints",null),e([y({type:c})],A.prototype,"initialExtent",void 0),e([y({readOnly:!0})],A.prototype,"isLive",null),e([y({readOnly:!0,json:{read:{source:"id"}}})],A.prototype,"layerId",void 0),e([y({readOnly:!0})],A.prototype,"livestreamStatus",null),e([y({type:Boolean})],A.prototype,"loop",null),e([y({readOnly:!0})],A.prototype,"metadata",null),e([y({readOnly:!0})],A.prototype,"mimeType",null),e([y({type:Boolean})],A.prototype,"muted",null),e([y({type:T})],A.prototype,"playbackInfo",void 0),e([y({type:Number})],A.prototype,"playbackRate",null),e([y({readOnly:!0,type:String})],A.prototype,"playerUrl",null),e([y({readOnly:!0})],A.prototype,"playing",null),e([y({readOnly:!0,json:{read:{source:"poster"}}})],A.prototype,"posterUrl",void 0),e([y({readOnly:!0})],A.prototype,"qualities",void 0),e([y()],A.prototype,"sensorSymbol",void 0),e([y()],A.prototype,"sensorSightLineSymbol",void 0),e([y()],A.prototype,"sensorTrailSymbol",void 0),e([y({readOnly:!0})],A.prototype,"serviceItemId",void 0),e([y()],A.prototype,"sourceJSON",void 0),e([y({readOnly:!0})],A.prototype,"sourceQuality",void 0),e([y({readOnly:!0,json:{name:"serviceType"}})],A.prototype,"sourceType",void 0),e([y()],A.prototype,"spatialReference",void 0),e([y()],A.prototype,"start",void 0),e([y({readOnly:!0})],A.prototype,"started",null),e([y({readOnly:!0,type:String})],A.prototype,"state",null),e([y({readOnly:!0,type:w})],A.prototype,"telemetry",null),e([y({type:x})],A.prototype,"telemetryDisplay",void 0),e([y({type:t})],A.prototype,"telemetryColor",void 0),e([y({readOnly:!1,json:{read:{source:"name"}}})],A.prototype,"title",void 0),e([y({readOnly:!0})],A.prototype,"type",void 0),e([y(b)],A.prototype,"url",void 0),e([y({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],A.prototype,"version",void 0),e([y({readOnly:!0})],A.prototype,"videoElement",null),e([y({readOnly:!0})],A.prototype,"videoHeight",null),e([y({readOnly:!0,json:{read:!1}})],A.prototype,"videoLayersInfo",void 0),e([m("service","videoLayersInfo",["id","name","poster","serviceType","type"])],A.prototype,"readLayerInfosFromService",null),e([y({type:L,nonNullable:!1,readOnly:!0})],A.prototype,"videoTimeExtent",null),e([y({readOnly:!0})],A.prototype,"videoWidth",null),e([y()],A.prototype,"volume",null),e([y({readOnly:!0})],A.prototype,"waiting",null),A=e([d("esri.layers.VideoLayer")],A);const Q=A;export{Q as default};
|
package/layers/WMSLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import s from"../request.js";import i from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import n from"../core/Error.js";import{JSONMap as l}from"../core/jsonMap.js";import{clone as p}from"../core/lang.js";import{MultiOriginJSONMixin as m}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u}from"../core/promiseUtils.js";import{on as c,watch as y,sync as f}from"../core/reactiveUtils.js";import{urlToObject as d,addQueryParameters as h,addProxy as g,Url as b}from"../core/urlUtils.js";import{property as w}from"../core/accessorSupport/decorators/property.js";import{Integer as v}from"../core/accessorSupport/ensureType.js";import{reader as x}from"../core/accessorSupport/decorators/reader.js";import{subclass as j}from"../core/accessorSupport/decorators/subclass.js";import{writer as I}from"../core/accessorSupport/decorators/writer.js";import{willPropertyWrite as S}from"../core/accessorSupport/write.js";import F from"../geometry/Extent.js";import R from"../geometry/SpatialReference.js";import{getScale as P}from"../geometry/support/scaleUtils.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import L from"./Layer.js";import{BlendLayer as O}from"./mixins/BlendLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{PortalLayer as M}from"./mixins/PortalLayer.js";import{RefreshableLayer as _}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as C}from"./mixins/TemporalLayer.js";import{isAxesOrderReversedForWkid as W}from"./ogc/crsUtils.js";import{isWmsServer as q}from"./support/arcgisLayerUrl.js";import{legendEnabled as N,url as $}from"./support/commonProperties.js";import{ExportWMSImageParameters as k}from"./support/ExportWMSImageParameters.js";import{createBitmap as B}from"./support/imageBitmapUtils.js";import H from"./support/WMSSublayer.js";import{normalizeWKID as G,toTimeQueryParameter as V,getPopupLayers as A,parseCapabilities as D}from"./support/wmsUtils.js";const J=new l({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function z(e){return"text/html"===e}function Q(e){return"text/plain"===e}let K=class extends(O(C(_(T(U(M(m(L)))))))){constructor(...e){super(...e),this.allSublayers=new a({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([c((()=>this.sublayers),"after-add",(({item:e})=>{e.parent=e.layer=this}),f),c((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=e.parent=null}),f),y((()=>this.sublayers),((e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=r.layer=this}),f)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(u).then((()=>this._fetchService(t))).then((()=>this._checkLayerValidity()))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new F({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return null==this.featureInfoFormats?null:this.featureInfoFormats.find(z)??this.featureInfoFormats.find(Q)??null}set featureInfoFormat(e){null==e?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(z(e)||Q(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new R(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter((e=>e!==r)),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return Y(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return Y(t.layers,r)}writeSublayers(e,t,r,o){t.layers=[];const s=new Map,i=e.flatten((({sublayers:e})=>e??[]));for(const a of i)if("number"==typeof a.parent?.id){const e=s.get(a.parent.id);null!=e?e.push(a.id):s.set(a.parent.id,[a.id])}for(const a of i){const e={sublayer:a,...o},r=a.write({parentLayerId:"number"==typeof a.parent?.id?a.parent.id:-1},e);if(s.has(a.id)&&(r.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const r=a.write({},e);delete r.id,t.layers.push(r)}}t.visibleLayers=i.filter((({visible:e,sublayers:t})=>e&&!t)).map((({name:e})=>e)).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=d(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const o=h(t,r??{});this._set("url",o)}createExportImageParameters(e,t,r,o){const s=o?.pixelRatio??1,i=P({extent:e,width:t})*s,a=new k({layer:this,scale:i}),{xmin:n,ymin:l,xmax:p,ymax:m,spatialReference:u}=e,c=G(u,this.spatialReferences),y="1.3.0"===this.version&&W(c)?`${l},${n},${m},${p}`:`${n},${l},${p},${m}`,f=a.toJSON(),d="1.3.0"===this.version?"crs":"srs";return{bbox:y,[d]:null==c||isNaN(c)?void 0:"EPSG:"+c,...f}}async fetchImage(e,t,r,o){const i=this.mapUrl,a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement("canvas");return e.width=t,e.height=r,e}const n=V(o?.timeExtent),l={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...a,time:n,...this.refreshParameters}),signal:o?.signal};return s(i??"",l).then((e=>e.data))}async fetchImageBitmap(e,t,r,o){const i=this.mapUrl??"",a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement("canvas");return e.width=t,e.height=r,e}const n=V(o?.timeExtent),l={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...a,time:n,...this.refreshParameters}),signal:o?.signal},{data:p}=await s(i,l);return B(p,i,o?.signal)}fetchFeatureInfo(e,t,r,o,s){const i=P({extent:e,width:t}),a=new k({layer:this,scale:i}),n=A(a.visibleSublayers);if(null==this.featureInfoUrl||null==n)return Promise.resolve([]);if(null==this.fetchFeatureInfoFunction&&null==this.featureInfoFormat)return Promise.resolve([]);const l="1.3.0"===this.version?{I:o,J:s}:{x:o,y:s},p={query_layers:n,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...l},m={...this.createExportImageParameters(e,t,r),...p},u=this._mixCustomParameters(m);return null!=this.fetchFeatureInfoFunction?this.fetchFeatureInfoFunction(u):this._defaultFetchFeatureInfoFunction(h(this.featureInfoUrl,u))}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}findSublayerByName(e){return this.allSublayers.find((t=>t.name===e))}serviceSupportsSpatialReference(e){return q(this.url)||null!=this.spatialReferences&&this.spatialReferences.some((t=>{const r=900913===t?R.WebMercator:new R({wkid:t});return E(r,e)}))}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=encodeURI(g(e)),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const s=new o({title:this.title,content:t}),i=new r({sourceLayer:this,popupTemplate:s});return Promise.resolve([i])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:o}=await s(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=D(o)}if(this.parsedUrl){const e=new b(this.parsedUrl.path),{httpsDomains:r}=t.request;"https"!==e.scheme||e.port&&"443"!==e.port||!e.host||r.includes(e.host)||r.push(e.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new n("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function X(e,t){return e.some((e=>{for(const r in e)if(S(e,r,null,t))return!0;return!1}))}function Y(e,t,r){e=e??[];const o=new Map;e.every((e=>null==e.id))&&(e=p(e)).forEach(((e,t)=>e.id=t));for(const i of e){const e=new H;e.read(i,t),r&&!r.includes(e.name)&&(e.visible=!1),o.set(e.id,e)}const s=[];for(const a of e){const e=null!=a.id?o.get(a.id):null;if(e)if(null!=a.parentLayerId&&a.parentLayerId>=0){const t=o.get(a.parentLayerId);if(!t)continue;t.sublayers||(t.sublayers=new i),t.sublayers.push(e)}else s.push(e)}return s}e([w({readOnly:!0})],K.prototype,"allSublayers",void 0),e([w({json:{type:Object,write:!0}})],K.prototype,"customParameters",void 0),e([w({json:{type:Object,write:!0}})],K.prototype,"customLayerParameters",void 0),e([w({type:String,json:{write:!0}})],K.prototype,"copyright",void 0),e([w()],K.prototype,"description",void 0),e([w({readOnly:!0})],K.prototype,"dimensions",void 0),e([w({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],K.prototype,"fullExtent",void 0),e([x(["web-document","portal-item"],"fullExtent",["extent"])],K.prototype,"readFullExtentFromItemOrMap",null),e([I(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],K.prototype,"writeFullExtent",null),e([w({type:[F]})],K.prototype,"fullExtents",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"featureInfoFormat",null),e([w({type:[String],readOnly:!0})],K.prototype,"featureInfoFormats",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"featureInfoUrl",void 0),e([w()],K.prototype,"fetchFeatureInfoFunction",void 0),e([w({type:String,json:{origins:{"web-document":{default:"image/png",type:J.jsonValues,read:{reader:J.read,source:"format"},write:{writer:J.write,target:"format"}}}}})],K.prototype,"imageFormat",void 0),e([x("imageFormat",["supportedImageFormatTypes"])],K.prototype,"readImageFormat",null),e([w({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],K.prototype,"imageMaxHeight",void 0),e([w({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],K.prototype,"imageMaxWidth",void 0),e([w()],K.prototype,"imageTransparency",void 0),e([w(N)],K.prototype,"legendEnabled",void 0),e([w({type:["show","hide","hide-children"]})],K.prototype,"listMode",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"mapUrl",void 0),e([w({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],K.prototype,"isReference",void 0),e([w({type:["WMS"]})],K.prototype,"operationalLayerType",void 0),e([w()],K.prototype,"resourceInfo",void 0),e([w({type:R,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],K.prototype,"spatialReference",void 0),e([x(["web-document","portal-item"],"spatialReference",["spatialReferences"])],K.prototype,"readSpatialReferenceFromItemOrDocument",null),e([w({type:[v],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],K.prototype,"spatialReferences",void 0),e([I(["web-document","portal-item"],"spatialReferences")],K.prototype,"writeSpatialReferences",null),e([w({type:i.ofType(H),json:{write:{target:"layers",overridePolicy(e,t,r){if(X(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],K.prototype,"sublayers",void 0),e([x(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],K.prototype,"readSublayersFromItemOrMap",null),e([x("service","sublayers",["layers"])],K.prototype,"readSublayers",null),e([I("sublayers",{layers:{type:[H]},visibleLayers:{type:[String]}})],K.prototype,"writeSublayers",null),e([w({json:{read:!1},readOnly:!0,value:"wms"})],K.prototype,"type",void 0),e([w($)],K.prototype,"url",null),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"version",void 0),K=e([j("esri.layers.WMSLayer")],K);const Z=K;export{Z as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import s from"../request.js";import i from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import n from"../core/Error.js";import{JSONMap as l}from"../core/jsonMap.js";import{clone as p}from"../core/lang.js";import{MultiOriginJSONMixin as m}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u}from"../core/promiseUtils.js";import{on as c,watch as y,sync as f}from"../core/reactiveUtils.js";import{renderingSanitizer as d}from"../core/sanitizerUtils.js";import{urlToObject as h,addQueryParameters as g,addProxy as b,makeAbsolute as w,Url as v}from"../core/urlUtils.js";import{property as x}from"../core/accessorSupport/decorators/property.js";import{Integer as j}from"../core/accessorSupport/ensureType.js";import{reader as I}from"../core/accessorSupport/decorators/reader.js";import{subclass as S}from"../core/accessorSupport/decorators/subclass.js";import{writer as F}from"../core/accessorSupport/decorators/writer.js";import{willPropertyWrite as P}from"../core/accessorSupport/write.js";import R from"../geometry/Extent.js";import E from"../geometry/SpatialReference.js";import{getScale as L}from"../geometry/support/scaleUtils.js";import{equals as O}from"../geometry/support/spatialReferenceUtils.js";import U from"./Layer.js";import{BlendLayer as M}from"./mixins/BlendLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as C}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as W}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as q}from"./mixins/TemporalLayer.js";import{isAxesOrderReversedForWkid as N}from"./ogc/crsUtils.js";import{isWmsServer as $}from"./support/arcgisLayerUrl.js";import{legendEnabled as k,url as B}from"./support/commonProperties.js";import{ExportWMSImageParameters as H}from"./support/ExportWMSImageParameters.js";import{createBitmap as G}from"./support/imageBitmapUtils.js";import V from"./support/WMSSublayer.js";import{normalizeWKID as z,toTimeQueryParameter as A,getPopupLayers as D,parseCapabilities as J}from"./support/wmsUtils.js";const Q=new l({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function K(e){return"text/html"===e}function X(e){return"text/plain"===e}let Y=class extends(M(q(C(W(_(T(m(U)))))))){constructor(...e){super(...e),this.allSublayers=new a({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([c((()=>this.sublayers),"after-add",(({item:e})=>{e.parent=e.layer=this}),f),c((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=e.parent=null}),f),y((()=>this.sublayers),((e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=r.layer=this}),f)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(u).then((()=>this._fetchService(t))).then((()=>this._checkLayerValidity()))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new R({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return null==this.featureInfoFormats?null:this.featureInfoFormats.find(K)??this.featureInfoFormats.find(X)??null}set featureInfoFormat(e){null==e?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(K(e)||X(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new E(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter((e=>e!==r)),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return ee(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return ee(t.layers,r)}writeSublayers(e,t,r,o){t.layers=[];const s=new Map,i=e.flatten((({sublayers:e})=>e??[]));for(const a of i)if("number"==typeof a.parent?.id){const e=s.get(a.parent.id);null!=e?e.push(a.id):s.set(a.parent.id,[a.id])}for(const a of i){const e={sublayer:a,...o},r=a.write({parentLayerId:"number"==typeof a.parent?.id?a.parent.id:-1},e);if(s.has(a.id)&&(r.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const r=a.write({},e);delete r.id,t.layers.push(r)}}t.visibleLayers=i.filter((({visible:e,sublayers:t})=>e&&!t)).map((({name:e})=>e)).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=h(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const o=g(t,r??{});this._set("url",o)}createExportImageParameters(e,t,r,o){const s=o?.pixelRatio??1,i=L({extent:e,width:t})*s,a=new H({layer:this,scale:i}),{xmin:n,ymin:l,xmax:p,ymax:m,spatialReference:u}=e,c=z(u,this.spatialReferences),y="1.3.0"===this.version&&N(c)?`${l},${n},${m},${p}`:`${n},${l},${p},${m}`,f=a.toJSON(),d="1.3.0"===this.version?"crs":"srs";return{bbox:y,[d]:null==c||isNaN(c)?void 0:"EPSG:"+c,...f}}async fetchImage(e,t,r,o){const i=this.mapUrl,a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement("canvas");return e.width=t,e.height=r,e}const n=A(o?.timeExtent),l={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...a,time:n,...this.refreshParameters}),signal:o?.signal};return s(i??"",l).then((e=>e.data))}async fetchImageBitmap(e,t,r,o){const i=this.mapUrl??"",a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement("canvas");return e.width=t,e.height=r,e}const n=A(o?.timeExtent),l={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...a,time:n,...this.refreshParameters}),signal:o?.signal},{data:p}=await s(i,l);return G(p,i,o?.signal)}fetchFeatureInfo(e,t,r,o,s){const i=L({extent:e,width:t}),a=new H({layer:this,scale:i}),n=D(a.visibleSublayers);if(null==this.featureInfoUrl||null==n)return Promise.resolve([]);if(null==this.fetchFeatureInfoFunction&&null==this.featureInfoFormat)return Promise.resolve([]);const l="1.3.0"===this.version?{I:o,J:s}:{x:o,y:s},p={query_layers:n,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...l},m={...this.createExportImageParameters(e,t,r),...p},u=this._mixCustomParameters(m);return null!=this.fetchFeatureInfoFunction?this.fetchFeatureInfoFunction(u):this._defaultFetchFeatureInfoFunction(g(this.featureInfoUrl,u))}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}findSublayerByName(e){return this.allSublayers.find((t=>t.name===e))}serviceSupportsSpatialReference(e){return $(this.url)||null!=this.spatialReferences&&this.spatialReferences.some((t=>{const r=900913===t?E.WebMercator:new E({wkid:t});return O(r,e)}))}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=b(d.sanitizeUrl(w(e))),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const s=new o({title:this.title,content:t}),i=new r({sourceLayer:this,popupTemplate:s});return Promise.resolve([i])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:o}=await s(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=J(o)}if(this.parsedUrl){const e=new v(this.parsedUrl.path),{httpsDomains:r}=t.request;"https"!==e.scheme||e.port&&"443"!==e.port||!e.host||r.includes(e.host)||r.push(e.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new n("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function Z(e,t){return e.some((e=>{for(const r in e)if(P(e,r,null,t))return!0;return!1}))}function ee(e,t,r){e=e??[];const o=new Map;e.every((e=>null==e.id))&&(e=p(e)).forEach(((e,t)=>e.id=t));for(const i of e){const e=new V;e.read(i,t),r&&!r.includes(e.name)&&(e.visible=!1),o.set(e.id,e)}const s=[];for(const a of e){const e=null!=a.id?o.get(a.id):null;if(e)if(null!=a.parentLayerId&&a.parentLayerId>=0){const t=o.get(a.parentLayerId);if(!t)continue;t.sublayers||(t.sublayers=new i),t.sublayers.push(e)}else s.push(e)}return s}e([x({readOnly:!0})],Y.prototype,"allSublayers",void 0),e([x({json:{type:Object,write:!0}})],Y.prototype,"customParameters",void 0),e([x({json:{type:Object,write:!0}})],Y.prototype,"customLayerParameters",void 0),e([x({type:String,json:{write:!0}})],Y.prototype,"copyright",void 0),e([x()],Y.prototype,"description",void 0),e([x({readOnly:!0})],Y.prototype,"dimensions",void 0),e([x({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],Y.prototype,"fullExtent",void 0),e([I(["web-document","portal-item"],"fullExtent",["extent"])],Y.prototype,"readFullExtentFromItemOrMap",null),e([F(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],Y.prototype,"writeFullExtent",null),e([x({type:[R]})],Y.prototype,"fullExtents",void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Y.prototype,"featureInfoFormat",null),e([x({type:[String],readOnly:!0})],Y.prototype,"featureInfoFormats",void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Y.prototype,"featureInfoUrl",void 0),e([x()],Y.prototype,"fetchFeatureInfoFunction",void 0),e([x({type:String,json:{origins:{"web-document":{default:"image/png",type:Q.jsonValues,read:{reader:Q.read,source:"format"},write:{writer:Q.write,target:"format"}}}}})],Y.prototype,"imageFormat",void 0),e([I("imageFormat",["supportedImageFormatTypes"])],Y.prototype,"readImageFormat",null),e([x({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],Y.prototype,"imageMaxHeight",void 0),e([x({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],Y.prototype,"imageMaxWidth",void 0),e([x()],Y.prototype,"imageTransparency",void 0),e([x(k)],Y.prototype,"legendEnabled",void 0),e([x({type:["show","hide","hide-children"]})],Y.prototype,"listMode",void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Y.prototype,"mapUrl",void 0),e([x({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Y.prototype,"isReference",void 0),e([x({type:["WMS"]})],Y.prototype,"operationalLayerType",void 0),e([x()],Y.prototype,"resourceInfo",void 0),e([x({type:E,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],Y.prototype,"spatialReference",void 0),e([I(["web-document","portal-item"],"spatialReference",["spatialReferences"])],Y.prototype,"readSpatialReferenceFromItemOrDocument",null),e([x({type:[j],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],Y.prototype,"spatialReferences",void 0),e([F(["web-document","portal-item"],"spatialReferences")],Y.prototype,"writeSpatialReferences",null),e([x({type:i.ofType(V),json:{write:{target:"layers",overridePolicy(e,t,r){if(Z(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],Y.prototype,"sublayers",void 0),e([I(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],Y.prototype,"readSublayersFromItemOrMap",null),e([I("service","sublayers",["layers"])],Y.prototype,"readSublayers",null),e([F("sublayers",{layers:{type:[V]},visibleLayers:{type:[String]}})],Y.prototype,"writeSublayers",null),e([x({json:{read:!1},readOnly:!0,value:"wms"})],Y.prototype,"type",void 0),e([x(B)],Y.prototype,"url",null),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Y.prototype,"version",void 0),Y=e([S("esri.layers.WMSLayer")],Y);const te=Y;export{te as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Graphic.js";import t from"../../core/Error.js";import r from"../../core/Logger.js";import{getMetersPerCartesianUnitForSR as a}from"../../core/unitUtils.js";import{parseData as s}from"../../core/urlUtils.js";import{isEqualBaseGCS as o,canProjectWithoutEngine as n,projectWithoutEngine as l}from"../../geometry/
|
|
5
|
+
import e from"../../Graphic.js";import t from"../../core/Error.js";import r from"../../core/Logger.js";import{getMetersPerCartesianUnitForSR as a}from"../../core/unitUtils.js";import{parseData as s}from"../../core/urlUtils.js";import{isEqualBaseGCS as o,canProjectWithoutEngine as n,projectWithoutEngine as l}from"../../geometry/projectionUtils.js";import{fromJSON as i}from"../../geometry/support/jsonUtils.js";import u from"../../geometry/support/MeshTransform.js";import{equals as d}from"../../geometry/support/spatialReferenceUtils.js";import{isFeatureIdentifierArrayWithGlobalId as c,isFeatureIdentifierArrayWithObjectId as p}from"./editingSupport.js";async function m(e,t,r){const{geometry:s}=t,i={...t.attributes};if(null!=r&&"mesh"===s?.type){const{transformFieldRoles:t}=r,{origin:c,spatialReference:p,vertexSpace:m}=s,f=s.transform??new u,g="local"===m.type,b=e.spatialReference,y=b.isGeographic,R=d(b,p),h=o(p,b)&&n(p,b);if(!(g&&y&&h||!g&&!y&&R))return null;const I=l(c,p,b);if(null==I)return null;if(i[t.originX]=I.x,i[t.originY]=I.y,i[t.originZ]=I.z??0,null!=f){const{translation:e,scale:r,rotation:s}=f,o=g?1:a(p)/a(b);i[t.translationX]=e[0]*o,i[t.translationY]=e[2]*o,i[t.translationZ]=-e[1]*o,i[t.scaleX]=r[0],i[t.scaleY]=r[2],i[t.scaleZ]=r[1],i[t.rotationX]=s[0],i[t.rotationY]=s[2],i[t.rotationZ]=-s[1],i[t.rotationDeg]=s[3]}return{attributes:i}}return null==s?{attributes:i}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:i}}async function f(e,t){const r=await Promise.all((t.addAttachments??[]).map((t=>g(e,t)))),a=await Promise.all((t.updateAttachments??[]).map((t=>g(e,t)))),s=t.deleteAttachments??[];return r.length||a.length||s.length?{adds:r,updates:a,deletes:[...s]}:null}async function g(e,t){const{feature:r,attachment:a}=t,{globalId:o,name:n,contentType:l,data:i,uploadId:u}=a,d={globalId:o};if(r&&("attributes"in r?d.parentGlobalId=r.attributes?.[e.globalIdField]:r.globalId&&(d.parentGlobalId=r.globalId)),u)d.uploadId=u;else if(i){const e=await s(i);e&&(d.contentType=e.mediaType,d.data=e.data),i instanceof File&&(d.name=i.name)}return n&&(d.name=n),l&&(d.contentType=l),d}function b(e,t,r){if(!t||0===t.length)return[];if(r&&c(t))return t.map((e=>e.globalId));if(p(t))return t.map((e=>e.objectId));const a=r?e.globalIdField:e.objectIdField;return a?t.map((e=>e.getAttribute(a))):[]}function y(e){const t=e?.assetMaps;if(t){for(const e of t.addResults)e.success||r.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`);for(const e of t.updateResults)e.success||r.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`)}const a=e?.attachments,s={addFeatureResults:e?.addResults?.map(R)??[],updateFeatureResults:e?.updateResults?.map(R)??[],deleteFeatureResults:e?.deleteResults?.map(R)??[],addAttachmentResults:a?.addResults?a.addResults.map(R):[],updateAttachmentResults:a?.updateResults?a.updateResults.map(R):[],deleteAttachmentResults:a?.deleteResults?a.deleteResults.map(R):[]};return e?.editMoment&&(s.editMoment=e.editMoment),s}function R(e){const r=!0===e.success?null:e.error||{code:void 0,description:"Feature edit failed"};return{objectId:e.objectId,globalId:e.globalId,error:r?new t("feature-layer-source:edit-failure",r.description,{code:r.code}):null}}function h(t,r){return new e({attributes:t.attributes,geometry:i({...t.geometry,spatialReference:r})})}function I(e,t){return{adds:e?.adds?.map((e=>h(e,t)))||[],updates:e?.updates?.map((e=>({original:h(e[0],t),current:h(e[1],t)})))||[],deletes:e?.deletes?.map((e=>h(e,t)))||[],spatialReference:t}}function j(e){const t=e.details.raw,r=+t.code,a=+t.extendedCode;return 500===r&&(-2147217144===a||-2147467261===a)}export{I as createEditedFeatures,R as createFeatureEditResult,f as getAttachmentEditsJSON,b as getFeatureIds,m as getFeatureJSON,j as isProtectedOrPrivateVersionError,y as unpackEditResultData};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{result as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import has from"../../../core/has.js";import s from"../../../core/Error.js";import{clone as a}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{destroyMaybe as l,removeMaybe as n,abortMaybe as u}from"../../../core/maybe.js";import h from"../../../core/Promise.js";import{createAbortError as c,isAbortError as d}from"../../../core/promiseUtils.js";import{initial as p,whenOnce as m,watch as f,syncAndInitial as y,sync as _}from"../../../core/reactiveUtils.js";import{sqlAnd as g}from"../../../core/sql.js";import{property as F}from"../../../core/accessorSupport/decorators/property.js";import{subclass as x}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../../core/support/UpdatingHandles.js";import{projectWithZConversion as D}from"../../../geometry/projection.js";import{isHostedAgolService as w}from"../../support/arcgisLayerUrl.js";import{checkServiceCurrentUserSupport as b}from"../../support/featureLayerUtils.js";import{getEffectiveLayerCapabilities as C}from"../../support/layerUtils.js";import S from"../../../rest/support/StatisticDefinition.js";import{FeatureTileDescriptor as E}from"../../../views/3d/layers/support/FeatureTileDescriptor.js";import{FeatureTileFetcher3D as T}from"../../../views/3d/layers/support/FeatureTileFetcher3D.js";import{FeatureTileFetcher3DDebugger as V}from"../../../views/3d/layers/support/FeatureTileFetcher3DDebugger.js";import{debugFlags as H}from"../../../views/3d/support/debugFlags.js";let L=class extends(h.EsriPromiseMixin(t)){get dataUpdating(){return this._tileFetcher?.dataUpdating??!1}set extent(e){if(null!=e&&!e.spatialReference.equals(this.layerView.view.spatialReference))return void o.getLogger(this).error("#extent=","extent needs to be in the same spatial reference as the view");const t=this._get("extent");if(t===e)return;if(null!=t&&e&&t.equals(e))return;const i=null!=e?e.clone():null;this._set("extent",i)}get updating(){return!!(this._tileFetcher?.updating||null!=this._fetchDataInfoPromise||"tiles"===this.mode&&this.layerView.view.featureTiles?.updating||this._updatingHandles?.updating)}get updatingTotal(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return null!=this._tileFetcher?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(null==this._tileFetcher||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return this.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get hasAllFeatures(){return this.serviceDataCount===N.noServiceDataCount&&"snapshot"===this.mode&&this.hasAllFeaturesInView||this.serviceDataCount===this.graphics.length}get hasAllFeaturesInView(){const e=this.context.effectiveDisplayFilter?.where||null,t=null!=e&&"1=1"!==e;return("tiles"!==this.mode||!t)&&(this._tileFetcher?.hasAllFeatures??!1)}get hasFullGeometries(){return this._tileFetcher?.hasFullGeometries??!1}get mode(){const e=this.layerView.layer;if("feature"===e.type&&null!=e.infoFor3D)return"snapshot";if("catalog-footprint"===e.type)return"tiles";if(this._forceTilesMode)return"tiles";const t=this.layerView.view;if(!1===t.qualitySettings?.graphics3D?.snapshotAvailable||this.serviceDataCount===N.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||t.quality<1)return"tiles";const i=t&&t.featureTiles,r=i&&i.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&r){const t=this._approximateExtentSizeAtScale(e.minScale,r);if((this.serviceDataExtent.width/t+this.serviceDataExtent.height/t)/2>N.maxSnapshotMinScaleFactor)return"tiles"}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const e=this._get("maxTotalSnapshotVertices")||0,t="snapshot"===this.mode&&this._tileFetcher?.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){const i=this.layerView.view,r=Math.ceil((i.width/t.pixelSize+i.height/t.pixelSize)/2),s=t.levels[0];return r*((s.tileSize[0]/(s.scale/e)+s.tileSize[1]/(s.scale/e))/2)}get tileDescriptors(){if("snapshot"===this.mode){const e=new E(0,0,0,this.layerView.view.featureTiles.tilingScheme,"dummy-tile-full-extent");return new r([e])}const e=this.layerView.view.featureTiles;return e?e.tiles:new r}get test(){}constructor(e){super(e),this.type="feature-tile-3d",this._updatingHandles=new v,this.serviceDataExtent=null,this.serviceDataCount=N.noServiceDataCount,this._snapshotLimitExceeded=!1,this.displayFeatureLimit=null,this._forceTilesMode=!1,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add((()=>this.displayFeatureLimit),(e=>this._updatingHandles.addPromise(this._updateSnapshotLimit(e,null,this._lifeCycleAbortController.signal)))),this._updatingHandles.add((()=>this.mode),(()=>this._modeChanged()),p),this._updatingHandles.add((()=>this.mode),((e,t)=>{"tiles"===e&&"snapshot"===t&&(this._forceTilesMode=!0)}),p),this.addResolvingPromise(Promise.resolve().then((()=>this._verifyCapabilities())).then((()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo()))).then((()=>this._initializeTileFetcher())))}_verifyCapabilities(){const e=this.layerView.layer;if("ogc-feature"!==e.type&&!C(e)?.operations.supportsQuery)throw new s("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=l(this._tileFetcher),this._tilesHandle=n(this._tilesHandle),this._lifeCycleAbortController=u(this._lifeCycleAbortController),this._updatingHandles.destroy(),this._set("_updatingHandles",null)}suspend(){this._suspended||(this._suspended=!0,null!=this._tileFetcher&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,null!=this._tileFetcher&&this._tileFetcher.resume())}restart(){const e=()=>{null!=this._tileFetcher&&this._tileFetcher.restart()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(e,e))}refetch(){this._refetch({resetForceTilesMode:!1})}getMissingAttributesForFeature(e){return this._tileFetcher?.getMissingAttributesForFeature(e)}_refetch(e){const t=()=>{null!=this._tileFetcher&&(e.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(t,t))}_initializeTileFetcher(){const e=this.layerView.view;if(!e)return;const t=m((()=>e.featureTiles?.tilingScheme),this._lifeCycleAbortController.signal);this._updatingHandles.addPromise(t),t.then((()=>{const{layerView:e,tileDescriptors:t}=this,i=e.layer,r=new T({context:this.context,filterExtent:this.extent,tileDescriptors:t,features:this.graphics});this._tileFetcher=r,this._suspended?r.suspend():r.resume();const s=this.layerView.view;s&&this.addHandles(f((()=>s.quality),(e=>r.memoryFactor=e),y));const a="polygon"===this.context.geometryType?"polygonLodFactor":"polyline"===this.context.geometryType?"polylineLodFactor":null;a&&this.addHandles(f((()=>this.layerView.view?.qualitySettings?.graphics3D?.[a]),(e=>r.lodFactor=e||1),p));const o=e=>{r.maximumNumberOfFeatures=e,r.useTileCount=this.serviceDataCount>e},l=e=>{r.useTileCount=e>this.maximumNumberOfFeatures};"ogc-feature"!==i.type&&this._updatingHandles.add((()=>i.createQueryVersion),(()=>this._dataFilterChanged())),this._updatingHandles.add((()=>this.context.effectiveDisplayFilter),(()=>this._effectiveDisplayFilterChanged())),this._updatingHandles.add((()=>e.availableFields),((e,t)=>this._availableFieldsChanged(t,e))),this._updatingHandles.add((()=>e.requiredFields),((e,t)=>this._requiredFieldsChanged(t,e))),"customParameters"in i&&this._updatingHandles.add((()=>i.customParameters),(()=>this.restart())),this.addHandles([i.on("apply-edits",(e=>this._applyEdits(e))),f((()=>this.extent),(e=>r.filterExtent=e),_),f((()=>this.tileDescriptors),(e=>r.tileDescriptors=e),_),f((()=>this.maximumNumberOfFeatures),o,y),f((()=>this.serviceDataCount),l,y),f((()=>H.FEATURE_TILE_FETCH_SHOW_TILES),(e=>{e&&r&&!r.debugger?(r.debugger=new V(r,s.featureTiles.tilingScheme.toTileInfo(),s),r.debugger.update()):!e&&this._tileFetcher&&r.debugger&&(r.debugger.destroy(),r.debugger=null)}),p)]),this._supportsExceedsLimitQuery||this._updatingHandles.add((()=>this.maxTotalSnapshotVertices),(()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal))))})).catch((()=>{}))}_modeChanged(){switch(this.mode){case"tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.featureTiles.addClient());break;default:o.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case"snapshot":null!=this._tilesHandle&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0),this.notifyChange("maxTotalSnapshotVertices"),this._refetch({resetForceTilesMode:!0})}_effectiveDisplayFilterChanged(){"snapshot"!==this.mode&&this._refetch({resetForceTilesMode:!1})}_applyEdits(e){const t=this.layerView.layer;null!=this._tileFetcher&&this._tileFetcher.applyEdits(e).then((e=>{if(e){if(!this._lifeCycleAbortController)throw c();e.exceededTransferLimit&&"refresh"in t?t.refresh():(e.deletedFeatures.length||e.updatedFeatures.length||e.addedFeatures.length)&&this._updatingHandles.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}})).catch((e=>{if(!d(e))throw e}))}_availableFieldsChanged(e,t){null!=this._tileFetcher&&P(this._tileFetcher.availableFields,t)&&this._refetch({resetForceTilesMode:!1})}_requiredFieldsChanged(e,t){null!=this._tileFetcher&&P(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){const t=this.layerView.layer,i=t.createQuery();return i.returnGeometry=!1,i.outStatistics=[new S({statisticType:"exceedslimit",maxVertexCount:e,outStatisticFieldName:"exceedslimit",maxPointCount:1e8,maxRecordCount:1e8})],t.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),i}_createDataInfoQuery(){const e=this.layerView.layer,t=this.layerView,i=e.createQuery();return i.returnGeometry=!1,i.outSpatialReference=this.layerView.view.spatialReference,e.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),t.effectiveDisplayFilter&&(i.where=g(i.where,t.effectiveDisplayFilter.where)),i}_fullExtentIsAccurate(){const e=this.layerView.layer;if("definitionExpression"in e&&e.definitionExpression)return!1;switch(e.type){case"feature":case"catalog-footprint":case"oriented-imagery":return w(e.url);case"csv":case"geojson":case"ogc-feature":case"wfs":return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(t){d(t)||this._set("serviceDataExtent",a(this.layerView.fullExtentInLocalViewSpatialReference)??null)}}async _tryUpdateServiceDataExtent(e){const t=this.layerView,i=t.layer,r=i.capabilities?.query.supportsExtent??!1,s=a(t.fullExtentInLocalViewSpatialReference),o=i.fullExtent,l=this._fullExtentIsAccurate(),n=this.serviceDataCount;if(r&&n<=N.maxFeatureCountForExtent&&(!s||!l)&&"queryExtent"in i){const t=this._createDataInfoQuery(),r=await i.queryExtent(t,{timeout:N.queryExtentTimeout,signal:e});this._set("serviceDataExtent",r.extent)}else if(s)this._set("serviceDataExtent",s);else if(null!=o){const e=o.spatialReference?await D(o,t.view.spatialReference):null;this._set("serviceDataExtent",e??null)}else this._set("serviceDataExtent",null)}async _updateServiceDataCount(e){const t=this.layerView.layer;if(!("queryFeatureCount"in t)||!has("featurelayer-snapshot-enabled"))return void this._set("serviceDataCount",N.noServiceDataCount);const r=await i(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:N.queryStatisticsTimeout,signal:e}));if(!0===r.ok)this._set("serviceDataCount",r.value);else{if(d(r.error))throw r.error;this._set("serviceDataCount",N.noServiceDataCount)}}get _supportsExceedsLimitQuery(){const e=this.layerView.layer;return null!=e.capabilities&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case"point":case"multipoint":return 1;case"polygon":return 4;case"polyline":return 2;case"multipatch":case"mesh":return 3;default:return 0}}async _updateSnapshotLimit(e,t,r){if(null==e?.averageSymbolComplexity)return void(this._snapshotLimitExceeded=!1);const{maximumTotalNumberOfVertices:s,averageSymbolComplexity:a}=e,{verticesPerFeature:o,verticesPerCoordinate:l}=a,n=o<=0,u=this._minimumNumberOfVerticesForGeometry>1;if(!n&&!u)return void(this._snapshotLimitExceeded=!1);0!==o&&null!=t&&await t;const h=Math.min(s,I),c=this.serviceDataCount,p=c!==N.noServiceDataCount;let m=p?Math.ceil((h-c*o)/(l||1)):Math.ceil(h/(l||1));if(u&&(m=Math.min(m,q)),p&&this._minimumNumberOfVerticesForGeometry*c>m)return void(this._snapshotLimitExceeded=!0);if(!this._supportsExceedsLimitQuery||!has("featurelayer-snapshot-enabled"))return void(this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>m);const f=await i(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(m),{timeout:N.queryStatisticsTimeout,signal:r}));if(!1===f.ok){if(d(f.error))throw f.error;return void(this._snapshotLimitExceeded=!1)}const y=f.value.features[0];this._snapshotLimitExceeded=!!y?.attributes&&!!y.attributes.exceedslimit}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo(),await b(this.layerView.layer);let e=new AbortController;const t=e.signal,i=this._updateServiceDataCount(t),r=Promise.allSettled([i,this._updateSnapshotLimit(this.displayFeatureLimit,i,t)]),s=r.then((()=>this._updateServiceDataExtent(t))).catch((e=>{d(e)||o.getLogger(this).error("#fetchServiceDataInfo()",e)})).then((()=>{s===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null}));return e&&(this._fetchDataInfoPromise=s),this._fetchDataInfoAbortController=e,r.then((()=>{}),(()=>{}))}_cancelFetchServiceDataInfo(){const e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get performanceInfo(){return{storedFeatures:this._tileFetcher?.storedFeatures??0,totalFeatures:this._tileFetcher?.totalFeatures??0,totalVertices:this._tileFetcher?.totalVertices??0,missingTiles:this._tileFetcher?.missingTiles??0}}};e([F({readOnly:!0})],L.prototype,"type",void 0),e([F({constructOnly:!0})],L.prototype,"graphics",void 0),e([F({constructOnly:!0})],L.prototype,"layerView",void 0),e([F({constructOnly:!0})],L.prototype,"context",void 0),e([F({readOnly:!0})],L.prototype,"dataUpdating",null),e([F()],L.prototype,"extent",null),e([F()],L.prototype,"updating",null),e([F({readOnly:!0})],L.prototype,"_updatingHandles",void 0),e([F()],L.prototype,"updatingTotal",null),e([F()],L.prototype,"updatingRemaining",null),e([F()],L.prototype,"expectedFeatureDiff",null),e([F()],L.prototype,"memoryForUnusedFeatures",null),e([F()],L.prototype,"maximumNumberOfFeaturesExceeded",null),e([F({readOnly:!0})],L.prototype,"serviceDataExtent",void 0),e([F({readOnly:!0})],L.prototype,"serviceDataCount",void 0),e([F()],L.prototype,"_snapshotLimitExceeded",void 0),e([F()],L.prototype,"displayFeatureLimit",void 0),e([F({type:Number})],L.prototype,"maximumNumberOfFeatures",null),e([F({readOnly:!0})],L.prototype,"hasAllFeatures",null),e([F({readOnly:!0})],L.prototype,"hasAllFeaturesInView",null),e([F({readOnly:!0})],L.prototype,"hasFullGeometries",null),e([F()],L.prototype,"_forceTilesMode",void 0),e([F({readOnly:!0})],L.prototype,"mode",null),e([F({readOnly:!0})],L.prototype,"maxTotalSnapshotVertices",null),e([F({readOnly:!0})],L.prototype,"tileDescriptors",null),e([F()],L.prototype,"_tileFetcher",void 0),e([F()],L.prototype,"_fetchDataInfoPromise",void 0),L=e([x("esri.layers.graphics.controllers.FeatureTileController3D")],L);const O=1e4,I=1e6,A=12e3,j=1e4,q=5e6;function P(e,t){if(!t)return!1;for(const i of t)if(!e.has(i))return!0;return!1}var N;!function(e){function t(){e.maxFeatureCountForExtent=O,e.queryStatisticsTimeout=A,e.queryExtentTimeout=j}e.noServiceDataCount=1/0,e.maxSnapshotMinScaleFactor=5,e.reset=t}(N||(N={})),N.reset();export{L as FeatureTileController3D,N as FeatureTileController3DConstants};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{result as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import has from"../../../core/has.js";import s from"../../../core/Error.js";import{clone as a}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{destroyMaybe as l,removeMaybe as n,abortMaybe as u}from"../../../core/maybe.js";import h from"../../../core/Promise.js";import{createAbortError as c,isAbortError as d}from"../../../core/promiseUtils.js";import{initial as p,whenOnce as m,watch as f,syncAndInitial as y,sync as _}from"../../../core/reactiveUtils.js";import{sqlAnd as g}from"../../../core/sql.js";import{property as F}from"../../../core/accessorSupport/decorators/property.js";import{subclass as x}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../../core/support/UpdatingHandles.js";import{projectWithZConversion as D}from"../../../geometry/projectionUtils.js";import{isHostedAgolService as w}from"../../support/arcgisLayerUrl.js";import{checkServiceCurrentUserSupport as C}from"../../support/featureLayerUtils.js";import{getEffectiveLayerCapabilities as b}from"../../support/layerUtils.js";import S from"../../../rest/support/StatisticDefinition.js";import{FeatureTileDescriptor as E}from"../../../views/3d/layers/support/FeatureTileDescriptor.js";import{FeatureTileFetcher3D as T}from"../../../views/3d/layers/support/FeatureTileFetcher3D.js";import{FeatureTileFetcher3DDebugger as V}from"../../../views/3d/layers/support/FeatureTileFetcher3DDebugger.js";import{debugFlags as H}from"../../../views/3d/support/debugFlags.js";let L=class extends(h.EsriPromiseMixin(t)){get dataUpdating(){return this._tileFetcher?.dataUpdating??!1}set extent(e){if(null!=e&&!e.spatialReference.equals(this.layerView.view.spatialReference))return void o.getLogger(this).error("#extent=","extent needs to be in the same spatial reference as the view");const t=this._get("extent");if(t===e)return;if(null!=t&&e&&t.equals(e))return;const i=null!=e?e.clone():null;this._set("extent",i)}get updating(){return!!(this._tileFetcher?.updating||null!=this._fetchDataInfoPromise||"tiles"===this.mode&&this.layerView.view.featureTiles?.updating||this._updatingHandles?.updating)}get updatingTotal(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return null!=this._tileFetcher?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(null==this._tileFetcher||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return this.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get hasAllFeatures(){return this.serviceDataCount===N.noServiceDataCount&&"snapshot"===this.mode&&this.hasAllFeaturesInView||this.serviceDataCount===this.graphics.length}get hasAllFeaturesInView(){const e=this.context.effectiveDisplayFilter?.where||null,t=null!=e&&"1=1"!==e;return("tiles"!==this.mode||!t)&&(this._tileFetcher?.showsAllFeatures??!1)}get hasFullGeometries(){return this._tileFetcher?.hasFullGeometries??!1}get mode(){const e=this.layerView.layer;if("feature"===e.type&&null!=e.infoFor3D)return"snapshot";if("catalog-footprint"===e.type)return"tiles";if(this._forceTilesMode)return"tiles";const t=this.layerView.view;if(!1===t.qualitySettings?.graphics3D?.snapshotAvailable||this.serviceDataCount===N.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||t.quality<1)return"tiles";const i=t&&t.featureTiles,r=i&&i.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&r){const t=this._approximateExtentSizeAtScale(e.minScale,r);if((this.serviceDataExtent.width/t+this.serviceDataExtent.height/t)/2>N.maxSnapshotMinScaleFactor)return"tiles"}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const e=this._get("maxTotalSnapshotVertices")||0,t="snapshot"===this.mode&&this._tileFetcher?.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){const i=this.layerView.view,r=Math.ceil((i.width/t.pixelSize+i.height/t.pixelSize)/2),s=t.levels[0];return r*((s.tileSize[0]/(s.scale/e)+s.tileSize[1]/(s.scale/e))/2)}get tileDescriptors(){if("snapshot"===this.mode){const e=new E(0,0,0,this.layerView.view.featureTiles.tilingScheme,"dummy-tile-full-extent");return new r([e])}const e=this.layerView.view.featureTiles;return e?e.tiles:new r}get test(){}constructor(e){super(e),this.type="feature-tile-3d",this._updatingHandles=new v,this.serviceDataExtent=null,this.serviceDataCount=N.noServiceDataCount,this._snapshotLimitExceeded=!1,this.displayFeatureLimit=null,this._forceTilesMode=!1,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add((()=>this.displayFeatureLimit),(e=>this._updatingHandles.addPromise(this._updateSnapshotLimit(e,null,this._lifeCycleAbortController.signal)))),this._updatingHandles.add((()=>this.mode),(()=>this._modeChanged()),p),this._updatingHandles.add((()=>this.mode),((e,t)=>{"tiles"===e&&"snapshot"===t&&(this._forceTilesMode=!0)}),p),this.addResolvingPromise(Promise.resolve().then((()=>this._verifyCapabilities())).then((()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo()))).then((()=>this._initializeTileFetcher())))}_verifyCapabilities(){const e=this.layerView.layer;if("ogc-feature"!==e.type&&!b(e)?.operations.supportsQuery)throw new s("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=l(this._tileFetcher),this._tilesHandle=n(this._tilesHandle),this._lifeCycleAbortController=u(this._lifeCycleAbortController),this._updatingHandles.destroy(),this._set("_updatingHandles",null)}suspend(){this._suspended||(this._suspended=!0,null!=this._tileFetcher&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,null!=this._tileFetcher&&this._tileFetcher.resume())}restart(){const e=()=>{null!=this._tileFetcher&&this._tileFetcher.restart()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(e,e))}refetch(){this._refetch({resetForceTilesMode:!1})}getMissingAttributesForFeature(e){return this._tileFetcher?.getMissingAttributesForFeature(e)}_refetch(e){const t=()=>{null!=this._tileFetcher&&(e.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(t,t))}_initializeTileFetcher(){const e=this.layerView.view;if(!e)return;const t=m((()=>e.featureTiles?.tilingScheme),this._lifeCycleAbortController.signal);this._updatingHandles.addPromise(t),t.then((()=>{const{layerView:e,tileDescriptors:t}=this,i=e.layer,r=new T({context:this.context,filterExtent:this.extent,tileDescriptors:t,features:this.graphics});this._tileFetcher=r,this._suspended?r.suspend():r.resume();const s=this.layerView.view;s&&this.addHandles(f((()=>s.quality),(e=>r.memoryFactor=e),y));const a="polygon"===this.context.geometryType?"polygonLodFactor":"polyline"===this.context.geometryType?"polylineLodFactor":null;a&&this.addHandles(f((()=>this.layerView.view?.qualitySettings?.graphics3D?.[a]),(e=>r.lodFactor=e||1),p));const o=e=>{r.maximumNumberOfFeatures=e,r.useTileCount=this.serviceDataCount>e},n=e=>{r.useTileCount=e>this.maximumNumberOfFeatures};"ogc-feature"!==i.type&&this._updatingHandles.add((()=>i.createQueryVersion),(()=>this._dataFilterChanged())),this._updatingHandles.add((()=>this.context.effectiveDisplayFilter),(()=>this._effectiveDisplayFilterChanged())),this._updatingHandles.add((()=>e.availableFields),((e,t)=>this._availableFieldsChanged(t,e))),this._updatingHandles.add((()=>e.requiredFields),((e,t)=>this._requiredFieldsChanged(t,e))),"customParameters"in i&&this._updatingHandles.add((()=>i.customParameters),(()=>this.restart())),this.addHandles([i.on("apply-edits",(e=>this._applyEdits(e))),f((()=>this.extent),(e=>r.filterExtent=e),_),f((()=>this.tileDescriptors),(e=>r.tileDescriptors=e),_),f((()=>this.maximumNumberOfFeatures),o,y),f((()=>this.serviceDataCount),n,y),f((()=>H.FEATURE_TILE_FETCH_SHOW_TILES),(e=>{e&&r?r.debugger??=new V(r,s.featureTiles.tilingScheme.toTileInfo(),s):!e&&this._tileFetcher&&r.debugger&&(r.debugger=l(r.debugger))}),p)]),this._supportsExceedsLimitQuery||this._updatingHandles.add((()=>this.maxTotalSnapshotVertices),(()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal))))})).catch((()=>{}))}_modeChanged(){switch(this.mode){case"tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.featureTiles.addClient());break;default:o.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case"snapshot":null!=this._tilesHandle&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0),this.notifyChange("maxTotalSnapshotVertices"),this._refetch({resetForceTilesMode:!0})}_effectiveDisplayFilterChanged(){"snapshot"!==this.mode&&this._refetch({resetForceTilesMode:!1})}_applyEdits(e){const t=this.layerView.layer;null!=this._tileFetcher&&this._tileFetcher.applyEdits(e).then((e=>{if(e){if(!this._lifeCycleAbortController)throw c();e.exceededTransferLimit&&"refresh"in t?t.refresh():(e.deletedFeatures.length||e.updatedFeatures.length||e.addedFeatures.length)&&this._updatingHandles.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}})).catch((e=>{if(!d(e))throw e}))}_availableFieldsChanged(e,t){null!=this._tileFetcher&&P(this._tileFetcher.availableFields,t)&&this._refetch({resetForceTilesMode:!1})}_requiredFieldsChanged(e,t){null!=this._tileFetcher&&P(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){const t=this.layerView.layer,i=t.createQuery();return i.returnGeometry=!1,i.outStatistics=[new S({statisticType:"exceedslimit",maxVertexCount:e,outStatisticFieldName:"exceedslimit",maxPointCount:1e8,maxRecordCount:1e8})],t.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),i}_createDataInfoQuery(){const e=this.layerView.layer,t=this.layerView,i=e.createQuery();return i.returnGeometry=!1,i.outSpatialReference=this.layerView.view.spatialReference,e.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),t.effectiveDisplayFilter&&(i.where=g(i.where,t.effectiveDisplayFilter.where)),i}_fullExtentIsAccurate(){const e=this.layerView.layer;if("definitionExpression"in e&&e.definitionExpression)return!1;switch(e.type){case"feature":case"catalog-footprint":case"oriented-imagery":return w(e.url);case"csv":case"geojson":case"ogc-feature":case"wfs":return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(t){d(t)||this._set("serviceDataExtent",a(this.layerView.fullExtentInLocalViewSpatialReference)??null)}}async _tryUpdateServiceDataExtent(e){const t=this.layerView,i=t.layer,r=i.capabilities?.query.supportsExtent??!1,s=a(t.fullExtentInLocalViewSpatialReference),o=i.fullExtent,l=this._fullExtentIsAccurate(),n=this.serviceDataCount;if(r&&n<=N.maxFeatureCountForExtent&&(!s||!l)&&"queryExtent"in i){const t=this._createDataInfoQuery(),r=await i.queryExtent(t,{timeout:N.queryExtentTimeout,signal:e});this._set("serviceDataExtent",r.extent)}else if(s)this._set("serviceDataExtent",s);else if(null!=o){const e=o.spatialReference?await D(o,t.view.spatialReference):null;this._set("serviceDataExtent",e??null)}else this._set("serviceDataExtent",null)}async _updateServiceDataCount(e){const t=this.layerView.layer;if(!("queryFeatureCount"in t)||!has("featurelayer-snapshot-enabled"))return void this._set("serviceDataCount",N.noServiceDataCount);const r=await i(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:N.queryStatisticsTimeout,signal:e}));if(!0===r.ok)this._set("serviceDataCount",r.value);else{if(d(r.error))throw r.error;this._set("serviceDataCount",N.noServiceDataCount)}}get _supportsExceedsLimitQuery(){const e=this.layerView.layer;return null!=e.capabilities&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case"point":case"multipoint":return 1;case"polygon":return 4;case"polyline":return 2;case"multipatch":case"mesh":return 3;default:return 0}}async _updateSnapshotLimit(e,t,r){if(null==e?.averageSymbolComplexity)return void(this._snapshotLimitExceeded=!1);const{maximumTotalNumberOfVertices:s,averageSymbolComplexity:a}=e,{verticesPerFeature:o,verticesPerCoordinate:l}=a,n=o<=0,u=this._minimumNumberOfVerticesForGeometry>1;if(!n&&!u)return void(this._snapshotLimitExceeded=!1);0!==o&&null!=t&&await t;const h=Math.min(s,I),c=this.serviceDataCount,p=c!==N.noServiceDataCount;let m=p?Math.ceil((h-c*o)/(l||1)):Math.ceil(h/(l||1));if(u&&(m=Math.min(m,q)),p&&this._minimumNumberOfVerticesForGeometry*c>m)return void(this._snapshotLimitExceeded=!0);if(!this._supportsExceedsLimitQuery||!has("featurelayer-snapshot-enabled"))return void(this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>m);const f=await i(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(m),{timeout:N.queryStatisticsTimeout,signal:r}));if(!1===f.ok){if(d(f.error))throw f.error;return void(this._snapshotLimitExceeded=!1)}const y=f.value.features[0];this._snapshotLimitExceeded=!!y?.attributes&&!!y.attributes.exceedslimit}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo(),await C(this.layerView.layer);let e=new AbortController;const t=e.signal,i=this._updateServiceDataCount(t),r=Promise.allSettled([i,this._updateSnapshotLimit(this.displayFeatureLimit,i,t)]),s=r.then((()=>this._updateServiceDataExtent(t))).catch((e=>{d(e)||o.getLogger(this).error("#fetchServiceDataInfo()",e)})).then((()=>{s===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null}));return e&&(this._fetchDataInfoPromise=s),this._fetchDataInfoAbortController=e,r.then((()=>{}),(()=>{}))}_cancelFetchServiceDataInfo(){const e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get performanceInfo(){return{storedFeatures:this._tileFetcher?.storedFeatures??0,totalFeatures:this._tileFetcher?.totalFeatures??0,totalVertices:this._tileFetcher?.totalVertices??0,missingTiles:this._tileFetcher?.missingTiles??0}}};e([F({readOnly:!0})],L.prototype,"type",void 0),e([F({constructOnly:!0})],L.prototype,"graphics",void 0),e([F({constructOnly:!0})],L.prototype,"layerView",void 0),e([F({constructOnly:!0})],L.prototype,"context",void 0),e([F({readOnly:!0})],L.prototype,"dataUpdating",null),e([F()],L.prototype,"extent",null),e([F()],L.prototype,"updating",null),e([F({readOnly:!0})],L.prototype,"_updatingHandles",void 0),e([F()],L.prototype,"updatingTotal",null),e([F()],L.prototype,"updatingRemaining",null),e([F()],L.prototype,"expectedFeatureDiff",null),e([F()],L.prototype,"memoryForUnusedFeatures",null),e([F()],L.prototype,"maximumNumberOfFeaturesExceeded",null),e([F({readOnly:!0})],L.prototype,"serviceDataExtent",void 0),e([F({readOnly:!0})],L.prototype,"serviceDataCount",void 0),e([F()],L.prototype,"_snapshotLimitExceeded",void 0),e([F()],L.prototype,"displayFeatureLimit",void 0),e([F({type:Number})],L.prototype,"maximumNumberOfFeatures",null),e([F({readOnly:!0})],L.prototype,"hasAllFeatures",null),e([F({readOnly:!0})],L.prototype,"hasAllFeaturesInView",null),e([F({readOnly:!0})],L.prototype,"hasFullGeometries",null),e([F()],L.prototype,"_forceTilesMode",void 0),e([F({readOnly:!0})],L.prototype,"mode",null),e([F({readOnly:!0})],L.prototype,"maxTotalSnapshotVertices",null),e([F({readOnly:!0})],L.prototype,"tileDescriptors",null),e([F()],L.prototype,"_tileFetcher",void 0),e([F()],L.prototype,"_fetchDataInfoPromise",void 0),L=e([x("esri.layers.graphics.controllers.FeatureTileController3D")],L);const O=1e4,I=1e6,A=12e3,j=1e4,q=5e6;function P(e,t){if(!t)return!1;for(const i of t)if(!e.has(i))return!0;return!1}var N;!function(e){function t(){e.maxFeatureCountForExtent=O,e.queryStatisticsTimeout=A,e.queryExtentTimeout=j}e.noServiceDataCount=1/0,e.maxSnapshotMinScaleFactor=5,e.reset=t}(N||(N={})),N.reset();export{L as FeatureTileController3D,N as FeatureTileController3DConstants};
|