@arcgis/core 5.2.0-next.71 → 5.2.0-next.73
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00cbff0b785e24e87d97.js +1 -0
- package/assets/esri/core/workers/chunks/{359584a8fb5687a7d098.js → 014f9fd2818e2c9d9a3b.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b3a8a6167f2e1eeb828.js → 0823961e5d0bdedbf8cf.js} +2 -2
- package/assets/esri/core/workers/chunks/{a62f1b8ed065b2a38f1a.js → 0dbf31a663b5220a3136.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe10a95ebe1da2322af6.js → 0df660dfd941cff3ea1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{d93d0cb69f3a9a722510.js → 1418c03c4ab87f7ab5f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{c03da138651ac53cadcb.js → 186bedc377cc97731ca2.js} +2 -2
- package/assets/esri/core/workers/chunks/{fff23b2682590c4b21e3.js → 2a2ed7bd44010f24c2dd.js} +1 -1
- package/assets/esri/core/workers/chunks/2e44978ee677aa23163d.js +256 -0
- package/assets/esri/core/workers/chunks/{fc2cae359d571690d754.js → 35fd2f765d2cb3f59a22.js} +4 -4
- package/assets/esri/core/workers/chunks/{6b208bac120bcfecd9e4.js → 3e2b4e734aa20a308f3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa19d5923276418096da.js → 44b50d4716a2567ab6f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{50e0dd74795978468625.js → 4cf2b0558a4acc141429.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d3a18d56e2e5669c562.js → 64176f7ae719289a2f79.js} +1 -1
- package/assets/esri/core/workers/chunks/{9684ab5e8254fdfcb7bb.js → 67f54586156d1ab80257.js} +1 -1
- package/assets/esri/core/workers/chunks/{2cfe6f41865ffb3a4645.js → 7e373d9c98ce910db9d2.js} +1 -1
- package/assets/esri/core/workers/chunks/{4da993c79b373b9d304e.js → 8302bffd28cc6720e0fe.js} +2 -2
- package/assets/esri/core/workers/chunks/{9dda9414104f585560a4.js → ad1d06a91121ebfe9162.js} +2 -2
- package/assets/esri/core/workers/chunks/{065e3353124fc5ac44ce.js → b33d870cbfa238762c5e.js} +1 -1
- package/assets/esri/core/workers/chunks/ba4f419f46be09a9a55c.js +1 -0
- package/assets/esri/core/workers/chunks/{684d3cb4fb233180b2d0.js → cd892c9603710d6130a9.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa5d27e47d47ff8fcb96.js → d03e7be74c57c3dbf003.js} +2 -2
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/Component.glsl.js +3 -3
- package/chunks/HUDMaterial.glsl.js +8 -8
- package/chunks/lyr3DMain.js +1 -1
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/ILyr3DWasmPerSceneView.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +3 -3
- package/support/revision.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/BitmapTile.js +1 -1
- package/views/2d/engine/BitmapTileContainer.js +1 -1
- package/views/2d/engine/flow/FlowContainer.js +1 -1
- package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/imagery/RasterBitmap.js +1 -1
- package/views/2d/engine/imagery/RasterTile.js +1 -1
- package/views/2d/engine/imagery/RasterTileContainer.js +1 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/imagery/RasterVFTile.js +1 -1
- package/views/2d/engine/imagery/RasterVFTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/OverlayContainer.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/TileContainer.js +1 -1
- package/views/2d/engine/webgl/normalizedTileUtils.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimationUniformInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/rasterVFUtils.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ClipShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DebugOverlayShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/Tile.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowParticlesShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowStreamlinesShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterVFTransform.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderOutline.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAggregateManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/settings.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/DepthConversion.glsl.js +14 -0
- package/views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js +3 -15
- package/views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/assets/esri/core/workers/chunks/6357c7cac401aee9fe77.js +0 -1
- package/assets/esri/core/workers/chunks/d2faac81142586cf7509.js +0 -1
- package/assets/esri/core/workers/chunks/fd6107f95082e05f016a.js +0 -256
- package/views/2d/engine/webgl/shaderGraph/techniques/line/utils.js +0 -2
- /package/assets/esri/core/workers/chunks/{3b3a8a6167f2e1eeb828.js.LICENSE.txt → 0823961e5d0bdedbf8cf.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c03da138651ac53cadcb.js.LICENSE.txt → 186bedc377cc97731ca2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4da993c79b373b9d304e.js.LICENSE.txt → 8302bffd28cc6720e0fe.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{9dda9414104f585560a4.js.LICENSE.txt → ad1d06a91121ebfe9162.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fa5d27e47d47ff8fcb96.js.LICENSE.txt → d03e7be74c57c3dbf003.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as n,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as c}from"../../../core/object.js";import{createAbortError as p,ignoreAbortErrors as d,throwIfNotAbortError as y,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as g,sync as f}from"../../../core/reactiveUtils.js";import{isScreenRect as w}from"../../../core/screenUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/units.js";import{property as b,subclass as S}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{fromJSON as j}from"../../../geometry/support/jsonUtils.js";import x from"../../../geometry/support/rotate.js";import{isCurvedGeometry as E}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as I}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import k from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as O}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as R}from"../../../layers/support/featureLayerUtils.js";import{packFields as V}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as C}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as Q}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import M from"../../../rest/support/AttributeBinsFeatureSet.js";import P from"../../../rest/support/AttributeBinsQuery.js";import H from"../../../rest/support/FeatureSet.js";import L from"../../../rest/support/Query.js";import{HittestDrawHelper as T}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{symbolToCIM as W}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as D}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as G}from"./LayerView2D.js";import{FeatureContainer as N}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as J}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as z}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as B}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as Z}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as K}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as $}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as X}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as Y}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as ee}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as te}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as re}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as se}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as ie}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as ae}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as oe}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ne}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as le}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as ue}from"./support/handleNoEngineError.js";import{toJSONGeometryType as he}from"./support/util.js";import{getMapPointsFromScreen as ce}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as pe}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as de}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ye}from"../../support/highlightOptionsUtils.js";function me(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ge=4294967294;function fe(e,t){return l(e.map(e=>g(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t,f)))}function we(e){if(!e.geometry)return e;if(!E(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:I(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}const ve=l=>{const f=de(G(l));let _=class extends f{constructor(){super(...arguments),this._commandsQueue=new le({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new z,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new k}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(p()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===C(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await J(t)}async _attachProxy(){const e=x(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(p()),y(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get layerAdapter(){switch(this.layer.type){case"annotation-feature":return new B(this.layer);case"dimension-feature":return new K(this.layer);case"feature":return"memory"===this.layer.source.type?new Y(this.layer):new $(this.layer);case"geojson":case"csv":case"wfs":return new Y(this.layer);case"parquet":return new se(this.layer);case"subtype-group":return new ae(this.layer);case"ogc-feature":return new te(this.layer);case"stream":return new ie(this.layer);case"oriented-imagery":return new re(this.layer);case"knowledge-graph-sublayer":return new ee(this.layer);case"catalog-footprint":return new Z(this.layer);default:this.layer}return null}get timeExtent(){return Q(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return n();const l=ye(t);return this._addHighlights(o,l),n(()=>!this.destroyed&&this._removeHighlights(o,l))}async hitTest(e,i){const a=w(i),{trueHitIds:o,candidateHitIds:n}=await this.featureContainer.hitTest(i),l=await this.getWorker(),[u,h]=await Promise.all([l.pipeline.getDisplayFeatures(n),l.pipeline.getDisplayFeatures(o)]),{features:c,aggregates:p,tracks:d}=u,{features:y,aggregates:g,tracks:f}=h,v=[];if(a&&this.hasRenderer()){const e=new Map,t=new r;for(const r of c){t.attributes=r.attributes,t.geometry=j(r.geometry),t.symbol=null;const s=this.layerAdapter.getRenderer(t);if(!s){v.push(r);continue}const i=await D(t,{renderer:s,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:"2d",timeZone:this.view.timeZone});if(!i)continue;let a=null;const o=W(i);if("web-style"===o.type)try{const e=W(await o.fetchSymbol({acceptedFormats:["cim","web"]}));a="web-style"===e.type?null:e}catch(x){m(x),0;continue}else a=o;const n=a?.symbol;if(!n)continue;const l=this.view.stage.cimAnalyzer.analyzeSymbolReference(a,!1).some(e=>"alignment"in e&&0===e.alignment);e.set(r,{cimSymbol:n,isScreenAligned:l})}e.size>0&&!this._hittestDrawHelper&&(this._hittestDrawHelper=new T(this.view.stage.painter.textureManager.resourceManager));const{resolution:s,rotation:a}=this.view.state,o=ce(this.view,i);for(const[r,{cimSymbol:i,isScreenAligned:n}]of e){if(!r)continue;const e={hittestType:"rect",textInfo:null,mapRotation:a,resolution:s,searchDist:0,isScreenAligned:n};this._hittestDrawHelper.hitTest(o,i,r.geometry,e)&&v.push(r)}}else v.push(...c);const _=[...y,...v],b=[...g,...p],S=[...f,...d],A=this.featureContainer.getSortKeys(_.map(e=>e.displayId)),F=({displayId:e},{displayId:t})=>A.has(e)&&A.has(t)?A.get(e)-A.get(t):e-t;return _.sort(F).reverse(),b.sort(F).reverse(),[...b.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...S.map(t=>this._createTrackGraphicHit(e,s.fromJSON(t))),..._.map(t=>this._createFeatureGraphicHit(a?null:e,r.fromJSON(t)))]}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return ue(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return ue(r,0)}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return ue(r,[])}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return ue(r,{features:[]})}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await ue(r,{features:[]});return M.fromJSON(s)}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await ue(r,{features:[]}),i=q.fromJSON(s);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await ue(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return ue(r,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=H.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return ue(r,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return ue(r,[])}async queryStatistics(){const e=await this.getWorker();return ue(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return ue(a,{})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await ue(r,{features:[]}),i=H.fromJSON(s);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.featureContainer.getPresenting(),r=this._subscriptions.update(e.targetState,this._lastTargetState,t);r&&(this.featureContainer.updateSubscriptions(r),d(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(r))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),d(this._updatingHandles.addPromise(this._workerAttached.promise)),d(this._attachProxy()),this.featureContainer=new N(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new pe(this.view.featuresTilingScheme),this.requestUpdate(),this.addAttachHandles([fe([()=>this._displayRefreshVersion,()=>"displayFilterInfo"in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,e=>{e&&this.getWorker().then(e=>{if(this.destroyed)return;const t=x(this.view.extent,this.view.rotation,this.view.center);return e.pipeline.updateStationaryExtent(t.toJSON(),this.featureContainer.requiresRefresh)}).catch(()=>{})})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=h(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}onProxyClientEvent(e){}hasRenderer(){return"renderer"in this.layer&&null!=this.layer.renderer}isUpdating(){const e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updating;return this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){const e=this;return{updateSchemaStart:()=>e.updateSchemaStart(),updateSchemaEnd:t=>e.updateSchemaEnd(t),openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},openGlyphPorts:async()=>{const t=await e.container.stage.textureManager.openMessagePorts();return{result:t,transferList:t}},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!("renderer"in this.layer)||!this.layer.renderer||"dictionary"!==this.layer.renderer.type)throw new Error("InternalError: Expected renderer to be of type 'dictionary'");const t=this.layer.renderer,r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=he(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await oe({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}async _fetchMeshRequest(e){const{layer:t}=this;try{const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null};this._fields||(this._fields=t.fields.map(e=>e.toJSON()));return{type:"mesh-response",meshes:await oe({...e.symbolReference,hasTextStringTemplates:!0},{path:"anno-like",schemaOptions:r,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch(r){return{type:"mesh-response",meshes:[]}}}_cleanUpQuery(e){const t=L.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),"returnZ"in this.layer&&(t.returnZ??=this.layer.returnZ),"returnM"in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=P.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=L.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ge+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ge+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?u.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=he(this.layer.geometryType),i=X(this.layer),a=[];for(const n of e.added){const e=O(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=O(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),l=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:l,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){const e=this.layer;"featureReduction"in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),R(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;const t=this.featureContainer.updateStart("subtype-group"===e.type);this._lastFeatureEffect=this.featureEffect;const r={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},s=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)};return c(this._lastSchema?.source.strategy,i.source.strategy)||c(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch(t){}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.updateEnd")}catch(t){}}async _doUpdate(){const e=Math.round(performance.now()),t=await this.getWorker();await t.pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){const t=await this.getWorker();try{let r=new ne;for(const s of e.messages)switch(s.type){case"edit":r.tryAdd(await this._resolveEdit(s.event))||(await t.pipeline.onOverride(r.toMessage()),r=new ne,r.tryAdd(await this._resolveEdit(s.event)));break;case"override":r.tryAdd(this._resolveOverrides(s.options))||(await t.pipeline.onOverride(r.toMessage()),r=new ne,r.tryAdd(this._resolveOverrides(s.options)));break}await t.pipeline.onOverride(r.toMessage())}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=me(this._lastAvailableFields,e);return this._lastAvailableFields=t,V(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[E(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||u.getLogger(this).error(e)});this._updatingHandles.consumePromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function E(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let l=i?.toJSON()??null;return s.size&&(l??=(new U).toJSON(),l.hiddenIds=Array.from(s)),l}return e([b()],_.prototype,"_commandsQueue",void 0),e([b()],_.prototype,"_sourceRefreshVersion",void 0),e([b()],_.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],_.prototype,"_pipelineUpdating",void 0),e([b()],_.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],_.prototype,"dataUpdating",null),e([b({readOnly:!0})],_.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],_.prototype,"hasFullGeometries",null),e([b()],_.prototype,"featureEffectView",void 0),e([b()],_.prototype,"layerAdapter",null),e([b({readOnly:!0})],_.prototype,"timeExtent",null),_=e([S("esri.views.2d.layers.FeatureLikeLayerView2D")],_),_};export{ve as FeatureLikeLayerView2D};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as n,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as c}from"../../../core/object.js";import{createAbortError as p,ignoreAbortErrors as d,throwIfNotAbortError as y,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as g,sync as f}from"../../../core/reactiveUtils.js";import{isScreenRect as w}from"../../../core/screenUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/units.js";import{property as b,subclass as S}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{fromJSON as j}from"../../../geometry/support/jsonUtils.js";import x from"../../../geometry/support/rotate.js";import{isCurvedGeometry as R}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as E}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import I from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as k}from"../../../layers/graphics/featureConversionUtils.js";import O from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as U}from"../../../layers/support/featureLayerUtils.js";import{packFields as V}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as C}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as Q}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import M from"../../../rest/support/AttributeBinsFeatureSet.js";import P from"../../../rest/support/AttributeBinsQuery.js";import H from"../../../rest/support/FeatureSet.js";import L from"../../../rest/support/Query.js";import{HittestDrawHelper as T}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{symbolToCIM as W}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as D}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as G}from"./LayerView2D.js";import{FeatureContainer as N}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as J}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as z}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as B}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as Z}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as K}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as $}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as X}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as Y}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as ee}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as te}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as re}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as se}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as ie}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as ae}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as oe}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ne}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as le}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as ue}from"./support/handleNoEngineError.js";import{toJSONGeometryType as he}from"./support/util.js";import{getMapPointsFromScreen as ce}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as pe}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as de}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ye}from"../../support/highlightOptionsUtils.js";function me(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ge=4294967294;function fe(e,t){return l(e.map(e=>g(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t,f)))}function we(e){if(!e.geometry)return e;if(!R(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:E(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}const ve=l=>{const f=de(G(l));let _=class extends f{constructor(){super(...arguments),this._commandsQueue=new le({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this._stationaryRotation=0,this.eventLog=new z,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new I}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(p()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===C(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await J(t)}async _attachProxy(){const e=x(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(p()),y(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get layerAdapter(){switch(this.layer.type){case"annotation-feature":return new B(this.layer);case"dimension-feature":return new K(this.layer);case"feature":return"memory"===this.layer.source.type?new Y(this.layer):new $(this.layer);case"geojson":case"csv":case"wfs":return new Y(this.layer);case"parquet":return new se(this.layer);case"subtype-group":return new ae(this.layer);case"ogc-feature":return new te(this.layer);case"stream":return new ie(this.layer);case"oriented-imagery":return new re(this.layer);case"knowledge-graph-sublayer":return new ee(this.layer);case"catalog-footprint":return new Z(this.layer);default:this.layer}return null}get timeExtent(){return Q(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return n();const l=ye(t);return this._addHighlights(o,l),n(()=>!this.destroyed&&this._removeHighlights(o,l))}async hitTest(e,i){const a=w(i),{trueHitIds:o,candidateHitIds:n}=await this.featureContainer.hitTest(i),l=await this.getWorker(),[u,h]=await Promise.all([l.pipeline.getDisplayFeatures(n),l.pipeline.getDisplayFeatures(o)]),{features:c,aggregates:p,tracks:d}=u,{features:y,aggregates:g,tracks:f}=h,v=[];if(a&&this.hasRenderer()){const e=new Map,t=new r;for(const r of c){t.attributes=r.attributes,t.geometry=j(r.geometry),t.symbol=null;const s=this.layerAdapter.getRenderer(t);if(!s){v.push(r);continue}const i=await D(t,{renderer:s,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:"2d",timeZone:this.view.timeZone});if(!i)continue;let a=null;const o=W(i);if("web-style"===o.type)try{const e=W(await o.fetchSymbol({acceptedFormats:["cim","web"]}));a="web-style"===e.type?null:e}catch(x){m(x),0;continue}else a=o;const n=a?.symbol;if(!n)continue;const l=this.view.stage.cimAnalyzer.analyzeSymbolReference(a,!1).some(e=>"alignment"in e&&0===e.alignment);e.set(r,{cimSymbol:n,isScreenAligned:l})}e.size>0&&!this._hittestDrawHelper&&(this._hittestDrawHelper=new T(this.view.stage.painter.textureManager.resourceManager));const{resolution:s,rotation:a}=this.view.state,o=ce(this.view,i);for(const[r,{cimSymbol:i,isScreenAligned:n}]of e){if(!r)continue;const e={hittestType:"rect",textInfo:null,mapRotation:a,resolution:s,searchDist:0,isScreenAligned:n};this._hittestDrawHelper.hitTest(o,i,r.geometry,e)&&v.push(r)}}else v.push(...c);const _=[...y,...v],b=[...g,...p],S=[...f,...d],A=this.featureContainer.getSortKeys(_.map(e=>e.displayId)),F=({displayId:e},{displayId:t})=>A.has(e)&&A.has(t)?A.get(e)-A.get(t):e-t;return _.sort(F).reverse(),b.sort(F).reverse(),[...b.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...S.map(t=>this._createTrackGraphicHit(e,s.fromJSON(t))),..._.map(t=>this._createFeatureGraphicHit(a?null:e,r.fromJSON(t)))]}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return ue(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return ue(r,0)}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return ue(r,[])}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return ue(r,{features:[]})}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await ue(r,{features:[]});return M.fromJSON(s)}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await ue(r,{features:[]}),i=q.fromJSON(s);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await ue(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return ue(r,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=H.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return ue(r,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return ue(r,[])}async queryStatistics(){const e=await this.getWorker();return ue(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return ue(a,{})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await ue(r,{features:[]}),i=H.fromJSON(s);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.featureContainer.getPresenting(),r=this._subscriptions.update(e.targetState,this._lastTargetState,t);r&&(this.featureContainer.updateSubscriptions(r),d(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(r))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),d(this._updatingHandles.addPromise(this._workerAttached.promise)),d(this._attachProxy()),this.featureContainer=new N(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new pe(this.view.featuresTilingScheme),this._stationaryRotation=this.view.rotation,this.requestUpdate(),this.addAttachHandles([fe([()=>this._displayRefreshVersion,()=>"displayFilterInfo"in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,e=>{if(!e)return;const t=this.view.rotation;t!==this._stationaryRotation&&(this._stationaryRotation=t,this._update()),this.getWorker().then(e=>{if(this.destroyed)return;const t=x(this.view.extent,this.view.rotation,this.view.center);return e.pipeline.updateStationaryExtent(t.toJSON(),this.featureContainer.requiresRefresh)}).catch(()=>{})})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=h(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}onProxyClientEvent(e){}hasRenderer(){return"renderer"in this.layer&&null!=this.layer.renderer}isUpdating(){const e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updating;return this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){const e=this;return{updateSchemaStart:()=>e.updateSchemaStart(),updateSchemaEnd:t=>e.updateSchemaEnd(t),openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},openGlyphPorts:async()=>{const t=await e.container.stage.textureManager.openMessagePorts();return{result:t,transferList:t}},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!("renderer"in this.layer)||!this.layer.renderer||"dictionary"!==this.layer.renderer.type)throw new Error("InternalError: Expected renderer to be of type 'dictionary'");const t=this.layer.renderer,r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression,viewRotation:this._stationaryRotation};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=he(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await oe({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}async _fetchMeshRequest(e){const{layer:t}=this;try{const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null,viewRotation:this._stationaryRotation};this._fields||(this._fields=t.fields.map(e=>e.toJSON()));return{type:"mesh-response",meshes:await oe({...e.symbolReference,hasTextStringTemplates:!0},{path:"anno-like",schemaOptions:r,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch(r){return{type:"mesh-response",meshes:[]}}}_cleanUpQuery(e){const t=L.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),"returnZ"in this.layer&&(t.returnZ??=this.layer.returnZ),"returnM"in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=P.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=L.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ge+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ge+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?u.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=he(this.layer.geometryType),i=X(this.layer),a=[];for(const n of e.added){const e=k(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=k(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),l=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:l,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){const e=this.layer;"featureReduction"in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),U(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;const t=this.featureContainer.updateStart("subtype-group"===e.type);this._lastFeatureEffect=this.featureEffect;const r={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0,viewRotation:this._stationaryRotation},s=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)};return c(this._lastSchema?.source.strategy,i.source.strategy)||c(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch(t){}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.updateEnd")}catch(t){}}async _doUpdate(){const e=Math.round(performance.now()),t=await this.getWorker();await t.pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){const t=await this.getWorker();try{let r=new ne;for(const s of e.messages)switch(s.type){case"edit":r.tryAdd(await this._resolveEdit(s.event))||(await t.pipeline.onOverride(r.toMessage()),r=new ne,r.tryAdd(await this._resolveEdit(s.event)));break;case"override":r.tryAdd(this._resolveOverrides(s.options))||(await t.pipeline.onOverride(r.toMessage()),r=new ne,r.tryAdd(this._resolveOverrides(s.options)));break}await t.pipeline.onOverride(r.toMessage())}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=me(this._lastAvailableFields,e);return this._lastAvailableFields=t,V(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[R(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||u.getLogger(this).error(e)});this._updatingHandles.consumePromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function R(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new O,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new O,i.where=v(i.where,a));let l=i?.toJSON()??null;return s.size&&(l??=(new O).toJSON(),l.hiddenIds=Array.from(s)),l}return e([b()],_.prototype,"_commandsQueue",void 0),e([b()],_.prototype,"_sourceRefreshVersion",void 0),e([b()],_.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],_.prototype,"_pipelineUpdating",void 0),e([b()],_.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],_.prototype,"dataUpdating",null),e([b({readOnly:!0})],_.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],_.prototype,"hasFullGeometries",null),e([b()],_.prototype,"featureEffectView",void 0),e([b()],_.prototype,"layerAdapter",null),e([b({readOnly:!0})],_.prototype,"timeExtent",null),_=e([S("esri.views.2d.layers.FeatureLikeLayerView2D")],_),_};export{ve as FeatureLikeLayerView2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{isAbortError as n}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as c}from"../../../core/reactiveUtils.js";import{isScreenRect as p}from"../../../core/screenUtils.js";import{property as h,subclass as d}from"../../../core/accessorSupport/decorators.js";import u from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as f}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import S from"../engine/webgl/OverlayContainer.js";import{LayerView2D as E}from"./LayerView2D.js";import{getMapPointsFromScreen as T}from"../support/hitTestUtils.js";import R from"../../layers/MediaLayerView.js";import{TaskPriority as U}from"../../support/Scheduler.js";let G=class extends(E(R)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([c(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),c(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:U.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],o=p(t);for(const{elementView:{normalizedCoords:n,element:l}}of this._elementReferences.values())if(o){const r=T(this.view,t).map(e=>[e.x,e.y]);null!=n&&y(r,n.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=n&&f(n.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{n(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(C,e,!0);const r=new u({xmin:C[0],ymin:C[1],xmax:C[2],ymax:C[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){o(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const r=[],s=[];for(const e of this._tileStrategy.tiles){const o=q(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||s.push(e):o&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){q(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([h({readOnly:!0})],G.prototype,"elements",void 0),G=e([d("esri.views.2d.layers.MediaLayerView2D")],G);const C=g(),V={xmin:0,ymin:0,xmax:0,ymax:0};function q(e,t,i){return e.getTileBounds(C,t.key,!0),V.xmin=C[0],V.ymin=C[1],V.xmax=C[2],V.ymax=C[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=G;export{M as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as h}from"../../../core/reactiveUtils.js";import{isScreenRect as p}from"../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../core/accessorSupport/decorators.js";import u from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as f}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../Viewpoint.js";import"../../../core/mathUtils.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../../../geometry/support/normalizeUtils.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/Tile.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import S from"../engine/webgl/OverlayContainer.js";import{LayerView2D as E}from"./LayerView2D.js";import{getMapPointsFromScreen as T}from"../support/hitTestUtils.js";import R from"../../layers/MediaLayerView.js";import{TaskPriority as G}from"../../support/Scheduler.js";let U=class extends(E(R)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([h(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),h(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:G.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],n=p(t);for(const{elementView:{normalizedCoords:o,element:l}}of this._elementReferences.values())if(n){const r=T(this.view,t).map(e=>[e.x,e.y]);null!=o&&y(r,o.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=o&&f(o.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(q,e,!0);const r=new u({xmin:q[0],ymin:q[1],xmax:q[2],ymax:q[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){n(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const r=[],s=[];for(const e of this._tileStrategy.tiles){const n=C(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?n||s.push(e):n&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){C(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([c({readOnly:!0})],U.prototype,"elements",void 0),U=e([d("esri.views.2d.layers.MediaLayerView2D")],U);const q=g(),V={xmin:0,ymin:0,xmax:0,ymax:0};function C(e,t,i){return e.getTileBounds(q,t.key,!0),V.xmin=q[0],V.ymin=q[1],V.xmax=q[2],V.ymax=q[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=U;export{M as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as h,subclass as a}from"../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../../../core/has.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"
|
|
2
|
+
import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as h,subclass as a}from"../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../../../core/has.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../Viewpoint.js";import"../../../core/Collection.js";import"../../../core/mathUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../../../geometry/support/normalizeUtils.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/Tile.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2D as c}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as u}from"./support/imageUtils.js";import d from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import j from"../../layers/LayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as T}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as V}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as v}from"../../support/drapedUtils.js";import{getHighlightName as U}from"../../support/highlightOptionsUtils.js";import{TaskPriority as q}from"../../support/Scheduler.js";const H=[0,0];let I=class extends(_(n(c(j)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new d(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:q.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new V({createFetchPopupFeaturesQueryGeometry:(e,i)=>v(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtTarget(e,i,t){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtTarget(i,t):[]}highlight(e,t){const s=T(e);if(0===s.length)return i();const r=U(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return o(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(H,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(h){if(s(h))throw h;if(!this.resampling)return m(this._tileInfoView.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new f(t),h=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return u(this._tileInfoView,h,s,e)}}return m(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:h,resamplingLevel:a=0}=i,o=new f(0,0,0,0);let l,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:h}),!this.resampling&&o.level!==e.level)return await r(i),m(this._tileInfoView.size);l=await this._fetchImage(o,h)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&a<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){o.set(t);try{l=await this._fetchTileWithTilemapCache(o,{...i,resamplingLevel:a+1})}catch{}}}}return l?this.resampling?u(this._tileInfoView,l,o,e):l:m(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate()),e.once("isReady",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i}).then(({bitmap:e})=>e)}};e([h()],I.prototype,"resampling",null),e([h()],I.prototype,"tilemapCache",null),I=e([a("esri.views.2d.layers.TileLayerView2D")],I);const G=I;export{G as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as t,sqlNotIn as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as a}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as l}from"./floorFilterUtils.js";import{getServiceGeometryType as n}from"./geometryUtils.js";import{ExceedsLimitCache as u}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{getSortKey as y}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as m}from"../schema/processor/StorageSchema.js";import{getAnnotationMatcherSchema as d}from"../../support/annodime/annotationSchema.js";class h{constructor(e){this.layer=e,this._cache=new u}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,a=!s&&i,o=p("isSourceHosted"in r&&r.isSourceHosted,a,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);return c(r,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{objectIdField:s,symbolCollection:i,referenceScale:a}=this.layer,o=await d(i,{cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null}),l=y(null,null,s);return{storage:m(null,t.filters),mesh:{properties:{sortKey:l,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:o,labels:{type:"label",classes:[]},referenceScale:a}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e,s){e=o(this.layer,e,s),this.layer.unplacedAnnotationsVisible||(e??=new i,e.where=t(e?.where,`${this.layer.statusField} = 0`));const a=this.layer.sublayers.filter(e=>!e.visible).map(e=>e.subtypeCode);if(!a.length)return e;e??=new i;const l=r(this.layer.subtypeField,a.toArray());return e.where=t(e.where,l),e}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.unplacedAnnotationsVisible,()=>l(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields,()=>this.layer.sublayers.map(({visible:e})=>({visible:e}))]}getRenderer(){return null}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=this.layer,e.origin=t?.graphicOrigin??this.layer.graphicOrigin}_createServiceInfo(t){const r=this.layer,{capabilities:i,editingInfo:o,globalIdField:l,datesInUnknownTimezone:u,dateFieldsTimeZone:p,subtypeField:c}=r,y=n(r),m=r.timeInfo?.toJSON(),d=r.spatialReference.toJSON(),h=e(this.layer.parsedUrl),f=this.layer.objectIdField,g=s(h.path),b=t.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:f,outSpatialReference:b,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:p,subtypeField:c,globalIdField:l,fieldsIndex:r.fieldsIndex.toJSON(),geometryType:y,featureIdInfo:a(r),timeInfo:m,spatialReference:d,outSpatialReference:b,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:r.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:i.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:i.query.maxRecordCount,tileMaxRecordCount:i.query.tileMaxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:i.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:i.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:i.query.supportsReturnExceededLimitGeometries}}}}export{h as AnnotationLayerAdapter};
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as t,sqlNotIn as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as a}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as l}from"./floorFilterUtils.js";import{getServiceGeometryType as n}from"./geometryUtils.js";import{ExceedsLimitCache as u}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{getSortKey as y}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as m}from"../schema/processor/StorageSchema.js";import{getAnnotationMatcherSchema as d}from"../../support/annodime/annotationSchema.js";class h{constructor(e){this.layer=e,this._cache=new u}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,a=!s&&i,o=p("isSourceHosted"in r&&r.isSourceHosted,a,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);return c(r,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{objectIdField:s,symbolCollection:i,referenceScale:a}=this.layer,o=await d(i,{cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null,viewRotation:e.viewRotation}),l=y(null,null,s);return{storage:m(null,t.filters),mesh:{properties:{sortKey:l,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:o,labels:{type:"label",classes:[]},referenceScale:a}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e,s){e=o(this.layer,e,s),this.layer.unplacedAnnotationsVisible||(e??=new i,e.where=t(e?.where,`${this.layer.statusField} = 0`));const a=this.layer.sublayers.filter(e=>!e.visible).map(e=>e.subtypeCode);if(!a.length)return e;e??=new i;const l=r(this.layer.subtypeField,a.toArray());return e.where=t(e.where,l),e}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.unplacedAnnotationsVisible,()=>l(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields,()=>this.layer.sublayers.map(({visible:e})=>({visible:e}))]}getRenderer(){return null}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=this.layer,e.origin=t?.graphicOrigin??this.layer.graphicOrigin}_createServiceInfo(t){const r=this.layer,{capabilities:i,editingInfo:o,globalIdField:l,datesInUnknownTimezone:u,dateFieldsTimeZone:p,subtypeField:c}=r,y=n(r),m=r.timeInfo?.toJSON(),d=r.spatialReference.toJSON(),h=e(this.layer.parsedUrl),f=this.layer.objectIdField,g=s(h.path),b=t.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:f,outSpatialReference:b,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:p,subtypeField:c,globalIdField:l,fieldsIndex:r.fieldsIndex.toJSON(),geometryType:y,featureIdInfo:a(r),timeInfo:m,spatialReference:d,outSpatialReference:b,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:r.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:i.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:i.query.maxRecordCount,tileMaxRecordCount:i.query.tileMaxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:i.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:i.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:i.query.supportsReturnExceededLimitGeometries}}}}export{h as AnnotationLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";class p{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);return o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{objectIdField:s,referenceScale:i,styleCollection:a}=this.layer,o=await c(a,{cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null}),p=n(null,null,s);return{storage:l(null,t.filters),mesh:{properties:{sortKey:p,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:o,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,{capabilities:o,editingInfo:n,globalIdField:l,datesInUnknownTimezone:c,dateFieldsTimeZone:p,subtypeField:u}=a,m=s(a),y=a.timeInfo?.toJSON(),d=a.spatialReference.toJSON(),h=e(this.layer.parsedUrl),f=this.layer.objectIdField,g=t(h.path),S=i.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:f,outSpatialReference:S,metadata:{timeReferenceUnknownClient:c,dateFieldsTimeZone:p,subtypeField:u,globalIdField:l,fieldsIndex:a.fieldsIndex.toJSON(),geometryType:m,featureIdInfo:r(a),timeInfo:y,spatialReference:d,outSpatialReference:S,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:a.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:o.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:o.query.maxRecordCount,tileMaxRecordCount:o.query.tileMaxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:n?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:o.query.supportsReturnExceededLimitGeometries}}}}export{p as DimensionLayerAdapter};
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";class p{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);return o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{objectIdField:s,referenceScale:i,styleCollection:a}=this.layer,o=await c(a,{cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null,viewRotation:e.viewRotation}),p=n(null,null,s);return{storage:l(null,t.filters),mesh:{properties:{sortKey:p,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:o,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,{capabilities:o,editingInfo:n,globalIdField:l,datesInUnknownTimezone:c,dateFieldsTimeZone:p,subtypeField:u}=a,m=s(a),y=a.timeInfo?.toJSON(),d=a.spatialReference.toJSON(),h=e(this.layer.parsedUrl),f=this.layer.objectIdField,g=t(h.path),S=i.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:f,outSpatialReference:S,metadata:{timeReferenceUnknownClient:c,dateFieldsTimeZone:p,subtypeField:u,globalIdField:l,fieldsIndex:a.fieldsIndex.toJSON(),geometryType:m,featureIdInfo:r(a),timeInfo:y,spatialReference:d,outSpatialReference:S,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:a.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:o.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:o.query.maxRecordCount,tileMaxRecordCount:o.query.tileMaxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:n?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:o.query.supportsReturnExceededLimitGeometries}}}}export{p as DimensionLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../../../core/Logger.js";import{CIMSymbolHelper as a}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as i}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as n}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{getMaxSizeVVSize as l,noVisualVariables as t}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as o,hasSizeVVUniform as r}from"./utils.js";function s(a,i){if(a&&i){const n=a.toLowerCase(),l=i.get(n);if(void 0!==l)return{name:n,index:l};e.getLogger("esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema").warn(`Invalid symbol layer name: "${a}"`)}return null}function c(e,a){if(a?.enabled&&a.drawOrder){const i=a.drawOrder.map(e=>e.toLowerCase()).slice().reverse(),n=new Map;for(const a of e)if(a.groupName&&a.name){const e=a.name.toLowerCase(),l=a.groupName.toLowerCase(),t=i.indexOf(l);-1!==t&&(n.has(t)||n.set(t,[]),n.get(t).push(e))}const l=[];i.forEach((e,a)=>{n.has(a)?l.push(...n.get(a)):l.push(e)});const t=new Map;return l.forEach((e,a)=>{t.set(e,a)}),t}return null}function u(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function f(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,n,l]=e;return[a,i,n,255*l]}return"string"==typeof e?e:{...e,defaultValue:f(e?.defaultValue)}}async function m(e,i){const{cimResourceManager:n,cimAnalyzer:l,scaleExpression:t,symbolLayerDrawing:o}=i.schemaOptions;await a.normalizeSymbolAndFetchResources(e.symbol,n);const r=l.analyzeSymbolReference(e,!1),s=u(e),f=c(r,o),m={scaleInfo:s,scaleExpression:t,rotationVariable:i.rotationVariable??null,layerOrderMap:f},S=[];for(const a of r)switch(a.type){case"marker":S.push(...p(a,i,m));break;case"fill":S.push(...g(a,i,m));break;case"outlineFill":S.push(...d(a,i,m));break;case"gradientFill":S.push(...I(a,i,m));break;case"line":S.push(...O(a,i,m));break;case"gradientStroke":S.push(...k(a,i,m));break;case"text":S.push(...A(a,i,m))}return S}function p(e,a,i){const{uniforms:l,schemaOptions:o}=a,{store:r}=o,{layerOrderMap:c}=i,u=e.isOutline?{...t,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops}:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,l=a?n.animatedMarkerShift:n.animatedMarker;return S(r.ensureInstance(l,{uniforms:u,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}},s(e.name,c)),e,t,i)}return V(r.ensureInstance(n.marker,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,c)),e,l,i)}function S(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:o(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:1===a.alignment,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function b(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:o(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2,angle:"angle"in a?a.angle:0})]}function V(e,a,n,{scaleInfo:t,scaleExpression:o}){const s=r(n);return[e.createMeshInfo({size:a.size,scaleX:a.scaleX,anchorX:a.anchorPoint.x,anchorY:a.anchorPoint.y,angle:a.rotation,color:f(a.color)??[0,0,0,0],colorLocked:a.colorLocked,frameHeight:a.frameHeight,widthRatio:a.widthRatio,scaleInfo:t,offsetX:a.offsetX,offsetY:a.offsetY,outlineColor:f(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineWidth,referenceSize:a.referenceSize||i.CIMVectorMarker.size,rotateClockwise:a.rotateClockwise,scaleFactor:o??1,sizeRatio:a.sizeRatio,alignment:a.alignment,isAbsoluteAnchorPoint:a.isAbsoluteAnchorPoint,scaleSymbolsProportionally:a.scaleSymbolsProportionally,sprite:a.spriteRasterizationParam,hasSizeVV:s,placement:a.markerPlacement,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,transforms:a.transform,minPixelBuffer:l(n)})]}function h(e,a,i){const{uniforms:l,schemaOptions:o}=a,{store:r}=o,{layerOrderMap:c}=i,u={visualVariableColor:e.colorLocked?null:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity};if(e.animationParams){const a=n.animatedFill;return b(r.ensureInstance(a,{uniforms:{...u,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},s(e.name,c)),e,t,i)}return v(r.ensureInstance(n.fill,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,c)),e,i)}function d(e,a,i){const{uniforms:l,schemaOptions:t}=a,{store:o}=t,{layerOrderMap:r}=i;return z(o.ensureInstance(n.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,r)),e,i)}function z(e,a,i){const n=f(a.color)??[0,0,0,0],l=f(a.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:n,outlineColor:l,width:a.outlineWidth,referenceWidth:a.referenceWidth,capType:a.cap,joinType:a.join,miterLimit:a.miterLimit,outlineUsesColorVV:!a.outlineColorLocked,hasSizeVV:!1,scaleInfo:i.scaleInfo,...P(!!a.effects?.length,i.rotationVariable),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,outlineEffects:a.outlineEffects?{type:"cim-effect-infos",effectInfos:a.outlineEffects}:null})]}function v(e,a,{scaleInfo:i,rotationVariable:n}){return[e.createMeshInfo({color:f(a.color)??[0,0,0,0],scaleInfo:i,...P(!!a.effects?.length,n),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function g(e,a,i){const{layerOrderMap:l}=i;if(!e.spriteRasterizationParam)return h(e,a,i);const{uniforms:o,schemaOptions:r}=a,{store:c}=r,u={visualVariableColor:e.colorLocked?null:o.visualVariableColor,visualVariableOpacity:o.visualVariableOpacity};if(e.animationParams){const a=n.animatedFill;return b(c.ensureInstance(a,{uniforms:{...u,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},s(e.name,l)),e,t,i)}return y(c.ensureInstance(n.complexFill,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,l)),e,null!=o.visualVariableColor,i)}function y(e,a,i,{scaleInfo:n}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),t=a.sampleAlphaOnly&&!l,o=a.spriteRasterizationParam;return[e.createMeshInfo({color:f(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:t,scaleProportionally:"CIMHatchFill"===o.resource.type,sprite:o,scaleInfo:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function I(e,a,i){const{uniforms:l,schemaOptions:t}=a,{store:o}=t,{layerOrderMap:r}=i;return M(o.ensureInstance(n.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,r)),e,i)}function M(e,a,{scaleInfo:i}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=a.spriteRasterizationParam;return[e.createMeshInfo({color:f(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:n,scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function O(e,a,i){const{uniforms:l,schemaOptions:o}=a,{store:r}=o,{layerOrderMap:c}=i,u=e.isOutline?{...t,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,l=n.animatedLine;return b(r.ensureInstance(l,{uniforms:{...u,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a,angle:!1}},s(e.name,c)),e,t,i)}const f={uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},m=!!(u.visualVariableSizeMinMaxValue||u.visualVariableSizeScaleStops||u.visualVariableSizeStops||u.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return C(r.ensureInstance(n.line,f,s(e.name,c)),e,m,i)}return L(r.ensureInstance(n.texturedLine,f,s(e.name,c)),e,m,i)}function R(e,a,{scaleInfo:i,rotationVariable:n}){return{color:f(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:a,...P(!!e.effects?.length,n),effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function P(e,a){if(!e||!a)return{};const i=a.valueExpression??(a.field?`$feature[${JSON.stringify(a.field)}]`:null);return i?{effectRotation:{valueExpressionInfo:{type:"CIMExpressionInfo",expression:i},defaultValue:0},effectRotationType:a.rotationType}:{}}function C(e,a,i,n){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const l=R(a,i,n);return[e.createMeshInfo(l)]}function L(e,a,i,n){const{spriteRasterizationParam:l,scaleDash:t,sampleAlphaOnly:o}=a;if(!l)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...R(a,i,n),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:t??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==l.resource.type&&"CIMGradientStroke"!==l.resource.type,sprite:l})]}function k(e,a,i){const{uniforms:l,schemaOptions:o}=a,{store:r}=o,{layerOrderMap:c}=i;return x(r.ensureInstance(n.gradientStroke,{uniforms:e.isOutline?{...t,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,c)),e,i)}function x(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=a.spriteRasterizationParam;return[e.createMeshInfo({...R(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function A(e,a,i){const{uniforms:l,schemaOptions:t}=a,{store:o}=t,{layerOrderMap:r}=i;return w(o.ensureInstance(n.text,{uniforms:{visualVariableColor:e.colorLocked?null:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableRotation:l.visualVariableRotation,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1,visibility:!1}},s(e.name,r)),e,l,i)}function w(e,a,i,{scaleInfo:n,scaleExpression:t}){return[e.createMeshInfo({alignment:a.alignment,boxBackgroundColor:f(a.backgroundColor),boxBorderLineColor:f(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:f(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:f(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:f(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:t??1,minPixelBuffer:l(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{S as createAnimatedMarkerMeshInfos,b as createAnimatedPolyMeshInfos,y as createComplexFillMeshInfos,V as createComplexMarkerMeshInfos,v as createComplexSimpleFillMeshInfos,C as createComplexSimpleLineMeshInfos,z as createComplexSimpleOutlineFillMeshInfos,m as createComplexSymbolInstances,w as createComplexTextMeshInfos,L as createComplexTexturedLineMeshInfos,M as createGradientFillMeshInfos,x as createGradientStrokeMeshInfos,u as getScaleInfo};
|
|
2
|
+
import e from"../../../../../../../core/Logger.js";import{CIMSymbolHelper as a}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as i}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as n}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{getMaxSizeVVSize as t,noVisualVariables as l}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as o,hasSizeVVUniform as r}from"./utils.js";function s(a,i){if(a&&i){const n=a.toLowerCase(),t=i.get(n);if(void 0!==t)return{name:n,index:t};e.getLogger("esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema").warn(`Invalid symbol layer name: "${a}"`)}return null}function c(e,a){if(a?.enabled&&a.drawOrder){const i=a.drawOrder.map(e=>e.toLowerCase()).slice().reverse(),n=new Map;for(const a of e)if(a.groupName&&a.name){const e=a.name.toLowerCase(),t=a.groupName.toLowerCase(),l=i.indexOf(t);-1!==l&&(n.has(l)||n.set(l,[]),n.get(l).push(e))}const t=[];i.forEach((e,a)=>{n.has(a)?t.push(...n.get(a)):t.push(e)});const l=new Map;return t.forEach((e,a)=>{l.set(e,a)}),l}return null}function u(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function f(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,n,t]=e;return[a,i,n,255*t]}return"string"==typeof e?e:{...e,defaultValue:f(e?.defaultValue)}}async function m(e,i){const{cimResourceManager:n,cimAnalyzer:t,scaleExpression:l,symbolLayerDrawing:o}=i.schemaOptions,r=e.symbol;if(null==r)return[];await a.normalizeSymbolAndFetchResources(r,n);const s=t.analyzeSymbolReference(e,!1),f=u(e),m=c(s,o),S="CIMPointSymbol"===r.type&&"Map"!==r.angleAlignment?i.schemaOptions.viewRotation:null,b={scaleInfo:f,scaleExpression:l,rotationVariable:i.rotationVariable??null,viewRotation:S,layerOrderMap:m},V=[];for(const a of s)switch(a.type){case"marker":V.push(...p(a,i,b));break;case"fill":V.push(...g(a,i,b));break;case"outlineFill":V.push(...d(a,i,b));break;case"gradientFill":V.push(...I(a,i,b));break;case"line":V.push(...R(a,i,b));break;case"gradientStroke":V.push(...L(a,i,b));break;case"text":V.push(...x(a,i,b))}return V}function p(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o,{layerOrderMap:c}=i,u=e.isOutline?{...l,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,t=a?n.animatedMarkerShift:n.animatedMarker;return S(r.ensureInstance(t,{uniforms:u,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}},s(e.name,c)),e,l,i)}return V(r.ensureInstance(n.marker,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,c)),e,t,i)}function S(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:o(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:1===a.alignment,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function b(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:o(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2,angle:"angle"in a?a.angle:0})]}function V(e,a,n,{scaleInfo:l,scaleExpression:o}){const s=r(n);return[e.createMeshInfo({size:a.size,scaleX:a.scaleX,anchorX:a.anchorPoint.x,anchorY:a.anchorPoint.y,angle:a.rotation,color:f(a.color)??[0,0,0,0],colorLocked:a.colorLocked,frameHeight:a.frameHeight,widthRatio:a.widthRatio,scaleInfo:l,offsetX:a.offsetX,offsetY:a.offsetY,outlineColor:f(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineWidth,referenceSize:a.referenceSize||i.CIMVectorMarker.size,rotateClockwise:a.rotateClockwise,scaleFactor:o??1,sizeRatio:a.sizeRatio,alignment:a.alignment,isAbsoluteAnchorPoint:a.isAbsoluteAnchorPoint,scaleSymbolsProportionally:a.scaleSymbolsProportionally,sprite:a.spriteRasterizationParam,hasSizeVV:s,placement:a.markerPlacement,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,transforms:a.transform,minPixelBuffer:t(n)})]}function h(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o,{layerOrderMap:c}=i,u={visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity};if(e.animationParams){const a=n.animatedFill;return b(r.ensureInstance(a,{uniforms:{...u,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},s(e.name,c)),e,l,i)}return v(r.ensureInstance(n.fill,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,c)),e,i)}function d(e,a,i){const{uniforms:t,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return z(o.ensureInstance(n.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,r)),e,i)}function z(e,a,i){const n=f(a.color)??[0,0,0,0],t=f(a.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:n,outlineColor:t,width:a.outlineWidth,referenceWidth:a.referenceWidth,capType:a.cap,joinType:a.join,miterLimit:a.miterLimit,outlineUsesColorVV:!a.outlineColorLocked,hasSizeVV:!1,scaleInfo:i.scaleInfo,...P(!!a.effects?.length||!!a.outlineEffects?.length,i.rotationVariable,i.viewRotation),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,outlineEffects:a.outlineEffects?{type:"cim-effect-infos",effectInfos:a.outlineEffects}:null})]}function v(e,a,{scaleInfo:i,rotationVariable:n,viewRotation:t}){return[e.createMeshInfo({color:f(a.color)??[0,0,0,0],scaleInfo:i,...P(!!a.effects?.length,n,t),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function g(e,a,i){const{layerOrderMap:t}=i;if(!e.spriteRasterizationParam)return h(e,a,i);const{uniforms:o,schemaOptions:r}=a,{store:c}=r,u={visualVariableColor:e.colorLocked?null:o.visualVariableColor,visualVariableOpacity:o.visualVariableOpacity};if(e.animationParams){const a=n.animatedFill;return b(c.ensureInstance(a,{uniforms:{...u,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},s(e.name,t)),e,l,i)}return y(c.ensureInstance(n.complexFill,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,t)),e,null!=o.visualVariableColor,i)}function y(e,a,i,{scaleInfo:n,rotationVariable:t,viewRotation:l}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const o=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),r=a.sampleAlphaOnly&&!o,s=a.spriteRasterizationParam;return[e.createMeshInfo({color:f(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:r,scaleProportionally:"CIMHatchFill"===s.resource.type,sprite:s,scaleInfo:n,...P(!!a.effects?.length,t,l),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function I(e,a,i){const{uniforms:t,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return M(o.ensureInstance(n.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:t.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,r)),e,i)}function M(e,a,{scaleInfo:i,rotationVariable:n,viewRotation:t}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({color:f(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,scaleInfo:i,...P(!!a.effects?.length,n,t),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function R(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o,{layerOrderMap:c}=i,u=e.isOutline?{...l,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,t=n.animatedLine;return b(r.ensureInstance(t,{uniforms:{...u,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a,angle:!1}},s(e.name,c)),e,l,i)}const f={uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},m=!!(u.visualVariableSizeMinMaxValue||u.visualVariableSizeScaleStops||u.visualVariableSizeStops||u.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return C(r.ensureInstance(n.line,f,s(e.name,c)),e,m,i)}return w(r.ensureInstance(n.texturedLine,f,s(e.name,c)),e,m,i)}function O(e,a,{scaleInfo:i,rotationVariable:n,viewRotation:t}){return{color:f(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:a,...P(!!e.effects?.length,n,t),effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function P(e,a,i){if(!e)return{};const n={};if(null!=i&&(n.viewRotation=i),!a)return n;const t=a.valueExpression??(a.field?`$feature[${JSON.stringify(a.field)}]`:null);return t?(n.effectRotation={valueExpressionInfo:{type:"CIMExpressionInfo",expression:t},defaultValue:0},n.effectRotationType=a.rotationType,n):n}function C(e,a,i,n){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=O(a,i,n);return[e.createMeshInfo(t)]}function w(e,a,i,n){const{spriteRasterizationParam:t,scaleDash:l,sampleAlphaOnly:o}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...O(a,i,n),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:l??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function L(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o,{layerOrderMap:c}=i;return k(r.ensureInstance(n.gradientStroke,{uniforms:e.isOutline?{...l,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo}},s(e.name,c)),e,i)}function k(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=a.spriteRasterizationParam;return[e.createMeshInfo({...O(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function x(e,a,i){const{uniforms:t,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return A(o.ensureInstance(n.text,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1,visibility:!1}},s(e.name,r)),e,t,i)}function A(e,a,i,{scaleInfo:n,scaleExpression:l}){return[e.createMeshInfo({alignment:a.alignment,boxBackgroundColor:f(a.backgroundColor),boxBorderLineColor:f(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:f(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:f(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:f(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:l??1,minPixelBuffer:t(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{S as createAnimatedMarkerMeshInfos,b as createAnimatedPolyMeshInfos,y as createComplexFillMeshInfos,V as createComplexMarkerMeshInfos,v as createComplexSimpleFillMeshInfos,C as createComplexSimpleLineMeshInfos,z as createComplexSimpleOutlineFillMeshInfos,m as createComplexSymbolInstances,A as createComplexTextMeshInfos,w as createComplexTexturedLineMeshInfos,M as createGradientFillMeshInfos,k as createGradientStrokeMeshInfos,u as getScaleInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{DisplayObject as t}from"../../engine/DisplayObject.js";import{DebugOverlayTechnique as i}from"../../engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js";class s extends t{constructor(e){super(),this._config=e,this._technique=new i}static makeFlags(e,t){return e|t<<2}_createTransforms(){return{displayViewScreenMat3:e()}}doRender(e){1===e.drawPhase&&this._technique.render(e,{mesh:this._config.getMesh(e),colors:this._config.getColors(e),opacities:this._config.getOpacities(e)})}onDetach(){this._technique.shutdown()}}export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../analysis/LengthDimension.js";import i from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as a,handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as o}from"../../../../core/lang.js";import{mapCollection as r}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as p,destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{watch as c,initial as m,sync as h,syncAndInitial as g,when as f}from"../../../../core/reactiveUtils.js";import{property as _,subclass as M}from"../../../../core/accessorSupport/decorators.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as C}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as w,applyConstraint as b,computeConstraint as P,constraintDependencies as O}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as D,LengthDimensionPointManipulator as H,pointManipulatorHandles as j,createOffsetManipulator as T,offsetManipulatorHandles as x,LineOfSightOrientationManipulator as G,headingManipulatorHandles as z,rotationManipulatorHandles as U,createMeasureTypeManipulator as R,measureTypeManipulatorHandles as I,updateOffsetManipulatorTransform as V,updateHeadingManipulatorTransform as A,updateRotationManipulatorTransform as E,updateMeasureTypeManipulatorTransform as k,unfocusedOffsetWidth as L,focusedOffsetWidth as F}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as q,arePointsVerticallyAligned as B,computationToGeometryDependencies as N,computeGeometryFromDimension as J}from"./lengthDimensionUtils.js";import{disabledPointColor as K,pointRadius as Q,getTransparentAccentColor as W,getContrastColor as X,initialOffsetPx as Y}from"./settings.js";import{getRotateHeadingTexture as Z}from"../images/Factory.js";import{SnappingVisualizer3D as $}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as tt}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as et}from"../../interactive/visualElements/VerticesVisualElement.js";import{Parameters as it,ImageMaterial as nt}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as at}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends i{constructor(t){super(t),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new y,this._getSnappingContext=u(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new $}));const{view:e}=t;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:at(2)}),this._constraintSnappingIndicator=new tt({view:e,attached:!0,width:1,renderOccluded:4,stipplePattern:at(5),isDecoration:!0});const i=K.toUnitRGBA();this._stagedStartIndicator=new et({view:e,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:i,size:2*Q,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const e=W(t.effectiveTheme),i=X(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=Z(t.stage.textures,{accentColor:e,contrastColor:i,preMultiplyAlpha:n});const s=new it(this._textureHandle.managedTexture,!1);s.renderOccluded=16,s.isDecoration=!0,this._orientationManipulatorMaterial=new nt(s);const o=r(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([c(()=>({accentColor:W(t.effectiveTheme),contrastColor:X(t.effectiveTheme)}),({accentColor:e,contrastColor:i})=>{const a=this._textureHandle;this._textureHandle=Z(t.stage.textures,{accentColor:e,contrastColor:i,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),a?.release();const s=e.toUnitRGBA();this._unfocusedOffsetManipulatorMaterial.setParameters({color:s}),this._focusedOffsetManipulatorMaterial.setParameters({color:s}),this._thinOffsetManipulatorMaterial.setParameters({color:s}),this._constraintSnappingIndicator.color=s},m),a(o),c(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=C(t,new S);this._applyPointUpdate(e,{endPoint:i})},h),c(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:n,firstGrabbedManipulator:a}=t;if(i===e?.stagedDimension&&a===e?.firstGrabbedManipulator){for(const s of[n,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},g),c(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),m),c(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),c(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=v();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.consumePromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",n=this._computeConstraint(t);w(t,i,{constraint:n,view:this.view})}}})}destroy(){this._textureHandle=p(this._textureHandle),this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=dt(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[f(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...g,equals:o}),c(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:n}=t;switch(n.previousConstraint){case 0:n.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:n.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:n.preConstraintProperties={measureType:"direct",orientation:i};break;default:n.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},h)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[c(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const n=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)n.attached=!0;else{const{start:e,end:a}=this._computationManipulators.get(i),s=()=>{n.attached=e.grabbing||a.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),a.events.on("grab-changed",s)],t)}else n.attached=!1}),c(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.consumePromise(d(this._snappingOperation.snap({point:t},this._ensureSnappingManager(),i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:i}){let n=t;if("mouse"===i){const e=this._getSnappingContext(i);n=this._ensureSnappingManager().update({point:t,context:e})}const a=new e({startPoint:C(n,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=a,this._resetSnappingState(),a}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let n=t;if("mouse"===e){const i=this._getSnappingContext(e);n=this._ensureSnappingManager().update({point:t,context:i})}const a=C(n,new S);this._applyPointUpdate(i,{endPoint:a}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),n=this._setupOffsetManipulator(t),a=this._setupHeadingManipulator(t),o=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new D({start:e,end:i,offset:n,heading:a,rotation:o,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=s(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([c(()=>t.geometry,()=>this._updateManipulators(t,e),{...g,equals:o})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:n}=t,a=new H(i,{metadata:n}),s=j(a,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:n,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),a}_setupOffsetManipulator(t){const{view:e}=this,i=T(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),n=x(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new G(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),n=z(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new G(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),n=U(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,n=R(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),a=I(n,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(a,t),n}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:n,selectedComputation:a,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=a===t,c=q(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==n&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);B(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;V(p,h,g),l.available&&A(l,t,g),u.available&&E(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&k(e,t,i,g)})}_updateManipulatorStyle(t){const e=L(t),i=F(t),n={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:a,heading:s,rotation:o}of this._computationManipulators.values())a.radius=i/2,s.update(n),o.update(n);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,n=N(t);"startPoint"in e&&(n.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(n.elevationAlignedEndPoint=e.endPoint);const a=J(n,i.renderCoordsHelper);if(null==a)return;const s=this._computeConstraint({...n,geometry:a});b(t,e,{...n,constraint:s,unconstrainedGeometry:a,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,n=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Y*n*i.unitInMeters}_computeConstraint(t){return P(O(t,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(t){return new st({width:1,renderOccluded:4,writeDepth:!1,polygonOffset:3,isDecoration:!0},t.state.isGlobal)}get test(){}};t([_({constructOnly:!0})],ht.prototype,"analysis",void 0),t([_({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([_({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([_({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([_({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([_({readOnly:!0})],ht.prototype,"updating",null),t([_()],ht.prototype,"firstGrabbedManipulator",null),t([_()],ht.prototype,"hasGrabbedManipulators",null),t([_()],ht.prototype,"snappingOptions",null),t([_()],ht.prototype,"_stagedDimension",void 0),t([_()],ht.prototype,"_snappingManager",null),t([_()],ht.prototype,"_activeComputation",null),t([_()],ht.prototype,"_stagedComputation",null),t([_()],ht.prototype,"_snappingManagerResult",void 0),ht=t([M("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=v();export{ht as LengthDimensionSubTool};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../analysis/LengthDimension.js";import i from"../../../../core/Accessor.js";import a from"../../../../core/Handles.js";import{destroyHandle as n,handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as o}from"../../../../core/lang.js";import{mapCollection as r}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as p,destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as c,watch as m,sync as h,syncAndInitial as g,when as f}from"../../../../core/reactiveUtils.js";import{property as _,subclass as M}from"../../../../core/accessorSupport/decorators.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as C}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as w,applyConstraint as b,computeConstraint as P,constraintDependencies as H}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as O,LengthDimensionPointManipulator as D,pointManipulatorHandles as j,createOffsetManipulator as T,offsetManipulatorHandles as x,LineOfSightOrientationManipulator as G,headingManipulatorHandles as z,rotationManipulatorHandles as U,createMeasureTypeManipulator as R,measureTypeManipulatorHandles as I,updateOffsetManipulatorTransform as V,updateHeadingManipulatorTransform as A,updateRotationManipulatorTransform as E,updateMeasureTypeManipulatorTransform as k,unfocusedOffsetWidth as L,focusedOffsetWidth as F}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as q,arePointsVerticallyAligned as B,computationToGeometryDependencies as N,computeGeometryFromDimension as J}from"./lengthDimensionUtils.js";import{disabledPointColor as K,pointRadius as Q,getTransparentAccentColor as W,getContrastColor as X,initialOffsetPx as Y}from"./settings.js";import{getRotateHeadingTexture as Z}from"../images/Factory.js";import{SnappingVisualizer3D as $}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as tt}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as et}from"../../interactive/visualElements/VerticesVisualElement.js";import{Parameters as it,ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends i{constructor(t){super(t),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new a,this._updatingHandles=new y,this._getSnappingContext=u(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new $}));const{view:e}=t;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new tt({view:e,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const i=K.toUnitRGBA();this._stagedStartIndicator=new et({view:e,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:i,size:2*Q,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const e=W(t.effectiveTheme),i=X(t.effectiveTheme),a=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=Z(t.stage.textures,{accentColor:e,contrastColor:i,preMultiplyAlpha:a});const s=new it(this._textureHandle.managedTexture,!1);s.renderOccluded=16,s.isDecoration=!0,this._orientationManipulatorMaterial=new at(s);const o=r(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([this._updatingHandles.add(()=>({accentColor:W(t.effectiveTheme),contrastColor:X(t.effectiveTheme)}),({accentColor:e,contrastColor:i})=>{const n=this._textureHandle;this._textureHandle=Z(t.stage.textures,{accentColor:e,contrastColor:i,preMultiplyAlpha:a}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),n?.release();const s=e.toUnitRGBA();this._unfocusedOffsetManipulatorMaterial.setParameters({color:s}),this._focusedOffsetManipulatorMaterial.setParameters({color:s}),this._thinOffsetManipulatorMaterial.setParameters({color:s}),this._constraintSnappingIndicator.color=s},c),n(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=C(t,new S);this._applyPointUpdate(e,{endPoint:i})},h),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},g),this._updatingHandles.add(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),c),this._updatingHandles.add(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),this._updatingHandles.add(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=v();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.consumePromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);w(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=p(this._textureHandle),this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=dt(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[f(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...g,equals:o}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},h)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[this._updatingHandles.add(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),this._updatingHandles.add(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.consumePromise(d(this._snappingOperation.snap({point:t},this._ensureSnappingManager(),i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:i}){let a=t;if("mouse"===i){const e=this._getSnappingContext(i);a=this._ensureSnappingManager().update({point:t,context:e})}const n=new e({startPoint:C(a,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._ensureSnappingManager().update({point:t,context:i})}const n=C(a,new S);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),o=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new O({start:e,end:i,offset:a,heading:n,rotation:o,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=s(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...g,equals:o})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new D(i,{metadata:a}),s=j(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=T(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=x(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new G(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=z(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new G(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=R(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=I(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=q(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);B(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;V(p,h,g),l.available&&A(l,t,g),u.available&&E(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&k(e,t,i,g)})}_updateManipulatorStyle(t){const e=L(t),i=F(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=N(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=J(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});b(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Y*a*i.unitInMeters}_computeConstraint(t){return P(H(t,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(t){return new st({width:1,renderOccluded:4,writeDepth:!1,polygonOffset:3,isDecoration:!0},t.state.isGlobal)}get test(){}};t([_({constructOnly:!0})],ht.prototype,"analysis",void 0),t([_({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([_({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([_({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([_({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([_({readOnly:!0})],ht.prototype,"updating",null),t([_()],ht.prototype,"firstGrabbedManipulator",null),t([_()],ht.prototype,"hasGrabbedManipulators",null),t([_()],ht.prototype,"snappingOptions",null),t([_()],ht.prototype,"_stagedDimension",void 0),t([_()],ht.prototype,"_snappingManager",null),t([_()],ht.prototype,"_activeComputation",null),t([_()],ht.prototype,"_stagedComputation",null),t([_()],ht.prototype,"_snappingManagerResult",void 0),ht=t([M("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=v();export{ht as LengthDimensionSubTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as e,equals as r}from"../../../../core/arrayUtils.js";import{EventedAccessor as i}from"../../../../core/Evented.js";import{destroyMaybe as s,removeMaybe as a}from"../../../../core/maybe.js";import n from"../../../../core/ReactiveMap.js";import{watch as o,initial as l}from"../../../../core/reactiveUtils.js";import{schedule as u}from"../../../../core/scheduling.js";import{property as p,subclass as h}from"../../../../core/accessorSupport/decorators.js";import g from"../../../../geometry/Multipoint.js";import{absoluteHeightElevationInfo as c,getConvertedElevation as d}from"../../../../support/elevationInfoUtils.js";import{restoreLineOfSightObserverState as y,restoreLineOfSightTargetState as _,snapshotLineOfSightTargetState as m,snapshotLineOfSightObserverState as v,updateLineOfSightItemFromAuthoredPoint as f}from"./LineOfSightAuthoringUtils.js";import{LineOfSightObserverManipulator as M,LineOfSightTargetManipulator as b,LineOfSightTargetManipulatorState as x,getInteractiveLineOfSightTargetManipulatorState as S}from"./LineOfSightManipulators.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";const A=Symbol("line-of-sight-aggregate-operations");let w=class extends i{constructor(){super(...arguments),this._operations=null,this.interacting=!1,this._externalGeometryStagingArea=new D(t=>this._syncOperationsFromAnalysisGeometry(t),()=>null==this._operations),this._observerManipulator=null,this._targetByPart=new Map,this._targetManipulators=new n,this._dragIntersectionContext=null}initialize(){this.addHandles([this._connectAnalysisItemLifecycle(),this._connectTargetPartMap(),this._connectStagedMultipointGeometry(),this._connectTargetManipulatorStates()])}destroy(){this._externalGeometryStagingArea.destroy(),this._replaceOperations(null),this._observerManipulator=null,this._targetManipulators.clear()}get operations(){return this._operations}get elevationInfo(){return c}get visible(){return this.analysisViewData.visible&&null!=this.origin}get isDraped(){return!1}get origin(){const t=this.analysis.observer,e=this.analysis.targets.at(0);return T(this.view,t?.position,t?.elevationInfo)??T(this.view,e?.position,e?.elevationInfo)}get _stagedMultipointGeometry(){const t=this.analysis.observer,r=this.analysis.targets.toArray(),i=t?.position?.spatialReference,s=[T(this.view,t?.position,t?.elevationInfo),...r.map(t=>T(this.view,t.position,t.elevationInfo))].filter(e).map(t=>t.toArray());return 0===s.length||null==i?null:new g({hasZ:!0,points:s,spatialReference:i})}get updating(){return!1}createManipulator(t){return null}_createObserverReshapeManipulator(t){this._clearManipulatorDragTracking(this._observerManipulator);const e=new M(this.view,{deleting:!1,intersection:null,type:"observer"});return e.selected=t.selected,this._observerManipulator=e,this._trackManipulatorDrag(e,this.analysis.observer),e}_createTargetReshapeManipulator(t){const{part:e}=t.vertex,r=this._targetByPart.get(e);if(null==r)return t.defaultCreate();this._clearManipulatorDragTracking(this._targetManipulators.get(r));const i=new b(this.view,{deleting:!1,target:r,type:"target"});return i.selected=t.selected,this._targetManipulators.set(r,i),this._updateTargetManipulatorState(i,this._getTargetComputation(r)),this._trackManipulatorDrag(i,r),i}createReshapeManipulator(t){const{part:e}=t.vertex;return 0===e.index?this._createObserverReshapeManipulator(t):this._createTargetReshapeManipulator(t)}getReshapeMoveConfig(t){return 1===t.numSelected&&null!=this._targetByPart.get(t.vertex.part)?{xyAxisMode:"all"}:null}getTargetManipulator(t){const e=this._targetManipulators.get(t);return e?.view?e:null}get observerManipulator(){return this._observerManipulator}get targetManipulators(){return[...this._targetManipulators.values()]}get lineOfSightManipulators(){return[this._observerManipulator,...this._targetManipulators.values()].filter(t=>null!=t&&!t.metadata.deleting)}toMap(t){return this.intersector.getScreenPointIntersection(t)?.mapPoint}createUndoRecord(){let t=this._snapshotState(),e=null;return{undo:()=>{e=this._snapshotState(),this._restoreSnapshot(t)},redo:()=>{null!=e&&(t=this._snapshotState(),this._restoreSnapshot(e))}}}_restoreSnapshot(t){const{observer:e}=this.analysis;null!=e&&null!=t.observer&&y(t.observer,e),this.analysis.targets.forEach((e,r)=>{const i=t.targets[r];null!=i&&_(i,e)}),this._queueAnalysisGeometryResync(),this.emit("committed")}_snapshotState(){return{observer:v(this.analysis.observer),targets:this.analysis.targets.toArray().map(t=>m(t))}}_replaceOperations(t){this.removeHandles(A),this._operations=s(this._operations),this._operations=t,this._targetByPart=null==t?new Map:G(t.data.parts,this.analysis.targets.toArray(),this._targetByPart),null==t&&(this._observerManipulator=null),null!=t&&this.addHandles(t.data.on("change",()=>this._operationsGeometryChanged()),A)}_connectAnalysisItemLifecycle(){return o(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>{null==t&&(this._clearManipulatorDragTracking(this._observerManipulator),this._observerManipulator=null);const r=new Set(e);for(const[i,s]of this._targetManipulators)r.has(i)&&null!=s.view||(this._clearManipulatorDragTracking(s),this._targetManipulators.delete(i))},l)}_connectTargetPartMap(){return o(()=>({operations:this._operations,targets:this.analysis.targets.toArray()}),({operations:t,targets:e})=>{null!=t&&(this._targetByPart=G(t.data.parts,e,this._targetByPart))},l)}_connectStagedMultipointGeometry(){return o(()=>this._stagedMultipointGeometry,t=>{this._externalGeometryStagingArea.stage(t)},l)}_connectTargetManipulatorStates(){return o(()=>({computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),interacting:this.interacting,targets:this.analysis.targets.toArray()}),({computations:t,interacting:e,targets:r})=>{for(const i of r){const r=this._targetManipulators.get(i);if(null==r)continue;const s=t.find(t=>t.target===i),a=null!=s&&s.isValid?s.isTargetVisible?x.visible:x.occluded:x.undefined;r.state=e?S(a):a}},l)}_queueAnalysisGeometryResync(){this._externalGeometryStagingArea.stage(this._stagedMultipointGeometry)}_getTargetComputation(t){return this.analysisViewData.computations.find(e=>e.target===t)}_updateTargetManipulatorState(t,e){null!=e&&e.computationResult.isValid?t.state=this._getTargetManipulatorState(e.computationResult.isTargetVisible?x.visible:x.occluded):t.state=this._getTargetManipulatorState(x.undefined)}_getTargetManipulatorState(t){return this.interacting?S(t):t}_syncOperationsFromAnalysisGeometry(t){if(null==t)return void(null!=this._operations&&(this._replaceOperations(null),this.emit("modified-externally")));const e=this._operations;if(null!=e&&e.data.geometry?.equals(t))this._syncTargetPartMapFromOperations(e);else{if(e?.trySetGeometry(t))return this._syncTargetPartMapFromOperations(e),this.emit("committed"),void this.emit("modified-externally");this._replaceOperations(P.fromGeometry(t,this.view.state.viewingMode)),this.emit("committed"),this.emit("modified-externally")}}_syncTargetPartMapFromOperations(t){this._targetByPart=G(t.data.parts,this.analysis.targets.toArray(),this._targetByPart)}_operationsGeometryChanged(){const t=this._operations,e=this.analysis.observer;if(this._externalGeometryStagingArea.inProgress||null==t||null==e)return;const{coordinateHelper:i,parts:s}=t.data,a=O(s,this._targetByPart);r(this.analysis.targets.toArray(),a)||this.analysis.targets.splice(0,this.analysis.targets.length,...a);const n=i.vectorToPoint(s[0]?.getFirstVertex()?.pos);null==n||I(this.view,e,n)||this._updateAnalysisItemFromAbsolutePoint(e,n);for(const r of s){if(0===r.index)continue;const t=this._targetByPart.get(r),e=i.vectorToPoint(r.getFirstVertex()?.pos);null!=t&&null!=e&&this.analysis.targets.includes(t)&&(I(this.view,t,e)||this._updateAnalysisItemFromAbsolutePoint(t,e))}null==this._dragIntersectionContext||this._dragIntersectionContext.dragging||(this._dragIntersectionContext=null),this.emit("committed")}_updateAnalysisItemFromAbsolutePoint(t,e){const r=this._dragIntersectionContext?.item===t?this._dragIntersectionContext.intersection:null;f(this.view,t,this.intersector,e,{sourceElevationInfo:c,preservedIntersection:r})}_trackManipulatorDrag(t,e){null!=e&&(this.removeHandles(t),this.addHandles(t.events.on("drag",t=>this._updateDragIntersectionContext(e,t)),t))}_clearManipulatorDragTracking(t){null!=t&&this.removeHandles(t)}_updateDragIntersectionContext(t,e){"cancel"!==e.action?this._dragIntersectionContext={dragging:"end"!==e.action,intersection:this.intersector.getScreenPointIntersection(e.screenPoint),item:t}:this._dragIntersectionContext=null}};function I(t,e,r){const i=T(t,e.position,e.elevationInfo);return i?.equals(r)??!1}function T(t,e,r){if(null==e)return null;const i=e.clone();return i.z=d(t,e,r??c,c),i}function G(t,e,r){const i=new Map;if(null!=r)for(const o of t){if(0===o.index||null!=o.getFirstVertex())continue;const t=r.get(o);null!=t&&i.set(o,t)}const s=new Set(i.values()),a=e.filter(t=>!s.has(t));let n=0;for(const o of t){if(0===o.index||null==o.getFirstVertex())continue;if(i.has(o))continue;const t=a[n++];if(null==t)break;i.set(o,t)}return i}function O(t,e){const r=[];for(const i of t){if(0===i.index||null==i.getFirstVertex())continue;const t=e.get(i);null!=t&&r.push(t)}return r}t([p({constructOnly:!0})],w.prototype,"analysisViewData",void 0),t([p({constructOnly:!0})],w.prototype,"analysis",void 0),t([p({constructOnly:!0})],w.prototype,"intersector",void 0),t([p({constructOnly:!0})],w.prototype,"view",void 0),t([p()],w.prototype,"_operations",void 0),t([p()],w.prototype,"interacting",void 0),t([p()],w.prototype,"_observerManipulator",void 0),t([p()],w.prototype,"operations",null),t([p()],w.prototype,"elevationInfo",null),t([p()],w.prototype,"visible",null),t([p()],w.prototype,"isDraped",null),t([p()],w.prototype,"origin",null),t([p()],w.prototype,"_stagedMultipointGeometry",null),t([p()],w.prototype,"updating",null),t([p()],w.prototype,"observerManipulator",null),t([p()],w.prototype,"targetManipulators",null),t([p()],w.prototype,"lineOfSightManipulators",null),w=t([h("esri.views.3d.analysis.LineOfSight.LineOfSightAggregateManipulatedObject3D")],w);class D{constructor(t,e){this._geometry=void 0,this._inProgressGeometry=void 0,this._scheduledHandle=null,this._apply=t,this._shouldApplyImmediately=e}destroy(){this._scheduledHandle=a(this._scheduledHandle),this._geometry=void 0,this._inProgressGeometry=void 0}get inProgress(){return null!=this._inProgressGeometry}stage(t){if(this._geometry=t,!this.inProgress&&this._shouldApplyImmediately())return this._scheduledHandle=a(this._scheduledHandle),void this._flush();this._scheduledHandle??=u(()=>{this._scheduledHandle=null,this._flush()})}_flush(){const t=this._geometry;if(void 0!==t){this._geometry=void 0,this._inProgressGeometry=t;try{this._apply(t)}finally{this._inProgressGeometry=void 0}}}}export{w as LineOfSightAggregateManipulatedObject3D};
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as e,equals as i}from"../../../../core/arrayUtils.js";import{EventedAccessor as r}from"../../../../core/Evented.js";import{destroyMaybe as s,removeMaybe as a}from"../../../../core/maybe.js";import n from"../../../../core/ReactiveMap.js";import{initial as o}from"../../../../core/reactiveUtils.js";import{schedule as l}from"../../../../core/scheduling.js";import{signal as u}from"../../../../core/signal.js";import{property as p,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../../core/support/UpdatingHandles.js";import c from"../../../../geometry/Multipoint.js";import{absoluteHeightElevationInfo as d,getConvertedElevation as y}from"../../../../support/elevationInfoUtils.js";import{restoreLineOfSightObserverState as _,restoreLineOfSightTargetState as m,snapshotLineOfSightTargetState as v,snapshotLineOfSightObserverState as f,updateLineOfSightItemFromAuthoredPoint as M}from"./LineOfSightAuthoringUtils.js";import{LineOfSightObserverManipulator as b,LineOfSightTargetManipulator as x,LineOfSightTargetManipulatorState as S,getInteractiveLineOfSightTargetManipulatorState as A}from"./LineOfSightManipulators.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";const w=Symbol("line-of-sight-aggregate-operations");let I=class extends r{constructor(){super(...arguments),this._operations=null,this.interacting=!1,this._externalGeometryStagingArea=new D(t=>this._syncOperationsFromAnalysisGeometry(t),()=>null==this._operations),this._observerManipulator=null,this._targetByPart=new Map,this._targetManipulators=new n,this._updatingHandles=new g,this._dragIntersectionContext=null}initialize(){this.addHandles([this._connectAnalysisItemLifecycle(),this._connectTargetPartMap(),this._connectStagedMultipointGeometry(),this._connectTargetManipulatorStates()])}destroy(){this._externalGeometryStagingArea.destroy(),this._updatingHandles.destroy(),this._replaceOperations(null),this._observerManipulator=null,this._targetManipulators.clear()}get operations(){return this._operations}get elevationInfo(){return d}get visible(){return this.analysisViewData.visible&&null!=this.origin}get isDraped(){return!1}get origin(){const t=this.analysis.observer,e=this.analysis.targets.at(0);return G(this.view,t?.position,t?.elevationInfo)??G(this.view,e?.position,e?.elevationInfo)}get _stagedMultipointGeometry(){const t=this.analysis.observer,i=this.analysis.targets.toArray(),r=t?.position?.spatialReference,s=[G(this.view,t?.position,t?.elevationInfo),...i.map(t=>G(this.view,t.position,t.elevationInfo))].filter(e).map(t=>t.toArray());return 0===s.length||null==r?null:new c({hasZ:!0,points:s,spatialReference:r})}get updating(){return this._updatingHandles.updating||this._externalGeometryStagingArea.updating.value}createManipulator(t){return null}_createObserverReshapeManipulator(t){this._clearManipulatorDragTracking(this._observerManipulator);const e=new b(this.view,{deleting:!1,intersection:null,type:"observer"});return e.selected=t.selected,this._observerManipulator=e,this._trackManipulatorDrag(e,this.analysis.observer),e}_createTargetReshapeManipulator(t){const{part:e}=t.vertex,i=this._targetByPart.get(e);if(null==i)return t.defaultCreate();this._clearManipulatorDragTracking(this._targetManipulators.get(i));const r=new x(this.view,{deleting:!1,target:i,type:"target"});return r.selected=t.selected,this._targetManipulators.set(i,r),this._updateTargetManipulatorState(r,this._getTargetComputation(i)),this._trackManipulatorDrag(r,i),r}createReshapeManipulator(t){const{part:e}=t.vertex;return 0===e.index?this._createObserverReshapeManipulator(t):this._createTargetReshapeManipulator(t)}getReshapeMoveConfig(t){return 1===t.numSelected&&null!=this._targetByPart.get(t.vertex.part)?{xyAxisMode:"all"}:null}getTargetManipulator(t){const e=this._targetManipulators.get(t);return e?.view?e:null}get observerManipulator(){return this._observerManipulator}get targetManipulators(){return[...this._targetManipulators.values()]}get lineOfSightManipulators(){return[this._observerManipulator,...this._targetManipulators.values()].filter(t=>null!=t&&!t.metadata.deleting)}toMap(t){return this.intersector.getScreenPointIntersection(t)?.mapPoint}createUndoRecord(){let t=this._snapshotState(),e=null;return{undo:()=>{e=this._snapshotState(),this._restoreSnapshot(t)},redo:()=>{null!=e&&(t=this._snapshotState(),this._restoreSnapshot(e))}}}_restoreSnapshot(t){const{observer:e}=this.analysis;null!=e&&null!=t.observer&&_(t.observer,e),this.analysis.targets.forEach((e,i)=>{const r=t.targets[i];null!=r&&m(r,e)}),this._queueAnalysisGeometryResync(),this.emit("committed")}_snapshotState(){return{observer:f(this.analysis.observer),targets:this.analysis.targets.toArray().map(t=>v(t))}}_replaceOperations(t){this.removeHandles(w),this._operations=s(this._operations),this._operations=t,this._targetByPart=null==t?new Map:H(t.data.parts,this.analysis.targets.toArray(),this._targetByPart),null==t&&(this._observerManipulator=null),null!=t&&this.addHandles(t.data.on("change",()=>this._operationsGeometryChanged()),w)}_connectAnalysisItemLifecycle(){return this._updatingHandles.add(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>{null==t&&(this._clearManipulatorDragTracking(this._observerManipulator),this._observerManipulator=null);const i=new Set(e);for(const[r,s]of this._targetManipulators)i.has(r)&&null!=s.view||(this._clearManipulatorDragTracking(s),this._targetManipulators.delete(r))},o)}_connectTargetPartMap(){return this._updatingHandles.add(()=>({operations:this._operations,targets:this.analysis.targets.toArray()}),({operations:t,targets:e})=>{null!=t&&(this._targetByPart=H(t.data.parts,e,this._targetByPart))},o)}_connectStagedMultipointGeometry(){return this._updatingHandles.add(()=>this._stagedMultipointGeometry,t=>{this._externalGeometryStagingArea.stage(t)},o)}_connectTargetManipulatorStates(){return this._updatingHandles.add(()=>({computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),interacting:this.interacting,targets:this.analysis.targets.toArray()}),({computations:t,interacting:e,targets:i})=>{for(const r of i){const i=this._targetManipulators.get(r);if(null==i)continue;const s=t.find(t=>t.target===r),a=null!=s&&s.isValid?s.isTargetVisible?S.visible:S.occluded:S.undefined;i.state=e?A(a):a}},o)}_queueAnalysisGeometryResync(){this._externalGeometryStagingArea.stage(this._stagedMultipointGeometry)}_getTargetComputation(t){return this.analysisViewData.computations.find(e=>e.target===t)}_updateTargetManipulatorState(t,e){null!=e&&e.computationResult.isValid?t.state=this._getTargetManipulatorState(e.computationResult.isTargetVisible?S.visible:S.occluded):t.state=this._getTargetManipulatorState(S.undefined)}_getTargetManipulatorState(t){return this.interacting?A(t):t}_syncOperationsFromAnalysisGeometry(t){if(null==t)return void(null!=this._operations&&(this._replaceOperations(null),this.emit("modified-externally")));const e=this._operations;if(null!=e&&e.data.geometry?.equals(t))this._syncTargetPartMapFromOperations(e);else{if(e?.trySetGeometry(t))return this._syncTargetPartMapFromOperations(e),this.emit("committed"),void this.emit("modified-externally");this._replaceOperations(P.fromGeometry(t,this.view.state.viewingMode)),this.emit("committed"),this.emit("modified-externally")}}_syncTargetPartMapFromOperations(t){this._targetByPart=H(t.data.parts,this.analysis.targets.toArray(),this._targetByPart)}_operationsGeometryChanged(){const t=this._operations,e=this.analysis.observer;if(this._externalGeometryStagingArea.inProgress||null==t||null==e)return;const{coordinateHelper:r,parts:s}=t.data,a=O(s,this._targetByPart);i(this.analysis.targets.toArray(),a)||this.analysis.targets.splice(0,this.analysis.targets.length,...a);const n=r.vectorToPoint(s[0]?.getFirstVertex()?.pos);null==n||T(this.view,e,n)||this._updateAnalysisItemFromAbsolutePoint(e,n);for(const i of s){if(0===i.index)continue;const t=this._targetByPart.get(i),e=r.vectorToPoint(i.getFirstVertex()?.pos);null!=t&&null!=e&&this.analysis.targets.includes(t)&&(T(this.view,t,e)||this._updateAnalysisItemFromAbsolutePoint(t,e))}null==this._dragIntersectionContext||this._dragIntersectionContext.dragging||(this._dragIntersectionContext=null),this.emit("committed")}_updateAnalysisItemFromAbsolutePoint(t,e){const i=this._dragIntersectionContext?.item===t?this._dragIntersectionContext.intersection:null;M(this.view,t,this.intersector,e,{sourceElevationInfo:d,preservedIntersection:i})}_trackManipulatorDrag(t,e){null!=e&&(this.removeHandles(t),this.addHandles(t.events.on("drag",t=>this._updateDragIntersectionContext(e,t)),t))}_clearManipulatorDragTracking(t){null!=t&&this.removeHandles(t)}_updateDragIntersectionContext(t,e){"cancel"!==e.action?this._dragIntersectionContext={dragging:"end"!==e.action,intersection:this.intersector.getScreenPointIntersection(e.screenPoint),item:t}:this._dragIntersectionContext=null}};function T(t,e,i){const r=G(t,e.position,e.elevationInfo);return r?.equals(i)??!1}function G(t,e,i){if(null==e)return null;const r=e.clone();return r.z=y(t,e,i??d,d),r}function H(t,e,i){const r=new Map;if(null!=i)for(const o of t){if(0===o.index||null!=o.getFirstVertex())continue;const t=i.get(o);null!=t&&r.set(o,t)}const s=new Set(r.values()),a=e.filter(t=>!s.has(t));let n=0;for(const o of t){if(0===o.index||null==o.getFirstVertex())continue;if(r.has(o))continue;const t=a[n++];if(null==t)break;r.set(o,t)}return r}function O(t,e){const i=[];for(const r of t){if(0===r.index||null==r.getFirstVertex())continue;const t=e.get(r);null!=t&&i.push(t)}return i}t([p({constructOnly:!0})],I.prototype,"analysisViewData",void 0),t([p({constructOnly:!0})],I.prototype,"analysis",void 0),t([p({constructOnly:!0})],I.prototype,"intersector",void 0),t([p({constructOnly:!0})],I.prototype,"view",void 0),t([p()],I.prototype,"_operations",void 0),t([p()],I.prototype,"interacting",void 0),t([p()],I.prototype,"_observerManipulator",void 0),t([p()],I.prototype,"operations",null),t([p()],I.prototype,"elevationInfo",null),t([p()],I.prototype,"visible",null),t([p()],I.prototype,"isDraped",null),t([p()],I.prototype,"origin",null),t([p()],I.prototype,"_stagedMultipointGeometry",null),t([p()],I.prototype,"updating",null),t([p()],I.prototype,"observerManipulator",null),t([p()],I.prototype,"targetManipulators",null),t([p()],I.prototype,"lineOfSightManipulators",null),I=t([h("esri.views.3d.analysis.LineOfSight.LineOfSightAggregateManipulatedObject3D")],I);class D{constructor(t,e){this._geometry=void 0,this._inProgressGeometry=void 0,this._scheduledHandle=null,this.updating=u(!1),this._apply=t,this._shouldApplyImmediately=e}destroy(){this._scheduledHandle=a(this._scheduledHandle),this.updating.value=!1,this._geometry=void 0,this._inProgressGeometry=void 0}get inProgress(){return null!=this._inProgressGeometry}stage(t){if(this._geometry=t,!this.inProgress&&this._shouldApplyImmediately())return this._scheduledHandle=a(this._scheduledHandle),this.updating.value=!1,void this._flush();this.updating.value=!0,this._scheduledHandle??=l(()=>{this._scheduledHandle=null;try{this._flush()}finally{null==this._scheduledHandle&&(this.updating.value=!1)}})}_flush(){const t=this._geometry;if(void 0!==t){this._geometry=void 0,this._inProgressGeometry=t;try{this._apply(t)}finally{this._inProgressGeometry=void 0}}}}export{I as LineOfSightAggregateManipulatedObject3D};
|