@arcgis/core 5.1.0-next.64 → 5.1.0-next.66
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/Camera.d.ts +1 -1
- package/Ground.d.ts +7 -7
- package/PopupTemplate.d.ts +8 -8
- package/WebDocument2D.js +1 -1
- package/WebScene.d.ts +1 -1
- package/WebScene.js +1 -1
- package/analysis/AreaMeasurementAnalysis.d.ts +1 -1
- package/analysis/DirectLineMeasurementAnalysis.d.ts +1 -1
- package/analysis/LengthDimension.d.ts +4 -4
- package/analysis/ShadowCastAnalysis.d.ts +3 -3
- package/analysis/SliceAnalysis.d.ts +1 -1
- package/analysis/SlicePlane.d.ts +1 -1
- package/applications/Components/featureUtils.d.ts +24 -0
- package/applications/Components/featureUtils.js +1 -1
- package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +11 -1
- package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
- package/applications/WebEditor/drawToolZSnapping.d.ts +17 -0
- package/applications/WebEditor/drawToolZSnapping.js +2 -0
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/Pixel.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/geometry/wkt.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01be1315c60810651783.js +1 -0
- package/assets/esri/core/workers/chunks/02e8fc598ee09cf1b678.js +1 -0
- package/assets/esri/core/workers/chunks/0d650b0d090a425c9c18.js +1 -0
- package/assets/esri/core/workers/chunks/0e90e9ea1ad587eb3495.js +1 -0
- package/assets/esri/core/workers/chunks/0f196ec93925dfefc69a.js +1 -0
- package/assets/esri/core/workers/chunks/12294f8c32c34788b6de.js +1 -0
- package/assets/esri/core/workers/chunks/13a8346abe5509167578.js +1 -0
- package/assets/esri/core/workers/chunks/1515824f11ef5ab95378.js +1 -0
- package/assets/esri/core/workers/chunks/151c2766a4cacc6adbd6.js +1 -0
- package/assets/esri/core/workers/chunks/155f57fe9886ef322e2a.js +1 -0
- package/assets/esri/core/workers/chunks/170f4d83555d238e365b.js +1 -0
- package/assets/esri/core/workers/chunks/171cca726a763c770469.js +1 -0
- package/assets/esri/core/workers/chunks/17445fd8048966617d49.js +1 -0
- package/assets/esri/core/workers/chunks/1761dc5799850ca7b66c.js +1 -0
- package/assets/esri/core/workers/chunks/17d54e77001ccb48a258.js +1 -0
- package/assets/esri/core/workers/chunks/19afacc9a741038e4bfb.js +1 -0
- package/assets/esri/core/workers/chunks/1d8777266fb1c5cfca55.js +1 -0
- package/assets/esri/core/workers/chunks/1f16bc8c02d8c4b2f693.js +1 -0
- package/assets/esri/core/workers/chunks/1f76c06af4682c85bc21.js +1 -0
- package/assets/esri/core/workers/chunks/{9eef3cd5f519c8ae88c0.js → 205e957ffd7e95f530f7.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa6e1ad099b43a6f5501.js → 21a8e2a11ffacc226e2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{811b378fa5bf8a4d3d66.js → 224461c1d9755966d0b6.js} +1 -1
- package/assets/esri/core/workers/chunks/27262083d37fe623ca9c.js +1 -0
- package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +1 -0
- package/assets/esri/core/workers/chunks/2a65bbe6c63c384cbf5f.js +1 -0
- package/assets/esri/core/workers/chunks/2fa69ca3ba8c442dd7d6.js +1 -0
- package/assets/esri/core/workers/chunks/314140e2e9b813191907.js +1 -0
- package/assets/esri/core/workers/chunks/32e22d6eee9fed1f70b0.js +1 -0
- package/assets/esri/core/workers/chunks/{af40e2e6eaf3d2226812.js → 3464a38e758c687a28d4.js} +1 -1
- package/assets/esri/core/workers/chunks/38816f95e801f1c5bbad.js +1 -0
- package/assets/esri/core/workers/chunks/3f8e8f83ebda07d29ca8.js +1 -0
- package/assets/esri/core/workers/chunks/41396724040180d2537f.js +1 -0
- package/assets/esri/core/workers/chunks/{66baacbef23291eab853.js → 413d2fa54508e6f42c74.js} +1 -1
- package/assets/esri/core/workers/chunks/{32e9e92bbbd000fbbaf7.js → 4141a3a93732996601e8.js} +2 -2
- package/assets/esri/core/workers/chunks/41e59d75ccb51a238739.js +1 -0
- package/assets/esri/core/workers/chunks/44016e1176629c36bc11.js +1 -0
- package/assets/esri/core/workers/chunks/468c70e5fdb61dfaad80.js +1 -0
- package/assets/esri/core/workers/chunks/4d069a0ebadb9c53b550.js +1 -0
- package/assets/esri/core/workers/chunks/4e7b084f7104deea1ddb.js +1 -0
- package/assets/esri/core/workers/chunks/{9c72127de7afcbaafbaf.js → 51852ef71ac04954fdae.js} +1 -1
- package/assets/esri/core/workers/chunks/549a51dedcc49f366e53.js +1 -0
- package/assets/esri/core/workers/chunks/{42e084704dea6e4135b6.js → 54c0306082d30d59cba2.js} +1 -1
- package/assets/esri/core/workers/chunks/56036327e721f9c42b33.js +1 -0
- package/assets/esri/core/workers/chunks/57cdd5d4ae073d5ca725.js +1 -0
- package/assets/esri/core/workers/chunks/5b9257c5359fa05f4f28.js +1 -0
- package/assets/esri/core/workers/chunks/5d574079f0e96e883aab.js +1 -0
- package/assets/esri/core/workers/chunks/5d967bcf71c05ddb1ab6.js +1 -0
- package/assets/esri/core/workers/chunks/5fccb372b4d5ee2f64cc.js +1 -0
- package/assets/esri/core/workers/chunks/61778185d702da468b00.js +1 -0
- package/assets/esri/core/workers/chunks/61794a861a9209b72622.js +1 -0
- package/assets/esri/core/workers/chunks/61b49cdaf288f36f9288.js +1 -0
- package/assets/esri/core/workers/chunks/{8ea67b502f9355dab7e9.js → 621ea864e2774f160d1c.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d289cee96e7c7fe1029.js → 62a2da0ffc67f98445c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{254898b41cabe313b6ce.js → 62d96b012c2d6f601863.js} +1 -1
- package/assets/esri/core/workers/chunks/644dd906bee3ef465ec0.js +1 -0
- package/assets/esri/core/workers/chunks/66692d6edc1bd96645e2.js +1 -0
- package/assets/esri/core/workers/chunks/679086351352756b33c9.js +1 -0
- package/assets/esri/core/workers/chunks/681e97ebbf9c69c410c6.js +1 -0
- package/assets/esri/core/workers/chunks/69520cad347947b09f21.js +1 -0
- package/assets/esri/core/workers/chunks/{c86b15f6a18880f921cd.js → 6a567755b67c06d16f21.js} +1 -1
- package/assets/esri/core/workers/chunks/{fdf4c1f202cfddf0f226.js → 6d11ec355e5474b2968b.js} +1 -1
- package/assets/esri/core/workers/chunks/6e7bb6d3e739527116a4.js +1 -0
- package/assets/esri/core/workers/chunks/751f3cfb000045ac78bb.js +1 -0
- package/assets/esri/core/workers/chunks/{64ad6130de549083caba.js → 789357e0f79823f145dd.js} +1 -1
- package/assets/esri/core/workers/chunks/{b6d94cbd1c5adad2f247.js → 78fbfc03d9b827c3f767.js} +1 -1
- package/assets/esri/core/workers/chunks/79df97e3f5975b42dc4d.js +1 -0
- package/assets/esri/core/workers/chunks/{25e4568a3ff76f48ac5e.js → 7a56c836c89a8b978800.js} +1 -1
- package/assets/esri/core/workers/chunks/7e97684e851274efd11f.js +1 -0
- package/assets/esri/core/workers/chunks/7e9b790fe01b89acdf6d.js +1 -0
- package/assets/esri/core/workers/chunks/7fb9a5bc22d7581f1d20.js +1 -0
- package/assets/esri/core/workers/chunks/{5c1abb46b9937a050c32.js → 7ffcd308087c35adda04.js} +1 -1
- package/assets/esri/core/workers/chunks/84eb889b9cce35dac2e5.js +1 -0
- package/assets/esri/core/workers/chunks/891d97d0da6361d63679.js +1 -0
- package/assets/esri/core/workers/chunks/8a0f254d45d00b293479.js +1 -0
- package/assets/esri/core/workers/chunks/8ede12f54b215c52cf3c.js +1 -0
- package/assets/esri/core/workers/chunks/8fed6becd107d2ed9bbd.js +1 -0
- package/assets/esri/core/workers/chunks/90cef6f96df7dc27db39.js +1 -0
- package/assets/esri/core/workers/chunks/921c30b7f4dfc3e018d9.js +1 -0
- package/assets/esri/core/workers/chunks/927773ed23b1fc245bf7.js +1 -0
- package/assets/esri/core/workers/chunks/{b056b4c79bcd542dd1d2.js → 9622a83b29acb768fcb5.js} +1 -1
- package/assets/esri/core/workers/chunks/97062996e1e4196cfa7c.js +1 -0
- package/assets/esri/core/workers/chunks/97210bcb5e3cf3ac961b.js +1 -0
- package/assets/esri/core/workers/chunks/{f550fc8c078ebd47d7a3.js → 97e15e66e55d9149fd48.js} +1 -1
- package/assets/esri/core/workers/chunks/9c819ebdc98ed8b6afcf.js +1 -0
- package/assets/esri/core/workers/chunks/9dfd00972c12a4adc15d.js +1 -0
- package/assets/esri/core/workers/chunks/9fab410b9fa668dc498b.js +1 -0
- package/assets/esri/core/workers/chunks/a118de5a163ae42bee60.js +1 -0
- package/assets/esri/core/workers/chunks/a4b6fdbc995be03d2afb.js +1 -0
- package/assets/esri/core/workers/chunks/a59db907ec1e31002100.js +1 -0
- package/assets/esri/core/workers/chunks/a5b395e518e4c5fc95d0.js +1414 -0
- package/assets/esri/core/workers/chunks/a5d9dbb1fef8c4465943.js +1 -0
- package/assets/esri/core/workers/chunks/{62c2757f5dc4aaca2df8.js → a73e8b80760dc88f926f.js} +1 -1
- package/assets/esri/core/workers/chunks/a96692514dcaa50340dd.js +1 -0
- package/assets/esri/core/workers/chunks/b4fb4484fa39eede1f62.js +1 -0
- package/assets/esri/core/workers/chunks/b50a42a9f96515beb929.js +1 -0
- package/assets/esri/core/workers/chunks/b8acb6c2538053c01cc6.js +1 -0
- package/assets/esri/core/workers/chunks/b8bf3e8b8b870f69f231.js +1 -0
- package/assets/esri/core/workers/chunks/b8e85b7d5eed6e7c79b5.js +1 -0
- package/assets/esri/core/workers/chunks/{fd629a3ab558adf52617.js → bc2c7cb99e227ddbd3a6.js} +1 -1
- package/assets/esri/core/workers/chunks/bc85bb82cfcbc216fa31.js +1 -0
- package/assets/esri/core/workers/chunks/{354351ab3fc79dedf9a8.js → bcb8a25438c66815e37a.js} +1 -1
- package/assets/esri/core/workers/chunks/be1e4c3ec53fc92a26f1.js +1 -0
- package/assets/esri/core/workers/chunks/be4d13088a557b7de4b1.js +1 -0
- package/assets/esri/core/workers/chunks/bf758d57091fa534c1f8.js +1 -0
- package/assets/esri/core/workers/chunks/bfd516c37fb717e14d71.js +1 -0
- package/assets/esri/core/workers/chunks/c22945637a40355fbe61.js +1 -0
- package/assets/esri/core/workers/chunks/c25a58d9f94aaa96957d.js +1 -0
- package/assets/esri/core/workers/chunks/c4e936879c6cb25cf586.js +1 -0
- package/assets/esri/core/workers/chunks/c6a43f748dbf8bac4bb5.js +1 -0
- package/assets/esri/core/workers/chunks/cb9185ed31109781fe59.js +1 -0
- package/assets/esri/core/workers/chunks/d21fdd67477800101f3b.js +1 -0
- package/assets/esri/core/workers/chunks/d264aed5dbe09e34040f.js +1 -0
- package/assets/esri/core/workers/chunks/d315098b038a96084ff5.js +1 -0
- package/assets/esri/core/workers/chunks/d4465fd3319d0b6a26cc.js +1 -0
- package/assets/esri/core/workers/chunks/{13eb0162d95b4d27389c.js → d598d08dbf2796742e8c.js} +1 -1
- package/assets/esri/core/workers/chunks/d5c7ebfd5c2ca635a7a8.js +1 -0
- package/assets/esri/core/workers/chunks/{d4368e281c12fa7c17c5.js → d635f97b7b82a37482d6.js} +1 -1
- package/assets/esri/core/workers/chunks/d7b92bd9198dd3b27eb5.js +1 -0
- package/assets/esri/core/workers/chunks/d83ac66478a419e08af6.js +1 -0
- package/assets/esri/core/workers/chunks/d8dde0d1759e009b8373.js +1 -0
- package/assets/esri/core/workers/chunks/d94dfb2ce31e59b3306b.js +1 -0
- package/assets/esri/core/workers/chunks/{8166ad6bbd7d7a8f91cf.js → deddf6ae4498a3d0d0e5.js} +1 -1
- package/assets/esri/core/workers/chunks/{45f1e682668cffc00b44.js → e0df7554b1679168663d.js} +1 -1
- package/assets/esri/core/workers/chunks/e0fcb5fa0e9f21fde2b6.js +1 -0
- package/assets/esri/core/workers/chunks/e305ced975d885c28e7e.js +1 -0
- package/assets/esri/core/workers/chunks/e3c60b7df2740e600066.js +1 -0
- package/assets/esri/core/workers/chunks/e611cd03eee4fae7c413.js +1 -0
- package/assets/esri/core/workers/chunks/e64a92b6f4075616f40f.js +1 -0
- package/assets/esri/core/workers/chunks/e78b442417f6a903b9b1.js +1 -0
- package/assets/esri/core/workers/chunks/{ba72989749543122a6fe.js → e9f2b573f482718306e6.js} +1 -1
- package/assets/esri/core/workers/chunks/ea6d3b7c7d720aa7bc94.js +1 -0
- package/assets/esri/core/workers/chunks/eab1b45ab5a802e29f8c.js +1 -0
- package/assets/esri/core/workers/chunks/eb7392799a01c2a8497a.js +1 -0
- package/assets/esri/core/workers/chunks/{c17c3453d014dc73fe0b.js → ef013a77950c1902de11.js} +1 -1
- package/assets/esri/core/workers/chunks/ef0fe4e1a9e960a74c60.js +1 -0
- package/assets/esri/core/workers/chunks/efbbcf467b2a27a92b85.js +1 -0
- package/assets/esri/core/workers/chunks/f201edf9b68717a6106d.js +1 -0
- package/assets/esri/core/workers/chunks/f43a63094190d2074cd0.js +1 -0
- package/assets/esri/core/workers/chunks/f59f1db572be1f19887f.js +1 -0
- package/assets/esri/core/workers/chunks/{dc07dc1cd30edc0c4193.js → f62e42659b406435573d.js} +1 -1
- package/assets/esri/core/workers/chunks/fa160a2a5dc9f5a7c34b.js +1 -0
- package/assets/esri/core/workers/chunks/fa7ae035472540999721.js +1 -0
- package/assets/esri/core/workers/chunks/fe3b42eadcdd9ba54f05.js +1 -0
- package/assets/esri/core/workers/chunks/fee31d9297648219375d.js +1 -0
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/GaussianSplat.glsl.js +14 -2
- package/chunks/OITDim.glsl.js +3 -2
- package/chunks/Path.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/ShadowCastAccumulate.glsl.js +2 -2
- package/chunks/ShadowHighlight.glsl.js +3 -3
- package/chunks/ShadowHighlightBuffer.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +1 -1
- package/chunks/Water.glsl.js +1 -1
- package/config.js +1 -1
- package/core/timeUtils.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/effects/FocusAreas.d.ts +1 -1
- package/form/elements/FieldElement.d.ts +3 -3
- package/form/elements/GroupElement.d.ts +1 -1
- package/form/elements/TextElement.d.ts +1 -1
- package/form/elements/inputs/ComboBoxInput.d.ts +1 -1
- package/form/elements/inputs/DateTimeOffsetPickerInput.d.ts +1 -1
- package/form/elements/inputs/DateTimeOffsetPickerInput.js +1 -1
- package/form/elements/inputs/Input.d.ts +1 -1
- package/form/elements/inputs/RadioButtonsInput.d.ts +1 -1
- package/form/elements/inputs/SwitchInput.d.ts +1 -1
- package/form/elements/inputs/inputUtils.js +1 -1
- package/form/elements/inputs.js +1 -1
- package/geometry/Mesh.d.ts +7 -7
- package/geometry/operators/alphaShapeOperator.d.ts +1 -1
- package/geometry/operators/areaOperator.d.ts +1 -1
- package/geometry/operators/bufferOperator.d.ts +1 -1
- package/geometry/operators/centroidOperator.d.ts +1 -1
- package/geometry/operators/clipOperator.d.ts +1 -1
- package/geometry/operators/containsOperator.d.ts +1 -1
- package/geometry/operators/convexHullOperator.d.ts +1 -1
- package/geometry/operators/crossesOperator.d.ts +1 -1
- package/geometry/operators/cutOperator.d.ts +1 -1
- package/geometry/operators/densifyOperator.d.ts +1 -1
- package/geometry/operators/differenceOperator.d.ts +1 -1
- package/geometry/operators/disjointOperator.d.ts +1 -1
- package/geometry/operators/distanceOperator.d.ts +1 -1
- package/geometry/operators/generalizeOperator.d.ts +1 -1
- package/geometry/operators/geodesicProximityOperator.d.ts +1 -1
- package/geometry/operators/geodeticDistanceOperator.d.ts +1 -1
- package/geometry/operators/geodeticUtilsOperator.d.ts +2 -2
- package/geometry/operators/graphicBufferOperator.d.ts +1 -1
- package/geometry/operators/intersectionOperator.d.ts +1 -1
- package/geometry/operators/intersectsOperator.d.ts +1 -1
- package/geometry/operators/isNearOperator.d.ts +1 -1
- package/geometry/operators/lengthOperator.d.ts +1 -1
- package/geometry/operators/locateBetweenOperator.d.ts +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.d.ts +1 -1
- package/geometry/operators/offsetOperator.d.ts +5 -5
- package/geometry/operators/overlapsOperator.d.ts +1 -1
- package/geometry/operators/proximityOperator.d.ts +1 -1
- package/geometry/operators/simplifyOGCOperator.d.ts +1 -1
- package/geometry/operators/simplifyOperator.d.ts +1 -1
- package/geometry/operators/support/Transformation.d.ts +6 -6
- package/geometry/operators/symmetricDifferenceOperator.d.ts +1 -1
- package/geometry/operators/touchesOperator.d.ts +1 -1
- package/geometry/operators/unionOperator.d.ts +1 -1
- package/geometry/operators/withinOperator.d.ts +1 -1
- package/geometry/support/MeshMaterialMetallicRoughness.d.ts +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/geometry/support/vcsData.js +2 -0
- package/geometry/support/vcsLookup.js +2 -0
- package/interfaces.d.ts +4 -2
- package/intl.js +1 -1
- package/kernel.js +1 -1
- package/layers/BuildingSceneLayer.d.ts +4 -4
- package/layers/CSVLayer.d.ts +2 -2
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/ElevationLayer.d.ts +1 -1
- package/layers/FeatureLayer.d.ts +9 -2
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +2 -2
- package/layers/GeoRSSLayer.d.ts +1 -1
- package/layers/GraphicsLayer.d.ts +2 -2
- package/layers/ImageryLayer.d.ts +3 -3
- package/layers/ImageryTileLayer.d.ts +2 -2
- package/layers/IntegratedMesh3DTilesLayer.d.ts +6 -6
- package/layers/IntegratedMeshLayer.d.ts +7 -7
- package/layers/MapImageLayer.d.ts +1 -1
- package/layers/MediaLayer.d.ts +1 -1
- package/layers/OGCFeatureLayer.d.ts +2 -2
- package/layers/PointCloudLayer.d.ts +1 -1
- package/layers/SceneLayer.d.ts +9 -9
- package/layers/StreamLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/VectorTileLayer.d.ts +2 -2
- package/layers/VideoLayer.d.ts +1 -1
- package/layers/VoxelLayer.d.ts +8 -8
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/WFSLayer.d.ts +6 -6
- package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/BlendLayer.d.ts +6 -6
- package/layers/pointCloudFilters/PointCloudReturnFilter.d.ts +1 -1
- package/layers/pointCloudFilters/PointCloudValueFilter.d.ts +1 -1
- package/layers/support/DimensionalDefinition.d.ts +2 -2
- package/layers/support/FeatureEffect.d.ts +4 -4
- package/layers/support/FeatureFilter.d.ts +17 -17
- package/layers/support/FeatureReductionBinning.d.ts +1 -1
- package/layers/support/FeatureReductionCluster.d.ts +9 -9
- package/layers/support/FeatureReductionSelection.d.ts +1 -1
- package/layers/support/LabelClass.d.ts +2 -2
- package/layers/support/RasterFunction.d.ts +1 -1
- package/layers/support/SceneFilter.d.ts +2 -2
- package/layers/support/SceneModification.d.ts +3 -3
- package/layers/support/SymbolLayerDrawing.d.ts +15 -0
- package/layers/support/SymbolLayerDrawing.js +2 -0
- package/layers/support/capabilities.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/types.d.ts +6 -0
- package/networks/support/jsonTypes.d.ts +36 -11
- package/package.json +4 -4
- package/popup/Feature.d.ts +20 -10
- package/popup/Feature.js +1 -1
- package/popup/Features.d.ts +82 -227
- package/popup/Features.js +1 -1
- package/popup/content/AttachmentsContent.d.ts +1 -1
- package/popup/content/BarChartMediaInfo.d.ts +1 -1
- package/popup/content/ColumnChartMediaInfo.d.ts +1 -1
- package/popup/content/FieldsContent.d.ts +1 -1
- package/popup/content/ImageMediaInfo.d.ts +1 -1
- package/popup/content/LineChartMediaInfo.d.ts +1 -1
- package/popup/content/MediaContent.d.ts +1 -1
- package/popup/content/PieChartMediaInfo.d.ts +1 -1
- package/popup/content/RelationshipContent.d.ts +1 -1
- package/popup/content/TextContent.d.ts +1 -1
- package/popup/support/FeatureAbilities.d.ts +45 -9
- package/popup/support/featureUtils.js +1 -1
- package/popup/types.d.ts +126 -8
- package/portal/schemas/definitions.js +1 -1
- package/renderers/ClassBreaksRenderer.d.ts +1 -1
- package/renderers/DictionaryRenderer.d.ts +1 -1
- package/renderers/DotDensityRenderer.d.ts +3 -3
- package/renderers/FlowRenderer.d.ts +5 -5
- package/renderers/HeatmapRenderer.d.ts +3 -3
- package/renderers/PieChartRenderer.d.ts +1 -1
- package/renderers/RasterShadedReliefRenderer.d.ts +1 -1
- package/renderers/Renderer.d.ts +4 -4
- package/renderers/SimpleRenderer.d.ts +2 -2
- package/renderers/UniqueValueRenderer.d.ts +2 -2
- package/renderers/VectorFieldRenderer.d.ts +1 -1
- package/renderers/mixins/VisualVariablesMixin.d.ts +12 -12
- package/renderers/visualVariables/ColorVariable.d.ts +1 -1
- package/renderers/visualVariables/OpacityVariable.d.ts +1 -1
- package/renderers/visualVariables/RotationVariable.d.ts +1 -1
- package/renderers/visualVariables/SizeVariable.d.ts +1 -1
- package/renderers/visualVariables/VisualVariable.d.ts +1 -1
- package/rest/query/support/AttachmentInfo.d.ts +1 -1
- package/rest/support/AttributeBinsQuery.d.ts +8 -8
- package/rest/support/AutoIntervalBinParameters.d.ts +1 -1
- package/rest/support/DateBinParameters.d.ts +1 -1
- package/rest/support/FixedBoundariesBinParameters.d.ts +1 -1
- package/rest/support/FixedIntervalBinParameters.d.ts +1 -1
- package/rest/support/Query.d.ts +8 -8
- package/rest/support/TopFeaturesQuery.d.ts +8 -8
- package/smartMapping/labels/clusters.d.ts +1 -1
- package/smartMapping/popup/clusters.d.ts +2 -2
- package/smartMapping/popup/templates.d.ts +1 -1
- package/smartMapping/raster/renderers/flow.d.ts +2 -2
- package/smartMapping/renderers/color.d.ts +12 -12
- package/smartMapping/renderers/predominance.d.ts +3 -3
- package/smartMapping/renderers/relationship.d.ts +15 -15
- package/smartMapping/renderers/univariateColorSize.d.ts +4 -4
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/smartMapping/symbology/color.d.ts +4 -4
- package/smartMapping/symbology/flow.d.ts +2 -2
- package/smartMapping/symbology/types.d.ts +18 -18
- package/support/actions/ActionButton.d.ts +1 -1
- package/support/basemapDefinitions.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/CIMSymbol.d.ts +1 -1
- package/symbols/ExtrudeSymbol3DLayer.d.ts +1 -1
- package/symbols/FillSymbol3DLayer.d.ts +3 -3
- package/symbols/IconSymbol3DLayer.d.ts +1 -1
- package/symbols/LabelSymbol3D.d.ts +2 -2
- package/symbols/LineStyleMarker3D.d.ts +7 -7
- package/symbols/LineSymbol3D.d.ts +2 -2
- package/symbols/LineSymbol3DLayer.d.ts +7 -7
- package/symbols/LineSymbolMarker.d.ts +6 -6
- package/symbols/MarkerSymbol.d.ts +1 -1
- package/symbols/MeshSymbol3D.d.ts +2 -2
- package/symbols/ObjectSymbol3DLayer.d.ts +1 -1
- package/symbols/PathSymbol3DLayer.d.ts +14 -14
- package/symbols/PictureFillSymbol.d.ts +1 -1
- package/symbols/PictureMarkerSymbol.d.ts +1 -1
- package/symbols/PointSymbol3D.d.ts +3 -3
- package/symbols/PolygonSymbol3D.d.ts +5 -5
- package/symbols/SimpleFillSymbol.d.ts +8 -8
- package/symbols/SimpleLineSymbol.d.ts +20 -20
- package/symbols/SimpleMarkerSymbol.d.ts +7 -7
- package/symbols/Symbol3DLayer.d.ts +16 -16
- package/symbols/TextSymbol.d.ts +1 -1
- package/symbols/TextSymbol3DLayer.d.ts +1 -1
- package/symbols/WaterSymbol3DLayer.d.ts +3 -3
- package/symbols/WebStyleSymbol.d.ts +12 -12
- package/symbols/callouts/Callout3D.d.ts +1 -1
- package/symbols/callouts/LineCallout3D.d.ts +3 -3
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/types.d.ts +29 -23
- package/symbols/edges/Edges3D.d.ts +1 -1
- package/symbols/edges/SolidEdges3D.d.ts +1 -1
- package/symbols/patterns/LineStylePattern3D.d.ts +11 -11
- package/symbols/patterns/StylePattern3D.d.ts +8 -8
- package/symbols/support/ElevationInfo.d.ts +2 -2
- package/symbols/support/IconSymbol3DLayerResource.d.ts +6 -6
- package/symbols/support/ObjectSymbol3DLayerResource.d.ts +7 -7
- package/symbols/support/Symbol3DEmissive.d.ts +2 -2
- package/symbols/support/Symbol3DVerticalOffset.d.ts +2 -2
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/flow/FlowStrategy.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Stack.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
- package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +2 -2
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/support/DisplayGL.js +1 -1
- package/views/2d/types.d.ts +3 -3
- package/views/3d/FocusAreasView.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/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/environment/CloudyWeather.d.ts +1 -1
- package/views/3d/environment/Environment.d.ts +4 -4
- package/views/3d/environment/FoggyWeather.d.ts +1 -1
- package/views/3d/environment/RainyWeather.d.ts +1 -1
- package/views/3d/environment/SnowyWeather.d.ts +1 -1
- package/views/3d/environment/SunLighting.d.ts +1 -1
- package/views/3d/environment/SunnyWeather.d.ts +1 -1
- package/views/3d/environment/VirtualLighting.d.ts +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/graphics/extrudeUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
- package/views/3d/webgl/ManagedFBO.js +1 -1
- package/views/3d/webgl/RenderNode.d.ts +2 -2
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +18 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITDim.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITDimTechniqueConfiguration.js +2 -0
- package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl.d.ts +1 -1
- package/views/Magnifier.d.ts +3 -3
- package/views/MapView.d.ts +7 -7
- package/views/SceneView.d.ts +16 -16
- package/views/View.d.ts +17 -3
- package/views/View.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/drawUtils.js +1 -1
- package/views/draw/support/reshapeTooltipUtils.js +1 -1
- package/views/draw/support/types.d.ts +9 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +7 -7
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +3 -2
- package/views/support/HighlightOptions.d.ts +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/views/types.d.ts +59 -2
- package/views/ui/DefaultUI.d.ts +2 -2
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
- package/webscene/Environment.d.ts +10 -10
- package/webscene/Glow.d.ts +1 -1
- package/webscene/background/ColorBackground.d.ts +1 -1
- package/widgets/AreaMeasurement2D.d.ts +1 -1
- package/widgets/AreaMeasurement3D.d.ts +2 -2
- package/widgets/Attachments.d.ts +1 -1
- package/widgets/Attribution.d.ts +1 -1
- package/widgets/BasemapGallery.d.ts +1 -1
- package/widgets/BasemapLayerList.d.ts +3 -3
- package/widgets/BasemapToggle.d.ts +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +1 -1
- package/widgets/Bookmarks.d.ts +2 -2
- package/widgets/BuildingExplorer.d.ts +1 -1
- package/widgets/CatalogLayerList.d.ts +3 -3
- package/widgets/Compass.d.ts +2 -2
- package/widgets/CoordinateConversion.d.ts +1 -1
- package/widgets/Daylight.d.ts +5 -5
- package/widgets/DirectLineMeasurement3D.d.ts +2 -2
- package/widgets/Directions.d.ts +4 -4
- package/widgets/DistanceMeasurement2D.d.ts +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.d.ts +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor.d.ts +8 -8
- package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.d.ts +1 -1
- package/widgets/ElevationProfile.d.ts +3 -3
- package/widgets/Expand.d.ts +1 -1
- package/widgets/Feature/FeatureViewModel.d.ts +14 -4
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm.d.ts +1 -1
- package/widgets/FeatureTable/ActionColumn.d.ts +2 -2
- package/widgets/FeatureTable/AttachmentsColumn.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +3 -3
- package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -1
- package/widgets/FeatureTable/RelationshipColumn.d.ts +1 -1
- package/widgets/FeatureTable/VisibleElements.d.ts +1 -1
- package/widgets/FeatureTable.d.ts +10 -10
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.d.ts +5 -5
- package/widgets/FeatureTemplates.d.ts +8 -8
- package/widgets/Features/FeaturesViewModel.d.ts +18 -7
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Features/FeaturesVisibleElements.d.ts +2 -2
- package/widgets/Features.d.ts +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/FloorFilter.d.ts +2 -2
- package/widgets/Histogram.d.ts +2 -2
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/widgets/Home.d.ts +1 -1
- package/widgets/LayerList/ListItemPanel.d.ts +1 -1
- package/widgets/LayerList.d.ts +4 -4
- package/widgets/Legend.d.ts +8 -8
- package/widgets/LineOfSight.d.ts +1 -1
- package/widgets/Locate.d.ts +2 -2
- package/widgets/Measurement.d.ts +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.d.ts +1 -1
- package/widgets/NavigationToggle.d.ts +3 -3
- package/widgets/Popup/PopupViewModel.d.ts +2 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/PopupVisibleElements.d.ts +2 -2
- package/widgets/Popup.d.ts +18 -9
- package/widgets/Popup.js +1 -1
- package/widgets/Print/CustomTemplate.d.ts +1 -1
- package/widgets/Print/TemplateOptions.d.ts +4 -4
- package/widgets/ScaleRangeSlider.d.ts +1 -1
- package/widgets/Search/SearchViewModel.d.ts +4 -4
- package/widgets/Search.d.ts +5 -5
- package/widgets/ShadowCast.d.ts +3 -3
- package/widgets/Sketch/SketchViewModel.d.ts +39 -39
- package/widgets/Sketch.d.ts +43 -43
- package/widgets/Slice.d.ts +2 -2
- package/widgets/Slider/SliderViewModel.d.ts +2 -2
- package/widgets/Slider.d.ts +9 -9
- package/widgets/Swipe/SwipeViewModel.d.ts +1 -1
- package/widgets/Swipe.d.ts +2 -2
- package/widgets/TableList/ListItemPanel.d.ts +1 -1
- package/widgets/TableList.d.ts +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +10 -10
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/TimeSlider/types.d.ts +1 -1
- package/widgets/TimeSlider.d.ts +13 -13
- package/widgets/Track.d.ts +2 -2
- package/widgets/UtilityNetworkAssociations.d.ts +3 -3
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace.d.ts +4 -4
- package/widgets/UtilityNetworkValidateTopology.d.ts +1 -1
- package/widgets/ValuePicker.d.ts +5 -5
- package/widgets/VideoPlayer.d.ts +1 -1
- package/widgets/smartMapping/ClassedColorSlider.d.ts +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.d.ts +1 -1
- package/widgets/smartMapping/ColorSizeSlider.d.ts +2 -2
- package/widgets/smartMapping/ColorSlider.d.ts +1 -1
- package/widgets/smartMapping/HeatmapSlider.d.ts +1 -1
- package/widgets/smartMapping/OpacitySlider.d.ts +1 -1
- package/widgets/smartMapping/SizeSlider.d.ts +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.d.ts +4 -4
- package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +6 -6
- package/widgets/support/GridControls.d.ts +1 -1
- package/widgets/support/SnappingControls/VisibleElements.d.ts +1 -1
- package/widgets/support/SnappingControls.d.ts +6 -6
- package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +0 -1
- package/assets/esri/core/workers/chunks/05c8d2c0362af4511d86.js +0 -1
- package/assets/esri/core/workers/chunks/06868e4f52de9d918255.js +0 -1
- package/assets/esri/core/workers/chunks/06c0b93e276cfc1fb7ac.js +0 -1
- package/assets/esri/core/workers/chunks/0888baa99c9007ad63bc.js +0 -1
- package/assets/esri/core/workers/chunks/0de66f13e84830a654fb.js +0 -1
- package/assets/esri/core/workers/chunks/0f597c690e5c60fe944b.js +0 -1
- package/assets/esri/core/workers/chunks/0f8736242544f9e9a57a.js +0 -1
- package/assets/esri/core/workers/chunks/0ff12fe9e358100668d9.js +0 -1
- package/assets/esri/core/workers/chunks/11a8541f3909f9ffb000.js +0 -1
- package/assets/esri/core/workers/chunks/13a009229c96ecb7b04f.js +0 -1
- package/assets/esri/core/workers/chunks/185f59f90070d5d6ac94.js +0 -1
- package/assets/esri/core/workers/chunks/190bc75254bc0542a6be.js +0 -1
- package/assets/esri/core/workers/chunks/1af247c86d1c4ae8fef3.js +0 -1
- package/assets/esri/core/workers/chunks/2339465190c9d5ede25f.js +0 -1
- package/assets/esri/core/workers/chunks/23eb204d3cb818adea32.js +0 -1
- package/assets/esri/core/workers/chunks/241ef4a1bea20b49d812.js +0 -1
- package/assets/esri/core/workers/chunks/2669a7195f1de21a9cf3.js +0 -1
- package/assets/esri/core/workers/chunks/2a2d5f9ea42cb2eee9c6.js +0 -1
- package/assets/esri/core/workers/chunks/2a7e7a497823e9f05aa3.js +0 -1
- package/assets/esri/core/workers/chunks/2aaeaf022af8493281dc.js +0 -1
- package/assets/esri/core/workers/chunks/2d92ba11781a3cfc3a78.js +0 -1
- package/assets/esri/core/workers/chunks/31e0bfc2cab055aebf9a.js +0 -1
- package/assets/esri/core/workers/chunks/32360a55d1836b2a737e.js +0 -1
- package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +0 -1
- package/assets/esri/core/workers/chunks/34acecd7a314fed12335.js +0 -1
- package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +0 -1
- package/assets/esri/core/workers/chunks/368b4c0a5eecbb06feac.js +0 -1
- package/assets/esri/core/workers/chunks/37729578a7c4cf15eded.js +0 -1
- package/assets/esri/core/workers/chunks/3af1e2f0b3d30c58d0c2.js +0 -1
- package/assets/esri/core/workers/chunks/3c155efd5768003a91eb.js +0 -1
- package/assets/esri/core/workers/chunks/3d4bb59ab2f644f4d675.js +0 -1
- package/assets/esri/core/workers/chunks/3f0d9fdd8c37605dd85d.js +0 -1
- package/assets/esri/core/workers/chunks/48eca6f51112ba80bd3b.js +0 -1
- package/assets/esri/core/workers/chunks/4b5737021a149aa786af.js +0 -1
- package/assets/esri/core/workers/chunks/55214e1d9f3d98fa7ed9.js +0 -1
- package/assets/esri/core/workers/chunks/55a0b69cf034ac32fc25.js +0 -1
- package/assets/esri/core/workers/chunks/576a1784e93c5406e657.js +0 -1
- package/assets/esri/core/workers/chunks/59289867cce97da74e39.js +0 -1
- package/assets/esri/core/workers/chunks/5a6d6082c5bcb1a80eda.js +0 -1
- package/assets/esri/core/workers/chunks/5a9620cb66c8e64e4668.js +0 -1
- package/assets/esri/core/workers/chunks/5c6e5f22450dd0583074.js +0 -1
- package/assets/esri/core/workers/chunks/5eeb6d3a7b815d41621e.js +0 -1
- package/assets/esri/core/workers/chunks/5f06a57b4f7d7de16bbf.js +0 -1
- package/assets/esri/core/workers/chunks/5f2e246ffcbdedea4de5.js +0 -1
- package/assets/esri/core/workers/chunks/5ff41f43e57be0557541.js +0 -1414
- package/assets/esri/core/workers/chunks/6b32b3f98872771ff81e.js +0 -1
- package/assets/esri/core/workers/chunks/6be9d00839002f24fafd.js +0 -1
- package/assets/esri/core/workers/chunks/6c72dbd5275bffde1583.js +0 -1
- package/assets/esri/core/workers/chunks/6c886f19875291d02407.js +0 -1
- package/assets/esri/core/workers/chunks/75f7c1f600c4051bc905.js +0 -1
- package/assets/esri/core/workers/chunks/77f6659e400064d38130.js +0 -1
- package/assets/esri/core/workers/chunks/78c7eace6ec3fa5c7413.js +0 -1
- package/assets/esri/core/workers/chunks/7cee28575fd57430cf02.js +0 -1
- package/assets/esri/core/workers/chunks/82e0691995d821137d5f.js +0 -1
- package/assets/esri/core/workers/chunks/8435b6bf356959009b76.js +0 -1
- package/assets/esri/core/workers/chunks/8677865189081e0b83bc.js +0 -1
- package/assets/esri/core/workers/chunks/86f70bd786d6d57fde69.js +0 -1
- package/assets/esri/core/workers/chunks/8878ab87ef7961fafae8.js +0 -1
- package/assets/esri/core/workers/chunks/8a893f23827769d42092.js +0 -1
- package/assets/esri/core/workers/chunks/8d1d0c3f0532aa98487d.js +0 -1
- package/assets/esri/core/workers/chunks/8e68b4628e9616356c34.js +0 -1
- package/assets/esri/core/workers/chunks/8edae79554843dd77ada.js +0 -1
- package/assets/esri/core/workers/chunks/9032c040b214b5af775b.js +0 -1
- package/assets/esri/core/workers/chunks/909ef35fa33be2b6da41.js +0 -1
- package/assets/esri/core/workers/chunks/90b7acc70adba193b215.js +0 -1
- package/assets/esri/core/workers/chunks/91718795fc4ca6516ac7.js +0 -1
- package/assets/esri/core/workers/chunks/92d4e962284e13ba2fc5.js +0 -1
- package/assets/esri/core/workers/chunks/94f80c46ccf5e19038b8.js +0 -1
- package/assets/esri/core/workers/chunks/979c2f52b6d6e1e8241b.js +0 -1
- package/assets/esri/core/workers/chunks/97f10efb0fe05bedcebd.js +0 -1
- package/assets/esri/core/workers/chunks/98f5bf1b91f3696b2fce.js +0 -1
- package/assets/esri/core/workers/chunks/9c52d4b54dfdb69dee29.js +0 -1
- package/assets/esri/core/workers/chunks/9de8149ae0a0726a4ab2.js +0 -1
- package/assets/esri/core/workers/chunks/9def5d17b94e5db71883.js +0 -1
- package/assets/esri/core/workers/chunks/9f272445c285ee9abb7b.js +0 -1
- package/assets/esri/core/workers/chunks/a10be7eb05a007fff1ed.js +0 -1
- package/assets/esri/core/workers/chunks/a32c87b89567a9fd1efc.js +0 -1
- package/assets/esri/core/workers/chunks/a3b29eca5807978fb2a3.js +0 -1
- package/assets/esri/core/workers/chunks/a446dff865332268625a.js +0 -1
- package/assets/esri/core/workers/chunks/a5bf2718c02a0e645013.js +0 -1
- package/assets/esri/core/workers/chunks/a6d166058e3025bb280e.js +0 -1
- package/assets/esri/core/workers/chunks/a8e111a5cfd6151d5dbb.js +0 -1
- package/assets/esri/core/workers/chunks/aed45f7e7eee154a21b8.js +0 -1
- package/assets/esri/core/workers/chunks/af3bd661b355eed3da21.js +0 -1
- package/assets/esri/core/workers/chunks/b0f2ce61d3cad413898e.js +0 -1
- package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +0 -1
- package/assets/esri/core/workers/chunks/b744b950999b92393e37.js +0 -1
- package/assets/esri/core/workers/chunks/b75165880704efccc47c.js +0 -1
- package/assets/esri/core/workers/chunks/ba9e107edc2027238be3.js +0 -1
- package/assets/esri/core/workers/chunks/bc3b22dc08c147b8d425.js +0 -1
- package/assets/esri/core/workers/chunks/c08e9914deb1dc62bc0f.js +0 -1
- package/assets/esri/core/workers/chunks/c0bb53d8d58ad18334d3.js +0 -1
- package/assets/esri/core/workers/chunks/c0d453f93af2d4a6ce64.js +0 -1
- package/assets/esri/core/workers/chunks/c9a42d86185a0ad35dd1.js +0 -1
- package/assets/esri/core/workers/chunks/cbb50415f7de8746ee1a.js +0 -1
- package/assets/esri/core/workers/chunks/d23dd7da45a7aa341540.js +0 -1
- package/assets/esri/core/workers/chunks/d2801df3fa44dee15ec8.js +0 -1
- package/assets/esri/core/workers/chunks/d53b31c9056f82831bc0.js +0 -1
- package/assets/esri/core/workers/chunks/d626e08d23330d84413b.js +0 -1
- package/assets/esri/core/workers/chunks/db6e03fe8dd316f5005f.js +0 -1
- package/assets/esri/core/workers/chunks/de79645e559a2d1ffa67.js +0 -1
- package/assets/esri/core/workers/chunks/e2779965db231fb666a5.js +0 -1
- package/assets/esri/core/workers/chunks/e4e2f059c52674dcae5b.js +0 -1
- package/assets/esri/core/workers/chunks/ec21311584e4fb13e510.js +0 -1
- package/assets/esri/core/workers/chunks/eca45cd479f7fd28ca6e.js +0 -1
- package/assets/esri/core/workers/chunks/ee8cd91c27e9cdfc3b2e.js +0 -1
- package/assets/esri/core/workers/chunks/efdd75896ca53eb6242f.js +0 -1
- package/assets/esri/core/workers/chunks/f1c348cf2a1e35da9b20.js +0 -1
- package/assets/esri/core/workers/chunks/f4053e4e2d6e678db48a.js +0 -1
- package/assets/esri/core/workers/chunks/f4d577ff61da7964e08a.js +0 -1
- package/assets/esri/core/workers/chunks/f7da652f8dab57677cc3.js +0 -1
- package/assets/esri/core/workers/chunks/fe92f54e45fd21ccd75f.js +0 -1
- package/assets/esri/core/workers/chunks/fee1d873127dca02459f.js +0 -1
- package/assets/esri/core/workers/chunks/ff31936236dd9b1acb24.js +0 -1
- /package/assets/esri/core/workers/chunks/{32e9e92bbbd000fbbaf7.js.LICENSE.txt → 4141a3a93732996601e8.js.LICENSE.txt} +0 -0
package/views/draw/DrawTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t,__decorate as i}from"tslib";import{createTask as a}from"../../core/asyncUtils.js";import{disposable as n}from"../../core/handleUtils.js";import s from"../../core/Logger.js";import{getOrCreateMapValue as r}from"../../core/MapUtils.js";import{destroyMaybe as o,abortMaybe as l}from"../../core/maybe.js";import{when as d,initial as p,watch as c,on as h,sync as g}from"../../core/reactiveUtils.js";import{screenPointEqual as u,createScreenPoint as m}from"../../core/screenUtils.js";import{diff as v}from"../../core/accessorSupport/diffUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as M}from"../../core/support/UpdatingHandles.js";import _ from"../../geometry/Polygon.js";import{i as b,e as w}from"../../chunks/simplifyOperator.js";import{isExtent as S}from"../../geometry/support/jsonTypeUtils.js";import{isPolygon as C}from"../../geometry/support/typeUtils.js";import{isCurvedGeometry as H}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as x}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{getEffectiveElevationInfo as P}from"../../support/elevationInfoUtils.js";import{getMaxDeviationInPixels as L,getMinSegmentsPerCurve as k}from"../2d/layers/graphics/densificationConstants.js";import{createSnappingVisualizer as O}from"./support/createSnappingVisualizer.js";import{multipointFromGeometry as j,markHandled as I,getPointerType as G}from"./support/drawToolUtils.js";import{PluginContext as T}from"./support/PluginContext.js";import{viewEventToCommand as E}from"./support/input/drawToolInput.js";import{EditSessionManager as V}from"./support/managers/EditSessionManager.js";import{GlobalStateManager as U}from"./support/managers/GlobalStateManager.js";import{InteractiveHandleManager as A}from"./support/managers/InteractiveHandleManager.js";import{MeasurementManager as D}from"./support/managers/MeasurementManager.js";import{PluginLifecycleManager as R}from"./support/managers/PluginLifecycleManager.js";import{SurfaceManager as F}from"./support/managers/SurfaceManager.js";import{TooltipManager as Z}from"./support/managers/TooltipManager.js";import{ViewEventPriorities as q}from"../input/InputManager.js";import{createCoordinateHelper as B}from"../interactive/coordinateHelper.js";import{InteractiveToolBase as z}from"../interactive/InteractiveToolBase.js";import{KeyBindings as K,mediaKeys as Q,sketchKeys as N,advancedSketchKeys as W,tooltipKeys as $}from"../interactive/keybindings.js";import{isInputModeAvailable as J}from"../interactive/tooltip/tooltipCommonUtils.js";const X=Symbol();let Y=class extends z{constructor(e){super(e),this._shapeVisualId=Symbol(),this._vertexVisualId=Symbol(),this._pluginContexts=new Map,this._queuedFeedbackEvents=[],this._flushingQueuedFeedbackEvents=!1,this._snappingVisualizer=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._updatingHandles=new M,this._keybindings=this._makeKeyBindings(),this._pendingBeginRequest=null,this.type="draw-2.0",this.automaticManipulatorSelection=!0,this.snappingManager=null,this.sketchOptions=null,this.elevationInfo=null,this.hasZ=!1,this.defaultZ=0,this.lastScreenPosition=null,this.measurementManager=new D,this.globalStateManager=new U({getPluginStack:()=>this.pluginStack}),this.editSessionManager=new V({getContext:()=>this._editSessionManagerContext}),this.lifecycleManager=new R({getContext:this._getContextForPlugin.bind(this),editSessionManager:this.editSessionManager,afterAttach:this._afterAttach.bind(this),afterDetach:this._afterDetach.bind(this),beforeResume:this._beforeResume.bind(this)}),this.surfaceManager=null,this.interactiveHandleManager=null,this.renderer=null,this.enableVertexVisuals=!0}initialize(){const{view:e}=this;this.interactiveHandleManager=new A({view:e,renderer:this.renderer}),this._override("manipulators",this.interactiveHandleManager.manipulators),this.tooltipManager=new Z({getDependencies:()=>this._tooltipDependencies,getLastScreenPosition:()=>this.lastScreenPosition}),this.addHandles(d(()=>this.renderer,t=>{t.addOrUpdateVisual(this._shapeVisualId,{role:"outputGeometry"}),t.addOrUpdateVisual(this._vertexVisualId,{role:"vertex"}),this._updatingHandles.addPromise(O(e,t).then(e=>this._snappingVisualizer=e))},p)),this.addHandles([d(()=>this.view,e=>{this.surfaceManager?.destroy(),this.surfaceManager=new F({spatialReference:this.coordinateHelper.spatialReference,excludedGraphicsLayer:null,defaultZ:this.defaultZ,hasZ:this.hasZ,view:e,elevationInfo:this.elevationInfo,getContext:()=>({drawAtFixedElevation:this.globalStateManager.drawAtFixedElevation,elevationConstraint:this.tooltipManager?.elevationConstraint,constraintsEnabled:this.tooltipManager?.constraintsEnabled??!1})})},p),d(()=>this.sketchOptions?.tooltips.effectiveEnabled,()=>this.measurementManager.preloadMeasurementUtils(),{once:!0,initial:!0}),c(()=>[this.editGeometryOperations,this.sketchOptions?.labels.enabled,this.globalStateManager.segmentLabelsDisabled],()=>{this._updatingHandles.addPromise(this._setupSegmentLabels())},p),h(()=>this.editSessionManager,"cancelPlugin",({plugin:e})=>{this._suspendPlugin(e)},g),h(()=>this.editSessionManager,"restartPlugin",({restartInfo:e})=>{this._resumePlugin(e)},g),c(()=>this.lifecycleManager.updating,e=>{e||this._emitQueuedFeedbackEvents()},g),h(()=>this.editGeometryOperations,["vertex-add","vertex-update","vertex-remove"],e=>{const t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),i=t.map(e=>e.coordinates);switch(e.type){case"vertex-add":this._emitWhenReady(e.type,{...e,added:i,vertices:t});break;case"vertex-update":this._emitWhenReady(e.type,{...e,updated:i,vertices:t});break;case"vertex-remove":this._emitWhenReady(e.type,{...e,removed:i,vertices:t})}})])}destroy(){this.active&&this.onDeactivate(),this.editSessionManager.destroy(),this.lifecycleManager.destroy(),this.measurementManager.destroy(),this.globalStateManager.destroy();for(const e of this._pluginContexts.values())e.destroy();this._pluginContexts.clear(),this.surfaceManager=o(this.surfaceManager),this.interactiveHandleManager=o(this.interactiveHandleManager),this._segmentLabelsImportTask=l(this._segmentLabelsImportTask),this._segmentLabels=o(this._segmentLabels),this.tooltipManager=o(this.tooltipManager)}get _tooltipDependencies(){const{defaultZ:e,editGeometryOperations:t,sketchOptions:i,directionOptions:a,view:n}=this;return t&&i&&n?{defaultZ:e,directionOptions:a,editGeometryOperations:t,sketchOptions:i,view:n,getActiveHandle:()=>this.interactiveHandleManager?.focusedHandle,getAllHandles:()=>this.interactiveHandleManager?.allhandles,getHelpMessageKey:()=>this.helpMessageKey,notifyTooltipsChanged:()=>{const{interactiveHandleManager:e,movementCommandContext:t}=this;e&&t&&e.reapplyPositions(t)}}:null}get _editSessionManagerContext(){const{coordinateHelper:e,view:t}=this;if(!t)return null;return{coordinateHelper:e,viewingMode:"3d"===t.type&&"global"===t.viewingMode?1:2}}get _densificationParameters(){const{view:e,coordinateHelper:t}=this,i=t.spatialReference,a=e?.spatialReference,n=e.resolution;if(!(i&&a&&n&&Number.isFinite(n)))return null;const s=a.metersPerUnit/i.metersPerUnit;return{maxDeviation:2**Math.round(Math.log2(n))*L()*s,minSegmentsPerCurve:k()}}get test(){return{densificationParameters:this._densificationParameters,segmentLabels:this._segmentLabels}}get updating(){return this._updatingHandles.updating||this.lifecycleManager.updating||!!this._segmentLabels?.updating}get coordinateHelper(){return B(this.hasZ,!1,this.view.spatialReference)}get editGeometry(){return this.editGeometryOperations?.data}get editGeometryOperations(){return this.editSessionManager.editGeometryOperations}get unprocessedGeometry(){return this.editSessionManager.outputGeometry}get simplifiedGeometryPreview(){const e=this.editSessionManager.outputGeometry;if(e&&C(e))try{const t=this._densificationParameters,i=H(e)&&t?new _({...x(e,t)}):e;if(!b(i))return w(i)}catch(t){return e}return e}get canUndo(){return this.editSessionManager.canUndo}get canRedo(){return this.editSessionManager.canRedo}get pluginStack(){return this.lifecycleManager.pluginStack}get mostDownstreamPlugin(){return this.pluginStack.at(-1)}get mostUpstreamPlugin(){return this.pluginStack.at(0)}get positionOfLastUserInput(){return this.lastScreenPosition?this.view.toMap(this.lastScreenPosition):this.view.center}get movementCommandContext(){const{editGeometryOperations:e,tooltipManager:t,surfaceManager:i,snappingManager:a,interactiveHandleManager:n,_snappingVisualizer:s,defaultZ:r,hasZ:o,globalStateManager:{drawAtFixedElevation:l},view:d}=this;return{tooltipManager:t,editGeometryOperations:e,surfaceManager:i,interactiveHandleManager:n,snappingManager:a,snappingVisualizer:s,pointerType:"mouse",hasZ:o,defaultZ:r,view:d,drawAtFixedElevation:l}}get tooltip(){return this.tooltipManager?.tooltip}get activeTooltipInfo(){return this.tooltipManager?.tooltipInfo}get helpMessageKey(){return this.pluginStack.items.findLast(e=>e.helpMessageKey)?.helpMessageKey??"noTool"}begin(e){this.active?(this.lifecycleManager.begin(e),this._pendingBeginRequest=null):this._pendingBeginRequest=e}complete(e){const t=this.lifecycleManager;e&&t.complete(e),0===t.pluginStack.length&&(this._finalizeAndSimplifyGeometryResult(),this.emit("complete",{geometry:this.finalGeometry,aborted:!1,type:"complete",vertices:[]}),this.view?.activeTool===this&&(this.view.activeTool=null))}cancelFirstUserLeafPlugin(){const e=this.pluginStack.toArray().findLast(e=>!0!==e.configuration?.hidden);e&&this.lifecycleManager.cancel(e)}replaceLeaf(e){const t=this.lifecycleManager;t.updating?s.getLogger(this).info("Ignoring command; arrived while updating:","replaceLeaf"):t.replaceLeaf(e)}finishPart(){const e=this.mostUpstreamPlugin,t=e?.configuration;if(this.editGeometryOperations&&t&&t.kind?.includes("multipart")){const e=this.pluginStack.at(1);e&&this.complete(e)}}undo(){this._guardCommand({action:"undo"},()=>this.editSessionManager.undo())}redo(){this._guardCommand({action:"redo"},()=>this.editSessionManager.redo())}executeCommand(e){return this._handleCommand(e)}addPromise(e){return this._updatingHandles.addPromise(e)}getGeometryIfCompleted(){const e=this.lifecycleManager.gatherCompletablePlugins();return this.editSessionManager?.generatePreviewGeometryForPlugins(e)}onActivate(){super.onActivate();const{view:e}=this;this.lastScreenPosition=e?.inputManager.latestPointerInfo?.location,this.renderer?.activate(),this._pendingBeginRequest&&(this.begin(this._pendingBeginRequest),this._pendingBeginRequest=null),this.enableVertexVisuals&&this.addHandles(c(()=>this.unprocessedGeometry,e=>{this.renderer?.addOrUpdateVisual(this._vertexVisualId,{geometry:e?j(e):null})},p)),this.addHandles([c(()=>this.simplifiedGeometryPreview,e=>{this.renderer?.addOrUpdateVisual(this._shapeVisualId,{geometry:e})},p),d(()=>this.interactiveHandleManager?.capturingHandle?.screenPosition,e=>this.lastScreenPosition=e,{initial:!0,equals:u}),c(()=>this.interactiveHandleManager?.capturingHandle?.outputMapPosition,(e,t)=>{const i=this.interactiveHandleManager?.capturingHandle?.editSession?.endVertex;e&&t&&i&&this._emitWhenReady("cursor-update",{updated:i.pos,type:"vertex-update",operation:"apply",vertices:[{componentIndex:i.part.index,vertexIndex:i.index,coordinates:i.pos}]})},g),this._keybindings.register(e,q.TOOL),c(()=>e.viewpoint,(e,t)=>{e&&t&&v(e,t)&&this._handleCommand({action:"viewpoint-moved"})})],X)}onDeactivate(){super.onDeactivate(),this.removeHandles(X),this.renderer?.deactivate(),this.snappingManager?.doneSnapping(),this.lifecycleManager.cancelAll(),this._pendingBeginRequest=null}onInputEvent(e){const t=E(e);t&&this._handleCommand(t)}_emitWhenReady(e,t){if(this.destroyed)return;const i=()=>{this.emit(e,t)};this.lifecycleManager.updating||this._flushingQueuedFeedbackEvents?this._queuedFeedbackEvents.push(i):i()}_emitQueuedFeedbackEvents(){if(!(this.destroyed||this._flushingQueuedFeedbackEvents||this.lifecycleManager.updating||0===this._queuedFeedbackEvents.length)){this._flushingQueuedFeedbackEvents=!0;try{for(;!this.destroyed&&!this.lifecycleManager.updating&&this._queuedFeedbackEvents.length>0;)this._queuedFeedbackEvents.shift()?.()}finally{this._flushingQueuedFeedbackEvents=!1}}}async _handleCommand(e){if(this.lifecycleManager.updating)s.getLogger(this).info("Ignoring command; arrived while updating:",e.action);else switch(e.action){case"view-drag":return await this._handleViewDragCommand(e);case"vertex-add":return this._guardCommand(e,()=>{I(e),this._commitNext()});case"vertex-add-and-finish-part":return this._handleVertexAddAndFinishPartCommand(e);case"cancel":return this._guardCommand(e,()=>this.cancel());case"complete":return this._guardCommand(e,()=>{this.mostUpstreamPlugin&&(I(e),this.complete(this.mostUpstreamPlugin))});case"finish-part":return this._guardCommand(e,()=>this.finishPart());case"undo":return this._guardCommand(e,()=>this.editSessionManager.undo());case"redo":return this._guardCommand(e,()=>this.editSessionManager.redo());case"next-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("forward"));case"previous-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("backward"));case"toggle-manipulator-follow":this.interactiveHandleManager?.toggleFollow()&&I(e);break;case"viewpoint-moved":return await this._handleViewpointMovedCommand(e);case"manipulator-move-to":return await this._handleManipulatorMoveToCommand(e);case"manipulator-drag-to":return await this._handleManipulatorDragToCommand(e);case"vertex-add-at-point":return await this._handleVertexAddAtPointCommand(e);case"show-tooltip":return this._guardCommand(e,async()=>{const t=this.tooltipManager?.tooltip;t&&J(t.info)&&(await t.enterInputMode(),I(e))});case"constraint-center":this.globalStateManager.setCentered(e.enabled);break;case"constraint-aspect":this.globalStateManager.setPreserveAspectRatio(e.enabled)}}async _handleViewDragCommand(e){if(!this.editable)return;const t=e.originalEvent,i=this.interactiveHandleManager?.capturingHandle;(!t||!("pointerType"in t)||"touch"!==t.pointerType||"capture-always"!==i?.captureMode&&"capture-when-engaged"!==i?.captureMode)&&"capture-when-engaged"!==this.interactiveHandleManager?.capturingHandle?.captureMode?this._before(e)&&I(e):I(e)}_handleVertexAddAndFinishPartCommand(e){this._before(e)||(I(e),this._commitNext(),this.finishPart())}async _handleViewpointMovedCommand(e){this.editable&&(await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(null,{...this.movementCommandContext,pointerType:G(e.originalEvent)})),this.interactiveHandleManager?.updateAllScreenPositions())}async _handleManipulatorMoveToCommand(e){if(!this.editable)return;const t=this._updateLastScreenPosition(e);this.interactiveHandleManager?.capturingHandle&&I(e),await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(t,{...this.movementCommandContext,pointerType:G(e.originalEvent)}))}async _handleManipulatorDragToCommand(e){if(!this.editable)return;const t=G(e.originalEvent),i=this._updateLastScreenPosition(e),a=this.interactiveHandleManager?.findHandleByManipulator(i);"touch"===t&&a&&"start"===e.state&&this.interactiveHandleManager?.releaseHandle();const n=this.interactiveHandleManager?.findHandleDragging(),s=this.interactiveHandleManager?.capturingHandle,r=n??s??a;r&&!a&&I(e),"capture-when-engaged"===r?.captureMode||"capture-always"===r?.captureMode&&"touch"===t?"end"===e.state?await this._updatingHandles.addPromise(r.noteDragEnd(i,{...this.movementCommandContext,pointerType:t}).then(()=>{r&&"touch"===G(e.originalEvent)&&"grabbable-object"!==r.captureMode&&"capture-when-engaged"!==r.defaultCaptureMode&&"primary"===r.role&&(1===this.interactiveHandleManager?.handleCount?this._handleCommand({action:"vertex-add"}):this.interactiveHandleManager?.releaseHandle())})):"start"===e.state?await this._updatingHandles.addPromise(r.noteDragStart(i,{...this.movementCommandContext,pointerType:t}).then(()=>{r&&"touch"===G(e.originalEvent)&&"grabbable-object"!==r.captureMode&&"capture-when-engaged"!==r.defaultCaptureMode&&!r.editSession?.lastPointAddedBySession&&this._handleCommand({action:"vertex-add"})})):await this._updatingHandles.addPromise(r?.moveTo(i,{...this.movementCommandContext,pointerType:G(e.originalEvent)})):"grabbable-object"===r?.captureMode&&(this.interactiveHandleManager?.releaseHandle(s),await this._updatingHandles.addPromise(r.moveTo(i,{...this.movementCommandContext,pointerType:t})))}async _handleVertexAddAtPointCommand(e){const t=this._updateLastScreenPosition(e),i=this.interactiveHandleManager?.capturingHandle??this.interactiveHandleManager?.findHandleByManipulator(t);this.editable&&i&&(this._before(e)||(I(e),await this._updatingHandles.addPromise(i.moveTo(t,{...this.movementCommandContext,skipSnapping:!0,pointerType:G(e.originalEvent)}).finally(()=>this._commitNext()))))}_makeKeyBindings(){const e=new K,t=(t,i)=>{e.addToggle(t,e=>this._handleCommand({action:i,originalEvent:e,enabled:"key-down"===e.type}))},i=(t,i)=>{e.add(t,e=>this._handleCommand({action:i,originalEvent:e}))};return t(Q.preserveAspectRatio,"constraint-aspect"),t(N.center,"constraint-center"),i(W.toggleFollowManipulator,"toggle-manipulator-follow"),i(N.undo,"undo"),i(N.redo,"redo"),i(N.complete,"complete"),i(N.vertexAdd,"vertex-add"),i({key:$.enterInputMode,continuePropagation:!0,repeats:!0},"show-tooltip"),e}_afterAttach(){}_afterDetach(e){this.interactiveHandleManager?.unregisterCustomConstraint(e),this.interactiveHandleManager?.unregisterHandle(e),this.tooltipManager?.unregisterPluginFields(e),this.globalStateManager.clearPluginOverrides(e);const t=this._pluginContexts.get(e);t&&(t.destroy(),this._pluginContexts.delete(e))}_beforeResume(e,t){this.interactiveHandleManager?.replaceEditSessions(e,t)}_commitNext(){const i={stack:[],error:void 0,hasError:!1};try{const t=this.mostDownstreamPlugin;if(!t)return;this.tooltipManager?.storeConstraintSnapshot();let a=!1;const s=this.editGeometryOperations;e(i,s?n(s.on("vertex-add",()=>a=!0)):null,!1);t.completeStep?t.completeStep():this.complete(t),a&&this.tooltipManager?.unlockOnVertexPlacement()}catch(a){i.error=a,i.hasError=!0}finally{t(i)}}_suspendPlugin(e){this.lifecycleManager.suspend(e),this.measurementManager.suspendPlugin(e)}_resumePlugin(e){this.lifecycleManager.resume(e)}_updateLastScreenPosition(e){const t=m(e.x,e.y);return this.lastScreenPosition=t,t}_getContextForPlugin(e,t){const i=r(this._pluginContexts,e,()=>new T({drawTool:this,plugin:e,session:t}));return i.session=t,i}_finalizeAndSimplifyGeometryResult(){const e=this.unprocessedGeometry;try{const t=e?w(e):e;t&&!S(t)?this.finalGeometry=t:this.finalGeometry=e}catch(t){s.getLogger(this).error("draw-tool:complete","geometry simplification failed",t)}}_before(e){if(!this.hasEventListener(`before-${e.action}`))return!1;const t=new CustomEvent(`before-${e.action}`,{detail:e,cancelable:!0});return this.emit(`before-${e.action}`,t),t.defaultPrevented}_guardCommand(e,t,i){return this._before(e)?i?.():t()}async _setupSegmentLabels(){const e=this.editGeometryOperations,t=this.sketchOptions?.labels,i=!!t?.enabled,a=this.globalStateManager.segmentLabelsDisabled;if(!e||!t||!i)return void(this._segmentLabels=o(this._segmentLabels));if(a)return void(this._segmentLabels&&(this._segmentLabels.visible=!1));if(this._segmentLabels?.context?.editGeometryOperations===e&&this._segmentLabels.context.labelOptions===t)return void(this._segmentLabels.visible=!0);const n=await this._createSegmentLabels(e,t);n&&(this._segmentLabels=o(this._segmentLabels),this._segmentLabels=n)}async _createSegmentLabels(e,t){return(this._segmentLabelsImportTask??=a(async i=>{if("3d"===this.view.type){const a=import("../3d/interactive/SegmentLabels3D.js"),{SegmentLabels3D:n}=await this._updatingHandles.addPromise(a);return this._isSegmentLabelsSetupStale(i,e,t)?null:new n({context:{view:this.view,editGeometryOperations:e,elevationInfo:P(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})}const a=import("../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:n}=await this._updatingHandles.addPromise(a);return this._isSegmentLabelsSetupStale(i,e,t)?null:new n({context:{view:this.view,editGeometryOperations:e,elevationInfo:P(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})})).promise}_isSegmentLabelsSetupStale(e,t,i){return e.aborted||this.editGeometryOperations!==t||this.sketchOptions?.labels!==i||!i.enabled||this.globalStateManager.segmentLabelsDisabled}};i([y()],Y.prototype,"_snappingVisualizer",void 0),i([y()],Y.prototype,"_segmentLabels",void 0),i([y()],Y.prototype,"_segmentLabelsImportTask",void 0),i([y()],Y.prototype,"_tooltipDependencies",null),i([y()],Y.prototype,"_editSessionManagerContext",null),i([y()],Y.prototype,"_densificationParameters",null),i([y({constructOnly:!0,nonNullable:!0})],Y.prototype,"view",void 0),i([y()],Y.prototype,"automaticManipulatorSelection",void 0),i([y()],Y.prototype,"updating",null),i([y()],Y.prototype,"coordinateHelper",null),i([y()],Y.prototype,"editGeometry",null),i([y()],Y.prototype,"editGeometryOperations",null),i([y()],Y.prototype,"unprocessedGeometry",null),i([y()],Y.prototype,"finalGeometry",void 0),i([y()],Y.prototype,"simplifiedGeometryPreview",null),i([y()],Y.prototype,"snappingManager",void 0),i([y()],Y.prototype,"sketchOptions",void 0),i([y()],Y.prototype,"elevationInfo",void 0),i([y()],Y.prototype,"hasZ",void 0),i([y()],Y.prototype,"defaultZ",void 0),i([y()],Y.prototype,"directionOptions",void 0),i([y()],Y.prototype,"canUndo",null),i([y()],Y.prototype,"canRedo",null),i([y()],Y.prototype,"pluginStack",null),i([y()],Y.prototype,"mostDownstreamPlugin",null),i([y()],Y.prototype,"mostUpstreamPlugin",null),i([y()],Y.prototype,"lastScreenPosition",void 0),i([y()],Y.prototype,"positionOfLastUserInput",null),i([y()],Y.prototype,"tooltipManager",void 0),i([y()],Y.prototype,"measurementManager",void 0),i([y()],Y.prototype,"globalStateManager",void 0),i([y()],Y.prototype,"editSessionManager",void 0),i([y()],Y.prototype,"lifecycleManager",void 0),i([y()],Y.prototype,"surfaceManager",void 0),i([y()],Y.prototype,"interactiveHandleManager",void 0),i([y()],Y.prototype,"renderer",void 0),i([y()],Y.prototype,"movementCommandContext",null),i([y()],Y.prototype,"tooltip",null),i([y()],Y.prototype,"activeTooltipInfo",null),i([y()],Y.prototype,"helpMessageKey",null),i([y({constructOnly:!0})],Y.prototype,"enableVertexVisuals",void 0),Y=i([f("esri.views.draw.DrawTool")],Y);export{Y as DrawTool};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as i}from"tslib";import{createTask as n}from"../../core/asyncUtils.js";import{makeHandle as a,disposable as s}from"../../core/handleUtils.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as d}from"../../core/maybe.js";import{when as p,initial as c,watch as h,on as g,sync as u}from"../../core/reactiveUtils.js";import{screenPointEqual as m,createScreenPoint as v}from"../../core/screenUtils.js";import{diff as y}from"../../core/accessorSupport/diffUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import{subclass as M}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import b from"../../geometry/Polygon.js";import{i as w,e as S}from"../../chunks/simplifyOperator.js";import{isExtent as C}from"../../geometry/support/jsonTypeUtils.js";import{isPolygon as x}from"../../geometry/support/typeUtils.js";import{isCurvedGeometry as H}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as P}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{getEffectiveElevationInfo as L}from"../../support/elevationInfoUtils.js";import{getMaxDeviationInPixels as k,getMinSegmentsPerCurve as O}from"../2d/layers/graphics/densificationConstants.js";import{createSnappingVisualizer as I}from"./support/createSnappingVisualizer.js";import{multipointFromGeometry as j,markHandled as G,getPointerType as T}from"./support/drawToolUtils.js";import{PluginContext as E}from"./support/PluginContext.js";import{viewEventToCommand as V}from"./support/input/drawToolInput.js";import{EditSessionManager as U}from"./support/managers/EditSessionManager.js";import{GlobalStateManager as A}from"./support/managers/GlobalStateManager.js";import{InteractiveHandleManager as D}from"./support/managers/InteractiveHandleManager.js";import{MeasurementManager as R}from"./support/managers/MeasurementManager.js";import{PluginLifecycleManager as F}from"./support/managers/PluginLifecycleManager.js";import{SurfaceManager as Z}from"./support/managers/SurfaceManager.js";import{TooltipManager as q}from"./support/managers/TooltipManager.js";import{ViewEventPriorities as B}from"../input/InputManager.js";import{createCoordinateHelper as z}from"../interactive/coordinateHelper.js";import{InteractiveToolBase as K}from"../interactive/InteractiveToolBase.js";import{KeyBindings as N,mediaKeys as Q,sketchKeys as W,advancedSketchKeys as $,tooltipKeys as J}from"../interactive/keybindings.js";import{isInputModeAvailable as X}from"../interactive/tooltip/tooltipCommonUtils.js";const Y=Symbol();let ee=class extends K{constructor(e){super(e),this._shapeVisualId=Symbol(),this._vertexVisualId=Symbol(),this._pluginContexts=new Map,this._queuedFeedbackEvents=[],this._flushingQueuedFeedbackEvents=!1,this._commandsSuspended=!1,this._snappingVisualizer=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._updatingHandles=new _,this._keybindings=this._makeKeyBindings(),this._pendingBeginRequest=null,this.type="draw-2.0",this.automaticManipulatorSelection=!0,this.snappingManager=null,this.sketchOptions=null,this.elevationInfo=null,this.hasZ=!1,this.defaultZ=0,this.lastScreenPosition=null,this.measurementManager=new R,this.globalStateManager=new A({getPluginStack:()=>this.pluginStack}),this.editSessionManager=new U({getContext:()=>this._editSessionManagerContext}),this.lifecycleManager=new F({getContext:this._getContextForPlugin.bind(this),editSessionManager:this.editSessionManager,afterAttach:this._afterAttach.bind(this),afterDetach:this._afterDetach.bind(this),beforeResume:this._beforeResume.bind(this)}),this.surfaceManager=null,this.interactiveHandleManager=null,this.renderer=null,this.enableVertexVisuals=!0}initialize(){const{view:e}=this;this.interactiveHandleManager=new D({view:e,renderer:this.renderer}),this._override("manipulators",this.interactiveHandleManager.manipulators),this.tooltipManager=new q({getDependencies:()=>this._tooltipDependencies,getLastScreenPosition:()=>this.lastScreenPosition}),this.addHandles(p(()=>this.renderer,t=>{t.addOrUpdateVisual(this._shapeVisualId,{role:"outputGeometry"}),t.addOrUpdateVisual(this._vertexVisualId,{role:"vertex"}),this._updatingHandles.addPromise(I(e,t).then(e=>this._snappingVisualizer=e))},c)),this.addHandles([p(()=>this.view,e=>{this.surfaceManager?.destroy(),this.surfaceManager=new Z({spatialReference:this.coordinateHelper.spatialReference,excludedGraphicsLayer:null,defaultZ:this.defaultZ,hasZ:this.hasZ,view:e,elevationInfo:this.elevationInfo,getContext:()=>({drawAtFixedElevation:this.globalStateManager.drawAtFixedElevation,elevationConstraint:this.tooltipManager?.elevationConstraint,constraintsEnabled:this.tooltipManager?.constraintsEnabled??!1})})},c),p(()=>this.sketchOptions?.tooltips.effectiveEnabled,()=>this.measurementManager.preloadMeasurementUtils(),{once:!0,initial:!0}),h(()=>[this.editGeometryOperations,this.sketchOptions?.labels.enabled,this.globalStateManager.segmentLabelsDisabled],()=>{this._updatingHandles.addPromise(this._setupSegmentLabels())},c),g(()=>this.editSessionManager,"cancelPlugin",({plugin:e})=>{this._suspendPlugin(e)},u),g(()=>this.editSessionManager,"restartPlugin",({restartInfo:e})=>{this._resumePlugin(e)},u),h(()=>this.lifecycleManager.updating,e=>{e||this._emitQueuedFeedbackEvents()},u),g(()=>this.editGeometryOperations,["vertex-add","vertex-update","vertex-remove"],e=>{const t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),i=t.map(e=>e.coordinates);switch(e.type){case"vertex-add":this._emitWhenReady(e.type,{...e,added:i,vertices:t});break;case"vertex-update":this._emitWhenReady(e.type,{...e,updated:i,vertices:t});break;case"vertex-remove":this._emitWhenReady(e.type,{...e,removed:i,vertices:t})}})])}destroy(){this.active&&this.onDeactivate(),this.editSessionManager.destroy(),this.lifecycleManager.destroy(),this.measurementManager.destroy(),this.globalStateManager.destroy();for(const e of this._pluginContexts.values())e.destroy();this._pluginContexts.clear(),this.surfaceManager=l(this.surfaceManager),this.interactiveHandleManager=l(this.interactiveHandleManager),this._segmentLabelsImportTask=d(this._segmentLabelsImportTask),this._segmentLabels=l(this._segmentLabels),this.tooltipManager=l(this.tooltipManager)}get _tooltipDependencies(){const{defaultZ:e,editGeometryOperations:t,sketchOptions:i,directionOptions:n,view:a}=this;return t&&i&&a?{defaultZ:e,directionOptions:n,editGeometryOperations:t,sketchOptions:i,view:a,getActiveHandle:()=>this.interactiveHandleManager?.focusedHandle,getAllHandles:()=>this.interactiveHandleManager?.allhandles,getHelpMessageKey:()=>this.helpMessageKey,notifyTooltipsChanged:()=>{const{interactiveHandleManager:e,movementCommandContext:t}=this;e&&t&&e.reapplyPositions(t)}}:null}get _editSessionManagerContext(){const{coordinateHelper:e,view:t}=this;if(!t)return null;return{coordinateHelper:e,viewingMode:"3d"===t.type&&"global"===t.viewingMode?1:2}}get _densificationParameters(){const{view:e,coordinateHelper:t}=this,i=t.spatialReference,n=e?.spatialReference,a=e.resolution;if(!(i&&n&&a&&Number.isFinite(a)))return null;const s=n.metersPerUnit/i.metersPerUnit;return{maxDeviation:2**Math.round(Math.log2(a))*k()*s,minSegmentsPerCurve:O()}}get test(){return{densificationParameters:this._densificationParameters,segmentLabels:this._segmentLabels}}get updating(){return this._updatingHandles.updating||this.lifecycleManager.updating||!!this._segmentLabels?.updating}get coordinateHelper(){return z(this.hasZ,!1,this.view.spatialReference)}get editGeometry(){return this.editGeometryOperations?.data}get editGeometryOperations(){return this.editSessionManager.editGeometryOperations}get unprocessedGeometry(){return this.editSessionManager.outputGeometry}get simplifiedGeometryPreview(){const e=this.editSessionManager.outputGeometry;if(e&&x(e))try{const t=this._densificationParameters,i=H(e)&&t?new b({...P(e,t)}):e;if(!w(i))return S(i)}catch(t){return e}return e}get canUndo(){return this.editSessionManager.canUndo}get canRedo(){return this.editSessionManager.canRedo}get pluginStack(){return this.lifecycleManager.pluginStack}get mostDownstreamPlugin(){return this.pluginStack.at(-1)}get mostUpstreamPlugin(){return this.pluginStack.at(0)}get positionOfLastUserInput(){return this.lastScreenPosition?this.view.toMap(this.lastScreenPosition):this.view.center}get movementCommandContext(){const{editGeometryOperations:e,tooltipManager:t,surfaceManager:i,snappingManager:n,interactiveHandleManager:a,_snappingVisualizer:s,defaultZ:r,hasZ:o,globalStateManager:{drawAtFixedElevation:l},view:d}=this;return{tooltipManager:t,editGeometryOperations:e,surfaceManager:i,interactiveHandleManager:a,snappingManager:n,snappingVisualizer:s,pointerType:"mouse",hasZ:o,defaultZ:r,view:d,drawAtFixedElevation:l}}get tooltip(){return this.tooltipManager?.tooltip}get activeTooltipInfo(){return this.tooltipManager?.tooltipInfo}get helpMessageKey(){return this.pluginStack.items.findLast(e=>e.helpMessageKey)?.helpMessageKey??"noTool"}begin(e){this.active?(this.lifecycleManager.begin(e),this._pendingBeginRequest=null):this._pendingBeginRequest=e}complete(e){const t=this.lifecycleManager;e&&t.complete(e),0===t.pluginStack.length&&(this._finalizeAndSimplifyGeometryResult(),this.emit("complete",{geometry:this.finalGeometry,aborted:!1,type:"complete",vertices:[]}),this.view?.activeTool===this&&(this.view.activeTool=null))}cancelFirstUserLeafPlugin(){const e=this.pluginStack.toArray().findLast(e=>!0!==e.configuration?.hidden);e&&this.lifecycleManager.cancel(e)}getVertexSnappingCandidates(){return"secondary"===this.interactiveHandleManager?.capturingHandle?.role?[]:this.snappingManager?.getVertexCandidates()??[]}replaceLeaf(e){const t=this.lifecycleManager;t.updating?r.getLogger(this).info("Ignoring command; arrived while updating:","replaceLeaf"):t.replaceLeaf(e)}finishPart(){const e=this.mostUpstreamPlugin,t=e?.configuration;if(this.editGeometryOperations&&t&&t.kind?.includes("multipart")){const e=this.pluginStack.at(1);e&&this.complete(e)}}undo(){this._handleCommand({action:"undo"})}redo(){this._handleCommand({action:"redo"})}executeCommand(e){return this._handleCommand(e)}suspendCommands(){return this._commandsSuspended=!0,a(()=>{this._commandsSuspended=!1;const e=this.view?.inputManager.latestPointerInfo;if(e){const{x:t,y:i}=e.location;this._handleCommand({action:"manipulator-move-to",x:t,y:i})}})}addPromise(e){return this._updatingHandles.addPromise(e)}getGeometryIfCompleted(){const e=this.lifecycleManager.gatherCompletablePlugins();return this.editSessionManager?.generatePreviewGeometryForPlugins(e)}onActivate(){super.onActivate();const{view:e}=this;this.lastScreenPosition=e?.inputManager.latestPointerInfo?.location,this.renderer?.activate(),this._pendingBeginRequest&&(this.begin(this._pendingBeginRequest),this._pendingBeginRequest=null),this.enableVertexVisuals&&this.addHandles(h(()=>this.unprocessedGeometry,e=>{this.renderer?.addOrUpdateVisual(this._vertexVisualId,{geometry:e?j(e):null})},c)),this.addHandles([h(()=>this.simplifiedGeometryPreview,e=>{this.renderer?.addOrUpdateVisual(this._shapeVisualId,{geometry:e})},c),p(()=>this.interactiveHandleManager?.capturingHandle?.screenPosition,e=>this.lastScreenPosition=e,{initial:!0,equals:m}),h(()=>this.interactiveHandleManager?.capturingHandle?.outputMapPosition,(e,t)=>{const i=this.interactiveHandleManager?.capturingHandle?.editSession?.endVertex;e&&t&&i&&this._emitWhenReady("cursor-update",{updated:i.pos,type:"vertex-update",operation:"apply",vertices:[{componentIndex:i.part.index,vertexIndex:i.index,coordinates:i.pos}]})},u),this._keybindings.register(e,B.TOOL),h(()=>e.viewpoint,(e,t)=>{e&&t&&y(e,t)&&this._handleCommand({action:"viewpoint-moved"})})],Y)}onDeactivate(){super.onDeactivate(),this.removeHandles(Y),this.renderer?.deactivate(),this.snappingManager?.doneSnapping(),this.lifecycleManager.cancelAll(),this._pendingBeginRequest=null}onInputEvent(e){const t=V(e);t&&this._handleCommand(t)}forceAddVertex(){this._commitNext()}_emitWhenReady(e,t){if(this.destroyed)return;const i=()=>{this.emit(e,t)};this.lifecycleManager.updating||this._flushingQueuedFeedbackEvents?this._queuedFeedbackEvents.push(i):i()}_emitQueuedFeedbackEvents(){if(!(this.destroyed||this._flushingQueuedFeedbackEvents||this.lifecycleManager.updating||0===this._queuedFeedbackEvents.length)){this._flushingQueuedFeedbackEvents=!0;try{for(;!this.destroyed&&!this.lifecycleManager.updating&&this._queuedFeedbackEvents.length>0;)this._queuedFeedbackEvents.shift()?.()}finally{this._flushingQueuedFeedbackEvents=!1}}}async _handleCommand(e){if(!this._commandsSuspended)if(this.lifecycleManager.updating)r.getLogger(this).info("Ignoring command; arrived while updating:",e.action);else switch(e.action){case"view-drag":return await this._handleViewDragCommand(e);case"vertex-add":return this._guardCommand(e,()=>{G(e),this._commitNext()});case"vertex-add-and-finish-part":return this._handleVertexAddAndFinishPartCommand(e);case"cancel":return this._guardCommand(e,()=>this.cancel());case"complete":return this._guardCommand(e,()=>{this.mostUpstreamPlugin&&(G(e),this.complete(this.mostUpstreamPlugin))});case"finish-part":return this._guardCommand(e,()=>this.finishPart());case"undo":return this._guardCommand(e,()=>this.editSessionManager.undo());case"redo":return this._guardCommand(e,()=>this.editSessionManager.redo());case"next-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("forward"));case"previous-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("backward"));case"toggle-manipulator-follow":this.interactiveHandleManager?.toggleFollow()&&G(e);break;case"viewpoint-moved":return await this._handleViewpointMovedCommand(e);case"manipulator-move-to":return await this._handleManipulatorMoveToCommand(e);case"manipulator-drag-to":return await this._handleManipulatorDragToCommand(e);case"vertex-add-at-point":return await this._handleVertexAddAtPointCommand(e);case"show-tooltip":return this._guardCommand(e,async()=>{const t=this.tooltipManager?.tooltip;t&&X(t.info)&&(await t.enterInputMode(),G(e))});case"constraint-center":this.globalStateManager.setCentered(e.enabled);break;case"constraint-aspect":this.globalStateManager.setPreserveAspectRatio(e.enabled)}}async _handleViewDragCommand(e){if(!this.editable)return;const t=e.originalEvent,i=this.interactiveHandleManager?.capturingHandle;(!t||!("pointerType"in t)||"touch"!==t.pointerType||"capture-always"!==i?.captureMode&&"capture-when-engaged"!==i?.captureMode)&&"capture-when-engaged"!==this.interactiveHandleManager?.capturingHandle?.captureMode?this._before(e)&&G(e):G(e)}_handleVertexAddAndFinishPartCommand(e){this._before(e)||(G(e),this._commitNext(),this.finishPart())}async _handleViewpointMovedCommand(e){this.editable&&(await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(null,{...this.movementCommandContext,pointerType:T(e.originalEvent)})),this.interactiveHandleManager?.updateAllScreenPositions())}async _handleManipulatorMoveToCommand(e){if(!this.editable)return;const t=this._updateLastScreenPosition(e);this.interactiveHandleManager?.capturingHandle&&G(e),await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(t,{...this.movementCommandContext,pointerType:T(e.originalEvent)}))}async _handleManipulatorDragToCommand(e){if(!this.editable)return;const t=T(e.originalEvent),i=this._updateLastScreenPosition(e),n=this.interactiveHandleManager?.findHandleByManipulator(i);"touch"===t&&n&&"start"===e.state&&this.interactiveHandleManager?.releaseHandle();const a=this.interactiveHandleManager?.findHandleDragging(),s=this.interactiveHandleManager?.capturingHandle,r=a??s??n;r&&!n&&G(e),"capture-when-engaged"===r?.captureMode||"capture-always"===r?.captureMode&&"touch"===t?"end"===e.state?await this._updatingHandles.addPromise(r.noteDragEnd(i,{...this.movementCommandContext,pointerType:t}).then(()=>{r&&"touch"===T(e.originalEvent)&&"grabbable-object"!==r.captureMode&&"capture-when-engaged"!==r.defaultCaptureMode&&"primary"===r.role&&(1===this.interactiveHandleManager?.handleCount?this._handleCommand({action:"vertex-add"}):this.interactiveHandleManager?.releaseHandle())})):"start"===e.state?await this._updatingHandles.addPromise(r.noteDragStart(i,{...this.movementCommandContext,pointerType:t}).then(()=>{r&&"touch"===T(e.originalEvent)&&"grabbable-object"!==r.captureMode&&"capture-when-engaged"!==r.defaultCaptureMode&&!r.editSession?.lastPointAddedBySession&&this._handleCommand({action:"vertex-add"})})):await this._updatingHandles.addPromise(r?.moveTo(i,{...this.movementCommandContext,pointerType:T(e.originalEvent)})):"grabbable-object"===r?.captureMode&&(this.interactiveHandleManager?.releaseHandle(s),await this._updatingHandles.addPromise(r.moveTo(i,{...this.movementCommandContext,pointerType:t})))}async _handleVertexAddAtPointCommand(e){const t=this._updateLastScreenPosition(e),i=this.interactiveHandleManager?.capturingHandle??this.interactiveHandleManager?.findHandleByManipulator(t);this.editable&&i&&(this._before(e)||(G(e),await this._updatingHandles.addPromise(i.moveTo(t,{...this.movementCommandContext,skipSnapping:!0,pointerType:T(e.originalEvent)}).finally(()=>this._commitNext()))))}_makeKeyBindings(){const e=new N,t=(t,i)=>{e.addToggle(t,e=>this._handleCommand({action:i,originalEvent:e,enabled:"key-down"===e.type}))},i=(t,i)=>{e.add(t,e=>this._handleCommand({action:i,originalEvent:e}))};return t(Q.preserveAspectRatio,"constraint-aspect"),t(W.center,"constraint-center"),i($.toggleFollowManipulator,"toggle-manipulator-follow"),i(W.undo,"undo"),i(W.redo,"redo"),i(W.complete,"complete"),i(W.vertexAdd,"vertex-add"),i({key:J.enterInputMode,continuePropagation:!0,repeats:!0},"show-tooltip"),e}_afterAttach(){}_afterDetach(e){this.interactiveHandleManager?.unregisterCustomConstraint(e),this.interactiveHandleManager?.unregisterHandle(e),this.tooltipManager?.unregisterPluginFields(e),this.globalStateManager.clearPluginOverrides(e);const t=this._pluginContexts.get(e);t&&(t.destroy(),this._pluginContexts.delete(e))}_beforeResume(e,t){this.interactiveHandleManager?.replaceEditSessions(e,t)}_commitNext(){const i={stack:[],error:void 0,hasError:!1};try{const t=this.mostDownstreamPlugin;if(!t)return;this.tooltipManager?.storeConstraintSnapshot();let n=!1;const a=this.editGeometryOperations;e(i,a?s(a.on("vertex-add",()=>n=!0)):null,!1);t.completeStep?t.completeStep():this.complete(t),n&&this.tooltipManager?.unlockOnVertexPlacement()}catch(n){i.error=n,i.hasError=!0}finally{t(i)}}_suspendPlugin(e){this.lifecycleManager.suspend(e),this.measurementManager.suspendPlugin(e)}_resumePlugin(e){this.lifecycleManager.resume(e)}_updateLastScreenPosition(e){const t=v(e.x,e.y);return this.lastScreenPosition=t,t}_getContextForPlugin(e,t){const i=o(this._pluginContexts,e,()=>new E({drawTool:this,plugin:e,session:t}));return i.session=t,i}_finalizeAndSimplifyGeometryResult(){const e=this.unprocessedGeometry;try{const t=e?S(e):e;t&&!C(t)?this.finalGeometry=t:this.finalGeometry=e}catch(t){r.getLogger(this).error("draw-tool:complete","geometry simplification failed",t)}}_before(e){if(!this.hasEventListener(`before-${e.action}`))return!1;const t=new CustomEvent(`before-${e.action}`,{detail:e,cancelable:!0});return this.emit(`before-${e.action}`,t),t.defaultPrevented}_guardCommand(e,t,i){return this._before(e)?i?.():t()}async _setupSegmentLabels(){const e=this.editGeometryOperations,t=this.sketchOptions?.labels,i=!!t?.enabled,n=this.globalStateManager.segmentLabelsDisabled;if(!e||!t||!i)return void(this._segmentLabels=l(this._segmentLabels));if(n)return void(this._segmentLabels&&(this._segmentLabels.visible=!1));if(this._segmentLabels?.context?.editGeometryOperations===e&&this._segmentLabels.context.labelOptions===t)return void(this._segmentLabels.visible=!0);const a=await this._createSegmentLabels(e,t);a&&(this._segmentLabels=l(this._segmentLabels),this._segmentLabels=a)}async _createSegmentLabels(e,t){return(this._segmentLabelsImportTask??=n(async i=>{if("3d"===this.view.type){const n=import("../3d/interactive/SegmentLabels3D.js"),{SegmentLabels3D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})}const n=import("../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})})).promise}_isSegmentLabelsSetupStale(e,t,i){return e.aborted||this.editGeometryOperations!==t||this.sketchOptions?.labels!==i||!i.enabled||this.globalStateManager.segmentLabelsDisabled}};i([f()],ee.prototype,"_commandsSuspended",void 0),i([f()],ee.prototype,"_snappingVisualizer",void 0),i([f()],ee.prototype,"_segmentLabels",void 0),i([f()],ee.prototype,"_segmentLabelsImportTask",void 0),i([f()],ee.prototype,"_tooltipDependencies",null),i([f()],ee.prototype,"_editSessionManagerContext",null),i([f()],ee.prototype,"_densificationParameters",null),i([f({constructOnly:!0,nonNullable:!0})],ee.prototype,"view",void 0),i([f()],ee.prototype,"automaticManipulatorSelection",void 0),i([f()],ee.prototype,"updating",null),i([f()],ee.prototype,"coordinateHelper",null),i([f()],ee.prototype,"editGeometry",null),i([f()],ee.prototype,"editGeometryOperations",null),i([f()],ee.prototype,"unprocessedGeometry",null),i([f()],ee.prototype,"finalGeometry",void 0),i([f()],ee.prototype,"simplifiedGeometryPreview",null),i([f()],ee.prototype,"snappingManager",void 0),i([f()],ee.prototype,"sketchOptions",void 0),i([f()],ee.prototype,"elevationInfo",void 0),i([f()],ee.prototype,"hasZ",void 0),i([f()],ee.prototype,"defaultZ",void 0),i([f()],ee.prototype,"directionOptions",void 0),i([f()],ee.prototype,"canUndo",null),i([f()],ee.prototype,"canRedo",null),i([f()],ee.prototype,"pluginStack",null),i([f()],ee.prototype,"mostDownstreamPlugin",null),i([f()],ee.prototype,"mostUpstreamPlugin",null),i([f()],ee.prototype,"lastScreenPosition",void 0),i([f()],ee.prototype,"positionOfLastUserInput",null),i([f()],ee.prototype,"tooltipManager",void 0),i([f()],ee.prototype,"measurementManager",void 0),i([f()],ee.prototype,"globalStateManager",void 0),i([f()],ee.prototype,"editSessionManager",void 0),i([f()],ee.prototype,"lifecycleManager",void 0),i([f()],ee.prototype,"surfaceManager",void 0),i([f()],ee.prototype,"interactiveHandleManager",void 0),i([f()],ee.prototype,"renderer",void 0),i([f()],ee.prototype,"movementCommandContext",null),i([f()],ee.prototype,"tooltip",null),i([f()],ee.prototype,"activeTooltipInfo",null),i([f()],ee.prototype,"helpMessageKey",null),i([f({constructOnly:!0})],ee.prototype,"enableVertexVisuals",void 0),ee=i([M("esri.views.draw.DrawTool")],ee);export{ee as DrawTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import n from"../../../core/Logger.js";import{memoize as i}from"../../../core/memoize.js";import{ignoreAbortErrors as o}from"../../../core/promiseUtils.js";import{valueInUnit as s}from"../../../core/quantity.js";import{createScreenPoint as r}from"../../../core/screenUtils.js";import{property as a,subclass as p}from"../../../core/accessorSupport/decorators.js";import{fromArray as l,create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{normalize as g}from"../../../core/libs/gl-matrix-2/math/vec2.js";import c from"../../../geometry/Point.js";import{pointEquals as d}from"../../../layers/graphics/dehydratedFeatureComparison.js";import{makeDehydratedPoint as h}from"../../../layers/graphics/dehydratedPoint.js";import{getPolylineOrPolygonConstraint as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import n from"../../../core/Logger.js";import{memoize as i}from"../../../core/memoize.js";import{ignoreAbortErrors as o}from"../../../core/promiseUtils.js";import{valueInUnit as s}from"../../../core/quantity.js";import{createScreenPoint as r}from"../../../core/screenUtils.js";import{property as a,subclass as p}from"../../../core/accessorSupport/decorators.js";import{fromArray as l,create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{normalize as g}from"../../../core/libs/gl-matrix-2/math/vec2.js";import c from"../../../geometry/Point.js";import{pointEquals as d}from"../../../layers/graphics/dehydratedFeatureComparison.js";import{makeDehydratedPoint as h}from"../../../layers/graphics/dehydratedPoint.js";import{getZFromVertexSnappingCandidates as f}from"./drawUtils.js";import{getPolylineOrPolygonConstraint as m,getPointConstraint as S,pointToConstraintSpace as y,constraintSpaceToPoint as P}from"../../interactive/sketch/constraintUtils.js";import{SnappingContext as M}from"../../interactive/snapping/SnappingContext.js";import{SnappingOperation as v}from"../../interactive/snapping/SnappingOperation.js";let x=class extends e{constructor(t){super(t),this._snappingOperation=null,this.role="primary",this.captureMode="capture-always",this.defaultCaptureMode="capture-always",this.snappingEnabled=!0,this.selfSnappingEnabled=!0,this.editSession=null,this.outputMapPositionOfDragStart=null,this.selectedSnappingResult=null,this.screenPosition=null,this.inputMapPosition=null,this.drawToolDragging=!1,this.manipulatorDragging=!1,this._getSnappingContext=i((t,e,n,i,o,s)=>n?new M({elevationInfo:i,pointer:t,vertexHandle:e,editGeometryOperations:n,visualizer:o,suppressSelfSnapping:!s}):null)}get grabbable(){return"grabbable-object"===this.captureMode}get following(){const{captureMode:t}=this;return"capture-always"===t||"capture-when-engaged"===t}get outputMapPosition(){return this._get("outputMapPosition")}set outputMapPosition(t){const e=this._get("outputMapPosition");t&&e&&d(t,e)||this._set("outputMapPosition",t)}get dragging(){return this.drawToolDragging||this.manipulatorDragging}get firstPointZ(){const t=this.editSession?.lastPointAddedBySession;if(!t)return null;const e=this.editSession?.getInformationAboutPoint(0,t.partIndex);return e?.point.hasZ?e.point.z:null}async moveTo(t,e){const{snappingManager:n,skipSnapping:i,surfaceManager:s,pointerType:r,editGeometryOperations:a,snappingVisualizer:p}=e,l=this._getSnappingContext(r??"mouse",this.editSession?.endVertex,a,s?.elevationInfo,p,this.selfSnappingEnabled),u=this._ensureSnappingOperation(e);t&&(this.screenPosition=t);const g=this.screenPosition;if(!g)return null;const f=e.surfaceManager?.screenToMap(g,{firstPointZ:this.firstPointZ});if(this.inputMapPosition=f,this.selectedSnappingResult=null,!n||!f||!l||i||!this.snappingEnabled)return this.selectedSnappingResult=void 0,this.outputMapPosition=this._finalizeSnappingAndConstraintResult(null,f,e);const m=h(f.x,f.y,f.z,f?.spatialReference),S=u.snap({point:m},n,l);return o(S.then(()=>{const t=u.stagedPoint;return d(this.selectedSnappingResult,t)||(this.selectedSnappingResult=new c({...t})),this.outputMapPosition=this._finalizeSnappingAndConstraintResult(this.selectedSnappingResult,f,e)}))}async moveDeltaRelativeToScreen(t,e,n){const{inputMapPosition:i,screenPosition:o,firstPointZ:s}=this;if(!i)return null;const a=n.surfaceManager?n.surfaceManager.mapToScreen(i,{firstPointZ:s}):o;if(!a)return null;const p=r(a.x+t,a.y+e);return this.moveTo(p,n)}async noteDragStart(t,e){if(this.drawToolDragging=!0,e.skipSnapping||!this.snappingEnabled)return null;const{snappingManager:i,surfaceManager:s,pointerType:r,editGeometryOperations:a,snappingVisualizer:p}=e,l=this._getSnappingContext(r??"mouse",this.editSession?.endVertex,a,s?.elevationInfo,p,this.selfSnappingEnabled),u=this._ensureSnappingOperation(e),g=s?.screenToMap(t,{firstPointZ:this.firstPointZ});if(this.outputMapPositionOfDragStart=null,i&&l&&g){const t=u.snap({point:h(g.x,g.y,g.z,g?.spatialReference)},i,l);return o(t.then(()=>{const t=u.stagedPoint?new c({...u.stagedPoint}):null;return this.outputMapPositionOfDragStart=this._finalizeSnappingAndConstraintResult(t,g,e)})).catch(t=>(n.getLogger(this).error("drawtool:handle:snapping-failed",t),null))}return this.outputMapPositionOfDragStart=g,null}async noteDragEnd(t,e){return this.moveTo(t,e).finally(()=>this.drawToolDragging=!1)}async moveDeltaRelativeToSketchSegment(t,e){const n=this.editSession?.endVertex?.leftSegment?.leftVertex?.pos,{firstPointZ:i}=this,o=this.inputMapPosition?e.surfaceManager?.mapToScreen(this.inputMapPosition,{firstPointZ:i})??this.screenPosition:this.screenPosition;if(!n||!o)return null;const s=e.editGeometryOperations?.data?.coordinateHelper.vectorToPoint(n);if(!s)return null;const r=e.surfaceManager?.mapToScreen(s,{firstPointZ:i});if(!r)return null;const a=[o.x-r.x,o.y-r.y],p=g(u(),l(a)),[c,d]=[p[0]*t,p[1]*t];return this.moveDeltaRelativeToScreen(c,d,e)}refreshConstraint(t){const e=this.outputMapPosition??this.inputMapPosition;return this.outputMapPosition=this._finalizeSnappingAndConstraintResult(null,e,t)}_finalizeSnappingAndConstraintResult(t,e,n){const i=t??e;return i&&(i.z=f(n.snappingManager)??i.z),this._ensureZ(this._applyTooltipConstraints(i,n),n)}_applyTooltipConstraints(t,e){let n=t;const i=e.tooltipManager?.getConstraints(this);if(!i&&!e.interactiveHandleManager?.customConstraints)return n;if(!n)return n;const o=e.interactiveHandleManager?.customConstraints,r=e.editGeometryOperations?.data?.coordinateHelper;if(!r)return n;if(o&&this.editSession&&n){const t={handle:this,editSession:this.editSession,toScreen:t=>e.surfaceManager?.mapToScreen(t,{firstPointZ:this.firstPointZ})??null};for(const e of o)n=e(n,t)||n}const a=this.editSession?.endVertex,p=a?.leftSegment?.leftVertex,l=p?.leftSegment?.leftVertex,u=p&&r.vectorToPoint(p.pos),g=l&&r.vectorToPoint(l.pos);if(!i)return n;const d=(u||g)&&"primary"===this.role?m(u,g,i):S(i);if(!n||!i||!d)return n;const{context:h}=i,f=y(n,h),M=f?d.closestTo(f):void 0;if(!M)return n;const v=P(M,n,h),x="2d"===e.surfaceManager?.view?.type||"absolute-height"!==h.elevationInfo.mode,T=i.elevation,{hasZ:b,metersPerVerticalUnit:w}=e.surfaceManager??{};if(null!=v&&x&&null!=T&&b&&w&&(v.z=s(T,"meters")/w),!v)return null;return new c({x:v.x,y:v.y,z:v.z,hasM:v.hasM,hasZ:v.hasZ,m:v.m,spatialReference:v.spatialReference})}_ensureZ(t,e){return t&&e.hasZ?(null!=t.z&&t.hasZ||(t.z=e.defaultZ??0,t.hasZ=!0),t):t}_ensureSnappingOperation({view:t}){return this._snappingOperation??=new v({view:t})}};t([a()],x.prototype,"_snappingOperation",void 0),t([a()],x.prototype,"role",void 0),t([a()],x.prototype,"name",void 0),t([a()],x.prototype,"captureMode",void 0),t([a()],x.prototype,"defaultCaptureMode",void 0),t([a()],x.prototype,"grabbable",null),t([a()],x.prototype,"following",null),t([a()],x.prototype,"snappingEnabled",void 0),t([a()],x.prototype,"selfSnappingEnabled",void 0),t([a()],x.prototype,"editSession",void 0),t([a()],x.prototype,"outputMapPosition",null),t([a()],x.prototype,"outputMapPositionOfDragStart",void 0),t([a()],x.prototype,"selectedSnappingResult",void 0),t([a()],x.prototype,"screenPosition",void 0),t([a()],x.prototype,"inputMapPosition",void 0),t([a()],x.prototype,"dragging",null),t([a()],x.prototype,"drawToolDragging",void 0),t([a()],x.prototype,"manipulatorDragging",void 0),t([a({readOnly:!0})],x.prototype,"firstPointZ",null),x=t([p("esri.views.draw.support.InteractiveHandle")],x);export{x as InteractiveHandle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{pausable as c,when as d,watch as m,initial as v,sync as u}from"../../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import f from"../../../geometry/Point.js";import G from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as b,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{isPoint as S}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as E}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as w,toEllipticArc7 as I}from"../../../geometry/support/curves/circularArcUtils.js";import{getPaths as V,getEndpoint as H,isCircularArc as O,isEllipticArc4 as k,isBezierCurve as L,isCoordinate as P,cloneCurve as T,isEllipticArc7 as R}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as A}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as j}from"../../../geometry/support/curves/mathUtils.js";import U from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as F}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as D}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as K,cloneMove as z}from"./drawUtils.js";import N from"./GraphicMover.js";import W from"./HighlightHelper.js";import{addUniqueLayer as $,isConnectedReshapeSupportedLayer as q}from"./layerUtils.js";import{createTooltipInfos as X,connectTooltip as Y,updateTranslateTooltipInfo as Z,updateTranslateVertexTooltipInfo as B}from"./reshapeTooltipUtils.js";import{defaultSymbols as J,createMidpointGraphics as Q,createVertexGraphics as ee,createCurveControlPointGraphics as te,createCurveConstructionLineGraphics as ie,attributeKeys as se,getMidpoint as oe,controlPointKinds as re,fastCloneGeometry as ne,saveUpdatedCurveOrCoordinate as ae,toolIdAttribute as he,splitCurve as pe,isSingleSegmentCircle as le,isSingleSegmentEllipse as ce}from"./reshapeUtils.js";import{ViewEventPriorities as de}from"../../input/InputManager.js";import{createCoordinateHelper as me}from"../../interactive/coordinateHelper.js";import{sketchKeys as ve}from"../../interactive/keybindings.js";import{EditGeometryOperations as ue}from"../../interactive/editGeometry/EditGeometryOperations.js";import ye from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as _e}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as ge,enterInputModeIfAvailable as fe}from"../../interactive/tooltip/tooltipCommonUtils.js";import{MeasurementWorkerHandle as Ge}from"../../support/MeasurementWorkerHandle.js";const be=Symbol(),xe={mode:"on-the-ground",offset:0};let Me=class extends r{constructor(e){super(e),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._primaryGraphicMoving=!1,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._relatedGraphicIndex=null,this._updatingHandles=new g,this._measurementWorker=new Ge({preloadGeodetic:!0}),this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.filterVerticesEnabled=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=J,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new ye,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const e=this.view;this._highlightHelper=new W({view:e}),this._setup(),this._updateHandlesOnExternalGeometryChange=c(()=>this.graphic?.geometry,e=>{if(!e||!0===this._primaryGraphicMoving)return;const t=new Set(this.selectedManipulators.map(Le));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(e=>t.has(Le(e))).forEach(e=>this._addToSelection(e)),this.curveControlPointGraphics.filter(e=>t.has(Le(e))).forEach(e=>this._addToSelection(e));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},u),this.tooltip=ge(()=>({view:e,options:this.sketchOptions.tooltips})),this.tooltipInfos=X(this.sketchOptions),this.addHandles([d(()=>e?.ready,()=>{const{layer:e,view:t}=this;$(t,e),this.addHandles(t.on("key-down",e=>this._keyDownHandler(e),de.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),...this._effectiveFilterVerticesEnabled?[m(()=>[this.view.viewpoint,this.view.stationary],()=>{this.view.stationary&&this.refresh()})]:[],m(()=>this.layer,(e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),Y(this.tooltip,()=>this._tooltipsContext,this._updatingHandles),m(()=>this.sketchOptions.labels.enabled,e=>{this._segmentLabels?this._segmentLabels.visible=e:this._setUpGeometryHelper()}),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),v),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles),this._measurementWorker.destroy()}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??me(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _effectiveFilterVerticesEnabled(){return"2d"===this.view?.type&&this.filterVerticesEnabled}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{sketchOptions:e,activeTooltipInfo:t,graphic:i}=this;return{sketchOptions:e,activeTooltipInfo:t,graphic:i,selectedVertex:this._selectedManipulator,measurementWorker:this._measurementWorker,updateGeometry:(e,t,i,s,o)=>{this._setUpGeometryHelper();const r=e===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(e);const n=!0;if(this._syncGeometryAfterVertexMove(e,t,s,o,n),r){const{view:e}=this,s=e.toScreen(i),o=e.toScreen(t),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(e),this._emitReshapeStopEvent(e)}}}get state(){const e=this.view.ready,t=!(!this.graphic||!this.layer);return e&&t?"active":e?"ready":"disabled"}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}isUIGraphic(e){return e===this.graphic||this._isMidpoint(e)||this._isCurveControlPoint(e)||this._isVertex(e)||this._isConstructionLine(e)}refresh(e){if(this._reset(),this._setup(),e){for(const t of this.vertexGraphics)e.has(Le(t))&&this._addToSelection(t);for(const t of this.curveControlPointGraphics)e.has(Le(t))&&this._addToSelection(t)}}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:e}=this;e.length&&this._removeVertices(e)}_setup(){const{graphic:e,layer:t}=this;if(!t||null==e?.geometry)return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(null==e||"mesh"===e.type||"extent"===e.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(e):this._editGeometryOperations=ue.fromGeometry(e,2,{allowCurves:!0}),this._updatingHandles.consumePromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new U({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new _e({editGeometryOperations:i,elevationInfo:xe,pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new F(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(be)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._removeCurveGraphics(e),this._updateTooltip()}_removeMidpointGraphics(e=this.layer){const{midpointGraphics:t}=this;e?.removeMany(t.items),t.drain(h)}_removeVertexGraphics(e=this.layer){const{vertexGraphics:t}=this;this._relatedGraphicIndex=null,e?.removeMany(t.items),t.drain(h)}_removeCurveGraphics(e=this.layer){const{curveControlPointGraphics:t,constructionLineGraphics:i}=this;e?.removeMany(t.items),e?.removeMany(i.items),t.drain(h),i.drain(h)}_setupGraphics(){const e=this.graphic.geometry;if(null!=e&&("polyline"===e.type||"polygon"===e.type||"multipoint"===e.type)){const t=Ce(e);this.enableMidpoints&&"multipoint"!==e.type&&this._setUpMidpointGraphics(t),this.enableVertices&&(this._setUpVertexGraphics(t),this._setupCurveGraphics(t))}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=Q(e,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type,this.filterVerticesEnabled?this.view.extent:null,this.filterVerticesEnabled?this.view.resolution:-1);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){if(this._removeVertexGraphics(),this._effectiveFilterVerticesEnabled){const t=ee(e,this.symbols,this._coordinateHelper,this.view.extent,this.view.resolution);this._relatedGraphicIndex=t.graphicIndex,this.vertexGraphics.addMany(t.graphics),this.layer.addMany(t.graphics)}else{const t=ee(e,this.symbols,this._coordinateHelper,null,-1).graphics;this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}}_setupCurveGraphics(e){this._removeCurveGraphics();const t=te(e,this.symbols,this._coordinateHelper),i=ie(e,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(t),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(t)}async _setupSegmentLabels(){const e=this._editGeometryOperations,t=this.sketchOptions.labels.enabled;if(e&&this._segmentLabels?.context?.editGeometryOperations===e&&t||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&e&&t){const t=this._segmentLabelsImportTask??=i(async e=>{const t=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(t);return e.aborted?null:i}),s=await t.promise;if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:e,elevationInfo:xe,labelOptions:this.sketchOptions.labels},visible:!0})}}_updateSymbolsForTheme(){const e=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",e),hover:this.symbols.vertices.hover?.clone().set("color",e)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",e),hover:this.symbols.controlPoints.hover?.clone().set("color",e)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",e)};for(const t of this.vertexGraphics)this._isSelected(t)?t.symbol=this.symbols.vertices.selected:this._hoverGraphic===t?t.symbol=this.symbols.vertices.hover:t.symbol=this.symbols.vertices.default;for(const t of this.curveControlPointGraphics)this._isSelected(t)?t.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===t?t.symbol=this.symbols.controlPoints.hover:t.symbol=this.symbols.controlPoints.default;for(const t of this.constructionLineGraphics)t.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map(({geometry:e})=>({x:e.x,y:e.y}));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const o=t[i],r=t[e];o.x===r.x&&o.y===r.y&&s.push(e)}e[i].attributes[se.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();e&&"multipoint"!==t.geometry?.type&&r.push(t),this._mover=new N({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:e}=this;null!=e&&0!==e.length&&(this._connectedReshapeManager=new D({providerFactories:e,view:this.view}))}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic,i=this._isCurveControlPoint(t);if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick?.(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(e);this.refresh(),s.length&&this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t)||i){if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)return void(i||this._removeVertices(t));e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,o=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const{dx:t,dy:i,graphic:s}=e,o=this._connectedReshapeManager,r=o?Te(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._primaryGraphicMoving=!0,this._setUpOperation(e),this._emitMoveStartEvent(t,i),r&&o?.startFeatureMove([r]),this._effectiveFilterVerticesEnabled&&this._resetGraphics(this.layer),void(null!=n&&"point"===n.type&&this._onHandleMove(s,t,i,e,()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(t,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const t=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(e);i.length&&(this._emitVertexAddEvent([s],t,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(e),r){const e=n.filter(e=>this._isVertex(e));o?.startVertexMove(r,Re(e))}this._emitReshapeStartEvent(s),this._onHandleMove(s,t,i,e,()=>{this._updateTooltip(s,e.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e;t.totalDx+=i,t.totalDy+=s;const{operationType:r}=t,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,e,()=>{this._updateTooltip(o,e.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,e,()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const{dxMap:t,dyMap:o}=K(i,s,this.view);if(this._effectiveFilterVerticesEnabled){if(this.selectedManipulators.length>0){const e=this.selectedManipulators.toArray();this.selectedManipulators.removeAll();for(const t of e){if("point"===t.geometry?.type){const{pathIndex:e,pointIndex:i}=t.attributes,s=V(n)[e][i];if(s){const e=H(s);t.geometry=this._coordinateHelper.arrayToPoint(e)}}this._addToSelection(t.clone())}}}else{const e=Ce(n);this._updateVertexGraphicLocations(e)}this._connectedReshapeManager?.translate(t,o,0),this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(e){const t=this._activeOperationInfo;if(this._primaryGraphicMoving=!1,!t)return;const{dx:i,dy:s,graphic:o}=e,{operationType:r}=t;if(t.totalDx+=i,t.totalDy+=s,this._onHandleMove(o,i,s,e,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._effectiveFilterVerticesEnabled&&"move"===r){const e=new Set;for(const t of this.selectedManipulators)e.add(Le(t));return this.refresh(e),void this._updateTooltip()}if(this._isMidpoint(o)||o.getAttribute(se.curveFromStraightEdgeFlag))return this.refresh(),void this._connectedReshapeManager?.finish();this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null}_updateVertexGraphicLocations(e){const{_coordinateHelper:t}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=t.arrayToPoint(H(e[s][o]))}this._updateMidpointGraphicLocations(e),this._updateCurveGraphicLocations(e)}_updateMidpointGraphicLocations(e,t){const{_coordinateHelper:i}=this;if(t)for(const s of this.midpointGraphics){const{pathIndex:o,pointIndexStart:r,pointIndexEnd:n}=s.attributes;if(!t.has(o))continue;const a=t.get(o);if(!a.has(r)&&!a.has(n))continue;const h=e[o];s.geometry=new f(oe(h[r],h[n],i))}else for(const s of this.midpointGraphics){const{pathIndex:t,pointIndexStart:o,pointIndexEnd:r}=s.attributes,n=e[t];s.geometry=new f(oe(n[o],n[r],i))}}_updateCurveGraphicLocations(e){const{spatialReference:t}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[e,t]=ke(s);null!=e&&null!=t&&s.getAttribute(se.controlPointKind)&&a(i,e,()=>new Set)?.add(t)}for(const s of this.curveControlPointGraphics){const[t,o]=ke(s);if(i.get(t)?.has(o))continue;const r=e[t][o];if(O(r)||k(r)){const i=H(e[t][o-1]),n=O(r)?w(i,r):A(i,r),[a,h]=E(n,.25);s.geometry=new f({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(L(r)){const e=s.getAttribute(se.controlPointKind),[t,i]=e===re.bezier.cp1?r.b[1]:r.b[2];s.geometry=new f({x:t,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(se.controlPointKind),[o,r]=ke(s),n=e[o],a=H(n[r-1]),h=H(n[r]),p=e[o][r];i===re.bezier.line1?s.geometry=new G({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:t}):s.geometry=new G({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:t})}}_refreshGraphicIndicesAttributes(e){const{componentIndex:t,vertexIndex:i}=e,s=e=>{const[s,o]=ke(e);s===t&&o>=i&&e.setAttribute(se.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(se.pathIndex)!==t)continue;const e=o.getAttribute(se.pointIndexStart);e>=i&&(o.setAttribute(se.pointIndexStart,e+1),o.setAttribute(se.pointIndexEnd,o.getAttribute(se.pointIndexEnd)+1))}}_getVertexFromEditGeometry(e){const[t,i]=ke(e);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[t].vertices[i]}_onHandleMove(e,t,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=e.geometry,h="graphic-move-stop"===o.type;if(a&&S(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(e,new f(this._stagedVertex),t,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(e,new f(this._stagedVertex),t,s,h),r())})}else{const i=null!=this._stagedVertex?new f(this._stagedVertex):a;this._syncGeometryAfterVertexMove(e,i,t,s,h),r()}else r()}_syncGeometryAfterVertexMove(e,t,i,s,o=!1){const r=ne(this._editGeometryOperations?.data.geometry);if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(t),h=this._getVertexFromEditGeometry(e);let p=null;if(h){const e=n.getZ(a);p=[h.pos[0],h.pos[1]];const t=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=e?e-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],t,i,s),this._connectedReshapeManager?.translate(t,i,s)}if("point"===r.type)e.geometry=t;else if("mesh"===r.type)e.geometry=r.centerAt(t);else{if(e!==this.graphic){p&&!this._isVertex(e)&&(p=null);const o=n.spatialReference,[a,h]=ke(e);let l=Se(r);const c=n.pointToArray(t);if(this._updateGeometryFromGraphic(e,l,a,h,c,o,"polygon"===r.type),this._isVertex(e)||this._isCurveControlPoint(e)){const t=new Map;t.set(a,new Set([h])),l=this._moveRelatedCoordinates(l,e,c,t,p),l=this._moveSelectedHandleCoordinates(l,e,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(l,t),this._updateCurveGraphicLocations(l)}else this._isMidpoint(e)&&this._updateCurveGraphicLocations(l);ae(r,l)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_syncEditGeometryOperations(e){const t=this._editGeometryOperations?.trySetGeometry(e);t||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(e,t,i,s,o){if(this._effectiveFilterVerticesEnabled&&this._relatedGraphicIndex&&o){const r=this._relatedGraphicIndex.search({minX:o[0],maxX:o[0],minY:o[1],maxY:o[1]});for(const n of r)n.coordinate[0]===o[0]&&n.coordinate[1]===o[1]&&n.graphic&&(s&&a(s,n.pathIndex,()=>new Set).add(n.pointIndex),Oe(e,n.pathIndex,n.pointIndex,i,this._coordinateHelper.spatialReference),this._relatedGraphicIndex.remove(n),n.coordinate[0]=t.geometry.x,n.coordinate[1]=t.geometry.y,n.graphic.geometry=t.geometry,this._relatedGraphicIndex.insert(n));return e}const{relatedGraphicIndices:r}=t.attributes,n=this._coordinateHelper.spatialReference;if(!r?.length)return e;for(const h of r){const o=this.vertexGraphics.at(h),[r,p]=ke(o);s&&a(s,r,()=>new Set).add(p),Oe(e,r,p,i,n),o.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==t){const[t,a]=ke(n),h=n.getAttribute(se.relatedGraphicIndices),p=z(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,e,t,a,l,r,o),h?.length)for(const i of h){const t=this.vertexGraphics.at(i),[s,o]=ke(t);Oe(e,s,o,l,r),t.geometry=p}}return e}_updateGeometryFromGraphic(e,t,i,s,o,r,n){const a=t[i].length-1;this._isCurveControlPoint(e)?we(t,i,s,[o[0],o[1]],e.getAttribute(se.controlPointKind)):(Oe(t,i,s,o,r),n&&(0===s?Oe(t,i,a,o,r):s===a&&(t[i][0]=o)))}_onGraphicPointerOverCallback(e){const t=e.graphic;this._hoverGraphic=t;const i=this._isVertex(t);i&&!this._isSelected(t)?t.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?t:null),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._hoverGraphic=null,this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this._isCurveControlPoint(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.controlPoints.default),this.removeHandles(be),this._updateTooltip()}_handleMidpointClickOrStartMove(e){const{graphic:t}=e,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=ne(i),o=[],{[se.pathIndex]:r,[se.pointIndexStart]:n,[se.pointIndexEnd]:a}=t.attributes,h=C(t.geometry),p=0===a?n+1:a;t.attributes={[se.tool]:he,[se.pathIndex]:r,[se.pointIndex]:p,[se.relatedGraphicIndices]:[]};const l=Se(s),c=l[r][a];if(P(c)){if(this.enableCurveOnMidpoint&&e.viewEvent.native.shiftKey){const e=H(l[r][p]);l[r].splice(p,1,{c:[e,[h[0],h[1]]]}),t.setAttribute(se.controlPointKind,re.circle.interior),t.setAttribute(se.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(t),this.curveControlPointGraphics.push(t),ae(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const e=H(l[r][n]),t=pe(e,c,.5,this._coordinateHelper);l[r].splice(a,1,...t),o.push({coordinates:H(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(e){const t=Pe(e);for(const i of t)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(t)}_removeFromSelection(e,t){if(this._isVertex(e)){const{vertices:i}=this.symbols;e.symbol=t?i.hover:i.default}else if(this._isCurveControlPoint(e)){const{controlPoints:i}=this.symbols;e.symbol=t?i.hover:i.default}this.selectedManipulators.remove(e),this._emitDeselectEvent([e]),this._updateTooltip()}_clearSelection(){const e=this.selectedManipulators.toArray(),{controlPoints:t,vertices:i}=this.symbols;if(e.length>0){for(const s of e)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=t.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(e),this._updateTooltip()}}_keyDownHandler(e){null==this._activeOperationInfo&&fe(e,this.tooltip)||ve.delete.includes(e.key)&&!e.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),e.stopPropagation())}_removeVertices(e){const t=this.graphic.geometry,i=this.vertexGraphics.length;if(null==t||"polygon"!==t.type&&"polyline"!==t.type&&"multipoint"!==t.type)return;if("polygon"===t.type&&i<4||"multipoint"===t.type&&i<2||"polyline"===t.type&&i<3)return;const s=this.graphic.clone(),o=ne(t);let r=Se(o);const n=[],a=Pe(e);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:e,y:t}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=H(s[o]);if(e===a&&t===h){n.push({coordinates:H(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const e=r[i][o];e&&!P(e)&&(r[i][o]=H(e))}}}}if("polygon"===o.type)r=r.filter(e=>{if(e.length<2)return!1;const[t,i]=H(e[0]),[s,o]=H(e[e.length-1]);return(2!==e.length||t!==s||i!==o)&&(t===s&&i===o||e.push(e[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);ae(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isCurveControlPoint(e){return this.curveControlPointGraphics.includes(e)}_isConstructionLine(e){return this.constructionLineGraphics.includes(e)}_isSelected(e){return(this._isVertex(e)||this.curveControlPointGraphics.includes(e))&&this.selectedManipulators.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){const t=this._isMidpoint(e)?"copy":"move";this.addHandles(this.view.acquireCursor(t,"high"),be)}_updateTooltip(e,t){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:e===this.graphic?(i=r.translateGraphic,Z(i,o,this._tooltipsContext,this._updatingHandles,t)):e&&this.selectedManipulators.length>1&&(i=r.translateVertices,B(i,o,n,this._tooltipsContext,this._updatingHandles,t)),this.activeTooltipInfo=i}_updateGraphicGeometry(e){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=e,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(e,t){const i={type:"move-start",mover:this.graphic,dx:e,dy:t};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(e,t){const i={type:"move",mover:this.graphic,dx:e,dy:t};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(e,t){if(null==e||null==t){const i=this._activeOperationInfo;if(!i)return;e=i.totalDx,t=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:e,dy:t};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(e){const t={type:"reshape-start",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",t),this.callbacks.onReshapeStart?.(t)}_emitReshapeEvent(e){const t={type:"reshape",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape",t),this.callbacks.onReshape?.(t)}_emitReshapeStopEvent(e){const t={type:"reshape-stop",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",t),this.callbacks.onReshapeStop?.(t)}_emitSelectEvent(e){const t={type:"vertex-select",added:e};this.emit("select",t),this.callbacks.onVertexSelect?.(t)}_emitDeselectEvent(e){const t={type:"vertex-deselect",removed:e};this.emit("deselect",t),this.callbacks.onVertexDeselect?.(t)}_emitVertexAddEvent(e,t,i){const s={type:"vertex-add",added:e,graphic:this.graphic,oldGraphic:t,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(e,t,i){const s={type:"vertex-remove",removed:e,graphic:this.graphic,oldGraphic:t,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function Ce(e){let t=Se(e);t=t.map(e=>e.slice());for(const i of t)for(let e=0;e<i.length;e++)i[e]=T(i[e]);if("polygon"===e.type)for(const i of t){const e=i[i.length-1];if(!P(e))continue;const t=i[0];t[0]===e[0]&&t[1]===e[1]&&i.length>2&&i.pop()}return t}function Se(e){return"polygon"===e.type?e.curveRings?.slice()??e.rings.slice():"polyline"===e.type?e.curvePaths?.slice()??e.paths.slice():e.points.map(e=>[e])}function Ee(e,t,i,s){const o=e[t][i];if(O(o))o.c[1]=s;else if(k(o)){const o=H(e[t][i]);e[t][i]={c:[o,s]}}}function we(e,t,i,s,o){switch(o){case re.circle.interior:Ee(e,t,i,s);break;case re.bezier.cp1:e[t][i].b[1]=s;break;case re.bezier.cp2:e[t][i].b[2]=s}}function Ie(e,t){return e<1e-8*t}function Ve(e,{cx:t,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=e,[l,c]=n,d=l-h,m=c-p;t-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[t,i]:v?[-i,t]:[i,-t],[_,g]=[d,m],[f,G]=[u,y],b=_*G-g*f,x=(d**2+m**2)/2;if(Ie(Math.abs(b),x))return[(h+l)/2,(p+c)/2];const[M,C]=[G/b*x,-f/b*x],S=M**2+C**2,[E,w]=[d/2-M,m/2-C];if(Ie(E**2+w**2,S)){const[e,t]=v?[-C,M]:[C,-M];return[e+M+h,t+C+p]}const I=Math.sqrt((M**2+C**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*I+M+h,w*I+C+p]}function He(e,t,i){const s=b(new G({curvePaths:[[e,t]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return R(r)?r:I(e,r)}function Oe(e,t,i,s,o){const r=e[t][i],n=e[t].at(i+1);if(le(e,t)){const i=e[t][1];return e[t][0]=[...s],void(e[t][1]={a:[[...s],[...i.a[1]],0,0]})}if(ce(e,t)){const i=e[t][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=j(l,p);return e[t][0]=[...s],void(e[t][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=H(r);if(P(r))r.splice(0,r.length,...s);else if(L(r))r.b[0].splice(0,r.b[0].length,...s);else if(O(r)||k(r)){const o=H(e[t][i-1]),n=O(r)?w(o,r):A(o,r);e[t].splice(i,1,{c:[[...s],Ve(o,n,s,!0)]})}else if(R(r)){r.a[0].splice(0,r.a[0].length,...s);const n=H(e[t][i-1]);r.a=He(n,r,o).a}if(n&&!P(n)&&!L(r))if(O(n)||k(n)){const o=H(n),r=O(n)?w(a,n):A(a,n);e[t].splice(i+1,1,{c:[o,Ve(o,r,s,!1)]})}else if(R(n)){const e=H(r);n.a=He(e,n,o).a}}function ke({attributes:e}){return[e?.[se.pathIndex]||0,e?.[se.pointIndex]||0]}function Le({attributes:e}){return`${e?.[se.pathIndex]}-${e?.[se.pointIndex]}-${e?.[se.controlPointKind]??"vertex"}`}function Pe(e){return e instanceof t?[e]:[...e]}function Te(e){const t=e.sourceLayer??e.layer;return q(t)?{graphic:e,layer:t}:null}function Re(e){return e.toArray().map(({attributes:e})=>({pathIndex:e[se.pathIndex],vertexIndex:e[se.pointIndex]}))}e([y()],Me.prototype,"_activeOperationInfo",void 0),e([y()],Me.prototype,"_connectedReshapeManager",void 0),e([y()],Me.prototype,"_coordinateHelper",null),e([y()],Me.prototype,"_editGeometryOperations",void 0),e([y()],Me.prototype,"_effectiveFilterVerticesEnabled",null),e([y()],Me.prototype,"_primaryGraphicMoving",void 0),e([y()],Me.prototype,"_segmentLabels",void 0),e([y()],Me.prototype,"test",null),e([y()],Me.prototype,"_segmentLabelsImportTask",void 0),e([y()],Me.prototype,"_updatingHandles",void 0),e([y()],Me.prototype,"_selectedManipulator",null),e([y()],Me.prototype,"_tooltipsContext",null),e([y()],Me.prototype,"callbacks",void 0),e([y()],Me.prototype,"connectedReshapeProviders",void 0),e([y()],Me.prototype,"enableMidpoints",void 0),e([y()],Me.prototype,"enableCurveOnMidpoint",void 0),e([y()],Me.prototype,"enableMovement",void 0),e([y()],Me.prototype,"enableVertices",void 0),e([y()],Me.prototype,"filterVerticesEnabled",void 0),e([y()],Me.prototype,"graphic",void 0),e([y()],Me.prototype,"highlightName",void 0),e([y()],Me.prototype,"highlightsEnabled",void 0),e([y()],Me.prototype,"layer",void 0),e([y()],Me.prototype,"snappingManager",void 0),e([y({readOnly:!0})],Me.prototype,"state",null),e([y()],Me.prototype,"symbols",void 0),e([y()],Me.prototype,"tooltip",void 0),e([y()],Me.prototype,"tooltipInfos",void 0),e([y()],Me.prototype,"activeTooltipInfo",void 0),e([y()],Me.prototype,"updating",null),e([y({type:ye})],Me.prototype,"sketchOptions",void 0),e([y({readOnly:!0})],Me.prototype,"type",void 0),e([y({readOnly:!0})],Me.prototype,"vertexGraphics",void 0),e([y({readOnly:!0})],Me.prototype,"curveControlPointGraphics",void 0),e([y({readOnly:!0})],Me.prototype,"constructionLineGraphics",void 0),e([y({readOnly:!0})],Me.prototype,"midpointGraphics",void 0),e([y({readOnly:!0})],Me.prototype,"selectedManipulators",void 0),e([y()],Me.prototype,"view",void 0),Me=e([_("esri.views.draw.support.Reshape")],Me);const Ae=Me;export{Ae as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{throwIfAborted as c}from"../../../core/promiseUtils.js";import{pausable as d,when as m,watch as v,initial as u,sync as y}from"../../../core/reactiveUtils.js";import{property as _,subclass as g}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import G from"../../../geometry/Point.js";import b from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as x,toGeometry as M}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as S,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{fromJSON as E}from"../../../geometry/support/jsonUtils.js";import{isPoint as w}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as I}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as V,toEllipticArc7 as k}from"../../../geometry/support/curves/circularArcUtils.js";import{getPaths as H,getEndpoint as O,isCircularArc as L,isEllipticArc4 as P,isBezierCurve as T,isCoordinate as R,cloneCurve as A,isEllipticArc7 as j}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as U}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as F}from"../../../geometry/support/curves/mathUtils.js";import D from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as z}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as K}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as N,getZFromVertexSnappingCandidates as W,cloneMove as $}from"./drawUtils.js";import q from"./GraphicMover.js";import X from"./HighlightHelper.js";import{addUniqueLayer as Y,isConnectedReshapeSupportedLayer as Z}from"./layerUtils.js";import{createTooltipInfos as B,connectTooltip as J,updateTranslateTooltipInfo as Q,updateTranslateVertexTooltipInfo as tt}from"./reshapeTooltipUtils.js";import{defaultSymbols as et,createMidpointGraphics as it,createVertexGraphics as st,createCurveControlPointGraphics as ot,createCurveConstructionLineGraphics as rt,attributeKeys as nt,getMidpoint as at,controlPointKinds as ht,fastCloneGeometry as pt,saveUpdatedCurveOrCoordinate as lt,toolIdAttribute as ct,splitCurve as dt,isSingleSegmentCircle as mt,isSingleSegmentEllipse as vt}from"./reshapeUtils.js";import{ViewEventPriorities as ut}from"../../input/InputManager.js";import{createCoordinateHelper as yt}from"../../interactive/coordinateHelper.js";import{sketchKeys as _t}from"../../interactive/keybindings.js";import{EditGeometryOperations as gt}from"../../interactive/editGeometry/EditGeometryOperations.js";import ft from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as Gt}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as bt,enterInputModeIfAvailable as xt}from"../../interactive/tooltip/tooltipCommonUtils.js";import{MeasurementWorkerHandle as Mt}from"../../support/MeasurementWorkerHandle.js";const St=Symbol(),Ct={mode:"on-the-ground",offset:0};let Et=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._primaryGraphicMoving=!1,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._relatedGraphicIndex=null,this._updatingHandles=new f,this._measurementWorker=new Mt({preloadGeodetic:!0}),this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.filterVerticesEnabled=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=et,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new ft,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new X({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=d(()=>this.graphic?.geometry,t=>{if(!t||!0===this._primaryGraphicMoving)return;const e=new Set(this.selectedManipulators.map(Rt));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(Rt(t))).forEach(t=>this._addToSelection(t)),this.curveControlPointGraphics.filter(t=>e.has(Rt(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},y),this.tooltip=bt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=B(this.sketchOptions),this.addHandles([m(()=>t?.ready,()=>{const{layer:t,view:e}=this;Y(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),ut.TOOL))},{once:!0,initial:!0}),v(()=>this.graphic,()=>this.refresh()),...this._effectiveFilterVerticesEnabled?[v(()=>[this.view.viewpoint,this.view.stationary],()=>{this.view.stationary&&this.refresh()})]:[],v(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),v(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),v(()=>this.enableMidpoints,()=>this.refresh()),J(this.tooltip,()=>this._tooltipsContext,this._updatingHandles),v(()=>this.sketchOptions.labels.enabled,t=>{this._segmentLabels?this._segmentLabels.visible=t:this._setUpGeometryHelper()}),v(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),u),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles),this._measurementWorker.destroy()}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??yt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _effectiveFilterVerticesEnabled(){return"2d"===this.view?.type&&this.filterVerticesEnabled}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{sketchOptions:t,activeTooltipInfo:e,graphic:i}=this;return{sketchOptions:t,activeTooltipInfo:e,graphic:i,selectedVertex:this._selectedManipulator,measurementWorker:this._measurementWorker,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(t){if(this._reset(),this._setup(),t){for(const e of this.vertexGraphics)t.has(Rt(e))&&this._addToSelection(e);for(const e of this.curveControlPointGraphics)t.has(Rt(e))&&this._addToSelection(e)}}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&S(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;if(null==t||"mesh"===t.type||"extent"===t.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(t):this._editGeometryOperations=gt.fromGeometry(t,2,{allowCurves:!0}),this._updatingHandles.consumePromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new D({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new Gt({editGeometryOperations:i,elevationInfo:Ct,pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new z(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(St)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;this._relatedGraphicIndex=null,t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=wt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=it(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type,this.filterVerticesEnabled?this.view.extent:null,this.filterVerticesEnabled?this.view.resolution:-1);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){if(this._removeVertexGraphics(),this._effectiveFilterVerticesEnabled){const e=st(t,this.symbols,this._coordinateHelper,this.view.extent,this.view.resolution);this._relatedGraphicIndex=e.graphicIndex,this.vertexGraphics.addMany(e.graphics),this.layer.addMany(e.graphics)}else{const e=st(t,this.symbols,this._coordinateHelper,null,-1).graphics;this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}}_setupCurveGraphics(t){this._removeCurveGraphics();const e=ot(t,this.symbols,this._coordinateHelper),i=rt(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}async _setupSegmentLabels(){const t=this._editGeometryOperations,e=this.sketchOptions.labels.enabled;if(t&&this._segmentLabels?.context?.editGeometryOperations===t&&e||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&t&&e){const e=this._segmentLabelsImportTask??=i(async t=>{const e=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(e);return t.aborted?null:i}),s=await e.promise;if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:t,elevationInfo:Ct,labelOptions:this.sketchOptions.labels},visible:!0})}}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[nt.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new q({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new K({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?jt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._primaryGraphicMoving=!0,this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),this._effectiveFilterVerticesEnabled&&this._resetGraphics(this.layer),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,Ut(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const{dxMap:e,dyMap:o}=N(i,s,this.view);if(this._effectiveFilterVerticesEnabled){if(this.selectedManipulators.length>0){const t=this.selectedManipulators.toArray();this.selectedManipulators.removeAll();for(const e of t){if("point"===e.geometry?.type){const{pathIndex:t,pointIndex:i}=e.attributes,s=H(n)[t][i];if(s){const t=O(s);e.geometry=this._coordinateHelper.arrayToPoint(t)}}this._addToSelection(e.clone())}}}else{const t=wt(n);this._updateVertexGraphicLocations(t)}this._connectedReshapeManager?.translate(e,o,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(this._primaryGraphicMoving=!1,!e)return;const{dx:i,dy:s,graphic:o,x:r,y:n}=t,{operationType:a}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>this._handleVertexSnap(o,{x:r,y:n},a))}_afterMoveStop(t,e){if(this._effectiveFilterVerticesEnabled&&"move"===e){const t=new Set;for(const e of this.selectedManipulators)t.add(Rt(e));return this.refresh(t),void this._updateTooltip()}if(this._isMidpoint(t)||t.getAttribute(nt.curveFromStraightEdgeFlag))return this.refresh(),void this._connectedReshapeManager?.finish();this._updateTooltip(this._isVertex(t)?t:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null}_handleVertexSnap(t,e,s){const o=t.geometry,r=this.snappingManager?.getVertexCandidates(),n=this.callbacks.onVertexSnap,a=()=>"move"===s?this._emitMoveStopEvent():this._emitReshapeStopEvent(t);if(!(n&&o&&w(o)&&r&&0!==r.length))return a(),void this._afterMoveStop(t,s);p(this._snappingTask),this._snappingTask=i(async i=>{try{const s=await n(o,e,r);c(i);const a=E(s);this._syncGeometryAfterVertexMove(t,a,0,0),t.geometry=a}finally{a(),this._afterMoveStop(t,s)}})}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(O(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t,e){const{_coordinateHelper:i}=this;if(e)for(const s of this.midpointGraphics){const{pathIndex:o,pointIndexStart:r,pointIndexEnd:n}=s.attributes;if(!e.has(o))continue;const a=e.get(o);if(!a.has(r)&&!a.has(n))continue;const h=t[o];s.geometry=new G(at(h[r],h[n],i))}else for(const s of this.midpointGraphics){const{pathIndex:e,pointIndexStart:o,pointIndexEnd:r}=s.attributes,n=t[e];s.geometry=new G(at(n[o],n[r],i))}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=Tt(s);null!=t&&null!=e&&s.getAttribute(nt.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=Tt(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(L(r)||P(r)){const i=O(t[e][o-1]),n=L(r)?V(i,r):U(i,r),[a,h]=I(n,.25);s.geometry=new G({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(T(r)){const t=s.getAttribute(nt.controlPointKind),[e,i]=t===ht.bezier.cp1?r.b[1]:r.b[2];s.geometry=new G({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(nt.controlPointKind),[o,r]=Tt(s),n=t[o],a=O(n[r-1]),h=O(n[r]),p=t[o][r];i===ht.bezier.line1?s.geometry=new b({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new b({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=Tt(t);s===e&&o>=i&&t.setAttribute(nt.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(nt.pathIndex)!==e)continue;const t=o.getAttribute(nt.pointIndexStart);t>=i&&(o.setAttribute(nt.pointIndexStart,t+1),o.setAttribute(nt.pointIndexEnd,o.getAttribute(nt.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=Tt(t);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&w(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new G(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});if(p.valid){const i=p.apply();i.z=W(this.snappingManager)??i.z,this._stagedVertex=i,this._syncGeometryAfterVertexMove(t,new G(this._stagedVertex),e,s,h),r()}})}else{const i=null!=this._stagedVertex?new G(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}else r()}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=pt(this._editGeometryOperations?.data.geometry);if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);let p=null;if(h){const t=n.getZ(a);p=[h.pos[0],h.pos[1]];const e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){p&&!this._isVertex(t)&&(p=null);const o=n.spatialReference,[a,h]=Tt(t);let l=It(r);const c=n.pointToArray(e);if(this._updateGeometryFromGraphic(t,l,a,h,c,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)){const e=new Map;e.set(a,new Set([h])),l=this._moveRelatedCoordinates(l,t,c,e,p),l=this._moveSelectedHandleCoordinates(l,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(l,e),this._updateCurveGraphicLocations(l)}else this._isMidpoint(t)&&this._updateCurveGraphicLocations(l);lt(r,l)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_syncEditGeometryOperations(t){const e=this._editGeometryOperations?.trySetGeometry(t);e||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(t,e,i,s,o){if(this._effectiveFilterVerticesEnabled&&this._relatedGraphicIndex&&o){const r=this._relatedGraphicIndex.search({minX:o[0],maxX:o[0],minY:o[1],maxY:o[1]});for(const n of r)n.coordinate[0]===o[0]&&n.coordinate[1]===o[1]&&n.graphic&&(s&&a(s,n.pathIndex,()=>new Set).add(n.pointIndex),Pt(t,n.pathIndex,n.pointIndex,i,this._coordinateHelper.spatialReference),this._relatedGraphicIndex.remove(n),n.coordinate[0]=e.geometry.x,n.coordinate[1]=e.geometry.y,n.graphic.geometry=e.geometry,this._relatedGraphicIndex.insert(n));return t}const{relatedGraphicIndices:r}=e.attributes,n=this._coordinateHelper.spatialReference;if(!r?.length)return t;for(const h of r){const o=this.vertexGraphics.at(h),[r,p]=Tt(o);s&&a(s,r,()=>new Set).add(p),Pt(t,r,p,i,n),o.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=Tt(n),h=n.getAttribute(nt.relatedGraphicIndices),p=$(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,l,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=Tt(e);Pt(t,s,o,l,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?kt(e,i,s,[o[0],o[1]],t.getAttribute(nt.controlPointKind)):(Pt(e,i,s,o,r),n&&(0===s?Pt(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(St),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=pt(i),o=[],{[nt.pathIndex]:r,[nt.pointIndexStart]:n,[nt.pointIndexEnd]:a}=e.attributes,h=C(e.geometry),p=0===a?n+1:a;e.attributes={[nt.tool]:ct,[nt.pathIndex]:r,[nt.pointIndex]:p,[nt.relatedGraphicIndices]:[]};const l=It(s),c=l[r][a];if(R(c)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=O(l[r][p]);l[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(nt.controlPointKind,ht.circle.interior),e.setAttribute(nt.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),lt(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const t=O(l[r][n]),e=dt(t,c,.5,this._coordinateHelper);l[r].splice(a,1,...e),o.push({coordinates:O(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(t){const e=At(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&xt(t,this.tooltip)||_t.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),t.stopPropagation())}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=pt(e);let r=It(o);const n=[],a=At(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(t===a&&e===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!R(t)&&(r[i][o]=O(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=O(t[0]),[s,o]=O(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);lt(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),St)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,Q(i,o,this._tooltipsContext,this._updatingHandles,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,tt(i,o,n,this._tooltipsContext,this._updatingHandles,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function wt(t){let e=It(t);e=e.map(t=>t.slice());for(const i of e)for(let t=0;t<i.length;t++)i[t]=A(i[t]);if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!R(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function It(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Vt(t,e,i,s){const o=t[e][i];if(L(o))o.c[1]=s;else if(P(o)){const o=O(t[e][i]);t[e][i]={c:[o,s]}}}function kt(t,e,i,s,o){switch(o){case ht.circle.interior:Vt(t,e,i,s);break;case ht.bezier.cp1:t[e][i].b[1]=s;break;case ht.bezier.cp2:t[e][i].b[2]=s}}function Ht(t,e){return t<1e-8*e}function Ot(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[l,c]=n,d=l-h,m=c-p;e-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[e,i]:v?[-i,e]:[i,-e],[_,g]=[d,m],[f,G]=[u,y],b=_*G-g*f,x=(d**2+m**2)/2;if(Ht(Math.abs(b),x))return[(h+l)/2,(p+c)/2];const[M,S]=[G/b*x,-f/b*x],C=M**2+S**2,[E,w]=[d/2-M,m/2-S];if(Ht(E**2+w**2,C)){const[t,e]=v?[-S,M]:[S,-M];return[t+M+h,e+S+p]}const I=Math.sqrt((M**2+S**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*I+M+h,w*I+S+p]}function Lt(t,e,i){const s=x(new b({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=M(s,i),r=o[0][1];return j(r)?r:k(t,r)}function Pt(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(mt(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(vt(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=F(l,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=O(r);if(R(r))r.splice(0,r.length,...s);else if(T(r))r.b[0].splice(0,r.b[0].length,...s);else if(L(r)||P(r)){const o=O(t[e][i-1]),n=L(r)?V(o,r):U(o,r);t[e].splice(i,1,{c:[[...s],Ot(o,n,s,!0)]})}else if(j(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(t[e][i-1]);r.a=Lt(n,r,o).a}if(n&&!R(n)&&!T(r))if(L(n)||P(n)){const o=O(n),r=L(n)?V(a,n):U(a,n);t[e].splice(i+1,1,{c:[o,Ot(o,r,s,!1)]})}else if(j(n)){const t=O(r);n.a=Lt(t,n,o).a}}function Tt({attributes:t}){return[t?.[nt.pathIndex]||0,t?.[nt.pointIndex]||0]}function Rt({attributes:t}){return`${t?.[nt.pathIndex]}-${t?.[nt.pointIndex]}-${t?.[nt.controlPointKind]??"vertex"}`}function At(t){return t instanceof e?[t]:[...t]}function jt(t){const e=t.sourceLayer??t.layer;return Z(e)?{graphic:t,layer:e}:null}function Ut(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[nt.pathIndex],vertexIndex:t[nt.pointIndex]}))}t([_()],Et.prototype,"_activeOperationInfo",void 0),t([_()],Et.prototype,"_connectedReshapeManager",void 0),t([_()],Et.prototype,"_coordinateHelper",null),t([_()],Et.prototype,"_editGeometryOperations",void 0),t([_()],Et.prototype,"_effectiveFilterVerticesEnabled",null),t([_()],Et.prototype,"_primaryGraphicMoving",void 0),t([_()],Et.prototype,"_segmentLabels",void 0),t([_()],Et.prototype,"test",null),t([_()],Et.prototype,"_segmentLabelsImportTask",void 0),t([_()],Et.prototype,"_updatingHandles",void 0),t([_()],Et.prototype,"_selectedManipulator",null),t([_()],Et.prototype,"_tooltipsContext",null),t([_()],Et.prototype,"callbacks",void 0),t([_()],Et.prototype,"connectedReshapeProviders",void 0),t([_()],Et.prototype,"enableMidpoints",void 0),t([_()],Et.prototype,"enableCurveOnMidpoint",void 0),t([_()],Et.prototype,"enableMovement",void 0),t([_()],Et.prototype,"enableVertices",void 0),t([_()],Et.prototype,"filterVerticesEnabled",void 0),t([_()],Et.prototype,"graphic",void 0),t([_()],Et.prototype,"highlightName",void 0),t([_()],Et.prototype,"highlightsEnabled",void 0),t([_()],Et.prototype,"layer",void 0),t([_()],Et.prototype,"snappingManager",void 0),t([_({readOnly:!0})],Et.prototype,"state",null),t([_()],Et.prototype,"symbols",void 0),t([_()],Et.prototype,"tooltip",void 0),t([_()],Et.prototype,"tooltipInfos",void 0),t([_()],Et.prototype,"activeTooltipInfo",void 0),t([_()],Et.prototype,"updating",null),t([_({type:ft})],Et.prototype,"sketchOptions",void 0),t([_({readOnly:!0})],Et.prototype,"type",void 0),t([_({readOnly:!0})],Et.prototype,"vertexGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"curveControlPointGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"constructionLineGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"midpointGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"selectedManipulators",void 0),t([_()],Et.prototype,"view",void 0),Et=t([g("esri.views.draw.support.Reshape")],Et);const Ft=Et;export{Ft as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{equals as t}from"../../../core/arrayUtils.js";import{rad2deg as n}from"../../../core/mathUtils.js";import{create as r,center as o}from"../../../geometry/support/aaBoundingRect.js";import{getRingsOrPathsBounds as e}from"../../../geometry/support/boundsUtils.js";import{geometryToCoordinates as i}from"../../../geometry/support/coordsUtils.js";import{toEllipticArc7 as s}from"../../../geometry/support/curves/circularArcUtils.js";import{isCurvedGeometry as c,getEndpoint as u,isCoordinate as a,isBezierCurve as m,isCircularArc as l}from"../../../geometry/support/curves/curveUtils.js";import{transformEllipticArc as p}from"../../../geometry/support/curves/ellipticArc7Utils.js";import{getScaleTransform as f}from"../../interactive/editGeometry/operations/curveOperationUtils.js";function y(t,n,r,o){if(null==o||t.hasZ||(o=void 0),"point"===t.type)return t.x+=n,t.y+=r,t.hasZ&&null!=o&&(t.z+=o),t;if("multipoint"===t.type){const e=t.points;for(let t=0;t<e.length;t++)e[t]=g(e[t],n,r,o);return t}if("extent"===t.type)return t.xmin+=n,t.xmax+=n,t.ymin+=r,t.ymax+=r,null!=o&&(t.zmin??=0,t.zmin+=o,t.zmax??=0,t.zmax+=o),t;const e="polyline"===t.type?t.curvePaths??t.paths:t.curveRings??t.rings,i=c(t);for(let s=0;s<e.length;s++){const t=e[s];for(let e=0;e<t.length;e++)t[e]=v(t[e],n,r,o)}return"paths"in t?i?t.curvePaths=e:t.paths=e:i?t.curveRings=e:t.rings=e,t}function x(t,n,r,o,e){const i=t.clone();if(e){const{resolution:t}=o;y(i,n*t,-r*t)}else{const{dxMap:t,dyMap:e}=h(n,r,o);y(i,t,e)}return i}function h(t,n,r){const o=r.state.inverseTransform;return{dxMap:o[0]*t+o[2]*n,dyMap:o[1]*t+o[3]*n}}function g(t,n,r,o){return
|
|
2
|
+
import{equals as t}from"../../../core/arrayUtils.js";import{rad2deg as n}from"../../../core/mathUtils.js";import{create as r,center as o}from"../../../geometry/support/aaBoundingRect.js";import{getRingsOrPathsBounds as e}from"../../../geometry/support/boundsUtils.js";import{geometryToCoordinates as i}from"../../../geometry/support/coordsUtils.js";import{toEllipticArc7 as s}from"../../../geometry/support/curves/circularArcUtils.js";import{isCurvedGeometry as c,getEndpoint as u,isCoordinate as a,isBezierCurve as m,isCircularArc as l}from"../../../geometry/support/curves/curveUtils.js";import{transformEllipticArc as p}from"../../../geometry/support/curves/ellipticArc7Utils.js";import{getScaleTransform as f}from"../../interactive/editGeometry/operations/curveOperationUtils.js";function y(t,n,r,o){if(null==o||t.hasZ||(o=void 0),"point"===t.type)return t.x+=n,t.y+=r,t.hasZ&&null!=o&&(t.z+=o),t;if("multipoint"===t.type){const e=t.points;for(let t=0;t<e.length;t++)e[t]=g(e[t],n,r,o);return t}if("extent"===t.type)return t.xmin+=n,t.xmax+=n,t.ymin+=r,t.ymax+=r,null!=o&&(t.zmin??=0,t.zmin+=o,t.zmax??=0,t.zmax+=o),t;const e="polyline"===t.type?t.curvePaths??t.paths:t.curveRings??t.rings,i=c(t);for(let s=0;s<e.length;s++){const t=e[s];for(let e=0;e<t.length;e++)t[e]=v(t[e],n,r,o)}return"paths"in t?i?t.curvePaths=e:t.paths=e:i?t.curveRings=e:t.rings=e,t}function x(t,n,r,o,e){const i=t.clone();if(e){const{resolution:t}=o;y(i,n*t,-r*t)}else{const{dxMap:t,dyMap:e}=h(n,r,o);y(i,t,e)}return i}function h(t,n,r){const o=r.state.inverseTransform;return{dxMap:o[0]*t+o[2]*n,dyMap:o[1]*t+o[3]*n}}function g(t,n,r,o){return b(t,t[0]+n,t[1]+r,null!=t[2]&&null!=o?t[2]+o:void 0)}function v(t,n,r,o){const e=g(u(t),n,r,o);if(a(t))return e;if(m(t)){const[,o,i]=t.b;return{b:[e,[o[0]+n,o[1]+r],[i[0]+n,i[1]+r]]}}if(l(t)){const[,o]=t.c;return{c:[e,[o[0]+n,o[1]+r]]}}const[,i,...s]=t.a;return{a:[e,[i[0]+n,i[1]+r],...s]}}function d(n,s,c,a){if("point"===n.type){const{x:t,y:r}=n,o=a?a[0]:t,e=a?a[1]:r,i=n.clone(),u=(t-o)*s+o,m=(r-e)*c+e;return i.x=u,i.y=m,i}if("extent"===n.type){const{xmin:t,xmax:r,ymin:o,ymax:e}=n,i=a?a[0]:(t+r)/2,u=a?a[1]:(e+o)/2,m=n.clone();if(m.xmin=(t-i)*s+i,m.ymax=(e-u)*c+u,m.xmax=(r-i)*s+i,m.ymin=(o-u)*c+u,m.xmin>m.xmax){const t=m.xmin,n=m.xmax;m.xmin=n,m.xmax=t}if(m.ymin>m.ymax){const t=m.ymin,n=m.ymax;m.ymin=n,m.ymax=t}return m}let m=null;if(!a){m=i(n);const t=r(),o=e(t,m);if(!o)return n.clone();const[s,c,u,l]=o;a=[(s+u)/2,(c+l)/2]}const[l,p]=a;if("multipoint"===n.type){const t=n.clone(),r=t.points;for(let n=0;n<r.length;n++){const t=r[n],[o,e]=t,i=(o-l)*s+l,u=(e-p)*c+p;r[n]=b(t,i,u,void 0)}return t.points=r,t}const f=n.clone();m??=i(n);const y="polygon"===f.type,x=y?f.curveRings??f.rings:f.curvePaths??f.paths;if(!a){const t=r(),n=e(t,x,!1,!1);if(!n)return f;a=o(n)}for(const r of x){let n=null;const o=y&&r.length>0&&t(u(r[0]),u(r.at(-1)));for(let t=0;t<r.length;t++){const o=r[t];r[t]=j(o,s,c,l,p,n),n=o}o&&(r[0]=[...u(r.at(-1))])}return f}function M(t,n,r,o,e){const[i,s,...c]=t;return[(i-o)*n+o,(s-e)*r+e,...c]}function j(t,n,r,o,e,i){if(a(t))return M(t,n,r,o,e);if(m(t)){const[i,s,c]=t.b.map(t=>M(t,n,r,o,e));return{b:[i,s,c]}}if(!i)return t;const c=u(i),y=l(t)?s(c,t):t,[x,h,g,v,d,j,U]=y.a,z=d??0,b=j??Math.hypot(x[0]-h[0],x[1]-h[1]),P=U??1,R=f(o,e,1,0,0,1,n,r);return p(c,{a:[[...x],[...h],g,v,z,b,P]},R)}function U(t,n,r,o,e,i){const s=Math.sqrt((r-t)*(r-t)+(o-n)*(o-n));return Math.sqrt((e-t)*(e-t)+(i-n)*(i-n))/s}function z(t,r,o,e=!1){const i=Math.atan2(r.y-o.y,r.x-o.x)-Math.atan2(t.y-o.y,t.x-o.x),s=Math.atan2(Math.sin(i),Math.cos(i));return e?s:n(s)}function b(t,n,r,o){const e=[n,r];return t.length>2&&e.push(null!=o?o:t[2]),t.length>3&&e.push(t[3]),e}function P(t){const n=t?.getVertexCandidates();return n?.at(0)?.targetPoint.z}export{x as cloneMove,z as getRotationAngle,U as getScaleRatio,P as getZFromVertexSnappingCandidates,y as move,d as scale,h as screenDeltaToMapDelta};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{handlesGroup as e}from"../../../core/handleUtils.js";import{debounce as t}from"../../../core/promiseUtils.js";import{zeroMeters as o}from"../../../core/quantity.js";import{watch as n,syncAndInitial as i,sync as r}from"../../../core/reactiveUtils.js";import{createScreenPoint as a}from"../../../core/screenUtils.js";import s from"../../../geometry/Point.js";import{isCurvedGeometry as c}from"../../../geometry/support/curves/curveUtils.js";import{connectPasteEvent as l,getXYZDeltasFromTooltipInfo as p}from"../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as m}from"../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{SelectedVertexTooltipInfo as
|
|
2
|
+
import{handlesGroup as e}from"../../../core/handleUtils.js";import{debounce as t}from"../../../core/promiseUtils.js";import{zeroMeters as o}from"../../../core/quantity.js";import{watch as n,syncAndInitial as i,sync as r}from"../../../core/reactiveUtils.js";import{createScreenPoint as a}from"../../../core/screenUtils.js";import s from"../../../geometry/Point.js";import{isCurvedGeometry as c}from"../../../geometry/support/curves/curveUtils.js";import{connectPasteEvent as l,getXYZDeltasFromTooltipInfo as p}from"../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as m}from"../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{SelectedVertexTooltipInfo as u}from"../../interactive/tooltip/infos/SelectedVertexTooltipInfo.js";import{TranslateTooltipInfo as f}from"../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateVertexTooltipInfo as y}from"../../interactive/tooltip/infos/TranslateVertexTooltipInfo.js";import{elevationFromPoint as v}from"../../support/euclideanLengthMeasurementUtils.js";function g(e){const t={sketchOptions:e,viewType:"2d"};return{movePoint:new m(t),selectedVertex:new u(t),translateGraphic:new f(t),translateVertices:new y(t)}}function h(o,a,s){function c(){const e=a(),t=e.sketchOptions.tooltips.effectiveEnabled?e.activeTooltipInfo:null;return{...e,activeTooltipInfo:t}}let p=!1;function m(e){p||(p=!0,e(),p=!1)}const u=t(e=>x(e)),f=e=>{m(()=>{d(e),o.info=e.activeTooltipInfo,s.consumePromise(u(e))})};return e([n(()=>{const e=c();return{context:e,geometry:e.graphic?.geometry,vertexGeometry:e.selectedVertex?.geometry}},({context:e})=>f(e),i),n(()=>{const e=c(),{activeTooltipInfo:t}=e;if(t&&"key"in t)return{context:e,key:t.key}},(e,t)=>{e&&t&&e.key!==t.key&&m(()=>b(e.context))},r),l(o,{onBeforePaste:()=>{p=!0},onAfterPaste:()=>{b(c()),p=!1}})])}function d(e){const t=e.activeTooltipInfo;if(t)switch(t.sketchOptions=e.sketchOptions,t?.type){case"move-point":w(t,e);break;case"selected-vertex":k(t,e)}}async function x(e){const t=e.activeTooltipInfo;if("selected-vertex"===t?.type)return await T(t,e)}function w(e,{graphic:t}){j(e,t,t?.geometry)}function k(e,{graphic:t,selectedVertex:o}){j(e,t,o?.geometry);const n=t?.geometry;if(!n||!c(n))switch(n?.type){case"polygon":e.geometryType="polygon",e.totalLength.visible=!1;break;case"polyline":e.geometryType="polyline",e.area.visible=!1;break;case"multipoint":e.geometryType="multipoint",e.area.visible=!1,e.totalLength.visible=!1}}async function T(e,{graphic:t,measurementWorker:o}){const n=t?.geometry;switch(n?.type){case"polygon":e.area.actual=(await o.autoArea2D(n)).area;break;case"polyline":e.totalLength.actual=await o.autoLength2D(n)}}function j(e,t,o){t&&"point"===o?.type&&(e.setLocationFromPoint(o),e.elevation.actual=v(o),e.elevation.visible=!!t.geometry?.hasZ,e.elevation.readOnly=!1,e.elevation.showAsZ=!0)}function b(e){function t(t,o){const n=o?.geometry;if(!n||"point"!==n.type)return;const{dx:i,dy:r,dz:a}=p(t,n);if(0===i&&0===r&&0===a)return;const{x:c,y:l,z:m,m:u,spatialReference:f}=n,y=new s({x:c+i,y:l+r,z:null!=m?m+a:void 0,m:u,spatialReference:f});e.updateGeometry(o,y,n,i,r)}const{activeTooltipInfo:o,graphic:n,selectedVertex:i}=e;switch(o?.type){case"move-point":return t(o,n);case"selected-vertex":return t(o,i)}}function P(e,t,o,n,i){n.consumePromise(I(e,t,i,o))}const I=t(V);function L(e,t,o,n,i,r){e.elevation=null,i.consumePromise(D(e,t,r,o,n))}const D=t(U);async function U(e,t,n,i,{measurementWorker:r}){const s=[];if(n){const{x:o,y:i}=n.origin,c=t.toMap(n),l=t.toMap(a(o,i));s.push(r.autoDistance2DBetweenPoints(l,c).then(t=>{e.distance=t}))}else e.distance=o;switch(i?.type){case"polygon":s.push(r.autoArea2D(i).then(({area:t})=>{e.area=t,e.totalLength=null}));break;case"polyline":s.push(r.autoLength2D(i).then(t=>{e.area=null,e.totalLength=t}));break;default:e.area=null}await Promise.allSettled(s)}async function V(e,t,n,{measurementWorker:i}){if(!n)return void(e.distance=o);const{x:r,y:s}=n.origin,c=t.toMap(n),l=t.toMap(a(r,s));e.distance=await i.autoDistance2DBetweenPoints(l,c)}export{h as connectTooltip,g as createTooltipInfos,P as updateTranslateTooltipInfo,L as updateTranslateVertexTooltipInfo};
|
|
@@ -1562,4 +1562,12 @@ export interface EditSession {
|
|
|
1562
1562
|
*
|
|
1563
1563
|
* @internal
|
|
1564
1564
|
*/
|
|
1565
|
-
export type ReadonlyEditSession = Pick<EditSession, "getInformationAboutPoint" | "generatePreviewGeometry" | "firstPointAddedBySession" | "lastPointAddedBySession" | "sessionIsOperatingOnSameGeometry">;
|
|
1565
|
+
export type ReadonlyEditSession = Pick<EditSession, "getInformationAboutPoint" | "generatePreviewGeometry" | "firstPointAddedBySession" | "lastPointAddedBySession" | "sessionIsOperatingOnSameGeometry">;
|
|
1566
|
+
|
|
1567
|
+
/**
|
|
1568
|
+
* Information about a snapping target for a vertex of a feature (or a feature
|
|
1569
|
+
* itself, in the case of point features).
|
|
1570
|
+
*
|
|
1571
|
+
* @internal
|
|
1572
|
+
*/
|
|
1573
|
+
export interface VertexSnappingCandidate {}
|
|
@@ -7,7 +7,7 @@ export interface SketchLabelOptionsProperties extends Partial<Pick<SketchLabelOp
|
|
|
7
7
|
* segment of a graphic while sketching and editing. The labels display each segment's
|
|
8
8
|
* horizontal length and are not shown for non-planar polygons and polylines.
|
|
9
9
|
*
|
|
10
|
-
* [](https://developers.arcgis.com/javascript/latest/sample-code/sketch-3d/)
|
|
11
11
|
*
|
|
12
12
|
* How the segment lengths are computed depends on the view's spatial reference. In geographic coordinate systems (GCS)
|
|
13
13
|
* and in Web Mercator, the lengths are computed geodetically. In projected coordinate systems (PCS),
|
|
@@ -15,7 +15,7 @@ export interface SketchTooltipOptionsProperties extends Partial<Pick<SketchToolt
|
|
|
15
15
|
* To enter the tooltip UI's [input mode](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/sketch/SketchTooltipOptions/#inputEnabled),
|
|
16
16
|
* press the `Tab` key while drawing a new feature, or when editing a point, mesh, or a selected vertex.
|
|
17
17
|
*
|
|
18
|
-
* [](https://developers.arcgis.com/javascript/latest/sample-code/sketch-3d/)
|
|
19
19
|
*
|
|
20
20
|
* #### Available tooltip inputs and constraints
|
|
21
21
|
*
|
|
@@ -19,15 +19,15 @@ export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions,
|
|
|
19
19
|
* #### Self snapping (Geometry guides)
|
|
20
20
|
* Self snapping is set via the [selfEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#selfEnabled) property. This means that while a user is actively creating or updating a feature or graphic, they will see visualizations to help identify perpendicular and parallel lines, in addition to visualizations which aid in snapping to an extension of an existing feature. The following briefly demonstrates what self snapping looks like in a 2D application. Although this is shown for 2D, the same premise applies for 3D as well.
|
|
21
21
|
*
|
|
22
|
-
* 
|
|
23
23
|
* #### Feature snapping
|
|
24
24
|
* Feature snapping is set via the [featureEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#featureEnabled) property. It provides the ability to snap vertices of a graphic or feature that is currently being drawn or reshaped to that of an existing feature's vertex, edge, or end point. These existing features belong to layers within the [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) and must be specified in the [featureSources](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#featureSources) property. The following two images demonstrate feature snapping in a 2D application. Similar to self snapping, the same premise applies for 3D as well.
|
|
25
25
|
*
|
|
26
|
-
* 
|
|
27
27
|
*
|
|
28
28
|
* The above shows feature snapping to an existing feature's vertex endpoint and edge while creating a new feature. The bottom demonstrates taking an existing feature and reshaping its geometry to snap to another feature's vertex points.
|
|
29
29
|
*
|
|
30
|
-
* 
|
|
31
31
|
*
|
|
32
32
|
* > [!WARNING]
|
|
33
33
|
* >
|
|
@@ -41,10 +41,10 @@ export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions,
|
|
|
41
41
|
*
|
|
42
42
|
* Name | Details | 3D Example | 2D Example |
|
|
43
43
|
* ---------|---------|----------|:-----------:|
|
|
44
|
-
* Rectangle | Snap lines that are perpendicular to each other | <img alt="Rectangle" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-rectangle.
|
|
45
|
-
* Parallel | Snap to all parallel lines | <img alt="Parallel" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-parallel.
|
|
46
|
-
* Extension | Snap to an extension of the current shape | <img alt="Extension" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-extension.
|
|
47
|
-
* Vertex (as seen when updating geometries)| Snap vertices to an existing vertex | <img alt="Vertex" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-vertex-3d.
|
|
44
|
+
* Rectangle | Snap lines that are perpendicular to each other | <img alt="Rectangle" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-rectangle.avif" width="268px"> | <img alt="Rectangle-2d" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-rectangle-2d.avif" width="268px"> |
|
|
45
|
+
* Parallel | Snap to all parallel lines | <img alt="Parallel" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-parallel.avif" width="268px"> | <img alt="Parallel-2d" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-parallel-2.avif" width="268px"> |
|
|
46
|
+
* Extension | Snap to an extension of the current shape | <img alt="Extension" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-extension.avif" width="268px"> | <img alt="Extension-2" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-extension-2.avif" width="268px"> |
|
|
47
|
+
* Vertex (as seen when updating geometries)| Snap vertices to an existing vertex | <img alt="Vertex" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-vertex-3d.avif" width="143px"> | <img alt="Vertex-2" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-vertex-2.avif" width="143px"> |
|
|
48
48
|
*
|
|
49
49
|
* @since 4.19
|
|
50
50
|
* @see [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,syncAndInitial as l,on as s}from"../../core/reactiveUtils.js";import{sqlOr as n,sqlIn as o,sqlAnd as a}from"../../core/sql.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{getPopupProvider as f}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as p}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as b,unpackFieldNames as v,collectLabelingFields as w,collectElevationFields as E,collectFilterFields as x,collectFeatureReductionFields as R,collectOrderByInfos as q,collectFields as j,collectTrackInfoFields as C,collectDisplayFilterFields as O,collectField as _,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as P}from"../../layers/support/floorFilterUtils.js";import{collectRelativeTimeFields as U}from"../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as T}from"../../networks/support/networkFieldUtils.js";import L from"../../rest/support/Query.js";import{createFeatureIdInfo as S}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import D from"./LayerView.js";import{getFetchPopupTemplate as Q,getRequiredFields as N}from"./support/popupUtils.js";import{WhereClauseVisitor as G}from"./support/WhereClauseVisitor.js";let B=class extends D{constructor(){super(...arguments),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&T(t,e),e&&"displayFilterInfo"in e&&e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),l),s(()=>this.view?.floors,"change",()=>this._handleChange()),s(()=>(this.layer&&"displayFilterInfo"in this.layer?this.layer.displayFilterInfo:null)?.filters,"change",()=>this._handleChange()),s(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?b(t,[...v(t,e.outFields),...i]):b(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return"displayFilterInfo"in e&&this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?n(e,o(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get highlightOptions(){}set highlightOptions(e){}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new L(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,P(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new L(e)}async fetchPopupFeaturesFromGraphics(e,t){const i=[],r=new Set;for(const s of e){const e=f(s.origin),l=Q(e,{...t,checkPopupEnabled:!0});l&&(i.push(s),r.add(l))}if(0===i.length||0===r.size)return[];const l=await this._createPopupQuery(r,t);return await g(this.layer,i,l,{hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._updatingRequiredPromise=e,e.then(()=>{this._updatingRequiredPromise===e&&(this._updatingRequiredPromise=null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new G(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"displayFilterInfo"in e&&i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);"definitionExpression"in e&&"capabilities"in e&&e.capabilities?.query.relativeTimeBinWindow&&i.visitRelativeTimeQuery(e.definitionExpression);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,l="renderer"in i&&i.renderer,s="orderBy"in i&&i.orderBy,n="featureReduction"in i?i.featureReduction:null,o=new Set,a=[l?l.collectRequiredFields(o,r):null,w(o,i),e&&"elevationInfo"in i?E(o,i):null,null!=this.filter?x(o,i,this.filter):null,e||null==this.featureEffect?null:x(o,i,this.featureEffect.filter),!e&&n?R(o,i,n):null,!e&&s?q(o,i,s):null,"definitionExpression"in i&&"capabilities"in i&&i.capabilities?.query.relativeTimeBinWindow?U(o,i.fieldsIndex,i.definitionExpression):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&j(o,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;j(o,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||j(o,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&j(o,i.fieldsIndex,[i.timeInfo.endField]),await C(o,i)}if("floorInfo"in i&&i.floorInfo&&j(o,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&j(o,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(o,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&"displayFilterInfo"in i&&a.push(O(o,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(o,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){_(o,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(o,r),w(o,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;j(o,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&_(o,r,y);const u=await Promise.allSettled(a);if(e)_(o,r,i.objectIdField);else for(const t of p(S(i)))_(o,r,t);e&&"displayField"in i&&i.displayField&&_(o,r,i.displayField);for(const f of u)"rejected"===f.status&&t.getLogger(this).error(f.reason);const d=Array.from(o).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,t){return k(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),l=new Set;let s="point"===this.layer.geometryType;for(const n of e){if(!s){const e=await I(n);i(t),s=(e&&e.arcadeUtils.hasGeometryOperations(n))??!1}const e=await N(this.layer,n);i(t);for(const t of e)l.add(t)}return r.where="1=1",r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,P(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};e([u()],B.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],B.prototype,"availableFields",null),e([u({readOnly:!0})],B.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],B.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],B.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],B.prototype,"featureEffect",null),e([u({type:c})],B.prototype,"filter",void 0),e([u()],B.prototype,"layer",void 0),e([u({type:Number})],B.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],B.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],B.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],B.prototype,"requiredFields",void 0),e([u({readOnly:!0})],B.prototype,"signedInUser",null),e([u()],B.prototype,"view",void 0),B=e([d("esri.views.layers.FeatureLikeLayerView")],B);export{B as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../core/has.js";import i from"../../core/Logger.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import{watch as r,syncAndInitial as l,on as s}from"../../core/reactiveUtils.js";import{sqlOr as n,sqlIn as o,sqlAnd as a}from"../../core/sql.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{getPopupProvider as p}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as f}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as b,unpackFieldNames as v,collectLabelingFields as w,collectElevationFields as x,collectFilterFields as E,collectFeatureReductionFields as R,collectOrderByInfos as q,collectFields as j,collectTrackInfoFields as O,collectDisplayFilterFields as C,collectField as _,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as P}from"../../layers/support/floorFilterUtils.js";import{collectRelativeTimeFields as U}from"../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as T}from"../../networks/support/networkFieldUtils.js";import L from"../../rest/support/Query.js";import{createFeatureIdInfo as S}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import D from"./LayerView.js";import{getFetchPopupTemplate as N,getRequiredFields as Q}from"./support/popupUtils.js";import{WhereClauseVisitor as G}from"./support/WhereClauseVisitor.js";let B=class extends D{constructor(){super(...arguments),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,i=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,i?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,i?.requiredFieldsOptions?.utilityNetworkFields&&T(i,e),e&&"displayFilterInfo"in e&&e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),l),s(()=>this.view?.floors,"change",()=>this._handleChange()),s(()=>(this.layer&&"displayFilterInfo"in this.layer?this.layer.displayFilterInfo:null)?.filters,"change",()=>this._handleChange()),s(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:i},requiredFields:t}=this;return"outFields"in e&&e.outFields?b(i,[...v(i,e.outFields),...t]):b(i,t)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return"displayFilterInfo"in e&&this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?n(e,o(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get highlightOptions(){}set highlightOptions(e){}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){i.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},i=null!=this.filter?this.filter.createQuery(e):new L(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(i.where=a(i.where,P(this))),this.displayFilterEnabled&&(i.where=a(i.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(i.timeExtent=null!=i.timeExtent?i.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),i}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new L(e)}async fetchPopupFeaturesFromGraphics(e,i){const t=[],r=new Set;for(const s of e){const e=p(s.origin),l=N(e,{...i,checkPopupEnabled:!0});l&&(t.push(s),r.add(l))}if(0===t.length||0===r.size)return[];const l=await this._createPopupQuery(r,i);return await g(this.layer,t,l,{hasRequiredFields:(e,i)=>this._popupFeatureHasRequiredFields(e,i),...i})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._updatingRequiredPromise=e,e.then(()=>{this._updatingRequiredPromise===e&&(this._updatingRequiredPromise=null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,t=new G(e.fieldsIndex);if(t.visitFilter(this.filter),"featureReduction"in e&&t.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&t.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&t.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(t.visitFilter(this.featureEffect?.filter),"featureReduction"in e&&t.visitFeatureReduction(e.featureReduction),"displayFilterInfo"in e&&t.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo)),"subtype-group"===e.type)for(const i of e.sublayers)t.visitLabelingInfo(i.labelsVisible,i.labelingInfo);"definitionExpression"in e&&"capabilities"in e&&e.capabilities?.query.relativeTimeBinWindow&&t.visitRelativeTimeQuery(e.definitionExpression);try{const e=await t.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){i.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:t,layer:{fieldsIndex:r}}=this,l="renderer"in t&&t.renderer,s="orderBy"in t&&t.orderBy,n="featureReduction"in t?t.featureReduction:null,o=new Set,a=[l?l.collectRequiredFields(o,r):null,w(o,t),e&&"elevationInfo"in t?x(o,t):null,null!=this.filter?E(o,t,this.filter):null,e||null==this.featureEffect?null:E(o,t,this.featureEffect.filter),!e&&n?R(o,t,n):null,!e&&s?q(o,t,s):null,"definitionExpression"in t&&"capabilities"in t&&t.capabilities?.query.relativeTimeBinWindow?U(o,t.fieldsIndex,t.definitionExpression):null];if("timeInfo"in t&&t.timeInfo&&this.timeExtent&&j(o,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),"timeInfo"in t&&t.timeInfo&&"trackInfo"in t&&t.trackInfo){const{trackInfo:e}=t;j(o,t.fieldsIndex,[t.timeInfo.trackIdField]),"feature"!==t.type&&"startTimeField"!==e.timeField||j(o,t.fieldsIndex,[t.timeInfo.startField]),"endTimeField"===e.timeField&&j(o,t.fieldsIndex,[t.timeInfo.endField]),await O(o,t)}if("floorInfo"in t&&t.floorInfo&&j(o,t.fieldsIndex,[t.floorInfo.floorField]),"featureTitleFields"in t&&this.view?.requiredFieldsOptions?.featureTitleFields&&t.featureTitleFields&&j(o,t.fieldsIndex,t.featureTitleFields),"feature"===t.type&&t.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(o,t.fieldsIndex,[t.globalIdField]),"feature"!==t.type&&"subtype-group"!==t.type||!this.view?.requiredFieldsOptions?.utilityNetworkFields||j(o,t.fieldsIndex,T(this.view,t)),this.displayFilterEnabled&&"displayFilterInfo"in t&&a.push(C(o,t,t.displayFilterInfo)),"feature"===t.type&&e&&null!=t.infoFor3D&&(null==t.globalIdField&&i.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(o,t.fieldsIndex,[t.globalIdField])),"subtype-group"===t.type){_(o,r,t.subtypeField);const e=t.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(o,r),w(o,e)]));a.push(Promise.all(e))}if("catalog-footprint"===t.type&&t.parent){const e=t.parent;j(o,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===t.type&&"link-chart"===t.parentCompositeLayer.type&&_(o,r,y);const u=await Promise.allSettled(a);if(e)_(o,r,t.objectIdField);else for(const i of f(S(t)))_(o,r,i);e&&"displayField"in t&&t.displayField&&_(o,r,t.displayField);for(const p of u)"rejected"===p.status&&i.getLogger(this).error(p.reason);const d=Array.from(o).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,i){return k(e,i)}async _createPopupQuery(e,i){const r=this.layer.createQuery(),l=new Set;let s="point"===this.layer.geometryType;for(const n of e){if(!s){const e=await I(n);t(i),s=(e&&e.arcadeUtils.hasGeometryOperations(n))??!1}const e=await Q(this.layer,n);t(i);for(const i of e)l.add(i)}return r.where="1=1",r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,P(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};e([u()],B.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],B.prototype,"availableFields",null),e([u({readOnly:!0})],B.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],B.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],B.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],B.prototype,"featureEffect",null),e([u({type:c})],B.prototype,"filter",void 0),e([u()],B.prototype,"layer",void 0),e([u({type:Number})],B.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],B.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],B.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],B.prototype,"requiredFields",void 0),e([u({readOnly:!0})],B.prototype,"signedInUser",null),e([u()],B.prototype,"view",void 0),B=e([d("esri.views.layers.FeatureLikeLayerView")],B);export{B as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type Collection from "../../core/Collection.js";
|
|
1
2
|
import type LineOfSightLayer from "../../layers/LineOfSightLayer.js";
|
|
2
|
-
import type
|
|
3
|
+
import type LineOfSightAnalysisResult from "../3d/analysis/LineOfSightAnalysisResult.js";
|
|
3
4
|
import type LayerView from "./LayerView.js";
|
|
4
5
|
import type { AbortOptions } from "../../core/promiseUtils.js";
|
|
5
6
|
import type { LineOfSightPlacementResult } from "../3d/analysis/LineOfSight/types.js";
|
|
@@ -69,7 +70,7 @@ export default abstract class LineOfSightLayerView extends LayerView {
|
|
|
69
70
|
* const result = layerView.results.find((result) => result.target === targetObject);
|
|
70
71
|
* ```
|
|
71
72
|
*/
|
|
72
|
-
get results():
|
|
73
|
+
get results(): Collection<LineOfSightAnalysisResult | null | undefined>;
|
|
73
74
|
/**
|
|
74
75
|
* Starts the interactive placement of an observer and/or targets on the [layer](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#layer)'s
|
|
75
76
|
* [LineOfSightLayer.analysis](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/#analysis).
|
|
@@ -180,7 +180,7 @@ export default class HighlightOptions extends Accessor {
|
|
|
180
180
|
* highlights only the difference between the shadow areas, so the overlapping shadow areas aren't highlighted at
|
|
181
181
|
* all. Here is an example of what the shadow highlight looks like with different values:
|
|
182
182
|
*
|
|
183
|
-
* 
|
|
184
184
|
*
|
|
185
185
|
* > [!WARNING]
|
|
186
186
|
* >
|