@arcgis/core 4.33.0-next.20250515 → 4.33.0-next.20250517
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/Basemap.js +1 -1
- package/applications/Components/QuantityFormatter.d.ts +4 -0
- package/applications/Components/QuantityFormatter.js +5 -0
- package/applications/Components/baUtils.js +1 -1
- package/arcade/ArcadeDate.js +1 -1
- package/arcade/enum.js +5 -0
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/geometry/functions.js +1 -1
- package/arcade/geometry/unitConversion.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0fd6d80393722132e044.js → 0229c573fa8a2fff2d8b.js} +2 -2
- package/assets/esri/core/workers/chunks/{d21d9e8b8c8a2e0485d5.js → 094e8aae6dada24c8115.js} +1 -1
- package/assets/esri/core/workers/chunks/{ffaa977cd97a2b7190c5.js → 0c2dccec20c0994366fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{8f1fbfdac04e694f621d.js → 0c50ee1f3cdd30d96479.js} +1 -1
- package/assets/esri/core/workers/chunks/151d6354e7bc105b25c0.js +346 -0
- package/assets/esri/core/workers/chunks/1cf0fae3f2e848a2a738.js +1 -0
- package/assets/esri/core/workers/chunks/24327d01cb2c5c55a4b7.js +1 -0
- package/assets/esri/core/workers/chunks/{1a010d877b8428e755fb.js → 2841888fdbc2770e90c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e1dc8e5e18f18dd21e2.js → 29fb64826bb1351aca8d.js} +2 -2
- package/assets/esri/core/workers/chunks/{1f4fd9e3849f4e593375.js → 2b1486a466760d2152f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e0d2458f4d7a35bb97c.js → 2ce5cc797ae0d66c8678.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d564f79b82d427fc1da.js → 2fd30428309f4c517d4c.js} +1 -1
- package/assets/esri/core/workers/chunks/3ca6f893fd58f5b17af5.js +1 -0
- package/assets/esri/core/workers/chunks/{52d160cb7921ae7a4f57.js → 3fc44d8cef392b4b9c7a.js} +1 -1
- package/assets/esri/core/workers/chunks/417293f00b2c21cc3175.js +1 -0
- package/assets/esri/core/workers/chunks/{4cb199b547e5b97e65fb.js → 48cedef1c926d11164b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{563594357f3648652a5c.js → 4b21c4815533a43835c3.js} +1 -1
- package/assets/esri/core/workers/chunks/{d166f805990353578494.js → 523046e04679e301797d.js} +1 -1
- package/assets/esri/core/workers/chunks/{921c040d0497031fd8ff.js → 54da9c7fd1088a8076ce.js} +1 -1
- package/assets/esri/core/workers/chunks/{ab9614555a15f04396f6.js → 54f981fe0f8851767be9.js} +2 -2
- package/assets/esri/core/workers/chunks/{28d9e2ffc3059a55311e.js → 59f701c30bcd9088b291.js} +1 -1
- package/assets/esri/core/workers/chunks/5d50a8d0427eab0a2514.js +1 -0
- package/assets/esri/core/workers/chunks/5f4ca51b82daf0e51010.js +1 -0
- package/assets/esri/core/workers/chunks/{05c80002c37002ac99e8.js → 5f6719286a6c9a3ac74b.js} +1 -1
- package/assets/esri/core/workers/chunks/{a09b5700c92bb76c3234.js → 638ecabe3e22978af5a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fff43ffcd5602ccc50f.js → 649caffe8f5dbaad0d7b.js} +1 -1
- package/assets/esri/core/workers/chunks/{4480e4b61affb3b2e9d6.js → 6648e68f00d28e12bcf9.js} +1 -1
- package/assets/esri/core/workers/chunks/66a1b92358344dd28ee1.js +1 -0
- package/assets/esri/core/workers/chunks/{b92a34f88569c481ed10.js → 67338948e470c1251d8a.js} +3 -3
- package/assets/esri/core/workers/chunks/{a8d043b73e087bee7c40.js → 67c5f1112a7c65e9eeff.js} +1 -1
- package/assets/esri/core/workers/chunks/6a225393b63e1e8c7933.js +1 -0
- package/assets/esri/core/workers/chunks/6c29a768f02dc7ce0ed6.js +1 -0
- package/assets/esri/core/workers/chunks/{fbd2f45d5adce4ca323f.js → 73ddb356121add556994.js} +2 -2
- package/assets/esri/core/workers/chunks/{a6ca68ef6311ffc365b2.js → 73e179b04bb931ca9b86.js} +1 -1
- package/assets/esri/core/workers/chunks/7678177555570682154e.js +1 -0
- package/assets/esri/core/workers/chunks/7a9a0383f27f4967bcfa.js +1 -0
- package/assets/esri/core/workers/chunks/7b9d14cc4a466ef18d71.js +1 -0
- package/assets/esri/core/workers/chunks/7e6141b5baae47682f97.js +1 -0
- package/assets/esri/core/workers/chunks/{257db39a1ba1a11ebfb4.js → 8365707e408d19988356.js} +1 -1
- package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +1 -0
- package/assets/esri/core/workers/chunks/8a2cee726b7843c7408a.js +1 -0
- package/assets/esri/core/workers/chunks/{b1e275607d9754079f60.js → 8eadf90d938753691044.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff4e7da880b206fd98ec.js → 9049c81445cc044286f1.js} +1 -1
- package/assets/esri/core/workers/chunks/9588328d4ed6b0f04166.js +2 -0
- package/assets/esri/core/workers/chunks/{dcf5719f38ad40b92941.js → 9826a1c66885dbbdc130.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b4b4f84d594db8945f9.js → 9839309d0cd804fe52c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{c10885b3a0739708e9e0.js → 9a06476b834584d00d5c.js} +1 -1
- package/assets/esri/core/workers/chunks/{4954e0cf4a40e45d237f.js → 9c8e66da6cf32ace0914.js} +1 -1
- package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +1 -0
- package/assets/esri/core/workers/chunks/{d60da671aba70485050e.js → 9f18392933c06f1d63b6.js} +1 -1
- package/assets/esri/core/workers/chunks/a937076d2f8c2b6a5d8a.js +1 -0
- package/assets/esri/core/workers/chunks/{c3b2b05996e2008adbe3.js → a9f16323666042a9d47f.js} +1 -1
- package/assets/esri/core/workers/chunks/aad9a693813b47a51530.js +2 -0
- package/assets/esri/core/workers/chunks/{654fe135d41af81daa13.js → be1f3cac908c28c64401.js} +1 -1
- package/assets/esri/core/workers/chunks/{5e52c1c076a1502f9fe4.js → be2c8c0a8b2bce7979b6.js} +1 -1
- package/assets/esri/core/workers/chunks/bf4d9cdcbe6bb8bc9d39.js +1 -0
- package/assets/esri/core/workers/chunks/{d49518eb4b351afc5f00.js → ca3851ca2621879eb887.js} +1 -1
- package/assets/esri/core/workers/chunks/{56db71ea7eb8a5652d98.js → ca62e7ec102a1bb879dc.js} +1 -1
- package/assets/esri/core/workers/chunks/cb16ba9512ae0a09c55d.js +1 -0
- package/assets/esri/core/workers/chunks/{8c1242ffd48b3ef800fa.js → d103e184ddf9beec779d.js} +1 -1
- package/assets/esri/core/workers/chunks/d3d98ea5b5e56fc60a31.js +1 -0
- package/assets/esri/core/workers/chunks/{5719471414810b6a9aec.js → d9d9180689bcf71af00f.js} +1 -1
- package/assets/esri/core/workers/chunks/{dcaeb57c69d432118604.js → db13c93b4d708a2481db.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c3bfa75286376388806.js → db192728fa0ee08a776a.js} +1 -1
- package/assets/esri/core/workers/chunks/{40b8e53c8b1c447eff7e.js → e2d012078d51dc2b2802.js} +1 -1
- package/assets/esri/core/workers/chunks/e385a27fd1ac2123a05f.js +1 -0
- package/assets/esri/core/workers/chunks/{e85f892ea44d67d53ff0.js → f3b51aa0a1a8fc3b231c.js} +2 -2
- package/assets/esri/core/workers/chunks/f74f8ed3f17713a208c3.js +1 -0
- package/assets/esri/core/workers/chunks/f9567108862629f25c8b.js +1 -0
- package/assets/esri/core/workers/chunks/fa99abc572b382e7e0c7.js +1 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +74 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
- package/assets/esri/themes/base/widgets/_SearchResultRenderer.scss +5 -30
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_ar.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_bg.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_bs.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_ca.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_cs.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_da.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_de.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_el.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_en.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_es.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_et.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_fi.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_fr.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_he.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_hr.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_hu.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_id.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_it.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_ja.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_ko.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_lt.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_lv.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_nl.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_no.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_pl.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_pt-BR.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_pt-PT.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_ro.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_ru.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_sk.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_sl.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_sr.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_sv.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_th.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_tr.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_uk.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_vi.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_zh-CN.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_zh-HK.json +1 -1
- package/assets/esri/widgets/Search/t9n/Search_zh-TW.json +1 -1
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ar.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_bg.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_bs.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ca.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_cs.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_da.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_de.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_el.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_es.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_et.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_fi.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_fr.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_he.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_hr.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_hu.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_id.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_it.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ja.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ko.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_lt.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_lv.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_nl.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_no.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pl.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pt-BR.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pt-PT.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ro.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ru.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sk.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sl.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sr.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sv.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_th.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_tr.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_uk.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_vi.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-CN.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-HK.json +1 -0
- package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-TW.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ar.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_bg.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_bs.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ca.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_cs.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_da.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_de.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_el.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_es.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_et.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_fi.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_fr.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_he.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_hr.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_hu.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_id.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_it.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ja.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ko.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_lt.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_lv.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_nl.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_no.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pl.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pt-BR.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pt-PT.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ro.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ru.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sk.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sl.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sr.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sv.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_th.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_tr.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_uk.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_vi.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-CN.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-HK.json +1 -0
- package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-TW.json +1 -0
- package/chunks/Bufferer-Dw9Qi4T1.js +5 -0
- package/chunks/Distance2DCalculator-CXhBP-8I.js +5 -0
- package/chunks/Envelope.js +1 -1
- package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +5 -0
- package/chunks/Geometry.js +1 -1
- package/chunks/MultiPathImpl.js +5 -0
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/ShadowCastClear.glsl.js +5 -0
- package/chunks/distanceOperator.js +1 -1
- package/config.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/initNoPeFactory.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/aaBoundingBox.js +1 -1
- package/geometry.js +1 -1
- package/interfaces.d.ts +205 -51
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/package.json +2 -2
- package/pointCloudRenderers.js +1 -1
- package/portal/Portal.js +1 -1
- package/rasterRenderers.js +1 -1
- package/renderers.js +1 -1
- package/request.js +1 -1
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphAddPropertyResult.js +5 -0
- package/rest/knowledgeGraph/GraphApplyEditsResult.js +1 -1
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
- package/rest/knowledgeGraph/GraphDeletePropertyResult.js +5 -0
- package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +5 -0
- package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +5 -0
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/unitIdentifiers/insertGap.js +5 -0
- package/rest/networks/unitIdentifiers/queryUnitIdentifiers.js +5 -0
- package/rest/networks/unitIdentifiers/reset.js +5 -0
- package/rest/networks/unitIdentifiers/resize.js +5 -0
- package/rest/networks/unitIdentifiers/support/InsertGapParameters.js +5 -0
- package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParamters.js +5 -0
- package/rest/networks/unitIdentifiers/support/ResetParameters.js +5 -0
- package/rest/networks/unitIdentifiers/support/ResizeParameters.js +5 -0
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +5 -0
- package/rest/query/executeForCount.js +1 -1
- package/rest/utils.js +1 -1
- package/support/apiKeyUtils.js +1 -1
- package/support/basemapEnsureType.js +1 -1
- package/support/revision.js +1 -1
- package/symbols.js +1 -1
- package/unionTypes.d.ts +2 -0
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementController.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/Dimension/DimensionController.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/support/measurementUtils.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/ContentGeometryLayerView.js +5 -0
- package/views/3d/layers/DimensionLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
- package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/ViewshedLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/support/LayerViewAnalysisViewManager.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/support/pointsOfInterest/ContentGeometryUpdates.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastClear.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/ShadowCastClearTechnique.js +5 -0
- package/views/LinkChartView.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawScreenTool.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/reshapeTooltipUtils.js +1 -1
- package/views/draw/support/tooltipUtils.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/SelfSnappingEngine.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/support/automaticAreaMeasurementUtils.js +1 -1
- package/views/support/automaticLengthMeasurementUtils.js +1 -1
- package/views/support/extentUtils.js +1 -1
- package/views/support/geodesicAreaMeasurementUtils.js +1 -1
- package/views/support/geodesicLengthMeasurementUtils.js +1 -1
- package/views/support/geodesicMeasurementUtils.js +1 -1
- package/views/support/layerViewUtils.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Directions/css.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.d.ts +4 -0
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.d.ts +4 -0
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/searchResultRendererCSS.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/selectionListUtils.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/assets/esri/core/workers/chunks/009730713ed9bc7c7388.js +0 -1
- package/assets/esri/core/workers/chunks/0817ddd885ce8b2459cb.js +0 -1
- package/assets/esri/core/workers/chunks/0cce3770591b0730cf22.js +0 -1
- package/assets/esri/core/workers/chunks/1991f0d0f0a12175f849.js +0 -1
- package/assets/esri/core/workers/chunks/1f194ffea16cc6595ecc.js +0 -1
- package/assets/esri/core/workers/chunks/297d2c0a9d3f1e978318.js +0 -1
- package/assets/esri/core/workers/chunks/394b9723d108cff7136e.js +0 -1
- package/assets/esri/core/workers/chunks/4a362a35bcdb8405a53a.js +0 -1
- package/assets/esri/core/workers/chunks/52a3d0e041717da7697e.js +0 -1
- package/assets/esri/core/workers/chunks/62798f66872dc32e77d6.js +0 -346
- package/assets/esri/core/workers/chunks/6b42bcfbb60432e3ed1f.js +0 -1
- package/assets/esri/core/workers/chunks/7e8f78b96d43c224c7b6.js +0 -1
- package/assets/esri/core/workers/chunks/8e82acd1f730571680f4.js +0 -1
- package/assets/esri/core/workers/chunks/a0d2bd5d4ed3c90f6b1c.js +0 -1
- package/assets/esri/core/workers/chunks/a673128da9e6656ead2e.js +0 -1
- package/assets/esri/core/workers/chunks/a9b1f4bf5eaa937943be.js +0 -1
- package/assets/esri/core/workers/chunks/b52b28a6f422b10ff166.js +0 -1
- package/assets/esri/core/workers/chunks/c07c1bb7ae09136dc1f6.js +0 -1
- package/assets/esri/core/workers/chunks/cbbca011f8b176d4b5db.js +0 -1
- package/assets/esri/core/workers/chunks/cd5c380196db7fb55242.js +0 -1
- package/assets/esri/core/workers/chunks/ce321fd8fc5551e190ec.js +0 -1
- package/assets/esri/core/workers/chunks/ce53ddda04e09ba2f860.js +0 -1
- package/assets/esri/core/workers/chunks/d6ab65ad864782c50705.js +0 -1
- package/assets/esri/core/workers/chunks/da3c62a851a4332f6dda.js +0 -1
- package/assets/esri/core/workers/chunks/db3f710d770adf631b28.js +0 -2
- package/assets/esri/core/workers/chunks/f4c6ea630cecf0f260d7.js +0 -2
- package/chunks/Bufferer-CicaNej1.js +0 -5
- package/chunks/Distance2DCalculator-C1KHhZwD.js +0 -5
- package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +0 -5
- package/chunks/QuadraticBezier.js +0 -5
- /package/assets/esri/core/workers/chunks/{0fd6d80393722132e044.js.LICENSE.txt → 0229c573fa8a2fff2d8b.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7e1dc8e5e18f18dd21e2.js.LICENSE.txt → 29fb64826bb1351aca8d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{ab9614555a15f04396f6.js.LICENSE.txt → 54f981fe0f8851767be9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fbd2f45d5adce4ca323f.js.LICENSE.txt → 73ddb356121add556994.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{db3f710d770adf631b28.js.LICENSE.txt → 9588328d4ed6b0f04166.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f4c6ea630cecf0f260d7.js.LICENSE.txt → aad9a693813b47a51530.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{e85f892ea44d67d53ff0.js.LICENSE.txt → f3b51aa0a1a8fc3b231c.js.LICENSE.txt} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as r,InternalRenderCategory as o}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{ColorFormat as n}from"../../core/FBOCacheFormats.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as p}from"../../lib/VertexArrayObject.js";import{F as u}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as l}from"../../../../webgl/BufferObject.js";import{DepthStencilAttachment as m,FramebufferBit as d,Face as f,StencilOperation as g,CompareFunction as A,PrimitiveType as E,Usage as w}from"../../../../webgl/enums.js";import{noParameters as b}from"../../../../webgl/NoParameters.js";let _=class extends i{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[r.TRANSPARENT]},this.produces=o.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new u}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const t=this.techniques.get(a),s=this.bindParameters,i=s.camera,c=i.fullViewport[2],h=i.fullViewport[3];if(!t.compiled||!this._vaos)return void this.requestRender();const p=e.find((({name:e})=>e===r.TRANSPARENT)),u=this.renderingContext,l=this.fboCache.acquire(c,h,o.FOCUSAREA,n.RGBA8UNORM).attachDepth(p.getAttachment(m));u.bindFramebuffer(l.fbo),u.clear(d.COLOR|d.STENCIL),u.setViewport(0,0,c,h),u.clear(d.STENCIL,0);const w=u.bindTechnique(t,s);u.setFaceCullingEnabled(!1),u.setStencilTestEnabled(!0),u.setStencilOpSeparate(f.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),u.setStencilOpSeparate(f.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),u.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],t=this._counts[r];this._maskParameters.origin=this._origins[r],w.bindDraw(s,b,this._maskParameters),u.bindVAO(e),u.setDepthTestEnabled(!0),u.setStencilWriteMask(255),u.setStencilFunction(A.ALWAYS,0,255),u.setColorMask(!1,!1,!1,!1),u.drawArrays(E.TRIANGLES,0,t),u.setDepthTestEnabled(!1),u.setStencilWriteMask(0),u.setStencilFunction(A.NOTEQUAL,0,255),u.setColorMask(!0,!0,!0,!0),u.drawArrays(E.TRIANGLES,0,t)}return l}updateGeometries(){if(!this.view.stage)return;this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0;this.focusAreasView.volumes.forEach((e=>{const t=new Array,s=e.indicesBottom;for(let i=0;i<s.length;i++)t.push(e.positions[3*(s[i]-1)]),t.push(e.positions[3*(s[i]-1)+1]),t.push(e.positions[3*(s[i]-1)+2]);const r=e.indicesExtruded;for(let i=0;i<r.length;i++)t.push(e.positions[3*r[i]]),t.push(e.positions[3*r[i]+1]),t.push(e.positions[3*r[i]+2]);const o=new p(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",l.createVertex(this.renderingContext,w.STATIC_DRAW,new Float32Array(t))]]));this._vaos.push(o),this._counts.push(s.length+r.length),this._origins.push(e.origin)})),this.requestRender()}};e([t()],_.prototype,"consumes",void 0),e([t()],_.prototype,"produces",void 0),e([t({constructOnly:!0})],_.prototype,"focusAreasView",void 0),_=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],_);class R{constructor(e,t,s,r,o){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o}}var S;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(S||(S={}));export{S as FocusAreaEffect,R as FocusAreaGeometry,_ as FocusAreaMaskNode};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as r,InternalRenderCategory as o}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{ColorFormat as n}from"../../core/FBOCacheFormats.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as p}from"../../lib/VertexArrayObject.js";import{F as u}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as l}from"../../../../webgl/BufferObject.js";import{DepthStencilAttachment as m,FramebufferBit as d,Face as f,StencilOperation as g,CompareFunction as A,PrimitiveType as E,Usage as w}from"../../../../webgl/enums.js";import{noParameters as b}from"../../../../webgl/NoParameters.js";let _=class extends i{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[r.TRANSPARENT]},this.produces=o.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new u}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const t=this.techniques.get(a),s=this.bindParameters,i=s.camera,c=i.fullViewport[2],h=i.fullViewport[3];if(!t.compiled||!this._vaos)return void this.requestRender();const p=e.find((({name:e})=>e===r.TRANSPARENT)),u=this.renderingContext,l=this.fboCache.acquire(c,h,o.FOCUSAREA,n.RGBA8UNORM).attachDepth(p.getAttachment(m));u.bindFramebuffer(l.fbo),u.clear(d.COLOR|d.STENCIL),u.setViewport(0,0,c,h),u.clear(d.STENCIL,0);const w=u.bindTechnique(t,s);u.setFaceCullingEnabled(!1),u.setStencilTestEnabled(!0),u.setStencilOpSeparate(f.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),u.setStencilOpSeparate(f.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),u.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],t=this._counts[r];this._maskParameters.origin=this._origins[r],w.bindDraw(s,b,this._maskParameters),u.bindVAO(e),u.setDepthTestEnabled(!0),u.setStencilWriteMask(255),u.setStencilFunction(A.ALWAYS,0,255),u.setColorMask(!1,!1,!1,!1),u.drawArrays(E.TRIANGLES,0,t),u.setDepthTestEnabled(!1),u.setStencilWriteMask(0),u.setStencilFunction(A.NOTEQUAL,0,255),u.setColorMask(!0,!0,!0,!0),u.drawArrays(E.TRIANGLES,0,t)}return l}updateGeometries(){if(!this.view.stage)return;this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0;this.focusAreasView.volumes.forEach((e=>e.forEach((e=>{const t=new Array,s=e.indicesBottom;for(let i=0;i<s.length;i++)t.push(e.positions[3*(s[i]-1)]),t.push(e.positions[3*(s[i]-1)+1]),t.push(e.positions[3*(s[i]-1)+2]);const r=e.indicesExtruded;for(let i=0;i<r.length;i++)t.push(e.positions[3*r[i]]),t.push(e.positions[3*r[i]+1]),t.push(e.positions[3*r[i]+2]);const o=new p(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",l.createVertex(this.renderingContext,w.STATIC_DRAW,new Float32Array(t))]]));this._vaos.push(o),this._counts.push(s.length+r.length),this._origins.push(e.origin)})))),this.requestRender()}};e([t()],_.prototype,"consumes",void 0),e([t()],_.prototype,"produces",void 0),e([t({constructOnly:!0})],_.prototype,"focusAreasView",void 0),_=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],_);class R{constructor(e,t,s,r,o){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o}}var S;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(S||(S={}));export{S as FocusAreaEffect,R as FocusAreaGeometry,_ as FocusAreaMaskNode};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{sliceEquals as r}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as i}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as a,sync as n}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as l,G as m}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as p}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as d}from"./BindParameters.js";import{DepthRange as g}from"./DepthRange.js";import{createQuadVAO as f}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as v,shadowCastDisableElevationMax as S,shadowCastDisableElevationMin as w}from"./ShadowCastRenderer.js";import{ShadowMap as y}from"./ShadowMap.js";import{S as A}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as F}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as R,ShadowCastAccumulateIndex as x}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{TaskPriority as C}from"../../../support/Scheduler.js";import{SizedPixelFormat as j,PixelFormat as P,PixelType as D,TextureWrapMode as q,FramebufferBit as E}from"../../../webgl/enums.js";import{FramebufferObject as T}from"../../../webgl/FramebufferObject.js";import{TextureDescriptor as M}from"../../../webgl/TextureDescriptor.js";import{vertexCount as O}from"../../../webgl/Util.js";let B=class extends t{updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}constructor(e,t,r,i,s,c){super({}),this.fbos=e,this._techniques=t,this._stage=r,this._prepareForShadowMapPass=i,this._renderToShadowMap=s,this._requestRender=c,this._primarySet=new I(new R(x.PRIMARY),(()=>this._requestRenderIfEnabled())),this._contextSet=new I(new R(x.CONTEXT),(()=>this._requestRenderIfEnabled())),this._passParameters=new p,this._depthRange=g.zero,this._previewing=!1,this._cameraForcedForScreenshot=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._rctx=e.rctx,this._bindParameters=new d(new y(e,r.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=f(this._rctx),this._accumulationRenderer=new b(t,this._rctx,this,c);const h=this._stage.view.resourceController.scheduler;this.addHandles([h.registerTask(C.SHADOW_ACCUMULATOR,this),o((()=>r.renderView),(e=>{this.removeHandles(U),null!=e&&this.addHandles(e.events.on("force-camera-for-screenshot",(()=>this._cameraForcedForScreenshot=!0)),U)}),a),o((()=>this._previewing),(()=>this._requestRenderIfEnabled()),n),o((()=>2===this._numActive),(()=>this._numActiveChanged()),n),o((()=>this._depthRange),(()=>this._invalidateAccumulationSets()),n)],this._shadowAccumulatorKey);for(const o of this._accumulationSets())o.precompile(t)}*_accumulationSets(){yield this._primarySet,yield this._contextSet}normalizeCtorArgs(){return{}}dispose(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=s(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=s(this._fbo),this._vao=s(this._vao);for(const e of this._accumulationSets())e.destroy()}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fbo?.colorTexture}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return null!=this._fbo&&[...this._accumulationSets()].some((e=>e.active))}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==g.zero&&this._opacityFromElevation>v}get _doneAccumulating(){return[...this._accumulationSets()].every((e=>e.doneAccumulating))}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce(((e,t)=>e+(t.active?1:0)),0)}get _pixelFormat(){return 2===this._numActive?{pixelFormat:P.RG,internalFormat:j.RG8}:{pixelFormat:P.RED,internalFormat:j.R8}}get running(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some((e=>e.running))}runTask(e){this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const r of this._accumulationSets())this._runTaskForSet(r,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let r=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),r=!0;return r}renderAccumulation(e,t,r){if(this._updateCamera(t),this._bindParameters.contentCamera=r,this._bindParameters.depth=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!this.accumulating||!this.canAccumulate)return!1;(this._previewing||[...this._accumulationSets()].every((e=>0===e.progress))||this._cameraForcedForScreenshot)&&this._clear();const i=this._accumulateSets();return this._cameraForcedForScreenshot=!1,i}_accumulateSets(){let e=!1;for(const t of this._accumulationSets())this._accumulateSet(t)&&(e=!0);return e&&this._requestRender(),e}_accumulateSet(e){let t=this._cameraForcedForScreenshot?e.sampleCount:Math.min(L,e.sampleCount);t-=e.progress;for(let r=0;r<t;++r)this._accumulateShadow(e);return t>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setOptions(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const r=this._primarySet.progress;return!this.active||!this._fbo||r<1||e<0||e>=this._fbo.width||t<0||t>=this._fbo.height?0:(this._fbo.readPixels(e,t,1,1,P.RGBA,D.UNSIGNED_BYTE,k),k[x.PRIMARY]/r)}_numActiveChanged(){if(!this._fbo)return;const e=2===this._numActive,t=this._createFBO();t.resize(this._fbo.width,this._fbo.height),e&&(this._clearFrameBuffer(t),this._contextSet.invalidate()),this._rctx.blitFramebuffer(this._fbo,t),this._fbo.dispose(),this._fbo=t,this._requestRender()}_enable(){this._fbo||(this._fbo=this._createFBO(),this._invalidateAccumulationSets())}_createFBO(){const{pixelFormat:e,internalFormat:t}=this._pixelFormat,r=new M;return r.pixelFormat=e,r.internalFormat=t,r.wrapMode=q.CLAMP_TO_EDGE,new T(this._rctx,r)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.invalidate()}_disable(){this._fbo&&(this._fbo=s(this._fbo),this._requestRender())}_clear(){this._clearFrameBuffer(this._fbo);for(const e of this._accumulationSets())e.clear()}_clearFrameBuffer(e){e&&(this._rctx.bindFramebuffer(e),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(E.COLOR))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(F,e.configuration);this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,O(this._vao,"geometry"))}_updateCamera(e){const t=this._fbo;if(null==t)return;const r=this._bindParameters.camera;e.equals(r)||r.copyFrom(e),t.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-i(w,S,e.relativeElevation)}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};e([h()],B.prototype,"_fbo",void 0),e([h()],B.prototype,"_depthRange",void 0),e([h()],B.prototype,"_previewing",void 0),e([h()],B.prototype,"_accumulationRenderer",void 0),e([h()],B.prototype,"_refining",null),e([h()],B.prototype,"active",null),e([h()],B.prototype,"canAccumulate",null),e([h()],B.prototype,"_doneAccumulating",null),e([h()],B.prototype,"_opacityFromElevation",null),e([h()],B.prototype,"_numActive",null),e([h()],B.prototype,"_pixelFormat",null),e([h()],B.prototype,"running",null),B=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],B);const L=6,U="renderView",k=new Uint8Array(4);class I{constructor(e,t){this.configuration=e,this._requestRender=t,this._cachedLightDirections=[],this._progress=c(0),this._sampleCount=c(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,i=Math.min(A,e.length);if(!r(t,0,t.length,e,0,i,m)){t.length=i,this._sampleCount.value=i;for(let r=0;r<i;++r)t[r]=l(t[r]??_(),e[r]);this.invalidate()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}invalidate(){this.clear(),this._requestRender()}clear(){this.progress=0}precompile(e){e.precompile(F,this.configuration)}}export{B as ShadowAccumulator};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{sliceEquals as r}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as i}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as a,sync as n}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as m,G as l}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as p}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as d}from"./BindParameters.js";import{DepthRange as f}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as v,shadowCastDisableElevationMax as S,shadowCastDisableElevationMin as w}from"./ShadowCastRenderer.js";import{ShadowMap as F}from"./ShadowMap.js";import{S as y}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as A}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as R,ShadowCastAccumulateIndex as x}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as C}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{SizedPixelFormat as P,PixelFormat as q,PixelType as D,TextureWrapMode as T,FramebufferBit as E}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{TextureDescriptor as M}from"../../../webgl/TextureDescriptor.js";import{vertexCount as B}from"../../../webgl/Util.js";let L=class extends t{updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}constructor(e,t,r,i,s,c){super({}),this.fbos=e,this._techniques=t,this._stage=r,this._prepareForShadowMapPass=i,this._renderToShadowMap=s,this._requestRender=c,this._primarySet=new G(new R(x.PRIMARY),(()=>this._requestRenderIfEnabled())),this._contextSet=new G(new R(x.CONTEXT),(()=>this._requestRenderIfEnabled())),this._passParameters=new p,this._depthRange=f.zero,this._previewing=!1,this._cameraForcedForScreenshot=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._rctx=e.rctx,this._bindParameters=new d(new F(e,r.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(this._rctx),this._accumulationRenderer=new b(t,this._rctx,this,c);const h=this._stage.view.resourceController.scheduler;this.addHandles([h.registerTask(j.SHADOW_ACCUMULATOR,this),o((()=>r.renderView),(e=>{this.removeHandles(I),null!=e&&this.addHandles(e.events.on("force-camera-for-screenshot",(()=>this._cameraForcedForScreenshot=!0)),I)}),a),o((()=>this._previewing),(()=>this._requestRenderIfEnabled()),n),o((()=>2===this._numActive),(()=>this._numActiveChanged()),n),o((()=>this._depthRange),(()=>this._invalidateAccumulationSets()),n)],this._shadowAccumulatorKey);for(const o of this._accumulationSets())o.precompile(t)}*_accumulationSets(){yield this._primarySet,yield this._contextSet}normalizeCtorArgs(){return{}}dispose(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=s(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=s(this._fbo),this._vao=s(this._vao);for(const e of this._accumulationSets())e.destroy()}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fbo?.colorTexture}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return null!=this._fbo&&[...this._accumulationSets()].some((e=>e.active))}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==f.zero&&this._opacityFromElevation>v}get _doneAccumulating(){return[...this._accumulationSets()].every((e=>e.doneAccumulating))}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce(((e,t)=>e+(t.active?1:0)),0)}get _pixelFormat(){return 2===this._numActive?{pixelFormat:q.RG,internalFormat:P.RG8}:{pixelFormat:q.RED,internalFormat:P.R8}}get running(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some((e=>e.running))}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const r of this._accumulationSets())this._runTaskForSet(r,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let r=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),r=!0;return r}renderAccumulation(e,t,r){if(this._updateCamera(t),this._bindParameters.contentCamera=r,this._bindParameters.depth=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!this.accumulating||!this.canAccumulate)return!1;this._previewing||this._cameraForcedForScreenshot?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart();const i=this._accumulateSetsForRenderFrame();return this._cameraForcedForScreenshot=!1,i}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every((e=>0===e.progress)))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fbo,e)}_accumulateSetsForRenderFrame(){let e=!1;for(const t of this._accumulationSets())this._accumulateSetForRenderFrame(t)&&(e=!0);return e&&this._requestRender(),e}_accumulateSetForRenderFrame(e){let t=this._cameraForcedForScreenshot?e.sampleCount:Math.min(U,e.sampleCount);t-=e.progress;for(let r=0;r<t;++r)this._accumulateShadow(e);return t>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setOptions(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const r=this._primarySet.progress;return!this.active||!this._fbo||r<1||e<0||e>=this._fbo.width||t<0||t>=this._fbo.height?0:(this._fbo.readPixels(e,t,1,1,q.RGBA,D.UNSIGNED_BYTE,k),k[x.PRIMARY]/r)}_numActiveChanged(){if(!this._fbo)return;const e=2===this._numActive,t=this._createFBO();t.resize(this._fbo.width,this._fbo.height),e&&(this._clearFramebuffer(t),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fbo,t),this._fbo.dispose(),this._fbo=t,this._requestRender()}_enable(){this._fbo||(this._fbo=this._createFBO(),this._invalidateAccumulationSets())}_createFBO(){const{pixelFormat:e,internalFormat:t}=this._pixelFormat,r=new M;return r.pixelFormat=e,r.internalFormat=t,r.wrapMode=T.CLAMP_TO_EDGE,new O(this._rctx,r)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_disable(){this._fbo&&(this._fbo=s(this._fbo),this._requestRender())}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fbo){e&&(this._rctx.bindFramebuffer(e),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(E.COLOR))}_clearFramebufferForSet(e,t){if(!e)return;const r=this._techniques.get(C,t.configuration);this._rctx.bindFramebuffer(e),this._rctx.bindTechnique(r,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(r.primitiveType,0,B(this._vao,"geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(A,e.configuration);this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,B(this._vao,"geometry"))}_updateCamera(e){const t=this._fbo;if(null==t)return;const r=this._bindParameters.camera;e.equals(r)||r.copyFrom(e),t.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-i(w,S,e.relativeElevation)}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};e([h()],L.prototype,"_fbo",void 0),e([h()],L.prototype,"_depthRange",void 0),e([h()],L.prototype,"_previewing",void 0),e([h()],L.prototype,"_accumulationRenderer",void 0),e([h()],L.prototype,"_refining",null),e([h()],L.prototype,"active",null),e([h()],L.prototype,"canAccumulate",null),e([h()],L.prototype,"_doneAccumulating",null),e([h()],L.prototype,"_opacityFromElevation",null),e([h()],L.prototype,"_numActive",null),e([h()],L.prototype,"_pixelFormat",null),e([h()],L.prototype,"running",null),L=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],L);const U=6,I="renderView",k=new Uint8Array(4);class G{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=c(0),this._sampleCount=c(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,i=Math.min(y,e.length);if(!r(t,0,t.length,e,0,i,l)){t.length=i,this._sampleCount.value=i;for(let r=0;r<i;++r)t[r]=m(t[r]??_(),e[r]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(A,this.configuration),e.precompile(C,this.configuration)}}export{L as ShadowAccumulator};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"./ShadowCastAccumulateTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/ShadowCastClear.glsl.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{ShadowCastAccumulateIndex as i}from"./ShadowCastAccumulateTechniqueConfiguration.js";import{S as o}from"../../../../chunks/ShadowCastClear.glsl.js";import{PrimitiveType as t}from"../../../webgl/enums.js";import{makePipelineState as s}from"../../../webgl/renderState.js";class l extends r{constructor(r,i){super(r,i,new e(o,(()=>import("./ShadowCastClear.glsl.js")))),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(e){const r={r:e.index===i.PRIMARY,g:e.index===i.CONTEXT,b:!1,a:!1};return s({blending:null,colorWrite:r,depthTest:null,depthWrite:null})}}export{l as ShadowCastClearTechnique};
|
package/views/LinkChartView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../chunks/tslib.es6.js";import e from"../WebLinkChart.js";import{watch as
|
|
5
|
+
import{_ as r}from"../chunks/tslib.es6.js";import e from"../WebLinkChart.js";import{watch as t}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import a from"../geometry/SpatialReference.js";import i from"./View2D.js";let p=class extends i{constructor(r){super(r),this.map=null,this.view2dType="linkchart";const e=r=>{this.spatialReference="geographic-organic-standard"===r?this.map.basemap?.spatialReference??a.WebMercator:a.WGS84};let o=null;this.addHandles(t((()=>this.map),(r=>{r&&(o&&o.remove(),o=t((()=>r.linkChartProperties.layoutType),e),this.addHandles(o))}),{initial:!0}))}get inGeographicLayout(){return"geographic-organic-standard"===this.map?.linkChartProperties.layoutType}};r([o()],p.prototype,"inGeographicLayout",null),r([o({type:e})],p.prototype,"map",void 0),r([o({readOnly:!0})],p.prototype,"view2dType",void 0),p=r([s("esri.views.LinkChartView")],p);const c=p;export{c as default};
|
package/views/draw/DrawAction.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{destroyMaybe as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{destroyMaybe as r}from"../../core/maybe.js";import s from"../../core/Promise.js";import{ignoreAbortErrors as n}from"../../core/promiseUtils.js";import{createScreenPointArray as o}from"../../core/screenUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../layers/GraphicsLayer.js";import{makeDehydratedPoint as h}from"../../layers/graphics/dehydratedPoint.js";import{ViewingMode as l}from"../ViewingMode.js";import{SnappingVisualizer2D as c}from"../2d/interactive/SnappingVisualizer2D.js";import{createCoordinateHelper as m}from"../interactive/coordinateHelper.js";import{EditGeometry as _,Component as u}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as y}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as g}from"../interactive/snapping/SnappingContext.js";import{SnappingOperation as v}from"../interactive/snapping/SnappingOperation.js";var f;let x=class extends(s.EsriPromiseMixin(t.EventedAccessor)){static{f=this}constructor(e){super(e),this._hasZ=null,this._cursorScreenPoint=null,this._activePointerId=null,this._stagedVertexUnsnapped=null,this._lastVertexUnsnapped=null,this.interactiveUndoDisabled=!1,this.history=[],this.redoHistory=[],this.snapToScene=!1,this.view=null,this.elevationInfo=null,this.defaultZ=0,this._coordinateHelper=m(!!e.hasZ,!1,e.view.spatialReference),this._snappingManager=e.snappingManager,this._editGeometryOperations=new y(new _(e.editGeometryType??"polygon",this._coordinateHelper),l.Local),this._snappingGraphicsLayer=new d({id:f.SNAPPING_GRAPHICS_LAYER_ID,listMode:"hide",internal:!0}),this._snappingContext=new g({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:"mouse",visualizer:new c(this._snappingGraphicsLayer)}),this._activeComponent=new u(e.view.spatialReference,l.Local),this._editGeometryOperations.data.components.push(this._activeComponent)}normalizeCtorArgs(e){const t={...e};return delete t.editGeometryType,delete t.snappingManager,t}initialize(){this._snappingOperation=new v({view:this.view}),"2d"===this.view.type&&this.view.map.layers.add(this._snappingGraphicsLayer)}destroy(){this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy(),null!=this._snappingManager&&this._snappingManager.doneSnapping(),this._snappingOperation=r(this._snappingOperation),this._editGeometryOperations.destroy()}get _committedVertices(){return this._editGeometryOperations.data.components[0].vertices.map((e=>e.pos))}get vertices(){return null!=this._stagedVertex?[...this._committedVertices,this._coordinateHelper.pointToArray(this._stagedVertex)]:this._committedVertices}get hasZ(){return null!=this._hasZ?this._hasZ:"3d"===this.view.type}set hasZ(e){this._hasZ=e,this.notifyChange("hasZ")}get _stagedVertex(){return this._snappingOperation?.stagedPoint}set _stagedVertex(e){this._snappingOperation&&(this._snappingOperation.stagedPoint=i(e))}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this.canUndo&&this._editGeometryOperations.undo()}redo(){this.canRedo&&this._editGeometryOperations.redo()}getCoordsFromScreenPoint(e){const t=e&&this.screenToMap(e);return null==t?null:t.hasZ?[t.x,t.y,t.z]:[t.x,t.y]}getCoordsAndPointFromScreenPoint(e){const t=this.screenToMap(e);return null==t?null:t.hasZ?{vertex:[t.x,t.y,t.z],mapPoint:t}:{vertex:[t.x,t.y],mapPoint:t}}screenToMap(e){let t=null;if("3d"===this.view.type)if(this.hasZ){const i=this.elevationInfo??G;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(o(e.x,e.y),i,this._getGeometryZValue())}else{const i=this.elevationInfo??w;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(o(e.x,e.y),i,0),null!=t&&(t.z=void 0)}else t=this.view.toMap(e),null!=t&&(t.z=this.hasZ?this._getGeometryZValue():void 0);return t}_pushCursorVertex(e,t){const i=h(e[0],e[1],void 0,this.view.spatialReference);this._stagedVertexUnsnapped=i;const r=this._snappingManager;if(null==r)return this._stagedVertex=i,void t();n(this._snappingOperation.snap({point:i},r,this._snappingContext)).then((()=>{t()}))}_popCursorVertex(){this._stagedVertexUnsnapped=null,this._stagedVertex=null}_getGeometryZValue(){return this.defaultZ}_abortSnapping(){this._snappingOperation.abort()}_isDuplicateOfLastVertex(e){const t=this._editGeometryOperations.data.components[0].getLastVertex()?.pos;if(t&&e[0]===t[0]&&e[1]===t[1])return!0;const{x:i,y:r}=this._coordinateHelper.vectorToDehydratedPoint(e);return null!=this._lastVertexUnsnapped&&i===this._lastVertexUnsnapped.x&&r===this._lastVertexUnsnapped.y}_shouldHandlePointerEvent(e){return V(e)&&(null==this._activePointerId||this._activePointerId===e.pointerId)}_vertexAddHandler(e){const t=null!=this._stagedVertex?this._coordinateHelper.pointToArray(this._stagedVertex):this.getCoordsFromScreenPoint(this._cursorScreenPoint);null!=t&&this._addVertex(t,e.native)}_drawCompleteHandler(e){this._completeDrawing(e.native)}static{this.SNAPPING_GRAPHICS_LAYER_ID="DrawAction-snapping-graphics-layer"}};e([a({readOnly:!0})],x.prototype,"vertices",null),e([a({type:Boolean,nonNullable:!0})],x.prototype,"interactiveUndoDisabled",void 0),e([a({readOnly:!0})],x.prototype,"history",void 0),e([a({readOnly:!0})],x.prototype,"redoHistory",void 0),e([a()],x.prototype,"snapToScene",void 0),e([a()],x.prototype,"view",void 0),e([a()],x.prototype,"elevationInfo",void 0),e([a({nonNullable:!0})],x.prototype,"defaultZ",void 0),e([a()],x.prototype,"hasZ",null),e([a()],x.prototype,"_snappingOperation",void 0),e([a()],x.prototype,"_stagedVertex",null),x=f=e([p("esri.views.draw.DrawAction")],x);const G={mode:"absolute-height",offset:0},w={mode:"on-the-ground",offset:0};function V(e){return"mouse"!==e.pointerType||0===e.button}const O=x;export{O as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import{UndoRedo as o}from"../../UndoRedo.js";import{createTask as r}from"../../core/asyncUtils.js";import i from"../../core/Evented.js";import{makeHandle as s}from"../../core/handleUtils.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as a,syncAndInitial as l,sync as p}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{load as d}from"../../geometry/coordinateFormatter.js";import u from"../../layers/GraphicsLayer.js";import{pointEquals as m}from"../../layers/graphics/dehydratedFeatureComparison.js";import{CreateOperationGeometry as y}from"./support/CreateOperationGeometry.js";import{createCircle as g,createEllipse as v,createSquare as f,createRectangle as O,createPolygon as _,createPolyline as w,createMultipoint as C}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as G}from"./support/surfaceCoordinateSystems.js";import{createTooltipInfos as x,initializeConstraints as V,updateTooltipInfo as b,getConstraintZ as k,unlockConstraintsOnVertexAddOrRemove as S,lockElevationOnVertexAdd as U,getActiveTooltipInfo as j}from"./support/tooltipUtils.js";import{InteractiveToolBase as T}from"../interactive/InteractiveToolBase.js";import H from"../interactive/sketch/SketchOptions.js";import{makeTooltip as L,pasteLocation as R,enterInputModeIfAvailable as z}from"../interactive/tooltip/tooltipCommonUtils.js";import{autorun as E}from"../../core/accessorSupport/trackingUtils.js";let I=class extends(i.EventedMixin(T)){constructor(t){super(t),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.elevationLockOnVertexAddDisabled=!1,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new H}initialize(){const{view:t}=this;this.internalGraphicsLayer=new u({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer);const e=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=x(t.type,this.sketchOptions);const o=L((()=>({view:t,options:this.sketchOptions.tooltips})));this.tooltip=o,V(this._tooltipsContext),this._coordinateFormatterLoadTask=r((()=>d())),this.addHandles([e.on("vertex-add",(t=>this.onVertexAdd(t))),e.on("vertex-remove",(t=>this.onVertexRemove(t))),e.on("vertex-update",(t=>this.onVertexUpdate(t))),e.on("cursor-update",(t=>this.onCursorUpdate(t))),e.on("cursor-remove",(()=>this._updateGraphic())),e.on("complete",(t=>this.onComplete(t))),this._coordinateFormatterLoadTask,o.on("paste",(t=>R(t,this.activeTooltipInfo))),a((()=>this.cursor),(t=>{e.cursor=t}),l),E((()=>{const{activeTooltipInfo:t,sketchOptions:e}=this;b(t,this._tooltipsContext),o.info=e.tooltips.effectiveEnabled?t:null})),E((()=>{e.constraintZ=k(this._tooltipsContext)}),p)]),this.finishToolCreation()}destroy(){this.drawOperation=n(this.drawOperation),this.tooltip=n(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=n(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){return{createOperationGeometry:this._createOperationGeometry,defaultZ:this.defaultZ,directionOptions:this.directionOptions,drawOperation:this.drawOperation,forceUniformSize:this.forceUniformSize,geometryType:this.geometryType,graphic:this.graphic,sketchOptions:this.sketchOptions,tooltipInfos:this.tooltipInfos,view:this.view}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(t){this._set("centered",t),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(t){this._set("cursor",t)}set enabled(t){this.drawOperation.interactive=t,this._set("enabled",t)}set forceUniformSize(t){this._set("forceUniformSize",t),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(t){this._set("graphicSymbol",t),null!=this._graphic&&(this._graphic.symbol=t)}set mode(t){const e=this.drawOperation;e&&(e.drawingMode=t),this._set("mode",t)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:t,map:e}}=this;return"2d"===t&&e&&"undoRedo"in e&&e.undoRedo instanceof o?e.undoRedo:null}set undoRedo(t){this._override("undoRedo",t)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(t){this.destroyed||z(t,this.tooltip)||this.drawOperation.onInputEvent(t)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),0===this.drawOperation.numCommittedVertices&&V(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(F.outline),this.removeHandles(F.regularVertices),this.removeHandles(F.activeVertex),this.removeHandles(F.activeEdge),this.removeHandles(A)}_createOrUpdateGraphic(t){if(null!=this._graphic)return this.updateGraphicGeometry(t),this._graphic;const o=new e({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=o,this.updateGraphicGeometry(t),this.internalGraphicsLayer.add(o),this.addHandles(this.initializeGraphic(o)),this.notifyChange("graphic"),this.addHandles(s((()=>{this.internalGraphicsLayer.remove(o),this._graphic===o&&(this._graphic=null)})),A),o}updateGraphicGeometry(t){this._graphic.geometry=t}_getCreateOperationGeometry(t={operationComplete:!1}){if(null==this.drawOperation)return;const{coordinateHelper:e,view:o,visualizationCursorVertex:r,lastVertex:i,committedVertices:s,geometryIncludingUncommittedVertices:n,numCommittedVertices:a}=this.drawOperation;if(!(a>0||null!=r))return;const l=t.operationComplete?s:n,p=l.length,c=null!=r?e.pointToArray(r):null,h=this._drawSpatialReference,d="3d"===o.type&&"global"===o.viewingMode,u=new y;u.committedVertices=s,u.cursorVertex=c;const{geometryType:x}=this;switch(x){case"point":case"mesh":u.full=e.arrayToPoint(l[0]);break;case"multipoint":u.full=p>0?C(l,h):null;break;case"polyline":case"polygon":p>0&&(u.full="polygon"===x?_([l],h,d,!0):w([l],h,d),u.cursorEdge=null!=c&&i&&!m(r,i)?w([[c,e.pointToArray(i)]],h,d):null,u.outline=p>1?u.full:null);break;case"circle":case"rectangle":{if(u.committedVertices=u.cursorVertex=null,!p)break;const e=G(o,l[0]),r=l[0],i=e.makeMapPoint(r[0]+Z*o.resolution,r[1]);"circle"===x?1===p&&t.operationComplete?u.circle=g([r,i],e,!0):2===p&&(this.forceUniformSize?u.circle=g(l,e,this.centered):u.rectangle=v(l,e,this.centered)):1===p&&t.operationComplete?u.rectangle=f([r,i],e,!0):2===p&&(u.rectangle=this.forceUniformSize?f(l,e,this.centered):O(l,e,this.centered)),u.full=null!=u.circle?u.circle.geometry:u.rectangle?.geometry,u.outline="polygon"===u.full?.type?u.full:null;break}default:return null}return u}initializeGraphic(t){return s()}onComplete(t){if(!this.drawOperation)return;this._updateGraphic();let e=null;if(this.drawOperation.isCompleted){const t=this._getCreateOperationGeometry({operationComplete:!0});null!=t&&(e=this._createOrUpdateGraphic(t.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:e,...t})}onCursorUpdate(t){this._updateGraphic(),this.emit("cursor-update",t)}onDeactivate(){const{drawOperation:t}=this;t&&(t.isCompleted||t.cancel())}onOutlineChanged(t){return s()}onCursorEdgeChanged(t){return s()}onVertexAdd(t){S(this._tooltipsContext),this._updateGraphic(),this.elevationLockOnVertexAddDisabled||U(t.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",t)}onVertexRemove(t){S(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",t)}onVertexUpdate(t){this._updateGraphic(),this.emit("vertex-update",t)}_updateGraphic(){const t=this._getCreateOperationGeometry();this._createOperationGeometry=t,null!=t?(null!=t.cursorEdge?this.addHandles(this.onCursorEdgeChanged(t.cursorEdge),F.activeEdge):this.removeHandles(F.activeEdge),null!=t.outline?this.addHandles(this.onOutlineChanged(t.outline),F.outline):this.removeHandles(F.outline),null!=t.committedVertices?this.addHandles(this.onRegularVerticesChanged(t.committedVertices),F.regularVertices):this.removeHandles(F.regularVertices),null!=t.cursorVertex?this.addHandles(this.onActiveVertexChanged(t.cursorVertex),F.activeVertex):this.removeHandles(F.activeVertex),null!=t.full?this._createOrUpdateGraphic(t.full):this.removeHandles(A)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?j(this._tooltipsContext):null}};t([c()],I.prototype,"_coordinateFormatterLoadTask",void 0),t([c()],I.prototype,"_createOperationGeometry",void 0),t([c()],I.prototype,"_tooltipsContext",null),t([c({value:!0})],I.prototype,"centered",null),t([c()],I.prototype,"cursor",null),t([c({nonNullable:!0})],I.prototype,"defaultZ",void 0),t([c({constructOnly:!0})],I.prototype,"directionOptions",void 0),t([c()],I.prototype,"drawOperation",void 0),t([c()],I.prototype,"elevationLockOnVertexAddDisabled",void 0),t([c({value:!0})],I.prototype,"enabled",null),t([c({value:!0})],I.prototype,"forceUniformSize",null),t([c({constructOnly:!0})],I.prototype,"geometryType",void 0),t([c()],I.prototype,"graphic",null),t([c({constructOnly:!0})],I.prototype,"graphicProperties",void 0),t([c()],I.prototype,"graphicSymbol",null),t([c({constructOnly:!0})],I.prototype,"hasZ",void 0),t([c({constructOnly:!0})],I.prototype,"geometryToPlace",void 0),t([c()],I.prototype,"mode",null),t([c()],I.prototype,"snappingManager",void 0),t([c()],I.prototype,"snapToScene",void 0),t([c()],I.prototype,"tooltip",void 0),t([c()],I.prototype,"tooltipInfos",void 0),t([c({constructOnly:!0,type:H})],I.prototype,"sketchOptions",void 0),t([c()],I.prototype,"updating",null),t([c({constructOnly:!0,nonNullable:!0})],I.prototype,"view",void 0),t([c({constructOnly:!0})],I.prototype,"undoRedo",null),t([c()],I.prototype,"activeTooltipInfo",null),I=t([h("esri.views.draw.DrawGraphicTool")],I);const A=Symbol("create-operation-graphic"),F={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function M(t){switch(t){case"point":case"polyline":case"polygon":case"multipoint":return t;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const Z=48;export{I as DrawGraphicTool,M as geometryTypeToDrawOperationGeometryType};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import{UndoRedo as o}from"../../UndoRedo.js";import{createTask as r}from"../../core/asyncUtils.js";import i from"../../core/Evented.js";import{makeHandle as s}from"../../core/handleUtils.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as a,syncAndInitial as l,sync as p}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{load as h}from"../../geometry/coordinateFormatter.js";import u from"../../layers/GraphicsLayer.js";import{pointEquals as m}from"../../layers/graphics/dehydratedFeatureComparison.js";import{CreateOperationGeometry as y}from"./support/CreateOperationGeometry.js";import{createCircle as g,createEllipse as v,createSquare as f,createRectangle as O,createPolygon as _,createPolyline as w,createMultipoint as C}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as G}from"./support/surfaceCoordinateSystems.js";import{createTooltipInfos as x,initializeConstraints as V,updateTooltipInfo as U,getConstraintZ as b,unlockConstraintsOnVertexAddOrRemove as k,lockElevationOnVertexAdd as S,getActiveTooltipInfo as j}from"./support/tooltipUtils.js";import{InteractiveToolBase as T}from"../interactive/InteractiveToolBase.js";import L from"../interactive/sketch/SketchOptions.js";import{makeTooltip as H,pasteLocation as R,enterInputModeIfAvailable as z}from"../interactive/tooltip/tooltipCommonUtils.js";import{autorun as A}from"../../core/accessorSupport/trackingUtils.js";let E=class extends(i.EventedMixin(T)){constructor(t){super(t),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.elevationLockOnVertexAddDisabled=!1,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new L}initialize(){const{view:t}=this;this.internalGraphicsLayer=new u({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer);const e=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=x(t.type,this.sketchOptions);const o=H((()=>({view:t,options:this.sketchOptions.tooltips})));this.tooltip=o,V(this._tooltipsContext),this._coordinateFormatterLoadTask=r((()=>h())),this.addHandles([e.on("vertex-add",(t=>this.onVertexAdd(t))),e.on("vertex-remove",(t=>this.onVertexRemove(t))),e.on("vertex-update",(t=>this.onVertexUpdate(t))),e.on("cursor-update",(t=>this.onCursorUpdate(t))),e.on("cursor-remove",(()=>this._updateGraphic())),e.on("complete",(t=>this.onComplete(t))),this._coordinateFormatterLoadTask,o.on("paste",(t=>R(t,this.activeTooltipInfo))),a((()=>this.cursor),(t=>{e.cursor=t}),l),A((()=>{const{activeTooltipInfo:t,sketchOptions:e}=this;U(t,this._tooltipsContext),o.info=e.tooltips.effectiveEnabled?t:null})),A((()=>{e.constraintZ=b(this._tooltipsContext)}),p)]),this.finishToolCreation()}destroy(){this.drawOperation=n(this.drawOperation),this.tooltip=n(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=n(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){const{defaultZ:t,directionOptions:e,drawOperation:o,forceUniformSize:r,geometryType:i,graphic:s,sketchOptions:n,tooltipInfos:a,view:l,automaticAreaMeasurementUtils:p,automaticLengthMeasurementUtils:c}=this;return{createOperationGeometry:this._createOperationGeometry,defaultZ:t,directionOptions:e,drawOperation:o,forceUniformSize:r,geometryType:i,graphic:s,sketchOptions:n,tooltipInfos:a,view:l,automaticAreaMeasurementUtils:p,automaticLengthMeasurementUtils:c}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(t){this._set("centered",t),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(t){this._set("cursor",t)}set enabled(t){this.drawOperation.interactive=t,this._set("enabled",t)}set forceUniformSize(t){this._set("forceUniformSize",t),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(t){this._set("graphicSymbol",t),null!=this._graphic&&(this._graphic.symbol=t)}set mode(t){const e=this.drawOperation;e&&(e.drawingMode=t),this._set("mode",t)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:t,map:e}}=this;return"2d"===t&&e&&"undoRedo"in e&&e.undoRedo instanceof o?e.undoRedo:null}set undoRedo(t){this._override("undoRedo",t)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(t){this.destroyed||z(t,this.tooltip)||this.drawOperation.onInputEvent(t)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),0===this.drawOperation.numCommittedVertices&&V(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(I.outline),this.removeHandles(I.regularVertices),this.removeHandles(I.activeVertex),this.removeHandles(I.activeEdge),this.removeHandles(M)}_createOrUpdateGraphic(t){if(null!=this._graphic)return this.updateGraphicGeometry(t),this._graphic;const o=new e({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=o,this.updateGraphicGeometry(t),this.internalGraphicsLayer.add(o),this.addHandles(this.initializeGraphic(o)),this.notifyChange("graphic"),this.addHandles(s((()=>{this.internalGraphicsLayer.remove(o),this._graphic===o&&(this._graphic=null)})),M),o}updateGraphicGeometry(t){this._graphic.geometry=t}_getCreateOperationGeometry(t={operationComplete:!1}){if(null==this.drawOperation)return;const{coordinateHelper:e,view:o,visualizationCursorVertex:r,lastVertex:i,committedVertices:s,geometryIncludingUncommittedVertices:n,numCommittedVertices:a}=this.drawOperation;if(!(a>0||null!=r))return;const l=t.operationComplete?s:n,p=l.length,c=null!=r?e.pointToArray(r):null,d=this._drawSpatialReference,h="3d"===o.type&&"global"===o.viewingMode,u=new y;u.committedVertices=s,u.cursorVertex=c;const{geometryType:x}=this;switch(x){case"point":case"mesh":u.full=e.arrayToPoint(l[0]);break;case"multipoint":u.full=p>0?C(l,d):null;break;case"polyline":case"polygon":p>0&&(u.full="polygon"===x?_([l],d,h,!0):w([l],d,h),u.cursorEdge=null!=c&&i&&!m(r,i)?w([[c,e.pointToArray(i)]],d,h):null,u.outline=p>1?u.full:null);break;case"circle":case"rectangle":{if(u.committedVertices=u.cursorVertex=null,!p)break;const e=G(o,l[0]),r=l[0],i=e.makeMapPoint(r[0]+Z*o.resolution,r[1]);"circle"===x?1===p&&t.operationComplete?u.circle=g([r,i],e,!0):2===p&&(this.forceUniformSize?u.circle=g(l,e,this.centered):u.rectangle=v(l,e,this.centered)):1===p&&t.operationComplete?u.rectangle=f([r,i],e,!0):2===p&&(u.rectangle=this.forceUniformSize?f(l,e,this.centered):O(l,e,this.centered)),u.full=null!=u.circle?u.circle.geometry:u.rectangle?.geometry,u.outline="polygon"===u.full?.type?u.full:null;break}default:return null}return u}initializeGraphic(t){return s()}onComplete(t){if(!this.drawOperation)return;this._updateGraphic();let e=null;if(this.drawOperation.isCompleted){const t=this._getCreateOperationGeometry({operationComplete:!0});null!=t&&(e=this._createOrUpdateGraphic(t.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:e,...t})}onCursorUpdate(t){this._updateGraphic(),this.emit("cursor-update",t)}onDeactivate(){const{drawOperation:t}=this;t&&(t.isCompleted||t.cancel())}onOutlineChanged(t){return s()}onCursorEdgeChanged(t){return s()}onVertexAdd(t){k(this._tooltipsContext),this._updateGraphic(),this.elevationLockOnVertexAddDisabled||S(t.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",t)}onVertexRemove(t){k(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",t)}onVertexUpdate(t){this._updateGraphic(),this.emit("vertex-update",t)}_updateGraphic(){const t=this._getCreateOperationGeometry();this._createOperationGeometry=t,null!=t?(null!=t.cursorEdge?this.addHandles(this.onCursorEdgeChanged(t.cursorEdge),I.activeEdge):this.removeHandles(I.activeEdge),null!=t.outline?this.addHandles(this.onOutlineChanged(t.outline),I.outline):this.removeHandles(I.outline),null!=t.committedVertices?this.addHandles(this.onRegularVerticesChanged(t.committedVertices),I.regularVertices):this.removeHandles(I.regularVertices),null!=t.cursorVertex?this.addHandles(this.onActiveVertexChanged(t.cursorVertex),I.activeVertex):this.removeHandles(I.activeVertex),null!=t.full?this._createOrUpdateGraphic(t.full):this.removeHandles(M)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?j(this._tooltipsContext):null}};t([c()],E.prototype,"_coordinateFormatterLoadTask",void 0),t([c()],E.prototype,"_createOperationGeometry",void 0),t([c()],E.prototype,"_tooltipsContext",null),t([c({value:!0})],E.prototype,"centered",null),t([c()],E.prototype,"cursor",null),t([c({nonNullable:!0})],E.prototype,"defaultZ",void 0),t([c({constructOnly:!0})],E.prototype,"directionOptions",void 0),t([c()],E.prototype,"drawOperation",void 0),t([c()],E.prototype,"elevationLockOnVertexAddDisabled",void 0),t([c({value:!0})],E.prototype,"enabled",null),t([c({value:!0})],E.prototype,"forceUniformSize",null),t([c({constructOnly:!0})],E.prototype,"geometryType",void 0),t([c()],E.prototype,"graphic",null),t([c({constructOnly:!0})],E.prototype,"graphicProperties",void 0),t([c()],E.prototype,"graphicSymbol",null),t([c({constructOnly:!0})],E.prototype,"hasZ",void 0),t([c({constructOnly:!0})],E.prototype,"geometryToPlace",void 0),t([c()],E.prototype,"mode",null),t([c()],E.prototype,"snappingManager",void 0),t([c()],E.prototype,"snapToScene",void 0),t([c()],E.prototype,"tooltip",void 0),t([c()],E.prototype,"tooltipInfos",void 0),t([c({constructOnly:!0,type:L})],E.prototype,"sketchOptions",void 0),t([c()],E.prototype,"updating",null),t([c({constructOnly:!0,nonNullable:!0})],E.prototype,"view",void 0),t([c({constructOnly:!0})],E.prototype,"automaticAreaMeasurementUtils",void 0),t([c({constructOnly:!0})],E.prototype,"automaticLengthMeasurementUtils",void 0),t([c({constructOnly:!0})],E.prototype,"undoRedo",null),t([c()],E.prototype,"activeTooltipInfo",null),E=t([d("esri.views.draw.DrawGraphicTool")],E);const M=Symbol("create-operation-graphic"),I={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function F(t){switch(t){case"point":case"polyline":case"polygon":case"multipoint":return t;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const Z=48;export{E as DrawGraphicTool,F as geometryTypeToDrawOperationGeometryType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import i from"../../core/Evented.js";import{clone as n}from"../../core/lang.js";import{equalsMaybe as o,destroyMaybe as r}from"../../core/maybe.js";import{memoize as s}from"../../core/memoize.js";import{ignoreAbortErrors as a}from"../../core/promiseUtils.js";import p from"../../core/ReactiveSet.js";import{watch as c,syncAndInitial as l}from"../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{diff as m}from"../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as g}from"../../core/support/UpdatingHandles.js";import{pointEquals as y,pointNear as _}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getEffectiveElevationInfo as v}from"../../support/elevationInfoUtils.js";import{ViewingMode as f}from"../ViewingMode.js";import{defaultDrawingMode as x}from"./DrawingMode.js";import{DrawManipulator as C}from"./DrawManipulator.js";import{createCoordinateHelper as b}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as T,sceneSnappingAtLocation as S}from"../interactive/dragEventPipeline.js";import{EditGeometry as P,Component as V}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as w}from"../interactive/editGeometry/EditGeometryOperations.js";import{isPoint as O}from"../interactive/sketch/constraints.js";import{pointToConstraintSpace as M,constraintSpaceToPoint as D,getPointConstraint as E,getPolylineOrPolygonConstraint as I}from"../interactive/sketch/constraintUtils.js";import H from"../interactive/sketch/SketchLabelOptions.js";import{SnappingContext as j}from"../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as G}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as k}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as Z}from"../interactive/snapping/snappingUtils.js";const A="crosshair",L="progress",U=Symbol(),z=Symbol();let F=class extends(i.EventedMixin(e)){constructor(t){super(t),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new p,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new g,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=s(E),this._getPolylineOrPolygonConstraint=s(I),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new H,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,null==t.elevationInfo&&(this.elevationInfo=v(!!t.hasZ))}initialize(){const{geometryType:t,view:e}=this,i=e.spatialReference,n="viewingMode"in e.state?e.state.viewingMode:f.Local,r="segment"===t||"multipoint"===t?"polyline":t;this.coordinateHelper=b(this.hasZ,this.hasM,i),this._editGeometryOperations=new w(new P(r,this.coordinateHelper),n),this._snappingOperation=new k({view:e}),this.addHandles([c((()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint})),(({stagedPoint:t,constraint:e},i)=>{const{snappingOptions:n}=this;n&&(n.forceDisabled=null!=e&&O(e));if(null!=i&&t===i.stagedPoint&&e!==i.constraint)return this._onKeyboardBasedChange();this._processCursor(t??this._screenToMap(this._stagedScreenPoint))}),{equals:(t,e)=>t.stagedPoint===e.stagedPoint&&o(t.constraint,e.constraint)}),c((()=>this.view.viewpoint),((t,e)=>{t&&e&&m(t,e)&&this._onKeyboardBasedChange()}))]),this._activeComponent=new V(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const s=this.segmentLabels;null!=s&&(s.context={view:e,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(c((()=>this.labelOptions.enabled),(t=>{s.visible=t}),l))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],(t=>{const e=t.vertices.map((t=>({componentIndex:0,vertexIndex:t.index,coordinates:this.coordinateHelper.vectorToArray(t.pos)}))),i=e.map((t=>t.coordinates)),n=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;y(n,this.firstVertex)||(this.firstVertex=n);const o=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;y(o,this.lastVertex)||(this.lastVertex=o);const r=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;switch(y(r,this.secondToLastVertex)||(this.secondToLastVertex=r),this._processCursor(this.cursorVertex),t.type){case"vertex-add":this.emit(t.type,{...t,added:i,vertices:e});break;case"vertex-update":this.emit(t.type,{...t,updated:i,vertices:e});break;case"vertex-remove":this.emit(t.type,{...t,removed:i,vertices:e})}})));const p=this._manipulator=new C({consumesClicks:!1,grabbableForEvent:t=>"click"!==this.drawingMode||"touch"===t.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size});this.manipulators.add(p),p.grabbable="point"!==t&&"multipoint"!==t,this.addHandles([p.events.on("immediate-click",(t=>this._onImmediateClick(t))),p.events.on("immediate-double-click",(t=>this._onImmediateDoubleClick(t))),c((()=>this.drawingMode),(()=>{this.removeHandles(U),this.addHandles(this._createManipulatorDragPipeline(p),U)}),l),c((()=>({effectiveCursor:this.effectiveCursor})),(({effectiveCursor:t})=>{p.cursor=t}),l)]),Z(this,(()=>{const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);if(null!=this.snappingManager){const t=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,e);this._updatingHandles.addPromise(a(t))}}))}destroy(){r(this.segmentLabels),r(this._snappingOperation),this._editGeometryOperations=r(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:t,_manipulator:e}=this;return null!=t&&this._pointerDownStates.has(t)||e.grabbing||!e.interactive}get _snappingEnabled(){return null!=this.snappingManager&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const t=this._updateAndGetEffectiveDrawSurface();return"3d"===this.view.type&&this.drawSurface!==t}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map((t=>this.coordinateHelper.vectorToArray(t.pos)))}get _constraint(){const{constraints:t,constraintsEnabled:e}=this;if(t&&e)switch(this.geometryType){case"point":case"multipoint":return this._getPointConstraint(t);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,t)}}set drawingMode(t){this._set("drawingMode",t??x)}get effectiveCursor(){return this.loading?L:this._hideDefaultCursor?null:this.cursor||A}get interactive(){return this._manipulator.interactive}set interactive(t){this._manipulator.interactive=t}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return null!=this.snappingManager?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return"mouse"===this._stagedPointerType?this.cursorVertex:null}get committableVertex(){const{cursorVertex:t,lastVertex:e,firstVertex:i,geometryType:n}=this;return"polygon"===n&&_(t,i)||_(t,e)?null:t}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:t,committableVertex:e,coordinateHelper:i}=this,n=t.slice();return null!=e&&n.push(i.pointToArray(e)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:t}=this;null!=t&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(t))}complete(t){const e=t?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,o="multipoint"===i&&0===n||"polyline"===i&&n<2||"polygon"===i&&n<3;"segment"!==i&&"point"!==i||this.commitStagedVertex(),this._createOperationCompleted=!o,(this.isCompleted||e)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map(((t,e)=>({componentIndex:0,vertexIndex:e,coordinates:t}))),aborted:e,type:"complete"}))}onInputEvent(t){switch(t.type){case"pointer-down":this._pointerDownStates.add(t.pointerId);break;case"pointer-up":this._pointerDownStates.delete(t.pointerId)}switch(t.type){case"pointer-move":return this._onPointerMove(t);case"hold":return this._onHold(t)}}redo(){this._editGeometryOperations.redo()}undo(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(t){const e=n(this.cursorVertex),i=n(t),o=i&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(i)??i),r=this._snapToClosingVertex(o),s=this._applyConstraints(r);_(e,s)||(this._set("cursorVertex",s),this.segmentLabels?.set("stagedVertex",null!=s?this.coordinateHelper.pointToVector(s):null),null==s||"mouse"!==this._stagedPointerType?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(s)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(t){if(null==t||this._isDragging||"polygon"!==this.geometryType||this.numCommittedVertices<=2)return t;const e=this._mapToScreen(t);if(!e)return t;const i=this._activeComponent;return this._vertexWithinPointerDistance(i.vertices[0].pos,e)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,e)?this.lastVertex:t}_createManipulatorDragPipeline(t){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(t);case"freehand":return this._createManipulatorDragPipelineFreehand(t);case"hybrid":return this._createManipulatorDragPipelineHybrid(t)}}_createManipulatorDragPipelineClick(t){return T(t,((t,e,i,n)=>{const o="touch"===n&&this._snappingEnabled;if(this.isCompleted||!o)return;const{snappingStep:r,cancelSnapping:s}=G({predicate:()=>o,snappingManager:this.snappingManager,snappingContext:new j({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:n,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});i=i.next((t=>(o&&null!=this.snappingManager&&this.snappingManager.doneSnapping(),t))).next(s),e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(this._processCursor(t.mapStart),("segment"===this.geometryType||o&&!this.numCommittedVertices)&&this.commitStagedVertex()),t))).next(S(this.view,this.elevationInfo)).next(...r).next((t=>(o&&(this._processCursor(t.mapEnd),"end"===t.action&&this.commitStagedVertex()),t))).next((t=>("end"===t.action&&("mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()),t)))}))}_createManipulatorDragPipelineFreehand(t){return T(t,((t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(this._snappingOperation.abort(),null==this.committableVertex&&this._processCursor(t.mapStart),"segment"===this.geometryType&&this.commitStagedVertex()),t))).next((t=>{switch(t.action){case"start":case"update":this._processCursor(t.mapEnd),"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":this.complete()}return t}))}))}_createManipulatorDragPipelineHybrid(t){return T(t,((t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),z),this._processCursor(t.mapStart),this.commitStagedVertex()),t))).next((t=>{switch(t.action){case"start":case"update":this._processCursor(t.mapEnd),"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":"mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),this.removeHandles(z),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return t}))}))}get _drawAtFixedElevation(){const{constraintsEnabled:t,constraintZ:e,geometryType:i,numCommittedVertices:n}=this;return t?null!=e||"segment"===i&&n>0:("segment"===i||"polygon"===i)&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:t,coordinateHelper:e,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:o}=this;if(null==n)return i;if(!this.hasZ)return n.defaultZ=null,n;const r=this.elevationInfo?.mode;let s=this.defaultZ,a=t||"absolute-height"===r;if(null!=o&&(a=o),"on-the-ground"===r&&(a=!1),this._drawAtFixedElevation){s=(t?this.constraintZ:null)??e.getZ(this._activeComponent.vertices[0].pos),a=!1}return a?i:(n.defaultZ=s,n)}_mapToScreen(t){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(t)}_onHold(t){this._snappingOperation.abort(),"click"===this.drawingMode&&"touch"===t.pointerType&&this._snappingEnabled&&this._processCursor(t.mapPoint),t.stopPropagation()}_onImmediateClick(t){if(!("mouse"===t.pointerType&&2===t.button||this._manipulator.dragging))try{const{drawingMode:e,geometryType:i}=this;this._stagedPointerType=t.pointerType,this._stagedScreenPoint=t.screenPoint;const n=this._screenToMap(t.screenPoint);if(null==n)return;if(null==n||"freehand"===e&&"point"!==i&&"multipoint"!==i)return;if(this._snappingEnabled&&null!=this.cursorVertex||this._processCursor(n),null==this.committableVertex)return void this.complete();this.commitStagedVertex(),"mouse"!==t.pointerType&&this._processCursor(null),("freehand"===e&&"multipoint"!==this.geometryType||"point"===i||"segment"===i&&2===this.numCommittedVertices||"segment"===i&&"hybrid"===e&&1===this.numCommittedVertices)&&this.complete()}finally{t.stopPropagation()}}_onImmediateDoubleClick(t){this._manipulator.dragging||"point"===this.geometryType||(this.complete(),t.stopPropagation())}_onPointerMove(t){const e=d(t.x,t.y);this._stagedScreenPoint=e,this._stagedPointerType=t.pointerType,this._stagedPointerId=t.pointerId,this._isDragging?this._snappingOperation.abort():(t.stopPropagation(),this._processCursorMovementRelativeToSurface(e,t.pointerType))}_onKeyboardBasedChange(){"mouse"===this._stagedPointerType&&this._stagedScreenPoint&&null!=this._stagedPointerId&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(t,e){const i=this._snappingOperation,n=this._screenToMap(t),o=this._requiresScenePoint?this.drawSurface?.screenToMap(t):null;if(null==n)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const r=this.snappingManager;if(null==r)return this._processCursor(n),void i.abort();const s=this._getSnappingContext(e);this._updatingHandles.addPromise(a(i.snap({point:n,scenePoint:o},r,s)))}_applyConstraints(t){const{_constraint:e,constraints:i}=this;if(!t||!i||!e)return t;const{context:n}=i,o=M(t,n),r=o?e.closestTo(o):void 0;if(!r)return t;const s=D(r,t,n),a="2d"===this.view.type||"absolute-height"!==n.elevationInfo.mode;return null!=s&&a&&null!=this.constraintZ&&this.hasZ&&(s.z=this.constraintZ),s}_screenToMap(t){return t?this._updateAndGetEffectiveDrawSurface()?.screenToMap(t):null}_screenToMapDragEventStep(){let t=null;return e=>{if("start"===e.action&&(t=this._screenToMap(e.screenStart)),null==t)return null;const i=this._screenToMap(e.screenEnd);return null!=i?{...e,mapStart:t,mapEnd:i}:null}}_vertexWithinPointerDistance(t,e){const i=25,n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(t));return null!=n&&R(n,e,i)}_getSnappingContext(t){const e=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new j({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:t,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:null!=e?{value:e,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function R(t,e,i){const n=t.x-e.x,o=t.y-e.y;return n*n+o*o<=i}t([h()],F.prototype,"_hideDefaultCursor",void 0),t([h()],F.prototype,"_stagedPointerId",void 0),t([h()],F.prototype,"_isDragging",null),t([h()],F.prototype,"_snappingOperation",void 0),t([h()],F.prototype,"_snappingEnabled",null),t([h({constructOnly:!0})],F.prototype,"graphic",void 0),t([h()],F.prototype,"constraintsEnabled",void 0),t([h()],F.prototype,"constraints",void 0),t([h()],F.prototype,"_constraint",null),t([h()],F.prototype,"constraintZ",void 0),t([h()],F.prototype,"defaultZ",void 0),t([h()],F.prototype,"isDraped",void 0),t([h({value:x})],F.prototype,"drawingMode",null),t([h({constructOnly:!0})],F.prototype,"elevationDrawSurface",void 0),t([h({constructOnly:!0})],F.prototype,"elevationInfo",void 0),t([h({constructOnly:!0,type:H})],F.prototype,"labelOptions",void 0),t([h({constructOnly:!0})],F.prototype,"geometryType",void 0),t([h({constructOnly:!0})],F.prototype,"hasM",void 0),t([h({constructOnly:!0})],F.prototype,"hasZ",void 0),t([h()],F.prototype,"cursor",void 0),t([h()],F.prototype,"effectiveCursor",null),t([h()],F.prototype,"loading",void 0),t([h({constructOnly:!0})],F.prototype,"manipulators",void 0),t([h({constructOnly:!0})],F.prototype,"drawSurface",void 0),t([h({constructOnly:!0})],F.prototype,"segmentLabels",void 0),t([h({constructOnly:!0})],F.prototype,"snappingManager",void 0),t([h({constructOnly:!0})],F.prototype,"snappingVisualizer",void 0),t([h()],F.prototype,"snapToSceneEnabled",void 0),t([h({readOnly:!0})],F.prototype,"cursorVertex",null),t([h({readOnly:!0})],F.prototype,"visualizationCursorVertex",null),t([h()],F.prototype,"committableVertex",null),t([h()],F.prototype,"firstVertex",void 0),t([h()],F.prototype,"lastVertex",void 0),t([h()],F.prototype,"secondToLastVertex",void 0),t([h()],F.prototype,"updating",null),t([h({constructOnly:!0})],F.prototype,"view",void 0),F=t([u("esri.views.draw.DrawOperation")],F);export{F as DrawOperation,A as defaultCursor,L as defaultLoadingCursor};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import i from"../../core/Evented.js";import{clone as n}from"../../core/lang.js";import{equalsMaybe as o,destroyMaybe as r}from"../../core/maybe.js";import{memoize as s}from"../../core/memoize.js";import{ignoreAbortErrors as a}from"../../core/promiseUtils.js";import p from"../../core/ReactiveSet.js";import{watch as c,syncAndInitial as l}from"../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{diff as m}from"../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as g}from"../../core/support/UpdatingHandles.js";import{pointEquals as y,pointNear as _}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getEffectiveElevationInfo as v}from"../../support/elevationInfoUtils.js";import{ViewingMode as f}from"../ViewingMode.js";import{defaultDrawingMode as x}from"./DrawingMode.js";import{DrawManipulator as C}from"./DrawManipulator.js";import{createCoordinateHelper as b}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as T,sceneSnappingAtLocation as S}from"../interactive/dragEventPipeline.js";import{EditGeometry as P,Component as V}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as w}from"../interactive/editGeometry/EditGeometryOperations.js";import{isPoint as O}from"../interactive/sketch/constraints.js";import{pointToConstraintSpace as M,constraintSpaceToPoint as D,getPointConstraint as E,getPolylineOrPolygonConstraint as I}from"../interactive/sketch/constraintUtils.js";import H from"../interactive/sketch/SketchLabelOptions.js";import{SnappingContext as j}from"../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as G}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as k}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as Z}from"../interactive/snapping/snappingUtils.js";const L="crosshair",U="progress",A=Symbol(),z=Symbol();let F=class extends(i.EventedMixin(e)){constructor(t){super(t),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new p,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new g,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=s(E),this._getPolylineOrPolygonConstraint=s(I),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new H,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,null==t.elevationInfo&&(this.elevationInfo=v(!!t.hasZ))}initialize(){const{geometryType:t,view:e}=this,i=e.spatialReference,n="viewingMode"in e.state?e.state.viewingMode:f.Local,r="segment"===t||"multipoint"===t?"polyline":t;this.coordinateHelper=b(this.hasZ,this.hasM,i),this._editGeometryOperations=new w(new P(r,this.coordinateHelper),n),this._snappingOperation=new k({view:e}),this.addHandles([c((()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint})),(({stagedPoint:t,constraint:e},i)=>{const{snappingOptions:n}=this;n&&(n.forceDisabled=null!=e&&O(e));if(null!=i&&t===i.stagedPoint&&e!==i.constraint)return this._onKeyboardBasedChange();this._processCursor(t??this._screenToMap(this._stagedScreenPoint))}),{equals:(t,e)=>t.stagedPoint===e.stagedPoint&&o(t.constraint,e.constraint)}),c((()=>this.view.viewpoint),((t,e)=>{t&&e&&m(t,e)&&this._onKeyboardBasedChange()}))]),this._activeComponent=new V(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const s=this.segmentLabels;null!=s&&(s.context={view:e,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},this.addHandles(c((()=>this.labelOptions.enabled),(t=>{s.visible=t}),l))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],(t=>{const e=t.vertices.map((t=>({componentIndex:0,vertexIndex:t.index,coordinates:this.coordinateHelper.vectorToArray(t.pos)}))),i=e.map((t=>t.coordinates)),n=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;y(n,this.firstVertex)||(this.firstVertex=n);const o=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;y(o,this.lastVertex)||(this.lastVertex=o);const r=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;switch(y(r,this.secondToLastVertex)||(this.secondToLastVertex=r),this._processCursor(this.cursorVertex),t.type){case"vertex-add":this.emit(t.type,{...t,added:i,vertices:e});break;case"vertex-update":this.emit(t.type,{...t,updated:i,vertices:e});break;case"vertex-remove":this.emit(t.type,{...t,removed:i,vertices:e})}})));const p=this._manipulator=new C({consumesClicks:!1,grabbableForEvent:t=>"click"!==this.drawingMode||"touch"===t.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size});this.manipulators.add(p),p.grabbable="point"!==t&&"multipoint"!==t,this.addHandles([p.events.on("immediate-click",(t=>this._onImmediateClick(t))),p.events.on("immediate-double-click",(t=>this._onImmediateDoubleClick(t))),c((()=>this.drawingMode),(()=>{this.removeHandles(A),this.addHandles(this._createManipulatorDragPipeline(p),A)}),l),c((()=>({effectiveCursor:this.effectiveCursor})),(({effectiveCursor:t})=>{p.cursor=t}),l)]),Z(this,(()=>{const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);if(null!=this.snappingManager){const t=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,e);this._updatingHandles.addPromise(a(t))}}))}destroy(){r(this.segmentLabels),r(this._snappingOperation),this._editGeometryOperations=r(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:t,_manipulator:e}=this;return null!=t&&this._pointerDownStates.has(t)||e.grabbing||!e.interactive}get _snappingEnabled(){return null!=this.snappingManager&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const t=this._updateAndGetEffectiveDrawSurface();return"3d"===this.view.type&&this.drawSurface!==t}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map((t=>this.coordinateHelper.vectorToArray(t.pos)))}get _constraint(){const{constraints:t,constraintsEnabled:e}=this;if(t&&e)switch(this.geometryType){case"point":case"multipoint":return this._getPointConstraint(t);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,t)}}set drawingMode(t){this._set("drawingMode",t??x)}get effectiveCursor(){return this.loading?U:this._hideDefaultCursor?null:this.cursor||L}get interactive(){return this._manipulator.interactive}set interactive(t){this._manipulator.interactive=t}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return null!=this.snappingManager?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return"mouse"===this._stagedPointerType?this.cursorVertex:null}get committableVertex(){const{cursorVertex:t,lastVertex:e,firstVertex:i,geometryType:n}=this;return"polygon"===n&&_(t,i)||_(t,e)?null:t}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:t,committableVertex:e,coordinateHelper:i}=this,n=t.slice();return null!=e&&n.push(i.pointToArray(e)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:t}=this;null!=t&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(t))}complete(t){const e=t?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,o="multipoint"===i&&0===n||"polyline"===i&&n<2||"polygon"===i&&n<3;"segment"!==i&&"point"!==i||this.commitStagedVertex(),this._createOperationCompleted=!o,(this.isCompleted||e)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map(((t,e)=>({componentIndex:0,vertexIndex:e,coordinates:t}))),aborted:e,type:"complete"}))}onInputEvent(t){switch(t.type){case"pointer-down":this._pointerDownStates.add(t.pointerId);break;case"pointer-up":this._pointerDownStates.delete(t.pointerId)}switch(t.type){case"pointer-move":return this._onPointerMove(t);case"hold":return this._onHold(t)}}redo(){this._editGeometryOperations.redo()}undo(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(t){const e=n(this.cursorVertex),i=n(t),o=i&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(i)??i),r=this._snapToClosingVertex(o),s=this._applyConstraints(r);_(e,s)||(this._set("cursorVertex",s),this.segmentLabels?.set("stagedVertex",null!=s?this.coordinateHelper.pointToVector(s):null),null==s||"mouse"!==this._stagedPointerType?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(s)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(t){if(null==t||this._isDragging||"polygon"!==this.geometryType||this.numCommittedVertices<=2)return t;const e=this._mapToScreen(t);if(!e)return t;const i=this._activeComponent;return this._vertexWithinPointerDistance(i.vertices[0].pos,e)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,e)?this.lastVertex:t}_createManipulatorDragPipeline(t){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(t);case"freehand":return this._createManipulatorDragPipelineFreehand(t);case"hybrid":return this._createManipulatorDragPipelineHybrid(t)}}_createManipulatorDragPipelineClick(t){return T(t,((t,e,i,n)=>{const o="touch"===n&&this._snappingEnabled;if(this.isCompleted||!o)return;const{snappingStep:r,cancelSnapping:s}=G({predicate:()=>o,snappingManager:this.snappingManager,snappingContext:new j({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:n,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});i=i.next((t=>(o&&null!=this.snappingManager&&this.snappingManager.doneSnapping(),t))).next(s),e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(this._processCursor(t.mapStart),("segment"===this.geometryType||o&&!this.numCommittedVertices)&&this.commitStagedVertex()),t))).next(S(this.view,this.elevationInfo)).next(...r).next((t=>(o&&(this._processCursor(t.mapEnd),"end"===t.action&&this.commitStagedVertex()),t))).next((t=>("end"===t.action&&("mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()),t)))}))}_createManipulatorDragPipelineFreehand(t){return T(t,((t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(this._snappingOperation.abort(),null==this.committableVertex&&this._processCursor(t.mapStart),"segment"===this.geometryType&&this.commitStagedVertex()),t))).next((t=>{switch(t.action){case"start":case"update":this._processCursor(t.mapEnd),"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":this.complete()}return t}))}))}_createManipulatorDragPipelineHybrid(t){return T(t,((t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),z),this._processCursor(t.mapStart),this.commitStagedVertex()),t))).next((t=>{switch(t.action){case"start":case"update":this._processCursor(t.mapEnd),"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":"mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),this.removeHandles(z),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return t}))}))}get _drawAtFixedElevation(){const{constraintsEnabled:t,constraintZ:e,geometryType:i,numCommittedVertices:n}=this;return t?null!=e||"segment"===i&&n>0:("segment"===i||"polygon"===i)&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:t,coordinateHelper:e,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:o}=this;if(null==n)return i;if(!this.hasZ)return n.defaultZ=null,n;const r=this.elevationInfo?.mode;let s=this.defaultZ,a=t||"absolute-height"===r;if(null!=o&&(a=o),"on-the-ground"===r&&(a=!1),this._drawAtFixedElevation){s=(t?this.constraintZ:null)??e.getZ(this._activeComponent.vertices[0].pos),a=!1}return a?i:(n.defaultZ=s,n)}_mapToScreen(t){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(t)}_onHold(t){this._snappingOperation.abort(),"click"===this.drawingMode&&"touch"===t.pointerType&&this._snappingEnabled&&this._processCursor(t.mapPoint),t.stopPropagation()}_onImmediateClick(t){if(!("mouse"===t.pointerType&&2===t.button||this._manipulator.dragging))try{const{drawingMode:e,geometryType:i}=this;this._stagedPointerType=t.pointerType,this._stagedScreenPoint=t.screenPoint;const n=this._screenToMap(t.screenPoint);if(null==n)return;if(null==n||"freehand"===e&&"point"!==i&&"multipoint"!==i)return;if(this._snappingEnabled&&null!=this.cursorVertex||this._processCursor(n),null==this.committableVertex)return void this.complete();this.commitStagedVertex(),"mouse"!==t.pointerType&&this._processCursor(null),("freehand"===e&&"multipoint"!==this.geometryType||"point"===i||"segment"===i&&2===this.numCommittedVertices||"segment"===i&&"hybrid"===e&&1===this.numCommittedVertices)&&this.complete()}finally{t.stopPropagation()}}_onImmediateDoubleClick(t){this._manipulator.dragging||"point"===this.geometryType||(this.complete(),t.stopPropagation())}_onPointerMove(t){const e=d(t.x,t.y);this._stagedScreenPoint=e,this._stagedPointerType=t.pointerType,this._stagedPointerId=t.pointerId,this._isDragging?this._snappingOperation.abort():(t.stopPropagation(),this._processCursorMovementRelativeToSurface(e,t.pointerType))}_onKeyboardBasedChange(){"mouse"===this._stagedPointerType&&this._stagedScreenPoint&&null!=this._stagedPointerId&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(t,e){const i=this._snappingOperation,n=this._screenToMap(t),o=this._requiresScenePoint?this.drawSurface?.screenToMap(t):null;if(null==n)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const r=this.snappingManager;if(null==r)return this._processCursor(n),void i.abort();const s=this._getSnappingContext(e);this._updatingHandles.addPromise(a(i.snap({point:n,scenePoint:o},r,s)))}_applyConstraints(t){const{_constraint:e,constraints:i}=this;if(!t||!i||!e)return t;const{context:n}=i,o=M(t,n),r=o?e.closestTo(o):void 0;if(!r)return t;const s=D(r,t,n),a="2d"===this.view.type||"absolute-height"!==n.elevationInfo.mode;return null!=s&&a&&null!=this.constraintZ&&this.hasZ&&(s.z=this.constraintZ),s}_screenToMap(t){return t?this._updateAndGetEffectiveDrawSurface()?.screenToMap(t):null}_screenToMapDragEventStep(){let t=null;return e=>{if("start"===e.action&&(t=this._screenToMap(e.screenStart)),null==t)return null;const i=this._screenToMap(e.screenEnd);return null!=i?{...e,mapStart:t,mapEnd:i}:null}}_vertexWithinPointerDistance(t,e){const i=25,n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(t));return null!=n&&R(n,e,i)}_getSnappingContext(t){const e=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new j({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:t,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:null!=e?{value:e,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function R(t,e,i){const n=t.x-e.x,o=t.y-e.y;return n*n+o*o<=i}t([h()],F.prototype,"_hideDefaultCursor",void 0),t([h()],F.prototype,"_stagedPointerId",void 0),t([h()],F.prototype,"_isDragging",null),t([h()],F.prototype,"_snappingOperation",void 0),t([h()],F.prototype,"_snappingEnabled",null),t([h({constructOnly:!0})],F.prototype,"graphic",void 0),t([h()],F.prototype,"constraintsEnabled",void 0),t([h()],F.prototype,"constraints",void 0),t([h()],F.prototype,"_constraint",null),t([h()],F.prototype,"constraintZ",void 0),t([h()],F.prototype,"defaultZ",void 0),t([h()],F.prototype,"isDraped",void 0),t([h({constructOnly:!0})],F.prototype,"automaticLengthMeasurementUtils",void 0),t([h({value:x})],F.prototype,"drawingMode",null),t([h({constructOnly:!0})],F.prototype,"elevationDrawSurface",void 0),t([h({constructOnly:!0})],F.prototype,"elevationInfo",void 0),t([h({constructOnly:!0,type:H})],F.prototype,"labelOptions",void 0),t([h({constructOnly:!0})],F.prototype,"geometryType",void 0),t([h({constructOnly:!0})],F.prototype,"hasM",void 0),t([h({constructOnly:!0})],F.prototype,"hasZ",void 0),t([h()],F.prototype,"cursor",void 0),t([h()],F.prototype,"effectiveCursor",null),t([h()],F.prototype,"loading",void 0),t([h({constructOnly:!0})],F.prototype,"manipulators",void 0),t([h({constructOnly:!0})],F.prototype,"drawSurface",void 0),t([h({constructOnly:!0})],F.prototype,"segmentLabels",void 0),t([h({constructOnly:!0})],F.prototype,"snappingManager",void 0),t([h({constructOnly:!0})],F.prototype,"snappingVisualizer",void 0),t([h()],F.prototype,"snapToSceneEnabled",void 0),t([h({readOnly:!0})],F.prototype,"cursorVertex",null),t([h({readOnly:!0})],F.prototype,"visualizationCursorVertex",null),t([h()],F.prototype,"committableVertex",null),t([h()],F.prototype,"firstVertex",void 0),t([h()],F.prototype,"lastVertex",void 0),t([h()],F.prototype,"secondToLastVertex",void 0),t([h()],F.prototype,"updating",null),t([h({constructOnly:!0})],F.prototype,"view",void 0),F=t([u("esri.views.draw.DrawOperation")],F);export{F as DrawOperation,L as defaultCursor,U as defaultLoadingCursor};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{makeHandle as r}from"../../core/handleUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as a}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{DrawOperation as n}from"./DrawOperation.js";import{ScreenDrawSurface as p}from"./drawSurfaces.js";import{createCircle as c,createSquare as l,createEllipse as d,createRectangle as m}from"./support/createUtils.js";import{AffineCoordinateSystem as u}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as h}from"../interactive/InteractiveToolBase.js";import g from"../overlay/OutlineOverlayItem.js";let y=class extends(t.EventedMixin(h)){constructor(e){super(e),this._overlayItem=void 0,this.geometryType=null,this.mode=null,this.type="draw-screen"}initialize(){this.drawOperation=this._makeDrawOperation();const e=e=>this.drawOperation.on(e,(t=>{this._updateVisuals(),this.emit(e,t)}));this.addHandles([e("vertex-add"),e("vertex-remove"),e("vertex-update"),e("cursor-update"),e("complete")]),this.finishToolCreation()}destroy(){this.drawOperation=o(this.drawOperation),this._set("view",null)}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centeredToggled(e){this._set("centeredToggled",e),this._updateVisuals()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set uniformSizeToggled(e){this._set("uniformSizeToggled",e),this._updateVisuals()}get updating(){return this.drawOperation?.updating??!1}get cursor(){return this._get("cursor")??"crosshair"}set cursor(e){this._set("cursor",e),this.drawOperation.cursor=e}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}undo(){this.drawOperation.undo()}reset(){}_makeDrawOperation(){const{view:e}=this;return new n({view:e,manipulators:this.manipulators,geometryType:v(this.geometryType),drawingMode:this.mode,hasZ:!1,defaultZ:0,snapToSceneEnabled:!1,drawSurface:new p,hasM:!1,snappingManager:null,snappingVisualizer:null,graphic:null,cursor:this.cursor})}get coordinates(){const{drawOperation:e}=this;if(!e?.geometryIncludingUncommittedVertices.length)return[];const{coordinateHelper:t}=e,r=e.committableVertex,o=e.committedVertices.slice();null!=r&&o.push(t.pointToArray(r));const i=o.length;switch(this.geometryType){case"point":return o.slice(0,1);case"circle":case"rectangle":{const t=new u(a,p.spatialReference),r="circle"===this.geometryType?c:l,s="circle"===this.geometryType?d:m;if(1===i&&e.isCompleted){const e=o[0],i=t.makeMapPoint(e[0]+w,e[1]);return r([e,i],t,!0)?.geometry.rings[0]??[]}if(2===i){const e="rectangle"!==this.geometryType,i=this.centeredToggled!==e,a="rectangle"!==this.geometryType;return(this.uniformSizeToggled!==a?r(o,t,i)?.geometry.rings[0]:s(o,t,i)?.geometry.rings[0])??[]}return[]}}return o}_updateVisuals(){if(!this._overlayItem){const e=new g({strokeDash:[5],strokeDashColor:[255,255,255,255]});this.view.overlay?.addItem(e),this.addHandles(r((()=>{this.view.overlay?.removeItem(e),e?.destroy(),this._overlayItem=void 0}))),this._overlayItem=e}this._overlayItem.coordinates=this.coordinates}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}};function v(e){switch(e){case"polygon":case"point":return e;case"circle":case"rectangle":return"segment"}}e([i({value:!1})],y.prototype,"centeredToggled",null),e([i()],y.prototype,"drawOperation",void 0),e([i({value:!0})],y.prototype,"enabled",null),e([i({value:!1})],y.prototype,"uniformSizeToggled",null),e([i({constructOnly:!0})],y.prototype,"geometryType",void 0),e([i({constructOnly:!0})],y.prototype,"mode",void 0),e([i({readOnly:!0})],y.prototype,"type",void 0),e([i({readOnly:!0})],y.prototype,"updating",null),e([i({constructOnly:!0,nonNullable:!0})],y.prototype,"view",void 0),e([i()],y.prototype,"cursor",null),y=e([s("esri.views.draw.DrawScreenTool")],y);const w=48;export{y as DrawScreenTool,v as geometryTypeToDrawOperationGeometryType};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{makeHandle as r}from"../../core/handleUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as a}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{DrawOperation as n}from"./DrawOperation.js";import{ScreenDrawSurface as p}from"./drawSurfaces.js";import{createCircle as c,createSquare as l,createEllipse as d,createRectangle as m}from"./support/createUtils.js";import{AffineCoordinateSystem as u}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as h}from"../interactive/InteractiveToolBase.js";import g from"../overlay/OutlineOverlayItem.js";let y=class extends(t.EventedMixin(h)){constructor(e){super(e),this._overlayItem=void 0,this.geometryType=null,this.mode=null,this.type="draw-screen"}initialize(){this.drawOperation=this._makeDrawOperation();const e=e=>this.drawOperation.on(e,(t=>{this._updateVisuals(),this.emit(e,t)}));this.addHandles([e("vertex-add"),e("vertex-remove"),e("vertex-update"),e("cursor-update"),e("complete")]),this.finishToolCreation()}destroy(){this.drawOperation=o(this.drawOperation),this._set("view",null)}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centeredToggled(e){this._set("centeredToggled",e),this._updateVisuals()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set uniformSizeToggled(e){this._set("uniformSizeToggled",e),this._updateVisuals()}get updating(){return this.drawOperation?.updating??!1}get cursor(){return this._get("cursor")??"crosshair"}set cursor(e){this._set("cursor",e),this.drawOperation.cursor=e}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}undo(){this.drawOperation.undo()}reset(){}_makeDrawOperation(){const{view:e}=this;return new n({view:e,manipulators:this.manipulators,geometryType:v(this.geometryType),drawingMode:this.mode,hasZ:!1,defaultZ:0,snapToSceneEnabled:!1,drawSurface:new p,hasM:!1,snappingManager:null,snappingVisualizer:null,graphic:null,cursor:this.cursor,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}get coordinates(){const{drawOperation:e}=this;if(!e?.geometryIncludingUncommittedVertices.length)return[];const{coordinateHelper:t}=e,r=e.committableVertex,o=e.committedVertices.slice();null!=r&&o.push(t.pointToArray(r));const i=o.length;switch(this.geometryType){case"point":return o.slice(0,1);case"circle":case"rectangle":{const t=new u(a,p.spatialReference),r="circle"===this.geometryType?c:l,s="circle"===this.geometryType?d:m;if(1===i&&e.isCompleted){const e=o[0],i=t.makeMapPoint(e[0]+w,e[1]);return r([e,i],t,!0)?.geometry.rings[0]??[]}if(2===i){const e="rectangle"!==this.geometryType,i=this.centeredToggled!==e,a="rectangle"!==this.geometryType;return(this.uniformSizeToggled!==a?r(o,t,i)?.geometry.rings[0]:s(o,t,i)?.geometry.rings[0])??[]}return[]}}return o}_updateVisuals(){if(!this._overlayItem){const e=new g({strokeDash:[5],strokeDashColor:[255,255,255,255]});this.view.overlay?.addItem(e),this.addHandles(r((()=>{this.view.overlay?.removeItem(e),e?.destroy(),this._overlayItem=void 0}))),this._overlayItem=e}this._overlayItem.coordinates=this.coordinates}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}};function v(e){switch(e){case"polygon":case"point":return e;case"circle":case"rectangle":return"segment"}}e([i({value:!1})],y.prototype,"centeredToggled",null),e([i()],y.prototype,"drawOperation",void 0),e([i({value:!0})],y.prototype,"enabled",null),e([i({value:!1})],y.prototype,"uniformSizeToggled",null),e([i({constructOnly:!0})],y.prototype,"geometryType",void 0),e([i({constructOnly:!0})],y.prototype,"mode",void 0),e([i({readOnly:!0})],y.prototype,"type",void 0),e([i({readOnly:!0})],y.prototype,"updating",null),e([i({constructOnly:!0,nonNullable:!0})],y.prototype,"view",void 0),e([i({constructOnly:!0})],y.prototype,"automaticLengthMeasurementUtils",void 0),e([i()],y.prototype,"cursor",null),y=e([s("esri.views.draw.DrawScreenTool")],y);const w=48;export{y as DrawScreenTool,v as geometryTypeToDrawOperationGeometryType};
|
package/views/draw/DrawTool.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{destroyMaybe as o}from"../../core/maybe.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveElevationInfo as n}from"../../support/elevationInfoUtils.js";import{DrawOperation as a}from"./DrawOperation.js";import{ElevationDrawSurface as s,SceneDrawSurface as p}from"./drawSurfaces.js";import{InteractiveToolBase as d}from"../interactive/InteractiveToolBase.js";let l=class extends(e.EventedMixin(d)){constructor(t){super(t),this.defaultZ=0,this.elevationInfo=null,this.hasZ=!0,this.mode=null,this.snapToScene=null,this.type="draw-3d"}initialize(){const t=this.view,e=n(this.hasZ,this.elevationInfo);this.drawOperation=new a({view:t,manipulators:this.manipulators,geometryType:this.geometryType,drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:"3d"===t.type?new p(t,e):null,elevationDrawSurface:"3d"===t.type?new s(e,this.defaultZ,t):null,hasM:!1,elevationInfo:e,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils}),this.addHandles([this.drawOperation.on("vertex-add",(t=>this.onVertexAdd(t))),this.drawOperation.on("vertex-remove",(t=>this.onVertexRemove(t))),this.drawOperation.on("vertex-update",(t=>this.onVertexUpdate(t))),this.drawOperation.on("cursor-update",(t=>this.onCursorUpdate(t))),this.drawOperation.on("complete",(t=>this.onComplete(t)))]),this.finishToolCreation()}destroy(){this.drawOperation=o(this.drawOperation),this._set("view",null)}set enabled(t){this.drawOperation.interactive=t,this._set("enabled",t)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}getVertexCoords(){return this.drawOperation.geometryIncludingUncommittedVertices}onInputEvent(t){this.drawOperation.onInputEvent(t)}canRedo(){return this.drawOperation.canRedo}canUndo(){return this.drawOperation.canUndo}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}onComplete(t){this.emit("complete",t)}onCursorUpdate(t){this.emit("cursor-update",t)}onVertexAdd(t){this.emit("vertex-add",t)}onVertexRemove(t){this.emit("vertex-remove",t)}onVertexUpdate(t){this.emit("vertex-update",t)}};t([r({constructOnly:!0,nonNullable:!0})],l.prototype,"defaultZ",void 0),t([r()],l.prototype,"drawOperation",void 0),t([r({constructOnly:!0})],l.prototype,"elevationInfo",void 0),t([r({value:!0})],l.prototype,"enabled",null),t([r({constructOnly:!0})],l.prototype,"geometryType",void 0),t([r({constructOnly:!0})],l.prototype,"automaticLengthMeasurementUtils",void 0),t([r({constructOnly:!0})],l.prototype,"hasZ",void 0),t([r({constructOnly:!0})],l.prototype,"mode",void 0),t([r()],l.prototype,"snapToScene",void 0),t([r({readOnly:!0})],l.prototype,"type",void 0),t([r({readOnly:!0})],l.prototype,"updating",null),t([r({constructOnly:!0,nonNullable:!0})],l.prototype,"view",void 0),l=t([i("esri.views.draw.DrawTool")],l);export{l as DrawTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../geometry/Point.js";import o from"./DrawAction.js";import{
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../geometry/Point.js";import o from"./DrawAction.js";import{CursorUpdateEvent as r,DrawCompleteEvent as s}from"./input/DrawEvents.js";import{ViewEventPriorities as n}from"../input/InputManager.js";import{sketchKeys as a}from"../interactive/keybindings.js";import{loadAutomaticLengthMeasurementUtils as d}from"../support/automaticLengthMeasurementUtils.js";import{createScreenPointFromEvent as h}from"../support/screenUtils.js";let p=class extends o{constructor(t){super(t),this._addVertexOnPointerUp=!1,this._drawTool=null}initialize(){this._addViewHandles(),"3d"===this.view.type&&this.addResolvingPromise(this._addDrawTool())}destroy(){this._removeDrawTool(),this.emit("destroy")}complete(){this._completeDrawing()}_addViewHandles(){this._addViewHandles2DOnly(),this.addHandles([this.view.on("key-down",(t=>{t.key===a.complete&&(this._drawTool?this.complete():(this._abortSnapping(),this._vertexAddHandler(t)))}),n.TOOL)])}_addViewHandles2DOnly(){"2d"===this.view.type&&this.addHandles([this.view.on("pointer-down",(t=>{this._shouldHandlePointerEvent(t)&&(this._abortSnapping(),this._activePointerId=t.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=h(t),"touch"===t.pointerType&&this._updateCursor())}),n.TOOL),this.view.on("pointer-move",(t=>{this._abortSnapping(),this._cursorScreenPoint=h(t),"touch"!==t.pointerType&&this._updateCursor()}),n.TOOL),this.view.on("pointer-drag",(t=>{this._shouldHandlePointerEvent(t)&&(this._abortSnapping(),this._addVertexOnPointerUp=!1)}),n.TOOL),this.view.on("pointer-up",(t=>{if(this._shouldHandlePointerEvent(t))if(this._abortSnapping(),this._activePointerId=null,this._addVertexOnPointerUp)t.stopPropagation(),this._vertexAddHandler(t);else{const e="touch"===t.pointerType;this._updateCursor(e)}}),n.TOOL),this.view.on("drag",["Shift"],(t=>{t.stopPropagation()}),n.TOOL)])}async _addDrawTool(){const[{DrawTool:t},e]=await Promise.all([import("./DrawTool.js"),d()]),i=new t({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"point",mode:"click",automaticLengthMeasurementUtils:e});this.destroyed?i.destroy():(this._drawTool=i,this.view.addAndActivateTool(i),this.addHandles([i.on("cursor-update",(t=>{1===t.vertices.length&&this.emit("cursor-update",new r(this.view,t.vertices[0].vertexIndex,i.getVertexCoords()))})),i.on("complete",(t=>{this.emit("draw-complete",new s(i.getVertexCoords())),this._removeDrawTool(),this.removeAllHandles()}))]))}_removeDrawTool(){this._drawTool&&(this.view.tools.remove(this._drawTool),this._drawTool=null)}_addVertex(t){const e=this._coordinateHelper.arrayToVector(t);this._isDuplicateOfLastVertex(e)||(this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertex(e),this.notifyChange("vertices"),this._completeDrawing())}_updateCursor(t=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const e=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);null==e||t||this._pushCursorVertex(e.vertex,(()=>this.emit("cursor-update",new r(this.view,this._activeComponent.vertices.length,this.vertices,null!=this._stagedVertex?new i(this._stagedVertex):null))))}_completeDrawing(){if(this._drawTool)return void this._drawTool.completeCreateOperation();this._activePointerId=null,this._popCursorVertex(),this._abortSnapping(),null!=this._snappingManager&&this._snappingManager.doneSnapping();const t=new s(this.vertices);this.emit("draw-complete",t),t.defaultPrevented||this.removeAllHandles()}};p=t([e("esri.views.draw.PointDrawAction")],p);const l=p;export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../geometry/Point.js";import r from"./DrawAction.js";import{drawingModes as s,defaultDrawingMode as n}from"./DrawingMode.js";import{
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../geometry/Point.js";import r from"./DrawAction.js";import{drawingModes as s,defaultDrawingMode as n}from"./DrawingMode.js";import{VertexRemoveEvent as a,VertexAddEvent as d,CursorUpdateEvent as h,DrawCompleteEvent as p}from"./input/DrawEvents.js";import{ViewEventPriorities as l}from"../input/InputManager.js";import{sketchKeys as c}from"../interactive/keybindings.js";import{loadAutomaticLengthMeasurementUtils as _}from"../support/automaticLengthMeasurementUtils.js";import{createScreenPointFromEvent as v}from"../support/screenUtils.js";let u=class extends r{constructor(e){super(e),this._panEnabled=!1,this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1,this._drawTool=null,this.mode=n}initialize(){this._addViewHandles(),"3d"===this.view.type&&this.addResolvingPromise(this._addDrawTool())}destroy(){this._removeDrawTool(),this.emit("destroy")}get _dragEnabled(){return"freehand"===this.mode||"hybrid"===this.mode}get _clickEnabled(){return"click"===this.mode||"hybrid"===this.mode}undo(){this._drawTool?this._drawTool.undo():(super.undo(),this.notifyChange("vertices"))}redo(){this._drawTool?this._drawTool.redo():(super.redo(),this.notifyChange("vertices"))}canUndo(){return this._drawTool?.canUndo()??super.canUndo()}canRedo(){return this._drawTool?.canRedo()??super.canRedo()}complete(){this._completeDrawing()}_getGeometryZValue(){return this.hasZ&&this.vertices.length>0?this.vertices[0][2]:this.defaultZ}_addViewHandles(){this._addViewHandles2DOnly(),this.addHandles(this.view.on("key-down",(e=>{const{key:t,repeat:i}=e;t!==c.vertexAdd||i?t!==c.complete||i?t!==c.undo||this.interactiveUndoDisabled||i?t!==c.redo||this.interactiveUndoDisabled||i||(e.stopPropagation(),this.redo()):(e.stopPropagation(),this.undo()):(e.stopPropagation(),this._drawCompleteHandler(e)):(e.stopPropagation(),this._handleVertexAddKey(e))}),l.TOOL))}_addViewHandles2DOnly(){"2d"===this.view.type&&(this.addHandles([this.view.on("click",(e=>{e.stopPropagation()}),l.TOOL),this.view.on("pointer-down",(e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._activePointerId=e.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=v(e),"touch"===e.pointerType&&this._updateCursor())}),l.TOOL),this.view.on("pointer-move",(e=>{this._abortSnapping(),this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._cursorScreenPoint=v(e),"touch"!==e.pointerType&&this._updateCursor()}),l.TOOL),this.view.on("pointer-drag",(e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._cursorScreenPoint=v(e),this._dragEnabled&&!this._panEnabled?this._vertexAddHandler(e):this._addVertexOnPointerUp=!1)}),l.TOOL),this.view.on("pointer-up",(e=>{if(this._shouldHandlePointerEvent(e))if(this._abortSnapping(),this._activePointerId=null,this._addVertexOnPointerUp){if(!this._clickEnabled)return 1===this.vertices.length&&this.vertices.pop(),void this._drawCompleteHandler(e);this._vertexAddHandler(e)}else{const t="touch"===e.pointerType;this._updateCursor(t)}}),l.TOOL),this.view.on("drag",(e=>{this._dragEnabled&&null!=this._activePointerId&&!this._panEnabled&&e.stopPropagation()}),l.TOOL),this.view.on("drag",["Shift"],(e=>{e.stopPropagation()}),l.TOOL),this.view.on("double-click",(e=>{e.stopPropagation(),this._drawCompleteHandler(e)}),l.TOOL),this.view.on("double-click",["Control"],(e=>{e.stopPropagation(),this._drawCompleteHandler(e)}),l.TOOL),this.view.on("key-down",(e=>{const{key:t,repeat:i}=e;t!==c.pan||i||(e.stopPropagation(),this._panEnabled=!0)}),l.TOOL),this.view.on("key-up",(e=>{e.key===c.pan&&(e.stopPropagation(),this._panEnabled=!1)}),l.TOOL)]),this._addUndoRedoHandles())}_handleVertexAddKey(e){this._drawTool?this._drawTool.drawOperation.commitStagedVertex():this._cursorScreenPoint&&(this._abortSnapping(),this._vertexAddHandler(e))}_addUndoRedoHandles(){this.addHandles([this._editGeometryOperations.on("vertex-remove",(e=>{if(this.notifyChange("vertices"),"undo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new a(this.view,e.vertices[0].index,t))}})),this._editGeometryOperations.on("vertex-add",(e=>{if(this.notifyChange("vertices"),"apply"===e.operation){const e=this._committedVertices.length-1,t=new d(this.view,e,this.vertices);this.emit("vertex-add",t),t.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if("redo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new d(this.view,e.vertices[0].index,t))}}))])}async _addDrawTool(){const[{DrawTool:e},t]=await Promise.all([import("./DrawTool.js"),_()]),i=new e({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"polygon",mode:this.mode,automaticLengthMeasurementUtils:t});this.destroyed?i.destroy():(this._drawTool=i,this.view.addAndActivateTool(i),i.on("vertex-add",(e=>{if(1===e.vertices.length){const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-add",new d(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new d(t,o,r))}})),i.on("vertex-remove",(e=>{if(1===e.vertices.length){const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-remove",new a(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new a(t,o,r))}})),i.on("cursor-update",(e=>{1===e.vertices.length&&this.emit("cursor-update",new h(this.view,e.vertices[0].vertexIndex,i.getVertexCoords()))})),i.on("complete",(e=>{this.emit("draw-complete",new p(i.getVertexCoords())),this._removeDrawTool(),this.removeAllHandles()})))}_removeDrawTool(){this._drawTool&&(this.view.tools.remove(this._drawTool),this._drawTool=null)}_addVertex(e){const t=this._coordinateHelper.arrayToVector(e);this._isDuplicateOfLastVertex(t)||(this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertex(t))}_updateCursor(e=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const t=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);null==t||e||this._pushCursorVertex(t.vertex,(()=>this.emit("cursor-update",new h(this.view,this._activeComponent.vertices.length,this.vertices,null!=this._stagedVertex?new o(this._stagedVertex):null))))}_completeDrawing(){if(this._drawTool)return void this._drawTool.completeCreateOperation();if(this._activePointerId=null,this._popCursorVertex(),this._committedVertices.length<3)return;this._abortSnapping(),null!=this._snappingManager&&this._snappingManager.doneSnapping();const e=new p(this.vertices);this.emit("draw-complete",e),e.defaultPrevented||this.removeAllHandles()}};e([t()],u.prototype,"_dragEnabled",null),e([t()],u.prototype,"_clickEnabled",null),e([t({type:s})],u.prototype,"mode",void 0),u=e([i("esri.views.draw.PolygonDrawAction")],u);const m=u;export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../geometry/Point.js";import r from"./DrawAction.js";import{drawingModes as s,defaultDrawingMode as n}from"./DrawingMode.js";import{
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../geometry/Point.js";import r from"./DrawAction.js";import{drawingModes as s,defaultDrawingMode as n}from"./DrawingMode.js";import{VertexRemoveEvent as a,VertexAddEvent as d,CursorUpdateEvent as h,DrawCompleteEvent as p}from"./input/DrawEvents.js";import{ViewEventPriorities as l}from"../input/InputManager.js";import{sketchKeys as c}from"../interactive/keybindings.js";import{loadAutomaticLengthMeasurementUtils as _}from"../support/automaticLengthMeasurementUtils.js";import{createScreenPointFromEvent as v}from"../support/screenUtils.js";let u=class extends r{constructor(e){super(e),this._panEnabled=!1,this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1,this._drawTool=null,this.mode=n}initialize(){this._addViewHandles(),"3d"===this.view.type&&this.addResolvingPromise(this._addDrawTool())}destroy(){this._removeDrawTool(),this.emit("destroy")}get _clickEnabled(){return"click"===this.mode||"hybrid"===this.mode}get _dragEnabled(){return"freehand"===this.mode||"hybrid"===this.mode}undo(){this._drawTool?this._drawTool.undo():(super.undo(),this.notifyChange("vertices"))}redo(){this._drawTool?this._drawTool.redo():(super.redo(),this.notifyChange("vertices"))}canUndo(){return this._drawTool?.canUndo()??super.canUndo()}canRedo(){return this._drawTool?.canRedo()??super.canRedo()}complete(){this._completeDrawing()}_addViewHandles(){this._addViewHandles2DOnly(),this.addHandles([this.view.on("key-down",(e=>{const{key:t,repeat:i}=e;t!==c.vertexAdd||i?t!==c.complete||i?t!==c.undo||this.interactiveUndoDisabled||i?t!==c.redo||this.interactiveUndoDisabled||i||(e.stopPropagation(),this.redo()):(e.stopPropagation(),this.undo()):(e.stopPropagation(),this._drawCompleteHandler(e)):(e.stopPropagation(),this._handleVertexAddKey(e))}),l.TOOL)])}_addViewHandles2DOnly(){"2d"===this.view.type&&(this.addHandles([this.view.on("click",(e=>{e.stopPropagation()}),l.TOOL),this.view.on("pointer-down",(e=>{this._shouldHandlePointerEvent(e)&&!this._panEnabled&&(this._abortSnapping(),this._activePointerId=e.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=v(e),"touch"===e.pointerType&&this._updateCursor())}),l.TOOL),this.view.on("pointer-move",(e=>{this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._abortSnapping(),this._cursorScreenPoint=v(e),"touch"!==e.pointerType&&this._updateCursor()}),l.TOOL),this.view.on("pointer-drag",(e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._cursorScreenPoint=v(e),this._dragEnabled&&!this._panEnabled?this._vertexAddHandler(e):this._addVertexOnPointerUp=!1)}),l.TOOL),this.view.on("pointer-up",(e=>{if(this._shouldHandlePointerEvent(e))if(this._abortSnapping(),this._activePointerId=null,this._addVertexOnPointerUp){if(!this._clickEnabled)return 1===this.vertices.length&&this.vertices.pop(),void this._drawCompleteHandler(e);this._vertexAddHandler(e)}else{const t="touch"===e.pointerType;this._updateCursor(t)}}),l.TOOL),this.view.on("drag",(e=>{this._dragEnabled&&null!=this._activePointerId&&!this._panEnabled&&e.stopPropagation()}),l.TOOL),this.view.on("drag",["Shift"],(e=>{e.stopPropagation()}),l.TOOL),this.view.on("double-click",(e=>{e.stopPropagation(),this._drawCompleteHandler(e)}),l.TOOL),this.view.on("double-click",["Control"],(e=>{e.stopPropagation(),this._drawCompleteHandler(e)}),l.TOOL),this.view.on("key-down",(e=>{const{key:t,repeat:i}=e;t!==c.pan||i||(e.stopPropagation(),this._panEnabled=!0)}),l.TOOL),this.view.on("key-up",(e=>{e.key===c.pan&&(e.stopPropagation(),this._panEnabled=!1)}),l.TOOL)]),this._addUndoRedoHandles())}_handleVertexAddKey(e){this._drawTool?this._drawTool.drawOperation.commitStagedVertex():this._cursorScreenPoint&&(this._abortSnapping(),this._vertexAddHandler(e))}_addUndoRedoHandles(){this.addHandles([this._editGeometryOperations.on("vertex-remove",(e=>{if(this.notifyChange("vertices"),"undo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new a(this.view,e.vertices[0].index,t))}})),this._editGeometryOperations.on("vertex-add",(e=>{if(this.notifyChange("vertices"),"apply"===e.operation){const e=this._committedVertices.length-1,t=new d(this.view,e,this.vertices);this.emit("vertex-add",t),t.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if("redo"===e.operation){const t=[...this._committedVertices];null!=this._stagedVertex&&t.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new d(this.view,e.vertices[0].index,t))}}))])}async _addDrawTool(){const[{DrawTool:e},t]=await Promise.all([import("./DrawTool.js"),_()]),i=new e({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"polyline",mode:this.mode,automaticLengthMeasurementUtils:t});this.destroyed?i.destroy():(this._drawTool=i,this.view.addAndActivateTool(i),this.addHandles([i.on("vertex-add",(e=>{if(1!==e.vertices.length)return;const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-add",new d(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new d(t,o,r))})),i.on("vertex-remove",(e=>{if(1!==e.vertices.length)return;const{view:t}=this,o=e.vertices[0].vertexIndex,r=i.getVertexCoords();this.emit("vertex-remove",new a(t,o,r)),"undo"!==e.operation&&"redo"!==e.operation||this.emit(e.operation,new a(t,o,r))})),i.on("cursor-update",(e=>{1===e.vertices.length&&this.emit("cursor-update",new h(this.view,e.vertices[0].vertexIndex,i.getVertexCoords()))})),i.on("complete",(e=>{this.emit("draw-complete",new p(i.getVertexCoords())),this._removeDrawTool(),this.removeAllHandles()}))]))}_removeDrawTool(){this._drawTool&&(this.view.tools.remove(this._drawTool),this._drawTool=null)}_addVertex(e){const t=this._coordinateHelper.arrayToVector(e);this._isDuplicateOfLastVertex(t)||(this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertex(t))}_updateCursor(e=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const t=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);null==t||e||this._pushCursorVertex(t.vertex,(()=>this.emit("cursor-update",new h(this.view,this._activeComponent.vertices.length,this.vertices,null!=this._stagedVertex?new o(this._stagedVertex):null))))}_completeDrawing(){if(this._drawTool)return void this._drawTool.completeCreateOperation();if(this._activePointerId=null,this._popCursorVertex(),this._committedVertices.length<2)return;this._abortSnapping(),null!=this._snappingManager&&this._snappingManager.doneSnapping();const e=new p(this.vertices);this.emit("draw-complete",e),e.defaultPrevented||this.removeAllHandles()}};e([t()],u.prototype,"_clickEnabled",null),e([t()],u.prototype,"_dragEnabled",null),e([t({type:s})],u.prototype,"mode",void 0),u=e([i("esri.views.draw.PolylineDrawAction")],u);const m=u;export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import r from"../../geometry/Point.js";import{ViewingMode as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import r from"../../geometry/Point.js";import{ViewingMode as s}from"../ViewingMode.js";import o from"./DrawAction.js";import{VertexAddEvent as n,CursorUpdateEvent as a,DrawCompleteEvent as d}from"./input/DrawEvents.js";import{createViewAlignedCoordinateSystem as h}from"./support/surfaceCoordinateSystems.js";import{ViewEventPriorities as p}from"../input/InputManager.js";import{sketchKeys as l}from"../interactive/keybindings.js";import{EditGeometry as c,Component as _}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as m}from"../interactive/editGeometry/EditGeometryOperations.js";import{loadAutomaticLengthMeasurementUtils as g}from"../support/automaticLengthMeasurementUtils.js";import{createScreenPointFromEvent as u}from"../support/screenUtils.js";const v=["freehand","click"];let w=class extends o{constructor(e){super(e),this._isDragging=!1,this._panEnabled=!1,this._addVertexOnPointerUp=!1,this._drawTool=null,this.viewAlignedCoordinateSystem=null,this.mode="freehand"}initialize(){"2d"===this.view.type?this._addViewHandles():this.addResolvingPromise(this._addDrawTool())}destroy(){this._removeDrawTool(),this.emit("destroy")}complete(){this._completeDrawing()}_getGeometryZValue(){return this.hasZ&&this.vertices.length>0?this.vertices[0][2]:this.defaultZ}_addViewHandles(){"click"===this.mode?this.addHandles(this._getClickModeViewHandles()):this.addHandles(this._getDragModeViewHandles())}_getDragModeViewHandles(){return[this.view.on("immediate-click",(e=>{if(e.stopPropagation(),e.mapPoint&&!this._panEnabled){null!=this.getCoordsFromScreenPoint(u(e))&&(this._vertexAddHandler(e),this._drawCompleteHandler(e))}}),p.TOOL),this.view.on("pointer-down",(e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._panEnabled||(this._resetGeometry(),this._addVertexOnPointerUp=!0,this._cursorScreenPoint=u(e),this._activePointerId=e.pointerId,this._vertexAddHandler(e),this._isDragging=!1,"touch"===e.pointerType&&this._updateCursor()))}),p.TOOL),this.view.on("pointer-move",(e=>{this._abortSnapping(),null==this._activePointerId&&"touch"!==e.pointerType&&(this._cursorScreenPoint=u(e),this._updateCursor())}),p.TOOL),this.view.on("pointer-drag",(e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._isDragging=!0,this._cursorScreenPoint=u(e),this._updateCursor())}),p.TOOL),this.view.on("pointer-up",(e=>{this._shouldHandlePointerEvent(e)&&this._addVertexOnPointerUp&&(this._abortSnapping(),this._activePointerId=null,this._isDragging&&this._vertexAddHandler(e),2===this._committedVertices.length&&this._drawCompleteHandler(e),this._isDragging=!1)}),p.TOOL),this.view.on("key-down",(e=>{e.key===l.complete&&this._cursorScreenPoint?(this._abortSnapping(),this._vertexAddHandler(e),this._drawCompleteHandler(e)):e.key===l.pan&&(this._panEnabled=!0)}),p.TOOL),this.view.on("key-up",(e=>{e.key===l.pan&&(this._panEnabled=!1)}),p.TOOL),this.view.on("drag",(e=>{null!=this._activePointerId&&e.stopPropagation()}),p.TOOL),this.view.on("drag",["Shift"],(e=>{e.stopPropagation()}),p.TOOL)]}_getClickModeViewHandles(){return[this.view.on("pointer-down",(e=>{this._abortSnapping(),this._cursorScreenPoint=u(e),this._activePointerId=e.pointerId,this._isDragging=!1,"touch"===e.pointerType&&this._updateCursor()}),p.TOOL),this.view.on("pointer-move",(e=>{this._abortSnapping(),this._cursorScreenPoint=u(e),null==this._activePointerId&&"touch"!==e.pointerType&&this._updateCursor()}),p.TOOL),this.view.on("pointer-drag",(e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._isDragging=!0)}),p.TOOL),this.view.on("pointer-up",(e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._activePointerId=null,e.stopPropagation(),this._isDragging||this._vertexAddHandler(e),2!==this.vertices.length||this._isDragging||this._drawCompleteHandler(e),this._isDragging=!1)}),p.TOOL),this.view.on("key-down",(e=>{e.key===l.vertexAdd&&this._cursorScreenPoint&&(this._vertexAddHandler(e),2===this.vertices.length&&this._drawCompleteHandler(e)),e.key===l.complete&&this._cursorScreenPoint&&2===this.vertices.length&&(this._vertexAddHandler(e),this._drawCompleteHandler(e))}),p.TOOL)]}async _addDrawTool(){const[{DrawTool:e},t]=await Promise.all([import("./DrawTool.js"),g()]),i=new e({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"segment",mode:this.mode,automaticLengthMeasurementUtils:t});this.destroyed?i.destroy():(this._drawTool=i,this.view.addAndActivateTool(i),this.addHandles([i.on("vertex-add",(e=>{1===e.vertices.length&&this.emit("vertex-add",new n(this.view,e.vertices[0].vertexIndex,i.getVertexCoords()))})),i.on("cursor-update",(e=>{1===e.vertices.length&&this.emit("cursor-update",new a(this.view,e.vertices[0].vertexIndex,i.getVertexCoords()))})),i.on("complete",(e=>{this.emit("draw-complete",new d(i.getVertexCoords())),this._removeDrawTool()})),this.view.on("key-down",(e=>{e.key!==l.vertexAdd||e.repeat||"click"!==this.mode?e.key!==l.complete||e.repeat||i.completeCreateOperation():i.drawOperation.numCommittedVertices>0?i.completeCreateOperation():i.drawOperation.commitStagedVertex()}),p.TOOL)]))}_removeDrawTool(){this._drawTool&&(this.view.tools.remove(this._drawTool),this._drawTool=null)}_addVertex(e){const t=this._coordinateHelper.arrayToVector(e);if(this._isDuplicateOfLastVertex(t))return;this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertex(t),1===this._committedVertices.length&&(this.viewAlignedCoordinateSystem=h(this.view,this._committedVertices[0]));const i=this._committedVertices.length-1,r=new n(this.view,i,this.vertices);this.emit("vertex-add",r)}_updateCursor(){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const e=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);null!=e&&this._pushCursorVertex(e.vertex,(()=>this.emit("cursor-update",new a(this.view,this._activeComponent.vertices.length,this.vertices,null!=this._stagedVertex?new r(this._stagedVertex):null))))}_completeDrawing(){if(this._drawTool)return this._drawTool.completeCreateOperation(),void this.removeAllHandles();if(this._activePointerId=null,this._popCursorVertex(),this._cursorScreenPoint=null,this._isDragging=!1,this._abortSnapping(),null!=this._snappingManager&&this._snappingManager.doneSnapping(),this.vertices.length<1)return;const e=new d(this.vertices);this.emit("draw-complete",e),e.defaultPrevented||this.removeAllHandles()}_resetGeometry(){this._editGeometryOperations.destroy(),this._editGeometryOperations=new m(new c("polygon",this._coordinateHelper),s.Local),this._activeComponent=new _(this._coordinateHelper.spatialReference,s.Local),this._editGeometryOperations.data.components.push(this._activeComponent)}};e([t({type:v})],w.prototype,"mode",void 0),w=e([i("esri.views.draw.SegmentDrawAction")],w);const y=w;export{y as default};
|