@arcgis/core 4.34.0-next.1 → 4.34.0-next.11
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/ExperienceBuilder/sketchUtils.d.ts +1 -0
- package/applications/ExperienceBuilder/sketchUtils.js +1 -1
- package/arcade/Voxel.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/0039dee1337160366112.js +1 -0
- package/assets/esri/core/workers/chunks/{54ea93f416ab52b413c1.js → 076f830d6d0337dfce9d.js} +1 -1
- package/assets/esri/core/workers/chunks/09907c9ff597df9bc954.js +1 -0
- package/assets/esri/core/workers/chunks/0dbb350ce651bc236ec8.js +1 -0
- package/assets/esri/core/workers/chunks/0ed4ec00ef16aa58a33d.js +1 -0
- package/assets/esri/core/workers/chunks/{ead5d4e271effc04def3.js → 1415d4e2f5f3193be004.js} +1 -1
- package/assets/esri/core/workers/chunks/18011c691e0aca4144dd.js +1 -0
- package/assets/esri/core/workers/chunks/1dc1084eb34748a35d35.js +1 -0
- package/assets/esri/core/workers/chunks/1f315f0eeb26dad1addd.js +1 -0
- package/assets/esri/core/workers/chunks/2254989ca3ff3960f2fe.js +1 -0
- package/assets/esri/core/workers/chunks/2dc54925d473a959119c.js +1 -0
- package/assets/esri/core/workers/chunks/2ddb776434a93b8d9e63.js +1 -0
- package/assets/esri/core/workers/chunks/2e1ceff3f88a6c78dfa2.js +1 -0
- package/assets/esri/core/workers/chunks/{847e88e1d6da1e74cdc8.js → 2ecc1057d53e0b4a60b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{ece68a25651ef03fc95d.js → 342f61e784c9364a493b.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/{1c86aa3802d9ae0230ae.js → 3916879b9ca8c6979011.js} +1 -1
- package/assets/esri/core/workers/chunks/3adcf78ed1e7cd82666d.js +1 -0
- package/assets/esri/core/workers/chunks/3ae2e9f469020f777d9f.js +1 -0
- package/assets/esri/core/workers/chunks/3b63edcd34f832ac7bd8.js +1 -0
- package/assets/esri/core/workers/chunks/3cbc498388fb1931a9f8.js +1 -0
- package/assets/esri/core/workers/chunks/{b0522dffa5600345c07e.js → 3e85e63148b5e93d3074.js} +1 -1
- package/assets/esri/core/workers/chunks/4088f4c25a09932a3eb1.js +1 -0
- package/assets/esri/core/workers/chunks/427318722815bef1496b.js +1 -0
- package/assets/esri/core/workers/chunks/462cc6966d060be59c7c.js +1 -0
- package/assets/esri/core/workers/chunks/464c15b2779f9b803a06.js +1 -0
- package/assets/esri/core/workers/chunks/467cacb501b0417bb4df.js +1 -0
- package/assets/esri/core/workers/chunks/49089731ecfe7e8bb2f6.js +1 -0
- package/assets/esri/core/workers/chunks/4c3bd6cc0badb78c7112.js +1 -0
- package/assets/esri/core/workers/chunks/4e0bae3671fe1c7efa76.js +1 -0
- package/assets/esri/core/workers/chunks/500fb5f615f0c1db1b66.js +1 -0
- package/assets/esri/core/workers/chunks/52c34d6ecd9d45a33e69.js +1 -0
- package/assets/esri/core/workers/chunks/539541dec5fcf3b657aa.js +1 -0
- package/assets/esri/core/workers/chunks/{fa63b0f7fa799cb2f81d.js → 562800b0af52a38a311b.js} +1 -1
- package/assets/esri/core/workers/chunks/{b87fec1753f164c845c5.js → 58f403f956b7b3467344.js} +1 -1
- package/assets/esri/core/workers/chunks/5bfcb3d87380e7f85b08.js +1 -0
- package/assets/esri/core/workers/chunks/5d3246b8fc50f9d9e2c4.js +1 -0
- package/assets/esri/core/workers/chunks/5e539ce4751bcfa57145.js +1 -0
- package/assets/esri/core/workers/chunks/{6ee41e9c92ed8ba4c763.js → 5ef1095842e21090f1f4.js} +1 -1
- package/assets/esri/core/workers/chunks/6194636638b0439fccd8.js +1 -0
- package/assets/esri/core/workers/chunks/{9fc35ec8185beba96715.js → 632d1a1287dde980479e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1d043965dcdc11b3aeaa.js → 63852887b3f07d50f7c9.js} +1 -1
- package/assets/esri/core/workers/chunks/6a86fee4e945e61d9639.js +1 -0
- package/assets/esri/core/workers/chunks/6b0ae9ccdd1acef5b5b4.js +1 -0
- package/assets/esri/core/workers/chunks/6d90887dc605261dd7b3.js +1 -0
- package/assets/esri/core/workers/chunks/72ea996b03932c0f004f.js +1 -0
- package/assets/esri/core/workers/chunks/7317346ed8d7c5bb859d.js +1 -0
- package/assets/esri/core/workers/chunks/74276044cb75b51967f2.js +1 -0
- package/assets/esri/core/workers/chunks/766e08d0c56b2b31b63b.js +1 -0
- package/assets/esri/core/workers/chunks/{bd7b54db7fd278b15500.js → 7a2189614f2dad49ffcd.js} +1 -1
- package/assets/esri/core/workers/chunks/7ae88c141a5d85e5bb88.js +1 -0
- package/assets/esri/core/workers/chunks/7aef81778155be373d3e.js +1 -0
- package/assets/esri/core/workers/chunks/7e1906d35a764f7f10b0.js +1 -0
- package/assets/esri/core/workers/chunks/7fa46d1e9fcd8c0c6302.js +1 -0
- package/assets/esri/core/workers/chunks/{06eb4832b6c86744e52e.js → 8008f5479f4d16964088.js} +1 -1
- package/assets/esri/core/workers/chunks/80777a9db53bee2ad8a8.js +1 -0
- package/assets/esri/core/workers/chunks/83db8bd42f94f97c7cf1.js +1 -0
- package/assets/esri/core/workers/chunks/88b1214c284c2ec7d51b.js +1 -0
- package/assets/esri/core/workers/chunks/91d484960df25ec9554b.js +1 -0
- package/assets/esri/core/workers/chunks/92a5dccb328229a9336b.js +1 -0
- package/assets/esri/core/workers/chunks/948c5454881e661c3bdc.js +1 -0
- package/assets/esri/core/workers/chunks/{631205dc4d73d49ec9ed.js → 95507ff0a243e451b99e.js} +1 -1
- package/assets/esri/core/workers/chunks/9cb242dfc3765b590f51.js +1 -0
- package/assets/esri/core/workers/chunks/{1051a5a57b2fb843a555.js → 9cd55043f3d789f41815.js} +1 -1
- package/assets/esri/core/workers/chunks/9ddb0b07be31c3747238.js +1 -0
- package/assets/esri/core/workers/chunks/9f0f1472f36b42c507d1.js +1 -0
- package/assets/esri/core/workers/chunks/{ac2607f1e8cd2e99907c.js → 9f964467f7353039dd9c.js} +3 -3
- package/assets/esri/core/workers/chunks/a1a42b0d7cd47b647f8a.js +1 -0
- package/assets/esri/core/workers/chunks/a2e9141ff4efd13413a1.js +66 -0
- package/assets/esri/core/workers/chunks/a622ed3f182648ab3ff6.js +1 -0
- package/assets/esri/core/workers/chunks/a693cd3af2e995972252.js +1 -0
- package/assets/esri/core/workers/chunks/a6fb75929e456f87f804.js +1 -0
- package/assets/esri/core/workers/chunks/aaa564c84ee8ea36fbb4.js +1 -0
- package/assets/esri/core/workers/chunks/ad4f65d764654c70a117.js +1 -0
- package/assets/esri/core/workers/chunks/af0d7a7cbbaad47a49c6.js +1 -0
- package/assets/esri/core/workers/chunks/af2f2df3c43b49ad1a70.js +1 -0
- package/assets/esri/core/workers/chunks/b09539a4b491a90a6bbe.js +1 -0
- package/assets/esri/core/workers/chunks/{d9b2263e0a9f9068ab62.js → b6c3a2d93a59df9a1418.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7b640f7a181bd26c7c7.js → bac5e1d50b69f0d94694.js} +1 -1
- package/assets/esri/core/workers/chunks/bbbd58b02a3ee8fe595e.js +1 -0
- package/assets/esri/core/workers/chunks/{9ca480eb8b2312381ccf.js → bcadcb709e622f2aaaf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{6993a59cbb78bc26f029.js → c45a314ace9725aa250e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c16e0da7a19310c71e8b.js → c6cd8784a3e222eb2d4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{571252c9822d73cf7b01.js → c6fa79ce324122e08dbb.js} +1 -1
- package/assets/esri/core/workers/chunks/c8856370bae65d9eeb2b.js +1 -0
- package/assets/esri/core/workers/chunks/{97c148adf0347c69a79c.js → c9604f8df909ec4fad46.js} +1 -1
- package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +1 -0
- package/assets/esri/core/workers/chunks/{faa40ef04604c7cce706.js → cb63ea6a53d3c2fc3179.js} +1 -1
- package/assets/esri/core/workers/chunks/cfc5e0ec9b0290407383.js +1 -0
- package/assets/esri/core/workers/chunks/{9a06476b834584d00d5c.js → d0372bac0c5f4fbed468.js} +1 -1
- package/assets/esri/core/workers/chunks/d28d874c1337b69fedc0.js +1 -0
- package/assets/esri/core/workers/chunks/{54f4a1131f99468db076.js → d33a5d79f2163ad62b1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bbb38f59f37c51c72f0.js → d45a4e5806a80b69ceec.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a23dc625a812a562c21.js → d5f770302dc686e55ba7.js} +1 -1
- package/assets/esri/core/workers/chunks/d942cb9cf82b1c056979.js +1 -0
- package/assets/esri/core/workers/chunks/dc14507cfc052faa5890.js +1 -0
- package/assets/esri/core/workers/chunks/{ca60b34c3e1ed2ff5934.js → dd2b316baae02bbdddac.js} +1 -1
- package/assets/esri/core/workers/chunks/dea3e131bbd48cc48e1a.js +346 -0
- package/assets/esri/core/workers/chunks/df84863cb0600f658541.js +1 -0
- package/assets/esri/core/workers/chunks/e0ae33206f519b159b49.js +1 -0
- package/assets/esri/core/workers/chunks/e7589c39b13295af8f1d.js +1 -0
- package/assets/esri/core/workers/chunks/e7a440476cd1eb4c6547.js +1 -0
- package/assets/esri/core/workers/chunks/{e3c1aea34ece8336dae1.js → e9aa1d9ded8a52a40c57.js} +1 -1
- package/assets/esri/core/workers/chunks/eb23ce385b0d18959c7c.js +1 -0
- package/assets/esri/core/workers/chunks/ec922f876e1465d36045.js +1 -0
- package/assets/esri/core/workers/chunks/{80b596496800e8d60eb8.js → ed75e0962358523f4439.js} +1 -1
- package/assets/esri/core/workers/chunks/ede9738ac20e7dd5ce63.js +1 -0
- package/assets/esri/core/workers/chunks/eec034d88db320880133.js +1 -0
- package/assets/esri/core/workers/chunks/f2aa8090827086c62dde.js +1 -0
- package/assets/esri/core/workers/chunks/f48eb59b94ba8b7d4d72.js +1 -0
- package/assets/esri/core/workers/chunks/f5741d09fd4e1809f580.js +1 -0
- package/assets/esri/core/workers/chunks/fe3832107278244dc04d.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.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/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/chunks/FocusAreaColor.glsl.js +10 -8
- package/chunks/FocusAreaMask.glsl.js +1 -1
- package/chunks/Laserlines.glsl.js +2 -2
- package/chunks/aiServices.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/vec42.js +1 -1
- package/config.js +1 -1
- package/core/accessorSupport/decorators/persistable.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/effects/FocusArea.d.ts +4 -0
- package/effects/FocusArea.js +5 -0
- package/effects/FocusAreaOutline.d.ts +4 -0
- package/effects/FocusAreaOutline.js +5 -0
- package/effects/FocusAreas.d.ts +4 -0
- package/effects/FocusAreas.js +5 -0
- package/form/elements/GroupElement.js +1 -1
- package/form/elements/inputs.js +1 -1
- package/form/elements.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/frustum.js +1 -1
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/geometry/support/meshUtils/extent.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/geometry.js +1 -1
- package/interfaces.d.ts +745 -555
- package/intl/date.js +1 -1
- package/intl/number.js +1 -1
- package/kernel.js +1 -1
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/GroupLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.js +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/editingSupport.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/ImageryTileMixin.js +1 -1
- package/layers/mixins/operationalLayerModuleMap.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/BuildingSummaryStatistics.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/PromiseQueue.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/TelemetryDisplay.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/featurePopupQueryUtils.js +5 -0
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/multiLayerServiceUtils.js +5 -0
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/networks/CircuitManager.js +1 -1
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/UNTraceConfiguration.js +1 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/webScene.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/portalItemUtils.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rasterRenderers.js +1 -1
- package/renderers/RasterStretchRenderer.js +1 -1
- package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/renderers.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/knowledgeGraph/GraphAddFieldIndexResult.js +5 -0
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphAddPropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphDataModelOperationResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
- package/rest/knowledgeGraph/GraphDeletePropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/locator/locationToAddress.js +1 -1
- package/rest/networks/circuits/queryCircuits.js +1 -1
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
- package/rest/networks/queryAssociations.js +1 -1
- package/rest/networks/support/CircuitPath.js +5 -0
- package/rest/networks/support/CircuitPathConnectivityElement.js +5 -0
- package/rest/networks/support/CircuitTraceResult.js +5 -0
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/networks/unitIdentifiers/support/{QueryUnitIdentifiersParamters.js → QueryUnitIdentifiersParameters.js} +1 -1
- package/rest/support/LocationToAddressParameters.js +1 -1
- package/rest/support/geocodeEnums.js +5 -0
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/renderers/predominance.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.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/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -0
- package/symbols/support/ElevationInfo.js +1 -1
- package/symbols/support/FeatureExpressionInfo.d.ts +4 -0
- package/symbols/support/FeatureExpressionInfo.js +1 -1
- package/symbols/support/cimSymbolUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/ViewStateManager.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
- package/views/2d/engine/webgl/animations/infos.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/animations/utils.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/Colorize.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/Opacity.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechniques.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/enums.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.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/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/utils.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/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/LocalAtmosphere.js +1 -1
- package/views/3d/environment/MarsAtmosphere.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/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/support/Segment.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.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/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/SubView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.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/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.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/objectResourceUtils.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/support/DefinitionExpressionSceneLayerView.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/engineContent/marker.js +1 -1
- package/views/3d/support/geometryUtils/sphere.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl/RenderNode.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/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
- 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/focusArea/FocusAreaOutlineItem.js +5 -0
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/support/GraphicMover.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/CatalogDynamicGroupLayerView.js +1 -1
- package/views/layers/CatalogFootprintLayerView.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/PointCloudLayerView.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/TextureCompressionTracker.js +5 -0
- package/views/support/imageReprojection.js +1 -1
- package/views/support/projectionUtils.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/webdoc/support/writeUtils.js +1 -1
- package/webmap/utils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Directions/DirectionsVisibleElements.js +1 -1
- package/widgets/Directions/css.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/SketchController.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/Expand.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/VisibleElements.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Search/LocatorSearchSource.js +1 -1
- package/widgets/Search/SearchSource.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/ShadowCast/DiscreteOptions.js +1 -1
- package/widgets/ShadowCast/DurationOptions.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ShadowCastVisibleElements.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.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/UtilityNetworkAssociations/utils/isFromElement.js +1 -1
- package/widgets/support/tests.js +1 -1
- package/assets/esri/core/workers/chunks/003ddb190a5cc56f7925.js +0 -1
- package/assets/esri/core/workers/chunks/0624ae07d3af8d5f1ac8.js +0 -1
- package/assets/esri/core/workers/chunks/094e8aae6dada24c8115.js +0 -1
- package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +0 -1
- package/assets/esri/core/workers/chunks/0b70b2ee62904318a12c.js +0 -1
- package/assets/esri/core/workers/chunks/0c2dccec20c0994366fe.js +0 -1
- package/assets/esri/core/workers/chunks/0cf979a093e9744d1e80.js +0 -1
- package/assets/esri/core/workers/chunks/0fb5de3f8a4d69b2d514.js +0 -1
- package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +0 -1
- package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +0 -1
- package/assets/esri/core/workers/chunks/24327d01cb2c5c55a4b7.js +0 -1
- package/assets/esri/core/workers/chunks/253bcc3cc7bc4c2dc6ea.js +0 -1
- package/assets/esri/core/workers/chunks/2b1486a466760d2152f5.js +0 -1
- package/assets/esri/core/workers/chunks/2cf82d3645c75d311e99.js +0 -1
- package/assets/esri/core/workers/chunks/2d90806faa4269828948.js +0 -1
- package/assets/esri/core/workers/chunks/306e262f148b3057b11b.js +0 -1
- package/assets/esri/core/workers/chunks/32ee2708edd307954125.js +0 -1
- package/assets/esri/core/workers/chunks/36b0d6b4089a96475201.js +0 -1
- package/assets/esri/core/workers/chunks/377a7f0f7d304ff9fe5b.js +0 -1
- package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +0 -1
- package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +0 -1
- package/assets/esri/core/workers/chunks/3d7eedb787c1e3b9fbfc.js +0 -1
- package/assets/esri/core/workers/chunks/3fe7be535affae31de7e.js +0 -1
- package/assets/esri/core/workers/chunks/40f54c4f8ae63c6f3df9.js +0 -1
- package/assets/esri/core/workers/chunks/417293f00b2c21cc3175.js +0 -1
- package/assets/esri/core/workers/chunks/41cbba9b286cf5558a9c.js +0 -1
- package/assets/esri/core/workers/chunks/42d9989b2aad3ac28d4d.js +0 -1
- package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +0 -1
- package/assets/esri/core/workers/chunks/4ca0738ed38c15b68a77.js +0 -1
- package/assets/esri/core/workers/chunks/515e3295495d0958db7e.js +0 -1
- package/assets/esri/core/workers/chunks/51c31e6d014005107d42.js +0 -1
- package/assets/esri/core/workers/chunks/523046e04679e301797d.js +0 -1
- package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +0 -1
- package/assets/esri/core/workers/chunks/55f087bca75c3f2a4515.js +0 -1
- package/assets/esri/core/workers/chunks/5617532299f73d186968.js +0 -1
- package/assets/esri/core/workers/chunks/56d2a20c1b143697aa19.js +0 -1
- package/assets/esri/core/workers/chunks/585c7b485c42555ec554.js +0 -346
- package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +0 -1
- package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +0 -1
- package/assets/esri/core/workers/chunks/5e1f7fe6bbc5754efee1.js +0 -1
- package/assets/esri/core/workers/chunks/62b2d3720693c93a60f2.js +0 -1
- package/assets/esri/core/workers/chunks/66e79aa02b3aa12b3778.js +0 -1
- package/assets/esri/core/workers/chunks/67338948e470c1251d8a.js +0 -66
- package/assets/esri/core/workers/chunks/6b23ca6570357f9fb724.js +0 -1
- package/assets/esri/core/workers/chunks/6d1e1a4fcb90ea8b6848.js +0 -1
- package/assets/esri/core/workers/chunks/6ecc3a3737ae8622dfa4.js +0 -1
- package/assets/esri/core/workers/chunks/85efb318cda7260221ae.js +0 -1
- package/assets/esri/core/workers/chunks/86023cc5ccbc7ac43479.js +0 -1
- package/assets/esri/core/workers/chunks/87eca6de502d18d8b7eb.js +0 -1
- package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +0 -1
- package/assets/esri/core/workers/chunks/937b653b10e8704b38bf.js +0 -1
- package/assets/esri/core/workers/chunks/98ef17d15517368d2383.js +0 -1
- package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +0 -1
- package/assets/esri/core/workers/chunks/a036503087baa1f9fd00.js +0 -1
- package/assets/esri/core/workers/chunks/a0c35521e677459f6fa3.js +0 -1
- package/assets/esri/core/workers/chunks/aaa6d45316a7d3466d0f.js +0 -1
- package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +0 -1
- package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +0 -1
- package/assets/esri/core/workers/chunks/b5d68d8460b7c15001dd.js +0 -1
- package/assets/esri/core/workers/chunks/bf3555f91492a1a3b613.js +0 -1
- package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +0 -1
- package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +0 -1
- package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +0 -1
- package/assets/esri/core/workers/chunks/c9ab067b07d1eab974d1.js +0 -1
- package/assets/esri/core/workers/chunks/d2ebb72a43d995ed368a.js +0 -1
- package/assets/esri/core/workers/chunks/d3d98ea5b5e56fc60a31.js +0 -1
- package/assets/esri/core/workers/chunks/d52f5214a0330ed2e05e.js +0 -1
- package/assets/esri/core/workers/chunks/d839a237d5edc243d645.js +0 -1
- package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +0 -1
- package/assets/esri/core/workers/chunks/df7ca2fe12e22ccfde17.js +0 -1
- package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +0 -1
- package/assets/esri/core/workers/chunks/e04bcc98a557f77cc6fa.js +0 -1
- package/assets/esri/core/workers/chunks/e77371ddbaf4b2d9be8d.js +0 -1
- package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +0 -1
- package/assets/esri/core/workers/chunks/ee6240636d04d7d37b7b.js +0 -1
- package/assets/esri/core/workers/chunks/f00f8609bf0d14b488b8.js +0 -1
- package/assets/esri/core/workers/chunks/fc0a3db3d6d26c763fb9.js +0 -1
- package/assets/esri/core/workers/chunks/fc61d02286b6ff5447cc.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerTechnique.js +0 -5
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedShader.js +0 -5
- package/views/FocusArea.js +0 -5
- package/views/FocusAreaOutline.js +0 -5
- package/views/FocusAreaOutlineItem.js +0 -5
- package/views/FocusAreas.js +0 -5
- package/views/support/TextureCompressionHandle.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import s from"../../../core/PooledArray.js";import r from"../../../core/Promise.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{watch as d,initial as o,sync as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as u}from"../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../geometry/support/aaBoundingRect.js";import{PromiseQueue as c}from"../../support/PromiseQueue.js";import{viewingModeFromString as p}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as g}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as m}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as y}from"../../../views/3d/layers/i3s/I3SIndex.js";import f from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as x,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import b from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as w}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as v,getIndexCrs as C,findIntersectingNodes as L}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as V}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as I}from"../../../views/3d/support/extentUtils.js";import{ClientType as A,maxDownloadSlots as S}from"../../../views/3d/support/index.js";import{minQuality as M}from"../../../views/3d/support/MemoryController.js";import{noBudget as F}from"../../../views/support/Scheduler.js";const O=100,P=2,U=1e4,q=1e-4,G=1.2,Q=500,j=1.5;let T=class extends(r.EsriPromiseMixin(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(A.I3S_INDEX);return new w(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(A.I3S_DATA);return new w(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return v(this.layer)}get crsIndex(){return C(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new s({deallocator:null}),this._modificationsNodeFilteringArray=new s,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new c,this._elevationUpdateNodes=new s({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new f(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then((([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:l}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([d((()=>r?.pointsOfInterest?.focus?.renderLocation),(e=>this._pointOfInterestChanged(e)),o),d((()=>r.quality),(()=>this._setCameraDirty()),n),d((()=>e.contentVisible),(e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=l.scheduler.registerIdleStateCallbacks(t,i)}),o),m(e.view.resourceController.scheduler,this),d((()=>[this.featureTarget,this.fixedFeatureTarget]),(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),d((()=>r.state?.contentCamera),(()=>this._setCameraDirty())),d((()=>t.elevationInfo),(e=>this._elevationInfoChanged(e))),d((()=>e.lodFactor),(()=>this._setCameraDirty())),d((()=>e.availableFields),(()=>this._requiredFieldsChange())),d((()=>e.holeFilling),(e=>null!=this._index&&(this._index.holeFilling=e)))]),this._viewportQueries=new D(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,p(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new g(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new y(p(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,(t=>e.isNodeLoaded(t)),(t=>e.isNodeReloading(t)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,x.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(t=>e.computeVisibilityObb?.(t)??null),e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",(e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)})))}this._startNodeLoading()})))}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._nodeLoader=null,k.prune()}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=R(e,i),r=R(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();E(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=_();I(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=H.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateUpdating(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(e,t){const i=this._index;if(null==i?.rootNode||null==t)return null;this.crsIndex.equals(t)||(u(e,t,B,this.crsIndex),e=B);const s=this._elevationUpdateNodes;return s.clear(),L(e,i.rootNode,i,(e=>s.push(e.index))),s.length&&(s.forAll((e=>i.updateElevationChanged(e))),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?this._disableMemCache=e:this._disableMemCache=!0}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateUpdating(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this._isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>Q){if(this._featureLOD<=q)return;this._featureLOD/=j,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=U||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*G||e&&i.estimate>t))return;if(this._featureLOD<=q)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(U,Math.max(q,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&!this.layerView.isNodeLoaded(s.index);s=t.getParent(s.index))if(this._enableFromGPUCache(s,x.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?O:P)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const r=this._index.getNode(s.add.back());if(null==r||r.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=P)&&(this._downloadingCount<S&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.updating=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=H.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-M)/(.5-M)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&!(null==this._index||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new b(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading(((e,t)=>this._removeNodes(e,t,z.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;k.clear(),this.layerView.getLoadedNodeIndices(k);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return k.filterInPlace((e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)})),k.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(k,e,z.pop),!(i&&this._lodDropFactor<1)&&(0===k.length||(k.clear(),!1))}markNodeToRemove(e){k.push(e)}removeMarkedNodes(){this._removeNodes(k,F,z.pop)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;i===z.fadeout&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,V.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateUpdating();try{const i=this.layerView.getLoadedAttributes(e.index),s=E(i,this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal)),t.signal)}catch(i){if(!a(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void i.getLogger(this).error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())})).catch((e=>{if(!a(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!a(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(t===x.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t?.attributeInfo&&E(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,x.Leaf))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule((()=>i.loadCachedNodeData(e,t,a)),t);if(null==d)return!1;const o=this._requiredAttributes,n=await this.reschedule((()=>this._loadAttributes(e,o,t)),t);return await this.reschedule((()=>i.addCachedNodeData(e,d,{loadedAttributes:o,attributeData:n},t)),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=N.Cached})).catch((t=>{if(!a(t))throw i.getLogger(this).error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([l({readOnly:!0})],T.prototype,"isMeshPyramid",null),e([l({readOnly:!0})],T.prototype,"isGraphics3D",null),e([l({readOnly:!0})],T.prototype,"useMaximumNumberOfFeatures",null),e([l({readOnly:!0})],T.prototype,"indexStreamController",null),e([l({readOnly:!0})],T.prototype,"dataStreamController",null),e([l({readOnly:!0})],T.prototype,"crsVertex",null),e([l({readOnly:!0})],T.prototype,"crsIndex",null),e([l()],T.prototype,"featureTarget",void 0),e([l()],T.prototype,"fixedFeatureTarget",void 0),e([l()],T.prototype,"layerView",void 0),e([l()],T.prototype,"layer",null),e([l()],T.prototype,"updating",void 0),e([l({readOnly:!0})],T.prototype,"running",null),e([l()],T.prototype,"updatingProgress",void 0),e([l({readOnly:!0})],T.prototype,"leavesReached",void 0),e([l({constructOnly:!0})],T.prototype,"worker",void 0),e([l({readOnly:!0,dependsOn:[]})],T.prototype,"rootNodeVisible",null),T=e([h("esri.layers.graphics.controllers.I3SOnDemandController")],T);const k=new s({deallocator:null});function E(e,t){return null!=e&&e.length===t.length&&e.every((e=>R(t,e.name)>=0))}function R(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const H={distancePenalty:10},B=_();var z;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(z||(z={}));export{T as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import s from"../../../core/PooledArray.js";import r from"../../../core/Promise.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{watch as d,initial as o,sync as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as u}from"../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../geometry/support/aaBoundingRect.js";import{PromiseQueue as c}from"../../support/PromiseQueue.js";import{viewingModeFromString as p}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as g}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as m}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as y}from"../../../views/3d/layers/i3s/I3SIndex.js";import f from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as x,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import b from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as w}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as v,getIndexCrs as C,findIntersectingNodes as L}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as V}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as I}from"../../../views/3d/support/extentUtils.js";import{ClientType as A,maxDownloadSlots as S}from"../../../views/3d/support/index.js";import{minQuality as M}from"../../../views/3d/support/MemoryController.js";import{noBudget as F}from"../../../views/support/Scheduler.js";const O=100,P=2,U=1e4,q=1e-4,G=1.2,Q=500,j=1.5;let T=class extends(r.EsriPromiseMixin(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(A.I3S_INDEX);return new w(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(A.I3S_DATA);return new w(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return v(this.layer)}get crsIndex(){return C(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new s({deallocator:null}),this._modificationsNodeFilteringArray=new s,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new c,this._elevationUpdateNodes=new s({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new f(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then((([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:l}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([d((()=>r?.pointsOfInterest?.focus?.renderLocation),(e=>this._pointOfInterestChanged(e)),o),d((()=>r.quality),(()=>this._setCameraDirty()),n),d((()=>e.contentVisible),(e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=l.scheduler.registerIdleStateCallbacks(t,i)}),o),m(e.view.resourceController.scheduler,this),d((()=>[this.featureTarget,this.fixedFeatureTarget]),(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),d((()=>r.state?.contentCamera),(()=>this._setCameraDirty())),d((()=>t.elevationInfo),(e=>this._elevationInfoChanged(e))),d((()=>e.lodFactor),(()=>this._setCameraDirty())),d((()=>e.availableFields),(()=>this._requiredFieldsChange())),d((()=>e.holeFilling),(e=>null!=this._index&&(this._index.holeFilling=e)))]),this._viewportQueries=new D(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,p(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new g(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new y(p(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,(t=>e.isNodeLoaded(t)),(t=>e.isNodeReloading(t)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,x.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(t=>e.computeVisibilityObb?.(t)??null),e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",(e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)})))}this._startNodeLoading()})))}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._nodeLoader=null,k.prune()}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=R(e,i),r=R(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();E(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=_();I(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=H.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateUpdating(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(e,t){const i=this._index;if(null==i?.rootNode||null==t)return null;this.crsIndex.equals(t)||(u(e,t,B,this.crsIndex),e=B);const s=this._elevationUpdateNodes;return s.clear(),L(e,i.rootNode,i,(e=>s.push(e.index))),s.length&&(s.forAll((e=>i.updateElevationChanged(e))),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?this._disableMemCache=e:this._disableMemCache=!0}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateUpdating(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this._isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>Q){if(this._featureLOD<=q)return;this._featureLOD/=j,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=U||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*G||e&&i.estimate>t))return;if(this._featureLOD<=q)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(U,Math.max(q,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&!this.layerView.isNodeLoaded(s.index);s=t.getParent(s.index))if(this._enableFromGPUCache(s,x.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?O:P)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const r=this._index.getNode(s.add.back());if(null==r||r.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=P)&&(this._downloadingCount<S&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.updating=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=H.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-M)/(.5-M)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&!(null==this._index||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new b(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading(((e,t)=>this._removeNodes(e,t,z.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;k.clear(),this.layerView.getLoadedNodeIndices(k);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return k.filterInPlace((e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)})),k.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(k,e,z.pop),!(i&&this._lodDropFactor<1)&&(0===k.length||(k.clear(),!1))}markNodeToRemove(e){k.push(e)}removeMarkedNodes(){this._removeNodes(k,F,z.pop)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;i===z.fadeout&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,V.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateUpdating();try{const i=this.layerView.getLoadedAttributes(e.index),s=E(i,this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal)),t.signal)}catch(i){if(!a(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void i.getLogger(this).error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())})).catch((e=>{if(!a(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!a(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(t===x.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t?.attributeInfo&&E(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,x.Leaf))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule((()=>i.loadCachedNodeData(e,t,a)),t);if(null==d)return!1;const o=this._requiredAttributes,n=await this.reschedule((()=>this._loadAttributes(e,o,t)),t);return await this.reschedule((()=>i.addCachedNodeData(e,d,{loadedAttributes:o,attributeData:n},t)),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=N.Cached})).catch((t=>{if(!a(t))throw i.getLogger(this).error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([l({readOnly:!0})],T.prototype,"isMeshPyramid",null),e([l({readOnly:!0})],T.prototype,"isGraphics3D",null),e([l({readOnly:!0})],T.prototype,"useMaximumNumberOfFeatures",null),e([l({readOnly:!0})],T.prototype,"indexStreamController",null),e([l({readOnly:!0})],T.prototype,"dataStreamController",null),e([l({readOnly:!0})],T.prototype,"crsVertex",null),e([l({readOnly:!0})],T.prototype,"crsIndex",null),e([l()],T.prototype,"featureTarget",void 0),e([l()],T.prototype,"fixedFeatureTarget",void 0),e([l()],T.prototype,"layerView",void 0),e([l()],T.prototype,"layer",null),e([l()],T.prototype,"updating",void 0),e([l({readOnly:!0})],T.prototype,"running",null),e([l()],T.prototype,"updatingProgress",void 0),e([l({readOnly:!0})],T.prototype,"leavesReached",void 0),e([l({constructOnly:!0})],T.prototype,"worker",void 0),e([l({readOnly:!0,dependsOn:[]})],T.prototype,"rootNodeVisible",null),T=e([h("esri.layers.graphics.controllers.I3SOnDemandController")],T);const k=new s({deallocator:null});function E(e,t){return null!=e&&e.length===t.length&&e.every((e=>R(t,e.name)>=0))}function R(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const H={distancePenalty:10},B=_();var z;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(z||(z={}));export{T 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{indexOf as e,PositionHint as t}from"../../../core/arrayUtils.js";import{toConst as s}from"../../../core/compilerUtils.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{clone as r}from"../../../core/lang.js";import{removeMaybe as a,destroyMaybe as n}from"../../../core/maybe.js";import{signalFromSignalOrOptions as u,throwIfAborted as l}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import{isSerializable as h}from"../../../core/support/jsonUtils.js";import{getTransformation as c}from"../../../geometry/projection.js";import{set as m,create as f,expandWithAABB as d,negativeInfinity as y}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as p,create as g}from"../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as x}from"../../../geometry/support/boundsUtils.js";import{isExtent as w,isPolygon as F}from"../../../geometry/support/jsonUtils.js";import{equals as _,isValid as S}from"../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as R}from"../featureConversionUtils.js";import{getWhereClause as I}from"./attributeSupport.js";import{cleanFromGeometryEngine as Q,getGeometry as j}from"./geometryUtils.js";import{project as E,projectMany as b}from"./projectionSupport.js";import{QueryEngineCache as A}from"./QueryEngineCache.js";import{queryCapabilities as T}from"./QueryEngineCapabilities.js";import{QueryEngineResult as v}from"./QueryEngineResult.js";import{queryEngineEmptyResult as C,normalizeAttributeBinsQuery as P,normalizeQuery as M}from"./queryUtils.js";import{validateAttributeBinsQuery as z,validateQuery as G,validateStatisticsQuery as O}from"./queryValidationUtils.js";import{getSpatialQueryOperator as U,canQueryWithRBush as q}from"./spatialQuerySupport.js";import{getTimeExtent as k,getTimeOperator as B}from"./timeSupport.js";import Z from"../../support/FieldsIndex.js";import{noBudget as H}from"../../../views/support/Scheduler.js";const N="unsupported-query";class J{constructor(e,t=null,s,i,r){this.attributes=e,this.geometry=s,this.centroid=i,this.filterFlags=r,this.groupId=-1,this.displayId=t}}class L{constructor(e){this._changeHandle=null,this.capabilities={query:T},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._cache=e.cache??new A,this.timeInfo=e.timeInfo,this.featureIdInfo=e.featureIdInfo,"object-id"===e.featureIdInfo.type&&(this.objectIdField=e.featureIdInfo.fieldName),this._changeHandle=this.featureStore.events.on("changed",(()=>this._clearCache())),this.fieldsIndex=h(e.fieldsIndex)?e.fieldsIndex:Z.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map((e=>e.name))):this.availableFields=new Set(e.availableFields.map((e=>this.fieldsIndex.get(e)?.name)).filter((e=>null!=e))),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._changeHandle=a(this._changeHandle),this._frameTask=a(this._frameTask),this._clearCache(),n(this._cache)}get featureAdapter(){return this.featureStore.featureAdapter}_clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=u(t);try{const t=await this._executeQuery(e,{},s);return await t.createQueryResponse()}catch(i){if(i!==C)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=u(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(i){if(i!==C)throw i;return 0}}async executeQueryForExtent(e,t){const s=u(t),i=e.outSR;try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=t.size;if(!r)return{count:0,extent:null};return{count:r,extent:await this._getBounds(t.items,t.spatialReference,i||this.spatialReference)}}catch(r){if(r===C)return{count:0,extent:null};throw r}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){const s=u(t);try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),i=t.items,r=new Set;return await this.reschedule((()=>{for(const e of i)r.add(t.featureAdapter.getObjectId(e))}),s),r}catch(i){if(i===C)return new Set;throw i}}async executeQueryForLatestObservations(e,t){const s=u(t);if(!this.timeInfo?.trackIdField)throw new i(N,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const t=await this._executeQuery(e,{},s);return await this.reschedule((()=>this._filterLatest(t)),s),await t.createQueryResponse()}catch(r){if(r!==C)throw r;return new v([],e,this).createQueryResponse()}}async executeAttributeBinsQuery(e,t){const s=u(t);let i;e=r(e);try{e=await this.schedule((()=>P(e,this.definitionExpression,this.spatialReference)),s),e=await this.reschedule((()=>z(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s);const t=await this.reschedule((()=>this._executeSceneFilterQuery(e,s)),s);i=await this.reschedule((()=>this._executeGeometryQuery(e,t,s)),s),await this.reschedule((()=>this._executeAggregateIdsQuery(i)),s),await this.reschedule((()=>this.executeObjectIdsQuery(i)),s),await this.reschedule((()=>this.executeTimeQuery(i)),s),await this.reschedule((()=>this.executeAttributesQuery(i)),s)}catch(a){if(a!==C)throw a;i=new v([],e,this)}return i.createQueryBinsResponse(e)}async executeQueryForSummaryStatistics(e={},t,s){const i=u(s),{field:r,normalizationField:a,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:a,valueExpression:n},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=u(s),{field:r,field2:a,field3:n,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:r,field2:a,field3:n,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=u(s),{field:r,normalizationField:a,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:a,valueExpression:n},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=u(s),{field:r,normalizationField:a,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:a,valueExpression:n},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=u(e);this._timeExtentPromise||=k(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return l(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=m(f(),y);await this.featureStore.forEachBounds(e,(e=>d(i,e)));const r={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:Q(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(r.zmin=i[2],r.zmax=i[5],r.hasZ=!0);const a=E(r,t,s);if(a.spatialReference=Q(s),a.xmax-a.xmin===0){const e=o(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin===0){const e=o(a.spatialReference);a.ymin-=e,a.ymax+=e}if(this.hasZ&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin===0){const e=o(a.spatialReference);a.zmin-=e,a.zmax+=e}return a}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then((e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async schedule(e,t){return this._frameTask?.schedule(e,t)??e(H)}async reschedule(e,t){return this._frameTask?.reschedule(e,t)??e(H)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>await this.featureStore.forEach((t=>e.push(t))))().then((()=>s(e)))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=r(e),e=await this.schedule((()=>M(e,this.definitionExpression,this.spatialReference)),s),e=await this.reschedule((()=>G(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s),e={...e,...t};const i=await this.reschedule((()=>this._executeSceneFilterQuery(e,s)),s),a=await this.reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this.reschedule((()=>this._executeAggregateIdsQuery(a)),s),await this.reschedule((()=>this.executeObjectIdsQuery(a)),s),await this.reschedule((()=>this.executeTimeQuery(a)),s),await this.reschedule((()=>this.executeAttributesQuery(a)),s),a}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,a=this.featureStore.featureSpatialReference,n=e.sceneFilter.geometry,u=null==a||_(a,n.spatialReference)?n:E(n,a);if(!u)return null;const l=i||r,o=S(s)&&!_(this.spatialReference,s)&&l?async e=>this._project(e,s):e=>e,h=this.featureAdapter,c=await this.reschedule((()=>this.searchFeatures(V(u))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!c.length)return null;const s=new Set;for(const e of c)s.add(h.getObjectId(e));const i=await this.reschedule((()=>this._getAllFeatures()),t),r=await this.reschedule((async()=>{const r=await U("esriSpatialRelDisjoint",u,this.geometryType,this.hasZ,this.hasM),a=e=>!s.has(h.getObjectId(e))||r(h.getGeometry(e)),n=await this.runSpatialFilter(i,a,t);return new v(n,e,this)}),t);return o(r)}if(!c.length)return new v([],e,this);if(this._canExecuteSinglePass(u,e))return o(new v(c,e,this));const m=await U("esriSpatialRelContains",u,this.geometryType,this.hasZ,this.hasM),f=await this.runSpatialFilter(c,(e=>m(h.getGeometry(e))),t);return o(new v(f,e,this))}async _executeGeometryQuery(s,i,r){if(null!=i&&0===i.items.length)return i;const{geometry:a,outSR:n,returnGeometry:u,returnCentroid:l}=s,o=i?null:this._getCacheKey(s),h=o?this._cache.get(o):null;if(h)return new v(h,s,this);const c=S(n)&&!_(this.spatialReference,n),m=u||l,f=async e=>(c&&m&&await this._project(e,n),o&&this._cache.put(o,e.items),e),d=this.featureStore.featureSpatialReference,y=!a||null==d||_(d,a.spatialReference)?a:E(a,d);if(!y)return f(null!=i?i:await this._getAllFeaturesQueryEngineResult(s));const p=this.featureAdapter;let g=await this.reschedule((()=>this.searchFeatures(V(a))),r);const x=s.spatialRel??"esriSpatialRelIntersects";if("esriSpatialRelDisjoint"===x){if(!g.length)return f(null!=i?i:await this._getAllFeaturesQueryEngineResult(s));const e=new Set;for(const s of g)e.add(p.getObjectId(s));const t=null!=i?i.items:await this.reschedule((()=>this._getAllFeatures()),r),a=await this.reschedule((async()=>{const i=await U(x,y,this.geometryType,this.hasZ,this.hasM),a=t=>!e.has(p.getObjectId(t))||i(p.getGeometry(t)),n=await this.runSpatialFilter(t,a,r);return new v(n,s,this)}),r);return f(a)}if(null!=i){const s=new t;g=g.filter((t=>e(i.items,t,i.items.length,s)>=0))}if(!g.length){const e=new v([],s,this);return o&&this._cache.put(o,e.items),e}if(this._canExecuteSinglePass(y,s))return f(new v(g,s,this));const w=await U(x,y,this.geometryType,this.hasZ,this.hasM),F=await this.runSpatialFilter(g,(e=>w(p.getGeometry(e))),r);return f(new v(F,s,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const i of e.query.aggregateIds){this.aggregateAdapter.getFeatureObjectIds(i).forEach((e=>t.add(e)))}const s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}executeTimeQuery(e){if(0===e.items.length)return;const t=B(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}executeAttributesQuery(e){if(0===e.items.length)return;const t=I(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async runSpatialFilter(e,t,s){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let i=0;const r=new Array,a=async n=>{for(;i<e.length;){const u=e[i++];t(u)&&(r.push(u),n.madeProgress()),n.done&&await this.reschedule((e=>a(e)),s)}};return this.reschedule((e=>a(e)),s).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,a=new Map,n=this.featureAdapter.getAttribute;for(const u of e.items){const e=n(u,t),s=n(u,r),i=a.get(e);(!i||s>n(i,r))&&a.set(e,u)}e.items=Array.from(a.values())}_getCacheKey(e){const{geometry:t,spatialRel:s,returnGeometry:i,returnCentroid:r,outSR:a,resultType:n,cacheHint:u}=e;if("tile"!==n&&!u)return null;const l=i||r;return S(a)&&!_(this.spatialReference,a)&&l?JSON.stringify([t,s,a]):JSON.stringify([t,s])}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return q(e)&&("esriSpatialRelEnvelopeIntersects"===s||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===s||"esriSpatialRelContains"===s))}async _project(e,t){if(!t||_(this.spatialReference,t))return e;const i=this.featureAdapter;let r;try{const e=await this._getFullExtent();r=c(this.spatialReference,t,e)}catch{}const a=await b(e.items.map((e=>j(this.geometryType,this.hasZ,this.hasM,i.getGeometry(e)))),this.spatialReference,t,r);return e.items=s(a.map(((t,s)=>i.cloneWithGeometry(e.items[s],R(t,this.hasZ,this.hasM))))),e}async searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=r(e);try{e=await this.schedule((()=>M(e,this.definitionExpression,this.spatialReference)),s),e=await this.reschedule((()=>O(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s);const i=await this.reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this.reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this.reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this.reschedule((()=>this.executeObjectIdsQuery(r)),s),await this.reschedule((()=>this.executeTimeQuery(r)),s),await this.reschedule((()=>this.executeAttributesQuery(r)),s),r}catch(i){if(i!==C)throw i;return new v([],e,this)}}get test(){}}function V(e){if(q(e)){if(w(e))return[p(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if(F(e))return e.rings.map((e=>p(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[x(g(),e)]}export{J as Feature,L as QueryEngine,V as getQueryBBoxes};
|
|
5
|
+
import{indexOf as e,PositionHint as t}from"../../../core/arrayUtils.js";import{toConst as s}from"../../../core/compilerUtils.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{clone as r}from"../../../core/lang.js";import{removeMaybe as a,destroyMaybe as n}from"../../../core/maybe.js";import{signalFromSignalOrOptions as u,throwIfAborted as l}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import{isSerializable as h}from"../../../core/support/jsonUtils.js";import{getTransformation as c}from"../../../geometry/projectionUtils.js";import{set as m,create as f,expandWithAABB as d,negativeInfinity as y}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as p,create as g}from"../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as x}from"../../../geometry/support/boundsUtils.js";import{isExtent as w,isPolygon as F}from"../../../geometry/support/jsonUtils.js";import{equals as _,isValid as S}from"../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as R}from"../featureConversionUtils.js";import{getWhereClause as I}from"./attributeSupport.js";import{cleanFromGeometryEngine as Q,getGeometry as j}from"./geometryUtils.js";import{project as E,projectMany as b}from"./projectionSupport.js";import{QueryEngineCache as A}from"./QueryEngineCache.js";import{queryCapabilities as T}from"./QueryEngineCapabilities.js";import{QueryEngineResult as v}from"./QueryEngineResult.js";import{queryEngineEmptyResult as C,normalizeAttributeBinsQuery as P,normalizeQuery as M}from"./queryUtils.js";import{validateAttributeBinsQuery as z,validateQuery as G,validateStatisticsQuery as O}from"./queryValidationUtils.js";import{getSpatialQueryOperator as U,canQueryWithRBush as q}from"./spatialQuerySupport.js";import{getTimeExtent as k,getTimeOperator as B}from"./timeSupport.js";import Z from"../../support/FieldsIndex.js";import{noBudget as H}from"../../../views/support/Scheduler.js";const N="unsupported-query";class J{constructor(e,t=null,s,i,r){this.attributes=e,this.geometry=s,this.centroid=i,this.filterFlags=r,this.groupId=-1,this.displayId=t}}class L{constructor(e){this._changeHandle=null,this.capabilities={query:T},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._cache=e.cache??new A,this.timeInfo=e.timeInfo,this.featureIdInfo=e.featureIdInfo,"object-id"===e.featureIdInfo.type&&(this.objectIdField=e.featureIdInfo.fieldName),this._changeHandle=this.featureStore.events.on("changed",(()=>this._clearCache())),this.fieldsIndex=h(e.fieldsIndex)?e.fieldsIndex:Z.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map((e=>e.name))):this.availableFields=new Set(e.availableFields.map((e=>this.fieldsIndex.get(e)?.name)).filter((e=>null!=e))),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._changeHandle=a(this._changeHandle),this._frameTask=a(this._frameTask),this._clearCache(),n(this._cache)}get featureAdapter(){return this.featureStore.featureAdapter}_clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=u(t);try{const t=await this._executeQuery(e,{},s);return await t.createQueryResponse()}catch(i){if(i!==C)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=u(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(i){if(i!==C)throw i;return 0}}async executeQueryForExtent(e,t){const s=u(t),i=e.outSR;try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=t.size;if(!r)return{count:0,extent:null};return{count:r,extent:await this._getBounds(t.items,t.spatialReference,i||this.spatialReference)}}catch(r){if(r===C)return{count:0,extent:null};throw r}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){const s=u(t);try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),i=t.items,r=new Set;return await this.reschedule((()=>{for(const e of i)r.add(t.featureAdapter.getObjectId(e))}),s),r}catch(i){if(i===C)return new Set;throw i}}async executeQueryForLatestObservations(e,t){const s=u(t);if(!this.timeInfo?.trackIdField)throw new i(N,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const t=await this._executeQuery(e,{},s);return await this.reschedule((()=>this._filterLatest(t)),s),await t.createQueryResponse()}catch(r){if(r!==C)throw r;return new v([],e,this).createQueryResponse()}}async executeAttributeBinsQuery(e,t){const s=u(t);let i;e=r(e);try{e=await this.schedule((()=>P(e,this.definitionExpression,this.spatialReference)),s),e=await this.reschedule((()=>z(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s);const t=await this.reschedule((()=>this._executeSceneFilterQuery(e,s)),s);i=await this.reschedule((()=>this._executeGeometryQuery(e,t,s)),s),await this.reschedule((()=>this._executeAggregateIdsQuery(i)),s),await this.reschedule((()=>this.executeObjectIdsQuery(i)),s),await this.reschedule((()=>this.executeTimeQuery(i)),s),await this.reschedule((()=>this.executeAttributesQuery(i)),s)}catch(a){if(a!==C)throw a;i=new v([],e,this)}return i.createQueryBinsResponse(e)}async executeQueryForSummaryStatistics(e={},t,s){const i=u(s),{field:r,normalizationField:a,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:a,valueExpression:n},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=u(s),{field:r,field2:a,field3:n,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:r,field2:a,field3:n,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=u(s),{field:r,normalizationField:a,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:a,valueExpression:n},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=u(s),{field:r,normalizationField:a,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:a,valueExpression:n},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=u(e);this._timeExtentPromise||=k(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return l(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=m(f(),y);await this.featureStore.forEachBounds(e,(e=>d(i,e)));const r={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:Q(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(r.zmin=i[2],r.zmax=i[5],r.hasZ=!0);const a=E(r,t,s);if(a.spatialReference=Q(s),a.xmax-a.xmin===0){const e=o(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin===0){const e=o(a.spatialReference);a.ymin-=e,a.ymax+=e}if(this.hasZ&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin===0){const e=o(a.spatialReference);a.zmin-=e,a.zmax+=e}return a}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then((e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async schedule(e,t){return this._frameTask?.schedule(e,t)??e(H)}async reschedule(e,t){return this._frameTask?.reschedule(e,t)??e(H)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>await this.featureStore.forEach((t=>e.push(t))))().then((()=>s(e)))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=r(e),e=await this.schedule((()=>M(e,this.definitionExpression,this.spatialReference)),s),e=await this.reschedule((()=>G(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s),e={...e,...t};const i=await this.reschedule((()=>this._executeSceneFilterQuery(e,s)),s),a=await this.reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this.reschedule((()=>this._executeAggregateIdsQuery(a)),s),await this.reschedule((()=>this.executeObjectIdsQuery(a)),s),await this.reschedule((()=>this.executeTimeQuery(a)),s),await this.reschedule((()=>this.executeAttributesQuery(a)),s),a}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,a=this.featureStore.featureSpatialReference,n=e.sceneFilter.geometry,u=null==a||_(a,n.spatialReference)?n:E(n,a);if(!u)return null;const l=i||r,o=S(s)&&!_(this.spatialReference,s)&&l?async e=>this._project(e,s):e=>e,h=this.featureAdapter,c=await this.reschedule((()=>this.searchFeatures(V(u))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!c.length)return null;const s=new Set;for(const e of c)s.add(h.getObjectId(e));const i=await this.reschedule((()=>this._getAllFeatures()),t),r=await this.reschedule((async()=>{const r=await U("esriSpatialRelDisjoint",u,this.geometryType,this.hasZ,this.hasM),a=e=>!s.has(h.getObjectId(e))||r(h.getGeometry(e)),n=await this.runSpatialFilter(i,a,t);return new v(n,e,this)}),t);return o(r)}if(!c.length)return new v([],e,this);if(this._canExecuteSinglePass(u,e))return o(new v(c,e,this));const m=await U("esriSpatialRelContains",u,this.geometryType,this.hasZ,this.hasM),f=await this.runSpatialFilter(c,(e=>m(h.getGeometry(e))),t);return o(new v(f,e,this))}async _executeGeometryQuery(s,i,r){if(null!=i&&0===i.items.length)return i;const{geometry:a,outSR:n,returnGeometry:u,returnCentroid:l}=s,o=i?null:this._getCacheKey(s),h=o?this._cache.get(o):null;if(h)return new v(h,s,this);const c=S(n)&&!_(this.spatialReference,n),m=u||l,f=async e=>(c&&m&&await this._project(e,n),o&&this._cache.put(o,e.items),e),d=this.featureStore.featureSpatialReference,y=!a||null==d||_(d,a.spatialReference)?a:E(a,d);if(!y)return f(null!=i?i:await this._getAllFeaturesQueryEngineResult(s));const p=this.featureAdapter;let g=await this.reschedule((()=>this.searchFeatures(V(a))),r);const x=s.spatialRel??"esriSpatialRelIntersects";if("esriSpatialRelDisjoint"===x){if(!g.length)return f(null!=i?i:await this._getAllFeaturesQueryEngineResult(s));const e=new Set;for(const s of g)e.add(p.getObjectId(s));const t=null!=i?i.items:await this.reschedule((()=>this._getAllFeatures()),r),a=await this.reschedule((async()=>{const i=await U(x,y,this.geometryType,this.hasZ,this.hasM),a=t=>!e.has(p.getObjectId(t))||i(p.getGeometry(t)),n=await this.runSpatialFilter(t,a,r);return new v(n,s,this)}),r);return f(a)}if(null!=i){const s=new t;g=g.filter((t=>e(i.items,t,i.items.length,s)>=0))}if(!g.length){const e=new v([],s,this);return o&&this._cache.put(o,e.items),e}if(this._canExecuteSinglePass(y,s))return f(new v(g,s,this));const w=await U(x,y,this.geometryType,this.hasZ,this.hasM),F=await this.runSpatialFilter(g,(e=>w(p.getGeometry(e))),r);return f(new v(F,s,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const i of e.query.aggregateIds){this.aggregateAdapter.getFeatureObjectIds(i).forEach((e=>t.add(e)))}const s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}executeTimeQuery(e){if(0===e.items.length)return;const t=B(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}executeAttributesQuery(e){if(0===e.items.length)return;const t=I(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async runSpatialFilter(e,t,s){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let i=0;const r=new Array,a=async n=>{for(;i<e.length;){const u=e[i++];t(u)&&(r.push(u),n.madeProgress()),n.done&&await this.reschedule((e=>a(e)),s)}};return this.reschedule((e=>a(e)),s).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,a=new Map,n=this.featureAdapter.getAttribute;for(const u of e.items){const e=n(u,t),s=n(u,r),i=a.get(e);(!i||s>n(i,r))&&a.set(e,u)}e.items=Array.from(a.values())}_getCacheKey(e){const{geometry:t,spatialRel:s,returnGeometry:i,returnCentroid:r,outSR:a,resultType:n,cacheHint:u}=e;if("tile"!==n&&!u)return null;const l=i||r;return S(a)&&!_(this.spatialReference,a)&&l?JSON.stringify([t,s,a]):JSON.stringify([t,s])}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return q(e)&&("esriSpatialRelEnvelopeIntersects"===s||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===s||"esriSpatialRelContains"===s))}async _project(e,t){if(!t||_(this.spatialReference,t))return e;const i=this.featureAdapter;let r;try{const e=await this._getFullExtent();r=c(this.spatialReference,t,e)}catch{}const a=await b(e.items.map((e=>j(this.geometryType,this.hasZ,this.hasM,i.getGeometry(e)))),this.spatialReference,t,r);return e.items=s(a.map(((t,s)=>i.cloneWithGeometry(e.items[s],R(t,this.hasZ,this.hasM))))),e}async searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=r(e);try{e=await this.schedule((()=>M(e,this.definitionExpression,this.spatialReference)),s),e=await this.reschedule((()=>O(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s);const i=await this.reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this.reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this.reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this.reschedule((()=>this.executeObjectIdsQuery(r)),s),await this.reschedule((()=>this.executeTimeQuery(r)),s),await this.reschedule((()=>this.executeAttributesQuery(r)),s),r}catch(i){if(i!==C)throw i;return new v([],e,this)}}get test(){}}function V(e){if(q(e)){if(w(e))return[p(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if(F(e))return e.rings.map((e=>p(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[x(g(),e)]}export{J as Feature,L as QueryEngine,V as getQueryBBoxes};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as s}from"../../../core/arrayUtils.js";import{createResolver as t}from"../../../core/promiseUtils.js";import{initializeProjection as e,projectMany as n}from"../../../geometry/
|
|
5
|
+
import{isSome as s}from"../../../core/arrayUtils.js";import{createResolver as t}from"../../../core/promiseUtils.js";import{initializeProjection as e,projectMany as n}from"../../../geometry/projectionUtils.js";import{jsonAdapter as r}from"../../../geometry/geometryAdapters/json.js";import{isValid as i,equals as o,isWebMercator as a}from"../../../geometry/support/spatialReferenceUtils.js";import{canProject as m,lngLatToXY as u,xyToLngLat as l}from"../../../geometry/support/webMercatorUtils.js";const p=[0,0];function c(s,t){if(!t)return null;if("x"in t){const e={x:0,y:0};return[e.x,e.y]=s(t.x,t.y,p),null!=t.z&&(e.z=t.z),null!=t.m&&(e.m=t.m),e}if("xmin"in t){const e={xmin:0,ymin:0,xmax:0,ymax:0};return[e.xmin,e.ymin]=s(t.xmin,t.ymin,p),[e.xmax,e.ymax]=s(t.xmax,t.ymax,p),t.hasZ&&(e.zmin=t.zmin,e.zmax=t.zmax,e.hasZ=!0),t.hasM&&(e.mmin=t.mmin,e.mmax=t.mmax,e.hasM=!0),e}return"rings"in t?{rings:h(t.rings,s),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:h(t.paths,s),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:f(t.points,s),hasM:t.hasM,hasZ:t.hasZ}:null}function h(s,t){const e=[];for(const n of s)e.push(f(n,t));return e}function f(s,t){const e=[];for(const n of s){const s=t(n[0],n[1],[0,0]);e.push(s),n.length>2&&s.push(n[2]),n.length>3&&s.push(n[3])}return e}async function x(t,n){if(!t||!n)return;const r=Array.isArray(t)?t.map((s=>null!=s.geometry?s.geometry.spatialReference:null)).filter(s):[t];await e(r.map((s=>({source:s,dest:n}))))}const y=c.bind(null,u),g=c.bind(null,l);function j(s,t,e,u){if(!s)return null;if(e||(e=t,t=s.spatialReference),!i(t)||!i(e)||o(t,e))return s;if(m(t,e)){const t=a(e)?y(s):g(s);return t.spatialReference=e,t}return n(r,[s],t,e,null,u)[0]}class _{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(s,e,n,r){if(!s?.length||!e||!n||o(e,n))return s;const i={geometries:s,inSpatialReference:e,outSpatialReference:n,geographicTransformation:r,resolve:t()};return this._jobs.push(i),this._timer??=setTimeout(this._process,10),i.resolve.promise}_process(){this._timer=null;const s=this._jobs.shift();if(!s)return;const{geometries:t,inSpatialReference:e,outSpatialReference:i,resolve:o,geographicTransformation:u}=s;m(e,i)?a(i)?o(t.map(y)):o(t.map(g)):o(n(r,t,e,i,u,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const M=new _;function b(s,t,e,n){return M.push(s,t,e,n)}export{x as checkProjectionSupport,j as project,b as projectMany};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../core/Error.js";import{JSONMap as e}from"../../../core/jsonMap.js";import{getUnitString as i}from"../../../core/unitUtils.js";import{canProjectWithoutEngine as r}from"../../../geometry/
|
|
5
|
+
import t from"../../../core/Error.js";import{JSONMap as e}from"../../../core/jsonMap.js";import{getUnitString as i}from"../../../core/unitUtils.js";import{canProjectWithoutEngine as r}from"../../../geometry/projectionUtils.js";import{getGeometryExtent as n}from"../../../geometry/support/extentUtils.js";import{fromJSON as a,isPolygon as o,isExtent as s,isPolyline as l}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as m}from"../../../geometry/support/normalizeUtils.js";import{isGeographic as u,isWebMercator as c,wgs84 as p,equals as f}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as y,project as d}from"./projectionSupport.js";const g=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),S=Object.freeze({}),R="frequency";async function w(t,e,i){const r=t.bin;return r.onField&&(r.onField=r.onField.trim()),r.onExpression?.value&&(r.onExpression.value=r.onExpression.value.trim()),r.splitBy&&(r.splitBy.value&&(r.splitBy.value=r.splitBy.value.trim()),r.splitBy.outAlias&&(r.splitBy.outAlias=r.splitBy.outAlias.trim())),r.stackBy&&(r.stackBy.value&&(r.stackBy.value=r.stackBy.value.trim()),r.stackBy.outAlias&&(r.stackBy.outAlias=r.stackBy.outAlias.trim())),"normalizationField"in r.parameters&&r.parameters.normalizationField&&(r.parameters.normalizationField=r.parameters.normalizationField.trim()),t.outStatistics?.length||(t.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:R}]),x(t,e,i)}async function x(t,e,i){const{outFields:r,orderByFields:n,groupByFieldsForStatistics:a,outStatistics:o}=t;if(r)for(let s=0;s<r.length;s++)r[s]=r[s].trim();if(n)for(let s=0;s<n.length;s++)n[s]=n[s].trim();if(a)for(let s=0;s<a.length;s++)a[s]=a[s].trim();if(o)for(let s=0;s<o.length;s++)o[s].onStatisticField&&(o[s].onStatisticField=o[s].onStatisticField.trim());return t.geometry&&!t.outSR&&(t.outSR=t.geometry.spatialReference),B(t,e,i)}async function B(t,e,i){if(!t)return null;let{where:r}=t;if(t.where=r=r?.trim(),(!r||/^1 *= *1$/.test(r)||e&&e===r)&&(t.where=null),!t.geometry)return t;let o=await v(t);if(t.distance=0,t.units=null,"esriSpatialRelEnvelopeIntersects"===t.spatialRel){const{spatialReference:e}=t.geometry;o=n(o),o.spatialReference=e}if(o){await y(o.spatialReference,i),o=j(o,i);const e=(await m(a(o)))[0];if(null==e)throw S;const r="quantizationParameters"in t&&t.quantizationParameters?.tolerance||"maxAllowableOffset"in t&&t.maxAllowableOffset||0,n=r&&F(o,i)?{densificationStep:8*r}:void 0,s=e.toJSON(),l=d(s,s.spatialReference,i,n);if(!l)throw S;l.spatialReference=i,t.geometry=l}return t}function F(t,e){if(!t)return!1;const i=t.spatialReference;return(s(t)||o(t)||l(t))&&!f(i,e)&&!r(i,e)}function j(t,e){const i=t.spatialReference;return F(t,e)&&s(t)?{spatialReference:i,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:t}async function v(e){const{distance:r,units:n}=e,a=e.geometry;if(null==r||"vertexAttributes"in a)return a;const s=a.spatialReference,l=n?g.fromJSON(n):i(s),m=s&&(u(s)||c(s))?a:await y(s,p).then((()=>d(a,p))),f=await import("../../../geometry/operators/json/geodesicBufferOperator.js");await f.load();const S=f.execute(m,r||1,{unit:l})??void 0;if(!S||!o(S)||0===S.rings.length)throw new t("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return S}function h(t,e){return null==t?null:"string"==typeof t?e?new Date(`1970-01-01T${t}Z`).getTime():new Date(t).getTime():t instanceof Date?t.getTime():t}export{h as getDateInNumber,w as normalizeAttributeBinsQuery,x as normalizeQuery,B as normalizeQueryLike,S as queryEngineEmptyResult,g as unitsKebabDict};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{createResolver as i}from"../../core/promiseUtils.js";import{dataComponents as n}from"../../core/urlUtils.js";import{generateBracedUUID as o}from"../../core/uuid.js";import{normalizeCentralMeridian as l}from"../../geometry/support/normalizeUtils.js";import{isGeographic as d,equals as u,isWGS84 as p,isWebMercator as c}from"../../geometry/support/spatialReferenceUtils.js";import{isEditBusLayer as h,emitApplyEditsEvent as m}from"../mixins/EditBusLayer.js";import{isValidFieldValue as f}from"../support/fieldUtils.js";import{isGlbSupportedEditFormat as y}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as g,getEffectiveLayerCapabilities as b}from"../support/layerUtils.js";function w(e){return null!=e?.applyEdits}function F(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function A(e){return e.every(F)}function v(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function I(e){return e.every(v)}async function $(e,t,a,s={}){let n;const o="gdbVersion"in e?e.gdbVersion:null,l=s.gdbVersion??o;if(h(e)&&e.url)n=m(e.url,e.layerId,l,"original-and-current-features"===s.returnServiceEditsOption);else{n=i(),n.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:n.promise};e.emit("apply-edits",t)}try{const{results:i,edits:o}=await E(e,t,a,s),l=e=>e.filter((e=>!e.error)).map(r),d={edits:o,addedFeatures:l(i.addFeatureResults),updatedFeatures:l(i.updateFeatureResults),deletedFeatures:l(i.deleteFeatureResults),addedAttachments:l(i.addAttachmentResults),updatedAttachments:l(i.updateAttachmentResults),deletedAttachments:l(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return i.editedFeatureResults?.length&&(d.editedFeatures=i.editedFeatureResults),n.resolve(d),i}catch(d){throw n.reject(d),d}}async function E(e,t,r,s){if(await e.load(),!w(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!g(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:n}=await S(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,n)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function S(e,t,r){const i=b(e),n=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),o=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),l=null!=e.infoFor3D;if(V(t,i,r,!!n,!!o,`${e.type}-layer`),!i.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!i.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const d={...r};if(null!=d.rollbackOnFailureEnabled||i.editing.supportsRollbackOnFailure||(d.rollbackOnFailureEnabled=!0),d.rollbackOnFailureEnabled||"original-and-current-features"!==d.returnServiceEditsOption||(!1===d.rollbackOnFailureEnabled&&s.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),d.rollbackOnFailureEnabled=!0),!i.editing.supportsReturnServiceEditsInSourceSpatialReference&&d.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(d.returnServiceEditsInSourceSR&&"original-and-current-features"!==d.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=G(t,i,`${e.type}-layer`),p=r?.globalIdUsed||l,c=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach((e=>B(e,t)))}u.addFeatures.forEach((t=>O(t,e,p,c))),u.updateFeatures.forEach((t=>k(t,e,p,c))),u.deleteFeatures.forEach((t=>U(t,e,p,c))),u.addAttachments.forEach((t=>L(t,e))),u.updateAttachments.forEach((t=>L(t,e))),l&&await x(u,e);return{edits:await T(u),options:d}}function R(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const i of s){const r=e.attributes[i.name];if(void 0!==r&&!f(i,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${i.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function j(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:r}=e,{spatialReference:s,vertexSpace:i}=r,n=t.spatialReference,o="local"===i.type,l=d(n),h=u(n,s),m=h||p(n)&&(p(s)||c(s));if(!(o&&l&&m||!o&&!l&&h))throw new a(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${i.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${n.wkid} is not supported.`)}}function O(e,t,a,r){R(e,t,a,r),j(e,t)}function U(e,t,a,r){R(e,t,a,r)}function k(e,t,r,s){R(e,t,r,s),j(e,t);const i=b(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function L(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=n(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function B(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=o())}async function T(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map((e=>e.geometry)),s=await l(r),i=t.length,n=a.length;return s.slice(0,i).forEach(((e,a)=>t[a].geometry=e)),s.slice(i,i+n).forEach(((e,t)=>a[t].geometry=e)),e}function D(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function G(e,t,r){const s=D(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(M),s.updateFeatures=s.updateFeatures.map(M),s.addAssetFeatures=[],s}function V(e,t,r,s,i,n){if(!e||!s&&!i)throw new a(`${n}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed&&!r.usingFeatureServiceEndpoint)throw new a(`${n}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&i)throw new a(`${n}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${n}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function M(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function x(e,t){const{infoFor3D:r}=t;if(null==r)return;if(!y(r))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const a of e.addFeatures??[])z(a)&&s.push(a);for(const a of e.updateFeatures??[])z(a)&&s.push(a)}function z(e){return"mesh"===e?.geometry?.type}function q(e,t,r,s){if(!w(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{$ as applyEdits,V as checkEditingCapabilities,I as isFeatureIdentifierArrayWithGlobalId,A as isFeatureIdentifierArrayWithObjectId,v as isFeatureIdentifierWithGlobalId,F as isFeatureIdentifierWithObjectId,D as normalizeCollections,G as normalizeEdits,T as normalizeGeometries,M as shallowCloneFeature,q as uploadAssets};
|
|
5
|
+
import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{createResolver as i}from"../../core/promiseUtils.js";import{dataComponents as n}from"../../core/urlUtils.js";import{generateBracedUUID as o}from"../../core/uuid.js";import{normalizeCentralMeridian as l}from"../../geometry/support/normalizeUtils.js";import{isGeographic as d,equals as u,isWGS84 as p,isWebMercator as c}from"../../geometry/support/spatialReferenceUtils.js";import{isEditBusLayer as h,emitApplyEditsEvent as m}from"../mixins/EditBusLayer.js";import{isValidFieldValue as f}from"../support/fieldUtils.js";import{isGlbSupportedEditFormat as y}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as g,getEffectiveLayerCapabilities as b}from"../support/layerUtils.js";function w(e){return null!=e?.applyEdits}function F(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function A(e){return e.every(F)}function v(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function I(e){return e.every(v)}async function $(e,t,a,s={}){let n;const o="gdbVersion"in e?e.gdbVersion:null,l=s.gdbVersion??o;if(h(e)&&e.url)n=m(e.url,e.layerId,l,"original-and-current-features"===s.returnServiceEditsOption);else{n=i(),n.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:n.promise};e.emit("apply-edits",t)}try{const{results:i,edits:o}=await E(e,t,a,s),l=e=>e.filter((e=>!e.error)).map(r),d={edits:o,addedFeatures:l(i.addFeatureResults),updatedFeatures:l(i.updateFeatureResults),deletedFeatures:l(i.deleteFeatureResults),addedAttachments:l(i.addAttachmentResults),updatedAttachments:l(i.updateAttachmentResults),deletedAttachments:l(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return i.editedFeatureResults?.length&&(d.editedFeatures=i.editedFeatureResults),n.resolve(d),i}catch(d){throw n.reject(d),d}}async function E(e,t,r,s){if(await e.load(),!w(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!g(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:n}=await S(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,n)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function S(e,t,r){const i=b(e),n=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),o=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),l=null!=e.infoFor3D;if(V(t,i,r,!!n,!!o,`${e.type}-layer`),!i.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!i.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const d={...r};if(null!=d.rollbackOnFailureEnabled||i.editing.supportsRollbackOnFailure||(d.rollbackOnFailureEnabled=!0),d.rollbackOnFailureEnabled||"original-and-current-features"!==d.returnServiceEditsOption||(!1===d.rollbackOnFailureEnabled&&s.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),d.rollbackOnFailureEnabled=!0),!i.editing.supportsReturnServiceEditsInSourceSpatialReference&&d.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(d.returnServiceEditsInSourceSR&&"original-and-current-features"!==d.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=G(t,i,`${e.type}-layer`),p=r?.globalIdUsed||l,c=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach((e=>T(e,t)))}u.addFeatures.forEach((t=>O(t,e,p,c))),u.updateFeatures.forEach((t=>k(t,e,p,c))),u.deleteFeatures.forEach((t=>U(t,e,p,c))),u.addAttachments.forEach((t=>L(t,e))),u.updateAttachments.forEach((t=>L(t,e))),l&&await x(u,e);return{edits:await B(u),options:d}}function R(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const i of s){const r=e.attributes[i.name];if(void 0!==r&&!f(i,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${i.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function j(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:r}=e,{spatialReference:s,vertexSpace:i}=r,n=t.spatialReference,o="local"===i.type,l=d(n),h=u(n,s),m=h||p(n)&&(p(s)||c(s));if(!(o&&l&&m||!o&&!l&&h))throw new a(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${i.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${n.wkid} is not supported.`)}}function O(e,t,a,r){R(e,t,a,r),j(e,t)}function U(e,t,a,r){R(e,t,a,r)}function k(e,t,r,s){R(e,t,r,s),j(e,t);const i=b(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function L(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=n(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function T(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=o())}async function B(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map((e=>e.geometry)),s=await l(r),i=t.length,n=a.length;return s.slice(0,i).forEach(((e,a)=>t[a].geometry=e)),s.slice(i,i+n).forEach(((e,t)=>a[t].geometry=e)),e}function D(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function G(e,t,r){const s=D(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(M),s.updateFeatures=s.updateFeatures.map(M),s.addAssetFeatures=[],s}function V(e,t,r,s,i,n){if(!(e&&(s||i)||r?.usingTelecomOperations))throw new a(`${n}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed&&!r.usingFeatureServiceEndpoint)throw new a(`${n}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&i)throw new a(`${n}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${n}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function M(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function x(e,t){const{infoFor3D:r}=t;if(null==r)return;if(!y(r))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const a of e.addFeatures??[])z(a)&&s.push(a);for(const a of e.updateFeatures??[])z(a)&&s.push(a)}function z(e){return"mesh"===e?.geometry?.type}function q(e,t,r,s){if(!w(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{$ as applyEdits,V as checkEditingCapabilities,I as isFeatureIdentifierArrayWithGlobalId,A as isFeatureIdentifierArrayWithObjectId,v as isFeatureIdentifierWithGlobalId,F as isFeatureIdentifierWithObjectId,D as normalizeCollections,G as normalizeEdits,B as normalizeGeometries,M as shallowCloneFeature,q as uploadAssets};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import{parseDate as i}from"../../../../core/date.js";import n from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{isAbortError as s}from"../../../../core/promiseUtils.js";import{urlToObject as o,getFilename as a}from"../../../../core/urlUtils.js";import{projectMany as l}from"../../../../geometry/
|
|
5
|
+
import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import{parseDate as i}from"../../../../core/date.js";import n from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{isAbortError as s}from"../../../../core/promiseUtils.js";import{urlToObject as o,getFilename as a}from"../../../../core/urlUtils.js";import{projectMany as l}from"../../../../geometry/projectionUtils.js";import m from"../../../../geometry/SpatialReference.js";import{jsonAdapter as c}from"../../../../geometry/geometryAdapters/json.js";import{equals as d,isWebMercator as u,wgs84 as f}from"../../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as p}from"../../../../geometry/support/webMercatorUtils.js";import{OptimizedFeature as y}from"../../OptimizedFeature.js";import h from"../../OptimizedGeometry.js";import{executeQueryForSnapping as g}from"../../data/executeQueryForSnapping.js";import I from"../../data/FeatureStore.js";import{checkProjectionSupport as _}from"../../data/projectionSupport.js";import{QueryEngine as F}from"../../data/QueryEngine.js";import{parseRows as w,parseNumber as E,severSlicedString as j,readRows as T,inferDelimiterAndLocationInfo as x,extractFieldNamesAndAliasesFromRow as N,inferFields as S}from"../csv/csv.js";import{createDefaultAttributesFunction as q,createDrawingInfo as b}from"./clientSideDefaults.js";import C from"../../../support/FieldsIndex.js";import{getFieldDefaultValue as O}from"../../../support/fieldUtils.js";import{isNumber as v}from"../../../../support/guards.js";import{utc as D}from"../../../../time/constants.js";const k=b("esriGeometryPoint"),P=["csv"],R=[0,0];class V{constructor(e,t){this.x=e,this.y=t}}class A{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[i]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),n=G(i,e);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const r=await this._createFeatures(i);this._queryEngine.featureStore.addMany(r);const{fullExtent:s,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=s,o){const{start:e,end:t}=o;n.layerDefinition.timeInfo.timeExtent=[e,t]}return n}async applyEdits(){throw new n("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){await this._waitSnapshotComplete();return(await this._queryEngine.executeQueryForIds(e,t.signal)).filter(v)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),g(this._queryEngine,e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),e&&this._queryEngine.featureStore.addMany(e)}),(e=>{this._queryEngine.featureStore.clear(),s(e)||r.getLogger("esri.layers.CSVLayer").error(new n("csv-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete();const{fullExtent:i,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:i,timeExtent:o}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:i,customParameters:r}=this._loadOptions;if(!i)throw new n("csv-layer:invalid-source","url not defined");const s=o(i);return(await e(s.path,{query:{...s.query,...r},responseType:"text",signal:t})).data}_createQueryEngine(e){const{objectIdField:t,fields:i,extent:n,timeInfo:r}=e.layerDefinition,s=new I({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1}),o={type:"object-id",fieldName:t};return new F({fieldsIndex:C.fromLayerJSON({fields:i,dateFieldsTimeReference:{timeZoneIANA:D}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:r,featureIdInfo:o,spatialReference:n.spatialReference||{wkid:4326},featureStore:s})}async _createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:n}=this._locationInfo,{objectIdField:r,fieldsIndex:s,spatialReference:o}=this._queryEngine;let a=[];const f=[],g=s.fields.filter((e=>e.name!==r)).map((e=>e.name));let I=0;const _={};for(const i of s.fields)if("esriFieldTypeOID"!==i.type&&"esriFieldTypeGlobalID"!==i.type){const e=O(i);void 0!==e&&(_[i.name]=e)}const F=w(e,g,this._delimiter,q(_,r));for(const l of F){const e=this._parseCoordinateValue(l[t]),o=this._parseCoordinateValue(l[n]);if(null!=o&&null!=e&&!isNaN(e)&&!isNaN(o)){l[t]=e,l[n]=o;for(const e in l)if(e!==t&&e!==n)if(s.isDateField(e))l[e]=i(l[e]);else if(s.isNumericField(e)){const t=E(l[e]);isNaN(t)?l[e]=null:l[e]=t}else null!=l[e]&&(l[e]=j(l[e]));l[r]=I,I++,a.push(new V(o,e)),f.push(l)}}if(!d({wkid:4326},o))if(u(o))for(const i of a)[i.x,i.y]=p(i.x,i.y,R);else a=l(c,a,m.WGS84,o,null,null);const T=[];for(let i=0;i<a.length;i++){const{x:e,y:t}=a[i],n=f[i];n[r]=i+1,T.push(new y(new h([],[e,t]),n,null,n[r]))}return T}_parseCoordinateValue(e){if(null==e||""===e)return null;let t=E(e);return(isNaN(t)||Math.abs(t)>181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await _(f,e)}catch{throw new n("csv-layer:projection-not-supported","Projection not supported")}}}function G(e,t){const i=t.parsingOptions||{},r={delimiter:i.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:i.latitudeField,longitudeFieldName:i.longitudeField}},s=r.layerDefinition={name:a(t.url,P)||"csv",dateFieldsTimeReference:{timeZoneIANA:D},drawingInfo:k,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:i.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:i.spatialReference||{wkid:4326}}},o=T(e),l=o.next().value?.trim(),m=o.next().value?.trim();if(!l)throw new n("csv-layer:empty-csv","CSV is empty",{csv:e});const{delimiter:c,locationInfo:d}=x(l,m,i);if(!c)throw new n("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:l,secondLine:m,parsingOptions:i});if(!d)throw new n("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:l,secondLine:m,parsingOptions:i});r.locationInfo=d,r.delimiter=c;const{names:u,aliases:f}=N(l,c),p=S(e,r.delimiter,u,f,r.locationInfo);if(i.fields?.length){const e=new C(i.fields);for(const t of p){const i=e.get(t.name);i&&Object.assign(t,i)}}if(!p.some((e=>"esriFieldTypeOID"===e.type&&(s.objectIdField=e.name,!0)))){const e={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};s.objectIdField=e.name,p.unshift(e)}s.fields=p;const y=new C(s.fields);if(r.locationInfo&&(r.locationInfo.latitudeFieldName=y.get(r.locationInfo.latitudeFieldName).name,r.locationInfo.longitudeFieldName=y.get(r.locationInfo.longitudeFieldName).name),s.timeInfo){const e=s.timeInfo;if(e.startTimeField){const t=y.get(e.startTimeField);t?(e.startTimeField=t.name,t.type="esriFieldTypeDate"):e.startTimeField=null}if(e.endTimeField){const t=y.get(e.endTimeField);t?(e.endTimeField=t.name,t.type="esriFieldTypeDate"):e.endTimeField=null}if(e.trackIdField){const t=y.get(e.trackIdField);e.trackIdField=t?t.name:null}e.startTimeField||e.endTimeField||(s.timeInfo=null)}return r}export{A 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";import{initializeProjection as m,project as h}from"../../geometry/projection.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as T}from"./supportUtils.js";import{executeQueryStreaming as I}from"../../rest/knowledgeGraphService.js";import M from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import D from"../../rest/support/Query.js";let E=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach((i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach((e=>{o(this.memberIdTypeLookup,e.id,(()=>new Set)).add(s);const t=this.getById(e.id);t&&a.set(e.id,t)})),this.sublayerCaches.set(s,a)}))}addToLayer(e){e.forEach((({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,(()=>new Set)).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,(()=>new Set)).add(e)}}))}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new D({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach((i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)})),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[l,m]of s){const e=`${l}_ids`;a[e]=m,t&&0!==t?.length?r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await I(this.knowledgeGraph,new M({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,l]of n.entries()){const e=`${d}_ids`;o[e]=l,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await I(this.knowledgeGraph,new M({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[m,h]of o.entries()){const e=`${m}_ids`;s[e]=h,a.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await I(this.knowledgeGraph,new M({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const l=[];for(const[m,h]of p)for(const e of h)l.push({id:e,typeName:m});return l}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],l=new Map,m=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&m.set(e.name,e)})),this.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&m.set(e.name,e)})),e||this.inclusionModeDefinition?e?e.forEach((e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))l.has(t)?l.get(t)?.push(e):l.set(t,[e])})):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e.useAllData?l.set(t,null):e.members&&e.members.forEach((e=>{l.has(t)&&null!==l.get(t)?l.get(t)?.push(e.id):l.set(t,[e.id])}))})):(this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,null)})),this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,null)})));for(const[s,h]of l){const e=new Set(h),l=new Promise(((d,l)=>{const c=async()=>{const d=new Set,l=[];let c,u="",f=!1;if(t||m.get(s)?.properties?.forEach((e=>{e.name&&d.add(e.name)})),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach((e=>{u+=`, n.${e}`,l.push(e)}));else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach((e=>{u+=`, n.${e}`,l.push(e)}))}c=new M(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await I(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,(()=>new Set)).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,(()=>new Set)).add(p.id),o(this.relationshipConnectionsLookup,p.id,(()=>[p.originId,p.destinationId])));a<t.length;a++)p.properties[l[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach((e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],(()=>new Set)).add(s))}))}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then((()=>{d(null)})).catch((e=>{"AbortError"===e.name?d(null):l(e)}))}));d.push(l),this._processingCacheUpdatesLookup.get(s)?.push(l)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map((e=>e.id)));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)}));t.forEach((e=>{this.sublayerCaches.get(e)?.forEach(((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)}))}))}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,D=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let E=!b&&D?Array.from(D).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(E=e.objectIds);else if(null!=e.objectIds&&E&&E.length>0){const t=e.objectIds;e.objectIds=E.filter((e=>t.includes(e)))}else if(null!=e.objectIds)E=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=E}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach((e=>{s.add(e.name)})):i.forEach((e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)}))}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let w=b?.geometryMaxBoundingRectangleSizeX,I=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await m(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(w&&I&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:w,ymax:I}),t=h(e,c);w=t.xmax,I=t.ymax}if(o.xmax-o.xmin>w)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${w}° latitude, limit exceeded`);if(o.ymax-o.ymin>I)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${I}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach((e=>{i.fieldNames.includes(e.name)&&s.add(e.name)}))}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach((e=>{u+=`, n.${e}`,r.push(e)})),p=new M({openCypherQuery:u,bindParameters:{param_filter_geom:new l({rings:T(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach((e=>{n.fieldNames.includes(e.name)&&s.add(e.name)}));const o=new Set(["column-reference","string","number","binary-expression"]),r=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let p=!1;const d=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return p=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return p=!0,"";{let i=e.right.value;"%"===i.charAt(0)&&(i=i.slice(1)),"%"===i.charAt(i.length-1)&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,""};i=d(n.parseTree),p&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;E&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach((e=>{n+=`, n.${e}`,r.push(e)})),p=new M(E?{openCypherQuery:n,bindParameters:{ids:E}}:{openCypherQuery:n})}const N=(await I(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await N.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach((e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}})),t}};e([r()],E.prototype,"knowledgeGraph",void 0),e([r()],E.prototype,"inclusionModeDefinition",void 0),e([r()],E.prototype,"entityTypeNames",void 0),e([r()],E.prototype,"relationshipTypeNames",void 0),e([r()],E.prototype,"geographicLookup",void 0),e([r()],E.prototype,"sublayerCaches",void 0),e([r()],E.prototype,"nodeConnectionsLookup",void 0),e([r()],E.prototype,"relationshipConnectionsLookup",void 0),e([r()],E.prototype,"memberIdTypeLookup",void 0),E=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],E);export{E as KnowledgeGraphLayerDataManager};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";import{initializeProjection as m,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as T}from"./supportUtils.js";import{executeQueryStreaming as I}from"../../rest/knowledgeGraphService.js";import M from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import D from"../../rest/support/Query.js";let E=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach((i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach((e=>{o(this.memberIdTypeLookup,e.id,(()=>new Set)).add(s);const t=this.getById(e.id);t&&a.set(e.id,t)})),this.sublayerCaches.set(s,a)}))}addToLayer(e){e.forEach((({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,(()=>new Set)).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,(()=>new Set)).add(e)}}))}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new D({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach((i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)})),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[l,m]of s){const e=`${l}_ids`;a[e]=m,t&&0!==t?.length?r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await I(this.knowledgeGraph,new M({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,l]of n.entries()){const e=`${d}_ids`;o[e]=l,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await I(this.knowledgeGraph,new M({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[m,h]of o.entries()){const e=`${m}_ids`;s[e]=h,a.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await I(this.knowledgeGraph,new M({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const l=[];for(const[m,h]of p)for(const e of h)l.push({id:e,typeName:m});return l}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],l=new Map,m=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&m.set(e.name,e)})),this.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&m.set(e.name,e)})),e||this.inclusionModeDefinition?e?e.forEach((e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))l.has(t)?l.get(t)?.push(e):l.set(t,[e])})):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e.useAllData?l.set(t,null):e.members&&e.members.forEach((e=>{l.has(t)&&null!==l.get(t)?l.get(t)?.push(e.id):l.set(t,[e.id])}))})):(this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,null)})),this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,null)})));for(const[s,h]of l){const e=new Set(h),l=new Promise(((d,l)=>{const c=async()=>{const d=new Set,l=[];let c,u="",f=!1;if(t||m.get(s)?.properties?.forEach((e=>{e.name&&d.add(e.name)})),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach((e=>{u+=`, n.${e}`,l.push(e)}));else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach((e=>{u+=`, n.${e}`,l.push(e)}))}c=new M(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await I(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,(()=>new Set)).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,(()=>new Set)).add(p.id),o(this.relationshipConnectionsLookup,p.id,(()=>[p.originId,p.destinationId])));a<t.length;a++)p.properties[l[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach((e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],(()=>new Set)).add(s))}))}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then((()=>{d(null)})).catch((e=>{"AbortError"===e.name?d(null):l(e)}))}));d.push(l),this._processingCacheUpdatesLookup.get(s)?.push(l)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map((e=>e.id)));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)}));t.forEach((e=>{this.sublayerCaches.get(e)?.forEach(((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)}))}))}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,D=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let E=!b&&D?Array.from(D).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(E=e.objectIds);else if(null!=e.objectIds&&E&&E.length>0){const t=e.objectIds;e.objectIds=E.filter((e=>t.includes(e)))}else if(null!=e.objectIds)E=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=E}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach((e=>{s.add(e.name)})):i.forEach((e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)}))}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let w=b?.geometryMaxBoundingRectangleSizeX,I=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await m(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(w&&I&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:w,ymax:I}),t=h(e,c);w=t.xmax,I=t.ymax}if(o.xmax-o.xmin>w)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${w}° latitude, limit exceeded`);if(o.ymax-o.ymin>I)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${I}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach((e=>{i.fieldNames.includes(e.name)&&s.add(e.name)}))}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach((e=>{u+=`, n.${e}`,r.push(e)})),p=new M({openCypherQuery:u,bindParameters:{param_filter_geom:new l({rings:T(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach((e=>{n.fieldNames.includes(e.name)&&s.add(e.name)}));const o=new Set(["column-reference","string","number","binary-expression"]),r=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let p=!1;const d=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return p=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return p=!0,"";{let i=e.right.value;"%"===i.charAt(0)&&(i=i.slice(1)),"%"===i.charAt(i.length-1)&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,""};i=d(n.parseTree),p&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;E&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach((e=>{n+=`, n.${e}`,r.push(e)})),p=new M(E?{openCypherQuery:n,bindParameters:{ids:E}}:{openCypherQuery:n})}const N=(await I(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await N.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach((e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}})),t}};e([r()],E.prototype,"knowledgeGraph",void 0),e([r()],E.prototype,"inclusionModeDefinition",void 0),e([r()],E.prototype,"entityTypeNames",void 0),e([r()],E.prototype,"relationshipTypeNames",void 0),e([r()],E.prototype,"geographicLookup",void 0),e([r()],E.prototype,"sublayerCaches",void 0),e([r()],E.prototype,"nodeConnectionsLookup",void 0),e([r()],E.prototype,"relationshipConnectionsLookup",void 0),e([r()],E.prototype,"memberIdTypeLookup",void 0),E=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],E);export{E as KnowledgeGraphLayerDataManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as i}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projection.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as S,systemAggregationCountFieldName as v,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as D,displayFilterEnabledProperty as P,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as H,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as oe,fixTimeInfoFields as ie}from"../support/fieldUtils.js";import ne from"../support/LabelClass.js";import{reader as se}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:o,...i}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...i,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let o={enabled:r};return r&&(o={...o,...Te.call(this,e,t)}),o}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(D(A(G(M(Z(W(K(V(i(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=S,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:v,type:"esriFieldTypeInteger",alias:v,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){oe(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const o=le(I(g.toJSON(this.geometryType)).renderer);return he(o.symbol,r),o}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),i=ue.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:i}=await this._setupQueryObjects(r),n=await i.executeQueryForExtent(o.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new l(n.extent):new l,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return await o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[S]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>ie(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),o=r.geometry;if(o&&!o.spatialReference?.isWGS84&&(await d(o.spatialReference,f),r.geometry=h(o instanceof u||o instanceof m||o instanceof y?o:o.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const i=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(i)}}};function Se(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",v],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){o.getLogger(this).warn("Error updating labelingInfo",n)}return se(e,t,r)}e([n(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([n()],Ie.prototype,"capabilities",void 0),e([n({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([n({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([n()],Ie.prototype,"displayField",void 0),e([n(fe(r(P)))],Ie.prototype,"displayFilterEnabled",void 0),e([n(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([n(fe(r(J)))],Ie.prototype,"effect",void 0),e([n()],Ie.prototype,"elevationInfo",void 0),e([n(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([n(fe(r(te)))],Ie.prototype,"featureReduction",null),e([n()],Ie.prototype,"fields",null),e([n()],Ie.prototype,"geometryType",null),e([n()],Ie.prototype,"geometryFieldName",null),e([n({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([n({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([n()],Ie.prototype,"hasM",null),e([n()],Ie.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([n({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([n({type:[ne],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Se,write:be()}})],Ie.prototype,"labelingInfo",null),e([n({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([n(fe(r(z)))],Ie.prototype,"legendEnabled",void 0),e([n(fe(r(H)))],Ie.prototype,"maxScale",void 0),e([n(fe(r(X)))],Ie.prototype,"minScale",void 0),e([n()],Ie.prototype,"objectIdField",void 0),e([n()],Ie.prototype,"objectType",void 0),e([n(fe(r($)))],Ie.prototype,"opacity",void 0),e([n(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([n({clonable:!1})],Ie.prototype,"parent",void 0),e([n()],Ie.prototype,"parentCompositeLayer",void 0),e([n(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([n({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([n({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([n()],Ie.prototype,"source",void 0),e([n()],Ie.prototype,"spatialReference",null),e([n({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([n({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([n({json:{read:!1}})],Ie.prototype,"type",void 0),e([n(fe(r(Y)))],Ie.prototype,"useViewTime",void 0),e([n({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([s("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);export{Ie as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONMixin as o}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as S,systemAggregationCountFieldName as v,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as D,displayFilterEnabledProperty as P,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as H,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as ie,fixTimeInfoFields as oe}from"../support/fieldUtils.js";import se from"../support/LabelClass.js";import{reader as ne}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:i,...o}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...o,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let i={enabled:r};return r&&(i={...i,...Te.call(this,e,t)}),i}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(D(A(G(M(Z(W(K(V(o(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=S,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:v,type:"esriFieldTypeInteger",alias:v,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){ie(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const i=le(I(g.toJSON(this.geometryType)).renderer);return he(i.symbol,r),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e),o=ue.fromJSON(await i.executeQuery(r.toJSON(),t?.signal));return o.features.forEach((e=>{e.sourceLayer=this})),o}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(r),s=await o.executeQueryForExtent(i.toJSON(),t?.signal);let n;return n=null!=s.extent?.xmin&&null!=s.extent?.xmax&&null!=s.extent?.ymin&&null!=s.extent?.ymax?new l(s.extent):new l,{count:s.count,extent:n}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[S]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>oe(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),i=r.geometry;if(i&&!i.spatialReference?.isWGS84&&(await d(i.spatialReference,f),r.geometry=h(i instanceof u||i instanceof m||i instanceof y?i:i.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(o)}}};function Se(e,t,r){const o=[["ESRI__AGGREGATION_COUNT",v],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of o)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(s){i.getLogger(this).warn("Error updating labelingInfo",s)}return ne(e,t,r)}e([s(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([s()],Ie.prototype,"capabilities",void 0),e([s({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([s({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([s()],Ie.prototype,"displayField",void 0),e([s(fe(r(P)))],Ie.prototype,"displayFilterEnabled",void 0),e([s(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([s(fe(r(J)))],Ie.prototype,"effect",void 0),e([s()],Ie.prototype,"elevationInfo",void 0),e([s(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([s(fe(r(te)))],Ie.prototype,"featureReduction",null),e([s()],Ie.prototype,"fields",null),e([s()],Ie.prototype,"geometryType",null),e([s()],Ie.prototype,"geometryFieldName",null),e([s({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([s({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([s()],Ie.prototype,"hasM",null),e([s()],Ie.prototype,"hasZ",null),e([s({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([s({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([s({type:[se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Se,write:be()}})],Ie.prototype,"labelingInfo",null),e([s({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([s(fe(r(z)))],Ie.prototype,"legendEnabled",void 0),e([s(fe(r(H)))],Ie.prototype,"maxScale",void 0),e([s(fe(r(X)))],Ie.prototype,"minScale",void 0),e([s()],Ie.prototype,"objectIdField",void 0),e([s()],Ie.prototype,"objectType",void 0),e([s(fe(r($)))],Ie.prototype,"opacity",void 0),e([s(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([s({clonable:!1})],Ie.prototype,"parent",void 0),e([s()],Ie.prototype,"parentCompositeLayer",void 0),e([s(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([s({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([s({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([s()],Ie.prototype,"source",void 0),e([s()],Ie.prototype,"spatialReference",null),e([s({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([s({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([s({json:{read:!1}})],Ie.prototype,"type",void 0),e([s(fe(r(Y)))],Ie.prototype,"useViewTime",void 0),e([s({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([n("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);export{Ie as default};
|