@arcgis/core 5.2.0-next.156 → 5.2.0-next.158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/LineOfSightAnalysis.d.ts +49 -32
- package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
- package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
- package/analysis/Viewshed.d.ts +23 -3
- package/analysis/ViewshedAnalysis.d.ts +33 -13
- package/arcade/geometry/operatorsWorkerConnection.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{820c8aaf3632edb0150c.js → 0a5a9885ee6f5b5f99f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{7bcedf479b07a4b4a234.js → 1419bf346978b81b08cc.js} +1 -1
- package/assets/esri/core/workers/chunks/2cb209bc51a19487692d.js +2 -0
- package/assets/esri/core/workers/chunks/2e66c969bf4209c957b5.js +2 -0
- package/assets/esri/core/workers/chunks/{925271bb763607a326ae.js → 2f04b8679c9f15390517.js} +1 -1
- package/assets/esri/core/workers/chunks/31640b41e0ecdff892fa.js +2 -0
- package/assets/esri/core/workers/chunks/{2ef5237e4c876d6a4ee0.js → 340256866f524cb069f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{6079d27f4ab319fb8f0c.js → 377595b23379b0c8fe95.js} +1 -1
- package/assets/esri/core/workers/chunks/{be5f92e98d09d6e6e38e.js → 4bb1bb3ffb1b71bc43c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{c5ed67fdf261cbb1624b.js → 4be559c53fe5ac0d0d2e.js} +1 -1
- package/assets/esri/core/workers/chunks/4e6656a5f29e31902fca.js +2 -0
- package/assets/esri/core/workers/chunks/{1aa4f5394a596e544aeb.js → 4eae066673484986d4c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{5f4feca26102088ea565.js → 60737732ce495bbdd0fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{67ebc5a3d46b254b725c.js → 612345f17f5eeb99ea8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{544070198d2ca556103a.js → 6a0ec102962d2c7b4368.js} +1 -1
- package/assets/esri/core/workers/chunks/6a2562cc00727155fc01.js +1 -0
- package/assets/esri/core/workers/chunks/784d6c6949284ed6e10b.js +1 -0
- package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js → 844eedda8f749972f707.js} +2 -2
- package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
- package/assets/esri/core/workers/chunks/{d2347d6aa1c57fd57029.js → 8ff23ac0abeea0073b47.js} +1 -1
- package/assets/esri/core/workers/chunks/9215b59c5ccecf9add58.js +1 -0
- package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec8b7476eac4718eb0ac.js → a504a5e06cb89a620799.js} +1 -1
- package/assets/esri/core/workers/chunks/a53823cf03dbdce1aecd.js +1 -0
- package/assets/esri/core/workers/chunks/{a556dd4e9e6d35e33a2c.js → a546ec82ba149e12f7bf.js} +1 -1
- package/assets/esri/core/workers/chunks/{4a640548032355e57acd.js → ab6506a3c16f8717fc00.js} +1 -1
- package/assets/esri/core/workers/chunks/{de6081df29183bf80787.js → ade5fdcd08dcbac74740.js} +1 -1
- package/assets/esri/core/workers/chunks/ba38231193919e093917.js +1 -0
- package/assets/esri/core/workers/chunks/{3f776d9fd2ab68b21fca.js → bbd44ac63d2a317d8ed9.js} +1 -1
- package/assets/esri/core/workers/chunks/be308db5b61a7246edfe.js +1 -0
- package/assets/esri/core/workers/chunks/cb4be68cc5085d421615.js +1 -0
- package/assets/esri/core/workers/chunks/{10445313d0d57b34511b.js → d53cc574a21031436c45.js} +1 -1
- package/assets/esri/core/workers/chunks/d6cd0039d6e9c40961e3.js +1 -0
- package/assets/esri/core/workers/chunks/dc51dcaa4e2f9a90f5bd.js +2 -0
- package/assets/esri/core/workers/chunks/f63686735e4e52f5b54e.js +1 -0
- package/assets/esri/core/workers/chunks/{b573df59391ca41ee5a7.js → fc73737b41e086f0ce0b.js} +1 -1
- package/assets/esri/core/workers/chunks/{3914d96147642a9d4b01.js → ffbcb816b611049a6276.js} +1 -1
- package/assets/esri/themes/base/widgets/_Weather.scss +1 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ar.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.bg.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.bs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ca.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.cs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.da.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.de.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.el.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.es.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.et.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.fi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.fr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.he.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.hr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.hu.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.id.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.it.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ja.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ko.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.lt.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.lv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.nl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.no.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ro.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ru.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.th.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.tr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.uk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.vi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.zh-TW.json +1 -1
- package/config.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +9 -0
- package/form/elements.d.ts +46 -8
- package/form/elements.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/kernel.js +1 -1
- package/layers/GeoJSONLayer.d.ts +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/LineOfSightLayer.d.ts +10 -8
- package/layers/ViewshedLayer.d.ts +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +2 -2
- package/layers/raster/datasets/InMemoryRaster.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/layers/support/layerOriginUtils.js +1 -1
- package/package.json +3 -3
- package/popup/FeaturesModel.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -3
- package/time/TimeExtent.d.ts +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +7 -0
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/interactive/options/TooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
- package/views/interactive/snapping/SnappingManagerPool.js +1 -1
- package/views/interactive/snapping/allLayerSnapping.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +35 -13
- package/views/layers/SketchLayerView.d.ts +1 -0
- package/views/layers/ViewshedLayerView.d.ts +36 -12
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +2 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +2 -0
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +2 -1
- package/widgets/Expand/ExpandViewModel.d.ts +2 -0
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.d.ts +3 -1
- package/widgets/Home/HomeViewModel.d.ts +2 -0
- package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +3 -0
- package/widgets/ScaleRangeSlider/types.d.ts +3 -3
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Swipe/SwipeViewModel.d.ts +2 -0
- package/widgets/Swipe/types.d.ts +9 -2
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +9 -5
- package/widgets/TimeSlider/types.d.ts +7 -0
- package/widgets/TimeSlider.d.ts +2 -3
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Track/TrackViewModel.d.ts +4 -0
- package/widgets/Track/types.d.ts +1 -0
- package/widgets/support/Selector3D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/1b946714ca4a1a7359d4.js +0 -2
- package/assets/esri/core/workers/chunks/22b01fe31bbf0bdc48db.js +0 -1
- package/assets/esri/core/workers/chunks/27c2da2e779def2ee08b.js +0 -1
- package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +0 -2
- package/assets/esri/core/workers/chunks/34570e6bbf559f18c1a5.js +0 -1
- package/assets/esri/core/workers/chunks/5566f14afb63065e438f.js +0 -1
- package/assets/esri/core/workers/chunks/68d8ae42ab71d01a70a5.js +0 -2
- package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +0 -1
- package/assets/esri/core/workers/chunks/8dc1c3042267618fd710.js +0 -2
- package/assets/esri/core/workers/chunks/96c50a0dda0f1503ef92.js +0 -2
- package/assets/esri/core/workers/chunks/bac8c32665e982896ecc.js +0 -1
- package/assets/esri/core/workers/chunks/d9b1aed88b205689cec6.js +0 -1
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +0 -1
- package/assets/esri/core/workers/chunks/f4f9d08b2df856e3b694.js +0 -1
- /package/assets/esri/core/workers/chunks/{1b946714ca4a1a7359d4.js.LICENSE.txt → 2cb209bc51a19487692d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{8dc1c3042267618fd710.js.LICENSE.txt → 2e66c969bf4209c957b5.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{96c50a0dda0f1503ef92.js.LICENSE.txt → 31640b41e0ecdff892fa.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2a1ec30f9ad305763f81.js.LICENSE.txt → 4e6656a5f29e31902fca.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js.LICENSE.txt → 844eedda8f749972f707.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{68d8ae42ab71d01a70a5.js.LICENSE.txt → dc51dcaa4e2f9a90f5bd.js.LICENSE.txt} +0 -0
|
@@ -13,9 +13,10 @@ import type { LineOfSightPlacementOptions, LineOfSightPlacementResult } from "./
|
|
|
13
13
|
* The LineOfSightAnalysisView3D is responsible for rendering a [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/)
|
|
14
14
|
* using custom visualizations.
|
|
15
15
|
*
|
|
16
|
-
* It allows to create an observer and
|
|
16
|
+
* It allows to create an observer and targets interactively using the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#place) method, query analysis [results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#results),
|
|
17
17
|
* or make an existing analysis editable by enabling the [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) property.
|
|
18
18
|
*
|
|
19
|
+
*
|
|
19
20
|
* The view for an analysis can be retrieved using [SceneView.whenAnalysisView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenAnalysisView)
|
|
20
21
|
* similar to how layer views are retrieved for layers using [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView).
|
|
21
22
|
*
|
|
@@ -26,11 +27,22 @@ import type { LineOfSightPlacementOptions, LineOfSightPlacementResult } from "./
|
|
|
26
27
|
* const analysisView = await view.whenAnalysisView(analysis);
|
|
27
28
|
* ```
|
|
28
29
|
*
|
|
30
|
+
* > [!WARNING]
|
|
31
|
+
* >
|
|
32
|
+
* > **Things to consider:**
|
|
33
|
+
* > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
34
|
+
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
35
|
+
* > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
36
|
+
* > * Layer types currently supported for snapping are: [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/) (except Mesh geometries),
|
|
37
|
+
* > [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/),
|
|
38
|
+
* > [3D Object SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), and [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/).
|
|
39
|
+
*
|
|
29
40
|
* @see [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/)
|
|
30
41
|
* @see [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/)
|
|
31
42
|
* @see [LineOfSightLayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/)
|
|
32
|
-
* @see [LineOfSightAnalysisTarget](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/)
|
|
33
43
|
* @see [LineOfSightAnalysisObserver](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/)
|
|
44
|
+
* @see [LineOfSightAnalysisTarget](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/)
|
|
45
|
+
* @see [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/)
|
|
34
46
|
* @see [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/)
|
|
35
47
|
* @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/)
|
|
36
48
|
* @see [Sample - Line of sight component](https://developers.arcgis.com/javascript/latest/sample-code/line-of-sight/)
|
|
@@ -44,10 +56,12 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
44
56
|
*/
|
|
45
57
|
get analysis(): LineOfSightAnalysis;
|
|
46
58
|
/**
|
|
47
|
-
* Enables interactivity for the
|
|
48
|
-
*
|
|
49
|
-
* [LineOfSightAnalysis.
|
|
50
|
-
*
|
|
59
|
+
* Enables interactivity for the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis).
|
|
60
|
+
* When set to `true`, and the analysis includes a valid [LineOfSightAnalysis.observer](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/#observer) and any
|
|
61
|
+
* [LineOfSightAnalysis.targets](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/#targets), they become selectable and editable.
|
|
62
|
+
*
|
|
63
|
+
* Targets can be removed by right-clicking on them or with the `Delete` key.
|
|
64
|
+
* The observer and the last target cannot be deleted interactively.
|
|
51
65
|
*
|
|
52
66
|
* This property is automatically set to `true` when the analysis is assigned to a
|
|
53
67
|
* [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/).
|
|
@@ -76,8 +90,13 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
76
90
|
*/
|
|
77
91
|
get results(): Collection<LineOfSightAnalysisResult | null | undefined>;
|
|
78
92
|
/**
|
|
79
|
-
* The observer or target currently selected for interactive editing.
|
|
80
|
-
*
|
|
93
|
+
* The observer or target currently selected for interactive editing.
|
|
94
|
+
*
|
|
95
|
+
* When [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) is `true`, any observer or target in the
|
|
96
|
+
* [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis) can be selected
|
|
97
|
+
* and its properties can be edited by interacting with the manipulators in the view.
|
|
98
|
+
*
|
|
99
|
+
* Use the item's `type` property to determine whether it is an observer or a target.
|
|
81
100
|
*
|
|
82
101
|
* @since 5.2
|
|
83
102
|
* @example
|
|
@@ -111,7 +130,7 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
111
130
|
get visible(): boolean;
|
|
112
131
|
set visible(value: boolean | null | undefined);
|
|
113
132
|
/**
|
|
114
|
-
* Starts the interactive placement of an observer and
|
|
133
|
+
* Starts the interactive placement of an observer and targets on the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis).
|
|
115
134
|
*
|
|
116
135
|
* If the analysis does not have a valid observer yet, this method will allow placing an observer, which can be followed
|
|
117
136
|
* by zero or more targets. Otherwise, if it already has a valid observer, it will allow placing targets. An observer
|
|
@@ -123,9 +142,13 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
123
142
|
* The promise resolves when the operation is productive, i.e. an observer or any targets were added.
|
|
124
143
|
* Otherwise, if nothing was added or signal was aborted, the promise is rejected.
|
|
125
144
|
*
|
|
145
|
+
* By default, the observer and targets are created at absolute height.
|
|
146
|
+
* Optionally, by specifying the options of the method,
|
|
147
|
+
* you can change the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/).
|
|
148
|
+
*
|
|
126
149
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) to `true`.
|
|
127
150
|
*
|
|
128
|
-
* @param options - An object specifying additional options.
|
|
151
|
+
* @param options - An object specifying additional placement options, including elevation information and an abort signal.
|
|
129
152
|
* @returns A promise
|
|
130
153
|
* which resolves when the operation is completed successfully - i.e. the user places an observer and/or target(s),
|
|
131
154
|
* leaving the analysis in a valid state. Otherwise, the promise is rejected.
|
|
@@ -135,11 +158,14 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
135
158
|
*
|
|
136
159
|
* try {
|
|
137
160
|
* await analysisView.place({
|
|
138
|
-
*
|
|
139
|
-
*
|
|
161
|
+
* signal: abortController.signal,
|
|
162
|
+
* // optional elevation info
|
|
163
|
+
* elevationInfo: { mode: "relative-to-ground", offset: 1.5 },
|
|
140
164
|
* });
|
|
141
165
|
* } catch (error) {
|
|
142
|
-
*
|
|
166
|
+
* if (error.name === "AbortError") {
|
|
167
|
+
* console.log("Placement operation was cancelled.");
|
|
168
|
+
* }
|
|
143
169
|
* }
|
|
144
170
|
*
|
|
145
171
|
* // cancel the placement operation at some later point
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquireForFeaturePlacement as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),setSelectedViewshed:e=>{this.analysisViewData.selectedViewshed=e}}}),p(this),this.addHandles([r(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive}),({creationState:n,interactive:r})=>{if(!r){this._placementController.cancelPlaceOperation(),this._destroyEditTool();return}if(n!=null){this._destroyEditTool();return}this._editTool||(this._editTool=new l({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e}),e.tools.add(this._editTool))},i),this._updatingHandles.add(()=>e.activeTool,e=>{e!=null&&e!==this._editTool&&this._placementController.creationState==null&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),n(this._placementController),this._updatingHandles.destroy()}get selectedViewshedComputedData(){return this._editTool?.selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._updatingHandles.updating||this._placementController.updating||!!this._editTool?.updating}get creating(){return this._placementController.creationState!=null}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}async place(e,t){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(e,t),e===`single`)return{}}_findViewshedComputedData(e){return this.analysisViewData.viewshedComputedDataHandles?.find(t=>t.viewshedComputedData.viewshed===e)?.viewshedComputedData}_destroyEditTool(){let e=this._editTool;this._editTool=null,e!=null&&(c(this.view,e),n(e))}get test(){}};e([a({constructOnly:!0})],m.prototype,`view`,void 0),e([a({constructOnly:!0})],m.prototype,`analysis`,void 0),e([a({constructOnly:!0})],m.prototype,`analysisViewData`,void 0),e([a()],m.prototype,`_placementController`,void 0),e([a()],m.prototype,`_editTool`,void 0),e([a()],m.prototype,`_snappingManagerResult`,void 0),e([a()],m.prototype,`selectedViewshedComputedData`,null),e([a()],m.prototype,`stagedViewshed`,null),e([a()],m.prototype,`active`,null),e([a()],m.prototype,`updating`,null),e([a()],m.prototype,`creating`,null),e([a()],m.prototype,`snappingOptions`,null),m=e([o(`esri.views.3d.analysis.Viewshed.ViewshedTool`)],m);const h=m;export{h as default};
|
|
@@ -12,6 +12,13 @@ export interface ViewshedPlacementOptions extends AbortOptions {
|
|
|
12
12
|
* Specifies how the placed viewshed observer is positioned on the vertical axis (z).
|
|
13
13
|
* Accepts an [ElevationInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/) instance or a plain object with elevation information properties.
|
|
14
14
|
*
|
|
15
|
+
* If no elevation info is provided and the [Viewshed.observer](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/#observer) has a [z-value](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/#hasZ),
|
|
16
|
+
* it is treated as an absolute value.
|
|
17
|
+
*
|
|
18
|
+
* > [!WARNING]
|
|
19
|
+
* >
|
|
20
|
+
* > [ElevationInfo.featureExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/#featureExpressionInfo) is not supported when the elevation info is specified for viewsheds.
|
|
21
|
+
*
|
|
15
22
|
* @since 5.2
|
|
16
23
|
*/
|
|
17
24
|
elevationInfo?: ElevationInfo | ElevationInfoProperties | null;
|
|
@@ -12,10 +12,7 @@ import type { ViewshedPlacementOptions, ViewshedPlacementResult } from "./Viewsh
|
|
|
12
12
|
*
|
|
13
13
|
* It allows to create new viewsheds interactively using the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#place) method,
|
|
14
14
|
* or to make existing viewsheds selectable and editable by enabling the [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#interactive) property.
|
|
15
|
-
* To select a viewshed, hover and click on its
|
|
16
|
-
*
|
|
17
|
-
* Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
18
|
-
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
15
|
+
* To select a viewshed, hover and click on its observer.
|
|
19
16
|
*
|
|
20
17
|
* The view for an analysis can be retrieved using [SceneView.whenAnalysisView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenAnalysisView)
|
|
21
18
|
* similar to how layer views are retrieved for layers using [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView).
|
|
@@ -29,11 +26,22 @@ import type { ViewshedPlacementOptions, ViewshedPlacementResult } from "./Viewsh
|
|
|
29
26
|
* const analysisView = await view.whenAnalysisView(analysis);
|
|
30
27
|
* ```
|
|
31
28
|
*
|
|
29
|
+
* > [!WARNING]
|
|
30
|
+
* >
|
|
31
|
+
* > **Things to consider:**
|
|
32
|
+
* > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
33
|
+
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
34
|
+
* > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
35
|
+
* > * Layer types currently supported for snapping are: [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/) (except Mesh geometries),
|
|
36
|
+
* > [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/),
|
|
37
|
+
* > [3D Object SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), and [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/).
|
|
38
|
+
*
|
|
32
39
|
* @since 4.30
|
|
33
40
|
* @see [ViewshedAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/)
|
|
34
41
|
* @see [Viewshed](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/)
|
|
35
42
|
* @see [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/)
|
|
36
43
|
* @see [ViewshedLayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/)
|
|
44
|
+
* @see [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/)
|
|
37
45
|
* @see [Sample - Interactive viewshed analysis](https://developers.arcgis.com/javascript/latest/sample-code/analysis-viewshed/)
|
|
38
46
|
* @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/)
|
|
39
47
|
* @see [3D viewshed overview](https://developers.arcgis.com/documentation/spatial-analysis-services/3d-visual/3d-viewshed/)
|
|
@@ -43,17 +51,21 @@ export default abstract class ViewshedAnalysisView3D extends AnalysisView3D {
|
|
|
43
51
|
/** The viewshed analysis object associated with the analysis view. */
|
|
44
52
|
get analysis(): ViewshedAnalysis;
|
|
45
53
|
/**
|
|
46
|
-
* Enables interactivity for the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#analysis).
|
|
47
|
-
* valid [ViewshedAnalysis.viewsheds](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/#viewsheds),
|
|
54
|
+
* Enables interactivity for the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#analysis).
|
|
55
|
+
* When set to `true` and the analysis includes any valid [ViewshedAnalysis.viewsheds](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/#viewsheds),
|
|
56
|
+
* they become selectable and editable.
|
|
57
|
+
*
|
|
58
|
+
* Viewsheds can be removed with the `Delete` key.
|
|
48
59
|
*
|
|
49
60
|
* @default false
|
|
50
61
|
*/
|
|
51
62
|
accessor interactive: boolean;
|
|
52
63
|
/**
|
|
53
|
-
* The
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
64
|
+
* The viewshed currently selected for interactive editing.
|
|
65
|
+
*
|
|
66
|
+
* When [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#interactive) is `true`, any viewshed in the
|
|
67
|
+
* [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#analysis) can be selected
|
|
68
|
+
* and its properties can be edited by interacting with the manipulators in the view.
|
|
57
69
|
*/
|
|
58
70
|
accessor selectedViewshed: Viewshed | null | undefined;
|
|
59
71
|
/** The analysis view type. */
|
|
@@ -71,34 +83,46 @@ export default abstract class ViewshedAnalysisView3D extends AnalysisView3D {
|
|
|
71
83
|
*
|
|
72
84
|
* This method is similar to the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#place) method, but it allows to create multiple viewsheds in a row.
|
|
73
85
|
*
|
|
86
|
+
* By default, the observer is created at absolute height.
|
|
87
|
+
* Optionally, by specifying the options of the method,
|
|
88
|
+
* you can change the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/).
|
|
89
|
+
*
|
|
74
90
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#interactive) to `true`.
|
|
75
91
|
*
|
|
76
|
-
* @param options - An object specifying additional options.
|
|
92
|
+
* @param options - An object specifying additional placement options, including elevation information and an abort signal.
|
|
77
93
|
* @returns A promise which resolves when creation is completed successfully or rejected if it is
|
|
78
94
|
* canceled.
|
|
79
95
|
* @example
|
|
80
96
|
* const abortController = new AbortController();
|
|
81
97
|
*
|
|
82
98
|
* try {
|
|
83
|
-
*
|
|
99
|
+
* await analysisView.createViewsheds({
|
|
100
|
+
* signal: abortController.signal,
|
|
101
|
+
* // optional elevation info
|
|
102
|
+
* elevationInfo: { mode: "relative-to-ground", offset: 1.5 },
|
|
103
|
+
* });
|
|
84
104
|
* } catch (error) {
|
|
85
105
|
* if (error.name === "AbortError") {
|
|
86
106
|
* console.log("Creation operation was cancelled.");
|
|
87
107
|
* }
|
|
88
108
|
* }
|
|
89
109
|
*
|
|
90
|
-
* // cancel the
|
|
110
|
+
* // cancel the creation operation at some later point
|
|
91
111
|
* abortController.abort();
|
|
92
112
|
*/
|
|
93
113
|
createViewsheds(options?: ViewshedPlacementOptions | null | undefined): Promise<void>;
|
|
94
114
|
/**
|
|
95
115
|
* Starts the interactive placement of a single viewshed, adding it to the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#analysis).
|
|
96
116
|
*
|
|
97
|
-
* The first click in the scene places the observer point and the second sets the viewshed's orientation.
|
|
117
|
+
* The first click in the scene places the observer point and the second sets the viewshed's orientation and distance.
|
|
98
118
|
*
|
|
99
119
|
* The placement operation will finish when the user presses the escape key.
|
|
100
120
|
* To stop the placing programmatically, pass an abort signal as an argument when calling the method.
|
|
101
121
|
*
|
|
122
|
+
* By default, the observer is created at absolute height.
|
|
123
|
+
* Optionally, by specifying the options of the method,
|
|
124
|
+
* you can change the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/).
|
|
125
|
+
*
|
|
102
126
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#interactive) to `true`.
|
|
103
127
|
*
|
|
104
128
|
* @param options - An object specifying additional options.
|
|
@@ -109,7 +133,11 @@ export default abstract class ViewshedAnalysisView3D extends AnalysisView3D {
|
|
|
109
133
|
* const abortController = new AbortController();
|
|
110
134
|
*
|
|
111
135
|
* try {
|
|
112
|
-
*
|
|
136
|
+
* await analysisView.place({
|
|
137
|
+
* signal: abortController.signal,
|
|
138
|
+
* // optional elevation info
|
|
139
|
+
* elevationInfo: { mode: "relative-to-ground", offset: 1.5 },
|
|
140
|
+
* });
|
|
113
141
|
* } catch (error) {
|
|
114
142
|
* if (error.name === "AbortError") {
|
|
115
143
|
* console.log("Placement operation was cancelled.");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import n from"../../../../core/Accessor.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{ignoreAbortErrors as i,isAborted as a}from"../../../../core/promiseUtils.js";import{pausable as o,sync as s,watch as c,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../layers/GraphicsLayer.js";import m from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as h,isPolygonGraphic as g}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as _}from"./VolumeMeasurementShiftTool.js";import{ExclusiveOperationManager as v}from"../../../analysis/ExclusiveOperationManager.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import n from"../../../../core/Accessor.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{ignoreAbortErrors as i,isAborted as a}from"../../../../core/promiseUtils.js";import{pausable as o,sync as s,watch as c,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../layers/GraphicsLayer.js";import m from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as h,isPolygonGraphic as g}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as _}from"./VolumeMeasurementShiftTool.js";import{ExclusiveOperationManager as v}from"../../../analysis/ExclusiveOperationManager.js";import{makeGeometryAnalysisSnappingOptions as y}from"../../../interactive/snapping/allLayerSnapping.js";import b from"../../../../widgets/Sketch/SketchViewModel.js";let x=class extends n{constructor(e){super(e),this._updatingHandles=new f,this._operationManager=new v,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){let{analysis:e,viewData:t,view:n}=this;this._graphicsLayer=new p({listMode:`hide`,internal:!0,elevationInfo:{mode:`on-the-ground`}});let r=y(n);this._externalGeometryChangeHandle=o(()=>this.analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),s),this._sketchViewModel=new b({layer:this._graphicsLayer,view:n,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:`move`},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:`reshape`},polygonSymbol:this._polygonSymbol,snappingOptions:r.options}),this.addHandles([this._sketchViewModel.on([`undo`,`redo`],this._onUndoRedo),c(()=>({map:n.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:n})=>{switch(C(e,t),n){case`idle`:case`reshaping-disabled`:this._operationManager.stop(),this._graphicsLayer.removeAll(),this._ensureUpdatedSketchGraphic();break;case`reshaping`:i(this._startReshape());break;case`awaiting-sketch`:this.viewData.interactive=!0}},l),r,this._externalGeometryChangeHandle]),this._shiftTool=new _({analysis:e,view:n,analysisViewData:t}),this.addHandles(this._shiftTool.on(`record-undo`,e=>{let t=this._sketchViewModel.activeComponent;t?.type===`reshape-3d`&&t.recordUndo(e.apply,e.undo)})),n.tools.add(this._shiftTool),this.addHandles({remove:()=>n.tools.remove(this._shiftTool)})}destroy(){this._operationManager.destroy(),this._sketchViewModel.destroy();let e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get(`sketchGraphic`)}set sketchGraphic(e){e!==this._get(`sketchGraphic`)&&(this._set(`sketchGraphic`,e),this._updateGeometryFromSketchGraphic())}get state(){let{geometry:e}=this.analysis,{interactive:t,visible:n}=this.viewData;return n?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?`sketching`:`awaiting-sketch`:e?t?`reshaping`:`reshaping-disabled`:`idle`:`idle`}get updating(){return this._sketchViewModel.updating||this._shiftTool.updating||this._updatingHandles.updating}get _polygonSymbol(){return new m({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._operationManager.start(`place`,async t=>{let n=this.analysis.clone();this._ensureUpdatedSketchGraphic();let i=this._sketchViewModel.on(`create`,e=>{switch(e.state){case`start`:this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic;break;case`active`:this._updateGeometryFromSketchGraphic();break;case`complete`:this._updateGeometryFromSketchGraphic(),t.stop();break;case`cancel`:t.stop()}});t.handles.push(i,r(()=>{if(i.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),!this.analysis.valid)return this._clearGeometry(),t.reject();if(a(e)||n.equals(this.analysis))return t.reject();t.resolve({})})),await this._updatingHandles.addPromise(this._sketchViewModel.create(`polygon`))},e)}_startReshape(){return this._operationManager.start(`reshape`,async e=>{let t=()=>{let e=this._ensureUpdatedSketchGraphic();return e?(this._graphicsLayer.removeAll(),this._graphicsLayer.add(e),this._updatingHandles.addPromise(this._sketchViewModel.update(e,{tool:`reshape`}))):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;let n=this._sketchViewModel.on(`update`,n=>{this._updateGeometryFromSketchGraphic(),n.state===`complete`&&(this.state===`reshaping`?i(t()):e.resolve())});e.handles.push(n,r(()=>{n.remove(),this._sketchViewModel.cancel(),e.resolve()})),await t()})}_ensureUpdatedSketchGraphic(){let{geometry:e}=this.analysis;return h(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){this._externalGeometryChangeHandle.pause();let e=this.sketchGraphic;this.analysis.geometry=g(e)?e.geometry:null,this._externalGeometryChangeHandle.resume()}get test(){}};e([u({constructOnly:!0})],x.prototype,`viewData`,void 0),e([u({constructOnly:!0})],x.prototype,`view`,void 0),e([u({constructOnly:!0})],x.prototype,`analysis`,void 0),e([u()],x.prototype,`sketchGraphic`,null),e([u({nonNullable:!0})],x.prototype,`state`,null),e([u()],x.prototype,`updating`,null),e([u()],x.prototype,`_polygonSymbol`,null),x=e([d(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool`)],x);const S=x;function C(e,t){t&&(t.removeFromParent(),e?.add(t))}export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{ignoreAbortErrors as r}from"../../../../../core/promiseUtils.js";import{syncAndInitial as i,when as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import h from"./AreaMeasurement3DView.js";import{PickRequest as g}from"../support/PickRequest.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y}from"../../../../interactive/dragEventPipeline.js";import{sketchKeys as b}from"../../../../interactive/keybindings.js";import{ManipulatorCollection as x}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as S}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as w}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as T}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{ignoreAbortErrors as r}from"../../../../../core/promiseUtils.js";import{syncAndInitial as i,when as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import h from"./AreaMeasurement3DView.js";import{PickRequest as g}from"../support/PickRequest.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y}from"../../../../interactive/dragEventPipeline.js";import{sketchKeys as b}from"../../../../interactive/keybindings.js";import{ManipulatorCollection as x}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as S}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as w}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as T}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as E}from"../../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as D}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as O}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as k}from"../../../../support/screenUtils.js";let A=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this.polygonState=`initial`,this.removeIncompleteOnCancel=!1,this.manipulators=new x,this._getSnappingContext=n(e=>new w({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new C(new S(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysisViewData:t,manipulators:n,visible:o}=this;this.measurementView=new h({view:e,analysisViewData:t,toolState:this,manipulators:n,visible:o}),this._snappingOperation=new D({view:e}),this._updatingHandles.add(()=>this.stagedPoint,e=>{this.analysisViewData.stagedPoint=e==null?null:u(e,new l)},i),O(this,()=>{let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);this._updatingHandles.consumePromise(r(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}),this._setupManipulators(),this.addHandles([a(()=>this.state===`measured`,()=>this.finishToolCreation(),i),this.analysisViewData.path.on(`change`,()=>{let e=this.analysisViewData.path;this.polygonState===`initial`&&!e.isEmptyPolygon&&(this.polygonState=e.isValidPolygon?`measured`:`drawing`)})])}destroy(){this.measurementView.destroy(),this._set(`measurementView`,null),this._updatingHandles=t(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=E(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){return this.analysisViewData.path.numVertices===0?`ready`:this.analysisViewData.path.isValidPolygon&&this.polygonState!==`editing`?`measured`:`measuring`}get cursor(){return this.active?`crosshair`:null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(e){this._snappingOperation.stagedPoint=e}get snappingOptions(){return this._snappingManager?.options}finishMeasurement(){let{path:e}=this.analysisViewData;e.numVertices<=2||(e.close(),this.polygonState=`measured`,this._resetSnappingState(),this.active&&(this.view.activeTool=null))}resetCreated(){super.resetCreated(),this._resetSnappingState(),this.polygonState=`initial`,this.state===`measured`&&(this.polygonState=`measured`,this.finishToolCreation())}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(e){switch(e.type){case`immediate-double-click`:this._handleImmediateDoubleClick(e);break;case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e);break;case`drag`:this._handleDrag(e);break;case`key-down`:this._handleKeyDown(e)}}_setupManipulators(){let e=e=>e.events.on(`grab-changed`,()=>{if(this.analysisViewData.path.isValidPolygon){let e=this.manipulators.some(e=>e.manipulator.grabbing);this.polygonState=e?`editing`:`measured`}}),t=t=>{this.addHandles([y(t,(e,t,n,r)=>{let i=m(e),a=e.metadata,o=this._snappingManager,s=this._getSnappingContext(r),c=this._updatingHandles,{snappingStep:l,cancelSnapping:d}=T({snappingManager:o,snappingContext:s,updatingHandles:c});n.next(i).next(t=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(a,f),e.location=f,t)).next(d),t.next(i).next(p(this.view)).next(...l).next(t=>{e.location=t.mapEnd,this.analysisViewData.lastDraggedVertex=t.action===`end`?null:a,this.analysisViewData.path.setVertexPosition(a,u(t.mapEnd))});let f=u(this.analysisViewData.path.getVertexPositionAsPoint(a))}),e(t)],t)};this.manipulators.forEach(({manipulator:e})=>{t(e)}),this.addHandles([this.manipulators.on(`after-add`,({item:{manipulator:e}})=>{t(e)}),this.manipulators.on(`after-remove`,({item:{manipulator:e}})=>this.removeHandles(e))])}_handleImmediateDoubleClick(e){d(e)&&(this.polygonState===`drawing`&&this.finishMeasurement(),e.stopPropagation())}_handleDrag(e){this.polygonState===`editing`&&e.stopPropagation()}_handleImmediateClick(e){if(!d(e))return;let t=k(e),{pointerType:n}=e;if(this.active)switch(this.polygonState){case`initial`:case`measured`:if(this._addVertexAt(t,n)){this.stagedPoint=null,this.polygonState=`drawing`,e.stopPropagation();return}break;case`drawing`:{let r=this.measurementView.vertexHandleAt(t,n);if(r==null){if(this._addVertexAt(t,n)){this.stagedPoint=null,e.stopPropagation();return}}else r.index===0&&(this.finishMeasurement(),e.stopPropagation());break}}e.pointerType===`mouse`&&this._hoverAt(t)}_handlePointerMove(e){if(e.pointerType===`mouse`){let t=k(e);this._hoverAt(t)}}_handleKeyDown(e){let{path:t}=this.analysisViewData;(e.key===b.cancel||e.key===b.complete)&&this.polygonState===`drawing`&&t.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),e.stopPropagation())}_hoverAt(e){let{polygonState:t}=this;if(this.active&&j.has(t)){let t=this._pick(e);if(t?.mapPoint!=null){let e=this._getSnappingContext(`mouse`);this._updatingHandles.consumePromise(r(this._snappingOperation.snap({point:t.mapPoint},this._ensureSnappingManager(),e)))}}else this.stagedPoint=null}_addVertexAt(e,t){let n=this._pick(e)?.mapPoint;if(n==null)return!1;this.analysis.valid&&this.polygonState===`measured`&&(this.analysis.clear(),this._set(`created`,!1),this.polygonState=`initial`);let r=this._getSnappingContext(t),i=this._snappingOperation.update({point:n},this._ensureSnappingManager(),r),a=u(i,new l);return this.analysisViewData.path.add(a),!0}_pick(e){let t=new g(e);return this.measurementView.pick(t)}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){}};e([o()],A.prototype,`_snappingManagerResult`,void 0),e([o()],A.prototype,`_snappingManager`,null),e([o({readOnly:!0})],A.prototype,`state`,null),e([o()],A.prototype,`polygonState`,void 0),e([o({readOnly:!0})],A.prototype,`cursor`,null),e([o()],A.prototype,`measurementView`,void 0),e([o()],A.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],A.prototype,`view`,void 0),e([o({constructOnly:!0})],A.prototype,`analysis`,void 0),e([o({constructOnly:!0})],A.prototype,`analysisViewData`,void 0),e([o({readOnly:!0})],A.prototype,`manipulators`,void 0),e([o()],A.prototype,`updating`,null),e([o()],A.prototype,`stagedPoint`,null),e([o()],A.prototype,`snappingOptions`,null),A=e([s(`esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool`)],A);const j=new Set([`initial`,`drawing`,`measured`]),M=A;export{M as default};
|
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=y(e,(e,r,i,a)=>{let o=m(e),s=this._ensureSnappingManager(),c=this._getSnappingContext(a),d=this._updatingHandles,{lineState:f}=this;i=i.next(o).next(b(this,[n,t])).next(n=>{if(t!==`cursorPoint`){let n=this.analysis[t];n!=null&&(e.location=n)}return n});let h=p(this.view),g=r.next(o).next(e=>{let r=h(e);return!r&&(this.lineState===`drawing`||this.lineState===`initial`)&&(this[t]=null,this[n]=null),r});if(a!==`touch`||f===`editing`){let{snappingStep:e,cancelSnapping:t}=w({snappingManager:s,snappingContext:c,updatingHandles:d});i.next(t),g=g.next(...e)}g.next(e=>e.action===`start`?null:e).next(r=>{let i=u(r.mapEnd,new l);this[t]=i,e.location=i,this[n]=this._surfaceLocation(i,r.surfaceType)})});return t===`cursorPoint`?[r]:[r,e.events.on(`grab-changed`,()=>{let e=s.grabbing||c.grabbing;this.lineState=e?`editing`:`measured`}),this._updatingHandles.add(()=>this.analysis[t],t=>{t&&(e.location=t)})]};this.startManipulator=s,this.endManipulator=c,this.cursorManipulator=d,this.manipulators.add(s),this.manipulators.add(c),this.manipulators.add(d),this.addHandles([...f(s,`startPoint`,`startPointSurfaceLocation`),...f(c,`endPoint`,`endPointSurfaceLocation`),...f(d,`cursorPoint`,`cursorPointSurfaceLocation`),r(()=>this.state===`measured`,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},i),a(()=>({startPointAvailable:this.startPoint!=null,endPointAvailable:this.endPoint!=null}),({startPointAvailable:e,endPointAvailable:t})=>{this.startManipulator.available=e,this.endManipulator.available=t},i)]),E(this)}destroy(){this._updatingHandles=t(this._updatingHandles),this.measurementView=t(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=T(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){let{analysis:e}=this;if(e.startPoint==null&&e.endPoint==null)return`ready`;let{lineState:t}=this;return this.validMeasurement&&t!==`editing`&&t!==`drawing`?`measured`:`measuring`}get cursor(){return this.active&&(this.state===`ready`||this.lineState!==`measured`)?`crosshair`:null}get startPoint(){return this.analysis.startPoint}set startPoint(e){this.analysis.startPoint=e}get endPoint(){return this.analysis.endPoint}set endPoint(e){this.analysis.endPoint=e}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(e){this.measurementView.cursorPoint=e}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return this.analysis.startPoint!=null&&this.analysis.endPoint!=null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState=`initial`,this.cursorPoint=null,this.state===`measured`&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(e){switch(e.type){case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e)}}_handlePointerMove(e){if(!this.active||this.view.navigating)return;let{pointerType:t}=e;if(t!==`mouse`)return;let n=D(e),{lineState:r,cursorManipulator:i,endManipulator:a}=this,o=!1;this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(i,t,n),o=!0),r===`initial`&&(this._emulatedDrag?.update(n),o=!0),r===`drawing`&&(a.events.emit(`drag`,{action:`update`,start:n,screenPoint:n}),o=!0),o&&e.stopPropagation()}_handleImmediateClick(e){if(!this.active||!d(e))return;let t=D(e),{pointerType:n}=e,{cursorManipulator:r,startManipulator:i,endManipulator:a,lineState:o}=this,s=!1;switch(this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(r,n,t)),o){case`initial`:if(this._emulatedDrag?.update(t),this.cursorPoint!=null){this._emulatedDrag?.end(t),this._emulatedDrag=null,this.analysis.valid&&(this.analysis.clear(),this._set(`created`,!1));let{cursorPoint:e}=this;this.startPoint=e,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,i.location=e,i.interactive=!1,a.interactive=!1,this.lineState=`drawing`,this._emulatedDrag=k(a,n,t),s=!0}break;case`drawing`:this._emulatedDrag?.update(t),this.endPoint!=null&&(this._emulatedDrag?.end(t),this._emulatedDrag=null,i.interactive=!0,a.interactive=!0,this.lineState=`measured`,s=!0)}s&&e.stopPropagation()}_surfaceLocation(e,t){return t===0?`on-the-surface`:(e.z??0)>=this._getElevation(e)?`above-the-surface`:`below-the-surface`}_getElevation(e){return this.view.groundView?.ready?g(this.view.elevationProvider,e)??0:0}get test(){}};e([o()],O.prototype,`_snappingManagerResult`,void 0),e([o()],O.prototype,`_snappingManager`,null),e([o({readOnly:!0})],O.prototype,`state`,null),e([o()],O.prototype,`lineState`,void 0),e([o({readOnly:!0})],O.prototype,`cursor`,null),e([o()],O.prototype,`startPoint`,null),e([o()],O.prototype,`endPoint`,null),e([o()],O.prototype,`cursorPoint`,null),e([o({constructOnly:!0})],O.prototype,`analysis`,void 0),e([o({constructOnly:!0})],O.prototype,`analysisViewData`,void 0),e([o()],O.prototype,`measurementView`,void 0),e([o()],O.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],O.prototype,`view`,void 0),e([o({readOnly:!0})],O.prototype,`validMeasurement`,null),e([o({value:null})],O.prototype,`startPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`endPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`cursorPointSurfaceLocation`,void 0),e([o()],O.prototype,`updating`,null),O=e([s(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool`)],O);function k(e,t,n){return e.events.emit(`drag`,{action:`start`,pointerType:t,start:n,screenPoint:n}),{update:t=>e.events.emit(`drag`,{action:`update`,start:t,screenPoint:t}),end:t=>e.events.emit(`drag`,{action:`end`,start:t,screenPoint:t}),cancel:()=>e.events.emit(`drag`,{action:`cancel`})}}const A=O;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{destroyHandle as n,makeHandle as r}from"../../../../core/handleUtils.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{abortMaybe as a,destroyMaybe as o}from"../../../../core/maybe.js";import{debounce as s}from"../../../../core/promiseUtils.js";import{initial as c,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as d}from"../../../../core/units.js";import{property as f,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as m}from"../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{set as g,transformMat2d as _}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{ControlPointOperations as b}from"../../interactive/editingTools/media/ControlPointOperations.js";import{ViewEventPriorities as x}from"../../../input/InputManager.js";import{KeyBindings as S,mediaKeys as C}from"../../../interactive/keybindings.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{destroyHandle as n,makeHandle as r}from"../../../../core/handleUtils.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{abortMaybe as a,destroyMaybe as o}from"../../../../core/maybe.js";import{debounce as s}from"../../../../core/promiseUtils.js";import{initial as c,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as d}from"../../../../core/units.js";import{property as f,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as m}from"../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{set as g,transformMat2d as _}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{ControlPointOperations as b}from"../../interactive/editingTools/media/ControlPointOperations.js";import{ViewEventPriorities as x}from"../../../input/InputManager.js";import{KeyBindings as S,mediaKeys as C}from"../../../interactive/keybindings.js";import{acquireForFeaturePlacement as w}from"../../../interactive/snapping/SnappingManagerPool.js";const T=Symbol(),E=Symbol();let D=class extends t{get editSourcePoints(){return!!this.options?.reshapeOptions.editSourcePoints!==this._isEditSourcePointsToggled}get updating(){return this._updatingHandles.updating}get _preferredInteractionTool(){return this.options?.tool??`transform`}get _toolType(){switch(this._preferredInteractionTool){case`transform`:return`transform-3d`;case`reshape`:return`reshape-3d`}}get _validatedSelectedElement(){let e=this.selectedElement;if(!e)return null;let{layer:{source:t}}=this;return t?`hasElement`in t?t.hasElement(e)?e:null:t===e?e:null:null}constructor(e){super(e),this.enabled=!1,this._isEditSourcePointsToggled=!1,this._updatingHandles=new y,this._isOpacityToggled=!1,this._factor=1,this._tool=null,this._object=null,this._createToolAbortController=null,this._onPointerMove=s(async e=>{let t=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(E),t&&t!==this.selectedElement&&this.addHandles(this.view.acquireCursor(`pointer`,`high`),E))}),this._tmpMat2=h(),this._tmpVec2=v()}destroy(){this._createToolAbortController=a(this._createToolAbortController)}initialize(){this.addHandles([n(this._updatingHandles),this._updatingHandles.add(()=>this.enabled,e=>this._enableDisable(e),c),this._updatingHandles.add(()=>this._preferredInteractionTool,e=>this._preferredInteractionToolChanged(e))])}_enableDisable(e){if(!e){this.removeHandles(T);return}this._dynamicImports();let{view:t}=this,n=new S;n.add(C.undo,()=>{this._object?.operations?.undo(),this._object?.emit(`modified-externally`)}),n.add(C.redo,()=>{this._object?.operations?.redo(),this._object?.emit(`modified-externally`)}),n.addToggle(C.preserveAspectRatio,e=>{this._tool?.type===`transform-3d`&&(this._tool.preserveAspectRatio=e.type===`key-down`)}),n.addToggle(C.editSourcePoints,e=>{this._tool?.type===`reshape-3d`&&(this._isEditSourcePointsToggled=e.type===`key-down`)}),n.addToggle(C.rotateIncrements,e=>{this._tool?.type===`transform-3d`&&(this._tool.snapRotation=e.type===`key-down`)}),n.add(C.toggleOpacity,()=>{let e=this._object?.element;e&&(e.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),n.add(C.moveUp,()=>this._move(0,this._factor)),n.add(C.moveDown,()=>this._move(0,-this._factor)),n.add(C.moveRight,()=>this._move(this._factor,0)),n.add(C.moveLeft,()=>this._move(-this._factor,0)),n.addToggle(C.factorModifier,e=>this._factor=e.type===`key-down`?10:1),this._isOpacityToggled=!1,this.addHandles([n.register(t,x.TOOL),r(()=>{this._isOpacityToggled&&this.selectedElement&&(this.selectedElement.opacity*=2,this._isOpacityToggled=!1)}),t.on(`immediate-click`,e=>this._onClick(e),x.TOOL),t.on(`pointer-move`,e=>this._onPointerMove(e).catch(()=>{}),x.TOOL),this._updatingHandles.add(()=>this._validatedSelectedElement,(e,t)=>{t&&e!==t&&this._isOpacityToggled&&(t.opacity*=2,this._isOpacityToggled=!1),this._selectedElementChanged(e)},c),r(()=>{this.removeHandles(E),this._removeTool()})],T)}async _onClick(e){await this._updatingHandles.addPromise(e.defer(async()=>{let t=await this._findElementAtScreenPoint(e);this.destroyed||(t&&e.stopPropagation(),this.selectedElement=t,this.selectedElement&&this.removeHandles(E))}))}async _selectedElementChanged(e){if(!e?.georeference){this._removeTool();return}this._object?.element!==e&&await this._updatingHandles.addPromise(this._recreateTool())}async _recreateTool(){this._createToolAbortController=a(this._createToolAbortController),this._removeTool();let e=this._validatedSelectedElement;if(!e)return;let t=new AbortController;this._createToolAbortController=t;let{ManipulatedObject3DMediaElement:n,ExtentTransformTool:i,ReshapeTool3D:s}=await this._dynamicImports();if(t.signal.aborted)return;let{view:c,layer:d,_toolType:f}=this;switch(this._object=new n({view:c,layer:d,element:e,tool:this._preferredInteractionTool}),f){case`transform-3d`:this._tool=new i({view:c,object:this._object}),c.inputManager.isModifierKeyDown(C.rotateIncrements.key)&&(this._tool.snapRotation=!0),c.inputManager.isModifierKeyDown(C.preserveAspectRatio.key)&&(this._tool.preserveAspectRatio=!0);break;case`reshape-3d`:{let e=w(c),{snappingManager:t}=e;this._tool=new s({view:c,object:this._object,enableMidpoints:!1,enableZShape:!1,snappingManager:t,enableMoveObject:!1,autoHideManipulators:!0,enableDeleteVertices:!1,toolOptions:{tooltips:{enabled:!0,inputEnabled:!0,visibleElements:{area:!1}}}}),this.addHandles([e,l(()=>({editSourcePoints:this.editSourcePoints,operations:this._object?.operations}),e=>{e.operations instanceof b&&(e.operations.editSourcePoints=e.editSourcePoints)},u)],this._tool)}}this.addHandles([r(()=>{this._object=o(this._object),this._tool&&=(c.tools.remove(this._tool),null)})],this._tool),c.addAndActivateTool(this._tool)}_preferredInteractionToolChanged(e){let{_tool:t}=this;if(!t)return;if(this._toolType!==t.type){this._updatingHandles.consumePromise(this._recreateTool());return}let{_object:n}=this;if(n){n.tool=e;return}}async _dynamicImports(){let[{ManipulatedObject3DMediaElement:e},{ExtentTransformTool:t,ReshapeTool3D:n}]=await Promise.all([import(`../../interactive/editingTools/ManipulatedObject3DMediaElement.js`),import(`../../interactive/editingTools.js`)]);return{ManipulatedObject3DMediaElement:e,ExtentTransformTool:t,ReshapeTool3D:n}}async _findElementAtScreenPoint(e){let t=(await this.view.hitTest(e,{include:[this.layer]})).results[0];return t?.type===`media`?t.element:null}_removeTool(){this._tool&&this.removeHandles(this._tool)}_move(e,t){let{view:n,_object:r}=this,a=r?.operations;if(!a)return;let o=n.overlayPixelSizeInMapUnits(n.pointsOfInterest.focus.location)*d(n.spatialReference)/d(a.data.spatialReference),{_tmpMat2:s,_tmpVec2:c}=this,l=m(s,i(360-this.view.camera.heading)),u=g(c,o*e,o*t);_(u,u,l),a.move(u[0],u[1],0),r.emit(`modified-externally`)}};e([f({constructOnly:!0})],D.prototype,`view`,void 0),e([f({constructOnly:!0})],D.prototype,`layer`,void 0),e([f()],D.prototype,`selectedElement`,void 0),e([f()],D.prototype,`enabled`,void 0),e([f()],D.prototype,`options`,void 0),e([f()],D.prototype,`editSourcePoints`,null),e([f()],D.prototype,`_isEditSourcePointsToggled`,void 0),e([f()],D.prototype,`updating`,null),e([f()],D.prototype,`_preferredInteractionTool`,null),e([f()],D.prototype,`_validatedSelectedElement`,null),D=e([p(`esri.views.3d.layers.support.MediaLayerInteraction`)],D);export{D as MediaLayerInteraction};
|
package/views/View.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import i from"../core/CollectionFlattener.js";import{referenceSetter as a}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as s}from"../core/Evented.js";import c from"../core/Handles.js";import{makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as u}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as f,abortMaybe as ee}from"../core/maybe.js";import{EsriPromise as te}from"../core/Promise.js";import{after as p}from"../core/promiseUtils.js";import m from"../core/ReactiveSet.js";import{watch as h,sync as g,whenOnce as _,when as v,syncAndInitial as y}from"../core/reactiveUtils.js";import{property as b,subclass as x}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as S}from"../core/support/OwningCollection.js";import{UpdatingHandles as C}from"../core/support/UpdatingHandles.js";import ne from"../geometry/Extent.js";import w from"../geometry/HeightModelInfo.js";import T from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as D}from"../support/AnalysesCollection.js";import{GraphicsCollection as O}from"../support/GraphicsCollection.js";import{system as k}from"../time/constants.js";import A from"../time/TimeExtent.js";import{isTimeZoneValid as j}from"../time/timeZoneUtils.js";import M from"./BasemapView.js";import N from"./Magnifier.js";import P from"./SelectionManager.js";import F from"./Theme.js";import{ToolViewManager as I}from"./ToolViewManager.js";import{GlyphMosaic as L}from"./2d/engine/webgl/GlyphMosaic.js";import{makeDefaultHighlightOptions as R}from"./3d/support/DefaultHighlights.js";import z from"./input/Input.js";import{ViewEvents as B}from"./input/ViewEvents.js";import V from"./interactive/options/ViewOptions.js";import H from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as W}from"./support/DefaultsFromMap.js";import{defaultHighlightName as G}from"./support/HighlightDefaults.js";import K from"./support/HighlightOptions.js";import q from"./support/LayerViewManager.js";import J from"./support/RequiredFieldsOptions.js";import{checkWebAssemblyRequirements as Y}from"./support/WebAssemblyRequirements.js";import{checkWebGLRequirements as X}from"./support/WebGLRequirements.js";var Z;let Q=class extends s(te){static{Z=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new c,this.updatingHandles=new C,this.allLayerViews=new i({getCollections:()=>this.layerviewCollections,getChildrenFunction:re}),this.animationsEnabled=!0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new O,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new N,this.options=new V,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new z,this.navigation=new H,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new B(this),this.requiredFieldsOptions=new J,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this._glyphMosaic=null,this.theme=null,this.registeredComponents=new m,this.handles.add(h(()=>this.preconditionsReady,e=>{let t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,Z.views.add(this)):(this._lockedSpatialReference=null,Z.views.remove(this)),this.notifyChange(`spatialReference`),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._glyphMosaic?.dispose(),this._teardown();else if(e&&!t){try{this._startup()}catch(e){queueMicrotask(()=>{this.fatalError=new o(`view:startup-error`,`View._startup failed`,e)});return}this._glyphMosaic=new L(1024,1024,!0),this.analysisViewManager?.attach(),this.toolViewManager.attach()}},g)),this.analyses=new D}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,_(()=>this.ready)))),this.basemapView=new M({view:this}),this.layerViewManager=new q({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new I({view:this}),this.selectionManager=new P({view:this}),this.addHandles([v(()=>this.readyState===`map-content-error`&&!this.spatialReference,()=>{d.getLogger(this).warn(`#spatialReference`,`no spatial reference could be derived from the currently added map layers`)}),h(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},y),h(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.viewReady=e)},g),h(()=>this.defaultsFromMapInputSpatialReference(),e=>{this.defaultsFromMap&&(this.defaultsFromMap.inputSpatialReference=e)},y),h(()=>this.defaultsFromMapInputHeightModelInfo(),e=>{this.defaultsFromMap&&(this.defaultsFromMap.inputHeightModelInfo=e)},y)])}get _layerToLayerviewMapping(){return Z._layerToLayerview}static{this._layerToLayerview=[[`view.map.basemap.baseLayers`,`view.basemapView.baseLayerViews`],[`view.map.basemap.groundLayers`,`view.basemapView.groundLayerViews`],[`view.map.basemap.referenceLayers`,`view.basemapView.referenceLayerViews`],[`view.map.layers`,`view.layerViews`]]}destroy(){this.destroyed||(Z.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set(`navigation`,null)),this.graphics=f(this.graphics),this.analyses=f(this.analyses),this.defaultsFromMap.destroy(),this._set(`defaultsFromMap`,null),this.analysisViewManager=f(this.analysisViewManager),this.toolViewManager=f(this.toolViewManager),this.layerViewManager=f(this.layerViewManager),this.selectionManager=f(this.selectionManager),this.basemapView=f(this.basemapView),this.layerViews.destroyAll(),this.invalidate(),this.handles.destroy(),this.map=f(this.map),this.updatingHandles.destroy())}_startup(){this._set(`ready`,!0)}_teardown(){this._set(`ready`,!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error(`#toMap()`,`Not implemented on this instance of View`),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get analyses(){return this._get(`analyses`)}set analyses(e){this._set(`analyses`,e)}get animation(){return this._get(`animation`)}set animation(e){this._set(`animation`,e)}get focusRegion(){return null}get attributionItems(){return this.suspended?[]:U(this._get(`attributionItems`),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new W({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get(`extent`)}set extent(e){this._set(`extent`,e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}glyphMosaic(){return this._glyphMosaic}get highlights(){return this._get(`highlights`)??R()}set highlights(e){this._set(`highlights`,a(e,this._get(`highlights`),r.ofType(K)))}get defaultHighlight(){return this.highlights.find(({name:e})=>e===G)}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){if(this.destroying||this.destroyed)return!1;let{map:e,spatialReference:t}=this;return!!(!this.fatalError&&this._isValid&&!this._readyCycleForced&&e&&(!u(e)||e.loaded)&&this.width!==0&&this.height!==0&&t&&this._validateSpatialReference(t)&&(this._lockedSpatialReference||this.defaultsFromMap?.ready)&&this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){let t=this._get(`map`);e!==t&&(e?.destroyed&&(d.getLogger(this).warn(`#map`,`The provided map is already destroyed`,{map:e}),e=null),u(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set(`map`,e))}get canZoomIn(){return!!this.ready}get canZoomOut(){return!!this.ready}get readyState(){if(this.destroyed)return this._get(`readyState`);if(!this.map)return`missing-map`;if(`container`in this&&!this.container)return`missing-container`;if(this.fatalError)return`rendering-error`;if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){let e=!(`loaded`in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?`empty-map`:(this._readyStateWaitingTask||(this._readyStateWaitingTask=n(e=>p(has(`view-readyState-waiting-delay`),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,`ready-state-task`)),this._readyStateWaitingTask?.finished?`map-content-error`:`loading`)}return this._readyStateWaitingTask=ee(this._readyStateWaitingTask),this.removeHandles(`ready-state-task`),this.ready?`ready`:`loading`}get spatialReference(){let{_userSpatialReference:e}=this;if(e&&e.vcsWkid!==null)return e;let t=e??this._lockedSpatialReference??this.getWebDocumentSpatialReference()??this.defaultsFromMap?.spatialReference??null,n=this.defaultsFromMap?.combinedHorizontalAndVerticalSpatialReference;return n?.equals(t)?n:t}set spatialReference(e){let t=!E(e,this._get(`spatialReference`));this._set(`_userSpatialReference`,e),t&&(this._set(`spatialReference`,e),this._spatialReferenceChanged(this.spatialReference))}_spatialReferenceChanged(e){}getWebDocumentSpatialReference(){return null}defaultsFromMapInputSpatialReference(){return this._userSpatialReference??this.getWebDocumentSpatialReference()??(this.ready?this._lockedSpatialReference:null)}defaultsFromMapInputHeightModelInfo(){return this.map?.heightModelInfo??null}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??k}set timeZone(e){this._userTimeZone=e,j(e)||d.getLogger(this).warn(`#timeZone`,`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??`default`}acquireCursor(e,t=`low`){let n=t===`high`?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},i=l(()=>n.remove(r));return n.add(r),this.addHandles(i),i}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new F}registerComponent(e){this.registeredComponents.add(e)}unregisterComponent(e){this.registeredComponents.delete(e)}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultHeightModelInfo(){return(this.map&&`heightModelInfo`in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o(`view:importLayerView-missing`,`importLayerView() not implemented`)}hasLayerViewModule(e){return!1}async validate(){let e=X(this.type);if(e)throw this._displayWebGLError(),d.getLogger(this).warn(`#validate()`,e.message),e;let t=await Y();if(t)throw d.getLogger(this).warn(`#validate()`,t.message),t}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return this.getSpatialReferenceSupport(e)!=null}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn(`#when()`,`Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead.`),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}_displayWebGLError(){let e=document.createElement(`div`);e.setAttribute(`style`,`display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;`);let t=document.createElement(`div`);t.innerHTML=`Unable to display map. WebGL2 support is required.`,t.setAttribute(`style`,`font-size: 24px; font-weight: bold;`);let n=document.createElement(`div`);n.innerHTML=`Ensure that your browser and hardware meet the minimum requirements.`,n.setAttribute(`style`,`font-size: 18px;`);let r=document.createElement(`a`);r.innerHTML=`https://esriurl.com/webgl-faq`,r.target=`_blank`,r.setAttribute(`style`,`font-size: 18px;`),r.href=`https://esriurl.com/webgl-faq`,e.appendChild(t),e.appendChild(n),e.appendChild(r);let i=this.getSurface();i&&i.appendChild(e)}};e([b()],Q.prototype,`_userSpatialReference`,void 0),e([b()],Q.prototype,`activeTool`,null),e([b({readOnly:!0})],Q.prototype,`allLayerViews`,void 0),e([b({readOnly:!0})],Q.prototype,`layerviewCollections`,null),e([b(S(D,`analyses`))],Q.prototype,`analyses`,null),e([b()],Q.prototype,`animation`,null),e([b()],Q.prototype,`animationsEnabled`,void 0),e([b()],Q.prototype,`focusRegionVisible`,void 0),e([b()],Q.prototype,`focusRegionShortcutEnabled`,void 0),e([b()],Q.prototype,`focusRegion`,null),e([b({readOnly:!0})],Q.prototype,`attributionItems`,null),e([b()],Q.prototype,`attributionVisible`,void 0),e([b()],Q.prototype,`basemapView`,void 0),e([b()],Q.prototype,`center`,null),e([b()],Q.prototype,`defaultsFromMapSettings`,null),e([b()],Q.prototype,`defaultsFromMap`,null),e([b()],Q.prototype,`dependencies`,void 0),e([b()],Q.prototype,`displayFilterEnabled`,void 0),e([b({type:ne})],Q.prototype,`extent`,null),e([b()],Q.prototype,`fatalError`,void 0),e([b(S(O,`graphics`))],Q.prototype,`graphics`,void 0),e([b({readOnly:!0,type:w})],Q.prototype,`heightModelInfo`,null),e([b({type:r.ofType(K)})],Q.prototype,`highlights`,null),e([b({readOnly:!0})],Q.prototype,`interacting`,null),e([b({constructOnly:!0})],Q.prototype,`layerViewFilter`,void 0),e([b({readOnly:!0})],Q.prototype,`navigating`,null),e([b({readOnly:!0})],Q.prototype,`preconditionsReady`,null),e([b({readOnly:!0})],Q.prototype,`typeSpecificPreconditionsReady`,void 0),e([b({type:r,readOnly:!0})],Q.prototype,`layerViews`,void 0),e([b()],Q.prototype,`resolution`,null),e([b({type:N})],Q.prototype,`magnifier`,void 0),e([b({nonNullable:!0,type:V})],Q.prototype,`options`,void 0),e([b({value:null,type:t})],Q.prototype,`map`,null),e([b()],Q.prototype,`padding`,void 0),e([b({readOnly:!0})],Q.prototype,`ready`,void 0),e([b({readOnly:!0})],Q.prototype,`canZoomIn`,null),e([b({readOnly:!0})],Q.prototype,`canZoomOut`,null),e([b()],Q.prototype,`_readyStateWaitingTask`,void 0),e([b({readOnly:!0})],Q.prototype,`readyState`,null),e([b({type:T})],Q.prototype,`spatialReference`,null),e([b()],Q.prototype,`stationary`,null),e([b({type:A})],Q.prototype,`timeExtent`,null),e([b({type:String,nonNullable:!0})],Q.prototype,`timeZone`,null),e([b()],Q.prototype,`tools`,null),e([b()],Q.prototype,`toolViewManager`,void 0),e([b({readOnly:!0})],Q.prototype,`type`,void 0),e([b({type:Number})],Q.prototype,`scale`,void 0),e([b({readOnly:!0})],Q.prototype,`updating`,void 0),e([b({readOnly:!0})],Q.prototype,`initialExtentRequired`,void 0),e([b({readOnly:!0})],Q.prototype,`initialExtent`,null),e([b()],Q.prototype,`cursor`,null),e([b({readOnly:!0})],Q.prototype,`input`,void 0),e([b({type:H,nonNullable:!0})],Q.prototype,`navigation`,void 0),e([b()],Q.prototype,`layerViewManager`,void 0),e([b()],Q.prototype,`analysisViewManager`,void 0),e([b()],Q.prototype,`selectionManager`,void 0),e([b()],Q.prototype,`width`,void 0),e([b()],Q.prototype,`height`,void 0),e([b({readOnly:!0})],Q.prototype,`resizing`,void 0),e([b({value:null,readOnly:!0})],Q.prototype,`size`,null),e([b({readOnly:!0})],Q.prototype,`suspended`,void 0),e([b({readOnly:!0})],Q.prototype,`viewEvents`,void 0),e([b()],Q.prototype,`_isValid`,void 0),e([b()],Q.prototype,`_readyCycleForced`,void 0),e([b()],Q.prototype,`_lockedSpatialReference`,void 0),e([b()],Q.prototype,`_userTimeZone`,void 0),e([b()],Q.prototype,`_lockedTimeZone`,void 0),e([b()],Q.prototype,`_userTimeExtent`,void 0),e([b()],Q.prototype,`_lockedTimeExtent`,void 0),e([b({type:F})],Q.prototype,`theme`,void 0),e([b({readOnly:!0,type:F})],Q.prototype,`effectiveTheme`,null),e([b({readOnly:!0})],Q.prototype,`registeredComponents`,void 0),Q=Z=e([x(`esri.views.View`)],Q);const $=globalThis.$arcgis;$&&!$.views&&Object.defineProperty($,"views",{configurable:!1,enumerable:!0,writable:!1,value:Q.views});function re(e){return e.layerViews}export{Q as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import i from"../core/CollectionFlattener.js";import{referenceSetter as a}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as s}from"../core/Evented.js";import c from"../core/Handles.js";import{makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as u}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as f,abortMaybe as ee}from"../core/maybe.js";import{EsriPromise as te}from"../core/Promise.js";import{after as p}from"../core/promiseUtils.js";import m from"../core/ReactiveSet.js";import{watch as h,sync as g,whenOnce as _,when as v,syncAndInitial as y}from"../core/reactiveUtils.js";import{property as b,subclass as x}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as S}from"../core/support/OwningCollection.js";import{UpdatingHandles as C}from"../core/support/UpdatingHandles.js";import ne from"../geometry/Extent.js";import w from"../geometry/HeightModelInfo.js";import T from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as D}from"../support/AnalysesCollection.js";import{GraphicsCollection as O}from"../support/GraphicsCollection.js";import{system as k}from"../time/constants.js";import A from"../time/TimeExtent.js";import{isTimeZoneValid as j}from"../time/timeZoneUtils.js";import M from"./BasemapView.js";import N from"./Magnifier.js";import P from"./SelectionManager.js";import F from"./Theme.js";import{ToolViewManager as I}from"./ToolViewManager.js";import{GlyphMosaic as L}from"./2d/engine/webgl/GlyphMosaic.js";import{makeDefaultHighlightOptions as R}from"./3d/support/DefaultHighlights.js";import z from"./input/Input.js";import{ViewEvents as B}from"./input/ViewEvents.js";import V from"./interactive/options/ViewOptions.js";import H from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as W}from"./support/DefaultsFromMap.js";import{defaultHighlightName as G}from"./support/HighlightDefaults.js";import K from"./support/HighlightOptions.js";import q from"./support/LayerViewManager.js";import J from"./support/RequiredFieldsOptions.js";import{checkWebAssemblyRequirements as Y}from"./support/WebAssemblyRequirements.js";import{checkWebGLRequirements as X}from"./support/WebGLRequirements.js";var Z;let Q=class extends s(te){static{Z=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new c,this.updatingHandles=new C,this.allLayerViews=new i({getCollections:()=>this.layerviewCollections,getChildrenFunction:re}),this.animationsEnabled=!0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new O,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new N,this.options=new V,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new z,this.navigation=new H,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new B(this),this.requiredFieldsOptions=new J,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this._glyphMosaic=null,this.theme=null,this.registeredComponents=new m,this.handles.add(h(()=>this.preconditionsReady,e=>{let t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,Z.views.add(this)):(this._lockedSpatialReference=null,Z.views.remove(this)),this.notifyChange(`spatialReference`),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._glyphMosaic?.dispose(),this._teardown();else if(e&&!t){try{this._startup()}catch(e){queueMicrotask(()=>{this.fatalError=new o(`view:startup-error`,`View._startup failed`,e)});return}this._glyphMosaic=new L(1024,1024,!0),this.analysisViewManager?.attach(),this.toolViewManager.attach()}},g)),this.analyses=new D}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,_(()=>this.ready)))),this.basemapView=new M({view:this}),this.layerViewManager=new q({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new I({view:this}),this.selectionManager=new P({view:this}),this.addHandles([v(()=>this.readyState===`map-content-error`&&!this.spatialReference,()=>{d.getLogger(this).warn(`#spatialReference`,`no spatial reference could be derived from the currently added map layers`)}),h(()=>[this.defaultsFromMap,this.initialExtentRequired],([e,t])=>{e&&(e.required={...e.required,extent:t})},y),h(()=>[this.defaultsFromMap,this.ready],([e,t])=>{e&&(e.viewReady=t)},g),h(()=>[this.defaultsFromMap,this.defaultsFromMapInputSpatialReference()],([e,t])=>{e&&(e.inputSpatialReference=t)},y),h(()=>[this.defaultsFromMap,this.defaultsFromMapInputHeightModelInfo()],([e,t])=>{e&&(e.inputHeightModelInfo=t)},y)])}get _layerToLayerviewMapping(){return Z._layerToLayerview}static{this._layerToLayerview=[[`view.map.basemap.baseLayers`,`view.basemapView.baseLayerViews`],[`view.map.basemap.groundLayers`,`view.basemapView.groundLayerViews`],[`view.map.basemap.referenceLayers`,`view.basemapView.referenceLayerViews`],[`view.map.layers`,`view.layerViews`]]}destroy(){this.destroyed||(Z.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set(`navigation`,null)),this.graphics=f(this.graphics),this.analyses=f(this.analyses),this.defaultsFromMap.destroy(),this._set(`defaultsFromMap`,null),this.analysisViewManager=f(this.analysisViewManager),this.toolViewManager=f(this.toolViewManager),this.layerViewManager=f(this.layerViewManager),this.selectionManager=f(this.selectionManager),this.basemapView=f(this.basemapView),this.layerViews.destroyAll(),this.invalidate(),this.handles.destroy(),this.map=f(this.map),this.updatingHandles.destroy())}_startup(){this._set(`ready`,!0)}_teardown(){this._set(`ready`,!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error(`#toMap()`,`Not implemented on this instance of View`),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get analyses(){return this._get(`analyses`)}set analyses(e){this._set(`analyses`,e)}get animation(){return this._get(`animation`)}set animation(e){this._set(`animation`,e)}get focusRegion(){return null}get attributionItems(){return this.suspended?[]:U(this._get(`attributionItems`),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new W({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get(`extent`)}set extent(e){this._set(`extent`,e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}glyphMosaic(){return this._glyphMosaic}get highlights(){return this._get(`highlights`)??R()}set highlights(e){this._set(`highlights`,a(e,this._get(`highlights`),r.ofType(K)))}get defaultHighlight(){return this.highlights.find(({name:e})=>e===G)}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){if(this.destroying||this.destroyed)return!1;let{map:e,spatialReference:t}=this;return!!(!this.fatalError&&this._isValid&&!this._readyCycleForced&&e&&(!u(e)||e.loaded)&&this.width!==0&&this.height!==0&&t&&this._validateSpatialReference(t)&&(this._lockedSpatialReference||this.defaultsFromMap?.ready)&&this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){let t=this._get(`map`);e!==t&&(e?.destroyed&&(d.getLogger(this).warn(`#map`,`The provided map is already destroyed`,{map:e}),e=null),u(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set(`map`,e))}get canZoomIn(){return!!this.ready}get canZoomOut(){return!!this.ready}get readyState(){if(this.destroyed)return this._get(`readyState`);if(!this.map)return`missing-map`;if(`container`in this&&!this.container)return`missing-container`;if(this.fatalError)return`rendering-error`;if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){let e=!(`loaded`in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?`empty-map`:(this._readyStateWaitingTask||(this._readyStateWaitingTask=n(e=>p(has(`view-readyState-waiting-delay`),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,`ready-state-task`)),this._readyStateWaitingTask?.finished?`map-content-error`:`loading`)}return this._readyStateWaitingTask=ee(this._readyStateWaitingTask),this.removeHandles(`ready-state-task`),this.ready?`ready`:`loading`}get spatialReference(){let{_userSpatialReference:e}=this;if(e&&e.vcsWkid!==null)return e;let t=e??this._lockedSpatialReference??this.getWebDocumentSpatialReference()??this.defaultsFromMap?.spatialReference??null,n=this.defaultsFromMap?.combinedHorizontalAndVerticalSpatialReference;return n?.equals(t)?n:t}set spatialReference(e){let t=!E(e,this._get(`spatialReference`));this._set(`_userSpatialReference`,e),t&&(this._set(`spatialReference`,e),this._spatialReferenceChanged(this.spatialReference))}_spatialReferenceChanged(e){}getWebDocumentSpatialReference(){return null}defaultsFromMapInputSpatialReference(){return this._userSpatialReference??this.getWebDocumentSpatialReference()??(this.ready?this._lockedSpatialReference:null)}defaultsFromMapInputHeightModelInfo(){return this.map?.heightModelInfo??null}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??k}set timeZone(e){this._userTimeZone=e,j(e)||d.getLogger(this).warn(`#timeZone`,`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??`default`}acquireCursor(e,t=`low`){let n=t===`high`?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},i=l(()=>n.remove(r));return n.add(r),this.addHandles(i),i}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new F}registerComponent(e){this.registeredComponents.add(e)}unregisterComponent(e){this.registeredComponents.delete(e)}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultHeightModelInfo(){return(this.map&&`heightModelInfo`in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o(`view:importLayerView-missing`,`importLayerView() not implemented`)}hasLayerViewModule(e){return!1}async validate(){let e=X(this.type);if(e)throw this._displayWebGLError(),d.getLogger(this).warn(`#validate()`,e.message),e;let t=await Y();if(t)throw d.getLogger(this).warn(`#validate()`,t.message),t}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return this.getSpatialReferenceSupport(e)!=null}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn(`#when()`,`Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead.`),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}_displayWebGLError(){let e=document.createElement(`div`);e.setAttribute(`style`,`display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;`);let t=document.createElement(`div`);t.innerHTML=`Unable to display map. WebGL2 support is required.`,t.setAttribute(`style`,`font-size: 24px; font-weight: bold;`);let n=document.createElement(`div`);n.innerHTML=`Ensure that your browser and hardware meet the minimum requirements.`,n.setAttribute(`style`,`font-size: 18px;`);let r=document.createElement(`a`);r.innerHTML=`https://esriurl.com/webgl-faq`,r.target=`_blank`,r.setAttribute(`style`,`font-size: 18px;`),r.href=`https://esriurl.com/webgl-faq`,e.appendChild(t),e.appendChild(n),e.appendChild(r);let i=this.getSurface();i&&i.appendChild(e)}};e([b()],Q.prototype,`_userSpatialReference`,void 0),e([b()],Q.prototype,`activeTool`,null),e([b({readOnly:!0})],Q.prototype,`allLayerViews`,void 0),e([b({readOnly:!0})],Q.prototype,`layerviewCollections`,null),e([b(S(D,`analyses`))],Q.prototype,`analyses`,null),e([b()],Q.prototype,`animation`,null),e([b()],Q.prototype,`animationsEnabled`,void 0),e([b()],Q.prototype,`focusRegionVisible`,void 0),e([b()],Q.prototype,`focusRegionShortcutEnabled`,void 0),e([b()],Q.prototype,`focusRegion`,null),e([b({readOnly:!0})],Q.prototype,`attributionItems`,null),e([b()],Q.prototype,`attributionVisible`,void 0),e([b()],Q.prototype,`basemapView`,void 0),e([b()],Q.prototype,`center`,null),e([b()],Q.prototype,`defaultsFromMapSettings`,null),e([b()],Q.prototype,`defaultsFromMap`,null),e([b()],Q.prototype,`dependencies`,void 0),e([b()],Q.prototype,`displayFilterEnabled`,void 0),e([b({type:ne})],Q.prototype,`extent`,null),e([b()],Q.prototype,`fatalError`,void 0),e([b(S(O,`graphics`))],Q.prototype,`graphics`,void 0),e([b({readOnly:!0,type:w})],Q.prototype,`heightModelInfo`,null),e([b({type:r.ofType(K)})],Q.prototype,`highlights`,null),e([b({readOnly:!0})],Q.prototype,`interacting`,null),e([b({constructOnly:!0})],Q.prototype,`layerViewFilter`,void 0),e([b({readOnly:!0})],Q.prototype,`navigating`,null),e([b({readOnly:!0})],Q.prototype,`preconditionsReady`,null),e([b({readOnly:!0})],Q.prototype,`typeSpecificPreconditionsReady`,void 0),e([b({type:r,readOnly:!0})],Q.prototype,`layerViews`,void 0),e([b()],Q.prototype,`resolution`,null),e([b({type:N})],Q.prototype,`magnifier`,void 0),e([b({nonNullable:!0,type:V})],Q.prototype,`options`,void 0),e([b({value:null,type:t})],Q.prototype,`map`,null),e([b()],Q.prototype,`padding`,void 0),e([b({readOnly:!0})],Q.prototype,`ready`,void 0),e([b({readOnly:!0})],Q.prototype,`canZoomIn`,null),e([b({readOnly:!0})],Q.prototype,`canZoomOut`,null),e([b()],Q.prototype,`_readyStateWaitingTask`,void 0),e([b({readOnly:!0})],Q.prototype,`readyState`,null),e([b({type:T})],Q.prototype,`spatialReference`,null),e([b()],Q.prototype,`stationary`,null),e([b({type:A})],Q.prototype,`timeExtent`,null),e([b({type:String,nonNullable:!0})],Q.prototype,`timeZone`,null),e([b()],Q.prototype,`tools`,null),e([b()],Q.prototype,`toolViewManager`,void 0),e([b({readOnly:!0})],Q.prototype,`type`,void 0),e([b({type:Number})],Q.prototype,`scale`,void 0),e([b({readOnly:!0})],Q.prototype,`updating`,void 0),e([b({readOnly:!0})],Q.prototype,`initialExtentRequired`,void 0),e([b({readOnly:!0})],Q.prototype,`initialExtent`,null),e([b()],Q.prototype,`cursor`,null),e([b({readOnly:!0})],Q.prototype,`input`,void 0),e([b({type:H,nonNullable:!0})],Q.prototype,`navigation`,void 0),e([b()],Q.prototype,`layerViewManager`,void 0),e([b()],Q.prototype,`analysisViewManager`,void 0),e([b()],Q.prototype,`selectionManager`,void 0),e([b()],Q.prototype,`width`,void 0),e([b()],Q.prototype,`height`,void 0),e([b({readOnly:!0})],Q.prototype,`resizing`,void 0),e([b({value:null,readOnly:!0})],Q.prototype,`size`,null),e([b({readOnly:!0})],Q.prototype,`suspended`,void 0),e([b({readOnly:!0})],Q.prototype,`viewEvents`,void 0),e([b()],Q.prototype,`_isValid`,void 0),e([b()],Q.prototype,`_readyCycleForced`,void 0),e([b()],Q.prototype,`_lockedSpatialReference`,void 0),e([b()],Q.prototype,`_userTimeZone`,void 0),e([b()],Q.prototype,`_lockedTimeZone`,void 0),e([b()],Q.prototype,`_userTimeExtent`,void 0),e([b()],Q.prototype,`_lockedTimeExtent`,void 0),e([b({type:F})],Q.prototype,`theme`,void 0),e([b({readOnly:!0,type:F})],Q.prototype,`effectiveTheme`,null),e([b({readOnly:!0})],Q.prototype,`registeredComponents`,void 0),Q=Z=e([x(`esri.views.View`)],Q);const $=globalThis.$arcgis;$&&!$.views&&Object.defineProperty($,"views",{configurable:!1,enumerable:!0,writable:!1,value:Q.views});function re(e){return e.layerViews}export{Q as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import{makeHandle as a}from"../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as s,isAborted as c,throwIfAborted as l}from"../../../core/promiseUtils.js";import{pausable as u,sync as d,watch as f,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as m,subclass as h}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import _ from"../../../layers/GraphicsLayer.js";import v from"../../../symbols/CIMSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import b from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as x}from"../ExclusiveOperationManager.js";import{isPolyline as S,isValidInputGraphic as C,isInternalGraphic as w}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as T}from"../../input/InputManager.js";import{isCancelEvent as E}from"../../interactive/interactiveToolUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import{makeHandle as a}from"../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as s,isAborted as c,throwIfAborted as l}from"../../../core/promiseUtils.js";import{pausable as u,sync as d,watch as f,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as m,subclass as h}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import _ from"../../../layers/GraphicsLayer.js";import v from"../../../symbols/CIMSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import b from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as x}from"../ExclusiveOperationManager.js";import{isPolyline as S,isValidInputGraphic as C,isInternalGraphic as w}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as T}from"../../input/InputManager.js";import{isCancelEvent as E}from"../../interactive/interactiveToolUtils.js";import{makeGeometryAnalysisSnappingOptions as D}from"../../interactive/snapping/allLayerSnapping.js";import O from"../../../widgets/Sketch/SketchViewModel.js";let k=class extends n{constructor(e){super(e),this._sketchViewModels=new i,this._updatingHandles=new g,this._operationManager=new x}initialize(){let{view:e}=this;this._allLayerSnappingOptions=D(e),this._graphicsLayer=new _({listMode:`hide`,internal:!0}),this._externalGeometryChangeHandle=u(()=>this._analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),d),this.addHandles([f(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:n,geometryVisualizationVisible:r,visible:i})=>{j(e,t);let a=this.sketchGraphic;switch(a&&(a.visible=i),n){case`idle`:case`reshaping-disabled`:a&&!r&&(a.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case`reshaping`:s(this._startReshape());break;case`awaiting-sketch`:this.analysisViewData.interactive=!0}},p),f(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},p),this._allLayerSnappingOptions,this._externalGeometryChangeHandle])}destroy(){this._operationManager.destroy(),this._sketchViewModels.drain(e=>o(e));let e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get(`sketchGraphic`)}set sketchGraphic(e){e!==this._get(`sketchGraphic`)&&(this._set(`sketchGraphic`,e),this._updateAnalysisFromSketchGraphic())}get state(){let{visible:e,interactive:t}=this.analysisViewData;if(!e)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return this._sketching?`sketching`:`awaiting-sketch`;case`pick-feature`:return`picking`;default:return this._analysis.geometry?t?`reshaping`:`reshaping-disabled`:`idle`}}get updating(){return this._sketchViewModels.some(e=>e.updating)||this._updatingHandles.updating}get _sketching(){return this._sketchViewModels.some(e=>e.createGraphic===this.sketchGraphic)}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return A(this.view.type)}place(e){return this._operationManager.start(`place`,async t=>{let n=this._createSketchViewModel(),r=this._analysis.clone();this._ensureUpdatedSketchGraphic();let i=this.sketchGraphic,o=this._analysis.elevationInfo,l=a(()=>{this.sketchGraphic===i&&(this._graphicsLayer.elevationInfo=o)}),u=n.on(`create`,e=>{switch(e.state){case`start`:this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo;break;case`active`:this._updateAnalysisFromSketchGraphic();break;case`complete`:this.sketchGraphic&&(this._updateAnalysisFromSketchGraphic(),this._addSketchGraphic(this.sketchGraphic)),t.stop();break;case`cancel`:t.stop()}});t.handles.push(u,a(()=>{if(u.remove(),n.destroy(),this._sketchViewModels.remove(n),this._updateAnalysisFromSketchGraphic(),!this._analysis.valid)return this._clear(),t.reject();if(c(e)||r.equals(this._analysis))return t.reject();t.resolve({})}),l),this._graphicsLayer.elevationInfo=M,await this._updatingHandles.addPromise(s(n.create(`polyline`)))},e)}async pickFeature(e){return this._operationManager.start(`pick-feature`,async e=>{let{view:t}=this;t.closePopup();let n=null;e.handles.push(t.on(`immediate-click`,i=>{i.defer(async()=>{n?.abort(),n=r(async n=>{let{results:r}=await t.hitTest(i);l(n);let a=null;for(let e of r)if(e.type===`graphic`&&C(e.graphic)&&!w(e.graphic)){a=e.graphic;break}a&&(i.preventDefault(),i.stopPropagation(),this._externalGeometryChangeHandle.pause(),this.sketchGraphic=null,this._analysis.setGeometryFromFeature(a),this._externalGeometryChangeHandle.resume(),e.resolve({feature:a}),e.stop())}),await n.promise})},T.TOOL),t.on(`key-down`,t=>{E(t)&&(e.reject(),e.stop())},T.TOOL),t.acquireCursor(`crosshair`,`high`),a(()=>{n?.abort(),e.reject()})),t.focus()},e)}_startReshape(){let e=this._createSketchViewModel();return this._sketchViewModels.add(e),this._operationManager.start(`reshape`,async t=>{let n=()=>{let t=this._ensureUpdatedSketchGraphic();return t?this._updatingHandles.addPromise(e.update(t,{tool:`reshape`})):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;let r=e.on(`update`,e=>{this._updateAnalysisFromSketchGraphic(),e.state===`complete`&&(this.state===`reshaping`?s(n()):t.resolve())});t.handles.push(r,a(()=>{r.remove(),this._sketchViewModels.remove(e),e.destroy(),t.resolve()})),await n()})}_createSketchViewModel(){return new O({layer:this._graphicsLayer,view:this.view,defaultCreateOptions:{mode:`click`,hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol,snappingOptions:this._allLayerSnappingOptions.options})}_ensureUpdatedSketchGraphic(){let{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,this._graphicsLayer.removeAll(),null;let n=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return n.geometry=e,this._addSketchGraphic(n),n}_addSketchGraphic(e){let{graphics:t}=this._graphicsLayer;t.includes(e)||t.add(e),t.length!==1&&t.removeMany(t.filter(t=>t!==e))}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){this._externalGeometryChangeHandle.pause();let e=this.sketchGraphic?.geometry;S(e)||(e=null);let t=this._analysis;t.geometry!==e&&(t.geometry=e),this._externalGeometryChangeHandle.resume()}};e([m({constructOnly:!0})],k.prototype,`analysisViewData`,void 0),e([m({constructOnly:!0})],k.prototype,`view`,void 0),e([m()],k.prototype,`sketchGraphic`,null),e([m({nonNullable:!0})],k.prototype,`state`,null),e([m()],k.prototype,`updating`,null),e([m()],k.prototype,`_sketching`,null),e([m()],k.prototype,`_analysis`,null),e([m()],k.prototype,`_lineSymbol`,null),k=e([h(`esri.views.analysis.ElevationProfile.ElevationProfileTool`)],k);function A(e){if(e===`2d`){let e={type:`CIMSolidStroke`,enable:!0,capStyle:`Butt`,joinStyle:`Round`,width:1.5};return new v({data:{type:`CIMSymbolReference`,symbol:{type:`CIMLineSymbol`,symbolLayers:[{...e,effects:[{type:`CIMGeometricEffectDashes`,dashTemplate:[5,4],lineDashEnding:`FullGap`,controlPointEnding:`NoConstraint`}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new y({color:[0,0,0,0]})}function j(e,t){t&&(t.removeFromParent(),e?.add(t))}const M=new b({mode:`on-the-ground`,offset:0});export{k as ElevationProfileTool};
|