@arcgis/core 4.34.0-next.1 → 4.34.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Map.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/DimensionAnalysis.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/analysis/ViewshedAnalysis.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{253bcc3cc7bc4c2dc6ea.js → 03db109e9b695528c35d.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc61d02286b6ff5447cc.js → 09da6b3085fc84cd69d5.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf3555f91492a1a3b613.js → 09f76ca9b47b465c934f.js} +1 -1
- package/assets/esri/core/workers/chunks/{42d9989b2aad3ac28d4d.js → 0d78fc2c2bc1152f84db.js} +1 -1
- package/assets/esri/core/workers/chunks/0fd826e7f64a37aaaa1e.js +1 -0
- package/assets/esri/core/workers/chunks/{ead5d4e271effc04def3.js → 1415d4e2f5f3193be004.js} +1 -1
- package/assets/esri/core/workers/chunks/17e43a050fbf8dc87588.js +1 -0
- package/assets/esri/core/workers/chunks/1ee6e9a88f0676032e91.js +1 -0
- package/assets/esri/core/workers/chunks/{1c86aa3802d9ae0230ae.js → 28e31ac00dc95a1318e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{ece68a25651ef03fc95d.js → 342f61e784c9364a493b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d23610475c85385fbff.js → 355e6bcdb401ada71f39.js} +1 -1
- package/assets/esri/core/workers/chunks/{bba6d7615d8f3862fe70.js → 36f0046ff6b46adce7b7.js} +1 -1
- package/assets/esri/core/workers/chunks/3adcf78ed1e7cd82666d.js +1 -0
- package/assets/esri/core/workers/chunks/{b0522dffa5600345c07e.js → 3e85e63148b5e93d3074.js} +1 -1
- package/assets/esri/core/workers/chunks/{d2ebb72a43d995ed368a.js → 42bb9bb6fe44a47d9b81.js} +1 -1
- package/assets/esri/core/workers/chunks/{6ee41e9c92ed8ba4c763.js → 4dd0a5f327fa5fc7249d.js} +1 -1
- package/assets/esri/core/workers/chunks/{36b0d6b4089a96475201.js → 51ba7345c31e6eb79060.js} +1 -1
- package/assets/esri/core/workers/chunks/{66e79aa02b3aa12b3778.js → 5200be8bce60fa831026.js} +1 -1
- package/assets/esri/core/workers/chunks/{6b23ca6570357f9fb724.js → 52a57106a41b8c9483d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa63b0f7fa799cb2f81d.js → 562800b0af52a38a311b.js} +1 -1
- package/assets/esri/core/workers/chunks/{585c7b485c42555ec554.js → 61f9747c960d959b571b.js} +2 -2
- package/assets/esri/core/workers/chunks/{9fc35ec8185beba96715.js → 632d1a1287dde980479e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1d043965dcdc11b3aeaa.js → 63852887b3f07d50f7c9.js} +1 -1
- package/assets/esri/core/workers/chunks/{32ee2708edd307954125.js → 7174150bf7595c22f976.js} +1 -1
- package/assets/esri/core/workers/chunks/{e77371ddbaf4b2d9be8d.js → 74c0db9e3a62e9839b23.js} +1 -1
- package/assets/esri/core/workers/chunks/{6ecc3a3737ae8622dfa4.js → 7b12607633bbdc318936.js} +1 -1
- package/assets/esri/core/workers/chunks/{06eb4832b6c86744e52e.js → 8008f5479f4d16964088.js} +1 -1
- package/assets/esri/core/workers/chunks/{d839a237d5edc243d645.js → 8aa8f9986b966ccb64e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{67338948e470c1251d8a.js → 8d14e957219364a81d5f.js} +3 -3
- package/assets/esri/core/workers/chunks/92a5dccb328229a9336b.js +1 -0
- package/assets/esri/core/workers/chunks/{631205dc4d73d49ec9ed.js → 95507ff0a243e451b99e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1051a5a57b2fb843a555.js → 9cd55043f3d789f41815.js} +1 -1
- package/assets/esri/core/workers/chunks/{40f54c4f8ae63c6f3df9.js → a32dcd5bc4680374d30c.js} +1 -1
- package/assets/esri/core/workers/chunks/ad4f65d764654c70a117.js +1 -0
- package/assets/esri/core/workers/chunks/b2a6afa0cd537805b4b8.js +1 -0
- package/assets/esri/core/workers/chunks/{ac2607f1e8cd2e99907c.js → b70f65ccee01d48a610e.js} +2 -2
- package/assets/esri/core/workers/chunks/{571252c9822d73cf7b01.js → b845586219f284a215b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7b640f7a181bd26c7c7.js → bac5e1d50b69f0d94694.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ca480eb8b2312381ccf.js → bcadcb709e622f2aaaf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{c16e0da7a19310c71e8b.js → c6cd8784a3e222eb2d4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{97c148adf0347c69a79c.js → c9604f8df909ec4fad46.js} +1 -1
- package/assets/esri/core/workers/chunks/{b87fec1753f164c845c5.js → ca76950d81ab4ebb65e1.js} +1 -1
- package/assets/esri/core/workers/chunks/{faa40ef04604c7cce706.js → cb63ea6a53d3c2fc3179.js} +1 -1
- package/assets/esri/core/workers/chunks/{54f4a1131f99468db076.js → d33a5d79f2163ad62b1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{55f087bca75c3f2a4515.js → d3c0d7799c92c6f0e7d3.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca60b34c3e1ed2ff5934.js → dd2b316baae02bbdddac.js} +1 -1
- package/assets/esri/core/workers/chunks/{e3c1aea34ece8336dae1.js → e9aa1d9ded8a52a40c57.js} +1 -1
- package/assets/esri/core/workers/chunks/{80b596496800e8d60eb8.js → ed75e0962358523f4439.js} +1 -1
- package/assets/esri/core/workers/chunks/{0cf979a093e9744d1e80.js → ef7955a2509be0f03ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/{b5d68d8460b7c15001dd.js → f1c6df5cf2ccb6ac47a1.js} +1 -1
- package/assets/esri/core/workers/chunks/f2aa8090827086c62dde.js +1 -0
- package/assets/esri/core/workers/chunks/{523046e04679e301797d.js → f3d97a4c4f433adbdab5.js} +1 -1
- package/assets/esri/core/workers/chunks/fd4c020297badcb81947.js +1 -0
- package/assets/esri/core/workers/chunks/{9a06476b834584d00d5c.js → feaf79b69d2e2a1f2aa2.js} +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/chunks/FocusAreaColor.glsl.js +10 -8
- package/chunks/Laserlines.glsl.js +2 -2
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/vec42.js +1 -1
- package/config.js +1 -1
- package/core/accessorSupport/decorators/persistable.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/effects/FocusArea.js +5 -0
- package/effects/FocusAreaOutline.js +5 -0
- package/effects/FocusAreas.js +5 -0
- package/geometry/projection/projectPointToVector.js +1 -1
- package/geometry/projection/projectVectorToPoint.js +1 -1
- package/geometry/projection/projectVectorToVector.js +1 -1
- package/geometry/projection.js +1 -1
- package/geometry/projectionUtils.js +5 -0
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/geometry/support/meshUtils/extent.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +171 -68
- package/kernel.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/CornersGeoreference.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/ExtentAndRotationGeoreference.js +1 -1
- package/layers/support/GeoreferenceBase.js +1 -1
- package/layers/support/LocalMediaElementSource.js +1 -1
- package/layers/support/MediaElementView.js +1 -1
- package/layers/support/PolygonCollection.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/networks/support/UNTraceConfiguration.js +1 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/webScene.js +1 -1
- package/portal/support/portalItemUtils.js +1 -1
- package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
- package/rest/knowledgeGraph/GraphAddFieldIndexResult.js +5 -0
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphAddPropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphDataModelOperationResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
- package/rest/knowledgeGraph/GraphDeletePropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/support/CircuitPath.js +5 -0
- package/rest/networks/support/CircuitPathConnectivityElement.js +5 -0
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/renderers/predominance.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.d.ts +4 -0
- package/smartMapping/renderers/support/spikeUtils.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/statistics/summaryStatistics.js +1 -1
- package/support/persistableUrlUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/ViewStateManager.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/support/projectionUtils.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/support/Segment.js +1 -1
- package/views/3d/layers/FeatureLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/focusAreaStyle.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/geometryUtils/sphere.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaEffect.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +5 -0
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/snapping/GridSnappingEngine.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/tests.js +1 -1
- package/assets/esri/core/workers/chunks/094e8aae6dada24c8115.js +0 -1
- package/assets/esri/core/workers/chunks/24327d01cb2c5c55a4b7.js +0 -1
- package/assets/esri/core/workers/chunks/2b1486a466760d2152f5.js +0 -1
- package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +0 -1
- package/assets/esri/core/workers/chunks/62b2d3720693c93a60f2.js +0 -1
- package/assets/esri/core/workers/chunks/6d1e1a4fcb90ea8b6848.js +0 -1
- package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +0 -1
- package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +0 -1
- package/assets/esri/core/workers/chunks/d3d98ea5b5e56fc60a31.js +0 -1
- package/views/FocusArea.js +0 -5
- package/views/FocusAreaOutline.js +0 -5
- package/views/FocusAreaOutlineItem.js +0 -5
- package/views/FocusAreas.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as E,distance2 as _,fromPoints as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,E){const{options:g,camera:v,rayBegin:P,rayEnd:N}=m;if(!g.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;S(v.eye,Ee[0],Ee[1],_e),S(v.eye,Ee[1],Ee[2],Ae),S(v.eye,Ee[2],Ee[3],Re),S(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=_(A(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(A(ce,pe,he),A(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}E(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f16(B.SIZE),this.parameters.vvColor?e.f16(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvOpacity&&e.f16(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE),d=(u?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let E=[1,1,1,1],_=0;const A=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);A?_=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(E=r.get(B.COLOR).data);const R=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),g=R?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),O=T(a.buffer),I=new Uint8Array(a.buffer),v=this.vertexBufferLayout.stride/4;let P=n*v;const N=P;let L=0;const b=m?(e,t,r)=>L=m[r]:(e,t,r)=>L+=h(e,t),C=S.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,U=4/C,j=(e,t,r,s,a,n,o)=>{S[P++]=t[0],S[P++]=t[1],S[P++]=t[2],J(e,t,O,P*C),P+=U,J(r,t,O,P*C),P+=U,S[P++]=o;let l=P*C;if(O[l++]=s,O[l++]=a,u?(P=Math.ceil(l/C),S[P]=d,l+=C):O[l++]=d,A)O[l++]=_;else{const e=Math.min(4*n,E.length-4),t=l/C*4;l+=C,I[t]=255*E[e],I[t+1]=255*E[e+1],I[t+2]=255*E[e+2],I[t+3]=255*E[e+3]}R&&(O[l++]=g);let c=l/C*4;y()&&i&&(I[c++]=i[0],I[c++]=i[1],I[c++]=i[2],I[c++]=i[3]),P=Math.ceil(.25*c)};P+=v,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const D=this._isClosed(r);if(D){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),j(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),j(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const F=D?0:1,w=D?p:p-1;for(let h=F;h<w;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),b(me,ue,h),j(me,ue,Te,0,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);j(me,ue,Te,t,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,t,Y.RIGHT_JOIN_END,h,L)}j(me,ue,Te,1,Y.LEFT_JOIN_START,h,L),j(me,ue,Te,1,Y.RIGHT_JOIN_START,h,L),c(me,ue),c(ue,Te)}D?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),L=b(me,ue,w),j(me,ue,Te,0,Y.LEFT_JOIN_END,F,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,F,L)):(L=b(me,ue,w),j(me,ue,ue,0,Y.LEFT_CAP_END,w,L),j(me,ue,ue,0,Y.RIGHT_CAP_END,w,L)),$(S,N+v,S,N,v);return P=$(S,P-v,S,P,v),this._parameters.wireframe&&this._addWireframeVertices(a,N,P,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=E(),fe=E(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=g(),Ae=g(),Re=g(),ge=g();export{Q as Parameters,q as RibbonLineMaterial};
|
|
5
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{distance2 as E,fromPoints as _,create as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{fromPoints as g,create as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,A){const{options:S,camera:v,rayBegin:P,rayEnd:N}=m;if(!S.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;g(v.eye,Ee[0],Ee[1],_e),g(v.eye,Ee[1],Ee[2],Ae),g(v.eye,Ee[2],Ee[3],Re),g(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=E(_(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(_(ce,pe,he),_(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}A(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f16(B.SIZE),this.parameters.vvColor?e.f16(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvOpacity&&e.f16(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE),d=(u?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let E=[1,1,1,1],_=0;const A=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);A?_=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(E=r.get(B.COLOR).data);const R=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),g=R?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),O=T(a.buffer),I=new Uint8Array(a.buffer),v=this.vertexBufferLayout.stride/4;let P=n*v;const N=P;let L=0;const b=m?(e,t,r)=>L=m[r]:(e,t,r)=>L+=h(e,t),C=S.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,U=4/C,j=(e,t,r,s,a,n,o)=>{S[P++]=t[0],S[P++]=t[1],S[P++]=t[2],J(e,t,O,P*C),P+=U,J(r,t,O,P*C),P+=U,S[P++]=o;let l=P*C;if(O[l++]=s,O[l++]=a,u?(P=Math.ceil(l/C),S[P]=d,l+=C):O[l++]=d,A)O[l++]=_;else{const e=Math.min(4*n,E.length-4),t=l/C*4;l+=C,I[t]=255*E[e],I[t+1]=255*E[e+1],I[t+2]=255*E[e+2],I[t+3]=255*E[e+3]}R&&(O[l++]=g);let c=l/C*4;y()&&i&&(I[c++]=i[0],I[c++]=i[1],I[c++]=i[2],I[c++]=i[3]),P=Math.ceil(.25*c)};P+=v,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const D=this._isClosed(r);if(D){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),j(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),j(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const F=D?0:1,w=D?p:p-1;for(let h=F;h<w;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),b(me,ue,h),j(me,ue,Te,0,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);j(me,ue,Te,t,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,t,Y.RIGHT_JOIN_END,h,L)}j(me,ue,Te,1,Y.LEFT_JOIN_START,h,L),j(me,ue,Te,1,Y.RIGHT_JOIN_START,h,L),c(me,ue),c(ue,Te)}D?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),L=b(me,ue,w),j(me,ue,Te,0,Y.LEFT_JOIN_END,F,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,F,L)):(L=b(me,ue,w),j(me,ue,ue,0,Y.LEFT_CAP_END,w,L),j(me,ue,ue,0,Y.RIGHT_CAP_END,w,L)),$(S,N+v,S,N,v);return P=$(S,P-v,S,P,v),this._parameters.wireframe&&this._addWireframeVertices(a,N,P,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=A(),fe=A(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=S(),Ae=S(),Re=S(),ge=S();export{Q as Parameters,q as RibbonLineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as e,parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";var i;!function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.PremultipliedAlpha=2]="PremultipliedAlpha",t[t.Depth=3]="Depth",t[t.COUNT=4]="COUNT"}(i||(i={}));class r extends e{constructor(){super(...arguments),this.blitMode=i.None,this.hasOpacityFactor=!1}}t([o({count:i.COUNT})],r.prototype,"blitMode",void 0),t([o()],r.prototype,"hasOpacityFactor",void 0);export{i as BlitMode,r as CompositingTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{F as FocusAreaColorPassParameters,b as build}from"../../../../chunks/FocusAreaColor.glsl.js";
|
|
5
|
+
import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/focusArea/FocusAreaEffect.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{F as FocusAreaColorPassParameters,b as build}from"../../../../chunks/FocusAreaColor.glsl.js";
|
package/views/SceneView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{ObservableChangesType as d}from"../core/ObservableChangesType.js";import{throwIfAborted as u}from"../core/promiseUtils.js";import{on as c,watch as g,initial as m,sync as y,whenOnce as f,syncAndInitial as w}from"../core/reactiveUtils.js";import{setFrameDuration as v}from"../core/scheduling.js";import{createScreenPointArray as _,createScreenPoint as b}from"../core/screenUtils.js";import{getMetersPerUnitForSR as M}from"../core/unitUtils.js";import{initialize as S}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as C,ensureClass as O}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as T}from"../core/accessorSupport/overrideDefaultsFrom.js";import{create as x}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{owningCollectionProperty as E}from"../core/support/OwningCollection.js";import A from"../geometry/Extent.js";import L from"../geometry/HeightModelInfo.js";import H from"../geometry/Point.js";import{project as I,canProjectWithoutEngine as D}from"../geometry/projection.js";import G from"../geometry/SpatialReference.js";import{projectBoundingRect as F}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as P}from"../geometry/projection/projectPointToVector.js";import{create as U,toExtent as W}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as q}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as z}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as k,isTiledLayer as B,isVoxelLayer as N,isIntegratedMeshLayer as Q}from"../layers/support/layerUtils.js";import{AnalysesCollection as Y}from"../support/AnalysesCollection.js";import{WebSceneTag as Z}from"../support/tagSymbols.js";import{BreakpointsOwner as $}from"./BreakpointsOwner.js";import{DOMContainer as J}from"./DOMContainer.js";import K from"./GroundView.js";import{PopupView as X}from"./PopupView.js";import ee from"./View.js";import te from"./ViewAnimation.js";import{ViewingMode as ie,stringFromViewingMode as re,viewingModeFromString as se}from"./ViewingMode.js";import{layerView3DImporter as ne}from"./3d/layerViewModuleImportUtils.js";import ae from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as oe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as le}from"./3d/environment/EnvironmentManager.js";import pe from"./3d/environment/SceneViewEnvironment.js";import he from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as de}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ue}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as ce}from"./3d/layers/support/FeatureTileTree3D.js";import ge from"./3d/state/ViewState.js";import{ViewStateManager as me}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as fe}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as we}from"./3d/support/debugFlags.js";import ve from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as _e}from"./3d/support/ElevationProvider.js";import{toMap as be,hitTest as Me}from"./3d/support/hitTest.js";import{popupHitTest as Se}from"./3d/support/popupHitTest.js";import Ve from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as je}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Re}from"./3d/support/ResourceController.js";import Ce from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Oe}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Te}from"./3d/support/ViewSlice.js";import{PointsOfInterest as xe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ee from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ae,getTiledLayerInfo as Le,checkIfTileInfoSupportedForView as He}from"./3d/terrain/terrainUtils.js";import{Stage as Ie}from"./3d/webgl-engine/Stage.js";import{olidEnabled as De}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{defaultTolerance as Ge}from"./3d/webgl-engine/lib/Intersector.js";import{terrainId as Fe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{defaultHighlightName as Pe}from"./support/HighlightDefaults.js";import Ue from"./support/HighlightOptions.js";import{occludeesSupported as We}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as qe,createScreenPointFromSupportedEvent as ze}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ke}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Be,destroyTextureCompressionWorker as Ne}from"./support/TextureCompressionHelper.js";import{check as Qe}from"./support/WebGLRequirements.js";import Ye from"./ui/DefaultUI.js";import Ze from"./ui/3d/DefaultUI3D.js";import $e from"../webscene/Environment.js";let Je=class extends($(X(J(ee)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Re(this),this.deconflictor=new de({view:this}),this.labeler=new ue({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new Y,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new oe,this.environment=new pe,this.environmentManager=new le,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ae({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ge({view:this}),this.slice=new Te,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Ze,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,S();const t=(e=null)=>{null!=e&&e.type===d.MOVE||(this._updatingChanged(),this.map?.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([c((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),g((()=>this.scene),(e=>e?.load().catch((()=>{}))))]),this.inputManager=new he({view:this}),this.stateManager=new me({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=Be(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new K({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>v(e>0?1e3/Math.ceil(e):0)),m),this.addHandles([g((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),y),g((()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration})),(()=>this._updateSlice()),y)])}destroy(){this.destroyed||(Ne(this),this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this._exitBasemapTerrain(),this.stage?.destroy(),this.slice.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof A?this.spatialReference&&(t=Ke(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ie.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Ke(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||G.WGS84,i=Ke(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||G.WGS84;let t;const i=i=>{const r=Ke(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new A({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach((e=>s(e))),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}castEnvironment(e){return e?e instanceof pe?e:e instanceof $e?this.environment?.cloneWithWebsceneEnvironment(e)??pe.fromWebsceneEnvironment(e):C(pe,e):new pe}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Z in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){ve.isValidProfile(e)&&(ve.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||ve.getDefaultProfile()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?z(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ae(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return re(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?re(this.defaultsFromMap.viewingMode):ke(t,ie.Global)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find((({name:e})=>e===Pe))??new Ue}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===Pe)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Ce(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=qe(e)?ze(this,e):e;return be(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?_e(this.elevationProvider,e):null)??0;return P(e,Xe,this.renderSpatialReference,t),this.state.camera.projectToScreen(Xe,et),b(et[0],et[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;P(e,Xe,i);const r=this.state.camera.computeScreenPixelSizeAt(Xe);return t&&i!==t?r*M(i)/M(t):r}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e,(()=>this.pixelSizeAt(e))):1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=qe(e)?ze(this,e):e;return Me(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Se(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshotWithOID(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!De())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);await this.whenReady();const r=await this.stage.renderView.takeScreenshotWithOID(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ne.importLayerView(e)}hasLayerViewModule(e){return ne.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Qe(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?se(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ie.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ie.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!ke(e,i)&&(null==t||(!!k(t)||(!B(t)||null!=Le(t,e,i))&&(!N(t)||i!==ie.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(k(t)&&(r||s)){return!s||i===ie.Local||null===He(t.tileInfo,t.fullExtent,e,ie.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:G.WebMercator,viewingMode:i}]:[{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}return B(t)||N(t)||!r&&!s?B(t)&&r&&i!==ie.Global?[{spatialReference:e,viewingMode:i},{spatialReference:G.WGS84,viewingMode:ie.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${re(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&We(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter((e=>"media-3d"!==e.type)).find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await f((()=>this.graphicsView)),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer):null}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await it[e]();return t&&(u(i.signal),await t(i.signal)),u(i.signal),this._importControllers.delete(e),r}catch{this._importControllers.delete(e)}return null}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ee({view:this})),this._set("elevationProvider",new fe({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){const e=this.basemapTerrain,t=this.elevationProvider;e&&(this._set("basemapTerrain",null),this._set("elevationProvider",null),t.unregister(e),t.destroy(),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new xe({view:this})),this._set("featureTiles",new ce({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?I(W(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>we.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&we.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||we.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),w),this.updatingHandles.add((()=>this.clippingArea),e,w),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,w)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.featureTiles&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this._set("featureTiles",p(this.featureTiles)),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=q(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",je.create(this.state.viewingMode,i)),t||this.addHandles(g((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!F(e,this.basemapTerrain.spatialReference,tt,t)||(this.renderCoordsHelper.extent=tt)}),y),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Ge/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===d.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(g((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),y),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new ye(this.state.viewingMode,(e=>this.stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ie({view:this,options:e,container:i}),this._updateSlice(),this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this.stage.renderer.setParameters({highQualityTransparency:e})),m),this.on("pointer-move",(()=>this.stage?.renderer.resetAnimation())),a(this.stage.renderView.canvas,"webglcontextlost",(e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)}))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Ge/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Oe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this._importModule("GraphicsView3D",(e=>f((()=>this.basemapTerrain?.ready),e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this._importModule("FocusAreasView"))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){const e=se(this.viewingMode);e===ie.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(c((()=>this.graphics),"after-changes",(()=>this._ensureGraphicsView())),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(g((()=>this.map?.focusAreas?.areas.length??0),(e=>this._ensureFocusAreasView(e)),{initial:!0}),"FocusAreasView");const t=this.scene?.initialViewProperties??null,i=t?.environment;i&&(this._overrideDefaultEnvironmentOnly?T(this.environment,i):this.environment=this.environment.cloneWithWebsceneEnvironment(i)),this.timeExtent=t?.timeExtent,t?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(Fe);for(const t of this.allLayerViews)Q(t.layer.type)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(Fe);for(const t of this.allLayerViews)Q(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}};function Ke(e,t){return null!=e&&D(e.spatialReference,t)?I(e,t):null}e([V()],Je.prototype,"_userClippingArea",void 0),e([V()],Je.prototype,"_resourceController",void 0),e([V()],Je.prototype,"_stage",void 0),e([V({readOnly:!0})],Je.prototype,"deconflictor",void 0),e([V({readOnly:!0})],Je.prototype,"labeler",void 0),e([V(E(Y,"analyses"))],Je.prototype,"analyses",void 0),e([V({type:te,readOnly:!0})],Je.prototype,"animation",null),e([V({readOnly:!0})],Je.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],Je.prototype,"elevationProvider",void 0),e([V()],Je.prototype,"camera",null),e([V({type:t})],Je.prototype,"contentCamera",null),e([V({readOnly:!0})],Je.prototype,"canvas",void 0),e([V({type:H})],Je.prototype,"center",null),e([V({type:A})],Je.prototype,"clippingArea",null),e([V({type:oe})],Je.prototype,"constraints",void 0),e([V({type:A,readOnly:!0})],Je.prototype,"renderDataExtent",null),e([V({readOnly:!0})],Je.prototype,"tileInfo",null),e([V({type:A,readOnly:!0})],Je.prototype,"dataExtent",null),e([V({type:A,readOnly:!0})],Je.prototype,"_groundAndLayersExtent",null),e([V({type:pe})],Je.prototype,"environment",void 0),e([j("environment")],Je.prototype,"castEnvironment",null),e([V({readOnly:!0})],Je.prototype,"environmentManager",void 0),e([V({type:A})],Je.prototype,"extent",null),e([V({type:r})],Je.prototype,"floors",void 0),e([V()],Je.prototype,"screenCenter",null),e([V()],Je.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],Je.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],Je.prototype,"graphicsView",void 0),e([V({readOnly:!0})],Je.prototype,"analysisViewManager",void 0),e([V()],Je.prototype,"groundView",void 0),e([V({type:Boolean})],Je.prototype,"initialExtentRequired",null),e([V()],Je.prototype,"defaultsFromMapSettings",null),e([V()],Je.prototype,"interacting",null),e([V()],Je.prototype,"stationary",null),e([V()],Je.prototype,"navigating",null),e([V()],Je.prototype,"map",void 0),e([V()],Je.prototype,"padding",null),e([V({type:xe,readOnly:!0})],Je.prototype,"pointsOfInterest",void 0),e([V({type:ce,readOnly:!0})],Je.prototype,"featureTiles",void 0),e([V()],Je.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],Je.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],Je.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],Je.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],Je.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],Je.prototype,"state",void 0),e([V({readOnly:!0})],Je.prototype,"inputManager",void 0),e([V({readOnly:!0})],Je.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],Je.prototype,"qualityProfile",null),e([V({type:Ve,get(){let e=this._get("qualitySettings");return e||(e=new Ve,ve.apply(this.qualityProfile,e)),e}})],Je.prototype,"qualitySettings",void 0),e([V()],Je.prototype,"slice",void 0),e([V({readOnly:!0})],Je.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],Je.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],Je.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Je.prototype,"resolution",null),e([V({type:Number})],Je.prototype,"scale",null),e([V()],Je.prototype,"heightModelInfo",null),e([V()],Je.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],Je.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],Je.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],Je.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],Je.prototype,"type",void 0),e([V(),j((e=>e instanceof Ye?e:O(Ze,e)))],Je.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Je.prototype,"updating",null),e([V()],Je.prototype,"_updatingObjects",null),e([V()],Je.prototype,"_updatingObjectsWithProgress",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],Je.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],Je.prototype,"viewingMode",null),e([V({type:i})],Je.prototype,"viewpoint",null),e([V({readOnly:!0})],Je.prototype,"visibleArea",null),e([V({type:Number})],Je.prototype,"zoom",null),e([V({type:Ue})],Je.prototype,"highlightOptions",null),e([V({readOnly:!0})],Je.prototype,"quality",null),e([V({readOnly:!0})],Je.prototype,"resolutionScale",null),e([V()],Je.prototype,"focusAreasView",void 0),e([V()],Je.prototype,"_defaultToMapOptions",null),e([V()],Je.prototype,"_defaultHitTestOptions",null),Je=e([R("esri.views.SceneView")],Je);const Xe=x(),et=_(),tt=U(),it={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js")},rt=Je;export{rt as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{ObservableChangesType as d}from"../core/ObservableChangesType.js";import{throwIfAborted as u}from"../core/promiseUtils.js";import{on as c,watch as g,initial as m,sync as y,whenOnce as f,syncAndInitial as w}from"../core/reactiveUtils.js";import{setFrameDuration as v}from"../core/scheduling.js";import{createScreenPointArray as _,createScreenPoint as b}from"../core/screenUtils.js";import{getMetersPerUnitForSR as M}from"../core/unitUtils.js";import{initialize as S}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as C,ensureClass as O}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as T}from"../core/accessorSupport/overrideDefaultsFrom.js";import{create as x}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{owningCollectionProperty as E}from"../core/support/OwningCollection.js";import A from"../geometry/Extent.js";import L from"../geometry/HeightModelInfo.js";import H from"../geometry/Point.js";import{project as I,canProjectWithoutEngine as D}from"../geometry/projectionUtils.js";import G from"../geometry/SpatialReference.js";import{projectBoundingRect as F}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as P}from"../geometry/projection/projectPointToVector.js";import{create as U,toExtent as W}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as q}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as z}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as k,isTiledLayer as B,isVoxelLayer as N,isIntegratedMeshLayer as Q}from"../layers/support/layerUtils.js";import{AnalysesCollection as Y}from"../support/AnalysesCollection.js";import{WebSceneTag as Z}from"../support/tagSymbols.js";import{BreakpointsOwner as $}from"./BreakpointsOwner.js";import{DOMContainer as J}from"./DOMContainer.js";import K from"./GroundView.js";import{PopupView as X}from"./PopupView.js";import ee from"./View.js";import te from"./ViewAnimation.js";import{ViewingMode as ie,stringFromViewingMode as re,viewingModeFromString as se}from"./ViewingMode.js";import{layerView3DImporter as ne}from"./3d/layerViewModuleImportUtils.js";import ae from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as oe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as le}from"./3d/environment/EnvironmentManager.js";import pe from"./3d/environment/SceneViewEnvironment.js";import he from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as de}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ue}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as ce}from"./3d/layers/support/FeatureTileTree3D.js";import ge from"./3d/state/ViewState.js";import{ViewStateManager as me}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as fe}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as we}from"./3d/support/debugFlags.js";import ve from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as _e}from"./3d/support/ElevationProvider.js";import{toMap as be,hitTest as Me}from"./3d/support/hitTest.js";import{popupHitTest as Se}from"./3d/support/popupHitTest.js";import Ve from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as je}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Re}from"./3d/support/ResourceController.js";import Ce from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Oe}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Te}from"./3d/support/ViewSlice.js";import{PointsOfInterest as xe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ee from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ae,getTiledLayerInfo as Le,checkIfTileInfoSupportedForView as He}from"./3d/terrain/terrainUtils.js";import{Stage as Ie}from"./3d/webgl-engine/Stage.js";import{olidEnabled as De}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{defaultTolerance as Ge}from"./3d/webgl-engine/lib/Intersector.js";import{terrainId as Fe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{defaultHighlightName as Pe}from"./support/HighlightDefaults.js";import Ue from"./support/HighlightOptions.js";import{occludeesSupported as We}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as qe,createScreenPointFromSupportedEvent as ze}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ke}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Be,destroyTextureCompressionWorker as Ne}from"./support/TextureCompressionHelper.js";import{check as Qe}from"./support/WebGLRequirements.js";import Ye from"./ui/DefaultUI.js";import Ze from"./ui/3d/DefaultUI3D.js";import $e from"../webscene/Environment.js";let Je=class extends($(X(J(ee)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Re(this),this.deconflictor=new de({view:this}),this.labeler=new ue({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new Y,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new oe,this.environment=new pe,this.environmentManager=new le,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ae({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ge({view:this}),this.slice=new Te,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Ze,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,S();const t=(e=null)=>{null!=e&&e.type===d.MOVE||(this._updatingChanged(),this.map?.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([c((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),g((()=>this.scene),(e=>e?.load().catch((()=>{}))))]),this.inputManager=new he({view:this}),this.stateManager=new me({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=Be(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new K({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>v(e>0?1e3/Math.ceil(e):0)),m),this.addHandles([g((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),y),g((()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration})),(()=>this._updateSlice()),y)])}destroy(){this.destroyed||(Ne(this),this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this._exitBasemapTerrain(),this.stage?.destroy(),this.slice.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof A?this.spatialReference&&(t=Ke(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ie.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Ke(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||G.WGS84,i=Ke(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||G.WGS84;let t;const i=i=>{const r=Ke(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new A({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach((e=>s(e))),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}castEnvironment(e){return e?e instanceof pe?e:e instanceof $e?this.environment?.cloneWithWebsceneEnvironment(e)??pe.fromWebsceneEnvironment(e):C(pe,e):new pe}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Z in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){ve.isValidProfile(e)&&(ve.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||ve.getDefaultProfile()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?z(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ae(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return re(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?re(this.defaultsFromMap.viewingMode):ke(t,ie.Global)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find((({name:e})=>e===Pe))??new Ue}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===Pe)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Ce(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=qe(e)?ze(this,e):e;return be(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?_e(this.elevationProvider,e):null)??0;return P(e,Xe,this.renderSpatialReference,t),this.state.camera.projectToScreen(Xe,et),b(et[0],et[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;P(e,Xe,i);const r=this.state.camera.computeScreenPixelSizeAt(Xe);return t&&i!==t?r*M(i)/M(t):r}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e,(()=>this.pixelSizeAt(e))):1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=qe(e)?ze(this,e):e;return Me(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Se(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshotWithOID(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!De())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);await this.whenReady();const r=await this.stage.renderView.takeScreenshotWithOID(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ne.importLayerView(e)}hasLayerViewModule(e){return ne.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Qe(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?se(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ie.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ie.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!ke(e,i)&&(null==t||(!!k(t)||(!B(t)||null!=Le(t,e,i))&&(!N(t)||i!==ie.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(k(t)&&(r||s)){return!s||i===ie.Local||null===He(t.tileInfo,t.fullExtent,e,ie.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:G.WebMercator,viewingMode:i}]:[{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}return B(t)||N(t)||!r&&!s?B(t)&&r&&i!==ie.Global?[{spatialReference:e,viewingMode:i},{spatialReference:G.WGS84,viewingMode:ie.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${re(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&We(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter((e=>"media-3d"!==e.type)).find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await f((()=>this.graphicsView)),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer):null}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await it[e]();return t&&(u(i.signal),await t(i.signal)),u(i.signal),this._importControllers.delete(e),r}catch{this._importControllers.delete(e)}return null}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ee({view:this})),this._set("elevationProvider",new fe({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){const e=this.basemapTerrain,t=this.elevationProvider;e&&(this._set("basemapTerrain",null),this._set("elevationProvider",null),t.unregister(e),t.destroy(),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new xe({view:this})),this._set("featureTiles",new ce({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?I(W(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>we.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&we.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||we.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),w),this.updatingHandles.add((()=>this.clippingArea),e,w),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,w)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.featureTiles&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this._set("featureTiles",p(this.featureTiles)),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=q(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",je.create(this.state.viewingMode,i)),t||this.addHandles(g((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!F(e,this.basemapTerrain.spatialReference,tt,t)||(this.renderCoordsHelper.extent=tt)}),y),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Ge/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===d.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(g((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),y),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new ye(this.state.viewingMode,(e=>this.stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ie({view:this,options:e,container:i}),this._updateSlice(),this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this.stage.renderer.setParameters({highQualityTransparency:e})),m),this.on("pointer-move",(()=>this.stage?.renderer.resetAnimation())),a(this.stage.renderView.canvas,"webglcontextlost",(e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)}))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Ge/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Oe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this._importModule("GraphicsView3D",(e=>f((()=>this.basemapTerrain?.ready),e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this._importModule("FocusAreasView"))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){const e=se(this.viewingMode);e===ie.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(c((()=>this.graphics),"after-changes",(()=>this._ensureGraphicsView())),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(g((()=>this.map?.focusAreas?.areas.length??0),(e=>this._ensureFocusAreasView(e)),{initial:!0}),"FocusAreasView");const t=this.scene?.initialViewProperties??null,i=t?.environment;i&&(this._overrideDefaultEnvironmentOnly?T(this.environment,i):this.environment=this.environment.cloneWithWebsceneEnvironment(i)),this.timeExtent=t?.timeExtent,t?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(Fe);for(const t of this.allLayerViews)Q(t.layer.type)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(Fe);for(const t of this.allLayerViews)Q(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}};function Ke(e,t){return null!=e&&D(e.spatialReference,t)?I(e,t):null}e([V()],Je.prototype,"_userClippingArea",void 0),e([V()],Je.prototype,"_resourceController",void 0),e([V()],Je.prototype,"_stage",void 0),e([V({readOnly:!0})],Je.prototype,"deconflictor",void 0),e([V({readOnly:!0})],Je.prototype,"labeler",void 0),e([V(E(Y,"analyses"))],Je.prototype,"analyses",void 0),e([V({type:te,readOnly:!0})],Je.prototype,"animation",null),e([V({readOnly:!0})],Je.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],Je.prototype,"elevationProvider",void 0),e([V()],Je.prototype,"camera",null),e([V({type:t})],Je.prototype,"contentCamera",null),e([V({readOnly:!0})],Je.prototype,"canvas",void 0),e([V({type:H})],Je.prototype,"center",null),e([V({type:A})],Je.prototype,"clippingArea",null),e([V({type:oe})],Je.prototype,"constraints",void 0),e([V({type:A,readOnly:!0})],Je.prototype,"renderDataExtent",null),e([V({readOnly:!0})],Je.prototype,"tileInfo",null),e([V({type:A,readOnly:!0})],Je.prototype,"dataExtent",null),e([V({type:A,readOnly:!0})],Je.prototype,"_groundAndLayersExtent",null),e([V({type:pe})],Je.prototype,"environment",void 0),e([j("environment")],Je.prototype,"castEnvironment",null),e([V({readOnly:!0})],Je.prototype,"environmentManager",void 0),e([V({type:A})],Je.prototype,"extent",null),e([V({type:r})],Je.prototype,"floors",void 0),e([V()],Je.prototype,"screenCenter",null),e([V()],Je.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],Je.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],Je.prototype,"graphicsView",void 0),e([V({readOnly:!0})],Je.prototype,"analysisViewManager",void 0),e([V()],Je.prototype,"groundView",void 0),e([V({type:Boolean})],Je.prototype,"initialExtentRequired",null),e([V()],Je.prototype,"defaultsFromMapSettings",null),e([V()],Je.prototype,"interacting",null),e([V()],Je.prototype,"stationary",null),e([V()],Je.prototype,"navigating",null),e([V()],Je.prototype,"map",void 0),e([V()],Je.prototype,"padding",null),e([V({type:xe,readOnly:!0})],Je.prototype,"pointsOfInterest",void 0),e([V({type:ce,readOnly:!0})],Je.prototype,"featureTiles",void 0),e([V()],Je.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],Je.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],Je.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],Je.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],Je.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],Je.prototype,"state",void 0),e([V({readOnly:!0})],Je.prototype,"inputManager",void 0),e([V({readOnly:!0})],Je.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],Je.prototype,"qualityProfile",null),e([V({type:Ve,get(){let e=this._get("qualitySettings");return e||(e=new Ve,ve.apply(this.qualityProfile,e)),e}})],Je.prototype,"qualitySettings",void 0),e([V()],Je.prototype,"slice",void 0),e([V({readOnly:!0})],Je.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],Je.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],Je.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Je.prototype,"resolution",null),e([V({type:Number})],Je.prototype,"scale",null),e([V()],Je.prototype,"heightModelInfo",null),e([V()],Je.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],Je.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],Je.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],Je.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],Je.prototype,"type",void 0),e([V(),j((e=>e instanceof Ye?e:O(Ze,e)))],Je.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Je.prototype,"updating",null),e([V()],Je.prototype,"_updatingObjects",null),e([V()],Je.prototype,"_updatingObjectsWithProgress",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],Je.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],Je.prototype,"viewingMode",null),e([V({type:i})],Je.prototype,"viewpoint",null),e([V({readOnly:!0})],Je.prototype,"visibleArea",null),e([V({type:Number})],Je.prototype,"zoom",null),e([V({type:Ue})],Je.prototype,"highlightOptions",null),e([V({readOnly:!0})],Je.prototype,"quality",null),e([V({readOnly:!0})],Je.prototype,"resolutionScale",null),e([V()],Je.prototype,"focusAreasView",void 0),e([V()],Je.prototype,"_defaultToMapOptions",null),e([V()],Je.prototype,"_defaultHitTestOptions",null),Je=e([R("esri.views.SceneView")],Je);const Xe=x(),et=_(),tt=U(),it={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js")},rt=Je;export{rt as default};
|
package/views/VideoView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,initial as m,whenOnce as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import u from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import b from"../layers/support/TileInfo.js";import v from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import C from"./2d/AnimationManager.js";import x from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./webgl/FBOAttachmentType.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"./2d/engine/transitions/FadeTransition.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import E from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as S}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import q from"./2d/engine/webgl/OverlayContainer.js";import V from"./navigation/Navigation.js";import R from"./ui/DefaultUI.js";import T from"./ui/video/DefaultUIVideo.js";const O=new t("#000");let W;async function z(){const[,{Stage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);W=e}const A=.01;let k=class extends s{};k=e([h("esri.views.VideoView.Base")],k);let U=class extends(_(M(r.EventedMixin(n.EsriPromiseMixin(k))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.layer=null,this.navigation=new V,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new S({constraints:new x({view:this,minScale:1,maxScale:A})}),this.type="2d",this.ui=new T,this.view2dType="video",this.addHandles([a((()=>this.preconditionsReady),(e=>e?this._startup():this._teardown())),a((()=>this.layer),(()=>this.addResolvingPromise(p((()=>this.ready)))),m),a((()=>this.videoSize),(([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)})),a((()=>[this.layer?.frameEffect,this._effectsContainer]),(()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)}),l)])}initialize(){this.addResolvingPromise(z().then((()=>(this._isValid=!0,p((()=>this.ready))))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference),this.stage=new W(this.surface,{renderingOptions:this.renderingOptions,backgroundColor:O}),this._prepareStage(this.stage);const t=new C({view:this});this._set("animationManager",t);const i=new E({view:this,animationManager:t});this._set("mapViewNavigation",i),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a((()=>this.stationary),(t=>e.stationary=t),l),a((()=>this.state.id),(()=>e.state=this.state),l),a((()=>this.renderingOptions),(t=>e.renderingOptions=t),l)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new v({video:this.layer?.videoElement,georeference:new u({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new P(this._videoElementView);this._overlayContainer=new q,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer)}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>A;r/=2)i.push(r);i.push(A);const{lods:s}=b.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([c()],U.prototype,"_overlayContainer",void 0),e([c()],U.prototype,"_isValid",void 0),e([c()],U.prototype,"_effectsContainer",void 0),e([c()],U.prototype,"constraintsInfo",null),e([c()],U.prototype,"layer",void 0),e([c({type:V,nonNullable:!0})],U.prototype,"navigation",void 0),e([c({readOnly:!0})],U.prototype,"preconditionsReady",null),e([c({readOnly:!0})],U.prototype,"ready",void 0),e([c({readOnly:!0})],U.prototype,"rendering",null),e([c()],U.prototype,"scale",null),e([c()],U.prototype,"spatialReference",void 0),e([c()],U.prototype,"stateManager",void 0),e([c()],U.prototype,"type",void 0),e([c(),d((e=>e instanceof R?e:g(T,e)))],U.prototype,"ui",void 0),e([c({readOnly:!0})],U.prototype,"videoSize",null),e([c({readOnly:!0})],U.prototype,"view2dType",void 0),U=e([h("esri.views.VideoView")],U);const D=U;export{D as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,initial as m,whenOnce as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{cast as c}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import u from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import b from"../layers/support/TileInfo.js";import v from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import C from"./2d/AnimationManager.js";import x from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as E}from"./2d/engine/Container.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./webgl/FBOAttachmentType.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"./2d/engine/transitions/FadeTransition.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import G from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as S}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import q from"./2d/engine/webgl/OverlayContainer.js";import V from"./navigation/Navigation.js";import R from"./ui/DefaultUI.js";import T from"./ui/video/DefaultUIVideo.js";const O=new t("#000");let W;async function z(){const[,{Stage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);W=e}const A=.01;let k=class extends s{};k=e([h("esri.views.VideoView.Base")],k);let U=class extends(_(M(r.EventedMixin(n.EsriPromiseMixin(k))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.layer=null,this.navigation=new V,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new S({constraints:new x({view:this,minScale:1,maxScale:A})}),this.type="2d",this.ui=new T,this.view2dType="video",this.addHandles([a((()=>this.preconditionsReady),(e=>e?this._startup():this._teardown())),a((()=>this.layer),(()=>this.addResolvingPromise(p((()=>this.ready)))),m),a((()=>this.videoSize),(([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)})),a((()=>[this.layer?.frameEffect,this._effectsContainer]),(()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)}),l)])}initialize(){this.addResolvingPromise(z().then((()=>(this._isValid=!0,p((()=>this.ready))))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference),this.stage=new W(this.surface,{renderingOptions:this.renderingOptions,backgroundColor:O}),this._prepareStage(this.stage);const t=new C({view:this});this._set("animationManager",t);const i=new G({view:this,animationManager:t});this._set("mapViewNavigation",i),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a((()=>this.stationary),(t=>e.stationary=t),l),a((()=>this.state.id),(()=>e.state=this.state),l),a((()=>this.renderingOptions),(t=>e.renderingOptions=t),l)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new v({video:this.layer?.videoElement,georeference:new u({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new P(this._videoElementView);this._overlayContainer=new q,this._overlayContainer.addChild(t),this._effectsContainer=new E,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>A;r/=2)i.push(r);i.push(A);const{lods:s}=b.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([d()],U.prototype,"_overlayContainer",void 0),e([d()],U.prototype,"_isValid",void 0),e([d()],U.prototype,"_effectsContainer",void 0),e([d()],U.prototype,"constraintsInfo",null),e([d()],U.prototype,"layer",void 0),e([d({type:V,nonNullable:!0})],U.prototype,"navigation",void 0),e([d({readOnly:!0})],U.prototype,"preconditionsReady",null),e([d({readOnly:!0})],U.prototype,"ready",void 0),e([d({readOnly:!0})],U.prototype,"rendering",null),e([d()],U.prototype,"scale",null),e([d()],U.prototype,"spatialReference",void 0),e([d()],U.prototype,"stateManager",void 0),e([d()],U.prototype,"type",void 0),e([d(),c((e=>e instanceof R?e:g(T,e)))],U.prototype,"ui",void 0),e([d({readOnly:!0})],U.prototype,"videoSize",null),e([d({readOnly:!0})],U.prototype,"view2dType",void 0),U=e([h("esri.views.VideoView")],U);const D=U;export{D as default};
|
package/views/View2D.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as p}from"../core/workers/workers.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import u from"../geometry/Polygon.js";import{isLoadedOrLoadFor as m}from"../geometry/projection.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as w}from"./DOMContainer.js";import{PopupView as V}from"./PopupView.js";import M from"./View.js";import{Viewport2DMixin as b}from"./Viewport2DMixin.js";import v from"./2d/AnimationManager.js";import{layerView2DImporter as _}from"./2d/layerViewModuleImportUtils.js";import j from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as S}from"./2d/viewpointUtils.js";import L from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as R}from"./2d/layers/support/util.js";import{clipContainsPoint as O}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as T,setDefaultHighlightOptions as k}from"./2d/support/highlightOptionsUtils.js";import{hitTest as C}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as x,takeScreenshot as D}from"./2d/support/screenshotUtils.js";import{Timeline as E}from"./2d/support/Timeline.js";import P from"./navigation/Navigation.js";import G from"./navigation/NavigationActionMap.js";import U from"./support/HighlightOptions.js";import{isSupportedScreenPointEvent as q,createScreenPointFromSupportedEvent as z}from"./support/screenUtils.js";import{check as A}from"./support/WebGLRequirements.js";import I from"./ui/DefaultUI.js";import N from"./ui/2d/DefaultUI2D.js";import{isWebMap as W}from"../webmap/utils.js";import $ from"../webmap/background/ColorBackground.js";let F,H,B,Z,J,K,Q;async function X(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);H=e,B=t,Z=i,J=r,K=s,Q=a,F=n}let Y=class extends(b(f(V(w(M))))){constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new P({actionMap:new G({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.floors=new i,this.grid=null,this.map=null,this.spatialReferenceLocked=!1,this.timeline=new E,this.type="2d",this.view2dType=null,this.ui=new N,this.test={takeScreenshot:async e=>x(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},p()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new L(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}get background(){return W(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get highlightOptions(){return T(this)}set highlightOptions(e){k(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resolution(){return this.stateManager.resolution??0}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating))||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce(((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating})),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get visibleArea(){const e=this.stateManager.visibleArea;return e?new u({rings:[e.map((e=>[e[0],e[1]]))],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return C(this,e,t)}async takeScreenshot(e){return D(this._getScreenshotView(e),e)}toMap(e){if(!this.ready)return null;const t=q(e)?z(this,e):e;return this.stateManager.toMap(t)}toScreen(e,t){return this.stateManager.toScreen(e,t)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return W(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return W(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return _.hasLayerViewModule(e)}importLayerView(e){return _.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter((i=>i.clips.every((i=>O(this,i,e,t))))).reverse(),s=new globalThis.Map(r.map((e=>[e.layer.uid,e]))),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=A(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e){a.getLogger(this).warn("#validate()",e.message);const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const s=document.createElement("a");throw s.innerHTML="https://esriurl.com/systemRequirements",s.target="_blank",s.setAttribute("style","font-size: 18px;"),s.href="https://esriurl.com/systemRequirements",t.appendChild(i),t.appendChild(r),t.appendChild(s),this.surface.appendChild(t),e}}loadAsyncDependencies(){return X()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,d=l?.rotation??0,g=l?.scale||p&&S(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),c=o.center??h,u=o.rotation??d,m=o.scale??g;return c&&m?new t({targetGeometry:c,scale:m,rotation:u}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new F(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=t,this._magnifierView=new K,this._magnifierView.magnifier=this.magnifier,this._gridView=new Q;const i=new Z({view:this});this._set("labelManager",i);const r=new v({view:this});this._set("animationManager",r);const s=new J({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),t.on("webgl-error",(e=>this.fatalError=e.error)),o((()=>this.stationary),(e=>t.stationary=e),l),o((()=>this.background),(e=>{t.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color}),l),o((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),l),o((()=>this.grid),(e=>this._gridView.grid=e),l),o((()=>this.renderingOptions),(e=>t.renderingOptions=e),l),o((()=>this.highlights.items.map((e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})))),(()=>{t.highlightGradient=R(t.highlightGradient,this.highlights.items)}),l),o((()=>this.state.id),(()=>t.state=this.state),l)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new j(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new H({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new B(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([h({constructOnly:!0})],Y.prototype,"deactivatedWebGLExtensions",void 0),e([h({constructOnly:!0})],Y.prototype,"debugWebGLExtensions",void 0),e([h({readOnly:!0})],Y.prototype,"featuresTilingScheme",void 0),e([h({readOnly:!0})],Y.prototype,"graphicsTileStore",null),e([h()],Y.prototype,"graphicsView",void 0),e([h()],Y.prototype,"constraintsInfo",null),e([h()],Y.prototype,"initialExtentRequired",null),e([h()],Y.prototype,"labelManager",void 0),e([h({type:P,nonNullable:!0})],Y.prototype,"navigation",void 0),e([h({constructOnly:!0})],Y.prototype,"renderCanvas",void 0),e([h()],Y.prototype,"renderingOptions",void 0),e([h({constructOnly:!0})],Y.prototype,"supersampleScreenshotsEnabled",void 0),e([h({readOnly:!0})],Y.prototype,"supportsGround",void 0),e([h()],Y.prototype,"defaultsFromMapSettings",null),e([h({readOnly:!0})],Y.prototype,"typeSpecificPreconditionsReady",null),e([h({type:$})],Y.prototype,"background",null),e([h()],Y.prototype,"center",null),e([h({type:i})],Y.prototype,"floors",void 0),e([h()],Y.prototype,"grid",void 0),e([h({type:U})],Y.prototype,"highlightOptions",null),e([h()],Y.prototype,"map",void 0),e([h()],Y.prototype,"padding",null),e([h({readOnly:!0})],Y.prototype,"rendering",null),e([h({readOnly:!0})],Y.prototype,"resolution",null),e([h()],Y.prototype,"scale",null),e([h({constructOnly:!0})],Y.prototype,"spatialReferenceLocked",void 0),e([h({readOnly:!0})],Y.prototype,"tileInfo",null),e([h({type:E,readOnly:!0})],Y.prototype,"timeline",void 0),e([h({readOnly:!0})],Y.prototype,"type",void 0),e([h({readOnly:!0})],Y.prototype,"updating",null),e([h({readOnly:!0})],Y.prototype,"view2dType",void 0),e([h({readOnly:!0})],Y.prototype,"visibleArea",null),e([h()],Y.prototype,"zoom",null),e([h({readOnly:!0})],Y.prototype,"navigating",null),e([h(),d((e=>e instanceof I?e:c(N,e)))],Y.prototype,"ui",void 0),Y=e([g("esri.views.View2D")],Y);const ee=Y;export{ee as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as p}from"../core/workers/workers.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import u from"../geometry/Polygon.js";import{isLoadedOrLoadFor as m}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as w}from"./DOMContainer.js";import{PopupView as V}from"./PopupView.js";import M from"./View.js";import{Viewport2DMixin as b}from"./Viewport2DMixin.js";import v from"./2d/AnimationManager.js";import{layerView2DImporter as _}from"./2d/layerViewModuleImportUtils.js";import j from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as S}from"./2d/viewpointUtils.js";import L from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as R}from"./2d/layers/support/util.js";import{clipContainsPoint as O}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as T,setDefaultHighlightOptions as k}from"./2d/support/highlightOptionsUtils.js";import{hitTest as C}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as x,takeScreenshot as D}from"./2d/support/screenshotUtils.js";import{Timeline as E}from"./2d/support/Timeline.js";import P from"./navigation/Navigation.js";import G from"./navigation/NavigationActionMap.js";import U from"./support/HighlightOptions.js";import{isSupportedScreenPointEvent as q,createScreenPointFromSupportedEvent as z}from"./support/screenUtils.js";import{check as A}from"./support/WebGLRequirements.js";import I from"./ui/DefaultUI.js";import N from"./ui/2d/DefaultUI2D.js";import{isWebMap as W}from"../webmap/utils.js";import $ from"../webmap/background/ColorBackground.js";let F,H,B,Z,J,K,Q;async function X(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);H=e,B=t,Z=i,J=r,K=s,Q=a,F=n}let Y=class extends(b(f(V(w(M))))){constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new P({actionMap:new G({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.floors=new i,this.grid=null,this.map=null,this.spatialReferenceLocked=!1,this.timeline=new E,this.type="2d",this.view2dType=null,this.ui=new N,this.test={takeScreenshot:async e=>x(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},p()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new L(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}get background(){return W(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get highlightOptions(){return T(this)}set highlightOptions(e){k(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resolution(){return this.stateManager.resolution??0}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating))||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce(((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating})),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get visibleArea(){const e=this.stateManager.visibleArea;return e?new u({rings:[e.map((e=>[e[0],e[1]]))],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return C(this,e,t)}async takeScreenshot(e){return D(this._getScreenshotView(e),e)}toMap(e){if(!this.ready)return null;const t=q(e)?z(this,e):e;return this.stateManager.toMap(t)}toScreen(e,t){return this.stateManager.toScreen(e,t)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return W(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return W(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return _.hasLayerViewModule(e)}importLayerView(e){return _.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter((i=>i.clips.every((i=>O(this,i,e,t))))).reverse(),s=new globalThis.Map(r.map((e=>[e.layer.uid,e]))),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=A(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e){a.getLogger(this).warn("#validate()",e.message);const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const s=document.createElement("a");throw s.innerHTML="https://esriurl.com/systemRequirements",s.target="_blank",s.setAttribute("style","font-size: 18px;"),s.href="https://esriurl.com/systemRequirements",t.appendChild(i),t.appendChild(r),t.appendChild(s),this.surface.appendChild(t),e}}loadAsyncDependencies(){return X()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,d=l?.rotation??0,g=l?.scale||p&&S(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),c=o.center??h,u=o.rotation??d,m=o.scale??g;return c&&m?new t({targetGeometry:c,scale:m,rotation:u}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new F(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=t,this._magnifierView=new K,this._magnifierView.magnifier=this.magnifier,this._gridView=new Q;const i=new Z({view:this});this._set("labelManager",i);const r=new v({view:this});this._set("animationManager",r);const s=new J({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),t.on("webgl-error",(e=>this.fatalError=e.error)),o((()=>this.stationary),(e=>t.stationary=e),l),o((()=>this.background),(e=>{t.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color}),l),o((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),l),o((()=>this.grid),(e=>this._gridView.grid=e),l),o((()=>this.renderingOptions),(e=>t.renderingOptions=e),l),o((()=>this.highlights.items.map((e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})))),(()=>{t.highlightGradient=R(t.highlightGradient,this.highlights.items)}),l),o((()=>this.state.id),(()=>t.state=this.state),l)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new j(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new H({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new B(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([h({constructOnly:!0})],Y.prototype,"deactivatedWebGLExtensions",void 0),e([h({constructOnly:!0})],Y.prototype,"debugWebGLExtensions",void 0),e([h({readOnly:!0})],Y.prototype,"featuresTilingScheme",void 0),e([h({readOnly:!0})],Y.prototype,"graphicsTileStore",null),e([h()],Y.prototype,"graphicsView",void 0),e([h()],Y.prototype,"constraintsInfo",null),e([h()],Y.prototype,"initialExtentRequired",null),e([h()],Y.prototype,"labelManager",void 0),e([h({type:P,nonNullable:!0})],Y.prototype,"navigation",void 0),e([h({constructOnly:!0})],Y.prototype,"renderCanvas",void 0),e([h()],Y.prototype,"renderingOptions",void 0),e([h({constructOnly:!0})],Y.prototype,"supersampleScreenshotsEnabled",void 0),e([h({readOnly:!0})],Y.prototype,"supportsGround",void 0),e([h()],Y.prototype,"defaultsFromMapSettings",null),e([h({readOnly:!0})],Y.prototype,"typeSpecificPreconditionsReady",null),e([h({type:$})],Y.prototype,"background",null),e([h()],Y.prototype,"center",null),e([h({type:i})],Y.prototype,"floors",void 0),e([h()],Y.prototype,"grid",void 0),e([h({type:U})],Y.prototype,"highlightOptions",null),e([h()],Y.prototype,"map",void 0),e([h()],Y.prototype,"padding",null),e([h({readOnly:!0})],Y.prototype,"rendering",null),e([h({readOnly:!0})],Y.prototype,"resolution",null),e([h()],Y.prototype,"scale",null),e([h({constructOnly:!0})],Y.prototype,"spatialReferenceLocked",void 0),e([h({readOnly:!0})],Y.prototype,"tileInfo",null),e([h({type:E,readOnly:!0})],Y.prototype,"timeline",void 0),e([h({readOnly:!0})],Y.prototype,"type",void 0),e([h({readOnly:!0})],Y.prototype,"updating",null),e([h({readOnly:!0})],Y.prototype,"view2dType",void 0),e([h({readOnly:!0})],Y.prototype,"visibleArea",null),e([h()],Y.prototype,"zoom",null),e([h({readOnly:!0})],Y.prototype,"navigating",null),e([h(),d((e=>e instanceof I?e:c(N,e)))],Y.prototype,"ui",void 0),Y=e([g("esri.views.View2D")],Y);const ee=Y;export{ee as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import o from"../../core/Evented.js";import{watch as i,sync as s}from"../../core/reactiveUtils.js";import{screenPointObjectToArray as r,pt2px as l,createScreenPointArray as n}from"../../core/screenUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{j as p}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u,project as y}from"../../geometry/
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import o from"../../core/Evented.js";import{watch as i,sync as s}from"../../core/reactiveUtils.js";import{screenPointObjectToArray as r,pt2px as l,createScreenPointArray as n}from"../../core/screenUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{j as p}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u,project as y}from"../../geometry/projectionUtils.js";import{projectPointToVector as g}from"../../geometry/projection/projectPointToVector.js";import{getGraphicEffectiveElevationMode as b}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as d}from"../../symbols/support/defaults.js";import f from"../../symbols/support/ElevationInfo.js";import{getSymbolInfo as _}from"./support/utils.js";import{intersectsDrapedGeometry as v}from"../support/drapedUtils.js";let S=class extends e{set graphic(t){this._circleCollisionCache=null,this._originalSymbol=t.symbol,this._set("graphic",t),this.attachSymbolChanged()}get elevationInfo(){const{layer:t}=this.graphic,e=t&&"elevationInfo"in t?t.elevationInfo:null,o=b(this.graphic),i=e?e.offset:0;return new f({mode:o,offset:i})}set focusedSymbol(t){t!==this._get("focusedSymbol")&&(this._set("focusedSymbol",t),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(t){t!==this._get("grabbing")&&(this._set("grabbing",t),this._updateGraphicSymbol())}set hovering(t){t!==this._get("hovering")&&(this._set("hovering",t),this._updateGraphicSymbol())}set selected(t){t!==this._get("selected")&&(this._set("selected",t),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:t?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(t){super(t),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(t){const e=this.graphic;if(!1===e.visible)return null;const o=e.geometry;if(null==o)return null;const i=this._get("focusedSymbol"),s=null!=i?i:e.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,t,o,s):this._intersectDistance3D(this.view,t,e)}attach(){this.attachSymbolChanged(),null!=this.layer&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),null!=this.layer&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=i((()=>this.graphic?.symbol),(t=>{null!=t&&t!==this.focusedSymbol&&t!==this._originalSymbol&&(this._originalSymbol=t,this._focused&&null!=this.focusedSymbol&&(this.graphic.symbol=this.focusedSymbol))}),s)}detachSymbolChanged(){null!=this._graphicSymbolChangedHandle&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&null!=this.focusedSymbol?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(t,e,o,i){if(null==(i=i||d(o)))return null;const s=1;let n=this._circleCollisionCache;if("point"===o.type&&"cim"===i.type&&"CIMPointSymbol"===i.data.symbol?.type&&i.data.symbol.symbolLayers){const{offsetX:l,offsetY:n,size:a}=_(i),c=r(e,j),p=a/2,m=t.toScreen(o),u=m.x+l,y=m.y+n;return h(c,[u,y])<p*p?s:null}if("point"!==o.type||"simple-marker"!==i.type)return v(e,o,t)?s:null;if(null==n||!n.originalPoint.equals(o)){const e=o,s=t.spatialReference;if(u(e.spatialReference,s)){const t=y(e,s);n={originalPoint:e.clone(),mapPoint:t,radiusPx:l(i.size)},this._circleCollisionCache=n}}if(null!=n){const o=r(e,j),a=t.toScreen?.(n.mapPoint);if(!a)return null;const c=n.radiusPx,p=a.x+l(i.xoffset),m=a.y-l(i.yoffset);return h(o,[p,m])<c*c?s:null}return null}_intersectDistance3D(t,e,o){const i=t.toMap(e,{include:[o]});return i&&g(i,C,t.renderSpatialReference)?p(C,t.state.camera.eye):null}};t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"graphic",null),t([a()],S.prototype,"elevationInfo",null),t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),t([a({value:null})],S.prototype,"focusedSymbol",null),t([a({constructOnly:!0})],S.prototype,"layer",void 0),t([a()],S.prototype,"interactive",void 0),t([a()],S.prototype,"selectable",void 0),t([a()],S.prototype,"grabbable",void 0),t([a({value:!1})],S.prototype,"grabbing",null),t([a()],S.prototype,"dragging",void 0),t([a()],S.prototype,"hovering",null),t([a({value:!1})],S.prototype,"selected",null),t([a()],S.prototype,"cursor",void 0),S=t([c("esri.views.interactive.GraphicManipulator")],S);const C=m(),j=n();export{S as GraphicManipulator};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t}from"../../core/arrayUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{project as a}from"../../geometry/
|
|
5
|
+
import{isSome as t}from"../../core/arrayUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{project as a}from"../../geometry/projectionUtils.js";import{isMeshWithRelativeVertexSpace as o}from"../../geometry/support/meshVertexSpaceUtils.js";import{clonePoint as l,hydratedSpatialReference as c}from"../../layers/graphics/hydratedFeatures.js";import{getZForElevationMode as s}from"../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"./editGeometry/EditGeometryOperations.js";function i(t,n){let e=null,r=null;return a=>{if("cancel"===a.action)return void(null!=r&&(r.execute({action:"cancel"}),e=null,r=null));const o={action:a.action,screenStart:a.start,screenEnd:a.screenPoint};"start"===a.action&&null==e&&(e=new w,r=new w,n(t,e,r,a.pointerType,o)),null!=e&&e.execute(o),"end"===a.action&&null!=e&&(e=null,r=null)}}function p(t,n){return t.events.on("drag",i(t,n))}function m(t,n){const e=[t.x,t.y,t.z??0],r=n,a=[Math.cos(r),Math.sin(r)],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]);if(0===o)return null;a[0]/=o,a[1]/=o;const l=t=>{const n=(t.x-e[0])*a[0]+(t.y-e[1])*a[1];t.x=e[0]+n*a[0],t.y=e[1]+n*a[1]};return t=>(l(t.mapStart),l(t.mapEnd),{...t,axis:a})}function f(t){let n=null;return e=>{if("start"===e.action&&(n=y(t,e.mapStart.spatialReference)),null==n)return null;const r=e.mapEnd.x-e.mapStart.x,a=e.mapEnd.y-e.mapStart.y,o=(e.mapEnd.z??0)-(e.mapStart.z??0);return n.move(r,a,o,e.action),{...e,translationX:r,translationY:a,translationZ:o}}}function d(t,n){return null==t?null:t.spatialReference.equals(n)?t.clone():a(t,n)}function y(t,n){const e=t.operations;if(!e)return null;const r=e.data.geometry,l=c(n);if(r.spatialReference.equals(l))return x(t,e,(()=>{}));if("mesh"!==r.type){const n=d(r,l);if(null==n)return null;const o=r.spatialReference;return x(t,u.fromGeometry(n,e.viewingMode),(()=>{const t=a(r,o);e.trySetGeometry(t)}))}if(o(r)){const n=d(r.origin,l);if(!n)return null;const o=r.spatialReference,c=u.fromGeometry(n,e.viewingMode);return x(t,e,(()=>{const t=a(c.data.geometry,o),n=t.x-r.origin.x,l=t.y-r.origin.y,s=(t.z??0)-(r.origin.z??0);e.move(n,l,s)}))}return null}function x(t,n,e){let r=0,a=0,o=0;return{move:(l,c,s,u)=>{"start"===u&&(r=0,a=0,o=0);const i=l-r,p=c-a,m=s-o;n.move(i,p,m),r+=i,a+=p,o+=m,e(),"end"===u&&t.endInteraction?.()}}}function E(t,n=null,e){let r=null;const o=null==n||t.spatialReference?.equals(n)?t=>t:t=>null!=t?a(t,n):t,l={exclude:[],...e};return n=>{if("start"===n.action&&(r=o(t.toMap(n.screenStart,l))),null==r)return null;const e=o(t.toMap(n.screenEnd,l));return null!=e?{...n,mapStart:r,mapEnd:e}:null}}function S(n){const e=n.map((t=>f(t))).filter(t);return t=>{const n=t.mapEnd.x-t.mapStart.x,r=t.mapEnd.y-t.mapStart.y,a=t.mapEnd.z-t.mapStart.z;return e.forEach((n=>n(t))),{...t,translationX:n,translationY:r,translationZ:a}}}function h(t,e){const r=new Map;for(const a of e)r.set(a,n(t[a]));return n=>(r.forEach(((n,e)=>{t[e]=n})),n)}function g(t){const n=t.operations?.createResetState();return t=>(n?.remove(),t)}function z(t){const n=t.map((t=>g(t))).filter((t=>null!=t));return t=>(n.forEach((n=>n(t))),t)}function v(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z);const a=r.mapEnd.x-t,o=r.mapEnd.y-n,l=r.mapEnd.z-e;return t=r.mapEnd.x,n=r.mapEnd.y,e=r.mapEnd.z,{...r,mapDeltaX:a,mapDeltaY:o,mapDeltaZ:l,mapDeltaSpatialReference:r.mapStart.spatialReference}}}function j(){let t=0,n=0;return e=>{"start"===e.action&&(t=e.screenStart.x,n=e.screenStart.y);const r=e.screenEnd.x-t,a=e.screenEnd.y-n;return t=e.screenEnd.x,n=e.screenEnd.y,{...e,screenDeltaX:r,screenDeltaY:a}}}function M(t,n){let a=null,o=0,l=0;return c=>{if("start"===c.action&&(a=t.toScreen?.(n),null!=a&&(a.x<0||a.x>t.width||a.y<0||a.y>t.height?a=null:(o=c.screenStart.x-a.x,l=c.screenStart.y-a.y))),null==a)return null;const s=e(c.screenEnd.x-o,0,t.width),u=e(c.screenEnd.y-l,0,t.height),i=r(s,u);return c.screenStart=a,c.screenEnd=i,c}}const R=()=>{};class w{constructor(){this.execute=R}next(t,n=new w){return null!=t&&(this.execute=e=>{const r=t(e);null!=r&&n.execute(r)}),n}}function D(t,n,e=[]){if("2d"===t.type)return t=>t;let r=null;return a=>{"start"===a.action&&(r=t.toMap(a.screenStart,{exclude:e}),null!=r&&(r.z=s(r,t,n)));const o=t.toMap(a.screenEnd,{exclude:e});null!=o&&(o.z=s(o,t,n));const l=null!=r&&null!=o?{sceneStart:r,sceneEnd:o}:null;return{...a,scenePoints:l}}}function U(t,n,e){const r=n.elevationProvider.getElevation(t.x,t.y,t.z??0,t.spatialReference,"scene")??0,a=l(t);return a.z=r,a.hasZ=!0,a.z=s(a,n,e),a}function G(t,n){if("2d"===t.type)return t=>t;let e=null;return r=>{"start"===r.action&&(e=U(r.mapStart,t,n));const a=U(r.mapEnd,t,n),o=null!=e&&null!=a?{sceneStart:e,sceneEnd:a}:null;return{...r,scenePoints:o}}}export{w as EventPipeline,v as addMapDelta,j as addScreenDelta,m as constrainToMapAxis,i as createDragEventPipelineCallback,p as createManipulatorDragEventPipeline,M as dragAtLocation,f as dragManipulatedObject,S as dragManipulatedObjectMany,g as resetManipulatedObject,z as resetManipulatedObjectMany,h as resetProperties,D as sceneSnappingAtLocation,G as sceneSnappingAtProjectedLocation,E as screenToMap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import r from"../../../core/Logger.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{convertUnit as n}from"../../../core/unitUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{K as a}from"../../../chunks/vec32.js";import{isLoadedOrLoadFor as p,project as l}from"../../../geometry/projectionUtils.js";import{getClosestDenormalizedXToReference as c}from"../../../geometry/support/normalizeUtils.js";import{getResolutionForScale as u}from"../../../geometry/support/scaleUtils.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as d}from"../../2d/grid/constants.js";import{getScaleFactor as g,measureMetersPerUnitAtReferencePoint as f}from"../../2d/grid/gridUtils.js";import{create as h,createWritable as m}from"../sketch/normalizedPoint.js";import{gridPlacementGraphicSymbol as S}from"./snappingUtils.js";import{IntersectionSnappingCandidate as y}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as v}from"./candidates/LineSnappingCandidate.js";let w=class extends e{constructor(t){super(t),this.options=null}destroy(){this._set("options",null)}get grid(){return this.view.grid}get effectiveViewRotation(){return this.grid?.rotateWithMap?0:i(this.view.rotation??0)}get gridRotation(){return i(this.grid?.rotation??0)}get gridCenter(){const{spatialReference:t,grid:e}=this;if(!e||!t||!p(e.center.spatialReference,t))return null;try{const r=l(e.center,t),i=t.isWrappable&&null!=this.view?.center?c(r.x,this.view.center.x,t):r.x;return h(i,r.y,r.z)}catch(i){return r.getLogger(this).errorOnce("Grid Snapping - Failed to project grid center.",i),null}}get offsetScaleFactor(){const{pixelsPerStride:t,grid:e}=this;if(!e||!t)return 1;const{majorLineInterval:r,dynamicScaling:i}=e;return r<1?null:g(r,t,i)}get spatialReference(){return this.view.spatialReference}get gridMetersPerStride(){const{grid:t}=this;return t?n(t.spacing,t.units,"meters"):null}get viewMetersPerPixel(){const{viewMetersPerSRUnit:t}=this;return null==t?null:t*u(this.view.scale,this.view.spatialReference)}get viewMetersPerSRUnit(){const{spatialReference:t}=this.view;return this.gridCenter?f(this.gridCenter[0],this.gridCenter[1],t):null}get pixelsPerStride(){const{gridMetersPerStride:t,viewMetersPerPixel:e}=this;return e&&t?t/e:null}get updating(){return null!=this.grid&&null!=this.spatialReference&&null==this.viewMetersPerSRUnit}async fetchCandidates(t,e,r){const{options:i,view:n}=this;if(!i?.effectiveGridEnabled||!n.grid||r.feature?.attributes&&S in r.feature.attributes)return[];const o=r.coordinateHelper.arrayToPoint(t),s=i.distance*("touch"===r.pointer?i.touchSensitivityMultiplier:1);return this.fetchCandidatesSync(o,s)}fetchCandidatesSync(t,e){const r=[],{grid:i,effectiveViewRotation:n,gridRotation:o,gridCenter:s,viewMetersPerPixel:a,viewMetersPerSRUnit:c,offsetScaleFactor:u,spatialReference:g,gridMetersPerStride:f,pixelsPerStride:m}=this;if(!(i&&a&&c&&s&&g&&u&&f&&m))return r;if(!i.dynamicScaling&&m<d)return r;if(!p(t.spatialReference,g))return r;const S=l(t,g),w=h(S.x,S.y,S.z),x=P(w,-o,s,-n),C=f/c*u,U=j(x,C,s),{shouldSnapX:b,shouldSnapY:L}=R(U,x,e,a,c);if(!b&&!L)return[];const z=h((b?U:x)[0],(L?U:x)[1]),E=P(z,o,s,n),F=P(U,o,s,n);if(L){const t=M(U,x,C,"y"),e=P(t,o,s,n);r.push(new v({lineStart:F,lineEnd:e,targetPoint:E,isDraped:!1}))}if(b){const t=M(U,x,C,"x"),e=P(t,o,s,n);r.push(new v({lineStart:F,lineEnd:e,targetPoint:E,isDraped:!1}))}return b&&L&&r.push(new y(E,r[0],r[1],!1)),r}};t([o({constructOnly:!0})],w.prototype,"view",void 0),t([o()],w.prototype,"options",void 0),t([o()],w.prototype,"grid",null),t([o()],w.prototype,"effectiveViewRotation",null),t([o()],w.prototype,"gridRotation",null),t([o()],w.prototype,"gridCenter",null),t([o()],w.prototype,"offsetScaleFactor",null),t([o()],w.prototype,"spatialReference",null),t([o()],w.prototype,"gridMetersPerStride",null),t([o()],w.prototype,"viewMetersPerPixel",null),t([o()],w.prototype,"viewMetersPerSRUnit",null),t([o()],w.prototype,"pixelsPerStride",null),t([o()],w.prototype,"updating",null),w=t([s("esri.views.interactive.snapping.GridSnappingEngine")],w);const P=(t,e,r,i)=>{const n=m(t[0],t[1],t[2]);return a(n,a(n,n,r,e),r,i)},j=(t,e,r)=>{const i=(t[0]-r[0])/e,n=(t[1]-r[1])/e,o=Math.trunc(i),s=Math.trunc(n),a=Math.round(i%1),p=Math.round(n%1),l=r[0]+(o+a)*e,c=r[1]+(s+p)*e;return h(l,c)},R=(t,e,r,i,n)=>{if(i<=0)return{shouldSnapX:!1,shouldSnapY:!1};const o=(t[0]-e[0])/i,s=(t[1]-e[1])/i;return{shouldSnapX:Math.abs(o*n)<r,shouldSnapY:Math.abs(s*n)<r}},M=(t,e,r,i)=>{if("y"===i){const i=e[0]>t[0]?1:-1;return h(t[0]+r*i,t[1])}const n=e[1]>t[1]?1:-1;return h(t[0],t[1]+r*n)};export{w as GridSnappingEngine};
|