@arcgis/core 6.0.0-next.55 → 6.0.0-next.56
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/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
- package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
- package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
- package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
- package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
- package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
- package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
- package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
- package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
- package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
- package/assets/esri/core/workers/chunks/{e61082f56c08abe54b3a.js → 5954f02c3901b28d8e73.js} +1 -1
- package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
- package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
- package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
- package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
- package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
- package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
- package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
- package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
- package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
- package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
- package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
- package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
- package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
- package/assets/esri/core/workers/chunks/{14259910f44c08fd5bbd.js → 9117c9b720c9ba6e7a6e.js} +1 -1
- package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
- package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
- package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
- package/assets/esri/core/workers/chunks/{be0b8bb4f09aae6ff5de.js → ab784764ddf9d7f693a1.js} +1 -1
- package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
- package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
- package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
- package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
- package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
- package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
- package/assets/esri/core/workers/chunks/{9e508f930086d2ef5f22.js → dfa1b0308e5e82d1ddfe.js} +40 -41
- package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
- package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
- package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
- package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
- package/assets/esri/core/workers/chunks/{4401b3f8ebb658abe789.js → efd6ea0966f60ab19520.js} +1 -1
- package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
- package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
- package/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +14 -14
- package/chunks/Component.glsl.js +37 -37
- package/chunks/DefaultMaterial.glsl.js +15 -15
- package/chunks/HUDMaterial.glsl.js +3 -3
- package/chunks/Path.glsl.js +15 -15
- package/chunks/Pattern.glsl.js +20 -20
- package/chunks/RasterColorizer.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +24 -24
- package/chunks/Water.glsl.js +29 -20
- package/chunks/pdf.js +57 -0
- package/config.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/scheduling.js +1 -1
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/parserUtils.js +2 -0
- package/layers/support/ControlPoint.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/geospatialPDFUtils.d.ts +63 -0
- package/layers/support/geospatialPDFUtils.js +2 -0
- package/package.json +5 -5
- package/symbols/CIMSymbol.d.ts +9 -9
- package/symbols/PathSymbol3DLayer.d.ts +1 -1
- package/symbols/WaterSymbol3DLayer.d.ts +13 -1
- package/symbols/WaterSymbol3DLayer.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/EnvironmentView.js +1 -1
- package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/Manipulator3DBase.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/Tiles3DBVH.js +1 -1
- package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/Attribution.js +5 -5
- package/views/DOMContainer.d.ts +2 -1
- package/views/SceneView.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/webgl/Program.js +3 -3
- package/views/webgl/ShaderBuilder.js +23 -23
- package/webscene/Slide.js +1 -1
- package/webscene/VirtualLighting.d.ts +2 -4
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/forms/types.d.ts +23 -1
- package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
- package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
- package/assets/esri/core/workers/chunks/249a687ce1b6d0815242.js +0 -1
- package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
- package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
- package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
- package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
- package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
- package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
- package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
- package/assets/esri/core/workers/chunks/844c593754b2692257f4.js +0 -1
- package/assets/esri/core/workers/chunks/846248697c398468d8e6.js +0 -1
- package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
- package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
- package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
- package/assets/esri/core/workers/chunks/a116dd204921e7464944.js +0 -1
- package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
- package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
- package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
- package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
- package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
- package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
- package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
- package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
- package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
- package/chunks/NativeLine.glsl.js +0 -8
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
- /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
package/views/SceneView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a,ensureClass as o}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as s}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as c}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ee}from"../core/accessorSupport/trackingUtils.js";import l from"../core/Collection.js";import{byId as te}from"../core/domUtils.js";import u from"../core/Error.js";import{on as ne}from"../core/events.js";import{destroyHandle as re,makeHandle as d}from"../core/handleUtils.js";import has from"../core/has.js";import{create as ie}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ae}from"../core/libs/rbush/PooledRBush.js";import f from"../core/Logger.js";import{mapCollectionAsync as oe}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,maybeProperty as se}from"../core/maybe.js";import{throwIfDestroyed as ce,throwIfAborted as m,createAbortError as le}from"../core/promiseUtils.js";import ue from"../core/ReactiveSet.js";import{on as h,watch as g,initial as _,sync as v,whenOnce as y,syncAndInitial as b}from"../core/reactiveUtils.js";import{setFrameDuration as de,cleanupScheduling as fe}from"../core/scheduling.js";import{createScreenPoint as pe,createScreenPointArray as me}from"../core/screenUtils.js";import{cleanupWhereClauseCache as he}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ge,getMetersPerUnitForSR as x}from"../core/units.js";import{initialize as _e}from"../core/workers/workers.js";import S from"../geometry/Extent.js";import ve from"../geometry/HeightModelInfo.js";import ye from"../geometry/Point.js";import{projectBoundingRect as be}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as xe}from"../geometry/projection/projectPointToVector.js";import{project as Se,canProjectWithoutEngine as Ce}from"../geometry/projectionUtils.js";import C from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as we}from"../geometry/spatialReferenceEllipsoidUtils.js";import{toExtent as Te,create as Ee}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as De}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Oe}from"../geometry/support/scaleUtils.js";import{wgs84 as ke,webMercator as Ae}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as je}from"../layers/graphics/dehydratedPoint.js";import{IntegratedMeshSemantics as w}from"../layers/support/IntegratedMeshSemantics.js";import{isImageryTileLayer as T,isTiledLayer as E,isVoxelLayer as D,isIntegratedMeshLayer as O,isGaussianSplatLayer as Me}from"../layers/support/layerUtils.js";import{TilemapCache as Ne}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Pe}from"../portal/portalDefault.js";import{WebSceneTag as Fe}from"../support/tagSymbols.js";import Ie from"../Viewpoint.js";import Le from"../webscene/Environment.js";import{clearVNodeCache as Re}from"../widgets/support/vnodeCache.js";import{importAnalysisViewModule as ze}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Be}from"./3d/camera/intersectionUtils.js";import k from"./3d/constraints/Constraints.js";import A from"./3d/environment/Environment.js";import{EnvironmentView as Ve}from"./3d/environment/EnvironmentView.js";import{GroundView3D as He}from"./3d/GroundView3D.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{layerView3DImporter as j}from"./3d/layerViewModuleImportUtils.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{cleanupPointToPointAnimationController as Je}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{ScreenSizePerspective as Xe}from"./3d/state/ScreenSizePerspective.js";import{cleanupNavigationUtils as Ze}from"./3d/state/utils/navigationUtils.js";import M from"./3d/state/ViewState.js";import{ViewStateManager as Qe,cleanupViewStateManager as $e}from"./3d/state/ViewStateManager.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as N}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{PointsOfInterest as P}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as F}from"./3d/support/QualityProfile.js";import I from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import L from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{createWebGLContext as vt}from"./3d/webgl-engine/createWebGLContext.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{cleanupEdgeProcessing as xt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{defaultTolerance as R}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as St}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as z}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{Stage as Ct}from"./3d/webgl-engine/Stage.js";import{BreakpointsOwner as wt}from"./BreakpointsOwner.js";import{DOMContainer as Tt}from"./DOMContainer.js";import B from"./interactive/options/ViewOptions.js";import{PopupView as Et}from"./PopupView.js";import Dt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as Ot}from"./support/drapedUtils.js";import{occludeesSupported as kt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as V,createScreenPointFromSupportedEvent as H}from"./support/screenUtils.js";import{isSpatialReferenceSupported as U}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as At,destroyTextureCompressionWorker as jt}from"./support/TextureCompressionHelper.js";import W from"./ui/3d/DefaultUI3D.js";import Mt from"./ui/DefaultUI.js";import G from"./View.js";import Nt from"./ViewAnimation.js";import{stringFromIsGlobal as K,isGlobalFromString as q}from"./ViewingMode.js";var J;const Pt=Symbol(),Y=Symbol();function Ft(e){let t=o(B,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let X=class extends wt(Et(Tt(G))){static{J=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new B({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new k,this._environment=new A,this.environmentView=new Ve,this.floors=new l,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Dt({importAnalysisViewModule:e=>ze(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ue,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new M({view:this}),this.slice=new ft,this.renderCoordsHelper=new ct,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new W,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,_e();let t=()=>this._updatingChanged();this.addHandles(re(oe(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([h(()=>this.map?.allLayers,`after-changes`,t,{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 Ue({view:this}),this.stateManager=new Qe({view:this}),this.screenSizePerspective=new Xe({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=At(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new He({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>de(e>0?1e3/Math.ceil(e):0),_),this.addHandles([g(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),v),g(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),v)])}destroy(){this.destroyed||(jt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),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(`environmentView`,p(this.environmentView)),this._set(`environment`,p(this.environment)),this.groundView=p(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}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 canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=a(ye,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||se(e,`clippingArea`);return!(this._userClippingArea||se(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof S?this.spatialReference&&(t=Z(t,this.spatialReference),t==null)?(f.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),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):(f.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?f.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.isGlobal)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:Z(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||C.WGS84,n=Z(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||C.WGS84,t,n=n=>{let r=Z(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new S({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)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);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof A?e:e instanceof Le?this.environment?.cloneWithWebsceneEnvironment(e)??A.fromWebsceneEnvironment(e):a(A,e):new A}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 layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return J._layerToLayerview}static{this._layerToLayerview=G._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}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&&Fe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=F(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new I(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?c(()=>Oe(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=ge(this.spatialReference);if(t&&e.heightUnit!==t)return new ve({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&f.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return N.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return N.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedGlobalMode;if(e!=null)return K(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?K(this.defaultsFromMap.viewingMode===1):U(t,!0)?`global`:`local`:`global`}set viewingMode(e){this.ready?f.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 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 ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return f.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return f.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Lt,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),xe(t,Q,this.renderSpatialReference),this.state.camera.projectToScreen(Q,$),pe($[0],$[1])}pixelSizeAt(e,t){if(!this.ready)return f.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;xe(e,Q,n);let r=this.state.camera.computeScreenPixelSizeAt(Q);return t&&n!==t?r*x(n)/x(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return f.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new u(`view:no-analysisview-for-analysis`,`The analysis does not exist in 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){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),a=await this._completeSettings(e);return a.format=`png`,[i,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return j.importLayerView(e)}hasLayerViewModule(e){return j.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedGlobalMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:q(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedGlobalMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n==null?[...r(!0)??[],...r(!1)??[]]:r(n);return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return U(e,n)?t==null||T(t)?!0:!(E(t)&&mt(t,e,n)==null||D(t)&&n):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,isGlobal:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?C.WGS84:C.WebMercator:new C({...i?ke:Ae,vcsWkid:o,latestVcsWkid:s});return T(t)&&(i||a)?!(a&&r!==!1)||ht(t.tileInfo,t.fullExtent,e,!0)===null?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:[{spatialReference:c(),isGlobal:n}]:!E(t)&&!D(t)&&(i||a)?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:E(t)&&i&&!n?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:!1}]:[{spatialReference:e,isGlobal:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedGlobalMode;return t||(n==null?e.isGeographic&&f.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):f.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${K(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return f.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return f.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&kt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await y(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),d(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await Rt[e]();if(t&&(ce(this),m(n.signal),await t(n.signal)),this.destroyed)throw le();return m(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new L({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new P({view:this})),this.addHandles([this.updatingHandles.add(()=>N.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&N.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},b),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?Se(Te(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},b),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},v)],Pt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Y),this.removeHandles(Pt),this._featureTiles=p(this.featureTiles),this._set(`pointsOfInterest`,p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=De(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.isGlobal=this.state.isGlobal,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(g(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&be(e,this.groundView.spatialReference,It,t)&&(this.renderCoordsHelper.extent=It)},v),Y),this.sceneIntersectionHelper?.setTolerance(R/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(Y)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(g(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),v),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(e){let t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,context:e,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},n=new Ye(this.state.isGlobal,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=te(this.surface);this._stage=new Ct({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),ne(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new u(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(R/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=p(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface();let e=vt(this.renderCanvas,{alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled});this._initStage(e),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>y(()=>this.groundView?.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`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){q(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(h(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?s(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(z);for(let t of this.allLayerViews)(O(t.layer)&&w.shouldIntersectAsGround(t.layer)||Me(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(z);for(let t of this.allLayerViews)O(t.layer)&&w.shouldIntersectAsGround(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Re(),ee(),he(),xt(),$e(),Be(),we(),Ot(),Pe(),_t(),St(),Je(),Ze(),ae(),fe(),bt(),gt(),Ke.cleanupI3SLodHandling(),Ne.cleanupTilemapCache(),M.cleanupViewstate(),L.cleanupTerrainSurface()}};e([n({nonNullable:!0}),r(Ft)],X.prototype,`options`,void 0),e([n()],X.prototype,`_userClippingArea`,void 0),e([n()],X.prototype,`_resourceController`,void 0),e([n()],X.prototype,`stage`,null),e([n({readOnly:!0})],X.prototype,`deconflictor`,void 0),e([n({readOnly:!0})],X.prototype,`labeler`,void 0),e([n()],X.prototype,`navigation`,void 0),e([n({type:Nt,readOnly:!0})],X.prototype,`animation`,null),e([n({readOnly:!0})],X.prototype,`basemapTerrain`,void 0),e([n({readOnly:!0})],X.prototype,`overlayManager`,null),e([n({readOnly:!0})],X.prototype,`elevationProvider`,void 0),e([n()],X.prototype,`camera`,null),e([n({type:t})],X.prototype,`contentCamera`,null),e([n({readOnly:!0})],X.prototype,`canvas`,null),e([n({type:ye,useTypeForAutocast:!1})],X.prototype,`center`,null),e([n({type:S})],X.prototype,`clippingArea`,null),e([n({type:k,nonNullable:!0})],X.prototype,`constraints`,void 0),e([n({type:S,readOnly:!0})],X.prototype,`renderDataExtent`,null),e([n({readOnly:!0})],X.prototype,`tileInfo`,null),e([n({type:S,readOnly:!0})],X.prototype,`dataExtent`,null),e([n({type:S,readOnly:!0})],X.prototype,`_groundAndLayersExtent`,null),e([n({type:A})],X.prototype,`environment`,null),e([r(`environment`)],X.prototype,`castEnvironment`,null),e([n({readOnly:!0})],X.prototype,`environmentView`,void 0),e([n({type:S})],X.prototype,`extent`,null),e([n({type:l})],X.prototype,`floors`,void 0),e([n()],X.prototype,`screenCenter`,null),e([n()],X.prototype,`frustum`,null),e([n({type:Number,readOnly:!0})],X.prototype,`fullOpacity`,void 0),e([n({readOnly:!0})],X.prototype,`graphicsView`,void 0),e([n()],X.prototype,`analysisViewManager`,void 0),e([n()],X.prototype,`groundView`,void 0),e([n({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([n({type:Boolean})],X.prototype,`initialExtentRequired`,null),e([n()],X.prototype,`defaultsFromMapSettings`,null),e([n()],X.prototype,`interacting`,null),e([n()],X.prototype,`stationary`,null),e([n()],X.prototype,`navigating`,null),e([n()],X.prototype,`map`,void 0),e([n()],X.prototype,`padding`,null),e([n({type:P,readOnly:!0})],X.prototype,`pointsOfInterest`,void 0),e([n()],X.prototype,`_featureTiles`,void 0),e([n()],X.prototype,`featureTiles`,null),e([n()],X.prototype,`_featureTreeDebugger`,void 0),e([n({constructOnly:!0})],X.prototype,`deactivatedWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`debugWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`renderCanvas`,void 0),e([n({constructOnly:!0})],X.prototype,`state`,void 0),e([n()],X.prototype,`screenSizePerspective`,void 0),e([n({readOnly:!0})],X.prototype,`inputManager`,void 0),e([n({readOnly:!0})],X.prototype,`stateManager`,void 0),e([n({type:[`low`,`medium`,`high`]})],X.prototype,`qualityProfile`,null),e([n({type:I,get(){let e=this._get(`qualitySettings`);if(!e){let t=F(this.qualityProfile);e=new I(t)}return e}})],X.prototype,`qualitySettings`,void 0),e([n()],X.prototype,`slice`,void 0),e([n({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,null),e([n({readOnly:!0})],X.prototype,`sceneIntersectionHelper`,void 0),e([n({type:Number,readOnly:!0})],X.prototype,`resolution`,null),e([n({type:Number})],X.prototype,`scale`,null),e([n({readOnly:!0,type:Number})],X.prototype,`terrainLevel`,null),e([n()],X.prototype,`heightModelInfo`,null),e([n({type:C})],X.prototype,`spatialReference`,void 0),e([n({type:Boolean,value:!1})],X.prototype,`alphaCompositingEnabled`,null),e([n({constructOnly:!0})],X.prototype,`preserveDrawingBufferEnabled`,void 0),e([n({type:Boolean})],X.prototype,`supersampleScreenshotsEnabled`,void 0),e([n({readOnly:!0})],X.prototype,`type`,void 0),e([n(),r(e=>e instanceof Mt?e:o(W,e))],X.prototype,`ui`,void 0),e([n({type:Boolean,readOnly:!0})],X.prototype,`updating`,null),e([n()],X.prototype,`_updatingObjects`,null),e([n()],X.prototype,`_updatingObjectsWithProgress`,null),e([n()],X.prototype,`_updatingObjectsToDebug`,null),e([n({type:Number,readOnly:!0})],X.prototype,`updatingProgress`,void 0),e([n({type:[`global`,`local`]})],X.prototype,`viewingMode`,null),e([n({type:Ie})],X.prototype,`viewpoint`,null),e([n({readOnly:!0})],X.prototype,`visibleArea`,null),e([n({type:Number})],X.prototype,`zoom`,null),e([n({readOnly:!0})],X.prototype,`quality`,null),e([n({readOnly:!0})],X.prototype,`resolutionScale`,null),e([n()],X.prototype,`focusAreasView`,void 0),e([n()],X.prototype,`_defaultToMapOptions`,null),e([n()],X.prototype,`_defaultHitTestOptions`,null),X=J=e([i(`esri.views.SceneView`)],X);function Z(e,t){return e!=null&&Ce(e.spatialReference,t)?Se(e,t):null}const Q=ie(),$=me(),It=Ee(),Lt=je(0,0,0,C.WebMercator),Rt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},zt=X;export{zt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a,ensureClass as o}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as s}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as c}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ee}from"../core/accessorSupport/trackingUtils.js";import l from"../core/Collection.js";import{byId as te}from"../core/domUtils.js";import u from"../core/Error.js";import{on as ne}from"../core/events.js";import{destroyHandle as re,makeHandle as d}from"../core/handleUtils.js";import has from"../core/has.js";import{create as ie}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ae}from"../core/libs/rbush/PooledRBush.js";import f from"../core/Logger.js";import{mapCollectionAsync as oe}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,maybeProperty as se}from"../core/maybe.js";import{throwIfDestroyed as ce,throwIfAborted as le,createAbortError as ue}from"../core/promiseUtils.js";import de from"../core/ReactiveSet.js";import{on as fe,watch as m,initial as pe,sync as h,whenOnce as g,syncAndInitial as _}from"../core/reactiveUtils.js";import{cleanupScheduling as me}from"../core/scheduling.js";import{createScreenPoint as he,createScreenPointArray as ge}from"../core/screenUtils.js";import{cleanupWhereClauseCache as _e}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ve,getMetersPerUnitForSR as v}from"../core/units.js";import{initialize as ye}from"../core/workers/workers.js";import y from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import b from"../geometry/Point.js";import{projectBoundingRect as xe}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as x}from"../geometry/projection/projectPointToVector.js";import{project as S,canProjectWithoutEngine as Se}from"../geometry/projectionUtils.js";import C from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Ce}from"../geometry/spatialReferenceEllipsoidUtils.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{IntegratedMeshSemantics as w}from"../layers/support/IntegratedMeshSemantics.js";import{isImageryTileLayer as T,isTiledLayer as E,isVoxelLayer as D,isIntegratedMeshLayer as O,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import Fe from"../Viewpoint.js";import Ie from"../webscene/Environment.js";import{clearVNodeCache as Le}from"../widgets/support/vnodeCache.js";import{importAnalysisViewModule as Re}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ze}from"./3d/camera/intersectionUtils.js";import k from"./3d/constraints/Constraints.js";import A from"./3d/environment/Environment.js";import{EnvironmentView as Be}from"./3d/environment/EnvironmentView.js";import{GroundView3D as Ve}from"./3d/GroundView3D.js";import He from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as Ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as We}from"./3d/layers/graphics/Labeler.js";import Ge from"./3d/layers/i3s/I3SLodHandling.js";import{layerView3DImporter as j}from"./3d/layerViewModuleImportUtils.js";import{Navigation3D as Ke}from"./3d/navigation/Navigation3D.js";import{cleanupPointToPointAnimationController as qe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Je}from"./3d/state/helpers/SceneIntersectionHelper.js";import{ScreenSizePerspective as Ye}from"./3d/state/ScreenSizePerspective.js";import{cleanupNavigationUtils as Xe}from"./3d/state/utils/navigationUtils.js";import M from"./3d/state/ViewState.js";import{ViewStateManager as Ze,cleanupViewStateManager as Qe}from"./3d/state/ViewStateManager.js";import $e from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as et}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as N}from"./3d/support/debugFlags.js";import{getElevationAtPoint as tt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as nt}from"./3d/support/GroundAndIMSurface.js";import{toMap as rt,hitTest as it}from"./3d/support/hitTest.js";import{PointsOfInterest as P}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import{popupHitTest as at}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as ot,getQualityProfileSettings as F}from"./3d/support/QualityProfile.js";import I from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as st}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ct}from"./3d/support/ResourceController.js";import lt from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as ut}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as dt}from"./3d/support/ViewSlice.js";import L from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as ft,getTiledLayerInfo as pt,checkIfTileInfoSupportedForView as mt}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as ht}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as gt}from"./3d/terrain/TileRenderer.js";import{createWebGLContext as _t}from"./3d/webgl-engine/createWebGLContext.js";import{olidEnabled as vt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as yt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{cleanupEdgeProcessing as bt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{defaultTolerance as R}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as z}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{Stage as St}from"./3d/webgl-engine/Stage.js";import{BreakpointsOwner as Ct}from"./BreakpointsOwner.js";import{DOMContainer as wt}from"./DOMContainer.js";import B from"./interactive/options/ViewOptions.js";import{PopupView as Tt}from"./PopupView.js";import Et from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as Dt}from"./support/drapedUtils.js";import{occludeesSupported as Ot}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as V,createScreenPointFromSupportedEvent as H}from"./support/screenUtils.js";import{isSpatialReferenceSupported as U}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as kt,destroyTextureCompressionWorker as At}from"./support/TextureCompressionHelper.js";import W from"./ui/3d/DefaultUI3D.js";import jt from"./ui/DefaultUI.js";import G from"./View.js";import Mt from"./ViewAnimation.js";import{stringFromIsGlobal as K,isGlobalFromString as q}from"./ViewingMode.js";var J;const Nt=Symbol(),Y=Symbol();function Pt(e){let t=o(B,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let X=class extends Ct(Tt(wt(G))){static{J=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new B({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ct(this),this.deconflictor=new Ue({view:this}),this.attribution3D=new $e({view:this}),this.labeler=new We({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new Ke({view:this}),this.basemapTerrain=null,this.elevationProvider=new et({view:this}),this._canvas=null,this.constraints=new k,this._environment=new A,this.environmentView=new Be,this.floors=new l,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Et({importAnalysisViewModule:e=>Re(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new de,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new M({view:this}),this.slice=new dt,this.renderCoordsHelper=new st,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new W,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(re(oe(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([fe(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),m(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new He({view:this}),this.stateManager=new Ze({view:this}),this.screenSizePerspective=new Ye({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=kt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new Ve({view:this}),this.groundAndIMSurface=new nt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},pe),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},pe),this.addHandles([m(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),m(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(At(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),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(`environmentView`,p(this.environmentView)),this._set(`environment`,p(this.environment)),this.groundView=p(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}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 canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=a(b,e))}get clippingArea(){if(this.state.isGlobal)return null;let e=this.map,t=this._userClippingArea||se(e,`clippingArea`);return!(this._userClippingArea||se(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof y?this.spatialReference&&(t=Z(t,this.spatialReference),t==null)?(f.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),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):(f.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.state.isGlobal&&e!=null?f.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.isGlobal)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:Z(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||C.WGS84,n=Z(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||C.WGS84,t,n=n=>{let r=Z(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new y({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)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);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof A?e:e instanceof Ie?this.environment?.cloneWithWebsceneEnvironment(e)??A.fromWebsceneEnvironment(e):a(A,e):new A}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 layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return J._layerToLayerview}static{this._layerToLayerview=G._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}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&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=F(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new I(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||ot()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?c(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=ve(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&f.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||ft(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return N.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return N.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedGlobalMode;if(e!=null)return K(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?K(this.defaultsFromMap.viewingMode===1):U(t,!0)?`global`:`local`:`global`}set viewingMode(e){this.ready?f.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 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 lt(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return f.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return rt(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return f.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=It,t.x=e.x,t.y=e.y,t.z=tt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),x(t,Q,this.renderSpatialReference),this.state.camera.projectToScreen(Q,$),he($[0],$[1])}pixelSizeAt(e,t){if(!this.ready)return f.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;x(e,Q,n);let r=this.state.camera.computeScreenPixelSizeAt(Q);return t&&n!==t?r*v(n)/v(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return f.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return it(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return at(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new u(`view:no-analysisview-for-analysis`,`The analysis does not exist in 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){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!vt())throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),a=await this._completeSettings(e);return a.format=`png`,[i,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return j.importLayerView(e)}hasLayerViewModule(e){return j.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedGlobalMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:q(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedGlobalMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n==null?[...r(!0)??[],...r(!1)??[]]:r(n);return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return U(e,n)?t==null||T(t)?!0:!(E(t)&&pt(t,e,n)==null||D(t)&&n):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,isGlobal:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?C.WGS84:C.WebMercator:new C({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return T(t)&&(i||a)?!(a&&r!==!1)||mt(t.tileInfo,t.fullExtent,e,!0)===null?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:[{spatialReference:c(),isGlobal:n}]:!E(t)&&!D(t)&&(i||a)?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:E(t)&&i&&!n?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:!1}]:[{spatialReference:e,isGlobal:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedGlobalMode;return t||(n==null?e.isGeographic&&f.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):f.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${K(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return f.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return f.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Ot(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await g(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),d(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await Lt[e]();if(t&&(ce(this),le(n.signal),await t(n.signal)),this.destroyed)throw ue();return le(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new L({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new P({view:this})),this.addHandles([this.updatingHandles.add(()=>N.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&N.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?S(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Y),this.removeHandles(Nt),this._featureTiles=p(this.featureTiles),this._set(`pointsOfInterest`,p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.isGlobal=this.state.isGlobal,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(m(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&xe(e,this.groundView.spatialReference,Ft,t)&&(this.renderCoordsHelper.extent=Ft)},h),Y),this.sceneIntersectionHelper?.setTolerance(R/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(Y)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(m(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(e){let t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,context:e,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},n=new Je(this.state.isGlobal,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=te(this.surface);this._stage=new St({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),ne(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new u(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(R/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=p(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface();let e=_t(this.renderCanvas,{alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled});this._initStage(e),this._initGlobe(),this.sharedSymbolResources=new ut({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>g(()=>this.groundView?.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`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){q(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(fe(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?s(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(z);for(let t of this.allLayerViews)(O(t.layer)&&w.shouldIntersectAsGround(t.layer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(z);for(let t of this.allLayerViews)O(t.layer)&&w.shouldIntersectAsGround(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Le(),ee(),_e(),bt(),Qe(),ze(),Ce(),Dt(),Ne(),gt(),xt(),qe(),Xe(),ae(),me(),yt(),ht(),Ge.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),M.cleanupViewstate(),L.cleanupTerrainSurface()}};e([n({nonNullable:!0}),r(Pt)],X.prototype,`options`,void 0),e([n()],X.prototype,`_userClippingArea`,void 0),e([n()],X.prototype,`_resourceController`,void 0),e([n()],X.prototype,`stage`,null),e([n({readOnly:!0})],X.prototype,`deconflictor`,void 0),e([n({readOnly:!0})],X.prototype,`labeler`,void 0),e([n()],X.prototype,`navigation`,void 0),e([n({type:Mt,readOnly:!0})],X.prototype,`animation`,null),e([n({readOnly:!0})],X.prototype,`basemapTerrain`,void 0),e([n({readOnly:!0})],X.prototype,`overlayManager`,null),e([n({readOnly:!0})],X.prototype,`elevationProvider`,void 0),e([n()],X.prototype,`camera`,null),e([n({type:t})],X.prototype,`contentCamera`,null),e([n({readOnly:!0})],X.prototype,`canvas`,null),e([n({type:b,useTypeForAutocast:!1})],X.prototype,`center`,null),e([n({type:y})],X.prototype,`clippingArea`,null),e([n({type:k,nonNullable:!0})],X.prototype,`constraints`,void 0),e([n({type:y,readOnly:!0})],X.prototype,`renderDataExtent`,null),e([n({readOnly:!0})],X.prototype,`tileInfo`,null),e([n({type:y,readOnly:!0})],X.prototype,`dataExtent`,null),e([n({type:y,readOnly:!0})],X.prototype,`_groundAndLayersExtent`,null),e([n({type:A})],X.prototype,`environment`,null),e([r(`environment`)],X.prototype,`castEnvironment`,null),e([n({readOnly:!0})],X.prototype,`environmentView`,void 0),e([n({type:y})],X.prototype,`extent`,null),e([n({type:l})],X.prototype,`floors`,void 0),e([n()],X.prototype,`screenCenter`,null),e([n()],X.prototype,`frustum`,null),e([n({type:Number,readOnly:!0})],X.prototype,`fullOpacity`,void 0),e([n({readOnly:!0})],X.prototype,`graphicsView`,void 0),e([n()],X.prototype,`analysisViewManager`,void 0),e([n()],X.prototype,`groundView`,void 0),e([n({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([n({type:Boolean})],X.prototype,`initialExtentRequired`,null),e([n()],X.prototype,`defaultsFromMapSettings`,null),e([n()],X.prototype,`interacting`,null),e([n()],X.prototype,`stationary`,null),e([n()],X.prototype,`navigating`,null),e([n()],X.prototype,`map`,void 0),e([n()],X.prototype,`padding`,null),e([n({type:P,readOnly:!0})],X.prototype,`pointsOfInterest`,void 0),e([n()],X.prototype,`_featureTiles`,void 0),e([n()],X.prototype,`featureTiles`,null),e([n()],X.prototype,`_featureTreeDebugger`,void 0),e([n({constructOnly:!0})],X.prototype,`deactivatedWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`debugWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`renderCanvas`,void 0),e([n({constructOnly:!0})],X.prototype,`state`,void 0),e([n()],X.prototype,`screenSizePerspective`,void 0),e([n({readOnly:!0})],X.prototype,`inputManager`,void 0),e([n({readOnly:!0})],X.prototype,`stateManager`,void 0),e([n({type:[`low`,`medium`,`high`]})],X.prototype,`qualityProfile`,null),e([n({type:I,get(){let e=this._get(`qualitySettings`);if(!e){let t=F(this.qualityProfile);e=new I(t)}return e}})],X.prototype,`qualitySettings`,void 0),e([n()],X.prototype,`slice`,void 0),e([n({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,null),e([n({readOnly:!0})],X.prototype,`sceneIntersectionHelper`,void 0),e([n({type:Number,readOnly:!0})],X.prototype,`resolution`,null),e([n({type:Number})],X.prototype,`scale`,null),e([n({readOnly:!0,type:Number})],X.prototype,`terrainLevel`,null),e([n()],X.prototype,`heightModelInfo`,null),e([n({type:C})],X.prototype,`spatialReference`,void 0),e([n({type:Boolean,value:!1})],X.prototype,`alphaCompositingEnabled`,null),e([n({constructOnly:!0})],X.prototype,`preserveDrawingBufferEnabled`,void 0),e([n({type:Boolean})],X.prototype,`supersampleScreenshotsEnabled`,void 0),e([n({readOnly:!0})],X.prototype,`type`,void 0),e([n(),r(e=>e instanceof jt?e:o(W,e))],X.prototype,`ui`,void 0),e([n({type:Boolean,readOnly:!0})],X.prototype,`updating`,null),e([n()],X.prototype,`_updatingObjects`,null),e([n()],X.prototype,`_updatingObjectsWithProgress`,null),e([n()],X.prototype,`_updatingObjectsToDebug`,null),e([n({type:Number,readOnly:!0})],X.prototype,`updatingProgress`,void 0),e([n({type:[`global`,`local`]})],X.prototype,`viewingMode`,null),e([n({type:Fe})],X.prototype,`viewpoint`,null),e([n({readOnly:!0})],X.prototype,`visibleArea`,null),e([n({type:Number})],X.prototype,`zoom`,null),e([n({readOnly:!0})],X.prototype,`quality`,null),e([n({readOnly:!0})],X.prototype,`resolutionScale`,null),e([n()],X.prototype,`focusAreasView`,void 0),e([n()],X.prototype,`_defaultToMapOptions`,null),e([n()],X.prototype,`_defaultHitTestOptions`,null),X=J=e([i(`esri.views.SceneView`)],X);function Z(e,t){return e!=null&&Se(e.spatialReference,t)?S(e,t):null}const Q=ie(),$=ge(),Ft=Te(),It=Ae(0,0,0,C.WebMercator),Lt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Rt=X;export{Rt as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{createTask as r}from"../../core/asyncUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as o,syncAndInitial as s,sync as c}from"../../core/reactiveUtils.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import{load as u}from"../../geometry/coordinateFormatter.js";import d from"../../Graphic.js";import{pointEquals as f}from"../../layers/graphics/dehydratedFeatureComparison.js";import p from"../../layers/GraphicsLayer.js";import{UndoRedo as m}from"../../UndoRedo.js";import{InteractiveToolBase as h}from"../interactive/InteractiveToolBase.js";import g from"../interactive/options/InteractiveToolOptions.js";import{makeTooltip as _,pasteLocation as v,enterInputModeIfAvailable as y}from"../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as b}from"../support/GeometryWorkerHandle.js";import{CreateOperationGeometry as x}from"./support/CreateOperationGeometry.js";import{createCircle as S,createEllipse as C,createSquare as w,createRectangle as T,createPolygon as E,createPolyline as D,createMultipoint as O}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as k}from"./support/surfaceCoordinateSystems.js";import{createTooltipInfos as A,initializeConstraints as j,updateTooltipInfo as M,getConstraintZ as N,unlockConstraintsOnVertexAddOrRemove as P,lockElevationOnVertexAdd as F,getActiveTooltipInfo as I}from"./support/tooltipUtils.js";import{autorun as L}from"../../core/accessorSupport/trackingUtils.js";let R=class extends h{constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.elevationLockOnVertexAddDisabled=!1,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.toolOptions=new g,this._updatingHandles=new l,this._measurementWorker=new b({preloadGeodetic:!0})}initialize(){let{view:e}=this;this.internalGraphicsLayer=new p({listMode:`hide`,internal:!0,title:`DrawGraphicTool layer`}),this.view.map.layers.add(this.internalGraphicsLayer);let t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=A(e.type,this.toolOptions);let n=_(()=>({view:e,options:this.toolOptions.tooltips}));this.tooltip=n,j(this._tooltipsContext),this._coordinateFormatterLoadTask=r(()=>u()),this.addHandles([t.on(`vertex-add`,e=>this.onVertexAdd(e)),t.on(`vertex-remove`,e=>this.onVertexRemove(e)),t.on(`vertex-update`,e=>this.onVertexUpdate(e)),t.on(`cursor-update`,e=>this.onCursorUpdate(e)),t.on(`cursor-remove`,()=>this._updateGraphic()),t.on(`complete`,e=>this.onComplete(e)),this._coordinateFormatterLoadTask,n.on(`paste`,e=>v(e,this.activeTooltipInfo)),o(()=>this.cursor,e=>{t.cursor=e},s),L(()=>{let{activeTooltipInfo:e,toolOptions:t}=this;M(e,this._tooltipsContext,this._updatingHandles),n.info=t.tooltips.effectiveEnabled?e:null}),L(()=>{t.constraintZ=N(this._tooltipsContext)},c)]),this.finishToolCreation(),t.initializePointer()}destroy(){this.drawOperation=a(this.drawOperation),this.tooltip=a(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=a(this.internalGraphicsLayer),this._updatingHandles.destroy(),this._measurementWorker.destroy(),this._set(`view`,null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){let{defaultZ:e,directionOptions:t,drawOperation:n,forceUniformSize:r,geometryType:i,graphic:a,toolOptions:o,tooltipInfos:s,view:c,_measurementWorker:l}=this;return{createOperationGeometry:this._createOperationGeometry,defaultZ:e,directionOptions:t,drawOperation:n,forceUniformSize:r,geometryType:i,graphic:a,toolOptions:o,tooltipInfos:s,view:c,measurementWorker:l}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set(`centered`,e),this._updateGraphic()}get cursor(){return this._get(`cursor`)}set cursor(e){this._set(`cursor`,e)}set enabled(e){this.drawOperation.interactive=e,this._set(`enabled`,e)}set forceUniformSize(e){this._set(`forceUniformSize`,e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set(`graphicSymbol`,e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){let t=this.drawOperation;t&&(t.drawingMode=e),this._set(`mode`,e)}get updating(){return(this._updatingHandles.updating||this.drawOperation?.updating)??!1}get undoRedo(){let{view:{type:e,map:t}}=this;return e===`2d`&&t&&`undoRedo`in t&&t.undoRedo instanceof m?t.undoRedo:null}set undoRedo(e){this._override(`undoRedo`,e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||y(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&j(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(B.outline),this.removeHandles(B.regularVertices),this.removeHandles(B.activeVertex),this.removeHandles(B.activeEdge),this.removeHandles(z)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;let t=new d({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange(`graphic`),this.addHandles(i(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),z),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;let{coordinateHelper:t,view:n,visualizationCursorVertex:r,lastVertex:i,committedVertices:a,geometryIncludingUncommittedVertices:o,numCommittedVertices:s}=this.drawOperation;if(!(s>0||r!=null))return;let c=e.operationComplete?a:o,l=c.length,u=r==null?null:t.pointToArray(r),d=this._drawSpatialReference,p=n.type===`3d`&&n.viewingMode===`global`,m=new x;m.committedVertices=a,m.cursorVertex=u;let{geometryType:h}=this;switch(h){case`point`:case`mesh`:m.full=t.arrayToPoint(c[0]);break;case`multipoint`:m.full=l>0?O(c,d):null;break;case`polyline`:case`polygon`:l>0&&(m.full=h===`polygon`?E([c],d,p,!0):D([c],d,p),m.cursorEdge=u!=null&&i&&!f(r,i)?D([[u,t.pointToArray(i)]],d,p):null,m.outline=l>1?m.full:null);break;case`circle`:case`rectangle`:{if(m.committedVertices=m.cursorVertex=null,!l)break;let t=k(n,c[0]),r=c[0],i=t.makeMapPoint(r[0]+H*n.resolution,r[1]);h===`circle`?l===1&&e.operationComplete?m.circle=S([r,i],t,!0):l===2&&(this.forceUniformSize?m.circle=S(c,t,this.centered):m.rectangle=C(c,t,this.centered)):l===1&&e.operationComplete?m.rectangle=w([r,i],t,!0):l===2&&(m.rectangle=this.forceUniformSize?w(c,t,this.centered):T(c,t,this.centered)),m.full=m.circle==null?m.rectangle?.geometry:m.circle.geometry,m.outline=m.full?.type===`polygon`?m.full:null;break}default:return null}return m}initializeGraphic(e){return i()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){let e=this._getCreateOperationGeometry({operationComplete:!0});e!=null&&(t=this._createOrUpdateGraphic(e.full))}this._createOperationGeometry=null,this.emit(`complete`,{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit(`cursor-update`,e)}onDeactivate(){let{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return i()}onCursorEdgeChanged(e){return i()}onVertexAdd(e){P(this._tooltipsContext),this._updateGraphic(),this.elevationLockOnVertexAddDisabled||F(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit(`vertex-add`,e)}onVertexRemove(e){P(this._tooltipsContext),this._updateGraphic(),this.emit(`vertex-remove`,e)}onVertexUpdate(e){this._updateGraphic(),this.emit(`vertex-update`,e)}_updateGraphic(){let e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e==null?this._destroyAllVisualizations():(e.cursorEdge==null?this.removeHandles(B.activeEdge):this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),B.activeEdge),e.outline==null?this.removeHandles(B.outline):this.addHandles(this.onOutlineChanged(e.outline),B.outline),e.committedVertices==null?this.removeHandles(B.regularVertices):this.addHandles(this.onRegularVerticesChanged(e.committedVertices),B.regularVertices),e.cursorVertex==null?this.removeHandles(B.activeVertex):this.addHandles(this.onActiveVertexChanged(e.cursorVertex),B.activeVertex),e.full==null?this.removeHandles(z):this._createOrUpdateGraphic(e.full))}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?I(this._tooltipsContext):null}};e([t()],R.prototype,`_coordinateFormatterLoadTask`,void 0),e([t()],R.prototype,`_createOperationGeometry`,void 0),e([t()],R.prototype,`_tooltipsContext`,null),e([t({value:!0})],R.prototype,`centered`,null),e([t()],R.prototype,`cursor`,null),e([t({nonNullable:!0})],R.prototype,`defaultZ`,void 0),e([t({constructOnly:!0})],R.prototype,`directionOptions`,void 0),e([t()],R.prototype,`drawOperation`,void 0),e([t()],R.prototype,`elevationLockOnVertexAddDisabled`,void 0),e([t({value:!0})],R.prototype,`enabled`,null),e([t({value:!0})],R.prototype,`forceUniformSize`,null),e([t({constructOnly:!0})],R.prototype,`geometryType`,void 0),e([t()],R.prototype,`graphic`,null),e([t({constructOnly:!0})],R.prototype,`graphicProperties`,void 0),e([t()],R.prototype,`graphicSymbol`,null),e([t({constructOnly:!0})],R.prototype,`hasZ`,void 0),e([t({constructOnly:!0})],R.prototype,`geometryToPlace`,void 0),e([t()],R.prototype,`mode`,null),e([t()],R.prototype,`snappingManager`,void 0),e([t()],R.prototype,`snapToScene`,void 0),e([t()],R.prototype,`tooltip`,void 0),e([t()],R.prototype,`tooltipInfos`,void 0),e([t({constructOnly:!0,type:g})],R.prototype,`toolOptions`,void 0),e([t()],R.prototype,`updating`,null),e([t({constructOnly:!0,nonNullable:!0})],R.prototype,`view`,void 0),e([t({constructOnly:!0})],R.prototype,`undoRedo`,null),e([t()],R.prototype,`activeTooltipInfo`,null),R=e([n(`esri.views.draw.DrawGraphicTool`)],R);const z=Symbol(`create-operation-graphic`),B={outline:Symbol(`outline-visual`),regularVertices:Symbol(`regular-vertices-visual`),activeVertex:Symbol(`active-vertex-visual`),activeEdge:Symbol(`active-edge-visual`)};function V(e){switch(e){case`point`:case`polyline`:case`polygon`:case`multipoint`:return e;case`circle`:case`rectangle`:return`segment`;case`mesh`:return`point`}}const H=48;export{R as DrawGraphicTool,V as geometryTypeToDrawOperationGeometryType};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{createTask as r}from"../../core/asyncUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as o,syncAndInitial as s,sync as c}from"../../core/reactiveUtils.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import{load as u}from"../../geometry/coordinateFormatter.js";import d from"../../Graphic.js";import{pointEquals as f}from"../../layers/graphics/dehydratedFeatureComparison.js";import p from"../../layers/GraphicsLayer.js";import{UndoRedo as m}from"../../UndoRedo.js";import{InteractiveToolBase as h}from"../interactive/InteractiveToolBase.js";import g from"../interactive/options/InteractiveToolOptions.js";import{makeTooltip as _,pasteLocation as v,enterInputModeIfAvailable as y}from"../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as b}from"../support/GeometryWorkerHandle.js";import{CreateOperationGeometry as x}from"./support/CreateOperationGeometry.js";import{createCircle as S,createEllipse as C,createSquare as w,createRectangle as T,createPolygon as E,createPolyline as D,createMultipoint as O}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as k}from"./support/surfaceCoordinateSystems.js";import{createTooltipInfos as A,initializeConstraints as j,updateTooltipInfo as M,getConstraintZ as N,unlockConstraintsOnVertexAddOrRemove as P,lockElevationOnVertexAdd as F,getActiveTooltipInfo as I}from"./support/tooltipUtils.js";import{autorun as L}from"../../core/accessorSupport/trackingUtils.js";let R=class extends h{constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.elevationLockOnVertexAddDisabled=!1,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.toolOptions=new g,this._updatingHandles=new l,this._measurementWorker=new b({preloadGeodetic:!0})}initialize(){let{view:e}=this;this.internalGraphicsLayer=new p({listMode:`hide`,internal:!0,title:`DrawGraphicTool layer`}),this.view.map.layers.add(this.internalGraphicsLayer);let t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=A(e.type,this.toolOptions);let n=_(()=>({view:e,options:this.toolOptions.tooltips}));this.tooltip=n,j(this._tooltipsContext),this._coordinateFormatterLoadTask=r(()=>u()),this.addHandles([t.on(`vertex-add`,e=>this.onVertexAdd(e)),t.on(`vertex-remove`,e=>this.onVertexRemove(e)),t.on(`vertex-update`,e=>this.onVertexUpdate(e)),t.on(`cursor-update`,e=>this.onCursorUpdate(e)),t.on(`cursor-remove`,()=>this._updateGraphic()),t.on(`complete`,e=>this.onComplete(e)),this._coordinateFormatterLoadTask,n.on(`paste`,e=>v(e,this.activeTooltipInfo)),o(()=>this.cursor,e=>{t.cursor=e},s),L(()=>{let{activeTooltipInfo:e,toolOptions:t}=this;M(e,this._tooltipsContext,this._updatingHandles),n.info=t.tooltips.effectiveEnabled?e:null}),L(()=>{t.constraintZ=N(this._tooltipsContext)},c)]),this.finishToolCreation(),t.initializePointer()}destroy(){this.drawOperation=a(this.drawOperation),this.tooltip=a(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=a(this.internalGraphicsLayer),this._updatingHandles.destroy(),this._measurementWorker.destroy(),this._set(`view`,null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){let{defaultZ:e,directionOptions:t,drawOperation:n,forceUniformSize:r,geometryType:i,graphic:a,toolOptions:o,tooltipInfos:s,view:c,_measurementWorker:l}=this;return{createOperationGeometry:this._createOperationGeometry,defaultZ:e,directionOptions:t,drawOperation:n,forceUniformSize:r,geometryType:i,graphic:a,toolOptions:o,tooltipInfos:s,view:c,measurementWorker:l}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set(`centered`,e),this._updateGraphic()}get cursor(){return this._get(`cursor`)}set cursor(e){this._set(`cursor`,e)}set enabled(e){this.drawOperation.interactive=e,this._set(`enabled`,e)}set forceUniformSize(e){this._set(`forceUniformSize`,e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set(`graphicSymbol`,e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){let t=this.drawOperation;t&&(t.drawingMode=e),this._set(`mode`,e)}get updating(){return(this._updatingHandles.updating||this.drawOperation?.updating)??!1}get undoRedo(){let{view:{type:e,map:t}}=this;return e===`2d`&&t&&`undoRedo`in t&&t.undoRedo instanceof m?t.undoRedo:null}set undoRedo(e){this._override(`undoRedo`,e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||y(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&j(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(B.outline),this.removeHandles(B.regularVertices),this.removeHandles(B.activeVertex),this.removeHandles(B.activeEdge),this.removeHandles(z)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;let t=new d({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange(`graphic`),this.addHandles(i(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),z),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;let{coordinateHelper:t,view:n,visualizationCursorVertex:r,lastVertex:i,committedVertices:a,geometryIncludingUncommittedVertices:o,numCommittedVertices:s}=this.drawOperation;if(!(s>0||r!=null))return;let c=e.operationComplete?a:o,l=c.length,u=r==null?null:t.pointToArray(r),d=this._drawSpatialReference,p=n.type===`3d`&&n.state.isGlobal,m=new x;m.committedVertices=a,m.cursorVertex=u;let{geometryType:h}=this;switch(h){case`point`:case`mesh`:m.full=t.arrayToPoint(c[0]);break;case`multipoint`:m.full=l>0?O(c,d):null;break;case`polyline`:case`polygon`:l>0&&(m.full=h===`polygon`?E([c],d,p,!0):D([c],d,p),m.cursorEdge=u!=null&&i&&!f(r,i)?D([[u,t.pointToArray(i)]],d,p):null,m.outline=l>1?m.full:null);break;case`circle`:case`rectangle`:{if(m.committedVertices=m.cursorVertex=null,!l)break;let t=k(n,c[0]),r=c[0],i=t.makeMapPoint(r[0]+H*n.resolution,r[1]);h===`circle`?l===1&&e.operationComplete?m.circle=S([r,i],t,!0):l===2&&(this.forceUniformSize?m.circle=S(c,t,this.centered):m.rectangle=C(c,t,this.centered)):l===1&&e.operationComplete?m.rectangle=w([r,i],t,!0):l===2&&(m.rectangle=this.forceUniformSize?w(c,t,this.centered):T(c,t,this.centered)),m.full=m.circle==null?m.rectangle?.geometry:m.circle.geometry,m.outline=m.full?.type===`polygon`?m.full:null;break}default:return null}return m}initializeGraphic(e){return i()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){let e=this._getCreateOperationGeometry({operationComplete:!0});e!=null&&(t=this._createOrUpdateGraphic(e.full))}this._createOperationGeometry=null,this.emit(`complete`,{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit(`cursor-update`,e)}onDeactivate(){let{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return i()}onCursorEdgeChanged(e){return i()}onVertexAdd(e){P(this._tooltipsContext),this._updateGraphic(),this.elevationLockOnVertexAddDisabled||F(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit(`vertex-add`,e)}onVertexRemove(e){P(this._tooltipsContext),this._updateGraphic(),this.emit(`vertex-remove`,e)}onVertexUpdate(e){this._updateGraphic(),this.emit(`vertex-update`,e)}_updateGraphic(){let e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e==null?this._destroyAllVisualizations():(e.cursorEdge==null?this.removeHandles(B.activeEdge):this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),B.activeEdge),e.outline==null?this.removeHandles(B.outline):this.addHandles(this.onOutlineChanged(e.outline),B.outline),e.committedVertices==null?this.removeHandles(B.regularVertices):this.addHandles(this.onRegularVerticesChanged(e.committedVertices),B.regularVertices),e.cursorVertex==null?this.removeHandles(B.activeVertex):this.addHandles(this.onActiveVertexChanged(e.cursorVertex),B.activeVertex),e.full==null?this.removeHandles(z):this._createOrUpdateGraphic(e.full))}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?I(this._tooltipsContext):null}};e([t()],R.prototype,`_coordinateFormatterLoadTask`,void 0),e([t()],R.prototype,`_createOperationGeometry`,void 0),e([t()],R.prototype,`_tooltipsContext`,null),e([t({value:!0})],R.prototype,`centered`,null),e([t()],R.prototype,`cursor`,null),e([t({nonNullable:!0})],R.prototype,`defaultZ`,void 0),e([t({constructOnly:!0})],R.prototype,`directionOptions`,void 0),e([t()],R.prototype,`drawOperation`,void 0),e([t()],R.prototype,`elevationLockOnVertexAddDisabled`,void 0),e([t({value:!0})],R.prototype,`enabled`,null),e([t({value:!0})],R.prototype,`forceUniformSize`,null),e([t({constructOnly:!0})],R.prototype,`geometryType`,void 0),e([t()],R.prototype,`graphic`,null),e([t({constructOnly:!0})],R.prototype,`graphicProperties`,void 0),e([t()],R.prototype,`graphicSymbol`,null),e([t({constructOnly:!0})],R.prototype,`hasZ`,void 0),e([t({constructOnly:!0})],R.prototype,`geometryToPlace`,void 0),e([t()],R.prototype,`mode`,null),e([t()],R.prototype,`snappingManager`,void 0),e([t()],R.prototype,`snapToScene`,void 0),e([t()],R.prototype,`tooltip`,void 0),e([t()],R.prototype,`tooltipInfos`,void 0),e([t({constructOnly:!0,type:g})],R.prototype,`toolOptions`,void 0),e([t()],R.prototype,`updating`,null),e([t({constructOnly:!0,nonNullable:!0})],R.prototype,`view`,void 0),e([t({constructOnly:!0})],R.prototype,`undoRedo`,null),e([t()],R.prototype,`activeTooltipInfo`,null),R=e([n(`esri.views.draw.DrawGraphicTool`)],R);const z=Symbol(`create-operation-graphic`),B={outline:Symbol(`outline-visual`),regularVertices:Symbol(`regular-vertices-visual`),activeVertex:Symbol(`active-vertex-visual`),activeEdge:Symbol(`active-edge-visual`)};function V(e){switch(e){case`point`:case`polyline`:case`polygon`:case`multipoint`:return e;case`circle`:case`rectangle`:return`segment`;case`mesh`:return`point`}}const H=48;export{R as DrawGraphicTool,V as geometryTypeToDrawOperationGeometryType};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{isSome as e}from"../../../core/arrayUtils.js";import{invert as t}from"../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n,clone as r}from"../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{rotationTo as i,invert as a}from"../../../core/libs/gl-matrix-2/math/quat.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{scale as s,dot as c,subtract as l,normalize as u,cross as d,transformQuat as f}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../geometry/Point.js";function h(e,t,n=null){return n==null?[e,t]:[e,t,n]}function g(e,t,n=null){return n==null?{x:e,y:t}:{x:e,y:t,z:n}}class _{constructor(e){this.spatialReference=e}mapToLocalMultiple(t){return t.map(e=>this.mapToLocal(e)).filter(e)}get doUnnormalization(){return!1}}class v extends _{constructor(e,i,a=null){super(i),this._defaultZ=a,this.transform=n(),this.transformInv=n(),this.transform=r(e),t(this.transformInv,this.transform)}makeMapPoint(e,t){return h(e,t,this._defaultZ)}mapToLocal(e){return g(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return h(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}}class y extends _{constructor(e,t){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=p(),this.tangentFrameUpWS=p(),this.tangentFrameRightWS=p(),this.tangentFrameForwardWS=p(),this.localFrameRightWS=p(),this.localFrameUpWS=p(),this.worldToLocalTransform=o(),this.localToWorldTransform=o(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=t,this.defaultZ=t.hasZ?t.z:null;let n=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,0,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,1,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,2,this.tangentFrameForwardWS);let r=p();s(r,this.tangentFrameForwardWS,c(n,this.tangentFrameForwardWS)),l(this.localFrameRightWS,n,r),u(this.localFrameRightWS,this.localFrameRightWS),d(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),i(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),a(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.
|
|
2
|
+
import{isSome as e}from"../../../core/arrayUtils.js";import{invert as t}from"../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n,clone as r}from"../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{rotationTo as i,invert as a}from"../../../core/libs/gl-matrix-2/math/quat.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{scale as s,dot as c,subtract as l,normalize as u,cross as d,transformQuat as f}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../geometry/Point.js";function h(e,t,n=null){return n==null?[e,t]:[e,t,n]}function g(e,t,n=null){return n==null?{x:e,y:t}:{x:e,y:t,z:n}}class _{constructor(e){this.spatialReference=e}mapToLocalMultiple(t){return t.map(e=>this.mapToLocal(e)).filter(e)}get doUnnormalization(){return!1}}class v extends _{constructor(e,i,a=null){super(i),this._defaultZ=a,this.transform=n(),this.transformInv=n(),this.transform=r(e),t(this.transformInv,this.transform)}makeMapPoint(e,t){return h(e,t,this._defaultZ)}mapToLocal(e){return g(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return h(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}}class y extends _{constructor(e,t){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=p(),this.tangentFrameUpWS=p(),this.tangentFrameRightWS=p(),this.tangentFrameForwardWS=p(),this.localFrameRightWS=p(),this.localFrameUpWS=p(),this.worldToLocalTransform=o(),this.localToWorldTransform=o(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=t,this.defaultZ=t.hasZ?t.z:null;let n=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,0,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,1,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,2,this.tangentFrameForwardWS);let r=p();s(r,this.tangentFrameForwardWS,c(n,this.tangentFrameForwardWS)),l(this.localFrameRightWS,n,r),u(this.localFrameRightWS,this.localFrameRightWS),d(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),i(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),a(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.state.isGlobal}makeMapPoint(e,t){return h(e,t,this.defaultZ)}mapToLocal(e){let t=p();this.view.renderCoordsHelper.toRenderCoords(new m({x:e[0],y:e[1],spatialReference:this.spatialReference}),t),f(t,t,this.worldToLocalTransform);let n=this.view.renderCoordsHelper.fromRenderCoords(t,new m({spatialReference:this.view.spatialReference}));return n==null?null:g(n.x/this.scale,n.y/this.scale)}localToMap(e){let t=p();this.view.renderCoordsHelper.toRenderCoords(new m({x:e.x*this.scale,y:e.y*this.scale,spatialReference:this.spatialReference}),t),f(t,t,this.localToWorldTransform);let n=this.view.renderCoordsHelper.fromRenderCoords(t,new m({spatialReference:this.view.spatialReference}));return n==null?null:h(n.x,n.y,this.defaultZ)}}function b(e,t){if(e.type===`2d`)return new v(e.state.transform,e.spatialReference,t.length>2?t[2]:null);if(e.type===`3d`){let n=t.length>2?new m({x:t[0],y:t[1],z:t[2],spatialReference:e.spatialReference}):new m({x:t[0],y:t[1],spatialReference:e.spatialReference});return new y(e,n)}return null}export{v as AffineCoordinateSystem,y as SceneViewCoordinateSystem,_ as SurfaceCoordinateSystem,b as createViewAlignedCoordinateSystem,h as makeMapPoint,g as makeSurfacePoint};
|
package/views/webgl/Program.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{update as e}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{webglValidateShadersEnabled as
|
|
3
|
-
validated: ${f.getProgramParameter(
|
|
2
|
+
import{update as e}from"../../core/arrayUtils.js";import has from"../../core/has.js";import t from"../../core/Logger.js";import{webglValidateShadersEnabled as n,webglDebugEnabled as r}from"./checkWebGLError.js";import{ResourceType as i}from"./enums.js";import{transpileShader as a}from"./ShaderTranspiler.js";const o=()=>t.getLogger(`esri.views.webgl.Program`),s=!!has(`esri-tests-disable-gpu-memory-measurements`);class c{constructor(e,t,r,c,u=new Map,d=[]){this._context=e,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||o().error(`RenderingContext isn't initialized!`),t.length===0&&o().error(`Shaders source should not be empty!`),t=a(t,35633),r=a(r,35632),this._vShader=l(this._context,35633,t),this._fShader=l(this._context,35632,r),p.enabled&&(this._linesOfCode=t.match(/\n/g).length+r.match(/\n/g).length+2,e.instanceCounter.increment(i.LinesOfCode,this._vShader,this._linesOfCode)),this._vShader&&this._fShader||o().error(`Error loading shaders!`),e.instanceCounter.increment(i.Shader,this),n()&&(this.vertexShader=t,this.fragmentShader=r),this.usedMemory=s?0:t.length+r.length;let f=this._context.gl,m=f.createProgram();f.attachShader(m,this._vShader),f.attachShader(m,this._fShader),c.forEach((e,t)=>f.bindAttribLocation(m,e,t)),this.hasTransformFeedbackVaryings=!!d?.length,this.hasTransformFeedbackVaryings&&f.transformFeedbackVaryings(m,d,f.SEPARATE_ATTRIBS),f.linkProgram(m),n()&&!f.getProgramParameter(m,f.LINK_STATUS)&&o().error(`Could not link shader
|
|
3
|
+
validated: ${f.getProgramParameter(m,f.VALIDATE_STATUS)}, gl error ${f.getError()}, vertex: ${f.getShaderParameter(this._vShader,f.COMPILE_STATUS)}, fragment: ${f.getShaderParameter(this._fShader,f.COMPILE_STATUS)}, info log: ${f.getProgramInfoLog(m)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(let[e,t]of u){let n=f.getUniformBlockIndex(m,e);n<0xffffffff&&f.uniformBlockBinding(m,n,t)}this._glName=m,e.instanceCounter.increment(i.Program,this)}get glName(){return this._glName}get hasGLName(){return this._glName!=null}get compiled(){return this._compiled?!0:!this._context.capabilities.parallelShaderCompile||this.glName==null?(this._compiled=!0,!0):(this._compiled=!!this._context.gl.getProgramParameter(this.glName,37297),this._compiled)}dispose(){let e=this._context.gl,t=this._context.instanceCounter;this._nameToUniformLocation.forEach(e=>e&&t.decrement(i.Uniform,e)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(t.decrement(i.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),e.deleteShader(this._vShader),this._vShader=null,t.decrement(i.Shader,this)),this._fShader&&=(e.deleteShader(this._fShader),null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,t.decrement(i.Program,this))}_getUniformLocation(e){let t=this._nameToUniformLocation.get(e);if(t!==void 0)return t;if(this.glName){let t=this._context.gl.getUniformLocation(this.glName,e);return this._nameToUniformLocation.set(e,t),t&&this._context.instanceCounter.increment(i.Uniform,t),t}return null}hasUniform(e){return this._getUniformLocation(e)!=null}setUniform1i(e,t,n){m(n,t);let r=this._nameToUniform1.get(e);(r===void 0||t!==r)&&(this._context.gl.uniform1i(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1iv(e,t,n){h(n,t),f(this._nameToUniform1v,e,t)&&this._context.gl.uniform1iv(this._getUniformLocation(e),t)}setUniform2iv(e,t,n){h(n,t),f(this._nameToUniform2,e,t)&&this._context.gl.uniform2iv(this._getUniformLocation(e),t)}setUniform3iv(e,t,n){h(n,t),f(this._nameToUniform3,e,t)&&this._context.gl.uniform3iv(this._getUniformLocation(e),t)}setUniform4iv(e,t,n){h(n,t),f(this._nameToUniform4,e,t)&&this._context.gl.uniform4iv(this._getUniformLocation(e),t)}setUniform1f(e,t,n){m(n,t);let r=this._nameToUniform1.get(e);(r===void 0||t!==r)&&(this._context.gl.uniform1f(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1fv(e,t,n){h(n,t),f(this._nameToUniform1v,e,t)&&this._context.gl.uniform1fv(this._getUniformLocation(e),t)}setUniform2f(e,t,n,r){m(r,t,n);let i=this._nameToUniform2.get(e);i===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),t,n),this._nameToUniform2.set(e,[t,n])):(t!==i[0]||n!==i[1])&&(this._context.gl.uniform2f(this._getUniformLocation(e),t,n),i[0]=t,i[1]=n)}setUniform2fv(e,t,n){h(n,t),f(this._nameToUniform2,e,t)&&this._context.gl.uniform2fv(this._getUniformLocation(e),t)}setUniform3f(e,t,n,r,i){m(i,t,n,r);let a=this._nameToUniform3.get(e);a===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),t,n,r),this._nameToUniform3.set(e,[t,n,r])):(t!==a[0]||n!==a[1]||r!==a[2])&&(this._context.gl.uniform3f(this._getUniformLocation(e),t,n,r),a[0]=t,a[1]=n,a[2]=r)}setUniform3fv(e,t,n){h(n,t);let r=this._getUniformLocation(e);r!=null&&f(this._nameToUniform3,e,t)&&this._context.gl.uniform3fv(r,t)}setUniform4f(e,t,n,r,i,a){m(a,t,n,r,i);let o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),t,n,r,i),this._nameToUniform4.set(e,[t,n,r,i])):(o===void 0||t!==o[0]||n!==o[1]||r!==o[2]||i!==o[3])&&(this._context.gl.uniform4f(this._getUniformLocation(e),t,n,r,i),o[0]=t,o[1]=n,o[2]=r,o[3]=i)}setUniform4fv(e,t,n){h(n,t);let r=this._getUniformLocation(e);r!=null&&f(this._nameToUniform4,e,t)&&this._context.gl.uniform4fv(r,t)}setUniformMatrix3fv(e,t,n=!1,r){h(r,t);let i=this._getUniformLocation(e);i!=null&&f(this._nameToUniformMatrix3,e,t)&&this._context.gl.uniformMatrix3fv(i,n,t)}setUniformMatrix4fv(e,t,n=!1,r){h(r,t);let i=this._getUniformLocation(e);if(i!=null){let r=this._nameToUniformMatrix4,a=r.get(e),o=!1;if(!a)r.set(e,Array.from(t)),o=!0;else{let n=t.length;if(a.length!==n)r.set(e,Array.from(t)),o=!0;else for(let e=0;e<n;++e){let r=t[e];if(a[e]!==r){for(a[e]=r;e<n;++e)a[e]=t[e];o=!0;break}}}o&&this._context.gl.uniformMatrix4fv(i,n,t)}}setUniformMatrices4fv(e,t,n=!1,r){h(r,t);let i=this._getUniformLocation(e);i!=null&&f(this._nameToUniformMatrix4,e,t)&&this._context.gl.uniformMatrix4fv(i,n,t)}stop(){}}function l(e,t,r){let i=e.gl,a=i.createShader(t);return i.shaderSource(a,r),i.compileShader(a),n()&&!i.getShaderParameter(a,i.COMPILE_STATUS)&&(o().error(`Compile error in ${t===35633?`vertex`:`fragment`} shader`),o().error(i.getShaderInfoLog(a)),o().error(u(r))),a}function u(e){let t=2;return e.replaceAll(`
|
|
4
4
|
`,()=>`
|
|
5
|
-
`+
|
|
5
|
+
`+d(t++)+`:`)}function d(e){return e>=1e3?e.toString():(` `+e).slice(-3)}function f(t,n,r){let i=t.get(n);return i===void 0?(t.set(n,Array.from(r)),!0):e(i,r)}const p={enabled:!1},m=r()?(e,...t)=>h(e,t):()=>{},h=r()?(e,t)=>{if(e?.supportsNaN)return;let n=t.length;for(let e=0;e<n;++e){let n=t[e];Number.isNaN(n)&&o().error(`Got ${n} as uniform value from ${Error().stack}`)}}:()=>{};export{c as DisposableProgram,p as test};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import"../../core/has.js";import
|
|
2
|
+
import{filterInPlace as e}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import"../../core/has.js";import n from"../../core/Logger.js";const r=()=>n.getLogger(`esri.views.3d.webgl-engine.core.shaderModules.ShaderBuilder`);class i{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class a extends i{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new d,this.varyings=new f,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){let n=this.attributes.generateSource(e),r=this.varyings.generateSource(e),i=e===`vertex`?this.vertex:this.fragment,a=i.uniforms.generateSource(),o=i.code.generateSource(),s=i.main.generateSource(t),c=this.debugName?`// ${this.debugName}\n`:``,l=e===`vertex`?g:h,u=i.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es
|
|
3
3
|
${c}
|
|
4
4
|
${l}
|
|
5
5
|
${u.join(`
|
|
@@ -15,26 +15,26 @@ ${d.join(`
|
|
|
15
15
|
${o.join(`
|
|
16
16
|
`)}
|
|
17
17
|
${s.join(`
|
|
18
|
-
`)}`}generateBind(
|
|
19
|
-
`)||``} \n}`]}if(
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
${
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
${
|
|
36
|
-
${
|
|
37
|
-
${
|
|
18
|
+
`)}`}generateBind(t){let n=new Map;this.vertex.uniforms.entries.forEach(e=>{let t=e.bind[0];t&&n.set(e.name,t)}),this.fragment.uniforms.entries.forEach(e=>{let t=e.bind[0];t&&n.set(e.name,t)});let r=Array.from(n.keys()),i=Array.from(n.values()),a=i.length;return n=>{r&&=(e(i,(e,n)=>t.hasUniform(r[n])),a=i.length,null);for(let e=0;e<a;++e)i[e](t,n)}}generateBindPass(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[1];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[1];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return(t,i)=>{for(let a=0;a<r;++a)n[a](e,i,t)}}generateBindDraw(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[2];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[2];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return(t,i,a)=>{for(let o=0;o<r;++o)n[o](e,a,t,i)}}}class o{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(let t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(e==null)r().error(`Trying to add null Uniform from ${Error().stack}.`);else{if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new t(`shaderbuilder:duplicate-uniform`,`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:n})=>t==null?`uniform ${n} ${e};`:`uniform ${n} ${e}[${t}];`)}get entries(){return Array.from(this._entries.values())}}class s{constructor(){this._entries=new Map}add(e,n){if(this._entries.has(e))throw new t(`shaderbuilder:duplicate-input`,`Duplicate input for ${e}`);this._entries.set(e,n)}get(e){let n=this._entries.get(e);if(n==null)throw new t(`shaderbuilder:input-resolver-error`,`No resolver for input ${e} found.`);return n()}}class c{constructor(e){this._stage=e,this._bodies=[]}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){let e=[];for(let t of this._bodies)typeof t==`string`?e.push(t):e.push(...t());return[`void main() {\n ${e.join(`
|
|
19
|
+
`)||``} \n}`]}if(e)throw new t(`shaderbuilder:missing-main`,`Shader does not contain main function body.`);return[]}}class l{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)typeof t==`string`?e.push(t):e.push(...t());return e}}class u extends i{constructor(){super(...arguments),this.uniforms=new o(this),this.main=new c(this),this.code=new l(this),this.constants=new m(this),this.inputs=new s}get builder(){return this}}class d{constructor(){this._entries=[]}add(e,t){this._entries.push([e,t])}generateSource(e){return e===`fragment`?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class f{constructor(){this._entries=new Map}add(e,t,n){this._entries.has(e)?r().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,flat:n?.flat??!1,invariant:n?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((n,r)=>t.push((n.invariant&&e===`vertex`?`invariant `:``)+(n.flat?`flat `:``)+(e===`vertex`?`out`:`in`)+` ${n.type} ${r};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,n=0){let i=this._entries.get(n);i?.name===e&&i?.type===t?r().warn(`Fragment shader output location ${n} occupied`):this._entries.set(n,{name:e,type:t})}static{this.DEFAULT_TYPE=`vec4`}static{this.DEFAULT_NAME=`fragColor`}generateSource(e){if(e===`vertex`)return[];this._entries.size===0&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});let t=[];return this._entries.forEach((e,n)=>t.push(`layout(location = ${n}) out ${e.type} ${e.name};`)),t}}class m{constructor(e){this._stage=e,this._entries=new Set}add(e,t,n){let r=`ERROR_CONSTRUCTOR_STRING`;switch(t){case`float`:r=m._numberToFloatStr(n);break;case`int`:r=m._numberToIntStr(n);break;case`uint`:r=m._numberToUintStr(n);break;case`bool`:r=n.toString();break;case`vec2`:r=`vec2(${m._numberToFloatStr(n[0])},\
|
|
20
|
+
${m._numberToFloatStr(n[1])})`;break;case`vec3`:r=`vec3(${m._numberToFloatStr(n[0])},\
|
|
21
|
+
${m._numberToFloatStr(n[1])},\
|
|
22
|
+
${m._numberToFloatStr(n[2])})`;break;case`vec4`:r=`vec4(${m._numberToFloatStr(n[0])},\
|
|
23
|
+
${m._numberToFloatStr(n[1])},\
|
|
24
|
+
${m._numberToFloatStr(n[2])},\
|
|
25
|
+
${m._numberToFloatStr(n[3])})`;break;case`ivec2`:r=`ivec2(${m._numberToIntStr(n[0])},\
|
|
26
|
+
${m._numberToIntStr(n[1])})`;break;case`ivec3`:r=`ivec3(${m._numberToIntStr(n[0])},\
|
|
27
|
+
${m._numberToIntStr(n[1])},\
|
|
28
|
+
${m._numberToIntStr(n[2])})`;break;case`ivec4`:r=`ivec4(${m._numberToIntStr(n[0])},\
|
|
29
|
+
${m._numberToIntStr(n[1])},\
|
|
30
|
+
${m._numberToIntStr(n[2])},\
|
|
31
|
+
${m._numberToIntStr(n[3])})`;break;case`uvec2`:r=`uvec2(${m._numberToUintStr(n[0])},\
|
|
32
|
+
${m._numberToUintStr(n[1])})`;break;case`uvec3`:r=`uvec3(${m._numberToUintStr(n[0])},\
|
|
33
|
+
${m._numberToUintStr(n[1])},\
|
|
34
|
+
${m._numberToUintStr(n[2])})`;break;case`uvec4`:r=`uvec4(${m._numberToUintStr(n[0])},\
|
|
35
|
+
${m._numberToUintStr(n[1])},\
|
|
36
|
+
${m._numberToUintStr(n[2])},\
|
|
37
|
+
${m._numberToUintStr(n[3])})`;break;case`mat2`:case`mat3`:case`mat4`:r=`${t}(${Array.prototype.map.call(n,e=>m._numberToFloatStr(e)).join(`, `)})`}return this._entries.add(`const ${t} ${e} = ${r};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const h=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
38
38
|
precision highp float;
|
|
39
39
|
precision highp int;
|
|
40
40
|
precision highp sampler2D;
|
|
@@ -48,7 +48,7 @@ ${s.join(`
|
|
|
48
48
|
precision mediump usampler2D;
|
|
49
49
|
precision mediump sampler2DArray;
|
|
50
50
|
precision mediump sampler2DShadow;
|
|
51
|
-
#endif`,
|
|
51
|
+
#endif`,g=`precision highp float;
|
|
52
52
|
precision highp int;
|
|
53
53
|
precision highp sampler2D;
|
|
54
54
|
precision highp usampler2D;
|
|
@@ -57,4 +57,4 @@ ${s.join(`
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
invariant gl_Position;
|
|
60
|
-
`;export{
|
|
60
|
+
`;export{l as Code,i as Includes,s as Inputs,c as Main,a as ShaderBuilder,u as Stage,o as Uniforms};
|
package/webscene/Slide.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Basemap.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a}from"../core/accessorSupport/ensureType.js";import{result as o}from"../core/asyncUtils.js";import{ClonableMixin as s}from"../core/Clonable.js";import c from"../core/Collection.js";import{referenceSetter as l}from"../core/collectionUtils.js";import{EventedMixin as u}from"../core/Evented.js";import{JSONSupport as d}from"../core/JSONSupport.js";import{squaredDistance as f}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../core/Logger.js";import{moduloPositive as h}from"../core/mathUtils.js";import{destroyMaybe as g,removeMaybe as _}from"../core/maybe.js";import{onAbortOrThrow as v,createAbortError as y,isAbortError as b}from"../core/promiseUtils.js";import{whenOnce as x,when as S}from"../core/reactiveUtils.js";import{Milliseconds as C,Seconds as w}from"../core/time.js";import T from"../layers/Layer.js";import{basemapEnsureType as E,clonePreservingTiledLayers as D}from"../support/basemapEnsureType.js";import O from"../Viewpoint.js";import{TaskPriority as k}from"../views/support/Scheduler.js";import A from"../webdoc/support/SlideThumbnail.js";import{timeExtent as j}from"../webdoc/support/timeProperties.js";import M from"./SunLighting.js";import N from"./support/Description.js";import P from"./support/SlideElements.js";import F from"./support/SlideEnvironment.js";import I from"./support/SlideGround.js";import L from"./support/SlideVisibleLayer.js";import R from"./support/Title.js";import z from"./VirtualLighting.js";let B=0;const V=c.ofType(L),H=[`caption`,`cover`,`none`];let U=class extends s(u(d)){constructor(e){super(e),this.id=Date.now().toString(16)+`-slide-`+B++,this.hidden=!1,this.viewpoint=null,this.ground=null,this.layout=`caption`,this.enabledFocusAreas=null,this.environment=new F,this.timeExtent=null,this.timeZone=null,this.elements=new P,this.title=new R,this.description=new N,this.thumbnail=new A,this.visibleLayers=new V}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas=null,this.basemap=null,this.thumbnail=g(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements.destroy()}get title(){return this._get(`title`)}set title(e){e=typeof e==`string`?new R({text:e}):a(R,e),this._set(`title`,e)}get description(){return this._get(`description`)}set description(e){e=typeof e==`string`?new N({text:e}):a(N,e),this._set(`description`,e)}get thumbnail(){return this._get(`thumbnail`)}set thumbnail(e){e=typeof e==`string`?new A({url:e}):a(A,e),this._set(`thumbnail`,e)}get basemap(){return this._get(`basemap`)}set basemap(e){this._set(`basemap`,E(e))}set visibleLayers(e){this._set(`visibleLayers`,l(e,this._get(`visibleLayers`),V))}castVisibleLayers(e){return!e||typeof e.map!=`function`?null:e.map(e=>{if(typeof e==`string`)return{id:e};if(e instanceof T){let t=K(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:`sublayerIds`in e?e.sublayerIds:void 0}:(m.getLogger(this).warn(`Invalid visible layer, expected { id }, Layer or "id"`),e)})}async _updateVisibleLayers(e){let t=[];await Promise.allSettled(this._getLayers(e.map).map(n=>e.whenLayerView(n).then(e=>{if(e.visible){let r=K(n);t.push(new L({id:e.layer.id,sublayerIds:r}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}async updateFrom(e,t){let n={format:`png`,quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting=e.environment.lighting.type===`virtual`?z.prototype.clone.apply(e.environment.lighting):M.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.enabledFocusAreas=new c(e.focusAreasView?.enabledAreas.map(({id:e})=>e)??[]),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?I.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.timeZone=e.timeZone,this.elements.analyses.updateFrom(e),await this._updateVisibleLayers(e);let r=await e.takeScreenshot(n);return this.thumbnail=new A({url:r.dataUrl}),this}async applyTo(e,t){this.emit(`apply-slide-start`),this._applyToController!=null&&this._applyToController.abort();let n=new AbortController;this._applyToController=n;let r=v(t,()=>n?.abort()),i=()=>{this._applyToController===n&&(this._applyToController=null),n=null,r?.remove()};try{await x(()=>e.ready,n.signal)}catch(e){throw i(),e}if(n.signal.aborted)throw i(),this.emit(`apply-slide-cancel`),y();let a=e.resourceController.scheduler.registerTask(k.SLIDE),s=!1,c={animate:!0,...t,signal:this._applyToController.signal},l=await o(e.addUpdatingPromise((async()=>{await Promise.all([a.schedule(async()=>s=await this._setViewpointOfInterest(e,c)),a.schedule(()=>this._applyBasemap(e,c),c.signal),a.schedule(()=>this._loadLayersWithSublayerVisibility(e))]),await Promise.all([a.schedule(()=>this._applyLayerVisibility(e),c.signal),a.schedule(()=>this._applyFocusAreaEnabled(e.map?.focusAreas.areas)),a.schedule(()=>this._applyGround(e),c.signal),a.schedule(()=>this.elements.analyses.applyTo(e),c.signal),a.schedule(()=>this._applyViewpoint(e,c),c.signal),a.schedule(()=>e.timeExtent=this.timeExtent?.clone()??null,c.signal),a.schedule(()=>{this.timeZone!=null&&(e.timeZone=this.timeZone)},c.signal),a.schedule(()=>e.environment.weather=this.environment.weather.clone())])})()));if(s&&(e.contentCamera=null),a.remove(),i(),l.ok===!1)throw this.emit(`apply-slide-cancel`),l.error;return this.emit(`apply-slide-complete`),this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(e){if(b(e))throw e}e.map.basemap=D(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaEnabled(e){if(e&&this.enabledFocusAreas)for(let t of e)t.enabled=this.enabledFocusAreas.includes(t.id)}_getLayers(e){let t=new c;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach(e=>{e.persistenceEnabled&&(t.add(e),`layers`in e&&this._collectLayers(e,t))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(e=>this.visibleLayers.find(t=>t.id===e.id)?.sublayerIds?e.load():null))}_applyLayerVisibility(e){this.visibleLayers&&this._getLayers(e.map).forEach(e=>{let t=this.visibleLayers.find(t=>t.id===e.id);e.visible=t!=null;let n=t?.sublayerIds,r=G(e);n&&r&&r.forEach(e=>e.visible=n.includes(e.id))})}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;let{toCameraAsync:n}=await import(`../views/3d/support/viewpointUtils.js`),r=await n(e,this.viewpoint);return e.contentCamera=r,r!=null}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){let n=this.environment.lighting;if(t.animate&&n.type===`sun`&&n.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(n.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let n=null;return e.environment.lighting.type!==`virtual`&&this.environment.lighting.type!==`virtual`&&(e.viewingMode===`global`&&(n=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.glow=this.environment.lighting.glow,e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,this.environment.lighting.type===`virtual`||e.environment.lighting.type===`virtual`?(e.environment.applyLighting(this.environment.lighting.clone()),e.environment.lighting.type!==`virtual`&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):this.environment.lighting.displayUTCOffset!=null&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset),e.goTo(this.viewpoint,t).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(t=>{throw e.animation??this._applyCachedCameraTrackingEnabled(e),t}).finally(()=>{_(n)})}_applyCachedCameraTrackingEnabled(e){e.environment.cachedCameraTrackingEnabled!=null&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[C(e.getTime()),w(e.getUTCHours()*3600+e.getUTCMinutes()*60+e.getUTCSeconds())]}_setTime(e,t,n){return e.setTime(t),e.setUTCHours(n/3600),e.setUTCMinutes(n%3600/60),e.setUTCSeconds(n%3600%60),e}_animateLightingWithCamera(e,t,n){let r=new Date(t.date.toString()),[i,a]=this._getTime(r),[o,s]=this._getTime(n.date),c=Y(a,s),l=e.renderCoordsHelper,u=p();l.toRenderCoords(e.camera.position,u);let d=p(),m=p();this.viewpoint.camera!=null&&l.toRenderCoords(this.viewpoint.camera.position,d);let h=new Date;return S(()=>e.camera,e=>{l.toRenderCoords(e.position,m);let n=f(u,m),r=f(d,m),s=0;n+r!==0&&(s=n/(n+r));let p=i+(o-i)*s,g=X(a,w(c*s));t.date=this._setTime(h,p,g)})}write(e,t){t?.origin||(t={origin:`web-scene`,...t});let n=super.write(e,t);return n?.elements&&Object.keys(n.elements).length===0&&delete n.elements,n}read(e,t){t?.origin||(t={origin:`web-scene`,...t}),super.read(e,t)}static createFrom(e,t){return new this().updateFrom(e,t)}};e([n({type:String,json:{write:{isRequired:!0}}})],U.prototype,`id`,void 0),e([n({type:R,useTypeForAutocast:!1,json:{default:()=>new R({text:``}),write:{isRequired:!0}}})],U.prototype,`title`,null),e([n({type:N,useTypeForAutocast:!1,json:{write:{overridePolicy(e){return{enabled:!!(e&&e.text)}}}}})],U.prototype,`description`,null),e([n({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],U.prototype,`hidden`,void 0),e([n({type:A,useTypeForAutocast:!1,json:{default:()=>new A({url:``}),write:{isRequired:!0}}})],U.prototype,`thumbnail`,null),e([n({type:O,nonNullable:!0,json:{write:{isRequired:!0}}})],U.prototype,`viewpoint`,void 0),e([n({type:t,useTypeForAutocast:!1,json:{read:{source:`baseMap`},write:{target:`baseMap`}}})],U.prototype,`basemap`,null),e([n({type:I,json:{write:!0}})],U.prototype,`ground`,void 0),e([n({type:H,json:{write:!0,default:`caption`},nonNullable:!0})],U.prototype,`layout`,void 0),e([n({type:V,json:{write:{isRequired:!0}}})],U.prototype,`visibleLayers`,null),e([r(`visibleLayers`)],U.prototype,`castVisibleLayers`,null),e([n({type:c.ofType(String),json:{write:!0},clonable:e=>e?new c(e.items):null})],U.prototype,`enabledFocusAreas`,void 0),e([n({type:F,json:{write:!0}})],U.prototype,`environment`,void 0),e([n(j)],U.prototype,`timeExtent`,void 0),e([n({type:String,json:{read:!0,write:!0}})],U.prototype,`timeZone`,void 0),e([n({type:P,nonNullable:!0,json:{write:!0}})],U.prototype,`elements`,void 0),U=e([i(`esri.webscene.Slide`)],U);const W=U;function G(e){if(e.type===`building-scene`||e.type===`map-image`)return e.allSublayers.toArray()}function K(e){let t=G(e);if(t)return t.filter(e=>e.visible).map(e=>e.id)}const q=w(86400),J=w(43200);function Y(e,t){let n=t-e;return n>J&&(n-=q),n<-J&&(n+=q),w(n)}function X(e,t){return w(h(e+t,q))}export{W as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Basemap.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a}from"../core/accessorSupport/ensureType.js";import{result as o}from"../core/asyncUtils.js";import{ClonableMixin as s}from"../core/Clonable.js";import c from"../core/Collection.js";import{referenceSetter as l}from"../core/collectionUtils.js";import{EventedMixin as u}from"../core/Evented.js";import{JSONSupport as d}from"../core/JSONSupport.js";import{squaredDistance as f}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../core/Logger.js";import{moduloPositive as h}from"../core/mathUtils.js";import{destroyMaybe as g,removeMaybe as _}from"../core/maybe.js";import{onAbortOrThrow as v,createAbortError as y,isAbortError as b}from"../core/promiseUtils.js";import{whenOnce as x,when as S}from"../core/reactiveUtils.js";import{Milliseconds as C,Seconds as w}from"../core/time.js";import T from"../layers/Layer.js";import{basemapEnsureType as E,clonePreservingTiledLayers as D}from"../support/basemapEnsureType.js";import O from"../Viewpoint.js";import{TaskPriority as k}from"../views/support/Scheduler.js";import A from"../webdoc/support/SlideThumbnail.js";import{timeExtent as j}from"../webdoc/support/timeProperties.js";import M from"./SunLighting.js";import N from"./support/Description.js";import P from"./support/SlideElements.js";import F from"./support/SlideEnvironment.js";import I from"./support/SlideGround.js";import L from"./support/SlideVisibleLayer.js";import R from"./support/Title.js";import z from"./VirtualLighting.js";let B=0;const V=c.ofType(L),H=[`caption`,`cover`,`none`];let U=class extends s(u(d)){constructor(e){super(e),this.id=Date.now().toString(16)+`-slide-`+B++,this.hidden=!1,this.viewpoint=null,this.ground=null,this.layout=`caption`,this.enabledFocusAreas=null,this.environment=new F,this.timeExtent=null,this.timeZone=null,this.elements=new P,this.title=new R,this.description=new N,this.thumbnail=new A,this.visibleLayers=new V}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas=null,this.basemap=null,this.thumbnail=g(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements.destroy()}get title(){return this._get(`title`)}set title(e){e=typeof e==`string`?new R({text:e}):a(R,e),this._set(`title`,e)}get description(){return this._get(`description`)}set description(e){e=typeof e==`string`?new N({text:e}):a(N,e),this._set(`description`,e)}get thumbnail(){return this._get(`thumbnail`)}set thumbnail(e){e=typeof e==`string`?new A({url:e}):a(A,e),this._set(`thumbnail`,e)}get basemap(){return this._get(`basemap`)}set basemap(e){this._set(`basemap`,E(e))}set visibleLayers(e){this._set(`visibleLayers`,l(e,this._get(`visibleLayers`),V))}castVisibleLayers(e){return!e||typeof e.map!=`function`?null:e.map(e=>{if(typeof e==`string`)return{id:e};if(e instanceof T){let t=K(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:`sublayerIds`in e?e.sublayerIds:void 0}:(m.getLogger(this).warn(`Invalid visible layer, expected { id }, Layer or "id"`),e)})}async _updateVisibleLayers(e){let t=[];await Promise.allSettled(this._getLayers(e.map).map(n=>e.whenLayerView(n).then(e=>{if(e.visible){let r=K(n);t.push(new L({id:e.layer.id,sublayerIds:r}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}async updateFrom(e,t){let n={format:`png`,quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting=e.environment.lighting.type===`virtual`?z.prototype.clone.apply(e.environment.lighting):M.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.enabledFocusAreas=new c(e.focusAreasView?.enabledAreas.map(({id:e})=>e)??[]),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?I.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.timeZone=e.timeZone,this.elements.analyses.updateFrom(e),await this._updateVisibleLayers(e);let r=await e.takeScreenshot(n);return this.thumbnail=new A({url:r.dataUrl}),this}async applyTo(e,t){this.emit(`apply-slide-start`),this._applyToController!=null&&this._applyToController.abort();let n=new AbortController;this._applyToController=n;let r=v(t,()=>n?.abort()),i=()=>{this._applyToController===n&&(this._applyToController=null),n=null,r?.remove()};try{await x(()=>e.ready,n.signal)}catch(e){throw i(),e}if(n.signal.aborted)throw i(),this.emit(`apply-slide-cancel`),y();let a=e.resourceController.scheduler.registerTask(k.SLIDE),s=!1,c={animate:!0,...t,signal:this._applyToController.signal},l=await o(e.addUpdatingPromise((async()=>{await Promise.all([a.schedule(async()=>s=await this._setViewpointOfInterest(e,c)),a.schedule(()=>this._applyBasemap(e,c),c.signal),a.schedule(()=>this._loadLayersWithSublayerVisibility(e))]),await Promise.all([a.schedule(()=>this._applyLayerVisibility(e),c.signal),a.schedule(()=>this._applyFocusAreaEnabled(e.map?.focusAreas.areas)),a.schedule(()=>this._applyGround(e),c.signal),a.schedule(()=>this.elements.analyses.applyTo(e),c.signal),a.schedule(()=>this._applyViewpoint(e,c),c.signal),a.schedule(()=>e.timeExtent=this.timeExtent?.clone()??null,c.signal),a.schedule(()=>{this.timeZone!=null&&(e.timeZone=this.timeZone)},c.signal),a.schedule(()=>e.environment.weather=this.environment.weather.clone())])})()));if(s&&(e.contentCamera=null),a.remove(),i(),l.ok===!1)throw this.emit(`apply-slide-cancel`),l.error;return this.emit(`apply-slide-complete`),this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(e){if(b(e))throw e}e.map.basemap=D(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaEnabled(e){if(e&&this.enabledFocusAreas)for(let t of e)t.enabled=this.enabledFocusAreas.includes(t.id)}_getLayers(e){let t=new c;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach(e=>{e.persistenceEnabled&&(t.add(e),`layers`in e&&this._collectLayers(e,t))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(e=>this.visibleLayers.find(t=>t.id===e.id)?.sublayerIds?e.load():null))}_applyLayerVisibility(e){this.visibleLayers&&this._getLayers(e.map).forEach(e=>{let t=this.visibleLayers.find(t=>t.id===e.id);e.visible=t!=null;let n=t?.sublayerIds,r=G(e);n&&r&&r.forEach(e=>e.visible=n.includes(e.id))})}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;let{toCameraAsync:n}=await import(`../views/3d/support/viewpointUtils.js`),r=await n(e,this.viewpoint);return e.contentCamera=r,r!=null}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){let n=this.environment.lighting;if(t.animate&&n.type===`sun`&&n.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(n.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let n=null;return e.environment.lighting.type!==`virtual`&&this.environment.lighting.type!==`virtual`&&(e.state.isGlobal&&(n=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.glow=this.environment.lighting.glow,e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,this.environment.lighting.type===`virtual`||e.environment.lighting.type===`virtual`?(e.environment.applyLighting(this.environment.lighting.clone()),e.environment.lighting.type!==`virtual`&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):this.environment.lighting.displayUTCOffset!=null&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset),e.goTo(this.viewpoint,t).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(t=>{throw e.animation??this._applyCachedCameraTrackingEnabled(e),t}).finally(()=>{_(n)})}_applyCachedCameraTrackingEnabled(e){e.environment.cachedCameraTrackingEnabled!=null&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[C(e.getTime()),w(e.getUTCHours()*3600+e.getUTCMinutes()*60+e.getUTCSeconds())]}_setTime(e,t,n){return e.setTime(t),e.setUTCHours(n/3600),e.setUTCMinutes(n%3600/60),e.setUTCSeconds(n%3600%60),e}_animateLightingWithCamera(e,t,n){let r=new Date(t.date.toString()),[i,a]=this._getTime(r),[o,s]=this._getTime(n.date),c=Y(a,s),l=e.renderCoordsHelper,u=p();l.toRenderCoords(e.camera.position,u);let d=p(),m=p();this.viewpoint.camera!=null&&l.toRenderCoords(this.viewpoint.camera.position,d);let h=new Date;return S(()=>e.camera,e=>{l.toRenderCoords(e.position,m);let n=f(u,m),r=f(d,m),s=0;n+r!==0&&(s=n/(n+r));let p=i+(o-i)*s,g=X(a,w(c*s));t.date=this._setTime(h,p,g)})}write(e,t){t?.origin||(t={origin:`web-scene`,...t});let n=super.write(e,t);return n?.elements&&Object.keys(n.elements).length===0&&delete n.elements,n}read(e,t){t?.origin||(t={origin:`web-scene`,...t}),super.read(e,t)}static createFrom(e,t){return new this().updateFrom(e,t)}};e([n({type:String,json:{write:{isRequired:!0}}})],U.prototype,`id`,void 0),e([n({type:R,useTypeForAutocast:!1,json:{default:()=>new R({text:``}),write:{isRequired:!0}}})],U.prototype,`title`,null),e([n({type:N,useTypeForAutocast:!1,json:{write:{overridePolicy(e){return{enabled:!!(e&&e.text)}}}}})],U.prototype,`description`,null),e([n({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],U.prototype,`hidden`,void 0),e([n({type:A,useTypeForAutocast:!1,json:{default:()=>new A({url:``}),write:{isRequired:!0}}})],U.prototype,`thumbnail`,null),e([n({type:O,nonNullable:!0,json:{write:{isRequired:!0}}})],U.prototype,`viewpoint`,void 0),e([n({type:t,useTypeForAutocast:!1,json:{read:{source:`baseMap`},write:{target:`baseMap`}}})],U.prototype,`basemap`,null),e([n({type:I,json:{write:!0}})],U.prototype,`ground`,void 0),e([n({type:H,json:{write:!0,default:`caption`},nonNullable:!0})],U.prototype,`layout`,void 0),e([n({type:V,json:{write:{isRequired:!0}}})],U.prototype,`visibleLayers`,null),e([r(`visibleLayers`)],U.prototype,`castVisibleLayers`,null),e([n({type:c.ofType(String),json:{write:!0},clonable:e=>e?new c(e.items):null})],U.prototype,`enabledFocusAreas`,void 0),e([n({type:F,json:{write:!0}})],U.prototype,`environment`,void 0),e([n(j)],U.prototype,`timeExtent`,void 0),e([n({type:String,json:{read:!0,write:!0}})],U.prototype,`timeZone`,void 0),e([n({type:P,nonNullable:!0,json:{write:!0}})],U.prototype,`elements`,void 0),U=e([i(`esri.webscene.Slide`)],U);const W=U;function G(e){if(e.type===`building-scene`||e.type===`map-image`)return e.allSublayers.toArray()}function K(e){let t=G(e);if(t)return t.filter(e=>e.visible).map(e=>e.id)}const q=w(86400),J=w(43200);function Y(e,t){let n=t-e;return n>J&&(n-=q),n<-J&&(n+=q),w(n)}function X(e,t){return w(h(e+t,q))}export{W as default};
|
|
@@ -30,10 +30,8 @@ export default class VirtualLighting extends JSONSupport {
|
|
|
30
30
|
* Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom
|
|
31
31
|
* levels, shadows are not displayed. For more control on which 3D objects cast shadows use the `castShadows`
|
|
32
32
|
* property available on [ObjectSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/ObjectSymbol3DLayer/#castShadows),
|
|
33
|
-
*
|
|
34
|
-
* [
|
|
35
|
-
* [ExtrudeSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/ExtrudeSymbol3DLayer/#castShadows),
|
|
36
|
-
* and [PathSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/#castShadows).
|
|
33
|
+
* [FillSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/#castShadows), [ExtrudeSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/ExtrudeSymbol3DLayer/#castShadows),
|
|
34
|
+
* [WaterSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/WaterSymbol3DLayer/#castShadows), and [PathSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/#castShadows).
|
|
37
35
|
*
|
|
38
36
|
* @default false
|
|
39
37
|
*/
|
|
@@ -6,7 +6,7 @@ import type { InputUnion } from "../../../form/elements/inputs/types.js";
|
|
|
6
6
|
import type { FieldValue } from "../../../layers/support/fieldUtils.js";
|
|
7
7
|
import type { NumericRange } from "../../../layers/support/NumericRange.js";
|
|
8
8
|
import type { DomainUnion as Domain } from "../../../layers/support/types.js";
|
|
9
|
-
import type { FieldInputDataTypes } from "../../support/forms/types.js";
|
|
9
|
+
import type { FieldInputDataTypes, FieldValueOptionSet } from "../../support/forms/types.js";
|
|
10
10
|
import type { EditableInputProperties } from "./EditableInput.js";
|
|
11
11
|
import type { FieldInputMessage } from "./types.js";
|
|
12
12
|
import type { InputController } from "./support/controllerUtils.js";
|
|
@@ -30,6 +30,8 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
30
30
|
* [BatchAttributeFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/)
|
|
31
31
|
*/
|
|
32
32
|
constructor(properties: FieldInputProperties);
|
|
33
|
+
/** @internal */
|
|
34
|
+
get codedValueOptions(): FieldValueOptionSet;
|
|
33
35
|
/**
|
|
34
36
|
* The type of data displayed by the field input. Possible values are listed below.
|
|
35
37
|
*
|
|
@@ -73,6 +75,12 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
73
75
|
accessor inputController: InputController | null;
|
|
74
76
|
/** An array of features that do not have a valid value for this field. */
|
|
75
77
|
get invalidFeatures(): Graphic[];
|
|
78
|
+
/**
|
|
79
|
+
* Indicates whether the field is a subtype field for any of the layers associated with this input.
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
get isSubtypeField(): boolean;
|
|
76
84
|
/** The input's label. */
|
|
77
85
|
get label(): string;
|
|
78
86
|
/** The maximum length of the input. If no length is specified, the value is `-1`. */
|
|
@@ -107,6 +115,14 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
107
115
|
get range(): NumericRange;
|
|
108
116
|
/** Indicates whether the field is required. This property will be true if it is required for any associated layers of the input. */
|
|
109
117
|
get required(): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Indicates whether the "No Value" option is enabled for the field input.
|
|
120
|
+
* This property takes into account whether the field is required and whether
|
|
121
|
+
* the input's `showNoValue` property is set`.
|
|
122
|
+
*
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
get showNoValueOptionEnabled(): boolean;
|
|
110
126
|
/**
|
|
111
127
|
* The status of the field input.
|
|
112
128
|
*
|