@arcgis/core 5.1.0-next.83 → 5.1.0-next.85
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/{e89dc473f46a5584d2ef.js → 004af103a94d21cb4889.js} +3 -3
- package/assets/esri/core/workers/chunks/53d13e13d8729bd4dcf2.js +1 -0
- package/assets/esri/core/workers/chunks/{45c83eb7c2a06166e3b0.js → 56717ff315c6ec874142.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e2c0c6d724f7639d4c1.js → 713ab619060bd5087479.js} +13 -13
- package/assets/esri/core/workers/chunks/{a9b5ce00323cd5574bf7.js → 7160e3e7340beb7fdb42.js} +1 -1
- package/assets/esri/core/workers/chunks/79eca9ccd4dc52da1d59.js +1 -0
- package/assets/esri/core/workers/chunks/{bd8cb64b6e08839398f3.js → c7da0981822182e15f3a.js} +1 -1
- package/assets/esri/core/workers/chunks/f9fe3c9867b0bdb2aec6.js +596 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +6 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/chunks/EdgeShader.glsl.js +13 -9
- package/chunks/Fog.glsl.js +1 -1
- package/chunks/GlowBlur.glsl.js +9 -13
- package/chunks/GlowComposition.glsl.js +10 -10
- package/chunks/ShadowCastVisualize.glsl.js +10 -10
- package/config.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/screenUtils.js +1 -1
- package/form/types.d.ts +1 -1
- package/geohash/GeohashCell.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/kernel.js +1 -1
- package/layers/scene/ModelFileInfo.js +1 -1
- package/layers/scene/modelQuerySupport.js +1 -1
- package/package.json +1 -1
- package/popup/Features.d.ts +10 -0
- package/popup/Features.js +1 -1
- package/rest/knowledgeGraph/GraphQueryStreamingResult.d.ts +4 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/FrameTask.js +1 -1
- package/views/2d/LabelManager.js +1 -1
- package/views/2d/engine/DisplayObject.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/flow/FlowContainer.js +1 -1
- package/views/2d/engine/flow/FlowView2D.js +1 -1
- package/views/2d/engine/flow/styles/AFlowResources.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/Stack.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/transitions/FadeTransition.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
- package/views/2d/engine/webgl/AFeatureTile.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/ResizableUint32Array.js +2 -0
- package/views/2d/engine/webgl/TileCpuState.js +2 -0
- package/views/2d/engine/webgl/TileGpuState.js +2 -0
- package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +2 -0
- package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +2 -0
- package/views/2d/engine/webgl/cpuMapped/GpuMeshState.js +2 -0
- package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugContainer.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
- package/views/2d/layers/GraphicsLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/FeatureTilePresentStrategy.js +2 -0
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/aggregation/AAggregateSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridCell.js +1 -1
- package/views/2d/layers/features/aggregation/GridIndexCell.js +2 -0
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceMessage.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
- package/views/2d/layers/features/support/Hashed.js +2 -0
- package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryView2D.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/2d/tiling/FeatureTileSubscriptionManager.js +1 -1
- package/views/2d/tiling/TileCombinedCoverage.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +2 -0
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool2.js +2 -0
- package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +2 -0
- package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/environment/CloudyWeather.js +1 -1
- package/views/3d/environment/FoggyWeather.js +1 -1
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/SnowyWeather.js +1 -1
- package/views/3d/environment/SunnyWeather.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/webgl/ManagedColorAttachment.js +1 -1
- package/views/3d/webgl/ManagedDepthAttachment.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +11 -11
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +2 -0
- package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/raymarching/{RayDistanceFalloff.glsl.js → DistanceFalloff.glsl.js} +2 -2
- package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.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/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/StencilUtils.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -7
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/support/rasterHitTestUtils.js +1 -1
- package/views/support/waitForResources.js +1 -1
- package/views/video/VideoOperationalDataView.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.d.ts +61 -0
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +2 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +9 -4
- package/widgets/BatchAttributeForm/templates/UtilityNetworkAssociationsElementTemplate.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.d.ts +17 -2
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GroupColumn.d.ts +7 -1
- package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +9 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +8 -0
- package/widgets/FeatureTable.js +1 -1
- package/assets/esri/core/workers/chunks/38f1a86b8dd9ee684ee5.js +0 -596
- package/assets/esri/core/workers/chunks/8f4cd30ce23e41c1a42c.js +0 -1
- package/assets/esri/core/workers/chunks/cbf1a03f54bd8d2a2b47.js +0 -1
- package/views/2d/engine/webgl/PooledUint32Array.js +0 -2
- package/views/2d/engine/webgl/cpuMapped/Buffer.js +0 -2
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +0 -2
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DistanceFalloff.glsl.js +0 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class M{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class W{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new M(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=E(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new g,o=l(1/0,1/0,-1/0,-1/0);Z(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new g;return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class z extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o){const n=e.metadata.outSpatialReference,l=new R({spatialReference:n}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:e.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:e.metadata.timeInfo,fieldsIndex:e.metadata.fieldsIndex,spatialReference:n,filterJSON:t.featureFilter}):null;return n.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,e,s,n,c,d,a,o)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null,hasZ:!1,hasM:!1})}destroy(){super.destroy(),this._clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){super.invalidate(),this._clear()}createState(t){return new z(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_clear(){for(const t of this._source.chunks())if(this._handledChunks.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(t)}}this._handledChunks.clear();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];if(this._handledChunks.has(i.chunkId))continue;this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.getObjectId();a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(t));const i=a.readAttribute(e);if(null!=i&&null!=t&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(!this._tracks.has(i)){const t=W.getOid(i),e=this._attributeStore.createDisplayIdForObjectId(t),s=new W(this._schema,i,t,e,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(i,s)}this._tracks.get(i).stageObservation(r,a),s.add(i)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId),null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=C.fromSpatialReference(e);if(null!=r){const t=a(s,1e6,r,o.geodesic);if(null!=t){const e=C.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function Z(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function E(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
|
|
2
|
+
import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class M{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class W{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new M(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=E(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new g,o=l(1/0,1/0,-1/0,-1/0);Z(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new g;return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class z extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o){const n=e.metadata.outSpatialReference,l=new R({spatialReference:n}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:e.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:e.metadata.timeInfo,fieldsIndex:e.metadata.fieldsIndex,spatialReference:n,filterJSON:t.featureFilter}):null;return n.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,e,s,n,c,d,a,o)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null,hasZ:!1,hasM:!1})}destroy(){super.destroy(),this._clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){super.invalidate(),this._clear()}createState(t){return new z(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_clear(){for(const t of this._source.chunks())if(this._handledChunks.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(t)}}this._handledChunks.clear();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];if(this._handledChunks.has(i.chunkId))continue;this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.getObjectId();a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(t));const i=a.readAttribute(e);if(null!=i&&null!=t&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(!this._tracks.has(i)){const t=W.getOid(i),e=this._attributeStore.createDisplayIdForObjectId(t),s=new W(this._schema,i,t,e,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(i,s)}this._tracks.get(i).stageObservation(r,a),s.add(i)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId),null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,{});for(const t of o)yield new S(e.subscription,t,!1,{});yield new S(e.subscription,i,e.done,{})}}function q(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=C.fromSpatialReference(e);if(null!=r){const t=a(s,1e6,r,o.geodesic);if(null!=t){const e=C.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function Z(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function E(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
class
|
|
2
|
+
class i{constructor(i,t,e,s){this.subscription=i,this.reader=t,this.end=e,this.debugInfo=s,this.type="append"}get id(){return this.subscription.tile.id}createMessage(i,t,e){return{type:"append",id:this.id,append:i,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:t,attributeEpoch:e}}}class t{constructor(i,t,e,s,r){this.subscription=i,this.reader=t,this.remove=e,this.end=s,this.debugInfo=r,this.type="update"}get id(){return this.subscription.tile.id}createMessage(i,t,e){return{type:"update",id:this.id,modify:i,debugInfo:this.debugInfo,remove:this.remove,version:t,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:e}}}export{i as FeatureTileAppendMessage,t as FeatureTileUpdateMessage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{FeatureSpatialIndex as e}from"../../../FeatureSpatialIndex.js";import{GeohashSpatialIndex as
|
|
2
|
+
import{FeatureSpatialIndex as e}from"../../../FeatureSpatialIndex.js";import{GeohashSpatialIndex as r}from"../../../aggregation/GeohashSpatialIndex.js";import{GridSpatialIndex as t}from"../../../aggregation/GridSpatialIndex.js";import{FeatureSetReaderIndirect as s}from"../../../support/FeatureSetReaderIndirect.js";class i{size(){return this.reader.getSize()}get fields(){return this.reader.fields}invalidate(){this._spatialIndex=null,this._gridIndex=null,this._geohashIndex=null}get usedMemory(){let e=0;return e+=this.reader.underlyingMemory,this._gridIndex&&(e+=this._gridIndex.usedMemory),this._geohashIndex&&(e+=this._geohashIndex.usedMemory),this._spatialIndex&&(e+=this._spatialIndex.usedMemory),e}getObjectIds(){const e=this.reader.getCursor(),r=[];for(;e.next();)r.push(e.getObjectId());return r}registerOverrides(e){this.reader.registerOverrides(e),this.invalidate()}queryFeaturesInBounds(e){const r=this._getSpatialIndex().search(e);return s.from(this.reader,r)}getGridIndex(e){return e.hash!==this._gridIndex?.hash&&(this._gridIndex=new t(e,this.reader.copy())),this._gridIndex}getGeohashIndex(e){return e.hash!==this._geohashIndex?.hash&&(this._geohashIndex=new r(e,this.reader.copy())),this._geohashIndex}_getSpatialIndex(){return this._spatialIndex||(this._spatialIndex=e.fromReader(this.reader)),this._spatialIndex}}export{i as ASourceChunk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{destroyMaybe as e}from"../../../../core/maybe.js";import{AFeatureContainer as t}from"../../engine/AFeatureContainer.js";import{GraphicInstanceStore as r}from"../../engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js";import n from"./GraphicBoundsRenderer.js";class s extends t{constructor(e,t=!1){super(e),this.drawOnTop=t,this._instanceStore=new r,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=e(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(e){this._boundsRenderer=new n(e),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(e,t){e.
|
|
2
|
+
import{destroyMaybe as e}from"../../../../core/maybe.js";import{AFeatureContainer as t}from"../../engine/AFeatureContainer.js";import{GraphicInstanceStore as r}from"../../engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js";import n from"./GraphicBoundsRenderer.js";class s extends t{constructor(e,t=!1){super(e),this.drawOnTop=t,this._instanceStore=new r,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=e(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(e){this._boundsRenderer=new n(e),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(e,t){e.update(t),this.contains(e)||this.addChild(e),this.requestRender()}_renderChildren(e,t){e.selection=t;for(const r of this.children)r.visible&&(r.upload(this._instanceStore,1),r.getDisplayList()?.render(e))}}export{s as AGraphicContainer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{pt2px as
|
|
2
|
+
import has from"../../../../core/has.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{r as e}from"../../../../chunks/rbush.js";import s from"../../../../geometry/Point.js";import{create as i,intersects as o,copy as r}from"../../../../geometry/support/aaBoundingRect.js";import{normalizeMapX as n}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as m}from"../../../../geometry/support/spatialReferenceUtils.js";import{HittestDrawHelper as a}from"../../../../symbols/cim/CIMSymbolDrawHelper.js";import{CIMSymbolInflatedSizeHelper as l}from"../../../../symbols/cim/CIMSymbolHelper.js";import{hittestToleranceSmallSymbol as h,hittestToleranceMobile as c,hittestToleranceDesktop as u}from"../../engine/webgl/definitions.js";import{GraphicStoreItem as p}from"./GraphicStoreItem.js";import{pixelBuffer as d}from"./graphicsUtils.js";import{GraphicUpdateMessage as f}from"./GraphicUpdateMessage.js";import{getMapPointsFromScreen as _,createHittestQuery as y}from"../../support/hitTestUtils.js";const b=1e-5;function I(t,e){return e.zOrder-t.zOrder}class x{constructor(t,e,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=t,this._cimResourceManager=e,this._hittestDrawHelper=new a(e),this._tileInfoView=s,this._store=o;const r=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(r.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(t){return this._items.get(t)}async update(t,e,s){const i=[],o=[],r=[],n=new Set,m=[];let a=0;const l=new Set;for(const h of t.items){const t=h.uid;if(l.has(t))continue;l.add(t),a++;const r=this._items.get(t),c=e(h);if(n.add(t),r){const t=r.update(h,c,a),e=r.updateDensificationResolution(this._resolution);t&&m.push(this._updateItem(r,s)),(t||e)&&o.push(r);continue}const u=this._store.createDisplayIdForObjectId(t),d=p.fromGraphic(h,c,a,u);d.updateDensificationResolution(this._resolution),m.push(this._updateItem(d,s)),this._items.set(d.objectId,d),i.push(d)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),r.push(c));return await Promise.all(m),this._index=null,new f(i,o,r)}updateLevel(t){if(this._resolution===t)return!1;this._index=null,this._boundsDirty=!0,this._resolution=t;for(const e of this.items())if(e.hasCurvedGeoemtry)return!0;return!1}hitTest(t,e,r,m){const a=i();let l=i();const p=y(e);if(!p)return console.warn("Unexpected hittest input:",e),[];let f=0,b=_(t,p.input);if(b=b.map(t=>new s(n(t.x,this._tileInfoView.spatialReference),t.y,this._tileInfoView.spatialReference)),"rect"===p.hittestType){const t=Math.min(...b.map(t=>t.x)),e=Math.min(...b.map(t=>t.y)),s=Math.max(...b.map(t=>t.x)),i=Math.max(...b.map(t=>t.y));a[0]=t,a[1]=e,a[2]=s,a[3]=i,l=a}else if("point"===p.hittestType){const t=has("esri-mobile"),e=t?c:u,s=e+(t?0:h),o=b[0].x,n=b[0].y,m=r*window.devicePixelRatio*s;a[0]=o-m,a[1]=n-m,a[2]=o+m,a[3]=n+m;const p=r*window.devicePixelRatio*e,_=i();_[0]=o-p,_[1]=n-p,_[2]=o+p,_[3]=n+p;const y=.5*r*(s+d);l[0]=o-y,l[1]=n-y,l[2]=o+y,l[3]=n+y,f=_[2]-_[0]}const x=this._searchIndex(l[0],l[1],l[2],l[3]);if(!x||0===x.length)return[];const g=[],w=i(),j=i();for(const s of x){if(!s.visible)continue;const{geometryBounds:t,symbolResource:e}=s;this._getSymbolBounds(w,e,t,j,m),j[3]=j[2]=j[1]=j[0]=0,o(w,a)&&g.push(s)}if(0===g.length)return[];const R=this._hittestDrawHelper,S=[];for(const s of g){const{projectedGeometry:t,symbolResource:e}=s;if(!e)continue;const{textInfo:i,symbolInfo:o}=e,n=o.cimSymbol;R.hitTest(b,n.symbol,t,i,m,r,f,p.hittestType)&&S.push(s)}return S.sort(I),S.map(t=>t.objectId)}queryItems(t){return 0===this._items.size?[]:this._searchForItems(t)}clear(){this._items.clear(),this._index=null}async _updateItem(t,e){await t.projectAndNormalize(this._outSpatialReference),await e(t);const{size:s}=t;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(t.symbolBounds,t.symbolResource,t.geometryBounds,t.size,0)}_searchIndex(t,s,i,o){return this._boundsDirty&&(this._items.forEach(t=>this._getSymbolBounds(t.symbolBounds,t.symbolResource,t.geometryBounds,t.size,0)),this._boundsDirty=!1),this._index||(this._index=e(9,t=>({minX:t.symbolBounds[0],minY:t.symbolBounds[1],maxX:t.symbolBounds[2],maxY:t.symbolBounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:t,minY:s,maxX:i,maxY:o})}_searchForItems(t){const e=this._tileInfoView.spatialReference,s=t.bounds,o=m(e);if(o&&e.isWrappable){const[e,r]=o.valid,n=Math.abs(s[2]-r)<b,m=Math.abs(s[0]-e)<b;if((!n||!m)&&(n||m)){const o=t.resolution;let m;m=i(n?[e,s[1],e+o*d,s[3]]:[r-o*d,s[1],r,s[3]]);const a=this._searchIndex(s[0],s[1],s[2],s[3]),l=this._searchIndex(m[0],m[1],m[2],m[3]);return[...new Set([...a,...l])]}}return this._searchIndex(s[0],s[1],s[2],s[3])}_getSymbolBounds(e,s,o,n,m){if(!s||!s.symbolInfo.linearCIM)return null;if(e||(e=i()),r(e,o),!n||0===n[0]&&0===n[1]&&0===n[2]&&0===n[3]){const{textInfo:e,symbolInfo:i}=s,o=i.cimSymbol;n||(n=[0,0,0,0]);const r=l.getSymbolInflateSize(n,o.symbol,this._cimResourceManager,m,e);n[0]=t(r[0]),n[1]=t(r[1]),n[2]=t(r[2]),n[3]=t(r[3])}const a=this._resolution,h=l.safeSize(n);return e[0]-=h*a,e[1]-=h*a,e[2]+=h*a,e[3]+=h*a,e}}export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import g from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as f,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as b,errorPolylineSymbol2D as w,errorPolygonSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as M}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as R}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createStorageSchema as j}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as x}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as U}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as C}from"../features/support/FeatureMetadata.js";import{GraphicsReader as q}from"../features/support/GraphicsReader.js";import G from"./GraphicStore.js";import{FeatureCommandQueue as k}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as F}from"../support/UpdateTracking2D.js";class P{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new P(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new P(e,s);for(const i of t)r.append(i);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||(this._reader=q.from(this.addedOrModified,this.tile,this.metadata)),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let A=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new F({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new k({process:e=>{if("update"===e.type)return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new U({spatialReference:this.view.spatialReference,fields:new g}),this._attributeStore=new x({isLocal:!0,update:e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=j(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=C.createGraphics(this.view.spatialReference),this._resourceProxy=new M({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([n(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new G(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return has("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:r}=this.view.state,i=this._graphicStore.hitTest(e.x,e.y,2,t,r),o=new Set(i),a=this.graphics.items.reduce((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e),new Map);return i.map(e=>a.get(e)).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:s,highlightFlags:r}of e){const e=this._graphicStore.getItem(s)?.displayId;t.push({objectId:s,highlightFlags:r,displayId:e})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{if(has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;const e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(const s of e.updated)this.container.restartAnimation(s.objectId);if(!e.hasAnyUpdate())return void this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){P.getOrCreate(r,t,this._metadata).append(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const i of e){P.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){P.getOrCreate(i,t,this._metadata).append(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){P.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _densifyItemsForDisplay(e){const t=new Map;for(const s of e)for(const e of s.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){const t={timeZone:null,timeExtent:null};for(const{tile:s,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${s.id}] GraphicsView fetchResources`,e);const i=r.getCursor();for(;i.next();)for(const e of i.getMeshWriters())e.enqueueRequest(this._resourceProxy,i,s.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){const t={timeZone:null,timeExtent:null},s=new T(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());for(const i of r.getMeshWriters())i.write(s,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(t),e.tile.level);s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){const t=e.displayId,s=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,s|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter(e=>"text"===e.type);if(s.length>0){const r=await this._getTextResources(e,s);return void(e.symbolResource={symbolInfo:t,textInfo:r})}e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r)}}async _convertToCIMSymbol(e){const t=f(e);return"web-style"===t.type?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:["cim","web"]})):t}async _createLinearCIM(e){return await y.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const s=this.container.instanceStore,r=this.view.stage.meshWriterRegistry,i=await R(e,t,s);return Promise.all(i.map(e=>r.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.consumePromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new v(e,s,t[0],t[3]);return this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=P.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return t?l(t)?w:p(t)||u(t)?S:this.defaultPointSymbolEnabled?b:null:this.defaultPointSymbolEnabled?b:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""}),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],A.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],A.prototype,"layerId",void 0),e([h({constructOnly:!0})],A.prototype,"requestUpdateCallback",void 0),e([h()],A.prototype,"container",void 0),e([h({constructOnly:!0})],A.prototype,"graphics",void 0),e([h()],A.prototype,"renderer",void 0),e([h()],A.prototype,"_updateTracking",void 0),e([h()],A.prototype,"updating",null),e([h()],A.prototype,"view",void 0),e([h()],A.prototype,"updateRequested",void 0),e([h()],A.prototype,"defaultPointSymbolEnabled",void 0),A=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],A);export{A as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import g from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as f,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as b,errorPolylineSymbol2D as w,errorPolygonSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as M}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as R}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createStorageSchema as j}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as U}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as x}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as C}from"../features/support/FeatureMetadata.js";import{GraphicsReader as q}from"../features/support/GraphicsReader.js";import G from"./GraphicStore.js";import{FeatureCommandQueue as k}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as F}from"../support/UpdateTracking2D.js";class P{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new P(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new P(e,s);for(const i of t)r.append(i);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||(this._reader=q.from(this.addedOrModified,this.tile,this.metadata)),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let A=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new F({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new k({process:e=>{if("update"===e.type)return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new x({spatialReference:this.view.spatialReference,fields:new g}),this._attributeStore=new U({isLocal:!0,update:e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=j(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=C.createGraphics(this.view.spatialReference),this._resourceProxy=new M({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([n(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new G(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return has("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e,t){if(!this.view||this.view.suspended)return[];const{resolution:r,rotation:i}=this.view.state,o=this._graphicStore.hitTest(e,t,r,i),a=new Set(o),n=this.graphics.items.reduce((e,t)=>(a.has(t.uid)&&e.set(t.uid,t),e),new Map);return o.map(e=>n.get(e)).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:s,highlightFlags:r}of e){const e=this._graphicStore.getItem(s)?.displayId;t.push({objectId:s,highlightFlags:r,displayId:e})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{if(has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;const e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(const s of e.updated)this.container.restartAnimation(s.objectId);if(!e.hasAnyUpdate())return void this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){P.getOrCreate(r,t,this._metadata).append(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const i of e){P.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){P.getOrCreate(i,t,this._metadata).append(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){P.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _densifyItemsForDisplay(e){const t=new Map;for(const s of e)for(const e of s.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){const t={timeZone:null,timeExtent:null};for(const{tile:s,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${s.id}] GraphicsView fetchResources`,e);const i=r.getCursor();for(;i.next();)for(const e of i.getMeshWriters())e.enqueueRequest(this._resourceProxy,i,s.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){const t={timeZone:null,timeExtent:null},s=new T(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());for(const i of r.getMeshWriters())i.write(s,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(t),e.tile.level);s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){const t=e.displayId,s=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,s|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter(e=>"text"===e.type);if(s.length>0){const r=await this._getTextResources(e,s);return void(e.symbolResource={symbolInfo:t,textInfo:r})}e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r)}}async _convertToCIMSymbol(e){const t=f(e);return"web-style"===t.type?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:["cim","web"]})):t}async _createLinearCIM(e){return await y.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const s=this.container.instanceStore,r=this.view.stage.meshWriterRegistry,i=await R(e,t,s);return Promise.all(i.map(e=>r.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.consumePromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new v(e,s,t[0],t[3]);return r.presenting=!0,this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=P.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.update({type:"append",append:i,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return t?l(t)?w:p(t)||u(t)?S:this.defaultPointSymbolEnabled?b:null:this.defaultPointSymbolEnabled?b:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""}),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],A.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],A.prototype,"layerId",void 0),e([h({constructOnly:!0})],A.prototype,"requestUpdateCallback",void 0),e([h()],A.prototype,"container",void 0),e([h({constructOnly:!0})],A.prototype,"graphics",void 0),e([h()],A.prototype,"renderer",void 0),e([h()],A.prototype,"_updateTracking",void 0),e([h()],A.prototype,"updating",null),e([h()],A.prototype,"view",void 0),e([h()],A.prototype,"updateRequested",void 0),e([h()],A.prototype,"defaultPointSymbolEnabled",void 0),A=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],A);export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{property as a,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{mosaicPixelData as o}from"../../../../layers/raster/functions/pixelUtils.js";import{BitmapContainer as l}from"../../engine/BitmapContainer.js";import{Container as n}from"../../engine/Container.js";import p from"../../engine/ImageryBitmapSource.js";import h from"../support/ExportStrategy.js";import{readFromPixelData as c}from"../../../support/rasterHitTestUtils.js";let g=class extends e{constructor(){super(...arguments),this.attached=!1,this.container=new n,this.updateRequested=!1,this.pixelHighlights=[],this.type="imagery",this._bitmapView=new l}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(t=>{r(t)||i.getLogger(this).error(t)})}async hitTest(t){let e=null;const{bitmaps:i}=this.strategy;if(1===i.length&&i[0].source)e={extent:i[0].source.extent,pixelBlock:i[0].source.originalPixelBlock};else if(i.length>1){const r=i.map(t=>t.source).find(e=>e.extent&&e.extent.contains(t));r&&(e={extent:r.extent,pixelBlock:r.originalPixelBlock})}return e?.pixelBlock?await c({mapPoint:t,layer:this.layer,pixelData:e}):null}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new h({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=e.originalPixelBlock??e.pixelBlock,{pixelHighlights:r}=this,a=r.length>0,s=await this.layer.applyRenderer({extent:e.extent,pixelBlock:i,isRawData:a}),o=s.pixelBlock;a&&i&&o&&await this.layer.highlightPixels({pixelBlock:i,renderedPixelBlock:o,highlightOptions:r}),e.filter=t=>this.layer.pixelFilter?this.layer.applyFilter(t):{...s,extent:e.extent}}).catch(t=>{r(t)||i.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(1===t.length&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(t=>t.source).filter(t=>t.extent&&t.extent.intersects(e)).map(t=>({extent:t.extent,pixelBlock:t.originalPixelBlock})),r=o(i,e);return null!=r?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent;const a=this.pixelHighlights.length>0;r.requestAsImageElement=!a,r.returnImageBitmap=!a,r.requestRawData=a;const s=await this.layer.internalFetchImage(t,e,i,r);if(s.imageBitmap)return s.imageBitmap;const o=await this.layer.applyRenderer({...s.pixelData,isRawData:a},{signal:r.signal}),l=s.pixelData.pixelBlock,n=o.pixelBlock;a&&l&&n&&await this.layer.highlightPixels({pixelBlock:l,renderedPixelBlock:n,highlightOptions:this.pixelHighlights});const h=new p(n,o.extent?.clone(),l);return h.filter=t=>this.layer.applyFilter(t),h}};t([a()],g.prototype,"attached",void 0),t([a()],g.prototype,"container",void 0),t([a()],g.prototype,"layer",void 0),t([a()],g.prototype,"strategy",void 0),t([a()],g.prototype,"timeExtent",void 0),t([a()],g.prototype,"view",void 0),t([a()],g.prototype,"updateRequested",void 0),t([a()],g.prototype,"updating",null),t([a()],g.prototype,"pixelHighlights",void 0),t([a()],g.prototype,"type",void 0),g=t([s("esri.views.2d.layers.imagery.ImageryView2D")],g);export{g as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{property as a,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{mosaicPixelData as o}from"../../../../layers/raster/functions/pixelUtils.js";import{BitmapContainer as l}from"../../engine/BitmapContainer.js";import{Container as n}from"../../engine/Container.js";import p from"../../engine/ImageryBitmapSource.js";import h from"../support/ExportStrategy.js";import{readFromPixelData as c}from"../../../support/rasterHitTestUtils.js";let g=class extends e{constructor(){super(...arguments),this.attached=!1,this.container=new n,this.updateRequested=!1,this.pixelHighlights=[],this.type="imagery",this._bitmapView=new l}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(t=>{r(t)||i.getLogger(this).error(t)})}async hitTest(t){if(this.layer.isRenderedFormat)return null;let e=null;const{bitmaps:i}=this.strategy;if(1===i.length&&i[0].source)e={extent:i[0].source.extent,pixelBlock:i[0].source.originalPixelBlock};else if(i.length>1){const r=i.map(t=>t.source).find(e=>e.extent&&e.extent.contains(t));r&&(e={extent:r.extent,pixelBlock:r.originalPixelBlock})}return e?.pixelBlock?await c({mapPoint:t,layer:this.layer,pixelData:e}):null}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new h({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=e.originalPixelBlock??e.pixelBlock,{pixelHighlights:r}=this,a=r.length>0,s=await this.layer.applyRenderer({extent:e.extent,pixelBlock:i,isRawData:a}),o=s.pixelBlock;a&&i&&o&&await this.layer.highlightPixels({pixelBlock:i,renderedPixelBlock:o,highlightOptions:r}),e.filter=t=>this.layer.pixelFilter?this.layer.applyFilter(t):{...s,extent:e.extent}}).catch(t=>{r(t)||i.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(1===t.length&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(t=>t.source).filter(t=>t.extent&&t.extent.intersects(e)).map(t=>({extent:t.extent,pixelBlock:t.originalPixelBlock})),r=o(i,e);return null!=r?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent;const a=this.pixelHighlights.length>0;r.requestAsImageElement=!a,r.returnImageBitmap=!a,r.requestRawData=a;const s=await this.layer.internalFetchImage(t,e,i,r);if(s.imageBitmap)return s.imageBitmap;const o=await this.layer.applyRenderer({...s.pixelData,isRawData:a},{signal:r.signal}),l=s.pixelData.pixelBlock,n=o.pixelBlock;a&&l&&n&&await this.layer.highlightPixels({pixelBlock:l,renderedPixelBlock:n,highlightOptions:this.pixelHighlights});const h=new p(n,o.extent?.clone(),l);return h.filter=t=>this.layer.applyFilter(t),h}};t([a()],g.prototype,"attached",void 0),t([a()],g.prototype,"container",void 0),t([a()],g.prototype,"layer",void 0),t([a()],g.prototype,"strategy",void 0),t([a()],g.prototype,"timeExtent",void 0),t([a()],g.prototype,"view",void 0),t([a()],g.prototype,"updateRequested",void 0),t([a()],g.prototype,"updating",null),t([a()],g.prototype,"pixelHighlights",void 0),t([a()],g.prototype,"type",void 0),g=t([s("esri.views.2d.layers.imagery.ImageryView2D")],g);export{g as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"./DebugOverlay.js";function t(t,a){t.container.addChild(new e({getMesh:e=>"vector-tile"===t.layer.type?o(t,e,a):n(t,e,a),getColors:s,getOpacities:i}))}const a=(t,a,r)=>{let n=0;const o=[],s=[];for(const i of t.children)if(i.symbols)for(const
|
|
2
|
+
import e from"./DebugOverlay.js";function t(t,a){t.container.addChild(new e({getMesh:e=>"vector-tile"===t.layer.type?o(t,e,a):n(t,e,a),getColors:s,getOpacities:i}))}const a=(t,a,r)=>{let n=0;const o=[],s=[];for(const i of t.children)if(i.symbols)for(const c of i.symbols.values())for(const i of c)for(const c of i.colliders(t)){const t=(c.xScreen+c.dxScreen)*a,u=(c.yScreen+c.dyScreen)*a,l=c.width*a,x=c.height*a,p=i.uniqueSymbol?.parts[c.partIndex].targetOpacity>.5;if(!p&&"all"!==r)continue;const f=3,d=1,h=3,v=0,D=p?2:0,y=p?3:0,g=e.makeFlags(D,y);o.push(t,u,g,t+l,u,g,t,u+x,g,t+l,u+x,g),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4;const m=p?f:d,C=p?h:v,w=e.makeFlags(m,C);o.push(t,u,w,t+l,u,w,t,u+1,w,t+l,u+1,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t,u+x-1,w,t+l,u+x-1,w,t,u+x,w,t+l,u+x,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t,u,w,t+1,u,w,t,u+x,w,t+1,u+x,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t+l-1,u,w,t+l,u,w,t+l-1,u+x,w,t+l,u+x,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4}return{vertexData:o,indexData:s,vertexCount:n}},r=(t,a)=>{let{vertexData:r,indexData:n,vertexCount:o}=a;const[s,i]=t.decluttererOffset,c=e.makeFlags(2,3),u=256,l=256,x=u+s,p=l+i;for(const e of[-3,3])for(const t of[-3,3])r.push(u,l,c,u+e,l+t,c,x,p,c,x+e,p+t,c),n.push(o,o+1,o+2,o+1,o+3,o+2),o+=4},n=(e,t,r)=>{const{pixelRatio:n}=t.state,{vertexData:o,indexData:s}=a(e.featureContainer,n,r);return{vertexData:new Int16Array(o),indexData:new Uint32Array(s)}},o=(e,t,n)=>{const{pixelRatio:o}=t.state,s=e._vectorTileContainer,{vertexData:i,indexData:c,vertexCount:u}=a(s,o,n),{symbolFader:l}=s;return l&&r(l,{vertexData:i,indexData:c,vertexCount:u}),{vertexData:new Int16Array(i),indexData:new Uint32Array(c)}},s=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],i=()=>[.05,.01,.15,.2];export{t as showCollisionBoxes};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../Graphic.js";import{isSome as
|
|
2
|
+
import e from"../../../Graphic.js";import{isSome as t}from"../../../core/arrayUtils.js";import{isIterable as i}from"../../../core/iteratorUtils.js";import{createScreenPoint as r}from"../../../core/screenUtils.js";import{clipContainsScreenRect as n,clipContainsPoint as a}from"./clippingUtils.js";import{isSupportedScreenPointEvent as s,createScreenPointFromSupportedEvent as l}from"../../support/screenUtils.js";function o(e){return e&&"width"in e&&"height"in e}function c(e){return e&&!("width"in e)&&!("height"in e)}function p(e){const t=o(e),i=c(e);if(t){return{hittestType:"rect",input:e}}if(i){return{hittestType:"point",input:e}}}async function f(e,i,c){let p=[];const f=!s(i)&&o(i),w=f?i:s(i)?l(e,i):i;if(f){const e=i;p=[r(e.x,e.y+e.height),r(e.x+e.width,e.y+e.height),r(e.x+e.width,e.y),r(e.x,e.y)]}else p=[w];if(!e.ready||p.some(({x:e,y:t})=>isNaN(e)||isNaN(t)))return{screenPoint:w,results:[]};let m=new Set;const x=new Set;let V=!1,j=null,M=null;c?.include?y(c.include,u(e,e=>{m.add(e),d(e,e=>x.add(e))},(e,t)=>{x.add(e),m.add(t)},e=>{j||(j=new Set),j.add(e)},e=>m.add(e),()=>V=!0)):(V=!0,m=new Set(e.allLayerViews),m.forEach(e=>{d(e,e=>x.add(e))})),c?.exclude&&y(c.exclude,u(e,e=>{m.delete(e),d(e,e=>x.delete(e))},e=>x.delete(e),e=>{M||(M=new Set),M.add(e)}));const b=g(e,i),L=b[0],S=e.allLayerViews.filter(t=>!t.suspended&&m.has(t)&&(f?t.clips.every(t=>n(e,t,p,b[0])):t.clips.every(t=>a(e,t,p[0],b[0])))).reverse();let U=[...V?e.graphicsView.hitTest(e,w).map(e=>({type:"graphic",graphic:e,layer:null,mapPoint:f?null:L})):[],...await Promise.all(S.map(e=>e.hitTest(L,w)).toArray())].filter(t).flat().filter(t);return U=U.filter(e=>"graphic"!==e.type||"subtype-group"!==e.layer?.type||x.has(e.graphic.layer)),j&&(U=U.filter(e=>!("graphic"in e)||!e.graphic||j?.has(h(e.graphic)))),M&&(U=U.filter(e=>!("graphic"in e)||!e.graphic||!M?.has(h(e.graphic)))),{screenPoint:w,results:U}}function u(t,i,r,n,a,s){return l=>{if(l instanceof e){if(l.layer===t)s?.();else{const e=t.allLayerViews.find(e=>e.layer===l.layer);e&&a?.(e)}n(h(l))}else if("layer"in l&&"element"in l);else if("subtype-sublayer"===l.type){const e=t.allLayerViews.find(e=>e.layer===l.parent);e&&r(l,e)}else{const e=t.allLayerViews.find(e=>e.layer===l);e&&i(e)}}}function y(e,t){if(e)if(i(e))for(const r of e)if(i(r))for(const e of r)t(e);else t(r);else t(e)}function h(e){const t=e.getObjectId();return t?`${e.layer?.uid??e.sourceLayer?.uid??"MapView"}/${t}`:`"MapView/${e.uid}`}function d(e,t){const i=e.layer;"subtype-group"===i?.type&&i.sublayers.forEach(e=>{t(e)})}function g(e,t){if(o(t)){const i=t;return[e.toMap(r(i.x,i.y)),e.toMap(r(i.x,i.y+i.height)),e.toMap(r(i.x+i.width,i.y+i.height)),e.toMap(r(i.x+i.width,i.y))]}return[e.toMap(t)]}export{p as createHittestQuery,g as getMapPointsFromScreen,f as hitTest,c as isScreenPoint,o as isScreenRect};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import s
|
|
2
|
+
import{TileCombinedCoverage as s}from"./TileCombinedCoverage.js";function e(s,e){const t=new Set;for(const i of s instanceof Set?s.values():s.keys())e.has(i)||t.add(i);return t}class t{constructor(s){this.version=s}}class i{constructor(s){this._tileInfoView=s,this._subscriptions=new Map,this._version=0}destroy(){}get coverage(){return this._coverage}get subscriptions(){return new Set(this._subscriptions.keys())}suspend(s){this._suspendedCoverage=this._coverage,this._coverage=null,this._updateSubscriptions(s)}resume(s){null==this._coverage&&(this._coverage=this._suspendedCoverage,this._suspendedCoverage=null,this._updateSubscriptions(s))}update(e,t,i){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._coverage=new s(this._tileInfoView,e,t),this._updateSubscriptions(i)}_updateSubscriptions(s){if(!this._coverage)return null;const i=new Set(Array.from(this._coverage.values()).map(s=>s.id)),r=e(this._subscriptions,s),o=e(i,this._subscriptions),n=e(r,i);for(const e of o.values())this._subscriptions.set(e,new t(this._version));for(const e of n.values())this._subscriptions.delete(e);if(o.size||n.size){return{subscribe:Array.from(o.values()).map(s=>({tileId:s,version:this._subscriptions.get(s).version})),unsubscribe:Array.from(n.values())}}return null}}export{i as FeatureTileSubscriptionManager};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
class e{constructor(e,o,s){this._coverage=new Map;const r=s?e.getTileCoverage(s,0,!0,"closest"):null,t=e.getTileCoverage(o,0,!0,"closest");if(!t)throw new Error("InternalError: Target coverage should be defined");const a=Array.from(t.keys()),i=new Map;for(const c of a)i.set(c.id,c);if(r)for(const c of r.keys())a.some(e=>e.containsChild(c)||c.containsChild(e))||i.set(c.id,c);this._coverage=i}*values(){yield*this._coverage.values()}*keys(){yield*this._coverage.keys()}}export{e as TileCombinedCoverage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import i from"../../../../core/Handles.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{memoize as s}from"../../../../core/memoize.js";import{ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{when as l,syncAndInitial as p,initial as u}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{create as g,fromPoints as _}from"../../../../geometry/support/lineSegment.js";import{hydrateGeometry as m,clonePoint as v}from"../../../../layers/graphics/hydratedFeatures.js";import{absoluteHeightElevationInfo as b,getGraphicEffectiveElevationInfo as y,getConvertedElevation as f}from"../../../../support/elevationInfoUtils.js";import M from"../../../../symbols/support/ElevationInfo.js";import{getLaserLineColors as T,laserLineConfiguration as P}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as w,LineOfSightObserverManipulator as S}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as L}from"./LineOfSightRayIntersector.js";import{SnappingVisualizer3D as k}from"../../interactive/SnappingVisualizer3D.js";import{LaserlineVisualElement as C}from"../../interactive/visualElements/LaserlineVisualElement.js";import{mouseButtons as O}from"../../../input/mouseButtons.js";import{AnalysisToolBase as H}from"../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as I}from"../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as R}from"../../../interactive/dragEventPipeline.js";import{EditGeometry as j}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as E}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as V}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as x}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as G}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as A}from"../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as F}from"../../../support/screenUtils.js";let U=class extends H{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._trackerIntersection=null,this._trackerMapPoint=null,this._snappingManagerResult=null,this._analysisHandles=new i,this._updatingHandles=new d,this._manipulatorHandles=new i,this._targetTrackerManipulator=null,this._getSnappingContext=s(e=>new V({elevationInfo:b,pointer:e,editGeometryOperations:new E(new j("point",I(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new k}))}initialize(){this._intersector=new L({view:this.view}),this._snappingOperation=new G({view:this.view}),A(this,()=>{const e=this.view.inputManager.latestPointerInfo?.type??"mouse",t=this._getSnappingContext(e);this._updatingHandles.consumePromise(o(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}),this.addHandles(l(()=>"created"===this.state,()=>this.finishToolCreation(),p)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData?.elevationAlignedObserver,e=>this._onObserverLocationChange(e),u),this._updatingHandles.add(()=>T(this.view.effectiveTheme),({glowColor:e,innerColor:t,globalAlpha:n})=>this._updateLaserLineStyle(e,t,n),u),this._updatingHandles.add(()=>this._laserLineRendererDependencies(),e=>this._updateLaserLineRenderer(e)),this._connectComputations(),this._updatingHandles.addWhen(()=>!this._shouldRenderTracker,()=>this._clearCursorTracker(),u),this._updatingHandles.add(()=>({active:this.active,hasGrabbedManipulators:this.hasGrabbedManipulators}),({active:e,hasGrabbedManipulators:t})=>{this._creationMode=!!e&&(this._creationMode||!t)},u),this._updatingHandles.add(()=>({observerPosition:this.analysis.observer?.position,showTracker:this._showTracker,hasGrabbedManipulators:this.hasGrabbedManipulators,stagedPoint:this._snappingOperation.stagedPoint,trackerIntersection:this._trackerIntersection}),({observerPosition:e,showTracker:t,hasGrabbedManipulators:i,stagedPoint:a,trackerIntersection:r})=>{if(null==e||!t||i||null==r?.mapPoint)return;this.analysisViewData.cursorTarget??=new n;const s=null!=a?m(a):r.mapPoint,o=this._resolveIntersection(r,s);this._updateFromIntersection(this.analysisViewData.cursorTarget,o,s),this._updateLaserLineRenderer()},u)])}destroy(){this._updatingHandles=r(this._updatingHandles),this._manipulatorHandles=r(this._manipulatorHandles),this._analysisHandles=r(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._snappingOperation=r(this._snappingOperation),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?"creating":"created":null!=this.analysis.observer?.position?"created":"ready"}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return!!this.analysisViewData?.updating||!!this._snappingManager?.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}get _snappingManager(){return this._snappingManagerResult?.snappingManager}get snappingOptions(){return this._snappingManager?.options}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this.analysisViewData.computations,e=>this._onComputationsCollectionChange(e),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_connectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const n=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&n.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=n,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add(()=>B(e),()=>W(n,e),u),this._updatingHandles.add(()=>e.elevationAlignedTargetLocation,e=>this._onTargetLocationChange(e,n),u)],e)}_disconnectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);null!=t&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),null!=this._targetTrackerManipulator&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this._trackerIntersection=null,this._trackerMapPoint=null,this._resetSnappingState(),this.analysisViewData.cursorTarget=r(this.analysisViewData.cursorTarget)}_ensureSnappingManager(){if(null==this._snappingManagerResult){const e=x(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}_createTargetManipulator(e){const t={target:e,type:"target"},n=new w(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(n),n.events.on("grab-changed",e=>this._manipulatorGrabChanged(n,e)),n.events.on("immediate-click",e=>this._manipulatorClick(n,e))],n),this.manipulators.add(n),null!=e.position?n.elevationAlignedLocation=e.position:n.available=!1,n}_getTargetManipulator(e){let t=null;return this.manipulators.forEach(n=>{const i=n.manipulator;null==t&&"target"===i.metadata.type&&i.metadata.target===e&&(t=i)}),t}_createObserverManipulator(){const e=new S(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",t=>this._manipulatorGrabChanged(e,t)),e.events.on("immediate-click",t=>this._manipulatorClick(e,t))],e),this.manipulators.add(e),e}_createTargetManipulatorDragPipeline(e){return R(e,(t,n,i,a)=>{const r=this._ensureSnappingManager(),{snappingStep:s,cancelSnapping:o}=D({snappingManager:r,snappingContext:this._getSnappingContext(a),updatingHandles:this._updatingHandles});n.next(this._screenToSnappingDragEvent()).next(...s).next(this._updateIntersectionFromSnappedPoint()).next(this._updateTargetDragStep(e)).next(()=>this._updateLaserLineRenderer()),i.next(z(e.metadata.target)).next(o).next(()=>this._updateLaserLineRenderer())})}_createObserverManipulatorDragPipeline(e){return R(e,(e,t,n,i)=>{const a=this._ensureSnappingManager(),{snappingStep:r,cancelSnapping:s}=D({snappingManager:a,snappingContext:this._getSnappingContext(i),updatingHandles:this._updatingHandles});t.next(this._screenToSnappingDragEvent()).next(...r).next(this._updateIntersectionFromSnappedPoint()).next(this._updateObserverDragStep()).next(()=>this._updateLaserLineRenderer()),n.next(this._cancelObserverDragStep()).next(s).next(()=>this._updateLaserLineRenderer())})}_screenToSnappingDragEvent(){let e=null;return t=>{"start"===t.action&&(e=this._intersector.getScreenPointIntersection(t.screenStart));const n=this._intersector.getScreenPointIntersection(t.screenEnd);return null==e?.mapPoint||null==n?.mapPoint?null:{...t,intersection:n,mapStart:v(e.mapPoint),mapEnd:v(n.mapPoint)}}}_updateIntersectionFromSnappedPoint(){return e=>(e.intersection=this._resolveIntersection(e.intersection,e.mapEnd),e)}_updateObserverDragStep(){return e=>(this.analysis.observer??=new t,this._updateFromIntersection(this.analysis.observer,e.intersection,e.mapEnd),e)}_cancelObserverDragStep(){const e=null!=this.analysis.observer?.position?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>(this._updateFromIntersection(e.metadata.target,t.intersection,t.mapEnd),e.elevationAlignedLocation=t.mapEnd,t)}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:n,shouldRenderTracker:i,observerPosition:a,visible:r}=e;if(null==t)return;const s=null!=n?n:i&&null!=a?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=_(this._observerManipulator.renderLocation,s.renderLocation,q):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=P;this._laserlineVisualElement=new C({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:t},isDecoration:!0})}_removeLaserLine(){null!=this._laserlineVisualElement&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,t,n){const i=this._laserlineVisualElement;if(null==i)return;const a=i.style;i.style={...a,glowColor:e.toUnitRGB(),innerColor:t.toUnitRGB(),globalAlpha:n}}_onObserverLocationChange(e){null!=e?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){null!=e?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e,i){const a=this._getPlacementLocation(e,i);if(null==a)return;const{intersection:r,point:s}=a;if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new n;this._updateFromIntersection(e,r,s),this.analysis.targets.add(e)}else{const e=new t;this._updateFromIntersection(e,r,s),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==O.Right&&(this._addPointFromClickEvent(F(e),e.pointerType),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==O.Right&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker)return void this._clearCursorTracker();const t=F(e),n=this._intersector.getScreenPointIntersection(t),i=n?.mapPoint;null!=n?.mapPoint&&null!=i?(this._trackerIntersection=n,this._trackerMapPoint=i,this._updateHoverSnapping(i,e.pointerType)):this._clearCursorTracker()}_getPlacementLocation(e,t){const n=this._intersector.getScreenPointIntersection(e);if(null==n?.mapPoint)return null;const i=n.mapPoint;if(!this._shouldUsePlacementSnapping(t))return{intersection:n,point:i};const a=n.mapPoint,r=this._trackerMapPoint?.equals(a)?this._snappingOperation.stagedPoint:null,s=m(r??this._snappingOperation.update({point:a},this._ensureSnappingManager(),this._getSnappingContext(t)));return{intersection:this._resolveIntersection(n,s),point:s}}_shouldUsePlacementSnapping(e){return"touch"!==e}_updateHoverSnapping(e,t){const n=this._getSnappingContext(t);this._updatingHandles.consumePromise(o(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}_updateFromIntersection(e,t,n=t.mapPoint){if(null==n)return e.position=null,e.elevationInfo=null,void(e.feature=null);const i=!t.mapPoint?.equals(n);switch(t.context?.type){case"graphic":{const n=t.context.graphic,i=y(n);"on-the-ground"===i.mode&&(i.mode="relative-to-ground",i.offset=0),e.elevationInfo=new M(i),e.feature=n}break;case"ground":e.elevationInfo=new M({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}i&&(e.elevationInfo=null);const a=n.clone();a.z=f(this.view,a,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=a}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==O.Right||this.analysis.targets.length<=1)return;const{target:n}=e.metadata;this.analysis.targets.remove(n),t.stopPropagation()}get testInfo(){}_resetSnappingState(){this._snappingManager?.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_resolveIntersection(e,t){return e.mapPoint?.equals(t)?e:this._intersector.getMapPointIntersection(t)??e}};function z(e){const t=e.position?.clone();return n=>(e.position=t,n)}function W(e,t){const{isValid:n,isTargetVisible:i}=t.computationResult;e.state=n?i?16:32:64}function B(e){const{isValid:t,isTargetVisible:n}=e.computationResult;return{isValid:t,isTargetVisible:n}}e([c({constructOnly:!0})],U.prototype,"view",void 0),e([c({constructOnly:!0})],U.prototype,"analysis",void 0),e([c()],U.prototype,"_creationMode",void 0),e([c({readOnly:!0})],U.prototype,"state",null),e([c({readOnly:!0})],U.prototype,"cursor",null),e([c()],U.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],U.prototype,"updating",null),e([c({constructOnly:!0})],U.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],U.prototype,"_showTracker",null),e([c()],U.prototype,"_latestPointerMovePointerType",void 0),e([c()],U.prototype,"_shouldRenderTracker",null),e([c()],U.prototype,"_laserlineVisualElement",void 0),e([c()],U.prototype,"_grabbedManipulator",void 0),e([c()],U.prototype,"_trackerIntersection",void 0),e([c()],U.prototype,"_trackerMapPoint",void 0),e([c()],U.prototype,"_snappingManagerResult",void 0),U=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],U);const q=g();export{U as LineOfSightTool};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import i from"../../../../core/Handles.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{memoize as s}from"../../../../core/memoize.js";import{ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{when as l,syncAndInitial as p,initial as u}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{fromPoints as g,create as _}from"../../../../geometry/support/lineSegment.js";import{hydrateGeometry as m,clonePoint as v}from"../../../../layers/graphics/hydratedFeatures.js";import{absoluteHeightElevationInfo as b,getGraphicEffectiveElevationInfo as y,getConvertedElevation as f}from"../../../../support/elevationInfoUtils.js";import M from"../../../../symbols/support/ElevationInfo.js";import{getLaserLineColors as T,laserLineConfiguration as P}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as w,LineOfSightObserverManipulator as S}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as L}from"./LineOfSightRayIntersector.js";import{SnappingVisualizer3D as k}from"../../interactive/SnappingVisualizer3D.js";import{LaserlineVisualElement as C}from"../../interactive/visualElements/LaserlineVisualElement.js";import{mouseButtons as O}from"../../../input/mouseButtons.js";import{AnalysisToolBase as H}from"../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as I}from"../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as R}from"../../../interactive/dragEventPipeline.js";import{EditGeometry as j}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as E}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as V}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as x}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as G}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as A}from"../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as F}from"../../../support/screenUtils.js";let U=class extends H{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._trackerIntersection=null,this._trackerMapPoint=null,this._snappingManagerResult=null,this._analysisHandles=new i,this._updatingHandles=new d,this._manipulatorHandles=new i,this._targetTrackerManipulator=null,this._getSnappingContext=s(e=>new V({elevationInfo:b,pointer:e,editGeometryOperations:new E(new j("point",I(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new k}))}initialize(){this._intersector=new L({view:this.view}),this._snappingOperation=new G({view:this.view}),A(this,()=>{const e=this.view.inputManager.latestPointerInfo?.type??"mouse",t=this._getSnappingContext(e);this._updatingHandles.consumePromise(o(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}),this.addHandles(l(()=>"created"===this.state,()=>this.finishToolCreation(),p)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData?.elevationAlignedObserver,e=>this._onObserverLocationChange(e),u),this._updatingHandles.add(()=>T(this.view.effectiveTheme),({glowColor:e,innerColor:t,globalAlpha:n})=>this._updateLaserLineStyle(e,t,n),u),this._updatingHandles.add(()=>this._laserLineRendererDependencies(),e=>this._updateLaserLineRenderer(e)),this._connectComputations(),this._updatingHandles.addWhen(()=>!this._shouldRenderTracker,()=>this._clearCursorTracker(),u),this._updatingHandles.add(()=>({active:this.active,hasGrabbedManipulators:this.hasGrabbedManipulators}),({active:e,hasGrabbedManipulators:t})=>{this._creationMode=!!e&&(this._creationMode||!t)},u),this._updatingHandles.add(()=>({observerPosition:this.analysis.observer?.position,showTracker:this._showTracker,hasGrabbedManipulators:this.hasGrabbedManipulators,stagedPoint:this._snappingOperation.stagedPoint,trackerIntersection:this._trackerIntersection}),({observerPosition:e,showTracker:t,hasGrabbedManipulators:i,stagedPoint:a,trackerIntersection:r})=>{if(null==e||!t||i||null==r?.mapPoint)return;this.analysisViewData.cursorTarget??=new n;const s=null!=a?m(a):r.mapPoint,o=this._resolveIntersection(r,s);this._updateFromIntersection(this.analysisViewData.cursorTarget,o,s),this._updateLaserLineRenderer()},u)])}destroy(){this._updatingHandles=r(this._updatingHandles),this._manipulatorHandles=r(this._manipulatorHandles),this._analysisHandles=r(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._snappingOperation=r(this._snappingOperation),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?"creating":"created":null!=this.analysis.observer?.position?"created":"ready"}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return!!this.analysisViewData?.updating||!!this._snappingManager?.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}get _snappingManager(){return this._snappingManagerResult?.snappingManager}get snappingOptions(){return this._snappingManager?.options}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this.analysisViewData.computations,e=>this._onComputationsCollectionChange(e),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_connectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const n=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&n.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=n,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add(()=>B(e),()=>W(n,e),u),this._updatingHandles.add(()=>e.elevationAlignedTargetLocation,e=>this._onTargetLocationChange(e,n),u)],e)}_disconnectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);null!=t&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),null!=this._targetTrackerManipulator&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this._trackerIntersection=null,this._trackerMapPoint=null,this._resetSnappingState(),this.analysisViewData.cursorTarget=r(this.analysisViewData.cursorTarget)}_ensureSnappingManager(){if(null==this._snappingManagerResult){const e=x(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}_createTargetManipulator(e){const t={target:e,type:"target"},n=new w(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(n),n.events.on("grab-changed",e=>this._manipulatorGrabChanged(n,e)),n.events.on("immediate-click",e=>this._manipulatorClick(n,e))],n),this.manipulators.add(n),null!=e.position?n.elevationAlignedLocation=e.position:n.available=!1,n}_getTargetManipulator(e){let t=null;return this.manipulators.forEach(n=>{const i=n.manipulator;null==t&&"target"===i.metadata.type&&i.metadata.target===e&&(t=i)}),t}_createObserverManipulator(){const e=new S(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",t=>this._manipulatorGrabChanged(e,t)),e.events.on("immediate-click",t=>this._manipulatorClick(e,t))],e),this.manipulators.add(e),e}_createTargetManipulatorDragPipeline(e){return R(e,(t,n,i,a)=>{const r=this._ensureSnappingManager(),{snappingStep:s,cancelSnapping:o}=D({snappingManager:r,snappingContext:this._getSnappingContext(a),updatingHandles:this._updatingHandles});n.next(this._screenToSnappingDragEvent()).next(...s).next(this._updateIntersectionFromSnappedPoint()).next(this._updateTargetDragStep(e)).next(()=>this._updateLaserLineRenderer()),i.next(z(e.metadata.target)).next(o).next(()=>this._updateLaserLineRenderer())})}_createObserverManipulatorDragPipeline(e){return R(e,(e,t,n,i)=>{const a=this._ensureSnappingManager(),{snappingStep:r,cancelSnapping:s}=D({snappingManager:a,snappingContext:this._getSnappingContext(i),updatingHandles:this._updatingHandles});t.next(this._screenToSnappingDragEvent()).next(...r).next(this._updateIntersectionFromSnappedPoint()).next(this._updateObserverDragStep()).next(()=>this._updateLaserLineRenderer()),n.next(this._cancelObserverDragStep()).next(s).next(()=>this._updateLaserLineRenderer())})}_screenToSnappingDragEvent(){let e=null;return t=>{"start"===t.action&&(e=this._intersector.getScreenPointIntersection(t.screenStart));const n=this._intersector.getScreenPointIntersection(t.screenEnd);return null==e?.mapPoint||null==n?.mapPoint?null:{...t,intersection:n,mapStart:v(e.mapPoint),mapEnd:v(n.mapPoint)}}}_updateIntersectionFromSnappedPoint(){return e=>(e.intersection=this._resolveIntersection(e.intersection,e.mapEnd),e)}_updateObserverDragStep(){return e=>(this.analysis.observer??=new t,this._updateFromIntersection(this.analysis.observer,e.intersection,e.mapEnd),e)}_cancelObserverDragStep(){const e=null!=this.analysis.observer?.position?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>(this._updateFromIntersection(e.metadata.target,t.intersection,t.mapEnd),e.elevationAlignedLocation=t.mapEnd,t)}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:n,shouldRenderTracker:i,observerPosition:a,visible:r}=e;if(null==t)return;const s=null!=n?n:i&&null!=a?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,q):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=P;this._laserlineVisualElement=new C({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:t},isDecoration:!0})}_removeLaserLine(){null!=this._laserlineVisualElement&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,t,n){const i=this._laserlineVisualElement;if(null==i)return;const a=i.style;i.style={...a,glowColor:e.toUnitRGB(),innerColor:t.toUnitRGB(),globalAlpha:n}}_onObserverLocationChange(e){null!=e?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){null!=e?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e,i){const a=this._getPlacementLocation(e,i);if(null==a)return;const{intersection:r,point:s}=a;if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new n;this._updateFromIntersection(e,r,s),this.analysis.targets.add(e)}else{const e=new t;this._updateFromIntersection(e,r,s),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==O.Right&&(this._addPointFromClickEvent(F(e),e.pointerType),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==O.Right&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker)return void this._clearCursorTracker();const t=F(e),n=this._intersector.getScreenPointIntersection(t),i=n?.mapPoint;null!=n?.mapPoint&&null!=i?(this._trackerIntersection=n,this._trackerMapPoint=i,this._updateHoverSnapping(i,e.pointerType)):this._clearCursorTracker()}_getPlacementLocation(e,t){const n=this._intersector.getScreenPointIntersection(e);if(null==n?.mapPoint)return null;const i=n.mapPoint;if(!this._shouldUsePlacementSnapping(t))return{intersection:n,point:i};const a=n.mapPoint,r=this._trackerMapPoint?.equals(a)?this._snappingOperation.stagedPoint:null,s=m(r??this._snappingOperation.update({point:a},this._ensureSnappingManager(),this._getSnappingContext(t)));return{intersection:this._resolveIntersection(n,s),point:s}}_shouldUsePlacementSnapping(e){return"touch"!==e}_updateHoverSnapping(e,t){const n=this._getSnappingContext(t);this._updatingHandles.consumePromise(o(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}_updateFromIntersection(e,t,n=t.mapPoint){if(null==n)return e.position=null,e.elevationInfo=null,void(e.feature=null);const i=!t.mapPoint?.equals(n);switch(t.context?.type){case"graphic":{const n=t.context.graphic,i=y(n);"on-the-ground"===i.mode&&(i.mode="relative-to-ground",i.offset=0),e.elevationInfo=new M(i),e.feature=n}break;case"ground":e.elevationInfo=new M({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}i&&(e.elevationInfo=null);const a=n.clone();a.z=f(this.view,a,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=a}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==O.Right||this.analysis.targets.length<=1)return;const{target:n}=e.metadata;this.analysis.targets.remove(n),t.stopPropagation()}get testInfo(){}_resetSnappingState(){this._snappingManager?.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_resolveIntersection(e,t){return e.mapPoint?.equals(t)?e:this._intersector.getMapPointIntersection(t)??e}};function z(e){const t=e.position?.clone();return n=>(e.position=t,n)}function W(e,t){const{isValid:n,isTargetVisible:i}=t.computationResult;e.state=n?i?16:32:64}function B(e){const{isValid:t,isTargetVisible:n}=e.computationResult;return{isValid:t,isTargetVisible:n}}e([c({constructOnly:!0})],U.prototype,"view",void 0),e([c({constructOnly:!0})],U.prototype,"analysis",void 0),e([c()],U.prototype,"_creationMode",void 0),e([c({readOnly:!0})],U.prototype,"state",null),e([c({readOnly:!0})],U.prototype,"cursor",null),e([c()],U.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],U.prototype,"updating",null),e([c({constructOnly:!0})],U.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],U.prototype,"_showTracker",null),e([c()],U.prototype,"_latestPointerMovePointerType",void 0),e([c()],U.prototype,"_shouldRenderTracker",null),e([c()],U.prototype,"_laserlineVisualElement",void 0),e([c()],U.prototype,"_grabbedManipulator",void 0),e([c()],U.prototype,"_trackerIntersection",void 0),e([c()],U.prototype,"_trackerMapPoint",void 0),e([c()],U.prototype,"_snappingManagerResult",void 0),U=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],U);const q=_();export{U as LineOfSightTool};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../core/has.js";import{property as t,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{AnalysisToolBase as o}from"../../../interactive/AnalysisToolBase.js";const r={ready:"ready",creating:"creating",created:"created"};let a=class extends o{constructor(e){super(e),this.analysisViewData=null,this.removeIncompleteOnCancel=!1}get state(){return this.active?r.creating:null!=this.analysis.observer?.position?r.created:r.ready}place(e){return this.analysisViewData.interactive=!0,Promise.reject(new Error("not implemented"))}activate(){throw this.view.activeTool=null,new Error("not implemented")}deactivate(){this.onDeactivate()}continue(){throw new Error("not implemented")}stop(){this.view.activeTool=null}get testInfo(){}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}};e([t({constructOnly:!0})],a.prototype,"view",void 0),e([t({constructOnly:!0})],a.prototype,"analysis",void 0),e([t({constructOnly:!0})],a.prototype,"analysisViewData",void 0),e([t()],a.prototype,"state",null),e([t()],a.prototype,"removeIncompleteOnCancel",void 0),a=e([i("esri.views.3d.analysis.LineOfSight.LineOfSightTool2")],a);export{a as LineOfSightTool2};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import"../../../core/has.js";import{abortMaybe as
|
|
2
|
+
import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{abortMaybe as e,destroyMaybe as o}from"../../../core/maybe.js";import{property as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"./AnalysisView3D.js";import{LineOfSightController as p}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as u}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightTool2 as h}from"./LineOfSight/LineOfSightTool2.js";import{LineOfSightVisualization as y}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as c,removeAnalysisViewTool as g,startPlaceOperation as f}from"../../analysis/analysisViewUtils.js";function m(){return has("enable-feature:analysis-drawtool-line-of-sight")??!1}function d(){return m()?h:u}let v=class extends a{constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=l(),this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new p({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new y({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),c(this,d())])}destroy(){g(this),this.userOperation=e(this.userOperation),this._analysisController=o(this._analysisController),this._analysisVisualization=o(this._analysisVisualization)}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){if(m()){if(null==this.tool||null==this.tool.place)throw new s("LineOfSightAnalysisView3D:place","LineOfSightTool with placement support is not available");return this.tool.place(t)}return f(this,{placementOptions:t})}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([r({readOnly:!0})],v.prototype,"type",void 0),t([r({constructOnly:!0,nonNullable:!0})],v.prototype,"analysis",void 0),t([r()],v.prototype,"tool",void 0),t([r({readOnly:!0})],v.prototype,"results",null),t([r()],v.prototype,"priority",null),t([r()],v.prototype,"computations",void 0),t([r()],v.prototype,"cursorTarget",void 0),t([r()],v.prototype,"editable",void 0),t([r()],v.prototype,"elevationAlignedObserver",void 0),t([r()],v.prototype,"observerEngineLocation",void 0),t([r()],v.prototype,"updating",null),t([r()],v.prototype,"userOperation",void 0),t([r()],v.prototype,"_analysisController",void 0),t([r()],v.prototype,"_analysisVisualization",void 0),v=t([n("esri.views.3d.analysis.LineOfSightAnalysisView3D")],v);const O=v;export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as
|
|
2
|
+
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{roundToNearest as e}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{initial as l}from"../../../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../../../core/screenUtils.js";import{throttle as h}from"../../../../core/throttle.js";import{convertTime as p}from"../../../../core/timeUtils.js";import{property as u,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as g}from"../../../../intl/locale.js";import{fetchMessageBundle as w}from"../../../../intl/messages.js";import{substitute as v}from"../../../../intl/substitute.js";let f=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=y(),this._tooltipContentElement=D(),this._updatingHandles=new m,this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this.shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const i=d(t,o);this._screenPoint=i,this._throttledUpdateShadowDuration?.(this.view,i)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=i(async i=>{const{results:s,ground:e}=await t.hitTest(o);if(n(i),0===s.length&&!e.mapPoint)return void(this.shadowDuration=null);const a=await this.getDuration(o,i);n(i),this.shadowDuration=a})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=i(()=>w("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([g(t),this._updatingHandles.add(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},l),this._updatingHandles.add(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},l),this._updatingHandles.add(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},l),this._updatingHandles.add(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=h(this._updateShadowDuration,t)},l),s(()=>{this._throttledUpdateShadowDuration=a(this._throttledUpdateShadowDuration)})])}destroy(){this._updatingHandles.destroy(),this._tooltipElement.remove()}get updating(){return this._updatingHandles.updating||null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||null!=this._messagesTask&&!this._messagesTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this.shadowDuration;if(null==t||null==o)return"";const i=e(o,o<U?j:U);return v(this.getVisualizeSunlight()?t.sunlightDuration:t.shadowDuration,{duration:_(i)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},i=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this.shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",i),t.on("pointer-down",i),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):i()}),t.on("click",o=>{const i=d(o.x,o.y);this._screenPoint=i,this._updateShadowDuration(t,i)}),s(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=r(this._shadowDurationTask)}};function y(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],f.prototype,"view",void 0),t([u()],f.prototype,"isVisible",void 0),t([u()],f.prototype,"getDuration",void 0),t([u()],f.prototype,"throttleDelay",void 0),t([u()],f.prototype,"updating",null),t([u()],f.prototype,"getVisualizeSunlight",void 0),t([u()],f.prototype,"_messagesTask",void 0),t([u()],f.prototype,"_screenPoint",void 0),t([u()],f.prototype,"_shadowDurationTask",void 0),t([u()],f.prototype,"shadowDuration",void 0),t([u()],f.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],f.prototype,"_formattedText",null),t([u()],f.prototype,"_styles",null),f=t([c("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],f);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=p(1,"minutes","milliseconds"),U=p(15,"minutes","milliseconds");export{f as ShadowCastTooltip};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t,equals as i}from"../../../core/arrayUtils.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as o}from"../../../core/maybe.js";import{after as l,throwIfAborted as u,isPromiseLike as c}from"../../../core/promiseUtils.js";import{watch as p,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{offsetDateUTC as g,convertTime as _}from"../../../core/timeUtils.js";import{property as f,subclass as y}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as D}from"../../../core/support/UpdatingHandles.js";import{g as C}from"../../../chunks/boundedPlane.js";import{polygonToVolume as b}from"../focusAreaUtils.js";import V from"./AnalysisView3D.js";import{registerAnalysisView as U,hideOtherAnalysisViews as T}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as P}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as O}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as x}from"../support/earthUtils.js";import{computeDirectionsOverTime as j}from"../support/sunUtils.js";import{maxColorRampSize as S}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as z}from"../../../widgets/support/traversalUtils.js";let R=class extends V{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._updatingHandles=new D,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([U(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{n(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=s(async e=>{await l(M,e),u(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&T(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},d),p(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{L(e,i,t)},d),p(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:s})=>{L(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{L(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{L(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new P({getDuration:this.getDurationAtScreen.bind(this),isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&L(this._renderer,!0,{enabled:!1}),this._tooltip=o(this._tooltip),this._stopPreviewingTask=n(this._stopPreviewingTask),this._updatingHandles=o(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||null!=this._stopPreviewingTask&&!this._stopPreviewingTask.finished||!0===this._tooltip?.updating||this._updatingHandles.updating}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){return this._updatedRecently||this._sceneUpdating}get _sceneUpdating(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,graphicsView:i}=e;return!t||this._shadowLayerViews.some(e=>e.updating)||!i?.suspended&&!!i?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?x(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=g(e,-e.getTimezoneOffset(),"minutes"),e=g(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(B-1)):B}get _interval(){const e=this._totalDurationInterval;switch(this.analysis.mode){case"min-duration":return this._totalDuration>0?e:0;case"total-duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,minDurationOptions:t}=this.analysis;return"min-duration"===e&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?I:this._referencePosition;if(null==i)return[];const s=j(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,B),r=s.length;q.length=0;const a=z(0,r,q),n=new Array(r);for(let o=0;o<r;++o)n[o]=s[a[o]];return n}get _analysisVolume(){const{geometry:e}=this.analysis;if(null==e)return this._previousVolume=null,null;try{const t=b(e,this.view,F);return null==t?(this._previousVolume=null,null):c(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return a.getLogger(this).error(new r("shadowcastanalysisview3d:projection-failed","Failed to project analysis area geometry to view spatial reference",{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"min-duration":return this._minDurationVisualizationParameters;case"total-duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){const{color:e,minDuration:t}=this.analysis.minDurationOptions,i=this._totalDuration;return{visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){const{minDurationOptions:e}=this.analysis;return e.contextEnabled?{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e.contextOptions.color,e.contextOptions.colorStops,1/this._lightDirectionsContext.length)}:{}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?G/s:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/s);return 0===r?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{bandedGradientColorRamp:a,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions;return{gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,1/this._lightDirections.length),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(k)}get _previewDependencies(){const{view:e}=this,i=e.slice.plane,s=this._shadowLayerViews,r=s.map(e=>e.layer).filter(t),a=s.map(e=>e.suspended),n=r.map(e=>e.visible),o=r.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=r.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),c=s.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:i,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:l,layerVisibilities:n,layerOpacities:o,filters:c,definitionExpressions:u}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){const{_renderer:t,_totalDurationSampleCount:i}=this;if(null==t||0===i)return 0;const s=this.view.state.camera.screenToRender(h(e.x,e.y),m());return t.readAccumulatedShadow(s)*this._totalDuration}_getEffectiveShadowCastColorRamp(e,t,i){if(null!=t){t.length>S&&a.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return E(e)}};e([f({readOnly:!0,type:["shadow-cast-view-3d"]})],R.prototype,"type",void 0),e([f({constructOnly:!0,nonNullable:!0})],R.prototype,"analysis",void 0),e([f({readOnly:!0})],R.prototype,"updating",null),e([f()],R.prototype,"_stopPreviewingTask",void 0),e([f()],R.prototype,"_updatedRecently",void 0),e([f()],R.prototype,"_tooltip",void 0),e([f()],R.prototype,"_sceneUpdating",null),e([f()],R.prototype,"_effectiveUtcOffset",null),e([f()],R.prototype,"_utcOffsetAuto",null),e([f()],R.prototype,"_dateUTCOffset",null),e([f()],R.prototype,"_startDateTimeUTC",null),e([f()],R.prototype,"_endDateTimeUTC",null),e([f()],R.prototype,"_referencePosition",null),e([f()],R.prototype,"_interval",null),e([f()],R.prototype,"_intervalContext",null),e([f()],R.prototype,"_totalDurationSampleCount",null),e([f()],R.prototype,"_totalDuration",null),e([f()],R.prototype,"_lightDirections",null),e([f()],R.prototype,"_lightDirectionsContext",null),e([f()],R.prototype,"_analysisVolume",null),e([f()],R.prototype,"_visualizationParameters",null),e([f()],R.prototype,"_minDurationVisualizationParameters",null),e([f()],R.prototype,"_minDurationContextVisualizationParameters",null),e([f()],R.prototype,"_durationVisualizationParameters",null),e([f()],R.prototype,"_discreteVisualizationParameters",null),e([f()],R.prototype,"_shadowLayerViews",null),e([f()],R.prototype,"_previewDependencies",null),e([f()],R.prototype,"_renderer",null),R=e([y("esri.views.3d.analysis.ShadowCastAnalysisView3D")],R);const A=R;function L(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function E(e){const t=e.toUnitRGBA();return[[0,w(t[0],t[1],t[2],0)],[1,t]]}function k(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;case"base-dynamic-3d":case"catalog-3d":case"catalog-dynamic-group-3d":case"dimension-3d":case"gaussian-splat-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"viewshed-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":case"group":default:return!1;case"graphics-3d":return e.layer.graphics.some(e=>{const{symbol:t}=e;return null==t||"text"!==t.type&&!("symbolLayers"in t)||"text"!==t.type&&t.symbolLayers.some(e=>"text"!==e.type)})}}function H(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=C(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,n=i(e.layerVisibilities,t.layerVisibilities),o=i(e.layerOpacities,t.layerOpacities),l=i(e.filters,t.filters),u=i(e.definitionExpressions,t.definitionExpressions);return s&&r&&a&&n&&o&&l&&u}const G=_(1,"hours","milliseconds"),M=500,B=255,I=v(),q=[],F=new O;export{A as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t,equals as i}from"../../../core/arrayUtils.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as o}from"../../../core/maybe.js";import{after as l,throwIfAborted as u,isPromiseLike as c}from"../../../core/promiseUtils.js";import{watch as p,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{offsetDateUTC as g,convertTime as _}from"../../../core/timeUtils.js";import{property as y,subclass as v}from"../../../core/accessorSupport/decorators.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as D}from"../../../core/support/UpdatingHandles.js";import{g as C}from"../../../chunks/boundedPlane.js";import{polygonToVolume as b}from"../focusAreaUtils.js";import V from"./AnalysisView3D.js";import{registerAnalysisView as U,hideOtherAnalysisViews as T}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as P}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as O}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as x}from"../support/earthUtils.js";import{computeDirectionsOverTime as S}from"../support/sunUtils.js";import{maxColorRampSize as z}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as j}from"../../../widgets/support/traversalUtils.js";let R=class extends V{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._updatingHandles=new D,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([U(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{n(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=s(async e=>{await l(B,e),u(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&T(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},d),p(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{L(e,i,t)},d),p(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:s})=>{L(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{L(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{L(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new P({getDuration:this.getDurationAtScreen.bind(this),getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&L(this._renderer,!0,{enabled:!1}),this._tooltip=o(this._tooltip),this._stopPreviewingTask=n(this._stopPreviewingTask),this._updatingHandles=o(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||null!=this._stopPreviewingTask&&!this._stopPreviewingTask.finished||!0===this._tooltip?.updating||this._updatingHandles.updating}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){return this._updatedRecently||this._sceneUpdating}get _sceneUpdating(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,graphicsView:i}=e;return!t||this._shadowLayerViews.some(e=>e.updating)||!i?.suspended&&!!i?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?x(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=g(e,-e.getTimezoneOffset(),"minutes"),e=g(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(M-1)):M}get _interval(){const e=this._totalDurationInterval;switch(this.analysis.mode){case"min-duration":return this._totalDuration>0?e:0;case"total-duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,minDurationOptions:t}=this.analysis;return"min-duration"===e&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?I:this._referencePosition;if(null==i)return[];const s=S(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,M),r=s.length;q.length=0;const a=j(0,r,q),n=new Array(r);for(let o=0;o<r;++o)n[o]=s[a[o]];return n}get _analysisVolume(){const{geometry:e}=this.analysis;if(null==e)return this._previousVolume=null,null;try{const t=b(e,this.view,F);return null==t?(this._previousVolume=null,null):c(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return a.getLogger(this).error(new r("shadowcastanalysisview3d:projection-failed","Failed to project analysis area geometry to view spatial reference",{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"min-duration":return this._minDurationVisualizationParameters;case"total-duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){const{color:e,minDuration:t}=this.analysis.minDurationOptions,i=this._totalDuration;return{visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){const{minDurationOptions:e}=this.analysis;return e.contextEnabled?{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e.contextOptions.color,e.contextOptions.colorStops,1/this._lightDirectionsContext.length,this.analysis.visualizeSunlight)}:{}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?G/s:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/s,this.analysis.visualizeSunlight);return 0===r?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{bandedGradientColorRamp:a,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions;return{gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,1/this._lightDirections.length,this.analysis.visualizeSunlight),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(k)}get _previewDependencies(){const{view:e}=this,i=e.slice.plane,s=this._shadowLayerViews,r=s.map(e=>e.layer).filter(t),a=s.map(e=>e.suspended),n=r.map(e=>e.visible),o=r.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=r.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),c=s.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:i,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:l,layerVisibilities:n,layerOpacities:o,filters:c,definitionExpressions:u}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){const{_renderer:t,_totalDurationSampleCount:i}=this;if(null==t||0===i)return 0;const s=this.view.state.camera.screenToRender(h(e.x,e.y),m()),r=t.readAccumulatedShadow(s);return(this.analysis.visualizeSunlight?1-r:r)*this._totalDuration}_getEffectiveShadowCastColorRamp(e,t,i,s){if(null!=t){t.length>z&&a.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(s?e=>[1-e.value*i,e.color.toUnitRGBA()]:e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return E(e,s)}};e([y({readOnly:!0,type:["shadow-cast-view-3d"]})],R.prototype,"type",void 0),e([y({constructOnly:!0,nonNullable:!0})],R.prototype,"analysis",void 0),e([y({readOnly:!0})],R.prototype,"updating",null),e([y()],R.prototype,"_stopPreviewingTask",void 0),e([y()],R.prototype,"_updatedRecently",void 0),e([y()],R.prototype,"_tooltip",void 0),e([y()],R.prototype,"_sceneUpdating",null),e([y()],R.prototype,"_effectiveUtcOffset",null),e([y()],R.prototype,"_utcOffsetAuto",null),e([y()],R.prototype,"_dateUTCOffset",null),e([y()],R.prototype,"_startDateTimeUTC",null),e([y()],R.prototype,"_endDateTimeUTC",null),e([y()],R.prototype,"_referencePosition",null),e([y()],R.prototype,"_interval",null),e([y()],R.prototype,"_intervalContext",null),e([y()],R.prototype,"_totalDurationSampleCount",null),e([y()],R.prototype,"_totalDuration",null),e([y()],R.prototype,"_lightDirections",null),e([y()],R.prototype,"_lightDirectionsContext",null),e([y()],R.prototype,"_analysisVolume",null),e([y()],R.prototype,"_visualizationParameters",null),e([y()],R.prototype,"_minDurationVisualizationParameters",null),e([y()],R.prototype,"_minDurationContextVisualizationParameters",null),e([y()],R.prototype,"_durationVisualizationParameters",null),e([y()],R.prototype,"_discreteVisualizationParameters",null),e([y()],R.prototype,"_shadowLayerViews",null),e([y()],R.prototype,"_previewDependencies",null),e([y()],R.prototype,"_renderer",null),R=e([v("esri.views.3d.analysis.ShadowCastAnalysisView3D")],R);const A=R;function L(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function E(e,t){const i=e.toUnitRGBA(),s=w(i[0],i[1],i[2],0),[r,a]=t?[i,s]:[s,i];return[[0,r],[1,a]]}function k(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;case"base-dynamic-3d":case"catalog-3d":case"catalog-dynamic-group-3d":case"dimension-3d":case"gaussian-splat-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"viewshed-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":case"group":default:return!1;case"graphics-3d":return e.layer.graphics.some(e=>{const{symbol:t}=e;return null==t||"text"!==t.type&&!("symbolLayers"in t)||"text"!==t.type&&t.symbolLayers.some(e=>"text"!==e.type)})}}function H(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=C(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,n=i(e.layerVisibilities,t.layerVisibilities),o=i(e.layerOpacities,t.layerOpacities),l=i(e.filters,t.filters),u=i(e.definitionExpressions,t.definitionExpressions);return s&&r&&a&&n&&o&&l&&u}const G=_(1,"hours","milliseconds"),B=500,M=255,I=f(),q=[],F=new O;export{A as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o,sync as i,initial as l}from"../../../../core/reactiveUtils.js";import{property as n,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{createSubToolHandles as r,findSubTool as d}from"./viewshedSubToolUtils.js";import{InteractiveToolBase as u}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as c}from"../../../interactive/keybindings.js";let h=class extends u{constructor(e){super(e),this.subToolHandles=new t,this._selectedManipulator=null}initialize(){this.subToolHandles=r({analysis:this.analysis,analysisViewData:this.analysisViewData,onBeforeSubToolRemove:e=>{this.selectedViewshed===e&&(this.selectedViewshed=null)},parentTool:this,view:this.view,viewshedComputedDataHandles:this.analysisViewData.viewshedComputedDataHandles}),this.addHandles([o(()=>this.firstGrabbedManipulator,e=>{null==e?this._selectedSubTool?.onManipulatorSelectionChanged():this.selectedViewshed=this._findSubTool(e)?.viewshed??null},i),o(()=>this.selectedViewshed,e=>this._syncSelectedManipulator(e),l)])}destroy(){this._selectManipulator(null),this.view.activeTool===this&&(this.view.activeTool=null),this.view.tools.includes(this)&&this.view.tools.remove(this),s(this.subToolHandles)}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)}get cursor(){return null}get creating(){return!1}get isPlacingTarget(){return!1}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){}onInputEvent(e){if("key-down"===e.type)this._onKeyDown(e)}_onKeyDown(e){if(c.cancel!==e.key)return;this.subToolHandles.some(({subTool:e})=>e.grabbing)||(this.selectedViewshed=null,e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return d(this.subToolHandles,e)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}_syncSelectedManipulator(e){if(null==e)return void this._selectManipulator(null);const t=this._selectedSubTool;if(null==t)return;const s=this._selectedManipulator,o=null!=s&&t.hasManipulator(s)?s:t.discManipulator;o!==s&&this._selectManipulator(o)}get test(){}};e([n({constructOnly:!0})],h.prototype,"analysis",void 0),e([n({constructOnly:!0})],h.prototype,"analysisViewData",void 0),e([n({constructOnly:!0})],h.prototype,"view",void 0),e([n()],h.prototype,"subToolHandles",void 0),e([n()],h.prototype,"_selectedManipulator",void 0),e([n()],h.prototype,"updating",null),e([n()],h.prototype,"cursor",null),e([n()],h.prototype,"creating",null),e([n()],h.prototype,"isPlacingTarget",null),e([n()],h.prototype,"selectedViewshed",null),e([n()],h.prototype,"selectedViewshedComputedData",null),e([n()],h.prototype,"_selectedSubTool",null),h=e([a("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],h);export{h as ViewshedEditTool};
|