@arcgis/core 4.25.0-next.20220718 → 4.25.0-next.20220721
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Camera.js +1 -1
- package/analysis/DimensioningAnalysis.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/analysis/SliceAnalysis.js +1 -1
- package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/1751de504354d98ac3fd.js +1 -0
- package/assets/esri/core/workers/chunks/1f4f1896880bfa6801c5.js +1 -0
- package/assets/esri/core/workers/chunks/290cd411d0d18b1d0efd.js +1 -0
- package/assets/esri/core/workers/chunks/{ab3bd5fecdb97f2d690e.js → 3b5be512567d9c1c6fe6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c3236a7058e64ea3b939.js → 3c9da9b88777700879aa.js} +1 -1
- package/assets/esri/core/workers/chunks/{f96e8724ae3458f5e262.js → 4a7aa1b9de61eb013647.js} +1 -1
- package/assets/esri/core/workers/chunks/4cb64ccb5fba126f9a66.js +1 -0
- package/assets/esri/core/workers/chunks/{68f19e58aae01791944e.js → 579ba109718bc2554008.js} +1 -1
- package/assets/esri/core/workers/chunks/59845b02b07a8ed7ce81.js +1 -0
- package/assets/esri/core/workers/chunks/{c705f907ce60a646d9aa.js → 652d36523efbe5c9ebb2.js} +1 -1
- package/assets/esri/core/workers/chunks/888d8e4471c9a2cd5009.js +1 -0
- package/assets/esri/core/workers/chunks/9493a8e5d6001b6bf275.js +1 -0
- package/assets/esri/core/workers/chunks/9d824cdfbcdf3cb3246f.js +1 -0
- package/assets/esri/core/workers/chunks/bf348f6f52701fa6016e.js +987 -0
- package/assets/esri/core/workers/chunks/d02881954c0cc0d39dfb.js +1 -0
- package/assets/esri/core/workers/chunks/{1ecbf642debc2207b762.js → da54483123f377e9b3e1.js} +1 -1
- package/assets/esri/core/workers/chunks/{61b71b8e028eda10ccab.js → e4ad2cf5d6bded02e392.js} +1 -1
- package/assets/esri/core/workers/chunks/{3bfab05ae07ac18a75fe.js → f298a70f3b6f27675d53.js} +1 -1
- package/assets/esri/core/workers/chunks/{d499cce61c1c5c367380.js → f40290cfad3fe6fb4ef9.js} +1 -1
- package/assets/esri/layers/support/rasterFormats/lerc-wasm.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/ComponentShader.glsl.js +39 -33
- package/chunks/Laserlines.glsl.js +4 -4
- package/chunks/Precipitation.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +46 -44
- package/chunks/Stars.glsl.js +2 -2
- package/chunks/Terrain.glsl.js +25 -17
- package/chunks/boundedPlane.js +1 -1
- package/chunks/lerc-wasm.js +1 -1
- package/chunks/mat2d.js +1 -1
- package/chunks/quatf32.js +1 -1
- package/core/BidiEngine.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/libs/gl-matrix-2/factories/quatf32.js +1 -1
- package/core/libs/gl-matrix-2/math/mat2d.js +1 -1
- package/core/perspectiveUtils.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/reactiveUtils.js +1 -1
- package/core/unitUtils.js +1 -1
- package/geometry/projection.js +1 -1
- package/geometry/projectionEllipsoid.js +1 -1
- package/geometry/support/MeshTexture.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/index.js +1 -1
- package/geometry/support/meshUtils/loadExternal.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/scaleUtils.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/interfaces.d.ts +3 -33
- package/layers/FeatureLayer.js +1 -1
- package/layers/effects/parser.js +1 -1
- package/layers/graphics/hydratedFeatures.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/support/ContingentValue.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/PixelBlock.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/layers/support/rasterDatasets/CloudRaster.js +1 -1
- package/layers/support/rasterDatasets/EphemeralBlockCache.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/multipartParser.js +1 -1
- package/layers/support/rasterFormats/ImageCanvasDecoder.js +1 -1
- package/layers/support/rasterFormats/JpgPlus.js +1 -1
- package/layers/support/rasterFormats/Lerc.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/Raw.js +1 -1
- package/layers/support/rasterFormats/TiffTags.js +1 -1
- package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/RasterShadedReliefRenderer.js +1 -1
- package/renderers/RasterStretchRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/AuthoringInfo.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/query/operations/queryTopFeatures.js +1 -1
- package/rest/support/DirectionsFeatureSet.js +1 -1
- package/rest/support/ImageHistogramParameters.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/smartMapping/labels/clusters.js +1 -1
- package/smartMapping/renderers/relationship.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/support/basemapUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/LabelSymbol3D.js +1 -1
- package/symbols/PointSymbol3D.js +1 -1
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/vectorTiles/Feature.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
- package/views/2d/engine/webgl/SDFConverter.js +1 -1
- package/views/2d/engine/webgl/TurboLine.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushClip.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushOverlay.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
- package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
- package/views/2d/engine/webgl/mesh/heuristics.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicLineTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicMarkerTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/layers/features/createSymbolSchema.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.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/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/IDBCache.js +1 -1
- package/views/3d/layers/i3s/IDBMockCache.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TilingSchemeLogic.js +1 -1
- package/views/3d/terrain/interfaces.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +9 -0
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +18 -17
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +5 -0
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/animation/pointToPoint/apex/planning.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/input/handlers/LatestPointer.js +1 -1
- package/views/input/handlers/MultiTouch.js +5 -0
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
- package/views/interactive/tooltip/Tooltip.js +1 -1
- package/views/interactive/tooltip/support/measurements.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/navigation/FilteredFiniteDifference.js +1 -1
- package/views/navigation/MomentumEstimator.js +1 -1
- package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/navigation/RotationMomentumEstimator.js +1 -1
- package/views/support/GroundViewElevationSampler.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/screenshotUtils.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/capabilities/Capabilities.js +1 -1
- package/views/webgl/capabilities.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Widget.js +1 -1
- package/assets/esri/core/workers/chunks/04ea469cb081e181ca82.js +0 -1
- package/assets/esri/core/workers/chunks/16c2626ca47132700519.js +0 -1
- package/assets/esri/core/workers/chunks/1e4e5d147263e98536bc.js +0 -1
- package/assets/esri/core/workers/chunks/35083def3c658d1ae9ff.js +0 -1
- package/assets/esri/core/workers/chunks/40032d2bf404a46b8f80.js +0 -1
- package/assets/esri/core/workers/chunks/613e82a3e13442685ac4.js +0 -1
- package/assets/esri/core/workers/chunks/64b4f1dbf61439cde801.js +0 -1
- package/assets/esri/core/workers/chunks/abd68b7ba3be4696611c.js +0 -1
- package/assets/esri/core/workers/chunks/b8a062c0c9c626acf61e.js +0 -982
- package/assets/esri/core/workers/chunks/e08686088be0aaca1a99.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{y as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as
|
|
5
|
+
import{isSome as e}from"../../../../../core/maybe.js";import{y as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,BufferViewVec4u8 as o,BufferViewVec2f as r,BufferViewVec3f as n}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as s}from"../../lib/Util.js";import{VertexAttribute as i}from"../../lib/VertexAttribute.js";function c(e,t,f,o,r=1){const n=f.typedBuffer,s=f.typedBufferStride,i=e.length;if(o*=s,1===r)for(let c=0;c<i;++c)n[o]=t[e[c]],o+=s;else for(let c=0;c<i;++c){const f=t[e[c]];for(let e=0;e<r;e++)n[o]=f,o+=s}}function l(e,t,f,o){const r=f.typedBuffer,n=f.typedBufferStride,s=e.length;o*=n;for(let i=0;i<s;++i){const f=2*e[i];r[o]=t[f],r[o+1]=t[f+1],o+=n}}function d(e,t,f,o,r){const n=f.typedBuffer,s=f.typedBufferStride,i=e.length;if(o*=s,null==r||1===r)for(let c=0;c<i;++c){const f=3*e[c];n[o]=t[f],n[o+1]=t[f+1],n[o+2]=t[f+2],o+=s}else for(let c=0;c<i;++c){const f=3*e[c];for(let e=0;e<r;++e)n[o]=t[f],n[o+1]=t[f+1],n[o+2]=t[f+2],o+=s}}function u(e,t,f,o,r=1){const n=f.typedBuffer,s=f.typedBufferStride,i=e.length;if(o*=s,1===r)for(let c=0;c<i;++c){const f=4*e[c];n[o]=t[f],n[o+1]=t[f+1],n[o+2]=t[f+2],n[o+3]=t[f+3],o+=s}else for(let c=0;c<i;++c){const f=4*e[c];for(let e=0;e<r;++e)n[o]=t[f],n[o+1]=t[f+1],n[o+2]=t[f+2],n[o+3]=t[f+3],o+=s}}function a(e,t,f,o){const r=f.typedBuffer,n=f.typedBufferStride,s=e.length;o*=n;for(let i=0;i<s;++i){const f=9*e[i];for(let e=0;e<9;++e)r[o+e]=t[f+e];o+=n}}function p(e,t,f,o){const r=f.typedBuffer,n=f.typedBufferStride,s=e.length;o*=n;for(let i=0;i<s;++i){const f=16*e[i];for(let e=0;e<16;++e)r[o+e]=t[f+e];o+=n}}function y(e,t,f,o,r,n=1){if(!f)return void d(e,t,o,r,n);const s=o.typedBuffer,i=o.typedBufferStride,c=e.length,l=f[0],u=f[1],a=f[2],p=f[4],y=f[5],B=f[6],g=f[8],h=f[9],b=f[10],O=f[12],S=f[13],m=f[14];if(r*=i,1===n)for(let d=0;d<c;++d){const f=3*e[d],o=t[f],n=t[f+1],c=t[f+2];s[r]=l*o+p*n+g*c+O,s[r+1]=u*o+y*n+h*c+S,s[r+2]=a*o+B*n+b*c+m,r+=i}else for(let d=0;d<c;++d){const f=3*e[d],o=t[f],c=t[f+1],z=t[f+2],I=l*o+p*c+g*z+O,A=u*o+y*c+h*z+S,L=a*o+B*c+b*z+m;for(let e=0;e<n;++e)s[r]=I,s[r+1]=A,s[r+2]=L,r+=i}}function B(e,f,o,r,n,s=1){if(!o)return void d(e,f,r,n,s);const i=o,c=r.typedBuffer,l=r.typedBufferStride,u=e.length,a=i[0],p=i[1],y=i[2],B=i[4],g=i[5],h=i[6],b=i[8],O=i[9],S=i[10],m=!t(i),z=1e-6,I=1-z;if(n*=l,1===s)for(let t=0;t<u;++t){const o=3*e[t],r=f[o],s=f[o+1],i=f[o+2];let d=a*r+B*s+b*i,u=p*r+g*s+O*i,A=y*r+h*s+S*i;if(m){const e=d*d+u*u+A*A;if(e<I&&e>z){const t=1/Math.sqrt(e);d*=t,u*=t,A*=t}}c[n+0]=d,c[n+1]=u,c[n+2]=A,n+=l}else for(let t=0;t<u;++t){const o=3*e[t],r=f[o],i=f[o+1],d=f[o+2];let u=a*r+B*i+b*d,A=p*r+g*i+O*d,L=y*r+h*i+S*d;if(m){const e=u*u+A*A+L*L;if(e<I&&e>z){const t=1/Math.sqrt(e);u*=t,A*=t,L*=t}}for(let e=0;e<s;++e)c[n+0]=u,c[n+1]=A,c[n+2]=L,n+=l}}function g(e,f,o,r,n,s=1){if(!o)return void u(e,f,r,n,s);const i=o,c=r.typedBuffer,l=r.typedBufferStride,d=e.length,a=i[0],p=i[1],y=i[2],B=i[4],g=i[5],h=i[6],b=i[8],O=i[9],S=i[10],m=!t(i),z=1e-6,I=1-z;if(n*=l,1===s)for(let t=0;t<d;++t){const o=4*e[t],r=f[o],s=f[o+1],i=f[o+2],d=f[o+3];let u=a*r+B*s+b*i,A=p*r+g*s+O*i,L=y*r+h*s+S*i;if(m){const e=u*u+A*A+L*L;if(e<I&&e>z){const t=1/Math.sqrt(e);u*=t,A*=t,L*=t}}c[n+0]=u,c[n+1]=A,c[n+2]=L,c[n+3]=d,n+=l}else for(let t=0;t<d;++t){const o=4*e[t],r=f[o],i=f[o+1],d=f[o+2],u=f[o+3];let A=a*r+B*i+b*d,L=p*r+g*i+O*d,j=y*r+h*i+S*d;if(m){const e=A*A+L*L+j*j;if(e<I&&e>z){const t=1/Math.sqrt(e);A*=t,L*=t,j*=t}}for(let e=0;e<s;++e)c[n+0]=A,c[n+1]=L,c[n+2]=j,c[n+3]=u,n+=l}}function h(e,t,f,o,r,n=1){const s=o.typedBuffer,i=o.typedBufferStride,c=e.length;if(r*=i,1===n){if(4===f)for(let l=0;l<c;++l){const f=4*e[l];s[r]=t[f],s[r+1]=t[f+1],s[r+2]=t[f+2],s[r+3]=t[f+3],r+=i}else if(3===f)for(let l=0;l<c;++l){const f=3*e[l];s[r]=t[f],s[r+1]=t[f+1],s[r+2]=t[f+2],s[r+3]=255,r+=i}}else if(4===f)for(let l=0;l<c;++l){const f=4*e[l];for(let e=0;e<n;++e)s[r]=t[f],s[r+1]=t[f+1],s[r+2]=t[f+2],s[r+3]=t[f+3],r+=i}else if(3===f)for(let l=0;l<c;++l){const f=3*e[l];for(let e=0;e<n;++e)s[r]=t[f],s[r+1]=t[f+1],s[r+2]=t[f+2],s[r+3]=255,r+=i}}function b(e,t,f,o){const r=t.typedBuffer,n=t.typedBufferStride;o*=n;for(let s=0;s<f;++s)r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2],r[o+3]=e[3],o+=n}function O(t,c,d,u,a,p){for(const O of c.fieldNames){const c=t.vertexAttributes.get(O),S=t.indices.get(O);if(c&&S)switch(O){case i.POSITION:{s(3===c.size);const e=a.getField(O,n);e&&y(S,c.data,d,e,p);break}case i.NORMAL:{s(3===c.size);const e=a.getField(O,n);e&&B(S,c.data,u,e,p);break}case i.UV0:{s(2===c.size);const e=a.getField(O,r);e&&l(S,c.data,e,p);break}case i.COLOR:{s(3===c.size||4===c.size);const e=a.getField(O,o);e&&h(S,c.data,c.size,e,p);break}case i.SYMBOLCOLOR:{s(3===c.size||4===c.size);const e=a.getField(O,o);e&&h(S,c.data,c.size,e,p);break}case i.TANGENT:{s(4===c.size);const e=a.getField(O,f);e&&g(S,c.data,u,e,p);break}}else if(O===i.OBJECTANDLAYERIDCOLOR&&e(t.objectAndLayerIdColor)&&4===t.objectAndLayerIdColor.length){if(t.indices.get(i.POSITION)){const e=t.indices.get(i.POSITION).length,f=a.getField(O,o);b(t.objectAndLayerIdColor,f,e,p)}}}}export{c as writeBufferFloat,a as writeBufferMat3f,p as writeBufferMat4f,l as writeBufferVec2,d as writeBufferVec3,u as writeBufferVec4,h as writeColor,O as writeDefaultAttributes,B as writeNormal,b as writeObjectAndLayerIdColor,y as writePosition,g as writeTangent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as s,disposeMaybe as o,isSome as n,isNone as a}from"../../../../core/maybe.js";import{watch as p,initial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{ComponentObjectCollection as u}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueRepository as _}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as f,AutoDisposableMixin as g}from"../lib/AutoDisposable.js";import{RenderRequestType as y,Decorations as R}from"../lib/basicInterfaces.js";import x from"../lib/CompositingHelper.js";import{textureToDepth as b}from"../lib/depthRangeUtils.js";import{GLMaterialRepository as v}from"../lib/GLMaterialRepository.js";import{MagnifierHelper as w}from"../lib/MagnifierHelper.js";import{Renderer as U}from"../lib/Renderer.js";import{RenderingContext as T}from"../lib/RenderingContext.js";import{TextureRepository as j}from"../lib/TextureRepository.js";import{StippleTextureRepository as C}from"../materials/StippleTextureRepository.js";import{WaterTextureRepository as A}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as M}from"./contextCache.js";import{removeLoadedShaderModules as q}from"./requireUtils.js";import{ScreenshotManager as D}from"./ScreenshotManager.js";import{contextCache as S}from"./testUtils.js";import{createContextOrErrorHTML as O}from"../../../webgl/context-util.js";let H=class extends(g(t)){constructor(e){super({}),this.events=new r,this.waterTextureRepository=new A,this._magnifierHelper=new w,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._container=e.container,this._viewingMode=e.viewingMode,this._initializeContext(e),p((()=>this.waterTextureRepository?.updating),(()=>this.requestRender()),d),this._magnifierHelper.events.on("request-render",(()=>this.requestRender())),this._stippleTextureRepository=new C(this._rctx),this._shaderTechniqueRepository=new _({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:this.waterTextureRepository}),this._textureRepository=new j(e,this._shaderTechniqueRepository,this._rctx),this._textureRepository.events.on("changed",(e=>this.requestRender(e))),this._materialRepository=new v(this._textureRepository,this._shaderTechniqueRepository,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new x(this._rctx,this._shaderTechniqueRepository),this._renderer=new U(this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,(e=>this.requestRender(e)),((t,r)=>e.schedule(t,r)),e),this._screenshotManager=new D(this._rctx,((e,t,r)=>this._renderer.render(e,t,t,r)),(e=>this.requestRender(e)),e.options.screenshot.renderOverlay,(e=>this.events.emit("force-camera-for-screenshot",e)),(()=>this._renderer.disposeOffscreenBuffers())),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}dispose(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=s(this._frameTask),this._shaderTechniqueRepository=o(this._shaderTechniqueRepository),super.dispose(),this._tmpDepthBuffer=null,this._rctx=null}get performanceInfo(){const e=this._rctx.gl;return{renderer:this._renderer.performanceInfo,textureMemory:void 0!==e.getUsedTextureMemory?e.getUsedTextureMemory():void 0,renderbufferMemory:void 0!==e.getUsedRenderbufferMemory?e.getUsedRenderbufferMemory():void 0,VBOMemory:void 0!==e.getUsedVBOMemory?e.getUsedVBOMemory():void 0}}requestRender(e=y.UPDATE){e===y.UPDATE?this._needsUpdate=!0:this._needsRender=!0}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this._renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}ensureEdgeView(){return this._renderer.ensureEdgeView()}get edgeView(){return this._renderer.edgeView}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}updateLightSources(e,t,r){this._renderer.updateLightSources(e,t,r),this.requestRender()}setRenderParameters(e){void 0!==e.idleSuspend&&this._idleSuspend!==!!e.idleSuspend&&(this._idleSuspend=!!e.idleSuspend,this.requestRender()),this._renderer.setRenderParameters(e)}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}modify(e){this._renderer.modify(e),e.clear()}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e)}getAlpha(){return this._rctx.contextAttributes.alpha}get shadowsEnabled(){return this._renderer.shadowsEnabled}readAccumulatedShadow(e){return this._renderer.readAccumulatedShadow(e[0],e[1])}readHUDVisibility(e,t,r,i,s){this._renderer.readHUDVisibility(e,t,r,i,s)}getMinimalDepthForArea(e,t,r,i,s,o=s){const a=i.constrainWindowSize(t,r,s*i.pixelRatio,o*i.pixelRatio),p=this._ensureDepthBuffer(a);this._renderer.readDepthPixels(i,a,p);let d=Number.MAX_VALUE;for(let n=0;n<a[2]*a[3];n++){const e=b(4*n,p,i.nearFar);d>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(d=e)}if(n(e)){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);n(s)&&d>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(d=s)}return d===Number.MAX_VALUE?void 0:d}_ensureDepthBuffer(e){const t=4*e[2]*e[3];return(a(this._tmpDepthBuffer)||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}get renderPlugins(){return this._renderer.renderPlugins}get test(){return{renderer:this._renderer}}get gpuMemoryUsage(){return this._renderer.gpuMemoryUsage}async reloadShaders(){q(),await this._shaderTechniqueRepository.reloadAll(),this.requestRender()}get animationTimestep(){return this._renderer.animationTimestep}_registerFrameTask(e){const t=e.state,r={viewCamera:t.camera,frameHasDecorations:!1};let i=!1,s=y.BACKGROUND,o=!1;const a={preRender:r=>{i=this.updating,s=this._needsUpdate?y.UPDATE:y.BACKGROUND,e.processSyncLayers();const o=c(r.time-this._lastAnimationUpdate);(o>this.animationTimestep||n(this.forcedAnimationTime)||i||this._needsRender)&&(this._renderer.updateAnimation({camera:t.camera,dt:o,forcedTime:this.forcedAnimationTime})&&this.requestRender(y.BACKGROUND),this._lastAnimationUpdate=r.time)},render:()=>{if((this._needsUpdate||this._needsRender||!this._idleSuspend||!this._renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this._renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this._renderer.render(null,t.camera,t.contentCamera,R.ON),o=!0,e&&this._renderer.hasWaterReflection&&(this.requestRender(y.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:()=>{r.viewCamera=t.camera,r.frameHasDecorations=this._renderer.hasSlicePlane||this._magnifierHelper.enabled,this._textureRepository.update(),this._screenshotManager.update(r)},finish:()=>{o&&(this._renderer.finish(s),o=!1)}};this._frameTask=h(a)}_initializeContext(e){const t=e.options;this._canvas=t.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:null==t.stencil||t.stencil,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},s=O("3d",this._canvas,r);if(a(s)){const e=has("esri-force-webgl");i.getLogger(this.declaredClass).error(e)}else this._rctx=this._newRenderingContext(s,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this.declaredClass).error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)}_newRenderingContext(e,t){const r={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8},i=(e,r)=>t.resourceController.memoryController.newCache(e,r);if(S.enabled){let t=B.get(e);return t?(t.configure(r),t.newCache=i,t.ref(),t):(t=new T(e,r,i),B.set(e,t),t.ref(),t)}return new T(e,r,i)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("standardDerivatives"),this._rctx.capabilities.enable("shaderTextureLOD"),this._rctx.capabilities.enable("textureFloat")}get componentObjectCollection(){return a(this._componentObjectCollection)&&(this._componentObjectCollection=new u(this._renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};e([l({type:Boolean,readOnly:!0})],H.prototype,"updating",null),e([f()],H.prototype,"_rctx",void 0),e([f()],H.prototype,"_container",void 0),e([f()],H.prototype,"_canvas",void 0),e([f()],H.prototype,"_stippleTextureRepository",void 0),e([f(),l()],H.prototype,"waterTextureRepository",void 0),e([f(),l()],H.prototype,"_magnifierHelper",void 0),e([f(),l()],H.prototype,"_textureRepository",void 0),e([f()],H.prototype,"_compositingHelper",void 0),e([f()],H.prototype,"_renderer",void 0),e([f()],H.prototype,"_screenshotManager",void 0),e([f()],H.prototype,"componentObjectCollection",null),e([f()],H.prototype,"_componentObjectCollection",void 0),e([l()],H.prototype,"_needsUpdate",void 0),e([l()],H.prototype,"_needsWaterReflectionUpdate",void 0),H=e([m("esri.views.3d.webgl-engine.parts.RenderView")],H);const B=M();export{H as RenderView};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as s,disposeMaybe as n,isSome as o,isNone as a}from"../../../../core/maybe.js";import{watch as d,initial as p}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{ComponentObjectCollection as u}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueRepository as _}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{AutoDisposableMixin as f,autoDispose as g}from"../lib/AutoDisposable.js";import{RenderRequestType as y,Decorations as R}from"../lib/basicInterfaces.js";import x from"../lib/CompositingHelper.js";import{textureToDepth as b}from"../lib/depthRangeUtils.js";import{GLMaterialRepository as v}from"../lib/GLMaterialRepository.js";import{MagnifierHelper as w}from"../lib/MagnifierHelper.js";import{ObjectAndLayerIdRenderHelper as j}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as U}from"../lib/Renderer.js";import{RenderingContext as A}from"../lib/RenderingContext.js";import{TextureRepository as C}from"../lib/TextureRepository.js";import{StippleTextureRepository as T}from"../materials/StippleTextureRepository.js";import{WaterTextureRepository as M}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as S}from"./contextCache.js";import{removeLoadedShaderModules as D}from"./requireUtils.js";import{ScreenshotManager as O}from"./ScreenshotManager.js";import{contextCache as q}from"./testUtils.js";import{createContextOrErrorHTML as H}from"../../../webgl/context-util.js";let L=class extends(f(t)){constructor(e){super({}),this.events=new r,this.waterTextureRepository=new M,this._magnifierHelper=new w,this._objectAndLayerIdRenderHelper=has("enable-feature:objectAndLayerId-rendering")?new j:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._container=e.container,this._viewingMode=e.viewingMode,this._initializeContext(e),d((()=>this.waterTextureRepository?.updating),(()=>this.requestRender()),p),this._magnifierHelper.events.on("request-render",(()=>this.requestRender())),this._stippleTextureRepository=new T(this._rctx),this._shaderTechniqueRepository=new _({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:this.waterTextureRepository}),this._textureRepository=new C(e,this._shaderTechniqueRepository,this._rctx),this._textureRepository.events.on("changed",(e=>this.requestRender(e))),this._materialRepository=new v(this._textureRepository,this._shaderTechniqueRepository,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new x(this._rctx,this._shaderTechniqueRepository),this._renderer=new U(this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,(e=>this.requestRender(e)),((t,r)=>e.schedule(t,r)),e),this._screenshotManager=new O(this._rctx,((e,t,r,i)=>this._renderer.render(e,t,r,r,i)),(e=>this.requestRender(e)),e.options.screenshot.renderOverlay,(e=>this.events.emit("force-camera-for-screenshot",e)),(()=>this._renderer.disposeOffscreenBuffers())),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}dispose(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=s(this._frameTask),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),super.dispose(),this._tmpDepthBuffer=null,this._rctx=null}get performanceInfo(){const e=this._rctx.gl;return{renderer:this._renderer.performanceInfo,textureMemory:void 0!==e.getUsedTextureMemory?e.getUsedTextureMemory():void 0,renderbufferMemory:void 0!==e.getUsedRenderbufferMemory?e.getUsedRenderbufferMemory():void 0,VBOMemory:void 0!==e.getUsedVBOMemory?e.getUsedVBOMemory():void 0}}requestRender(e=y.UPDATE){e===y.UPDATE?this._needsUpdate=!0:this._needsRender=!0}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this._renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}ensureEdgeView(){return this._renderer.ensureEdgeView()}get edgeView(){return this._renderer.edgeView}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}updateLightSources(e,t,r){this._renderer.updateLightSources(e,t,r),this.requestRender()}setRenderParameters(e){void 0!==e.idleSuspend&&this._idleSuspend!==!!e.idleSuspend&&(this._idleSuspend=!!e.idleSuspend,this.requestRender()),this._renderer.setRenderParameters(e)}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}modify(e){this._renderer.modify(e),e.clear()}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e).then((e=>e[0]))}takeScreenshotWithOID(e){return e.objectAndLayerIdColor=!0,this._screenshotManager.takeScreenshot(e)}getAlpha(){return this._rctx.contextAttributes.alpha}get shadowsEnabled(){return this._renderer.shadowsEnabled}readAccumulatedShadow(e){return this._renderer.readAccumulatedShadow(e[0],e[1])}readHUDVisibility(e,t,r,i,s){this._renderer.readHUDVisibility(e,t,r,i,s)}getMinimalDepthForArea(e,t,r,i,s,n=s){const a=i.constrainWindowSize(t,r,s*i.pixelRatio,n*i.pixelRatio),d=this._ensureDepthBuffer(a);this._renderer.readDepthPixels(i,a,d);let p=Number.MAX_VALUE;for(let o=0;o<a[2]*a[3];o++){const e=b(4*o,d,i.nearFar);p>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(p=e)}if(o(e)){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);o(s)&&p>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(p=s)}return p===Number.MAX_VALUE?void 0:p}_ensureDepthBuffer(e){const t=4*e[2]*e[3];return(a(this._tmpDepthBuffer)||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}get renderPlugins(){return this._renderer.renderPlugins}get test(){return{renderer:this._renderer}}get gpuMemoryUsage(){return this._renderer.gpuMemoryUsage}async reloadShaders(){D(),await this._shaderTechniqueRepository.reloadAll(),this.requestRender()}get animationTimestep(){return this._renderer.animationTimestep}_registerFrameTask(e){const t=e.state,r={viewCamera:t.camera,frameHasDecorations:!1};let i=!1,s=y.BACKGROUND,n=!1;const a={preRender:r=>{i=this.updating,s=this._needsUpdate?y.UPDATE:y.BACKGROUND,e.processSyncLayers();const n=c(r.time-this._lastAnimationUpdate);(n>this.animationTimestep||o(this.forcedAnimationTime)||i||this._needsRender)&&(this._renderer.updateAnimation({camera:t.camera,dt:n,forcedTime:this.forcedAnimationTime})&&this.requestRender(y.BACKGROUND),this._lastAnimationUpdate=r.time)},render:()=>{if((this._needsUpdate||this._needsRender||!this._idleSuspend||!this._renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this._renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this._renderer.render(null,null,t.camera,t.contentCamera,R.ON),n=!0,e&&this._renderer.hasWaterReflection&&(this.requestRender(y.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:()=>{r.viewCamera=t.camera,r.frameHasDecorations=this._renderer.hasSlicePlane||this._magnifierHelper.enabled,this._textureRepository.update(),this._screenshotManager.update(r)},finish:()=>{n&&(this._renderer.finish(s),n=!1)}};this._frameTask=h(a)}_initializeContext(e){const t=e.options;this._canvas=t.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:null==t.stencil||t.stencil,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},s=H("3d",this._canvas,r);if(a(s)){const e=has("esri-force-webgl");i.getLogger(this.declaredClass).error(e)}else this._rctx=this._newRenderingContext(s,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this.declaredClass).error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)}_newRenderingContext(e,t){const r={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8},i=(e,r)=>t.resourceController.memoryController.newCache(e,r);if(q.enabled){let t=B.get(e);return t?(t.configure(r),t.newCache=i,t.ref(),t):(t=new A(e,r,i),B.set(e,t),t.ref(),t)}return new A(e,r,i)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("standardDerivatives"),this._rctx.capabilities.enable("shaderTextureLOD"),this._rctx.capabilities.enable("textureFloat")}_getObjectAndLayerIdColor(e){return this._objectAndLayerIdRenderHelper?this._objectAndLayerIdRenderHelper.getObjectAndLayerIdColor(e):null}get componentObjectCollection(){return a(this._componentObjectCollection)&&(this._componentObjectCollection=new u(this._renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};e([l({type:Boolean,readOnly:!0})],L.prototype,"updating",null),e([g()],L.prototype,"_rctx",void 0),e([g()],L.prototype,"_container",void 0),e([g()],L.prototype,"_canvas",void 0),e([g()],L.prototype,"_stippleTextureRepository",void 0),e([g(),l()],L.prototype,"waterTextureRepository",void 0),e([g(),l()],L.prototype,"_magnifierHelper",void 0),e([l()],L.prototype,"_objectAndLayerIdRenderHelper",void 0),e([g(),l()],L.prototype,"_textureRepository",void 0),e([g()],L.prototype,"_compositingHelper",void 0),e([g()],L.prototype,"_renderer",void 0),e([g()],L.prototype,"_screenshotManager",void 0),e([g()],L.prototype,"componentObjectCollection",null),e([g()],L.prototype,"_componentObjectCollection",void 0),e([l()],L.prototype,"_needsUpdate",void 0),e([l()],L.prototype,"_needsWaterReflectionUpdate",void 0),L=e([m("esri.views.3d.webgl-engine.parts.RenderView")],L);const B=S();export{L as RenderView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as e,disposeMaybe as t}from"../../../../core/maybe.js";import{createResolver as r}from"../../../../core/promiseUtils.js";import{d as s}from"../../../../chunks/vec4f64.js";import{AutoDisposable as i}from"../lib/AutoDisposable.js";import{RenderRequestType as o,Decorations as n}from"../lib/basicInterfaces.js";import{createEmptyImageData as a,resampleHermite as h}from"../../../support/screenshotUtils.js";import{PixelFormat as c,DataType as l,TargetType as d,DepthStencilTargetType as f}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";class
|
|
5
|
+
import{isNone as e,disposeMaybe as t}from"../../../../core/maybe.js";import{createResolver as r}from"../../../../core/promiseUtils.js";import{d as s}from"../../../../chunks/vec4f64.js";import{AutoDisposable as i}from"../lib/AutoDisposable.js";import{RenderRequestType as o,Decorations as n}from"../lib/basicInterfaces.js";import{createEmptyImageData as a,resampleHermite as h}from"../../../support/screenshotUtils.js";import{PixelFormat as c,DataType as l,TargetType as d,DepthStencilTargetType as f}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";class _ extends i{constructor(e,t,r,s,i,o){super(),this._rctx=e,this._renderScene=t,this._requestRenderScene=r,this._renderOverlay=s,this._forceCameraHook=i,this._disposeOffscreenBuffers=o,this.supersample=!0,this._screenshotQueue=new Array}dispose(){this._rctx=null}takeScreenshot(e){this._requestRenderScene(o.BACKGROUND);const t=r();return this._screenshotQueue.push({settings:e,resolver:t}),t.promise}update(e){for(const t of this._screenshotQueue){if(this.isDisposed){t.resolver.reject();continue}const r={...t.settings,pixelRatio:t.settings.pixelRatio*e.viewCamera.pixelRatio},s=this._renderScreenshot(e,r);t.resolver(s)}this._screenshotQueue.length=0}_renderScreenshotOverlay(t,r,s){if(e(this._renderOverlay))return r;t.width=r.width,t.height=r.height;const i=t.getContext("2d"),o=s.pixelRatio;return i.save(),i.translate(0,r.height),i.scale(1,-1),s.region&&i.translate(-s.region.x,-s.region.y),i.scale(o,o),r=this._renderOverlay(t,r),i.restore(),r}_readbackScreenshot(e,t){return e.resample?this._readbackScreenshotResampled(e,t):this._readbackScreenshotImmediate(e,t)}_readbackScreenshotResampled(e,t){const{framebufferWidth:r,framebufferHeight:s,region:i,resample:o}=e,n=this._ensureScreenshotEncodeCanvas();let d=a(r,s,n);this._rctx.gl.readPixels(0,0,r,s,c.RGBA,l.UNSIGNED_BYTE,new Uint8Array(d.data.buffer)),t(),d=this._renderScreenshotOverlay(n,d,{...e,region:null});const f=a(i.width,i.height,n);return h(d,f,!0,o.region.x,s-(o.region.y+o.region.height),o.region.width,o.region.height)}_readbackScreenshotImmediate(e,t){const{framebufferHeight:r,region:s}=e,i=this._ensureScreenshotEncodeCanvas(),o=a(s.width,s.height,i);return this._rctx.gl.readPixels(s.x,r-(s.y+s.height),s.width,s.height,c.RGBA,l.UNSIGNED_BYTE,new Uint8Array(o.data.buffer)),t(),this._renderScreenshotOverlay(i,o,e)}_renderScreenshot(e,r){let i=null,o=null;const a=e.viewCamera,{framebufferWidth:h,framebufferHeight:c}=r;let l=!1;const _=r.disableDecorations&&e.frameHasDecorations,g=h!==a.fullWidth||c!==a.fullHeight,m=r.ignorePadding&&a.pixelRatio!==r.pixelRatio,p=g||_||m||r.objectAndLayerIdColor;if(r.objectAndLayerIdColor&&(o=new u(this._rctx,{width:h,height:c,colorTarget:d.TEXTURE,depthStencilTarget:f.DEPTH_STENCIL_RENDER_BUFFER})),p){const e=a.clone();if(r.ignorePadding){const t=s(e.padding);for(let s=0;s<4;s++)t[s]=Math.round(t[s]/e.pixelRatio*r.pixelRatio);e.padding=t}e.fullWidth=h,e.fullHeight=c,e.pixelRatio=r.pixelRatio;const t=a.fovX-e.fovX,_=a.fovY-e.fovY;t<0&&t<_?e.fovX=a.fovX:_<0&&_<t&&(e.fovY=a.fovY),this._forceCameraHook(e),l=!0,i=new u(this._rctx,{width:e.fullWidth,height:e.fullHeight,colorTarget:d.TEXTURE,depthStencilTarget:f.DEPTH_STENCIL_RENDER_BUFFER}),this._renderScene(i,o,e,r.disableDecorations?n.OFF:n.ON),this._disposeOffscreenBuffers()}const b=()=>{this._rctx.bindFramebuffer(null),t(i)},x=this._readbackScreenshot(r,b);b();let v=null;if(r.objectAndLayerIdColor){const e=()=>{this._rctx.bindFramebuffer(null),t(o)};this._rctx.bindFramebuffer(o),v=this._readbackScreenshot(r,e),this._rctx.bindFramebuffer(null),e()}if(p&&!this._rctx.contextAttributes.alpha)for(let t=3;t<x.data.length;t+=4)x.data[t]=255;if(v&&!this._rctx.contextAttributes.alpha)for(let t=3;t<v.data.length;t+=4)v.data[t]=255;return l&&this._forceCameraHook(a),[x,v]}_ensureScreenshotEncodeCanvas(){return this._screenshotEncodeCanvas||(this._screenshotEncodeCanvas=document.createElement("canvas")),this._screenshotEncodeCanvas}}export{_ as ScreenshotManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{c as e}from"../../../../chunks/mat3f64.js";import{f as t,c as i}from"../../../../chunks/vec3f64.js";import{f as s}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{doublePrecisionRequiresObfuscation as c}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as u}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as
|
|
5
|
+
import{c as e}from"../../../../chunks/mat3f64.js";import{f as t,c as i}from"../../../../chunks/vec3f64.js";import{f as s}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{doublePrecisionRequiresObfuscation as c}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as u}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as d,DepthTestFunction as m,AlphaDiscardMode as f}from"../lib/basicInterfaces.js";import{Default3D as b}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as v}from"../lib/Material.js";import{blendingDefault as S,oitBlending as g,oitDepthTest as y,getOITPolygonOffset as j}from"../lib/OrderIndependentTransparency.js";import{Program as x}from"../lib/Program.js";import{stencilWriteMaskOn as P,stencilToolMaskBaseParams as T,stencilBaseAllZerosParams as O}from"../lib/StencilUtils.js";import{TransparencyPassType as C}from"../lib/TransparencyPassType.js";import{D as M}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as z}from"../../../webgl/enums.js";import{makePipelineState as D,cullingParams as L,defaultDepthWriteParams as A,defaultColorWriteParams as w}from"../../../webgl/renderState.js";class F extends l{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=t(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=d.Back,this.emissiveFactor=t(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.externalColor=s(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=i(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=e(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=m.Less,this.textureAlphaMode=f.Blend,this.textureAlphaCutoff=h,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=v.Occlude}}class k extends n{constructor(){super(...arguments),this.origin=i(),this.slicePlaneLocalOrigin=this.origin}}class _ extends p{initializeConfiguration(e,t){t.spherical=e.viewingMode===r.Global,t.doublePrecisionRequiresObfuscation=c(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetalnessAndRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?a.Default:a.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,_.shader)}_initializeProgram(e,t){return new x(e.rctx,t.get().build(this.configuration),b)}_convertDepthTestFunction(e){return e===m.Lequal?z.LEQUAL:z.LESS}_makePipeline(e,t){const i=this.configuration,s=e===C.NONE,r=e===C.FrontFace;return D({blending:i.output!==o.Color&&i.output!==o.Alpha||!i.transparent?null:s?S:g(e),culling:E(i)&&L(i.cullFace),depthTest:{func:y(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:s||r?i.writeDepth&&A:null,colorWrite:w,stencilWrite:i.hasOccludees?P:null,stencilTest:i.hasOccludees?t?T:O:null,polygonOffset:s||r?null:j(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function E(e){return e.cullFace!==d.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}_.shader=new u(M,(()=>import("./DefaultMaterial.glsl.js")));export{k as DefaultMaterialDrawParameters,F as DefaultMaterialPassParameters,_ as DefaultMaterialTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as s}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as s}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as p,CullFaceOptions as n,DepthTestFunction as h}from"../lib/basicInterfaces.js";import{TransparencyPassType as d}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class c extends l{constructor(){super(...arguments),this.output=t.Color,this.alphaDiscardMode=p.Opaque,this.doubleSidedMode=r.None,this.pbrMode=i.Disabled,this.cullFace=n.None,this.transparencyPassType=d.NONE,this.normalType=e.Attribute,this.textureCoordinateType=s.None,this.customDepthTest=h.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1}}o([a({count:t.COUNT})],c.prototype,"output",void 0),o([a({count:p.COUNT})],c.prototype,"alphaDiscardMode",void 0),o([a({count:r.COUNT})],c.prototype,"doubleSidedMode",void 0),o([a({count:i.COUNT})],c.prototype,"pbrMode",void 0),o([a({count:n.COUNT})],c.prototype,"cullFace",void 0),o([a({count:d.COUNT})],c.prototype,"transparencyPassType",void 0),o([a({count:e.COUNT})],c.prototype,"normalType",void 0),o([a({count:s.COUNT})],c.prototype,"textureCoordinateType",void 0),o([a({count:h.COUNT})],c.prototype,"customDepthTest",void 0),o([a()],c.prototype,"spherical",void 0),o([a()],c.prototype,"hasVertexColors",void 0),o([a()],c.prototype,"hasSymbolColors",void 0),o([a()],c.prototype,"hasVerticalOffset",void 0),o([a()],c.prototype,"hasSlicePlane",void 0),o([a()],c.prototype,"hasSliceHighlight",void 0),o([a()],c.prototype,"hasColorTexture",void 0),o([a()],c.prototype,"hasMetalnessAndRoughnessTexture",void 0),o([a()],c.prototype,"hasEmissionTexture",void 0),o([a()],c.prototype,"hasOcclusionTexture",void 0),o([a()],c.prototype,"hasNormalTexture",void 0),o([a()],c.prototype,"hasScreenSizePerspective",void 0),o([a()],c.prototype,"hasVertexTangents",void 0),o([a()],c.prototype,"hasOccludees",void 0),o([a()],c.prototype,"hasMultipassTerrain",void 0),o([a()],c.prototype,"hasModelTransformation",void 0),o([a()],c.prototype,"offsetBackfaces",void 0),o([a()],c.prototype,"vvSize",void 0),o([a()],c.prototype,"vvColor",void 0),o([a()],c.prototype,"receiveShadows",void 0),o([a()],c.prototype,"receiveAmbientOcclusion",void 0),o([a()],c.prototype,"textureAlphaPremultiplied",void 0),o([a()],c.prototype,"instanced",void 0),o([a()],c.prototype,"instancedColor",void 0),o([a()],c.prototype,"objectAndLayerIdColorInstanced",void 0),o([a()],c.prototype,"instancedDoublePrecision",void 0),o([a()],c.prototype,"doublePrecisionRequiresObfuscation",void 0),o([a()],c.prototype,"writeDepth",void 0),o([a()],c.prototype,"transparent",void 0),o([a()],c.prototype,"enableOffset",void 0),o([a()],c.prototype,"cullAboveGround",void 0),o([a()],c.prototype,"snowCover",void 0),o([a({constValue:!0})],c.prototype,"hasVvInstancing",void 0),o([a({constValue:!1})],c.prototype,"useCustomDTRExponentForWater",void 0),o([a({constValue:!1})],c.prototype,"supportsTextureAtlas",void 0),o([a({constValue:!0})],c.prototype,"useFillLights",void 0);export{c as DefaultMaterialTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as r,parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class e extends r{constructor(){super(...arguments),this.contrastControlEnabled=!1}}o([t()],e.prototype,"contrastControlEnabled",void 0);export{e as LaserlinePathTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/maybe.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4PassUniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";import"./RibbonLineTechniqueConfiguration.js";export{N as NUM_ROUND_JOIN_SUBDIVISIONS,b as build}from"../../../../chunks/RibbonLine.glsl.js";
|
|
5
|
+
import"../../../../core/maybe.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4PassUniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";import"./RibbonLineTechniqueConfiguration.js";export{N as NUM_ROUND_JOIN_SUBDIVISIONS,b as build}from"../../../../chunks/RibbonLine.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{blendingDefault as r,oitBlending as n,oitDepthTest as s,oitDepthWrite as o,OITPolygonOffset as l}from"../lib/OrderIndependentTransparency.js";import{Program as c}from"../lib/Program.js";import{RenderSlot as a}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as p,stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as h,depthCompareAlways as d,stencilToolTransparentOccluderParams as T,stencilWriteMaskOff as f,stencilToolMaskOccluderParams as m,depthCompareLess as
|
|
5
|
+
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{blendingDefault as r,oitBlending as n,oitDepthTest as s,oitDepthWrite as o,OITPolygonOffset as l}from"../lib/OrderIndependentTransparency.js";import{Program as c}from"../lib/Program.js";import{RenderSlot as a}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as p,stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as h,depthCompareAlways as d,stencilToolTransparentOccluderParams as T,stencilWriteMaskOff as f,stencilToolMaskOccluderParams as m,depthCompareLess as O}from"../lib/StencilUtils.js";import{TransparencyPassType as g}from"../lib/TransparencyPassType.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as S}from"../../../webgl/enums.js";import{makePipelineState as A,defaultDepthWriteParams as E,defaultColorWriteParams as b}from"../../../webgl/renderState.js";const I=new Map([[P.POSITION,0],[P.SUBDIVISIONFACTOR,1],[P.UV0,2],[P.AUXPOS1,3],[P.AUXPOS2,4],[P.COLOR,5],[P.COLORFEATUREATTRIBUTE,5],[P.SIZE,6],[P.SIZEFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OBJECTANDLAYERIDCOLOR,8]]);class y extends i{initializeProgram(e){return new c(e.rctx,y.shader.get().build(this.configuration),I)}_makePipelineState(t,i){const c=this.configuration,a=t===g.NONE,d=t===g.FrontFace;return A({blending:c.output===e.Color||c.output===e.Alpha?a?r:n(t):null,depthTest:{func:s(t)},depthWrite:a?c.writeDepth&&E:o(t),colorWrite:b,stencilWrite:c.hasOccludees?p:null,stencilTest:c.hasOccludees?i?u:h:null,polygonOffset:a||d?c.hasPolygonOffset&&_:l})}initializePipeline(){const e=this.configuration;if(e.occluder){const t=e.hasPolygonOffset&&_;this._occluderPipelineTransparent=A({blending:r,polygonOffset:t,depthTest:d,depthWrite:null,colorWrite:b,stencilWrite:null,stencilTest:T}),this._occluderPipelineOpaque=A({blending:r,polygonOffset:t,depthTest:d,depthWrite:null,colorWrite:b,stencilWrite:f,stencilTest:m}),this._occluderPipelineMaskWrite=A({blending:null,polygonOffset:t,depthTest:O,depthWrite:null,colorWrite:null,stencilWrite:p,stencilTest:u})}return this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0),this._makePipelineState(this.configuration.transparencyPassType,!1)}get primitiveType(){return this.configuration.wireframe?S.LINES:S.TRIANGLE_STRIP}getPipelineState(e,t){return t?this._occludeePipelineState:this.configuration.occluder?e===a.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent:e===a.OCCLUDER_MATERIAL?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipelineState(e,t)}}y.shader=new t(R,(()=>import("./RibbonLine.glsl.js")));const _={factor:0,units:-4};export{y as RibbonLineTechnique,I as vertexAttributeLocations};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as i}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as p}from"../materials/DefaultTechniqueConfiguration.js";var r;!function(o){o[o.BUTT=0]="BUTT",o[o.SQUARE=1]="SQUARE",o[o.ROUND=2]="ROUND",o[o.COUNT=3]="COUNT"}(r||(r={}));class s extends p{constructor(){super(...arguments),this.output=t.Color,this.capType=r.BUTT,this.transparencyPassType=i.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.wireframe=!1}}o([e({count:t.COUNT})],s.prototype,"output",void 0),o([e({count:r.COUNT})],s.prototype,"capType",void 0),o([e({count:i.COUNT})],s.prototype,"transparencyPassType",void 0),o([e()],s.prototype,"occluder",void 0),o([e()],s.prototype,"hasSlicePlane",void 0),o([e()],s.prototype,"hasPolygonOffset",void 0),o([e()],s.prototype,"writeDepth",void 0),o([e()],s.prototype,"draped",void 0),o([e()],s.prototype,"stippleEnabled",void 0),o([e()],s.prototype,"stippleOffColorEnabled",void 0),o([e()],s.prototype,"stippleScaleWithLineWidth",void 0),o([e()],s.prototype,"stipplePreferContinuous",void 0),o([e()],s.prototype,"roundJoins",void 0),o([e()],s.prototype,"vvSize",void 0),o([e()],s.prototype,"vvColor",void 0),o([e()],s.prototype,"vvOpacity",void 0),o([e()],s.prototype,"falloffEnabled",void 0),o([e()],s.prototype,"innerColorEnabled",void 0),o([e()],s.prototype,"hasOccludees",void 0),o([e()],s.prototype,"hasMultipassTerrain",void 0),o([e()],s.prototype,"cullAboveGround",void 0),o([e()],s.prototype,"wireframe",void 0),o([e({constValue:!0})],s.prototype,"stippleRequiresClamp",void 0),o([e({constValue:!0})],s.prototype,"stippleRequiresStretchMeasure",void 0),o([e({constValue:!0})],s.prototype,"hasVvInstancing",void 0),o([e({constValue:!0})],s.prototype,"hasSliceTranslatedView",void 0);export{r as CapType,s as RibbonLineTechniqueConfiguration};
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as i}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as p}from"../materials/DefaultTechniqueConfiguration.js";var r;!function(o){o[o.BUTT=0]="BUTT",o[o.SQUARE=1]="SQUARE",o[o.ROUND=2]="ROUND",o[o.COUNT=3]="COUNT"}(r||(r={}));class s extends p{constructor(){super(...arguments),this.output=t.Color,this.capType=r.BUTT,this.transparencyPassType=i.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.wireframe=!1,this.objectAndLayerIdColorInstanced=!1}}o([e({count:t.COUNT})],s.prototype,"output",void 0),o([e({count:r.COUNT})],s.prototype,"capType",void 0),o([e({count:i.COUNT})],s.prototype,"transparencyPassType",void 0),o([e()],s.prototype,"occluder",void 0),o([e()],s.prototype,"hasSlicePlane",void 0),o([e()],s.prototype,"hasPolygonOffset",void 0),o([e()],s.prototype,"writeDepth",void 0),o([e()],s.prototype,"draped",void 0),o([e()],s.prototype,"stippleEnabled",void 0),o([e()],s.prototype,"stippleOffColorEnabled",void 0),o([e()],s.prototype,"stippleScaleWithLineWidth",void 0),o([e()],s.prototype,"stipplePreferContinuous",void 0),o([e()],s.prototype,"roundJoins",void 0),o([e()],s.prototype,"vvSize",void 0),o([e()],s.prototype,"vvColor",void 0),o([e()],s.prototype,"vvOpacity",void 0),o([e()],s.prototype,"falloffEnabled",void 0),o([e()],s.prototype,"innerColorEnabled",void 0),o([e()],s.prototype,"hasOccludees",void 0),o([e()],s.prototype,"hasMultipassTerrain",void 0),o([e()],s.prototype,"cullAboveGround",void 0),o([e()],s.prototype,"wireframe",void 0),o([e({constValue:!0})],s.prototype,"stippleRequiresClamp",void 0),o([e({constValue:!0})],s.prototype,"stippleRequiresStretchMeasure",void 0),o([e({constValue:!0})],s.prototype,"hasVvInstancing",void 0),o([e({constValue:!0})],s.prototype,"hasSliceTranslatedView",void 0),o([e()],s.prototype,"objectAndLayerIdColorInstanced",void 0);export{r as CapType,s as RibbonLineTechniqueConfiguration};
|
package/views/DOMContainer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{byId as t,reparent as s,empty as i}from"../core/domUtils.js";import{destroyMaybe as o,removeMaybe as r}from"../core/maybe.js";import{watch as n,initial as h}from"../core/reactiveUtils.js";import{addFrameTask as a}from"../core/scheduling.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import l from"./overlay/ViewOverlay.js";import p from"../widgets/Popup.js";const c=[0,0];function m(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return c[0]=s.left+(t?.pageXOffset??0),c[1]=s.top+(t?.pageYOffset??0),c}function f(e){e&&(i(e),e.parentNode&&e.parentNode.removeChild(e))}function y(e){const t=document.createElement("div");return e.appendChild(t),t}const v=16,_=750,g=512,w=2,C=i=>{let c=class extends i{constructor(...e){super(...e),this._freqInfo={freq:v,time:_},this._overlayRenderTaskHandle=null,this.height=0,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,0!==e.length&&void 0!==e[0]?.popup||(this.popup=new p({view:this})),this.handles.add([n((()=>this.cursor),(e=>{const{surface:t}=this;t&&t.setAttribute("data-cursor",e)})),n((()=>this.interacting),(e=>{const{surface:t}=this;t&&t.setAttribute("data-interacting",e.toString())}))])}initialize(){this.handles.add(n((()=>this.ui),((e,t)=>this._handleUIChange(e,t)))),this._wireUI(this.ui),this.handles.add([this.on("focus",(()=>this.notifyChange("focused"))),this.on("blur",(()=>this.notifyChange("focused")))])}destroy(){this.destroyed||(this.ui=o(this.ui),this.popup&&!this.popup.destroyed&&this.popup.destroy(),this.container=null)}set container(e){const t=this._get("container");if(t===e)return;const i="dom-size";if(this.handles.remove(i),this._stopMeasuring(),t&&(t.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(f(this.root),this._set("root",null)),this.userContent&&(s(this.userContent,t),f(this.userContent),this._set("userContent",null))),e){e.classList.add("esri-view");const t=document.createElement("div");t.className="esri-view-user-storage",s(e,t),e.appendChild(t),this._set("userContent",t);const o=document.createElement("div");o.className="esri-view-root",e.insertBefore(o,e.firstChild),this._set("root",o);const d=document.createElement("div");d.className="esri-view-surface",d.setAttribute("role","application"),d.tabIndex=0,o.appendChild(d),this._set("surface",d);const u=new l;o.appendChild(u.surface),this._set("overlay",u),n((()=>u.needsRender),(e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=a({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=r(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this.handles.add(n((()=>this.size),(e=>{const[t,s]=e,i="esri-view-surface--inset-outline";t>=document.body.clientWidth||s>=document.body.clientHeight?d.classList.add(i):d.classList.remove(i)}),h),i),this._set("container",e),this._startMeasuring()}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}set popup(e){const t=this._get("popup");t&&t!==e&&t.destroy(),this._set("popup",e)}get size(){return[this.width,this.height]}blur(){this.surface&&this.surface.blur()}focus(){this.surface&&this.surface.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i?i[0]:0,t-=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i?i[0]:0,t+=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}_handleUIChange(e,t){t&&(this.handles.remove("ui"),t.destroy()),e&&this._wireUI(e),this._set("ui",e)}_wireUI(e){this.handles.remove("ui"),e&&(e.view=this,this.handles.add([n((()=>this.root),(t=>{e.container=t?y(t):null}),h),n((()=>this.popup),((t,s)=>{const i="popup",o="manual";s&&e.remove(s,i),t&&(t.view=e.view,e.add(t,{key:i,position:o}))}),h)],"ui"))}_stopMeasuring(){this.handles.remove("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=v,e.time=_,this.handles.add([(()=>{const t=()=>{e.freq=v,e.time=_};return window.addEventListener("resize",t),{remove(){window.removeEventListener("resize",t)}}})(),a({prepare:e=>{const t=this._measure(),s=this._freqInfo;if(s.time+=e.deltaTime,t&&(s.freq=v,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const i=this._position();s.freq=i||t?v:Math.min(_,s.freq*w),!t&&s.freq>=g&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set("suspended",!0),!1;const i=this.width,o=this.height;return t===i&&s===o?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",t),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:i,oldHeight:o,width:t,height:s}),!0)}_position(){const e=this.container,t=this.position,s=e&&m(e);return!!s&&((!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set("position",[s[0],s[1]]),!0))}forceDOMReadyCycle(){}};return e([d({value:null,cast:e=>t(e)})],c.prototype,"container",null),e([d({readOnly:!0})],c.prototype,"focused",null),e([d({readOnly:!0})],c.prototype,"height",void 0),e([d({type:p})],c.prototype,"popup",null),e([d({type:l})],c.prototype,"overlay",void 0),e([d({readOnly:!0})],c.prototype,"position",void 0),e([d({readOnly:!0})],c.prototype,"resizing",void 0),e([d({readOnly:!0})],c.prototype,"root",void 0),e([d({value:null,readOnly:!0})],c.prototype,"size",null),e([d({readOnly:!0})],c.prototype,"surface",void 0),e([d({readOnly:!0})],c.prototype,"suspended",void 0),e([d()],c.prototype,"ui",void 0),e([d({readOnly:!0})],c.prototype,"userContent",void 0),e([d({readOnly:!0})],c.prototype,"width",void 0),e([d()],c.prototype,"widthBreakpoint",void 0),c=e([u("esri.views.DOMContainer")],c),c};function z(e){return e&&"focus"in e}export{C as DOMContainer,z as isDOMContainer};
|
package/views/MapView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import i from"../Viewpoint.js";import s from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import n from"../core/Error.js";import has from"../core/has.js";import{isIterable as a}from"../core/iteratorUtils.js";import o from"../core/Logger.js";import{isSome as l,unwrap as h,isNone as p}from"../core/maybe.js";import{throwIfAborted as c}from"../core/promiseUtils.js";import{watch as d,whenOnce as u,sync as m,syncAndInitial as g}from"../core/reactiveUtils.js";import{createScreenPoint as f}from"../core/screenUtils.js";import y from"../core/Warning.js";import{initialize as w}from"../core/workers/workers.js";import{property as _}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import V from"../geometry/Extent.js";import S from"../geometry/Point.js";import{isLoaded as j,load as T,canProjectWithoutEngine as R,project as b}from"../geometry/projection.js";import{equals as x}from"../geometry/support/spatialReferenceUtils.js";import M from"../layers/support/TileInfo.js";import{BreakpointsOwner as O}from"./BreakpointsOwner.js";import{DOMContainer as k}from"./DOMContainer.js";import{PopupView as L}from"./PopupView.js";import C from"./View.js";import z from"./ViewAnimation.js";import P from"./2d/AnimationManager.js";import E from"./2d/FrameTask.js";import{layerView2DImporter as G}from"./2d/layerViewModuleImportUtils.js";import N from"./2d/MapViewConstraints.js";import q from"./2d/PaddedViewState.js";import"./2d/tiling/PagedTileQueue.js";import D from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{centerAt as A,setExtent as F,rotateTo as U,scaleTo as I,copy as W,create as B,extentToScale as H,resize as $,angleBetween as J}from"./2d/viewpointUtils.js";import Q from"./2d/input/MapViewInputManager.js";import Z from"./2d/layers/features/support/TileStore.js";import K from"./2d/support/HighlightOptions.js";import{Timeline as Y}from"./2d/support/Timeline.js";import X from"./support/createScreenshotPlan.js";import{encode as ee,encodeData as te,getMaximumResolutionScale as ie,getFormatAndQuality as se}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as re,createScreenPointFromSupportedEvent as ne}from"./support/screenUtils.js";import{check as ae}from"./support/WebGLRequirements.js";import oe from"./ui/2d/DefaultUI2D.js";import le from"../webmap/background/ColorBackground.js";let he,pe,ce,de,ue,me;async function ge(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s,MagnifierView2D:r,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);pe=e,ce=t,de=i,ue=s,me=r,he=n}const fe=160;function ye(e){return e&&"esri.Viewpoint"===e.declaredClass}let we=class extends(O(k(L(C)))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!1,this.supportsGround=!1,this._stationaryTimer=null,this.frameTask=new E(this),this._pePromise=null,this.floors=new s,this.highlightOptions=new K,this.inputManager=new Q({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!1,this.timeline=new Y,this.type="2d",this.ui=new oe,this._pixelFormat={flipY:!0,premultipliedAlpha:!0},this.constraints=new N,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([d((()=>this.viewpoint),(()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(fe)}),m),this.on("resize",(e=>this._resizeHandler(e))),d((()=>this.animationManager?.animation),(e=>{this.animation=e}))]),w()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new Z(this.featuresTilingScheme)}get initialExtentRequired(){const{scale:e,constraints:t,center:i,viewpoint:s,extent:r}=this;let n=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!r&&(t?.effectiveLODs||(n=-1),(!i||0===e&&-1===n)&&(!s||!l(s.targetGeometry)||"extent"!==s.targetGeometry.type&&!s.scale)))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get _projectionEngineLoaded(){return!!j()||(this._pePromise||(this._pePromise=T().finally((()=>{this._pePromise=null}))),!1)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=this.spatialReference,i=h(e.targetGeometry);return!!R(i.spatialReference,t)||this._projectionEngineLoaded}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{e===this._get("animation")&&(this._set("animation",null),this.frameTask.requestFrame()),this.frameTask.animationInProgress=!1};e.when(i,i)}get background(){return this.get("map.initialViewProperties.background")||null}set background(e){void 0===e?this._clearOverride("background"):this._override("background",e)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return new S({x:e[0],y:e[1],spatialReference:t})}set center(e){if(null==e)return;if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void o.getLogger(this.declaredClass).error(new n("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:s}))}const i=this.viewpoint;A(i,i,t),this.viewpoint=i}set constraints(e){const t=this._get("constraints");t&&(this.handles.remove("map-view-constraints"),t.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(d((()=>e.version),(()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))}),m),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(null==e)return;if(!e.width||!e.height)return void o.getLogger(this.declaredClass).error(new n("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void o.getLogger(this.declaredClass).error(new n("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:s}))}const i=this.viewpoint;F(i,i,t,this.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;U(t,t,e),this.viewpoint=t}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}const t=this.viewpoint;I(t,t,e),this.viewpoint=t}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}get updating(){return!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)))}get viewpoint(){if(!this.ready)return this._get("viewpoint");const e=this.state.paddedViewState;return e&&e.viewpoint.clone()}set viewpoint(e){if(null==e)return;if(!this.ready)return this._set("viewpoint",e),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),void this.notifyChange("initialExtentRequired");let t,s;try{t=this._project(e,this.spatialReference),!e.scale||isNaN(e.scale)?s=new n("mapview:invalid-viewpoint",`invalid scale value of ${e.scale}`):p(e.targetGeometry)&&(s=new n("mapview:invalid-viewpoint","geometry not defined"))}catch(a){s=new n("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:a})}if(s)return void o.getLogger(this.declaredClass).error(s);this._scaleBeforeChangingSpatialReference=null;const r=new i({targetGeometry:new S,scale:0,rotation:0});W(r,t),this.constraints.constrain(r,this.state.paddedViewState.viewpoint),this.state.viewpoint=r,this.frameTask.requestFrame(),this._set("viewpoint",r)}get zoom(){return this.ready?this.constraints.scaleToZoom(this.scale):this._get("zoom")}set zoom(e){if(null==e)return;if(!this.ready){this._set("zoom",e),this._set("scale",0);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}if(!this.constraints.effectiveLODs)return void this._set("zoom",-1);const t=this.viewpoint;I(t,t,this.constraints.zoomToScale(e)),this.viewpoint=t,this._set("zoom",this.constraints.scaleToZoom(this.scale))}get navigating(){return!(!this.mapViewNavigation||!this.mapViewNavigation.interacting)}goTo(e,t){if(e)return this.animation&&(this.animation=null),this._createAnimation(),u((()=>this.ready),t).then((()=>{const i={animate:!0,...t},s=B(e,this);return this.animation.update(s),this._gotoTask={},i.animate?this._gotoAnimated(s,i):this._gotoImmediate(s,i)}));o.getLogger(this.declaredClass).error("#goTo()","target cannot be null or undefined")}async hitTest(e,t){const i=re(e)?ne(this,e):e;if(!this.ready||isNaN(i.x)||isNaN(i.y))return{screenPoint:i,results:[]};let s=new Set,r=!1,n=null,a=null;t?.include?Se(t.include,Ve(this,(e=>s.add(e)),(e=>{n||(n=new Set),n.add(e)}),(e=>s.add(e)),(()=>r=!0))):(r=!0,s=new Set(this.allLayerViews)),t?.exclude&&Se(t.exclude,Ve(this,(e=>s.delete(e)),(e=>{a||(a=new Set),a.add(e)})));const o=this.allLayerViews.filter((e=>!e.suspended&&s.has(e))).reverse(),h=this.toMap(i);let p=[...r?this.graphicsView.hitTest(h).map((e=>({type:"graphic",graphic:e,layer:null,mapPoint:h}))):[],...await Promise.all(o.map((e=>e.hitTest(h,i))).toArray())].filter(l).flat().filter(l);return n&&(p=p.filter((e=>!("graphic"in e)||!e.graphic||n.has(ve(e.graphic))))),a&&(p=p.filter((e=>!("graphic"in e)||!e.graphic||a.has(ve(e.graphic))))),{screenPoint:i,results:p}}async takeScreenshot(e){const t=this._createScreenshotPlan(e),i=await this._stage.takeScreenshot(t);return ee(i,{format:t.format,quality:t.quality,rotation:0,disableDecorations:!1},this._pixelFormat)}async _takeScreenshot(e){const t=this._createScreenshotPlan(e),i=await this._stage.takeScreenshot(t);return te(i,this._pixelFormat)}_createScreenshotPlan(e){e=e||{};const t=this.supersampleScreenshotsEnabled?Math.min(4,ie(this.size,Math.min(4096,this._stage.context.parameters.maxTextureSize))):1;let i;e.layers?(i=[],e.layers.forEach((e=>{const t=this.allLayerViews.find((t=>t.layer.id===e.id));t&&"container"in t&&t.container&&i.push(t.container)}))):i=this._stage.children;const{format:s,quality:r}=se(e.format,e.quality);return X(e,t,this.size,this.padding,s,r,i,e.rotation)}get test(){return{takeScreenshot:e=>this._takeScreenshot(e)}}toMap(e){if(!this.ready)return null;const t=re(e)?ne(this,e):e,i=[0,0],[s,r]=this.state.toMap(i,[t.x,t.y]),n=this.spatialReference;return new S({x:s,y:r,spatialReference:n})}toScreen(e){if(!this.ready)return null;const t=this._project(e,this.spatialReference),i=[t.x,t.y];return this.state.toScreen(i,i),f(i[0],i[1])}on(e,t,i,s){const r=this.inputManager&&this.viewEvents.on(e,t,i,s);return r||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||null}hasLayerViewModule(e){return G.hasLayerViewModule(e)}importLayerView(e){return G.importLayerView(e)}pixelSizeAt(){return this.ready?this.state.resolution:(o.getLogger(this.declaredClass).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}popupHitTest(e){return this.hitTest(e).then((t=>({...t,mapPoint:this.toMap(e)})))}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}validate(){let e=ae(this.type);return has("safari")&&has("safari")<9&&(e=new n("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),l(e)?(o.getLogger(this.declaredClass).warn("#validate()",e.message),Promise.reject(e)):ge()}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new z),this.animation}_cancellableGoTo(e,t,i){const s=()=>e===this._gotoTask,r=i.then((()=>{s()&&(this.animation=null)})).catch((e=>{throw s()&&(this.animation=null,t.done||(t.stop(),this.frameTask.animationInProgress=!1)),e})),n=new Promise((e=>e(r)));return t.when().catch((()=>{s()&&n.cancel&&n.cancel()})),n}_gotoImmediate(e,t){const i=this._gotoTask,s=this.animation,r=e.then((e=>{if(c(t),i!==this._gotoTask)throw new n("view:goto-interrupted","Goto was interrupted");this.viewpoint=s.target=e,s.finish()}));return this._cancellableGoTo(i,s,r)}_flipStationary(e){return null!==this._stationaryTimer||(this._stationaryTimer=setTimeout((()=>{this._stationaryTimer=null;const e=performance.now()-this._lastStationaryEventTimestamp;e<fe&&(this._stationaryTimer=this._flipStationary(e))}),e)),this._stationaryTimer}_getDefaultViewpoint(){const{constraints:e,initialExtent:t,map:s,padding:r,size:n}=this;if(!e)return null;const a=s&&"initialViewProperties"in s&&s.initialViewProperties,o={zoom:this._get("zoom"),scale:this._get("scale"),center:this._get("center"),extent:this._get("extent"),rotation:this._get("rotation"),viewpoint:this._get("viewpoint"),spatialReference:this._userSpatialReference};e.effectiveLODs?-1!==o.zoom&&(o.scale=e.zoomToScale(o.zoom)):o.zoom=-1;let p=null,c=null,d=0;const u=o.viewpoint&&o.viewpoint.rotation,m=o.viewpoint&&o.viewpoint.targetGeometry;l(m)&&("extent"===m.type?p=m:"point"===m.type&&(c=m,d=o.viewpoint.scale));const g=o.extent||p||h(a?.viewpoint?.targetGeometry)?.extent||t,f=o.center||c||g?.center,y=o.scale||d||a?.viewpoint?.scale||g&&H(g,[n[0]-r.left-r.right,n[1]-r.top-r.bottom]),w=o.rotation||u||a?.viewpoint?.rotation||0;return f&&y?new i({targetGeometry:f,scale:y,rotation:w}):null}_gotoAnimated(e,t){const i=this._gotoTask,s=this.animation,r=e.then((e=>{if(c(t),i!==this._gotoTask)throw new n("view:goto-interrupted","Goto was interrupted");return s.update(e),this.animationManager.animate(s,this.viewpoint,t),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(i,s,r)}_project(e,t){const i=e&&e.targetGeometry||e;if(!t)return e;if(!i)return null;if(t.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem)return e;if(x(t,i.spatialReference))return e;const s=b(i,t);if(!s)throw new n("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:i,spatialReference:t});return ye(e)?(e.targetGeometry=s,e):s}_resizeHandler(e){if(!this.ready)return;const t=this.state;let i=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();t.size=[e.width,e.height],$(i,i,s,this.state.paddedViewState.size,this.resizeAlign),i=this.constraints.constrain(i,null),this.state.viewpoint=i}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint(),t=e.targetGeometry;try{this._project(e,this.spatialReference)}catch(l){o.getLogger(this.declaredClass).warn(new y("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:t.toJSON(),spatialReference:this.spatialReference,error:l})),e.targetGeometry=this.defaultsFromMap.extent?.center||new S({x:0,y:0,spatialReference:this.spatialReference})}this.constraints?.fit(e),this._set("state",new q({padding:this._get("padding"),size:this.size,viewpoint:e})),this.graphics.owner=this;const i=new he(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenshotsEnabled,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this._stage=i,this._magnifierView=new me,this._magnifierView.magnifier=this.magnifier;const s=new de({view:this});this._set("labelManager",s);const r=new P({view:this});this._set("animationManager",r);const n=new ue({view:this,animationManager:r});this._set("mapViewNavigation",n),this._setupSpatialReferenceDependentProperties(),this.handles.add([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),i.on("post-render",(()=>this._set("rendering",i.renderRequested))),i.on("will-render",(()=>this._set("rendering",i.renderRequested))),i.on("webgl-error",(e=>this.fatalError=e.error)),d((()=>this.stationary),(e=>i.stationary=e),g),d((()=>this.background),(e=>{i.background=e,this._magnifierView.background=e}),g),d((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),g),d((()=>this.renderingOptions),(e=>i.renderingOptions=e),g),d((()=>this.highlightOptions),(e=>i.highlightOptions=e),g),d((()=>this.state.id),(()=>i.state=this.state),g)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask&&this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.handles.remove("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._stage.destroy(),this._stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask&&this.frameTask.stop(),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null),this._set("ready",!1);const{center:[e,t],spatialReference:i,rotation:s,scale:r}=this.state.paddedViewState,n=new S({x:e,y:t,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",n),this._set("zoom",-1),this._set("rotation",s),this._set("scale",r),this._set("spatialReference",i),this._set("state",null),this.animation=null}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this._stage.addChild(e.container)}));const e=this.graphicsView;this._stage.addChild(e.container),this._stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new D(M.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new pe({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new ce(e)});this.frameTask.graphicsView=t,this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),this.frameTask.graphicsView=null,e.destroy(),this._set("featuresTilingScheme",null)}_spatialReferenceChanged(e){if(!this.ready)return;this.frameTask.stop();for(const i of this.allLayerViews)i.processDetach();this._destroySpatialReferenceDependentProperties();const t=this.state.paddedViewState.clone();if(p(this._scaleBeforeChangingSpatialReference))this._scaleBeforeChangingSpatialReference=t.scale;else{const e=t.viewpoint.clone();e.scale=this._scaleBeforeChangingSpatialReference,t.viewpoint=e}const s=t.clone(),[r,n]=t.center;let a=null;try{a=this._project(new S({x:r,y:n,spatialReference:t.spatialReference}),e)}catch(h){j()||o.getLogger(this.declaredClass).warn(new y("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:a.toJSON(),spatialReference:e,error:h}))}a||(a=new S({x:0,y:0,spatialReference:e}));const l=A(new i({targetGeometry:new S,scale:0,rotation:0}),t.viewpoint,a);s.viewpoint=l;try{const i=20,r=[t.size[0]/2,t.size[1]/2],n=[r[0]+i,r[1]],a=t.toMap([0,0],n),{x:o,y:h}=this._project(new S({x:a[0],y:a[1],spatialReference:t.spatialReference}),e);a[0]=o,a[1]=h,s.toScreen(a,a);const p=J(r,a,n),c=Math.hypot(a[0]-r[0],a[1]-r[1])/i;!Number.isFinite(c)||Math.abs(c)>4?(l.rotation=0,l.targetGeometry=new S({x:0,y:0,spatialReference:e})):(l.scale*=c,l.scale>has("mapview-srswitch-adjust-rotation-scale-threshold")?l.rotation=0:l.rotation+=Number.isFinite(p)?p:0)}catch{}this._get("constraints").constrain(l,null),this._get("state").viewpoint=l,this._stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const i of this.allLayerViews)i.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}};we.type="2d",e([_({readOnly:!0})],we.prototype,"animationManager",void 0),e([_({constructOnly:!0})],we.prototype,"deactivatedWebGLExtensions",void 0),e([_({constructOnly:!0})],we.prototype,"debugWebGLExtensions",void 0),e([_({readOnly:!0})],we.prototype,"featuresTilingScheme",void 0),e([_({readOnly:!0})],we.prototype,"fullOpacity",void 0),e([_({readOnly:!0})],we.prototype,"graphicsTileStore",null),e([_()],we.prototype,"graphicsView",void 0),e([_({readOnly:!0})],we.prototype,"state",void 0),e([_()],we.prototype,"initialExtentRequired",null),e([_()],we.prototype,"labelManager",void 0),e([_({readOnly:!0})],we.prototype,"resourceManager",null),e([_({readOnly:!0})],we.prototype,"textureManager",null),e([_({readOnly:!0})],we.prototype,"mapViewNavigation",void 0),e([_({constructOnly:!0})],we.prototype,"renderCanvas",void 0),e([_()],we.prototype,"renderingOptions",void 0),e([_({readOnly:!0})],we.prototype,"rendering",void 0),e([_({constructOnly:!0})],we.prototype,"supersampleScreenshotsEnabled",void 0),e([_({readOnly:!0})],we.prototype,"supportsGround",void 0),e([_()],we.prototype,"_stationaryTimer",void 0),e([_()],we.prototype,"_defaultsFromMapSettings",null),e([_()],we.prototype,"_pePromise",void 0),e([_({readOnly:!0})],we.prototype,"typeSpecificPreconditionsReady",null),e([_()],we.prototype,"animation",null),e([_({type:le})],we.prototype,"background",null),e([_({value:null,type:S,dependsOn:["state.id","ready"]})],we.prototype,"center",null),e([_({type:N})],we.prototype,"constraints",null),e([_({value:null,type:V,dependsOn:["state.id","ready"]})],we.prototype,"extent",null),e([_()],we.prototype,"floors",void 0),e([_({type:K})],we.prototype,"highlightOptions",void 0),e([_({readOnly:!0})],we.prototype,"inputManager",void 0),e([_()],we.prototype,"map",void 0),e([_({value:{top:0,right:0,bottom:0,left:0},cast:e=>({top:0,right:0,bottom:0,left:0,...e})})],we.prototype,"padding",null),e([_()],we.prototype,"resizeAlign",void 0),e([_({readOnly:!0,dependsOn:["state.id"]})],we.prototype,"resolution",null),e([_({value:0,type:Number,dependsOn:["state.id","ready"]})],we.prototype,"rotation",null),e([_({value:0,type:Number,dependsOn:["state.id","ready"]})],we.prototype,"scale",null),e([_({constructOnly:!0})],we.prototype,"spatialReferenceLocked",void 0),e([_()],we.prototype,"stationary",null),e([_({type:Y,readOnly:!0})],we.prototype,"timeline",void 0),e([_({readOnly:!0})],we.prototype,"type",void 0),e([_({readOnly:!0})],we.prototype,"updating",null),e([_({value:null,type:i,dependsOn:["state.id","ready"]})],we.prototype,"viewpoint",null),e([_({value:-1,dependsOn:["state.id","ready"]})],we.prototype,"zoom",null),e([_({type:Boolean})],we.prototype,"navigating",null),e([_({type:oe})],we.prototype,"ui",void 0),we=e([v("esri.views.MapView")],we);const _e=we;function ve(e){const t=e.getObjectId();return t?`${e.layer?.uid??e.sourceLayer?.uid??"MapView"}/${t}`:`"MapView/${e.uid}`}function Ve(e,i,s,r,n){return a=>{if(a instanceof t){if(a.layer===e)n?.();else{const t=e.allLayerViews.find((e=>e.layer===a.layer));t&&r?.(t)}s(ve(a))}else{const t=e.allLayerViews.find((e=>e.layer===a));t&&i(t)}}}function Se(e,t){if(e)if(a(e))for(const i of e)if(a(i))for(const e of i)t(e);else t(i);else t(e)}export{_e as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import i from"../Viewpoint.js";import s from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import n from"../core/Error.js";import has from"../core/has.js";import{isIterable as a}from"../core/iteratorUtils.js";import o from"../core/Logger.js";import{isSome as l,unwrap as h,isNone as p}from"../core/maybe.js";import{throwIfAborted as c}from"../core/promiseUtils.js";import{watch as d,whenOnce as u,sync as m,syncAndInitial as g}from"../core/reactiveUtils.js";import{createScreenPoint as f}from"../core/screenUtils.js";import y from"../core/Warning.js";import{initialize as w}from"../core/workers/workers.js";import{property as _}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import V from"../geometry/Extent.js";import S from"../geometry/Point.js";import{load as j,canProjectWithoutEngine as T,project as R,isLoaded as b}from"../geometry/projection.js";import{equals as x}from"../geometry/support/spatialReferenceUtils.js";import M from"../layers/support/TileInfo.js";import{BreakpointsOwner as O}from"./BreakpointsOwner.js";import{DOMContainer as k}from"./DOMContainer.js";import{PopupView as L}from"./PopupView.js";import C from"./View.js";import z from"./ViewAnimation.js";import P from"./2d/AnimationManager.js";import E from"./2d/FrameTask.js";import{layerView2DImporter as G}from"./2d/layerViewModuleImportUtils.js";import N from"./2d/MapViewConstraints.js";import q from"./2d/PaddedViewState.js";import"./2d/tiling/PagedTileQueue.js";import D from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{centerAt as A,setExtent as F,rotateTo as U,scaleTo as I,copy as W,create as B,extentToScale as H,resize as $,angleBetween as J}from"./2d/viewpointUtils.js";import Q from"./2d/input/MapViewInputManager.js";import Z from"./2d/layers/features/support/TileStore.js";import K from"./2d/support/HighlightOptions.js";import{Timeline as Y}from"./2d/support/Timeline.js";import X from"./support/createScreenshotPlan.js";import{encode as ee,encodeData as te,getMaximumResolutionScale as ie,getFormatAndQuality as se}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as re,createScreenPointFromSupportedEvent as ne}from"./support/screenUtils.js";import{check as ae}from"./support/WebGLRequirements.js";import oe from"./ui/2d/DefaultUI2D.js";import le from"../webmap/background/ColorBackground.js";let he,pe,ce,de,ue,me;async function ge(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s,MagnifierView2D:r,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);pe=e,ce=t,de=i,ue=s,me=r,he=n}const fe=160;function ye(e){return e&&"esri.Viewpoint"===e.declaredClass}let we=class extends(O(k(L(C)))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!1,this.supportsGround=!1,this._stationaryTimer=null,this.frameTask=new E(this),this._pePromise=null,this.floors=new s,this.highlightOptions=new K,this.inputManager=new Q({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!1,this.timeline=new Y,this.type="2d",this.ui=new oe,this._pixelFormat={flipY:!0,premultipliedAlpha:!0},this.constraints=new N,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([d((()=>this.viewpoint),(()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(fe)}),m),this.on("resize",(e=>this._resizeHandler(e))),d((()=>this.animationManager?.animation),(e=>{this.animation=e}))]),w()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new Z(this.featuresTilingScheme)}get initialExtentRequired(){const{scale:e,constraints:t,center:i,viewpoint:s,extent:r}=this;let n=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!r&&(t?.effectiveLODs||(n=-1),(!i||0===e&&-1===n)&&(!s||!l(s.targetGeometry)||"extent"!==s.targetGeometry.type&&!s.scale)))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get _projectionEngineLoaded(){return!!b()||(this._pePromise||(this._pePromise=j().finally((()=>{this._pePromise=null}))),!1)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=this.spatialReference,i=h(e.targetGeometry);return!!T(i.spatialReference,t)||this._projectionEngineLoaded}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{e===this._get("animation")&&(this._set("animation",null),this.frameTask.requestFrame()),this.frameTask.animationInProgress=!1};e.when(i,i)}get background(){return this.get("map.initialViewProperties.background")||null}set background(e){void 0===e?this._clearOverride("background"):this._override("background",e)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return new S({x:e[0],y:e[1],spatialReference:t})}set center(e){if(null==e)return;if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void o.getLogger(this.declaredClass).error(new n("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:s}))}const i=this.viewpoint;A(i,i,t),this.viewpoint=i}set constraints(e){const t=this._get("constraints");t&&(this.handles.remove("map-view-constraints"),t.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(d((()=>e.version),(()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))}),m),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(null==e)return;if(!e.width||!e.height)return void o.getLogger(this.declaredClass).error(new n("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void o.getLogger(this.declaredClass).error(new n("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:s}))}const i=this.viewpoint;F(i,i,t,this.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;U(t,t,e),this.viewpoint=t}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}const t=this.viewpoint;I(t,t,e),this.viewpoint=t}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}get updating(){return!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)))}get viewpoint(){if(!this.ready)return this._get("viewpoint");const e=this.state.paddedViewState;return e&&e.viewpoint.clone()}set viewpoint(e){if(null==e)return;if(!this.ready)return this._set("viewpoint",e),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),void this.notifyChange("initialExtentRequired");let t,s;try{t=this._project(e,this.spatialReference),!e.scale||isNaN(e.scale)?s=new n("mapview:invalid-viewpoint",`invalid scale value of ${e.scale}`):p(e.targetGeometry)&&(s=new n("mapview:invalid-viewpoint","geometry not defined"))}catch(a){s=new n("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:a})}if(s)return void o.getLogger(this.declaredClass).error(s);this._scaleBeforeChangingSpatialReference=null;const r=new i({targetGeometry:new S,scale:0,rotation:0});W(r,t),this.constraints.constrain(r,this.state.paddedViewState.viewpoint),this.state.viewpoint=r,this.frameTask.requestFrame(),this._set("viewpoint",r)}get zoom(){return this.ready?this.constraints.scaleToZoom(this.scale):this._get("zoom")}set zoom(e){if(null==e)return;if(!this.ready){this._set("zoom",e),this._set("scale",0);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}if(!this.constraints.effectiveLODs)return void this._set("zoom",-1);const t=this.viewpoint;I(t,t,this.constraints.zoomToScale(e)),this.viewpoint=t,this._set("zoom",this.constraints.scaleToZoom(this.scale))}get navigating(){return!(!this.mapViewNavigation||!this.mapViewNavigation.interacting)}goTo(e,t){if(e)return this.animation&&(this.animation=null),this._createAnimation(),u((()=>this.ready),t).then((()=>{const i={animate:!0,...t},s=B(e,this);return this.animation.update(s),this._gotoTask={},i.animate?this._gotoAnimated(s,i):this._gotoImmediate(s,i)}));o.getLogger(this.declaredClass).error("#goTo()","target cannot be null or undefined")}async hitTest(e,t){const i=re(e)?ne(this,e):e;if(!this.ready||isNaN(i.x)||isNaN(i.y))return{screenPoint:i,results:[]};let s=new Set,r=!1,n=null,a=null;t?.include?Se(t.include,Ve(this,(e=>s.add(e)),(e=>{n||(n=new Set),n.add(e)}),(e=>s.add(e)),(()=>r=!0))):(r=!0,s=new Set(this.allLayerViews)),t?.exclude&&Se(t.exclude,Ve(this,(e=>s.delete(e)),(e=>{a||(a=new Set),a.add(e)})));const o=this.allLayerViews.filter((e=>!e.suspended&&s.has(e))).reverse(),h=this.toMap(i);let p=[...r?this.graphicsView.hitTest(h).map((e=>({type:"graphic",graphic:e,layer:null,mapPoint:h}))):[],...await Promise.all(o.map((e=>e.hitTest(h,i))).toArray())].filter(l).flat().filter(l);return n&&(p=p.filter((e=>!("graphic"in e)||!e.graphic||n.has(ve(e.graphic))))),a&&(p=p.filter((e=>!("graphic"in e)||!e.graphic||a.has(ve(e.graphic))))),{screenPoint:i,results:p}}async takeScreenshot(e){const t=this._createScreenshotPlan(e),i=await this._stage.takeScreenshot(t);return ee(i,{format:t.format,quality:t.quality,rotation:0,disableDecorations:!1},this._pixelFormat)}async _takeScreenshot(e){const t=this._createScreenshotPlan(e),i=await this._stage.takeScreenshot(t);return te(i,this._pixelFormat)}_createScreenshotPlan(e){e=e||{};const t=this.supersampleScreenshotsEnabled?Math.min(4,ie(this.size,Math.min(4096,this._stage.context.parameters.maxTextureSize))):1;let i;e.layers?(i=[],e.layers.forEach((e=>{const t=this.allLayerViews.find((t=>t.layer.id===e.id));t&&"container"in t&&t.container&&i.push(t.container)}))):i=this._stage.children;const{format:s,quality:r}=se(e.format,e.quality);return X(e,t,this.size,this.padding,s,r,i,e.rotation)}get test(){return{takeScreenshot:e=>this._takeScreenshot(e)}}toMap(e){if(!this.ready)return null;const t=re(e)?ne(this,e):e,i=[0,0],[s,r]=this.state.toMap(i,[t.x,t.y]),n=this.spatialReference;return new S({x:s,y:r,spatialReference:n})}toScreen(e){if(!this.ready)return null;const t=this._project(e,this.spatialReference),i=[t.x,t.y];return this.state.toScreen(i,i),f(i[0],i[1])}on(e,t,i,s){const r=this.inputManager&&this.viewEvents.on(e,t,i,s);return r||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||null}hasLayerViewModule(e){return G.hasLayerViewModule(e)}importLayerView(e){return G.importLayerView(e)}pixelSizeAt(){return this.ready?this.state.resolution:(o.getLogger(this.declaredClass).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}popupHitTest(e){return this.hitTest(e).then((t=>({...t,mapPoint:this.toMap(e)})))}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}validate(){let e=ae(this.type);return has("safari")&&has("safari")<9&&(e=new n("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),l(e)?(o.getLogger(this.declaredClass).warn("#validate()",e.message),Promise.reject(e)):ge()}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new z),this.animation}_cancellableGoTo(e,t,i){const s=()=>e===this._gotoTask,r=i.then((()=>{s()&&(this.animation=null)})).catch((e=>{throw s()&&(this.animation=null,t.done||(t.stop(),this.frameTask.animationInProgress=!1)),e})),n=new Promise((e=>e(r)));return t.when().catch((()=>{s()&&n.cancel&&n.cancel()})),n}_gotoImmediate(e,t){const i=this._gotoTask,s=this.animation,r=e.then((e=>{if(c(t),i!==this._gotoTask)throw new n("view:goto-interrupted","Goto was interrupted");this.viewpoint=s.target=e,s.finish()}));return this._cancellableGoTo(i,s,r)}_flipStationary(e){return null!==this._stationaryTimer||(this._stationaryTimer=setTimeout((()=>{this._stationaryTimer=null;const e=performance.now()-this._lastStationaryEventTimestamp;e<fe&&(this._stationaryTimer=this._flipStationary(e))}),e)),this._stationaryTimer}_getDefaultViewpoint(){const{constraints:e,initialExtent:t,map:s,padding:r,size:n}=this;if(!e)return null;const a=s&&"initialViewProperties"in s&&s.initialViewProperties,o={zoom:this._get("zoom"),scale:this._get("scale"),center:this._get("center"),extent:this._get("extent"),rotation:this._get("rotation"),viewpoint:this._get("viewpoint"),spatialReference:this._userSpatialReference};e.effectiveLODs?-1!==o.zoom&&(o.scale=e.zoomToScale(o.zoom)):o.zoom=-1;let p=null,c=null,d=0;const u=o.viewpoint&&o.viewpoint.rotation,m=o.viewpoint&&o.viewpoint.targetGeometry;l(m)&&("extent"===m.type?p=m:"point"===m.type&&(c=m,d=o.viewpoint.scale));const g=o.extent||p||h(a?.viewpoint?.targetGeometry)?.extent||t,f=o.center||c||g?.center,y=o.scale||d||a?.viewpoint?.scale||g&&H(g,[n[0]-r.left-r.right,n[1]-r.top-r.bottom]),w=o.rotation||u||a?.viewpoint?.rotation||0;return f&&y?new i({targetGeometry:f,scale:y,rotation:w}):null}_gotoAnimated(e,t){const i=this._gotoTask,s=this.animation,r=e.then((e=>{if(c(t),i!==this._gotoTask)throw new n("view:goto-interrupted","Goto was interrupted");return s.update(e),this.animationManager.animate(s,this.viewpoint,t),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(i,s,r)}_project(e,t){const i=e&&e.targetGeometry||e;if(!t)return e;if(!i)return null;if(t.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem)return e;if(x(t,i.spatialReference))return e;const s=R(i,t);if(!s)throw new n("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:i,spatialReference:t});return ye(e)?(e.targetGeometry=s,e):s}_resizeHandler(e){if(!this.ready)return;const t=this.state;let i=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();t.size=[e.width,e.height],$(i,i,s,this.state.paddedViewState.size,this.resizeAlign),i=this.constraints.constrain(i,null),this.state.viewpoint=i}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint(),t=e.targetGeometry;try{this._project(e,this.spatialReference)}catch(l){o.getLogger(this.declaredClass).warn(new y("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:t.toJSON(),spatialReference:this.spatialReference,error:l})),e.targetGeometry=this.defaultsFromMap.extent?.center||new S({x:0,y:0,spatialReference:this.spatialReference})}this.constraints?.fit(e),this._set("state",new q({padding:this._get("padding"),size:this.size,viewpoint:e})),this.graphics.owner=this;const i=new he(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenshotsEnabled,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this._stage=i,this._magnifierView=new me,this._magnifierView.magnifier=this.magnifier;const s=new de({view:this});this._set("labelManager",s);const r=new P({view:this});this._set("animationManager",r);const n=new ue({view:this,animationManager:r});this._set("mapViewNavigation",n),this._setupSpatialReferenceDependentProperties(),this.handles.add([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),i.on("post-render",(()=>this._set("rendering",i.renderRequested))),i.on("will-render",(()=>this._set("rendering",i.renderRequested))),i.on("webgl-error",(e=>this.fatalError=e.error)),d((()=>this.stationary),(e=>i.stationary=e),g),d((()=>this.background),(e=>{i.background=e,this._magnifierView.background=e}),g),d((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),g),d((()=>this.renderingOptions),(e=>i.renderingOptions=e),g),d((()=>this.highlightOptions),(e=>i.highlightOptions=e),g),d((()=>this.state.id),(()=>i.state=this.state),g)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask&&this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.handles.remove("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._stage.destroy(),this._stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask&&this.frameTask.stop(),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null),this._set("ready",!1);const{center:[e,t],spatialReference:i,rotation:s,scale:r}=this.state.paddedViewState,n=new S({x:e,y:t,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",n),this._set("zoom",-1),this._set("rotation",s),this._set("scale",r),this._set("spatialReference",i),this._set("state",null),this.animation=null}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this._stage.addChild(e.container)}));const e=this.graphicsView;this._stage.addChild(e.container),this._stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new D(M.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new pe({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new ce(e)});this.frameTask.graphicsView=t,this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),this.frameTask.graphicsView=null,e.destroy(),this._set("featuresTilingScheme",null)}_spatialReferenceChanged(e){if(!this.ready)return;this.frameTask.stop();for(const i of this.allLayerViews)i.processDetach();this._destroySpatialReferenceDependentProperties();const t=this.state.paddedViewState.clone();if(p(this._scaleBeforeChangingSpatialReference))this._scaleBeforeChangingSpatialReference=t.scale;else{const e=t.viewpoint.clone();e.scale=this._scaleBeforeChangingSpatialReference,t.viewpoint=e}const s=t.clone(),[r,n]=t.center;let a=null;try{a=this._project(new S({x:r,y:n,spatialReference:t.spatialReference}),e)}catch(h){b()||o.getLogger(this.declaredClass).warn(new y("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:a.toJSON(),spatialReference:e,error:h}))}a||(a=new S({x:0,y:0,spatialReference:e}));const l=A(new i({targetGeometry:new S,scale:0,rotation:0}),t.viewpoint,a);s.viewpoint=l;try{const i=20,r=[t.size[0]/2,t.size[1]/2],n=[r[0]+i,r[1]],a=t.toMap([0,0],n),{x:o,y:h}=this._project(new S({x:a[0],y:a[1],spatialReference:t.spatialReference}),e);a[0]=o,a[1]=h,s.toScreen(a,a);const p=J(r,a,n),c=Math.hypot(a[0]-r[0],a[1]-r[1])/i;!Number.isFinite(c)||Math.abs(c)>4?(l.rotation=0,l.targetGeometry=new S({x:0,y:0,spatialReference:e})):(l.scale*=c,l.scale>has("mapview-srswitch-adjust-rotation-scale-threshold")?l.rotation=0:l.rotation+=Number.isFinite(p)?p:0)}catch{}this._get("constraints").constrain(l,null),this._get("state").viewpoint=l,this._stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const i of this.allLayerViews)i.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}};we.type="2d",e([_({readOnly:!0})],we.prototype,"animationManager",void 0),e([_({constructOnly:!0})],we.prototype,"deactivatedWebGLExtensions",void 0),e([_({constructOnly:!0})],we.prototype,"debugWebGLExtensions",void 0),e([_({readOnly:!0})],we.prototype,"featuresTilingScheme",void 0),e([_({readOnly:!0})],we.prototype,"fullOpacity",void 0),e([_({readOnly:!0})],we.prototype,"graphicsTileStore",null),e([_()],we.prototype,"graphicsView",void 0),e([_({readOnly:!0})],we.prototype,"state",void 0),e([_()],we.prototype,"initialExtentRequired",null),e([_()],we.prototype,"labelManager",void 0),e([_({readOnly:!0})],we.prototype,"resourceManager",null),e([_({readOnly:!0})],we.prototype,"textureManager",null),e([_({readOnly:!0})],we.prototype,"mapViewNavigation",void 0),e([_({constructOnly:!0})],we.prototype,"renderCanvas",void 0),e([_()],we.prototype,"renderingOptions",void 0),e([_({readOnly:!0})],we.prototype,"rendering",void 0),e([_({constructOnly:!0})],we.prototype,"supersampleScreenshotsEnabled",void 0),e([_({readOnly:!0})],we.prototype,"supportsGround",void 0),e([_()],we.prototype,"_stationaryTimer",void 0),e([_()],we.prototype,"_defaultsFromMapSettings",null),e([_()],we.prototype,"_pePromise",void 0),e([_({readOnly:!0})],we.prototype,"typeSpecificPreconditionsReady",null),e([_()],we.prototype,"animation",null),e([_({type:le})],we.prototype,"background",null),e([_({value:null,type:S,dependsOn:["state.id","ready"]})],we.prototype,"center",null),e([_({type:N})],we.prototype,"constraints",null),e([_({value:null,type:V,dependsOn:["state.id","ready"]})],we.prototype,"extent",null),e([_()],we.prototype,"floors",void 0),e([_({type:K})],we.prototype,"highlightOptions",void 0),e([_({readOnly:!0})],we.prototype,"inputManager",void 0),e([_()],we.prototype,"map",void 0),e([_({value:{top:0,right:0,bottom:0,left:0},cast:e=>({top:0,right:0,bottom:0,left:0,...e})})],we.prototype,"padding",null),e([_()],we.prototype,"resizeAlign",void 0),e([_({readOnly:!0,dependsOn:["state.id"]})],we.prototype,"resolution",null),e([_({value:0,type:Number,dependsOn:["state.id","ready"]})],we.prototype,"rotation",null),e([_({value:0,type:Number,dependsOn:["state.id","ready"]})],we.prototype,"scale",null),e([_({constructOnly:!0})],we.prototype,"spatialReferenceLocked",void 0),e([_()],we.prototype,"stationary",null),e([_({type:Y,readOnly:!0})],we.prototype,"timeline",void 0),e([_({readOnly:!0})],we.prototype,"type",void 0),e([_({readOnly:!0})],we.prototype,"updating",null),e([_({value:null,type:i,dependsOn:["state.id","ready"]})],we.prototype,"viewpoint",null),e([_({value:-1,dependsOn:["state.id","ready"]})],we.prototype,"zoom",null),e([_({readOnly:!0})],we.prototype,"navigating",null),e([_({type:oe})],we.prototype,"ui",void 0),we=e([v("esri.views.MapView")],we);const _e=we;function ve(e){const t=e.getObjectId();return t?`${e.layer?.uid??e.sourceLayer?.uid??"MapView"}/${t}`:`"MapView/${e.uid}`}function Ve(e,i,s,r,n){return a=>{if(a instanceof t){if(a.layer===e)n?.();else{const t=e.allLayerViews.find((e=>e.layer===a.layer));t&&r?.(t)}s(ve(a))}else{const t=e.allLayerViews.find((e=>e.layer===a));t&&i(t)}}}function Se(e,t){if(e)if(a(e))for(const i of e)if(a(i))for(const e of i)t(e);else t(i);else t(e)}export{_e as default};
|