@arcgis/core 6.0.0-next.26 → 6.0.0-next.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Map.d.ts +6 -0
- package/analysis/AreaMeasurementAnalysis.d.ts +4 -2
- package/analysis/DirectLineMeasurementAnalysis.d.ts +8 -4
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0363d29fc665d169ebc4.js +1 -0
- package/assets/esri/core/workers/chunks/037c67ef5c4398d5954d.js +1 -0
- package/assets/esri/core/workers/chunks/03f33cb78b5405ab7e23.js +1 -0
- package/assets/esri/core/workers/chunks/07b726a46864501b90a0.js +1 -0
- package/assets/esri/core/workers/chunks/0864da8f8f147016cf1c.js +1 -0
- package/assets/esri/core/workers/chunks/{768389f7f8dba6080df7.js → 0cc7fba402a93e6d2455.js} +2 -2
- package/assets/esri/core/workers/chunks/0cfdeb53fb7d5532cf01.js +1 -0
- package/assets/esri/core/workers/chunks/112ed86f812e4400a7e0.js +1 -0
- package/assets/esri/core/workers/chunks/177f353ce72133e2eeed.js +1 -0
- package/assets/esri/core/workers/chunks/1dc6f093028530a492e6.js +1 -0
- package/assets/esri/core/workers/chunks/2294254af2c6afb560ee.js +1 -0
- package/assets/esri/core/workers/chunks/23a4806b4cdf7cc32e4d.js +1 -0
- package/assets/esri/core/workers/chunks/2447d2e2a4a3ab8fcf94.js +1 -0
- package/assets/esri/core/workers/chunks/271ae7deccb94112c2df.js +1 -0
- package/assets/esri/core/workers/chunks/2df37a9a95ceebb87a5f.js +1 -0
- package/assets/esri/core/workers/chunks/2e00c155e447e4930442.js +1 -0
- package/assets/esri/core/workers/chunks/2e9a1673b1d51aa082b6.js +1 -0
- package/assets/esri/core/workers/chunks/344f5334ad95c7974349.js +1 -0
- package/assets/esri/core/workers/chunks/348f1def9cd2ddf92e87.js +1 -0
- package/assets/esri/core/workers/chunks/{8e4206068c6953bb7df2.js → 3a47fc97c400fca2c736.js} +1 -1
- package/assets/esri/core/workers/chunks/47c97640ec525676918b.js +1 -0
- package/assets/esri/core/workers/chunks/50763ea061d5fb3f2e49.js +1 -0
- package/assets/esri/core/workers/chunks/518ab22f80c3300bcfff.js +1 -0
- package/assets/esri/core/workers/chunks/58609bf94f72bc4f1952.js +1 -0
- package/assets/esri/core/workers/chunks/586a929bc037e23857af.js +1 -0
- package/assets/esri/core/workers/chunks/58d10e0b35968680fd9f.js +1 -0
- package/assets/esri/core/workers/chunks/59bc55880e6fd8ce20c0.js +1 -0
- package/assets/esri/core/workers/chunks/{7c75a8ee266c36baa902.js → 5eec1c1162779574f46e.js} +1 -1
- package/assets/esri/core/workers/chunks/62a0abcf45a2bd14ecbe.js +1 -0
- package/assets/esri/core/workers/chunks/63c4412c16d8a44a5668.js +1 -0
- package/assets/esri/core/workers/chunks/6b4c3411f63a9ad9354c.js +1 -0
- package/assets/esri/core/workers/chunks/{f528ac5c648ca6a98582.js → 711cfb84659cb4437679.js} +1 -1
- package/assets/esri/core/workers/chunks/{9dd1fc56eb1ea6eb705e.js → 76e27e36050a3dd9d249.js} +1 -1
- package/assets/esri/core/workers/chunks/76f877e2d2493d56afab.js +1 -0
- package/assets/esri/core/workers/chunks/77463141652bf1ca6fb2.js +1 -0
- package/assets/esri/core/workers/chunks/7d3f7940815fa5dc244e.js +1 -0
- package/assets/esri/core/workers/chunks/914a0b5d9fef683cdf9c.js +1 -0
- package/assets/esri/core/workers/chunks/96f87c8efd4b11b37686.js +1 -0
- package/assets/esri/core/workers/chunks/97ec46605f16333144b7.js +1 -0
- package/assets/esri/core/workers/chunks/{7b482afb9fd1229f5707.js → 9934e8e19f94e9169eea.js} +1 -1
- package/assets/esri/core/workers/chunks/99f51d5d9da6e9bfc430.js +1 -0
- package/assets/esri/core/workers/chunks/9aebe876b1a2fb075f9c.js +1 -0
- package/assets/esri/core/workers/chunks/9c3db7a7c05fa0e81f0a.js +1 -0
- package/assets/esri/core/workers/chunks/{6f1d6453184e0a1530ad.js → 9c4961213ac6ec283dd9.js} +25 -25
- package/assets/esri/core/workers/chunks/a2cc53ad1a514167e4b8.js +1 -0
- package/assets/esri/core/workers/chunks/a33ba23aee3f8f40200f.js +1 -0
- package/assets/esri/core/workers/chunks/{45ba4aa87a4732198596.js → b13d8f4e4e80ef00b1bd.js} +1 -1
- package/assets/esri/core/workers/chunks/b3801d58c024224917df.js +1 -0
- package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +1 -0
- package/assets/esri/core/workers/chunks/b3dbcf43f136ba2dadc5.js +1 -0
- package/assets/esri/core/workers/chunks/b9596d862da1ec342cd3.js +1 -0
- package/assets/esri/core/workers/chunks/bc1fcc9c897461e68e29.js +1 -0
- package/assets/esri/core/workers/chunks/{8b4e9fd88c0c313416d4.js → be04f40f8b403befd0ef.js} +1 -1
- package/assets/esri/core/workers/chunks/{150e7a7bd5df25693da7.js → c90388932a7825d9d933.js} +1 -1
- package/assets/esri/core/workers/chunks/ca21786e519c914fc9e1.js +1 -0
- package/assets/esri/core/workers/chunks/cdb5c26fed7d9a97db49.js +1 -0
- package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +1 -0
- package/assets/esri/core/workers/chunks/d63e181f0e48bde73395.js +1 -0
- package/assets/esri/core/workers/chunks/d77888c84a8b49478807.js +1 -0
- package/assets/esri/core/workers/chunks/d7f2f1708d2a2668676c.js +1 -0
- package/assets/esri/core/workers/chunks/{13c64087be3b2985a21b.js → dbda982485d3fe26c729.js} +1 -1
- package/assets/esri/core/workers/chunks/dc7aa0a1eb6c6e361f9f.js +1 -0
- package/assets/esri/core/workers/chunks/ec1c4d66142b6efb0e8b.js +1 -0
- package/assets/esri/core/workers/chunks/ef2c3febcceedc44b3ac.js +1 -0
- package/assets/esri/core/workers/chunks/f08a2a262a3b55149396.js +1 -0
- package/assets/esri/core/workers/chunks/f2d56f5c15d5977e1d19.js +1 -0
- package/assets/esri/core/workers/chunks/ffe2077a9df7c838ea27.js +1 -0
- package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
- package/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/Component.glsl.js +9 -12
- package/chunks/GaussianSplat.glsl.js +65 -21
- package/chunks/GaussianSplatDepth.glsl.js +45 -4
- package/chunks/GaussianSplatShadow.glsl.js +73 -19
- package/chunks/GlobalIllumination.glsl.js +17 -47
- package/chunks/LineMarker.glsl.js +32 -31
- package/chunks/OITAddEmission.glsl.js +1 -1
- package/chunks/RasterColorizer.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +36 -36
- package/chunks/Terrain.glsl.js +3 -4
- package/chunks/Water.glsl.js +22 -23
- package/config.js +1 -1
- package/core/ReentrantObjectPool.js +1 -1
- package/core/memoryEstimations.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
- package/form/elements/inputs.d.ts +126 -25
- package/form/elements/inputs.js +1 -1
- package/form/elements.d.ts +1 -0
- package/geometry/operators/containsOperator.d.ts +1 -1
- package/geometry/operators/densifyOperator.d.ts +1 -1
- package/geometry/operators/differenceOperator.d.ts +6 -4
- package/geometry/operators/distanceOperator.d.ts +1 -1
- package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
- package/geometry/operators/graphicBufferOperator.d.ts +6 -6
- package/geometry/operators/integrateOperator.d.ts +2 -2
- package/geometry/operators/intersectsOperator.d.ts +3 -3
- package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
- package/geometry/operators/locateBetweenOperator.d.ts +2 -2
- package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
- package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
- package/geometry/operators/projectOperator.d.ts +2 -2
- package/geometry/operators/proximityOperator.d.ts +15 -15
- package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
- package/geometry/operators/simplifyOperator.d.ts +2 -2
- package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
- package/geometry/operators/support/Transformation.d.ts +8 -8
- package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
- package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
- package/geometry/operators/withinOperator.d.ts +3 -3
- package/geometry/support/Indices.js +1 -1
- package/graphic/MapNotesGraphicOrigin.d.ts +1 -0
- package/kernel.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +2 -2
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/MapNotesLayer.d.ts +3 -2
- package/layers/ParquetLayer.d.ts +1 -1
- package/layers/VectorTileLayer.d.ts +10 -1
- package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +2 -1
- package/layers/geospatialPDF/CIM2DLayerview.js +2 -0
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/support/Sublayer.d.ts +2 -2
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/package.json +3 -3
- package/popup/FeaturesModel.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/rest/featureService/FeatureService.d.ts +0 -5
- package/rest/networks/support/TraceLocation.d.ts +2 -1
- package/rest/networks/support/TraceResult.d.ts +0 -4
- package/rest/support/AttributeBinsQuery.d.ts +3 -2
- package/rest/support/ImageGPSInfoParameters.d.ts +2 -1
- package/rest/support/OutDistance.d.ts +2 -2
- package/rest/support/Query.d.ts +3 -2
- package/rest/support/TopFeaturesQuery.d.ts +2 -1
- package/rest/support/types.d.ts +10 -1
- package/smartMapping/raster/renderers/flow.d.ts +2 -1
- package/smartMapping/renderers/color.d.ts +11 -8
- package/smartMapping/renderers/location.d.ts +7 -4
- package/smartMapping/renderers/predominance.d.ts +7 -4
- package/smartMapping/renderers/relationship.d.ts +7 -4
- package/smartMapping/renderers/size.d.ts +6 -4
- package/smartMapping/renderers/type.d.ts +7 -4
- package/smartMapping/renderers/types.d.ts +15 -0
- package/smartMapping/renderers/univariateColorSize.d.ts +4 -2
- package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
- package/smartMapping/symbology/flow.d.ts +2 -1
- package/smartMapping/symbology/types.d.ts +2 -1
- package/support/BasemapStyle.d.ts +2 -2
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/types.d.ts +7 -9
- package/tables/elements.d.ts +1 -0
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/support/projectionUtils.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +15 -2
- package/views/3d/environment/VirtualLighting.d.ts +15 -2
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/ground/GroundMouseWheelMove.js +2 -0
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DBufferGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayerBase.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DStageObjectGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/navigation/Navigation3D.js +1 -1
- package/views/3d/state/controllers/GroundMouseWheelController.js +2 -0
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/terrain/BlendLayers.glsl.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/RasterColorizer.glsl.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/terrain/TextureReference.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderInfo.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js +7 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +25 -25
- package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +6 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/getLocalUp.glsl.js +4 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/{TileBackground.glsl.js → blendLayers.glsl.js} +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/DirtyEvents.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/geometryMemoryUtils.js +2 -0
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +61 -108
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawScreenTool.js +1 -1
- package/views/input/types.d.ts +2 -4
- package/views/interactive/options/LabelOptions.d.ts +5 -5
- package/views/interactive/options/SnappingOptions.d.ts +2 -2
- package/views/selection/SelectionOperation.js +1 -1
- package/views/selection/types.d.ts +43 -3
- package/views/support/layerViewUtils.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +0 -1
- package/widgets/Editor/VisibleElements.d.ts +4 -0
- package/widgets/Editor.d.ts +2 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
- package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search/LayerSearchSource.d.ts +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +4 -0
- package/widgets/Sketch.d.ts +2 -0
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +6 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +6 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +8 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0320cbd825f9a4222042.js +0 -1
- package/assets/esri/core/workers/chunks/067de1910190da228291.js +0 -1
- package/assets/esri/core/workers/chunks/09bd5df07eab80ae7b15.js +0 -1
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +0 -1
- package/assets/esri/core/workers/chunks/1c0c5cb13c2590aae906.js +0 -1
- package/assets/esri/core/workers/chunks/1c77de1e79860f8d2228.js +0 -1
- package/assets/esri/core/workers/chunks/24dac4970526a4e0ae63.js +0 -1
- package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +0 -1
- package/assets/esri/core/workers/chunks/30dcf2cfb31cb70de7df.js +0 -1
- package/assets/esri/core/workers/chunks/371e2ddb88cc6b9a41e8.js +0 -1
- package/assets/esri/core/workers/chunks/42f6194633c2d879c8da.js +0 -1
- package/assets/esri/core/workers/chunks/44f90e75c1dc3d726a95.js +0 -1
- package/assets/esri/core/workers/chunks/4abd3753cd9b80e4d937.js +0 -1
- package/assets/esri/core/workers/chunks/4bb9a5f4ca944d3fc206.js +0 -1
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +0 -1
- package/assets/esri/core/workers/chunks/4d93bed14945e3d34d5c.js +0 -1
- package/assets/esri/core/workers/chunks/4e3f651ac76fcd53df2b.js +0 -1
- package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +0 -1
- package/assets/esri/core/workers/chunks/58da3f8cf0f7f6a7e4fa.js +0 -1
- package/assets/esri/core/workers/chunks/5a19a9c3e01d3d415188.js +0 -1
- package/assets/esri/core/workers/chunks/5a830bc35adbedd33783.js +0 -1
- package/assets/esri/core/workers/chunks/6db0f8fe1402643fbe1a.js +0 -1
- package/assets/esri/core/workers/chunks/7124ad8dc5ad40dc66f3.js +0 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +0 -1
- package/assets/esri/core/workers/chunks/7c631e2947243e2c9bde.js +0 -1
- package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +0 -1
- package/assets/esri/core/workers/chunks/7fb7493f483cd9878bfa.js +0 -1
- package/assets/esri/core/workers/chunks/8e310e9cb9d84ac3ca2f.js +0 -1
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +0 -1
- package/assets/esri/core/workers/chunks/99a0a434ea2162166754.js +0 -1
- package/assets/esri/core/workers/chunks/9afc87474cef1fc4fe4a.js +0 -1
- package/assets/esri/core/workers/chunks/9cbde13e536676767900.js +0 -1
- package/assets/esri/core/workers/chunks/9cd3fcb5fca6f9dbbcd8.js +0 -1
- package/assets/esri/core/workers/chunks/a025ee38d402504193df.js +0 -1
- package/assets/esri/core/workers/chunks/a4b822ee45810c4c292a.js +0 -1
- package/assets/esri/core/workers/chunks/a51576d84edca88e41dd.js +0 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +0 -1
- package/assets/esri/core/workers/chunks/ace41659a5ca0e5abfc3.js +0 -1
- package/assets/esri/core/workers/chunks/b01804aa6c47a220a603.js +0 -1
- package/assets/esri/core/workers/chunks/b3273f847405799e3362.js +0 -1
- package/assets/esri/core/workers/chunks/ba3d5abff65aefcb8dee.js +0 -1
- package/assets/esri/core/workers/chunks/bca6b469940b7b954123.js +0 -1
- package/assets/esri/core/workers/chunks/c0d7ae314ebfad1e3791.js +0 -1
- package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +0 -1
- package/assets/esri/core/workers/chunks/c8eae00b0ec87d8b2ff3.js +0 -1
- package/assets/esri/core/workers/chunks/cd9aa950cb74b09008fe.js +0 -1
- package/assets/esri/core/workers/chunks/e0d9dc97985561320bd4.js +0 -1
- package/assets/esri/core/workers/chunks/e2775b4b753306dc8477.js +0 -1
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +0 -1
- package/assets/esri/core/workers/chunks/ebbf425af348e6ede814.js +0 -1
- package/assets/esri/core/workers/chunks/efc53007cd2e4991d7d4.js +0 -1
- package/assets/esri/core/workers/chunks/f46e92c67986c8c09bdd.js +0 -1
- package/assets/esri/core/workers/chunks/f8bc474434fd365ab174.js +0 -1
- package/assets/esri/core/workers/chunks/f8d2225f333524ce1d88.js +0 -1
- package/assets/esri/core/workers/chunks/f95a1f878c9c1146180e.js +0 -1
- package/assets/esri/core/workers/chunks/fb37f0848196c28b7fd7.js +0 -1
- /package/assets/esri/core/workers/chunks/{768389f7f8dba6080df7.js.LICENSE.txt → 0cc7fba402a93e6d2455.js.LICENSE.txt} +0 -0
package/views/VideoView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import n from"../Viewpoint.js";import r from"../core/Accessor.js";import{EventedMixin as i}from"../core/Evented.js";import{destroyMaybe as a}from"../core/maybe.js";import{EsriPromiseMixin as o}from"../core/Promise.js";import{watch as s,syncAndInitial as c,whenOnce as l,when as u}from"../core/reactiveUtils.js";import{property as d,cast as f,subclass as p}from"../core/accessorSupport/decorators.js";import{ensureClass as m}from"../core/accessorSupport/ensureType.js";import{create as h,fromValues as g}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import _ from"../geometry/Extent.js";import v from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{projectLoad as b,projectExecute as x}from"../geometry/operators/projectOperator.js";import S from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as C}from"../layers/support/MediaElementView.js";import w from"../layers/support/TileInfo.js";import T from"../layers/support/VideoElement.js";import{DOMContainer as E}from"./DOMContainer.js";import{Viewport2DBaseMixin as D}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as O}from"./Viewport2DMixin.js";import k from"./2d/AnimationManager.js";import A from"./2d/MapViewConstraints.js";import"./2d/engine/Stage.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"../core/RandomLCG.js";import"../core/has.js";import"../core/Logger.js";import"./2d/engine/transitions/FadeTransition.js";import"./webgl/BufferObject.js";import"./webgl/FramebufferObject.js";import"./webgl/Program.js";import"./webgl/Renderbuffer.js";import"./webgl/Texture.js";import"./webgl/enums.js";import"./webgl/Util.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import{Container as j}from"./2d/engine/Container.js";import"./2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"../geometry/Polygon.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"./webgl/UniformBufferLayout.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import M from"./2d/navigation/MapViewNavigation.js";import"../request.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"../core/mathUtils.js";import"../core/urlUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polyline.js";import"../geometry/spatialReferenceEllipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"../geometry/support/spatialReferenceUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as N}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import F from"./2d/engine/webgl/OverlayContainer.js";import I from"./navigation/Navigation.js";import L from"./ui/DefaultUI.js";import R from"./ui/video/DefaultUIVideo.js";const z=new t(`#000`);let B;async function V(){let[,{ParentStage:e}]=await Promise.all([import(`./2d/webglDeps.js`),import(`./2d/mapViewDeps.js`)]);B=e}const H=.01,U=[`feature`,`geojson`,`csv`,`stream`,`ogc-feature`,`catalog`,`wfs`,`parquet`,`graphics`,`group`];let W=class extends O(D(E(i(o(r))))){constructor(e){super(e),this._isValid=!1,this._readyCycleForced=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.map=null,this.navigation=new I,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new N({constraints:new A({view:this,minScale:1,maxScale:H})}),this.type=`2d`,this.ui=new R,this.view2dType=`video`,this.addHandles([s(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),s(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),s(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),s(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},c)])}initialize(){this._prevZoomEnabled=this.navigation.actionMap.mouseWheel===`zoom`&&this.ui.components.includes(`zoom`),this._prevRotationEnabled=this.navigation.actionMap.dragSecondary===`rotate`&&this.ui.components.includes(`compass`),this.addHandles([s(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?`none`:`zoom`,this.navigation.actionMap.dragPrimary=this.operationalDataVisible?`none`:`pan`,this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>e!==`zoom`):[...new Set([...this.ui.components,`zoom`])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?`none`:`rotate`,this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>e!==`compass`):[...new Set([...this.ui.components,`compass`])])))},c)]),this.addResolvingPromise(V().then(()=>(this._isValid=!0,l(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set(`preconditionsReady`,!1),this.frameTask=a(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set(`inputManager`,null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get focusRegion(){return super.focusRegion}get layer(){return this._get(`layer`)}set layer(e){e!==this._get(`layer`)&&(this.constructed&&!this.destroyed&&(this._forceReadyCycle(),this.addResolvingPromise(l(()=>this.ready))),this._set(`layer`,e))}get preconditionsReady(){return!(!this._isValid||this._readyCycleForced||this.width===0||this.height===0||this.videoSize[0]===0||this.videoSize[1]===0)}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];let[e,t]=this.size,n=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),r=e/t,i=t*n,a=e/n;return r>=1?n>=1?i<=e?[i,t]:[e,a]:a<=t?[e,a]:[i,t]:n>=1?a<=t?[e,a]:[i,t]:i<=e?[i,t]:[e,a]}async hitTest(e,t){if(!this._operationalDataView||!this._operationalDataView.ready)return{screenPoint:e,results:[]};let n=this._operationalDataView.videoToMap(e);if(!n)return{screenPoint:e,results:[]};let r=this._operationalDataView.state.toScreen(h(),n);return this._operationalDataView.hitTest({x:r[0],y:r[1]},t)}_startup(){if(!this.layer)return;let e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);let t={renderingOptions:this.renderingOptions,backgroundColor:z,groundControlPoints:()=>this._groundControlPoints(),getSize:()=>this.videoSize},n=new B(this._getOrCreateRenderCanvas(),t);this.stage=n,this._prepareStage(this.stage),this.childStage=n.childStage,this._prepareChildStage(this.childStage);let r=new k({view:this});this._set(`animationManager`,r);let i=new M({view:this,animationManager:r});this._set(`mapViewNavigation`,i),this._updateConstraints(),this.frameTask.start(),this._set(`ready`,!0)}_teardown(){this.frameTask?.stop(),this.stationaryManager?.clear(),this.stage?.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer?.removeAllChildren(),this._overlayContainer=null,this.removeHandles(`video-view`),this._set(`ready`,!1),this.stateManager?.ready&&this.stateManager.teardown()}_getViewpoint(){return new n({targetGeometry:new v({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([s(()=>this.stationary,t=>e.stationary=t,c),s(()=>this.state.id,()=>e.state=this.state,c),s(()=>this.renderingOptions,t=>e.renderingOptions=t,c)],`video-view`),this._extent=new _({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new C({element:new T({video:this.layer?.videoElement,georeference:new S({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});let t=new P(this._videoElementView);this._overlayContainer=new F,this._overlayContainer.addChild(t),this._effectsContainer=new j,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);let n=document.createElement(`div`);n.classList.add(`esri-video-poster`),this.container?.classList.add(`esri-video-view`),this.container?.appendChild(n)}_prepareChildStage(e){this.addHandles([s(()=>this.map,async t=>{if(!t)return;let{default:n}=await import(`./video/VideoOperationalDataView.js`);this._operationalDataView=new n({stage:e,layerViewFilter:e=>new Set(U).has(e.type),width:this.size[0],height:this.size[1],map:t,groundControlPoints:()=>this._groundControlPoints(),getVideoResolution:()=>g(this.layer?.videoWidth||0,this.layer?.videoHeight||0),getSize:()=>this.size}),l(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},c),s(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;let t=this.layer.groundControlPoints,n=t?.length;if(!n)return;await b();let r=Array(n),i=e.state.spatialReference;for(let e=0;e<n;e++){let{lat:n,lon:a}=t[e];r[e]=x(new v(a,n),i)}let a=1/0,o=1/0,s=-1/0,c=-1/0;for(let e of r)a=Math.min(a,e.x),o=Math.min(o,e.y),s=Math.max(s,e.x),c=Math.max(c,e.y);let l=_.fromJSON({xmin:a,ymin:o,xmax:s,ymax:c,spatialReference:i});await this._operationalDataView?.goTo(l,{animate:!1}).catch(()=>{})},c)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){let e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),n=[];for(let e=t;e>H;e/=2)n.push(e);n.push(H);let{lods:r}=w.create({scales:n});this.constraints.set({lods:r,minScale:t})}_updatePanConstraints(){let e=e=>{if(!e.targetGeometry)return e;let[t,n]=this.videoSize,r=t*e.scale/2,i=n*e.scale/2,a=e.targetGeometry.clone();return a.x=Math.max(r,Math.min(t-r,a.x)),a.y=Math.max(i,Math.min(n-i,a.y)),e.targetGeometry=a,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}_forceReadyCycle(){this.ready&&(u(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}_groundControlPoints(){return this.layer?.groundControlPoints}};e([d()],W.prototype,`_overlayContainer`,void 0),e([d()],W.prototype,`_isValid`,void 0),e([d()],W.prototype,`_readyCycleForced`,void 0),e([d()],W.prototype,`_effectsContainer`,void 0),e([d()],W.prototype,`constraintsInfo`,null),e([d()],W.prototype,`operationalDataVisible`,void 0),e([d()],W.prototype,`layer`,null),e([d()],W.prototype,`map`,void 0),e([d({type:I,nonNullable:!0})],W.prototype,`navigation`,void 0),e([d({readOnly:!0})],W.prototype,`preconditionsReady`,null),e([d({readOnly:!0})],W.prototype,`ready`,void 0),e([d({readOnly:!0})],W.prototype,`rendering`,null),e([d()],W.prototype,`scale`,null),e([d()],W.prototype,`spatialReference`,void 0),e([d()],W.prototype,`stateManager`,void 0),e([d()],W.prototype,`type`,void 0),e([d(),f(e=>e instanceof L?e:m(R,e))],W.prototype,`ui`,void 0),e([d({readOnly:!0})],W.prototype,`videoSize`,null),e([d({readOnly:!0})],W.prototype,`view2dType`,void 0),W=e([p(`esri.views.VideoView`)],W);const G=W;export{G as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import n from"../Viewpoint.js";import r from"../core/Accessor.js";import{EventedMixin as i}from"../core/Evented.js";import{destroyMaybe as a}from"../core/maybe.js";import{EsriPromiseMixin as o}from"../core/Promise.js";import{watch as s,syncAndInitial as c,whenOnce as l,when as u}from"../core/reactiveUtils.js";import{property as d,cast as f,subclass as p}from"../core/accessorSupport/decorators.js";import{ensureClass as m}from"../core/accessorSupport/ensureType.js";import{create as h,fromValues as g}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import _ from"../geometry/Extent.js";import v from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{projectLoad as b,projectExecute as x}from"../geometry/operators/projectOperator.js";import S from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as C}from"../layers/support/MediaElementView.js";import w from"../layers/support/TileInfo.js";import T from"../layers/support/VideoElement.js";import{DOMContainer as E}from"./DOMContainer.js";import{Viewport2DBaseMixin as D}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as O}from"./Viewport2DMixin.js";import k from"./2d/AnimationManager.js";import A from"./2d/MapViewConstraints.js";import"./2d/engine/Stage.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"../core/RandomLCG.js";import"../core/has.js";import"../core/Logger.js";import"./2d/engine/transitions/FadeTransition.js";import"./webgl/BufferObject.js";import"./webgl/FramebufferObject.js";import"./webgl/Program.js";import"./webgl/Renderbuffer.js";import"./webgl/Texture.js";import"../core/memoryEstimations.js";import"./webgl/enums.js";import"./webgl/Util.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import{Container as j}from"./2d/engine/Container.js";import"./2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"../geometry/Polygon.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"./webgl/UniformBufferLayout.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import M from"./2d/navigation/MapViewNavigation.js";import"../request.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"../core/mathUtils.js";import"../core/urlUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polyline.js";import"../geometry/spatialReferenceEllipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"../geometry/support/spatialReferenceUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as N}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import F from"./2d/engine/webgl/OverlayContainer.js";import I from"./navigation/Navigation.js";import L from"./ui/DefaultUI.js";import R from"./ui/video/DefaultUIVideo.js";const z=new t(`#000`);let B;async function V(){let[,{ParentStage:e}]=await Promise.all([import(`./2d/webglDeps.js`),import(`./2d/mapViewDeps.js`)]);B=e}const H=.01,U=[`feature`,`geojson`,`csv`,`stream`,`ogc-feature`,`catalog`,`wfs`,`parquet`,`graphics`,`group`];let W=class extends O(D(E(i(o(r))))){constructor(e){super(e),this._isValid=!1,this._readyCycleForced=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.map=null,this.navigation=new I,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new N({constraints:new A({view:this,minScale:1,maxScale:H})}),this.type=`2d`,this.ui=new R,this.view2dType=`video`,this.addHandles([s(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),s(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),s(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),s(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},c)])}initialize(){this._prevZoomEnabled=this.navigation.actionMap.mouseWheel===`zoom`&&this.ui.components.includes(`zoom`),this._prevRotationEnabled=this.navigation.actionMap.dragSecondary===`rotate`&&this.ui.components.includes(`compass`),this.addHandles([s(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?`none`:`zoom`,this.navigation.actionMap.dragPrimary=this.operationalDataVisible?`none`:`pan`,this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>e!==`zoom`):[...new Set([...this.ui.components,`zoom`])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?`none`:`rotate`,this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>e!==`compass`):[...new Set([...this.ui.components,`compass`])])))},c)]),this.addResolvingPromise(V().then(()=>(this._isValid=!0,l(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set(`preconditionsReady`,!1),this.frameTask=a(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set(`inputManager`,null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get focusRegion(){return super.focusRegion}get layer(){return this._get(`layer`)}set layer(e){e!==this._get(`layer`)&&(this.constructed&&!this.destroyed&&(this._forceReadyCycle(),this.addResolvingPromise(l(()=>this.ready))),this._set(`layer`,e))}get preconditionsReady(){return!(!this._isValid||this._readyCycleForced||this.width===0||this.height===0||this.videoSize[0]===0||this.videoSize[1]===0)}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];let[e,t]=this.size,n=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),r=e/t,i=t*n,a=e/n;return r>=1?n>=1?i<=e?[i,t]:[e,a]:a<=t?[e,a]:[i,t]:n>=1?a<=t?[e,a]:[i,t]:i<=e?[i,t]:[e,a]}async hitTest(e,t){if(!this._operationalDataView||!this._operationalDataView.ready)return{screenPoint:e,results:[]};let n=this._operationalDataView.videoToMap(e);if(!n)return{screenPoint:e,results:[]};let r=this._operationalDataView.state.toScreen(h(),n);return this._operationalDataView.hitTest({x:r[0],y:r[1]},t)}_startup(){if(!this.layer)return;let e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);let t={renderingOptions:this.renderingOptions,backgroundColor:z,groundControlPoints:()=>this._groundControlPoints(),getSize:()=>this.videoSize},n=new B(this._getOrCreateRenderCanvas(),t);this.stage=n,this._prepareStage(this.stage),this.childStage=n.childStage,this._prepareChildStage(this.childStage);let r=new k({view:this});this._set(`animationManager`,r);let i=new M({view:this,animationManager:r});this._set(`mapViewNavigation`,i),this._updateConstraints(),this.frameTask.start(),this._set(`ready`,!0)}_teardown(){this.frameTask?.stop(),this.stationaryManager?.clear(),this.stage?.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer?.removeAllChildren(),this._overlayContainer=null,this.removeHandles(`video-view`),this._set(`ready`,!1),this.stateManager?.ready&&this.stateManager.teardown()}_getViewpoint(){return new n({targetGeometry:new v({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([s(()=>this.stationary,t=>e.stationary=t,c),s(()=>this.state.id,()=>e.state=this.state,c),s(()=>this.renderingOptions,t=>e.renderingOptions=t,c)],`video-view`),this._extent=new _({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new C({element:new T({video:this.layer?.videoElement,georeference:new S({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});let t=new P(this._videoElementView);this._overlayContainer=new F,this._overlayContainer.addChild(t),this._effectsContainer=new j,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);let n=document.createElement(`div`);n.classList.add(`esri-video-poster`),this.container?.classList.add(`esri-video-view`),this.container?.appendChild(n)}_prepareChildStage(e){this.addHandles([s(()=>this.map,async t=>{if(!t)return;let{default:n}=await import(`./video/VideoOperationalDataView.js`);this._operationalDataView=new n({stage:e,layerViewFilter:e=>new Set(U).has(e.type),width:this.size[0],height:this.size[1],map:t,groundControlPoints:()=>this._groundControlPoints(),getVideoResolution:()=>g(this.layer?.videoWidth||0,this.layer?.videoHeight||0),getSize:()=>this.size}),l(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},c),s(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;let t=this.layer.groundControlPoints,n=t?.length;if(!n)return;await b();let r=Array(n),i=e.state.spatialReference;for(let e=0;e<n;e++){let{lat:n,lon:a}=t[e];r[e]=x(new v(a,n),i)}let a=1/0,o=1/0,s=-1/0,c=-1/0;for(let e of r)a=Math.min(a,e.x),o=Math.min(o,e.y),s=Math.max(s,e.x),c=Math.max(c,e.y);let l=_.fromJSON({xmin:a,ymin:o,xmax:s,ymax:c,spatialReference:i});await this._operationalDataView?.goTo(l,{animate:!1}).catch(()=>{})},c)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){let e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),n=[];for(let e=t;e>H;e/=2)n.push(e);n.push(H);let{lods:r}=w.create({scales:n});this.constraints.set({lods:r,minScale:t})}_updatePanConstraints(){let e=e=>{if(!e.targetGeometry)return e;let[t,n]=this.videoSize,r=t*e.scale/2,i=n*e.scale/2,a=e.targetGeometry.clone();return a.x=Math.max(r,Math.min(t-r,a.x)),a.y=Math.max(i,Math.min(n-i,a.y)),e.targetGeometry=a,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}_forceReadyCycle(){this.ready&&(u(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}_groundControlPoints(){return this.layer?.groundControlPoints}};e([d()],W.prototype,`_overlayContainer`,void 0),e([d()],W.prototype,`_isValid`,void 0),e([d()],W.prototype,`_readyCycleForced`,void 0),e([d()],W.prototype,`_effectsContainer`,void 0),e([d()],W.prototype,`constraintsInfo`,null),e([d()],W.prototype,`operationalDataVisible`,void 0),e([d()],W.prototype,`layer`,null),e([d()],W.prototype,`map`,void 0),e([d({type:I,nonNullable:!0})],W.prototype,`navigation`,void 0),e([d({readOnly:!0})],W.prototype,`preconditionsReady`,null),e([d({readOnly:!0})],W.prototype,`ready`,void 0),e([d({readOnly:!0})],W.prototype,`rendering`,null),e([d()],W.prototype,`scale`,null),e([d()],W.prototype,`spatialReference`,void 0),e([d()],W.prototype,`stateManager`,void 0),e([d()],W.prototype,`type`,void 0),e([d(),f(e=>e instanceof L?e:m(R,e))],W.prototype,`ui`,void 0),e([d({readOnly:!0})],W.prototype,`videoSize`,null),e([d({readOnly:!0})],W.prototype,`view2dType`,void 0),W=e([p(`esri.views.VideoView`)],W);const G=W;export{G as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../core/Evented.js";import{clone as n}from"../../core/lang.js";import{equalsMaybe as r,destroyMaybe as i}from"../../core/maybe.js";import{memoize as a}from"../../core/memoize.js";import{ignoreAbortErrors as o}from"../../core/promiseUtils.js";import s from"../../core/ReactiveSet.js";import{watch as c,syncAndInitial as l}from"../../core/reactiveUtils.js";import{createScreenPoint as u}from"../../core/screenUtils.js";import{property as d,subclass as f}from"../../core/accessorSupport/decorators.js";import{diff as p}from"../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as m}from"../../core/support/UpdatingHandles.js";import{pointEquals as h,pointNear as g}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getEffectiveElevationInfo as _}from"../../support/elevationInfoUtils.js";import{defaultDrawingMode as v}from"./drawingModes.js";import{LegacyDrawManipulator as y}from"./LegacyDrawManipulator.js";import{createCoordinateHelper as b}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as x,sceneSnappingAtLocation as S}from"../interactive/dragEventPipeline.js";import{EditGeometry as C,Part as w}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as T}from"../interactive/editGeometry/EditGeometryOperations.js";import{isPoint as E}from"../interactive/sketch/constraints.js";import{getPointConstraint as D,getPolylineOrPolygonConstraint as O,pointToConstraintSpace as k,constraintSpaceToPoint as A}from"../interactive/sketch/constraintUtils.js";import j from"../interactive/sketch/SketchLabelOptions.js";import{SnappingContext as M}from"../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as N}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as P}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as F}from"../interactive/snapping/snappingUtils.js";const I=`crosshair`,L=`progress`,R=Symbol(),z=Symbol();let B=class extends t{constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new s,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new m,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=a(D),this._getPolylineOrPolygonConstraint=a(O),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new j,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo??(this.elevationInfo=_(!!e.hasZ))}initializePointer(){let e=this.view.inputManager?.latestPointerInfo;e!=null&&e.type!==`touch`&&this._updatePointer(e.location,e.id,e.type)}initialize(){let{geometryType:e,view:t}=this,n=t.spatialReference,i=`viewingMode`in t.state?t.state.viewingMode:2,a=e===`segment`||e===`multipoint`?`polyline`:e;this.coordinateHelper=b(this.hasZ,this.hasM,n),this._editGeometryOperations=new T(new C(a,this.coordinateHelper),i),this._snappingOperation=new P({view:t}),this.addHandles([c(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:e,constraint:t},n)=>{let{snappingOptions:r}=this;if(r&&(r.forceDisabled=t!=null&&E(t)),n!=null&&e===n.stagedPoint&&t!==n.constraint)return this._onKeyboardBasedChange();this._processCursor(e??this._screenToMap(this._stagedScreenPoint))},{equals:(e,t)=>e.stagedPoint===t.stagedPoint&&r(e.constraint,t.constraint)}),c(()=>this.view.viewpoint,(e,t)=>{e&&t&&p(e,t)&&this._onKeyboardBasedChange()})]),this._activePart=new w(n,i),this._editGeometryOperations.data.parts.push(this._activePart);let s=this.segmentLabels;s!=null&&(s.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(c(()=>this.labelOptions.enabled,e=>{s.visible=e},l))),this.addHandles(this._editGeometryOperations.on([`vertex-add`,`vertex-update`,`vertex-remove`],e=>{let t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),n=t.map(e=>e.coordinates),r=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getFirstVertex()?.pos)??null;h(r,this.firstVertex)||(this.firstVertex=r);let i=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getLastVertex()?.pos)??null;h(i,this.lastVertex)||(this.lastVertex=i);let a=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.segments.at(-1)?.leftVertex?.pos)??null;switch(h(a,this.secondToLastVertex)||(this.secondToLastVertex=a),this._processCursor(this.cursorVertex),e.type){case`vertex-add`:this.emit(e.type,{...e,added:n,vertices:t});break;case`vertex-update`:this.emit(e.type,{...e,updated:n,vertices:t});break;case`vertex-remove`:this.emit(e.type,{...e,removed:n,vertices:t})}}));let u=this._manipulator=new y({consumesClicks:!1,grabbableForEvent:e=>this.drawingMode!==`click`||e.pointerType===`touch`&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(u),u.grabbable=e!==`point`&&e!==`multipoint`,this.addHandles([u.events.on(`immediate-click`,e=>this._onImmediateClick(e)),u.events.on(`immediate-double-click`,e=>this._onImmediateDoubleClick(e)),c(()=>this.drawingMode,()=>{this.removeHandles(R),this.addHandles(this._createManipulatorDragPipeline(u),R)},l),c(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:e})=>{u.cursor=e},l)]),F(this,()=>{let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);if(this.snappingManager!=null){let e=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,t);this._updatingHandles.consumePromise(o(e))}})}destroy(){i(this.segmentLabels),i(this._snappingOperation),this._editGeometryOperations=i(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){let{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){let e=this._updateAndGetEffectiveDrawSurface();return this.view.type===`3d`&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activePart.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){let{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case`point`:case`multipoint`:return this._getPointConstraint(e);case`polygon`:case`polyline`:return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set(`drawingMode`,e??v)}get effectiveCursor(){return this.loading?L:this._hideDefaultCursor?null:this.cursor||I}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activePart.vertices.length}get snappingOptions(){return this.snappingManager==null?null:this.snappingManager.options}get cursorVertex(){return this._get(`cursorVertex`)}get visualizationCursorVertex(){return this._stagedPointerType===`mouse`?this.cursorVertex:null}get committableVertex(){let{cursorVertex:e,lastVertex:t,firstVertex:n,geometryType:r}=this;return r===`polygon`&&g(e,n)||g(e,t)?null:e}get updating(){return this.loading||this._updatingHandles.updating||!!this.segmentLabels?.updating}get geometryIncludingUncommittedVertices(){let{committedVertices:e,committableVertex:t,coordinateHelper:n}=this,r=e.slice();return t!=null&&r.push(n.pointToArray(t)),r}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();let{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e),this._activePart)}complete(e){let t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();let{geometryType:n,numCommittedVertices:r}=this,i=n===`multipoint`&&r===0||n===`polyline`&&r<2||n===`polygon`&&r<3;(n===`segment`||n===`point`)&&this.commitStagedVertex(),this._createOperationCompleted=!i,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit(`complete`,{vertices:this.committedVertices.map((e,t)=>({componentIndex:0,vertexIndex:t,coordinates:e})),aborted:t,type:`complete`}))}onInputEvent(e){switch(e.type){case`pointer-down`:this._pointerDownStates.add(e.pointerId);break;case`pointer-up`:this._pointerDownStates.delete(e.pointerId)}switch(e.type){case`pointer-move`:return this._onPointerMove(e);case`hold`:return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){let t=n(this.cursorVertex),r=n(e),i=r&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(r)??r),a=this._snapToClosingVertex(i),o=this._applyConstraints(a);g(t,o)||(this._set(`cursorVertex`,o),this.segmentLabels?.set(`stagedVertex`,o==null?null:this.coordinateHelper.pointToVector(o)),o==null||this._stagedPointerType!==`mouse`?this.emit(`cursor-remove`):this.emit(`cursor-update`,{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activePart.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:`apply`,type:`vertex-update`}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!==`polygon`||this.numCommittedVertices<=2)return e;let t=this._mapToScreen(e);if(!t)return e;let n=this._activePart;return this._vertexWithinPointerDistance(n.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(n.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case`click`:return this._createManipulatorDragPipelineClick(e);case`freehand`:return this._createManipulatorDragPipelineFreehand(e);case`hybrid`:return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return x(e,(e,t,n,r)=>{let i=r===`touch`&&this._snappingEnabled;if(this.isCompleted||!i)return;let{snappingStep:a,cancelSnapping:o}=N({predicate:()=>i,snappingManager:this.snappingManager,snappingContext:new M({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:r,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n.next(e=>(i&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),e)).next(o),t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._processCursor(e.mapStart),(this.geometryType===`segment`||i&&!this.numCommittedVertices)&&this.commitStagedVertex()),e)).next(S(this.view,this.elevationInfo)).next(...a).next(e=>(i&&(this._processCursor(e.mapEnd),e.action===`end`&&this.commitStagedVertex()),e)).next(e=>(e.action===`end`&&(this._stagedPointerType!==`mouse`&&this._snappingOperation.abort(),(this.geometryType===`segment`||this.geometryType===`point`)&&this.complete()),e))})}_createManipulatorDragPipelineFreehand(e){return x(e,(e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._snappingOperation.abort(),this.committableVertex??this._processCursor(e.mapStart),this.geometryType===`segment`&&this.commitStagedVertex()),e)).next(e=>{switch(e.action){case`start`:case`update`:this._processCursor(e.mapEnd),(this.geometryType===`polygon`||this.geometryType===`polyline`)&&this.commitStagedVertex();break;case`end`:this.complete()}return e})})}_createManipulatorDragPipelineHybrid(e){return x(e,(e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),z),this._processCursor(e.mapStart),this.commitStagedVertex()),e)).next(e=>{switch(e.action){case`start`:case`update`:this._processCursor(e.mapEnd),(this.geometryType===`polygon`||this.geometryType===`polyline`)&&this.commitStagedVertex();break;case`end`:this._stagedPointerType!==`mouse`&&this._snappingOperation.abort(),this.removeHandles(z),(this.geometryType===`segment`||this.geometryType===`point`)&&this.complete()}return e})})}get _drawAtFixedElevation(){let{constraintsEnabled:e,constraintZ:t,geometryType:n,numCommittedVertices:r}=this;return e?t!=null||n===`segment`&&r>0:(n===`segment`||n===`polygon`)&&r>0}_updateAndGetEffectiveDrawSurface(){let{constraintsEnabled:e,coordinateHelper:t,drawSurface:n,elevationDrawSurface:r,snapToSceneEnabled:i}=this;if(r==null)return n;if(!this.hasZ)return r.defaultZ=null,r;let a=this.elevationInfo?.mode,o=this.defaultZ,s=e||a===`absolute-height`;return i!=null&&(s=i),a===`on-the-ground`&&(s=!1),this._drawAtFixedElevation&&(o=(e?this.constraintZ:null)??t.getZ(this._activePart.vertices[0].pos),s=!1),s?n:(r.defaultZ=o,r)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode===`click`&&e.pointerType===`touch`&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType===`mouse`&&e.button===2||this._manipulator.dragging))try{let{drawingMode:t,geometryType:n}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;let r=this._screenToMap(e.screenPoint);if(r==null||r==null||t===`freehand`&&n!==`point`&&n!==`multipoint`)return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(r),this.committableVertex==null){this.complete();return}this.commitStagedVertex(),e.pointerType!==`mouse`&&this._processCursor(null),(t===`freehand`&&this.geometryType!==`multipoint`||n===`point`||n===`segment`&&this.numCommittedVertices===2||n===`segment`&&t===`hybrid`&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType===`point`||(this.complete(),e.stopPropagation())}_onPointerMove(e){let t=u(e.x,e.y);this._updatePointer(t,e.pointerId,e.pointerType)&&e.stopPropagation()}_updatePointer(e,t,n){return this._stagedScreenPoint=e,this._stagedPointerType=n,this._stagedPointerId=t,this._isDragging?(this._snappingOperation.abort(),!1):(this._processCursorMovementRelativeToSurface(e,n),!0)}_onKeyboardBasedChange(){this._stagedPointerType!==`mouse`||!this._stagedScreenPoint||this._stagedPointerId==null||this._isDragging?this._snappingOperation.abort():this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType)}_processCursorMovementRelativeToSurface(e,t){let n=this._snappingOperation,r=this._screenToMap(e),i=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(r==null){this._hideDefaultCursor=!0,this._processCursor(null),n.abort();return}this._hideDefaultCursor=!1;let a=this.snappingManager;if(a==null){this._processCursor(r),n.abort();return}let s=this._getSnappingContext(t);this._updatingHandles.consumePromise(o(n.snap({point:r,scenePoint:i},a,s)))}_applyConstraints(e){let{_constraint:t,constraints:n}=this;if(!e||!n||!t)return e;let{context:r}=n,i=k(e,r),a=i?t.closestTo(i):void 0;if(!a)return e;let o=A(a,e,r),s=this.view.type===`2d`||r.elevationInfo.mode!==`absolute-height`;return o!=null&&s&&this.constraintZ!=null&&this.hasZ&&(o.z=this.constraintZ),o}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action===`start`&&(e=this._screenToMap(t.screenStart)),e==null)return null;let n=this._screenToMap(t.screenEnd);return n==null?null:{...t,mapStart:e,mapEnd:n}}}_vertexWithinPointerDistance(e,t){let n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return n!=null&&V(n,t,25)}_getSnappingContext(e){let t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new M({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t==null?null:{value:t,elevationInfo:this.elevationInfo},drawConstraints:this.constraints})}};e([d()],B.prototype,`_hideDefaultCursor`,void 0),e([d()],B.prototype,`_stagedPointerId`,void 0),e([d()],B.prototype,`_isDragging`,null),e([d()],B.prototype,`_snappingOperation`,void 0),e([d()],B.prototype,`_snappingEnabled`,null),e([d({constructOnly:!0})],B.prototype,`graphic`,void 0),e([d()],B.prototype,`constraintsEnabled`,void 0),e([d()],B.prototype,`constraints`,void 0),e([d()],B.prototype,`_constraint`,null),e([d()],B.prototype,`constraintZ`,void 0),e([d()],B.prototype,`defaultZ`,void 0),e([d()],B.prototype,`isDraped`,void 0),e([d({value:v})],B.prototype,`drawingMode`,null),e([d({constructOnly:!0})],B.prototype,`elevationDrawSurface`,void 0),e([d({constructOnly:!0})],B.prototype,`elevationInfo`,void 0),e([d({constructOnly:!0,type:j})],B.prototype,`labelOptions`,void 0),e([d({constructOnly:!0})],B.prototype,`geometryType`,void 0),e([d({constructOnly:!0})],B.prototype,`hasM`,void 0),e([d({constructOnly:!0})],B.prototype,`hasZ`,void 0),e([d()],B.prototype,`cursor`,void 0),e([d()],B.prototype,`effectiveCursor`,null),e([d()],B.prototype,`loading`,void 0),e([d({constructOnly:!0})],B.prototype,`manipulators`,void 0),e([d({constructOnly:!0})],B.prototype,`drawSurface`,void 0),e([d({constructOnly:!0})],B.prototype,`segmentLabels`,void 0),e([d({constructOnly:!0})],B.prototype,`snappingManager`,void 0),e([d({constructOnly:!0})],B.prototype,`snappingVisualizer`,void 0),e([d()],B.prototype,`snapToSceneEnabled`,void 0),e([d({readOnly:!0})],B.prototype,`cursorVertex`,null),e([d({readOnly:!0})],B.prototype,`visualizationCursorVertex`,null),e([d()],B.prototype,`committableVertex`,null),e([d()],B.prototype,`firstVertex`,void 0),e([d()],B.prototype,`lastVertex`,void 0),e([d()],B.prototype,`secondToLastVertex`,void 0),e([d()],B.prototype,`updating`,null),e([d({constructOnly:!0})],B.prototype,`view`,void 0),B=e([f(`esri.views.draw.DrawOperation`)],B);function V(e,t,n){let r=e.x-t.x,i=e.y-t.y;return r*r+i*i<=n}export{B as DrawOperation,I as defaultCursor,L as defaultLoadingCursor};
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../core/Evented.js";import{clone as n}from"../../core/lang.js";import{equalsMaybe as r,destroyMaybe as i}from"../../core/maybe.js";import{memoize as a}from"../../core/memoize.js";import{ignoreAbortErrors as o}from"../../core/promiseUtils.js";import s from"../../core/ReactiveSet.js";import{watch as c,syncAndInitial as l}from"../../core/reactiveUtils.js";import{createScreenPoint as u}from"../../core/screenUtils.js";import{property as d,subclass as f}from"../../core/accessorSupport/decorators.js";import{diff as p}from"../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as m}from"../../core/support/UpdatingHandles.js";import{pointEquals as h,pointNear as g}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getEffectiveElevationInfo as _}from"../../support/elevationInfoUtils.js";import{defaultDrawingMode as v}from"./drawingModes.js";import{LegacyDrawManipulator as y}from"./LegacyDrawManipulator.js";import{createCoordinateHelper as b}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as x,sceneSnappingAtLocation as S}from"../interactive/dragEventPipeline.js";import{EditGeometry as C,Part as w}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as T}from"../interactive/editGeometry/EditGeometryOperations.js";import{isPoint as E}from"../interactive/sketch/constraints.js";import{getPointConstraint as D,getPolylineOrPolygonConstraint as O,pointToConstraintSpace as k,constraintSpaceToPoint as A}from"../interactive/sketch/constraintUtils.js";import j from"../interactive/sketch/SketchLabelOptions.js";import{SnappingContext as M}from"../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as N}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as P}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as F}from"../interactive/snapping/snappingUtils.js";const I=`crosshair`,L=`progress`,R=Symbol(),z=Symbol();let B=class extends t{constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new s,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new m,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=a(D),this._getPolylineOrPolygonConstraint=a(O),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new j,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo??(this.elevationInfo=_(!!e.hasZ))}initializePointer(){let e=this.view.inputManager?.latestPointerInfo;e!=null&&e.type!==`touch`&&this._updatePointer(e.location,e.id,e.type)}initialize(){let{geometryType:e,view:t,spatialReference:n}=this,i=`viewingMode`in t.state?t.state.viewingMode:2,a=e===`segment`||e===`multipoint`?`polyline`:e;this.coordinateHelper=b(this.hasZ,this.hasM,n),this._editGeometryOperations=new T(new C(a,this.coordinateHelper),i),this._snappingOperation=new P({view:t}),this.addHandles([c(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:e,constraint:t},n)=>{let{snappingOptions:r}=this;if(r&&(r.forceDisabled=t!=null&&E(t)),n!=null&&e===n.stagedPoint&&t!==n.constraint)return this._onKeyboardBasedChange();this._processCursor(e??this._screenToMap(this._stagedScreenPoint))},{equals:(e,t)=>e.stagedPoint===t.stagedPoint&&r(e.constraint,t.constraint)}),c(()=>this.view.viewpoint,(e,t)=>{e&&t&&p(e,t)&&this._onKeyboardBasedChange()})]),this._activePart=new w(n,i),this._editGeometryOperations.data.parts.push(this._activePart);let s=this.segmentLabels;s!=null&&(s.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(c(()=>this.labelOptions.enabled,e=>{s.visible=e},l))),this.addHandles(this._editGeometryOperations.on([`vertex-add`,`vertex-update`,`vertex-remove`],e=>{let t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),n=t.map(e=>e.coordinates),r=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getFirstVertex()?.pos)??null;h(r,this.firstVertex)||(this.firstVertex=r);let i=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getLastVertex()?.pos)??null;h(i,this.lastVertex)||(this.lastVertex=i);let a=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.segments.at(-1)?.leftVertex?.pos)??null;switch(h(a,this.secondToLastVertex)||(this.secondToLastVertex=a),this._processCursor(this.cursorVertex),e.type){case`vertex-add`:this.emit(e.type,{...e,added:n,vertices:t});break;case`vertex-update`:this.emit(e.type,{...e,updated:n,vertices:t});break;case`vertex-remove`:this.emit(e.type,{...e,removed:n,vertices:t})}}));let u=this._manipulator=new y({consumesClicks:!1,grabbableForEvent:e=>this.drawingMode!==`click`||e.pointerType===`touch`&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(u),u.grabbable=e!==`point`&&e!==`multipoint`,this.addHandles([u.events.on(`immediate-click`,e=>this._onImmediateClick(e)),u.events.on(`immediate-double-click`,e=>this._onImmediateDoubleClick(e)),c(()=>this.drawingMode,()=>{this.removeHandles(R),this.addHandles(this._createManipulatorDragPipeline(u),R)},l),c(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:e})=>{u.cursor=e},l)]),F(this,()=>{let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);if(this.snappingManager!=null){let e=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,t);this._updatingHandles.consumePromise(o(e))}})}destroy(){i(this.segmentLabels),i(this._snappingOperation),this._editGeometryOperations=i(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){let{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){let e=this._updateAndGetEffectiveDrawSurface();return this.view.type===`3d`&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activePart.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){let{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case`point`:case`multipoint`:return this._getPointConstraint(e);case`polygon`:case`polyline`:return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set(`drawingMode`,e??v)}get effectiveCursor(){return this.loading?L:this._hideDefaultCursor?null:this.cursor||I}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activePart.vertices.length}get snappingOptions(){return this.snappingManager==null?null:this.snappingManager.options}get spatialReference(){return this._get(`spatialReference`)??this.view.spatialReference}get cursorVertex(){return this._get(`cursorVertex`)}get visualizationCursorVertex(){return this._stagedPointerType===`mouse`?this.cursorVertex:null}get committableVertex(){let{cursorVertex:e,lastVertex:t,firstVertex:n,geometryType:r}=this;return r===`polygon`&&g(e,n)||g(e,t)?null:e}get updating(){return this.loading||this._updatingHandles.updating||!!this.segmentLabels?.updating}get geometryIncludingUncommittedVertices(){let{committedVertices:e,committableVertex:t,coordinateHelper:n}=this,r=e.slice();return t!=null&&r.push(n.pointToArray(t)),r}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();let{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e),this._activePart)}complete(e){let t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();let{geometryType:n,numCommittedVertices:r}=this,i=n===`multipoint`&&r===0||n===`polyline`&&r<2||n===`polygon`&&r<3;(n===`segment`||n===`point`)&&this.commitStagedVertex(),this._createOperationCompleted=!i,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit(`complete`,{vertices:this.committedVertices.map((e,t)=>({componentIndex:0,vertexIndex:t,coordinates:e})),aborted:t,type:`complete`}))}onInputEvent(e){switch(e.type){case`pointer-down`:this._pointerDownStates.add(e.pointerId);break;case`pointer-up`:this._pointerDownStates.delete(e.pointerId)}switch(e.type){case`pointer-move`:return this._onPointerMove(e);case`hold`:return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){let t=n(this.cursorVertex),r=n(e),i=r&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(r)??r),a=this._snapToClosingVertex(i),o=this._applyConstraints(a);g(t,o)||(this._set(`cursorVertex`,o),this.segmentLabels?.set(`stagedVertex`,o==null?null:this.coordinateHelper.pointToVector(o)),o==null||this._stagedPointerType!==`mouse`?this.emit(`cursor-remove`):this.emit(`cursor-update`,{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activePart.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:`apply`,type:`vertex-update`}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!==`polygon`||this.numCommittedVertices<=2)return e;let t=this._mapToScreen(e);if(!t)return e;let n=this._activePart;return this._vertexWithinPointerDistance(n.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(n.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case`click`:return this._createManipulatorDragPipelineClick(e);case`freehand`:return this._createManipulatorDragPipelineFreehand(e);case`hybrid`:return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return x(e,(e,t,n,r)=>{let i=r===`touch`&&this._snappingEnabled;if(this.isCompleted||!i)return;let{snappingStep:a,cancelSnapping:o}=N({predicate:()=>i,snappingManager:this.snappingManager,snappingContext:new M({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:r,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n.next(e=>(i&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),e)).next(o),t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._processCursor(e.mapStart),(this.geometryType===`segment`||i&&!this.numCommittedVertices)&&this.commitStagedVertex()),e)).next(S(this.view,this.elevationInfo)).next(...a).next(e=>(i&&(this._processCursor(e.mapEnd),e.action===`end`&&this.commitStagedVertex()),e)).next(e=>(e.action===`end`&&(this._stagedPointerType!==`mouse`&&this._snappingOperation.abort(),(this.geometryType===`segment`||this.geometryType===`point`)&&this.complete()),e))})}_createManipulatorDragPipelineFreehand(e){return x(e,(e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._snappingOperation.abort(),this.committableVertex??this._processCursor(e.mapStart),this.geometryType===`segment`&&this.commitStagedVertex()),e)).next(e=>{switch(e.action){case`start`:case`update`:this._processCursor(e.mapEnd),(this.geometryType===`polygon`||this.geometryType===`polyline`)&&this.commitStagedVertex();break;case`end`:this.complete()}return e})})}_createManipulatorDragPipelineHybrid(e){return x(e,(e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),z),this._processCursor(e.mapStart),this.commitStagedVertex()),e)).next(e=>{switch(e.action){case`start`:case`update`:this._processCursor(e.mapEnd),(this.geometryType===`polygon`||this.geometryType===`polyline`)&&this.commitStagedVertex();break;case`end`:this._stagedPointerType!==`mouse`&&this._snappingOperation.abort(),this.removeHandles(z),(this.geometryType===`segment`||this.geometryType===`point`)&&this.complete()}return e})})}get _drawAtFixedElevation(){let{constraintsEnabled:e,constraintZ:t,geometryType:n,numCommittedVertices:r}=this;return e?t!=null||n===`segment`&&r>0:(n===`segment`||n===`polygon`)&&r>0}_updateAndGetEffectiveDrawSurface(){let{constraintsEnabled:e,coordinateHelper:t,drawSurface:n,elevationDrawSurface:r,snapToSceneEnabled:i}=this;if(r==null)return n;if(!this.hasZ)return r.defaultZ=null,r;let a=this.elevationInfo?.mode,o=this.defaultZ,s=e||a===`absolute-height`;return i!=null&&(s=i),a===`on-the-ground`&&(s=!1),this._drawAtFixedElevation&&(o=(e?this.constraintZ:null)??t.getZ(this._activePart.vertices[0].pos),s=!1),s?n:(r.defaultZ=o,r)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode===`click`&&e.pointerType===`touch`&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType===`mouse`&&e.button===2||this._manipulator.dragging))try{let{drawingMode:t,geometryType:n}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;let r=this._screenToMap(e.screenPoint);if(r==null||r==null||t===`freehand`&&n!==`point`&&n!==`multipoint`)return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(r),this.committableVertex==null){this.complete();return}this.commitStagedVertex(),e.pointerType!==`mouse`&&this._processCursor(null),(t===`freehand`&&this.geometryType!==`multipoint`||n===`point`||n===`segment`&&this.numCommittedVertices===2||n===`segment`&&t===`hybrid`&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType===`point`||(this.complete(),e.stopPropagation())}_onPointerMove(e){let t=u(e.x,e.y);this._updatePointer(t,e.pointerId,e.pointerType)&&e.stopPropagation()}_updatePointer(e,t,n){return this._stagedScreenPoint=e,this._stagedPointerType=n,this._stagedPointerId=t,this._isDragging?(this._snappingOperation.abort(),!1):(this._processCursorMovementRelativeToSurface(e,n),!0)}_onKeyboardBasedChange(){this._stagedPointerType!==`mouse`||!this._stagedScreenPoint||this._stagedPointerId==null||this._isDragging?this._snappingOperation.abort():this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType)}_processCursorMovementRelativeToSurface(e,t){let n=this._snappingOperation,r=this._screenToMap(e),i=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(r==null){this._hideDefaultCursor=!0,this._processCursor(null),n.abort();return}this._hideDefaultCursor=!1;let a=this.snappingManager;if(a==null){this._processCursor(r),n.abort();return}let s=this._getSnappingContext(t);this._updatingHandles.consumePromise(o(n.snap({point:r,scenePoint:i},a,s)))}_applyConstraints(e){let{_constraint:t,constraints:n}=this;if(!e||!n||!t)return e;let{context:r}=n,i=k(e,r),a=i?t.closestTo(i):void 0;if(!a)return e;let o=A(a,e,r),s=this.view.type===`2d`||r.elevationInfo.mode!==`absolute-height`;return o!=null&&s&&this.constraintZ!=null&&this.hasZ&&(o.z=this.constraintZ),o}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action===`start`&&(e=this._screenToMap(t.screenStart)),e==null)return null;let n=this._screenToMap(t.screenEnd);return n==null?null:{...t,mapStart:e,mapEnd:n}}}_vertexWithinPointerDistance(e,t){let n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return n!=null&&V(n,t,25)}_getSnappingContext(e){let t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new M({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t==null?null:{value:t,elevationInfo:this.elevationInfo},drawConstraints:this.constraints})}};e([d()],B.prototype,`_hideDefaultCursor`,void 0),e([d()],B.prototype,`_stagedPointerId`,void 0),e([d()],B.prototype,`_isDragging`,null),e([d()],B.prototype,`_snappingOperation`,void 0),e([d()],B.prototype,`_snappingEnabled`,null),e([d({constructOnly:!0})],B.prototype,`graphic`,void 0),e([d()],B.prototype,`constraintsEnabled`,void 0),e([d()],B.prototype,`constraints`,void 0),e([d()],B.prototype,`_constraint`,null),e([d()],B.prototype,`constraintZ`,void 0),e([d()],B.prototype,`defaultZ`,void 0),e([d()],B.prototype,`isDraped`,void 0),e([d({value:v})],B.prototype,`drawingMode`,null),e([d({constructOnly:!0})],B.prototype,`elevationDrawSurface`,void 0),e([d({constructOnly:!0})],B.prototype,`elevationInfo`,void 0),e([d({constructOnly:!0,type:j})],B.prototype,`labelOptions`,void 0),e([d({constructOnly:!0})],B.prototype,`geometryType`,void 0),e([d({constructOnly:!0})],B.prototype,`hasM`,void 0),e([d({constructOnly:!0})],B.prototype,`hasZ`,void 0),e([d()],B.prototype,`cursor`,void 0),e([d()],B.prototype,`effectiveCursor`,null),e([d()],B.prototype,`loading`,void 0),e([d({constructOnly:!0})],B.prototype,`manipulators`,void 0),e([d({constructOnly:!0})],B.prototype,`drawSurface`,void 0),e([d({constructOnly:!0})],B.prototype,`segmentLabels`,void 0),e([d({constructOnly:!0})],B.prototype,`snappingManager`,void 0),e([d({constructOnly:!0})],B.prototype,`snappingVisualizer`,void 0),e([d()],B.prototype,`snapToSceneEnabled`,void 0),e([d({constructOnly:!0})],B.prototype,`spatialReference`,null),e([d({readOnly:!0})],B.prototype,`cursorVertex`,null),e([d({readOnly:!0})],B.prototype,`visualizationCursorVertex`,null),e([d()],B.prototype,`committableVertex`,null),e([d()],B.prototype,`firstVertex`,void 0),e([d()],B.prototype,`lastVertex`,void 0),e([d()],B.prototype,`secondToLastVertex`,void 0),e([d()],B.prototype,`updating`,null),e([d({constructOnly:!0})],B.prototype,`view`,void 0),B=e([f(`esri.views.draw.DrawOperation`)],B);function V(e,t,n){let r=e.x-t.x,i=e.y-t.y;return r*r+i*i<=n}export{B as DrawOperation,I as defaultCursor,L as defaultLoadingCursor};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../core/handleUtils.js";import{destroyMaybe as n}from"../../core/maybe.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{IDENTITY as a}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{DrawOperation as o}from"./DrawOperation.js";import{ScreenDrawSurface as s}from"./drawSurfaces.js";import{createCircle as c,createSquare as l,createEllipse as u,createRectangle as d}from"./support/createUtils.js";import{AffineCoordinateSystem as f}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as p}from"../interactive/InteractiveToolBase.js";import m from"../overlay/OutlineOverlayItem.js";let h=class extends p{constructor(e){super(e),this.drawOperation=null,this._overlayItem=void 0,this.geometryType=null,this.mode=null,this.type=`draw-screen`}initialize(){this.drawOperation=this._makeDrawOperation();let e=e=>this.drawOperation?.on(e,t=>{this._updateVisuals(),this.emit(e,t)})??t();this.addHandles([e(`vertex-add`),e(`vertex-remove`),e(`vertex-update`),e(`cursor-update`),e(`complete`)]),this.finishToolCreation()}destroy(){this.drawOperation=n(this.drawOperation),this._set(`view`,null)}get canRedo(){return!!this.drawOperation?.canRedo}get canUndo(){return!!this.drawOperation?.canUndo}set centeredToggled(e){this._set(`centeredToggled`,e),this._updateVisuals()}set enabled(e){let{drawOperation:t}=this;t&&(t.interactive=e),this._set(`enabled`,e)}set uniformSizeToggled(e){this._set(`uniformSizeToggled`,e),this._updateVisuals()}get updating(){return this.drawOperation?.updating??!1}get cursor(){return this._get(`cursor`)??`crosshair`}set cursor(e){this._set(`cursor`,e);let{drawOperation:t}=this;t&&(t.cursor=e)}completeCreateOperation(){this.drawOperation?.complete()}onInputEvent(e){this.destroyed||this.drawOperation?.onInputEvent(e)}redo(){this.drawOperation?.redo()}undo(){this.drawOperation?.undo()}reset(){}_makeDrawOperation(){let{view:e}=this;return new o({view:e,manipulators:this.manipulators,geometryType:g(this.geometryType),drawingMode:this.mode,hasZ:!1,defaultZ:0,snapToSceneEnabled:!1,drawSurface:new s,hasM:!1,snappingManager:null,snappingVisualizer:null,graphic:null,cursor:this.cursor})}get coordinates(){let{drawOperation:e}=this;if(!e?.geometryIncludingUncommittedVertices.length)return[];let{coordinateHelper:t}=e,n=e.committableVertex,r=e.committedVertices.slice();n!=null&&r.push(t.pointToArray(n));let i=r.length;switch(this.geometryType){case`point`:return r.slice(0,1);case`circle`:case`rectangle`:{let t=new f(a,s.spatialReference),n=this.geometryType===`circle`?c:l,o=this.geometryType===`circle`?u:d;if(i===1&&e.isCompleted){let e=r[0];return n([e,t.makeMapPoint(e[0]+_,e[1])],t,!0)?.geometry.rings[0]??[]}if(i===2){let e=this.geometryType!==`rectangle`,i=this.centeredToggled!==e,a=this.geometryType!==`rectangle`;return(this.uniformSizeToggled===a?o(r,t,i)?.geometry.rings[0]:n(r,t,i)?.geometry.rings[0])??[]}return[]}}return r}_updateVisuals(){if(!this._overlayItem){let e=new m({strokeDash:[5],strokeDashColor:[255,255,255,255]});this.view.overlay?.addItem(e),this.addHandles(t(()=>{this.view.overlay?.removeItem(e),e?.destroy(),this._overlayItem=void 0})),this._overlayItem=e}this._overlayItem.coordinates=this.coordinates}onDeactivate(){this.drawOperation?.isCompleted||this.drawOperation?.cancel()}};e([r({value:!1})],h.prototype,`centeredToggled`,null),e([r()],h.prototype,`drawOperation`,void 0),e([r({value:!0})],h.prototype,`enabled`,null),e([r({value:!1})],h.prototype,`uniformSizeToggled`,null),e([r({constructOnly:!0})],h.prototype,`geometryType`,void 0),e([r({constructOnly:!0})],h.prototype,`mode`,void 0),e([r({readOnly:!0})],h.prototype,`type`,void 0),e([r({readOnly:!0})],h.prototype,`updating`,null),e([r({constructOnly:!0,nonNullable:!0})],h.prototype,`view`,void 0),e([r()],h.prototype,`cursor`,null),h=e([i(`esri.views.draw.DrawScreenTool`)],h);function g(e){switch(e){case`polygon`:case`point`:return e;case`circle`:case`rectangle`:return`segment`}}const _=48;export{h as DrawScreenTool,g as geometryTypeToDrawOperationGeometryType};
|
|
2
|
+
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../core/handleUtils.js";import{destroyMaybe as n}from"../../core/maybe.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{IDENTITY as a}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{DrawOperation as o}from"./DrawOperation.js";import{ScreenDrawSurface as s}from"./drawSurfaces.js";import{createCircle as c,createSquare as l,createEllipse as u,createRectangle as d}from"./support/createUtils.js";import{AffineCoordinateSystem as f}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as p}from"../interactive/InteractiveToolBase.js";import m from"../overlay/OutlineOverlayItem.js";let h=class extends p{constructor(e){super(e),this.drawOperation=null,this._overlayItem=void 0,this.geometryType=null,this.mode=null,this.type=`draw-screen`}initialize(){this.drawOperation=this._makeDrawOperation();let e=e=>this.drawOperation?.on(e,t=>{this._updateVisuals(),this.emit(e,t)})??t();this.addHandles([e(`vertex-add`),e(`vertex-remove`),e(`vertex-update`),e(`cursor-update`),e(`complete`)]),this.finishToolCreation()}destroy(){this.drawOperation=n(this.drawOperation),this._set(`view`,null)}get canRedo(){return!!this.drawOperation?.canRedo}get canUndo(){return!!this.drawOperation?.canUndo}set centeredToggled(e){this._set(`centeredToggled`,e),this._updateVisuals()}set enabled(e){let{drawOperation:t}=this;t&&(t.interactive=e),this._set(`enabled`,e)}set uniformSizeToggled(e){this._set(`uniformSizeToggled`,e),this._updateVisuals()}get updating(){return this.drawOperation?.updating??!1}get cursor(){return this._get(`cursor`)??`crosshair`}set cursor(e){this._set(`cursor`,e);let{drawOperation:t}=this;t&&(t.cursor=e)}completeCreateOperation(){this.drawOperation?.complete()}onInputEvent(e){this.destroyed||this.drawOperation?.onInputEvent(e)}redo(){this.drawOperation?.redo()}undo(){this.drawOperation?.undo()}reset(){}_makeDrawOperation(){let{view:e}=this;return new o({view:e,manipulators:this.manipulators,geometryType:g(this.geometryType),drawingMode:this.mode,hasZ:!1,defaultZ:0,snapToSceneEnabled:!1,drawSurface:new s,spatialReference:s.spatialReference,hasM:!1,snappingManager:null,snappingVisualizer:null,graphic:null,cursor:this.cursor})}get coordinates(){let{drawOperation:e}=this;if(!e?.geometryIncludingUncommittedVertices.length)return[];let{coordinateHelper:t}=e,n=e.committableVertex,r=e.committedVertices.slice();n!=null&&r.push(t.pointToArray(n));let i=r.length;switch(this.geometryType){case`point`:return r.slice(0,1);case`circle`:case`rectangle`:{let t=new f(a,s.spatialReference),n=this.geometryType===`circle`?c:l,o=this.geometryType===`circle`?u:d;if(i===1&&e.isCompleted){let e=r[0];return n([e,t.makeMapPoint(e[0]+_,e[1])],t,!0)?.geometry.rings[0]??[]}if(i===2){let e=this.geometryType!==`rectangle`,i=this.centeredToggled!==e,a=this.geometryType!==`rectangle`;return(this.uniformSizeToggled===a?o(r,t,i)?.geometry.rings[0]:n(r,t,i)?.geometry.rings[0])??[]}return[]}}return r}_updateVisuals(){if(!this._overlayItem){let e=new m({strokeDash:[5],strokeDashColor:[255,255,255,255]});this.view.overlay?.addItem(e),this.addHandles(t(()=>{this.view.overlay?.removeItem(e),e?.destroy(),this._overlayItem=void 0})),this._overlayItem=e}this._overlayItem.coordinates=this.coordinates}onDeactivate(){this.drawOperation?.isCompleted||this.drawOperation?.cancel()}};e([r({value:!1})],h.prototype,`centeredToggled`,null),e([r()],h.prototype,`drawOperation`,void 0),e([r({value:!0})],h.prototype,`enabled`,null),e([r({value:!1})],h.prototype,`uniformSizeToggled`,null),e([r({constructOnly:!0})],h.prototype,`geometryType`,void 0),e([r({constructOnly:!0})],h.prototype,`mode`,void 0),e([r({readOnly:!0})],h.prototype,`type`,void 0),e([r({readOnly:!0})],h.prototype,`updating`,null),e([r({constructOnly:!0,nonNullable:!0})],h.prototype,`view`,void 0),e([r()],h.prototype,`cursor`,null),h=e([i(`esri.views.draw.DrawScreenTool`)],h);function g(e){switch(e){case`polygon`:case`point`:return e;case`circle`:case`rectangle`:return`segment`}}const _=48;export{h as DrawScreenTool,g as geometryTypeToDrawOperationGeometryType};
|
package/views/input/types.d.ts
CHANGED
|
@@ -1061,12 +1061,10 @@ export interface ViewEventTypes extends ViewBaseEventTypes {
|
|
|
1061
1061
|
* ```js
|
|
1062
1062
|
* reactiveUtils.on(() => view,
|
|
1063
1063
|
* "focus-region-select",
|
|
1064
|
-
* async (
|
|
1064
|
+
* async () => {
|
|
1065
1065
|
* const focusRegion = view.focusRegion;
|
|
1066
1066
|
* // fetch the features for the focus region
|
|
1067
|
-
* const generator =
|
|
1068
|
-
* pointerType: event.pointerType,
|
|
1069
|
-
* });
|
|
1067
|
+
* const generator = view.fetchPopupFeatures(focusRegion);
|
|
1070
1068
|
* // convert the async generator to an array of features and process them
|
|
1071
1069
|
* const features = await Array.fromAsync(generator);
|
|
1072
1070
|
* });
|
|
@@ -29,7 +29,7 @@ export interface LabelOptionsProperties extends Partial<Pick<LabelOptions, "enab
|
|
|
29
29
|
* // Create a PortalItem instance for the map used in the 3D view
|
|
30
30
|
* view.map.portalItem = new PortalItem({
|
|
31
31
|
* portal: {
|
|
32
|
-
* units: "english" //or "metric"
|
|
32
|
+
* units: "english" // or "metric"
|
|
33
33
|
* },
|
|
34
34
|
* });
|
|
35
35
|
* ```
|
|
@@ -38,16 +38,16 @@ export interface LabelOptionsProperties extends Partial<Pick<LabelOptions, "enab
|
|
|
38
38
|
*
|
|
39
39
|
* ```js
|
|
40
40
|
* // Set the units directly on an existing PortalItem of the 3D view
|
|
41
|
-
* view.map.portalItem.portal.units = "english" //or "metric"
|
|
41
|
+
* view.map.portalItem.portal.units = "english" // or "metric"
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
|
-
*
|
|
44
|
+
* Alternatively, if no [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/) exists, you can set the [Portal.units](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/#units) property
|
|
45
45
|
* from a new default `Portal` created using the [Portal.getDefault()](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/#getDefault) method.
|
|
46
46
|
*
|
|
47
47
|
* ```js
|
|
48
|
-
* // Create
|
|
48
|
+
* // Create a new Portal instance and set its units
|
|
49
49
|
* const portal = Portal.getDefault();
|
|
50
|
-
* portal.units = "english" //or "metric"
|
|
50
|
+
* portal.units = "english" // or "metric"
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
53
|
* </details>
|
|
@@ -74,8 +74,8 @@ export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions,
|
|
|
74
74
|
* @see [Sample - Editor widget with configurations](https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-configurable/)
|
|
75
75
|
* @see [Sample - Snapping with Sketch widget and Magnifier](https://developers.arcgis.com/javascript/latest/sample-code/sketch-snapping-magnifier/)
|
|
76
76
|
* @example
|
|
77
|
-
* // Create a new instance of Sketch, and
|
|
78
|
-
* // a layer
|
|
77
|
+
* // Create a new instance of Sketch, and
|
|
78
|
+
* // specify a layer in featureSources.
|
|
79
79
|
* // This enables feature snapping on that layer.
|
|
80
80
|
* const sketch = new Sketch({
|
|
81
81
|
* layer: graphicsLayer,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{createTask as t}from"../../core/asyncUtils.js";import n from"../../core/Collection.js";import{EventedAccessor as r}from"../../core/Evented.js";import{makeHandle as i}from"../../core/handleUtils.js";import a from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{debounce as s,onAbort as c,ignoreAbortErrors as l}from"../../core/promiseUtils.js";import{on as
|
|
2
|
+
import{__decorate as e}from"tslib";import{createTask as t}from"../../core/asyncUtils.js";import n from"../../core/Collection.js";import{EventedAccessor as r}from"../../core/Evented.js";import{makeHandle as i}from"../../core/handleUtils.js";import a from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{debounce as s,onAbort as c,ignoreAbortErrors as l}from"../../core/promiseUtils.js";import u from"../../core/ReactiveMap.js";import{on as d}from"../../core/reactiveUtils.js";import{createScreenPoint as f}from"../../core/screenUtils.js";import{property as p,subclass as m}from"../../core/accessorSupport/decorators.js";import h from"../../geometry/Point.js";import g from"../../geometry/Polygon.js";import{isClockwise as _}from"../../geometry/support/coordsUtils.js";import{sketchKeys as v,selectionKeys as y}from"../interactive/keybindings.js";import{getSelectionFromGeometry as b}from"../../widgets/support/Selector2D/selectorUtils.js";import{getSelectionFromScreenSelector as x}from"../../widgets/support/Selector3D/selectorUtils.js";let S=class extends r{constructor(e){super(e),this._completed=!1,this._isConstraintKeyDown=!1,this._processTask=null,this.createTool=`rectangle`,this.effectiveSourceMap=new u,this.mode=null,this.persistSelection=!0,this.returnFeatureTitleFields=!1,this.returnGeometry=!0,this.selection=new n,this.selectionManager=null,this.selectOnComplete=!0,this.sources=null,this.toolName=``,this.type=`add`,this._process=s(async(e,n)=>{let{callback:r,completed:i}=e,a=t(async t=>{let{effectiveSelectionManager:n,effectiveSourceMap:a,returnFeatureTitleFields:o,returnGeometry:s,selection:c,sources:l,view:u}=this;if(!l?.length&&!n.sources.length||!u){c.removeAll();return}let d=u.type===`3d`&&`screenSelector`in e&&e.screenSelector&&l!=null?await x({selector:e.screenSelector,signal:t,sources:l,view:u}):`selector`in e&&e.selector&&l!=null?await b({effectiveSourceMap:a,returnFeatureTitleFields:o,returnGeometry:s,selector:e.selector,signal:t,sources:l,view:u}):[];if(c.removeAll(),c.addMany(d),i&&this.persistSelection)switch(this.effectiveType){case`remove`:n.updateSelection({current:[],added:[],removed:d});break;case`replace`:n.clear(),n.updateSelection({current:d,added:[],removed:[]});break;default:n.updateSelection({current:d,added:[],removed:[]})}r?.()});return c(n,()=>a.abort()),this._processTask=a,a.promise},C),this._onOperationFinish=this._onOperationFinish.bind(this)}async initialize(){await this._setup()}get _defaultMode(){return this.createTool===`polygon`?`click`:`hybrid`}get _selectionArea(){let e=this._tool.coordinates;if(e.length===0)return;let t=f(),n=this.view.spatialReference,r=e=>{t.x=e[0],t.y=e[1];let n=this.view.toMap(t);return[n?.x??0,n?.y??0]};if(e.length===1||e.every(([t,n])=>t===e[0][0]&&n===e[0][1])){let[t,i]=r(e[0]);return new h({x:t,y:i,spatialReference:n})}let i=e.map(r);return i.length===0?void 0:(_(i)||i.reverse(),new g({spatialReference:n,rings:[i]}))}get _screenSelector(){let e=this._tool.coordinates;if(e.length===0)return;let t=e=>f(e[0],e[1]);return e.length===1||e.every(([t,n])=>t===e[0][0]&&n===e[0][1])?t(e[0]):e.map(t)}get completed(){return this._completed}get effectiveSelectionManager(){return this.selectionManager??this.view.selectionManager}get effectiveType(){let e=this.type??`add`;if(this._isConstraintKeyDown)switch(e){case`add`:return`remove`;case`remove`:return`add`;case`replace`:return`add`;default:return e}return e}get processingFinalSelection(){return!!(this._processTask&&this._tool?.drawOperation?.isCompleted)}cancel(){this.selection.removeAll(),this._onOperationFinish(!0)}destroy(){this._toolImportController=o(this._toolImportController)}async _setup(){let{createTool:e,view:t}=this;if(await t.whenReady(),this.destroyed||this._toolImportController)return;let n=new AbortController;this._toolImportController=n;let r=await import(`../draw/DrawScreenTool.js`);if(n.signal.aborted)return;let o=Symbol();try{this._tool=new r.DrawScreenTool({view:t,mode:this.mode??this._defaultMode,geometryType:e,cursor:e===`point`?`default`:`crosshair`})}finally{this._toolImportController=null}this._tool?(this.selectOnComplete||this.addHandles(this._tool.on([`cursor-update`,`vertex-add`,`vertex-remove`],()=>{this._syncConstraintKeyDown(),l(this._process(this._selectionProcessParams))}),o),this._syncConstraintKeyDown(),this.addHandles([d(()=>t,`key-down`,e=>{if(!e.repeat)switch(this._syncConstraintKeyDown(),e.key){case v.constraint:this._tool.uniformSizeToggled=!0,e.stopPropagation();break;case v.center:this._tool.centeredToggled=!0,e.stopPropagation()}}),d(()=>t,`key-up`,e=>{switch(this._syncConstraintKeyDown(),e.key){case v.constraint:this._tool.uniformSizeToggled=!1,e.stopPropagation();break;case v.center:this._tool.centeredToggled=!1,e.stopPropagation()}}),this.selection.on(`change`,({added:e,removed:t})=>this.emit(`selection-change`,{operationType:this.effectiveType,added:e,removed:t})),this._tool.on(`complete`,async e=>{this._syncConstraintKeyDown(),this.removeHandles(o),e.aborted?this.cancel():(this._tool.cursor=`progress`,await this._process({...this._selectionProcessParams,callback:this._onOperationFinish,completed:!0}))})],o),this.addHandles(i(()=>t.tools.remove(this._tool))),t.addAndActivateTool(this._tool)):a.getLogger(this).warn(`Unable to import Draw module. SelectionOperation failed to load.`)}_syncConstraintKeyDown(){let{inputManager:e}=this.view;this._isConstraintKeyDown=y.invertType.some(t=>e.isModifierKeyDown(t))}get _selectionProcessParams(){return this.view.type===`3d`?{screenSelector:this._screenSelector}:{selector:this._selectionArea}}_onOperationFinish(e=!1){this.removeAllHandles(),this._processTask?.abort(),this._completed=!0,this.emit(`complete`,{aborted:e,operationType:this.effectiveType,selection:this.selection.toArray(),toolName:this.toolName})}};e([p()],S.prototype,`_completed`,void 0),e([p()],S.prototype,`_defaultMode`,null),e([p()],S.prototype,`_isConstraintKeyDown`,void 0),e([p()],S.prototype,`_processTask`,void 0),e([p()],S.prototype,`_selectionArea`,null),e([p()],S.prototype,`_screenSelector`,null),e([p()],S.prototype,`completed`,null),e([p({constructOnly:!0})],S.prototype,`createTool`,void 0),e([p()],S.prototype,`effectiveSelectionManager`,null),e([p()],S.prototype,`effectiveSourceMap`,void 0),e([p()],S.prototype,`effectiveType`,null),e([p({constructOnly:!0})],S.prototype,`mode`,void 0),e([p()],S.prototype,`persistSelection`,void 0),e([p()],S.prototype,`processingFinalSelection`,null),e([p()],S.prototype,`returnFeatureTitleFields`,void 0),e([p()],S.prototype,`returnGeometry`,void 0),e([p({readOnly:!0})],S.prototype,`selection`,void 0),e([p({constructOnly:!0})],S.prototype,`selectionManager`,void 0),e([p({constructOnly:!0})],S.prototype,`selectOnComplete`,void 0),e([p()],S.prototype,`sources`,void 0),e([p({constructOnly:!0})],S.prototype,`toolName`,void 0),e([p()],S.prototype,`type`,void 0),e([p({constructOnly:!0})],S.prototype,`view`,void 0),S=e([m(`esri.views.selection.SelectionOperation`)],S);const C=100,w=S;export{w as default};
|
|
@@ -14,11 +14,13 @@ import type Polyline from "../../geometry/Polyline.js";
|
|
|
14
14
|
import type GraphicsLayer from "../../layers/GraphicsLayer.js";
|
|
15
15
|
import type KnowledgeGraphLayer from "../../layers/KnowledgeGraphLayer.js";
|
|
16
16
|
import type LinkChartLayer from "../../layers/LinkChartLayer.js";
|
|
17
|
+
import type MapImageLayer from "../../layers/MapImageLayer.js";
|
|
17
18
|
import type MapNotesLayer from "../../layers/MapNotesLayer.js";
|
|
18
19
|
import type SketchLayer from "../../layers/SketchLayer.js";
|
|
19
20
|
import type SubtypeGroupLayer from "../../layers/SubtypeGroupLayer.js";
|
|
20
21
|
import type Field from "../../layers/support/Field.js";
|
|
21
22
|
import type FieldsIndex from "../../layers/support/FieldsIndex.js";
|
|
23
|
+
import type Sublayer from "../../layers/support/Sublayer.js";
|
|
22
24
|
import type SubtypeSublayer from "../../layers/support/SubtypeSublayer.js";
|
|
23
25
|
import type FeatureSet from "../../rest/support/FeatureSet.js";
|
|
24
26
|
import type Query from "../../rest/support/Query.js";
|
|
@@ -26,7 +28,7 @@ import type View from "../View.js";
|
|
|
26
28
|
import type LinkChartView from "../LinkChartView.js";
|
|
27
29
|
import type FeatureLikeLayerView from "../layers/FeatureLikeLayerView.js";
|
|
28
30
|
import type { LoadableMixin } from "../../core/Loadable.js";
|
|
29
|
-
import type { FeatureTitleOptions } from "../../layers/types.js";
|
|
31
|
+
import type { FeatureTitleOptions, ScaleRange } from "../../layers/types.js";
|
|
30
32
|
import type { RendererUnion } from "../../renderers/types.js";
|
|
31
33
|
import type { RequestOptions } from "../../request/types.js";
|
|
32
34
|
import type { MapViewOrSceneView } from "../MapViewOrSceneView.js";
|
|
@@ -40,14 +42,21 @@ import type { CreateTool } from "../../widgets/Sketch/types.js";
|
|
|
40
42
|
*
|
|
41
43
|
* @since 5.1
|
|
42
44
|
*/
|
|
43
|
-
export type SelectableParentLayerUnion = MapNotesLayer | KnowledgeGraphLayer | LinkChartLayer | SubtypeGroupLayer;
|
|
45
|
+
export type SelectableParentLayerUnion = MapNotesLayer | KnowledgeGraphLayer | LinkChartLayer | MapImageLayer | SketchLayer | SubtypeGroupLayer;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Sublayer source types from which selections can be determined.
|
|
49
|
+
*
|
|
50
|
+
* @since 5.2
|
|
51
|
+
*/
|
|
52
|
+
export type SelectableSublayerUnion = Sublayer | SubtypeSublayer;
|
|
44
53
|
|
|
45
54
|
/**
|
|
46
55
|
* Layer source types from which selections can be determined.
|
|
47
56
|
*
|
|
48
57
|
* @since 5.1
|
|
49
58
|
*/
|
|
50
|
-
export type SelectableLayerSourceUnion = SelectableLayer |
|
|
59
|
+
export type SelectableLayerSourceUnion = SelectableLayer | SelectableSublayerUnion | SelectableParentLayerUnion;
|
|
51
60
|
|
|
52
61
|
/**
|
|
53
62
|
* Types of sources from which selections can be determined.
|
|
@@ -145,6 +154,19 @@ export interface SelectableLayerBase extends Accessor, LoadableMixin {
|
|
|
145
154
|
type: SelectableLayerType;
|
|
146
155
|
/** **Optional:** The name of the field used to display features in the layer. */
|
|
147
156
|
displayField?: string | null;
|
|
157
|
+
/**
|
|
158
|
+
* **Optional:** The effective scale range of the selectable layer.
|
|
159
|
+
*
|
|
160
|
+
* @since 5.2
|
|
161
|
+
*/
|
|
162
|
+
effectiveScaleRange?: ScaleRange;
|
|
163
|
+
/**
|
|
164
|
+
* **Optional:** Indicates whether the layer is visible, accounting for potential
|
|
165
|
+
* parent layer visibility.
|
|
166
|
+
*
|
|
167
|
+
* @since 5.2
|
|
168
|
+
*/
|
|
169
|
+
effectiveVisible?: boolean | null;
|
|
148
170
|
/** **Optional:** The fields used to create feature titles. It can be a single field name or an array of field names. */
|
|
149
171
|
featureTitleFields?: string[];
|
|
150
172
|
/** **Optional:** The name of the global ID field in the layer. */
|
|
@@ -237,6 +259,12 @@ export interface SelectableLayerViewBase extends Accessor {
|
|
|
237
259
|
* @since 5.1
|
|
238
260
|
*/
|
|
239
261
|
layer: SelectableLayer;
|
|
262
|
+
/**
|
|
263
|
+
* A reference to the where clause currently applied to the layer view.
|
|
264
|
+
*
|
|
265
|
+
* @since 5.2
|
|
266
|
+
*/
|
|
267
|
+
definitionExpression?: string | null;
|
|
240
268
|
/**
|
|
241
269
|
* Indicates the layer view is currently suspended.
|
|
242
270
|
*
|
|
@@ -249,6 +277,18 @@ export interface SelectableLayerViewBase extends Accessor {
|
|
|
249
277
|
* @since 5.1
|
|
250
278
|
*/
|
|
251
279
|
updating: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Indicates whether the layer view is visible.
|
|
282
|
+
*
|
|
283
|
+
* @since 5.2
|
|
284
|
+
*/
|
|
285
|
+
visible: boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Indicates whether the layer view is visible at the current scale.
|
|
288
|
+
*
|
|
289
|
+
* @since 5.2
|
|
290
|
+
*/
|
|
291
|
+
visibleAtCurrentScale: boolean;
|
|
252
292
|
/**
|
|
253
293
|
* A reference to the view associated with the layer view.
|
|
254
294
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import has from"../../core/has.js";function t(e){return e&&typeof e.highlight==`function`}function n(e){return e&&typeof e.maskOccludee==`function`}const r=()=>!has(`disable-feature:layer-based-scale-visibility`);function i(
|
|
2
|
+
import e from"../../core/Error.js";import has from"../../core/has.js";function t(e){return e&&typeof e.highlight==`function`}function n(e){return e&&typeof e.maskOccludee==`function`}const r=()=>!has(`disable-feature:layer-based-scale-visibility`);function i(t,n,r){return new e(`layerview:spatial-reference-incompatible`,`The spatial reference of this ${t} (wkid: ${n??`undefined`}) is incompatible with the spatial reference of the view (wkid: ${r??`undefined`}).`,{})}function a(e){return e.type===`integrated-mesh-3d`||e.type===`integrated-mesh-3dtiles`}export{r as hasLayerBasedScaleVisibility,t as highlightsSupported,a as isIntegratedMeshLayerView,n as occludeesSupported,i as spatialReferenceIncompatibleError};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
function
|
|
2
|
+
import{isInEffectiveScaleRange as e}from"../../geometry/support/scaleUtils.js";function t(e){return!!(typeof e==`object`&&e&&`id`in e&&`type`in e)}function n(e){return!!(t(e)&&`on`in e&&e.on)}function r(e){return!!(t(e)&&`graphics`in e&&e.graphics)}function i(e){return!!(t(e)&&`fields`in e&&`fieldsIndex`in e&&`objectIdField`in e&&`createQuery`in e&&e.createQuery&&`queryFeatures`in e&&e.queryFeatures)}function a(e){return i(e)||r(e)}function o(e){return!!(typeof e==`object`&&e&&`layer`in e&&e.layer&&t(e.layer)&&`view`in e)}function s(e){return o(e)&&r(e.layer)}function c(e){return!!(o(e)&&`highlight`in e&&e.highlight)}function l(e){return!!(o(e)&&`createQuery`in e&&e.createQuery&&`queryFeatures`in e&&e.queryFeatures)}function u(e){return l(e)||s(e)}function d(e,t){return!!(typeof e==`object`&&e&&`isTable`in e&&e.isTable||t?.map?.allTables.includes(e))}function f(e,t){return u(e)?m(e)&&p(e.layer,t):!a(e)||p(e,t)}function p(t,n){return t.effectiveVisible!==!1&&e(t.effectiveScaleRange,n?.scale)}function m(e){return e.visible!==!1&&e.visibleAtCurrentScale!==!1}export{a as isSelectableLayer,t as isSelectableLayerBase,n as isSelectableLayerBaseWithEditing,u as isSelectableLayerView,o as isSelectableLayerViewBase,m as isSelectableLayerViewVisible,s as isSelectableLayerViewWithGraphics,c as isSelectableLayerViewWithHighlights,l as isSelectableLayerViewWithObjectIds,p as isSelectableLayerVisible,r as isSelectableLayerWithGraphics,i as isSelectableLayerWithObjectIds,f as isSelectionSourceVisible,d as isTableLayer};
|
|
@@ -6,6 +6,7 @@ import type { SnappingControlsVisibleElementsProperties } from "../support/Snapp
|
|
|
6
6
|
export interface VisibleElementsProperties extends Partial<Pick<VisibleElements, "createFeaturesSection" | "editFeaturesSection" | "flow" | "labelsToggle" | "mergeButton" | "selectionToolbar" | "settingsMenu" | "sketch" | "snappingControls" | "splitButton" | "tooltipsToggle" | "undoRedoButtons" | "zoomToButton">> {
|
|
7
7
|
/**
|
|
8
8
|
* The available [SnappingControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SnappingControls/) elements within the widget.
|
|
9
|
+
* These visibility properties are preserved but ignored while [Editor.useViewOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#useViewOptions) is `true`.
|
|
9
10
|
*
|
|
10
11
|
* @since 5.0
|
|
11
12
|
*/
|
|
@@ -92,6 +93,7 @@ export default class VisibleElements extends Accessor {
|
|
|
92
93
|
accessor sketch: boolean;
|
|
93
94
|
/**
|
|
94
95
|
* Indicates whether to display the `SnappingControls` widget. Default is `true`.
|
|
96
|
+
* This property is preserved but ignored while [Editor.useViewOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#useViewOptions) is `true`.
|
|
95
97
|
*
|
|
96
98
|
* @default true
|
|
97
99
|
* @since 5.0
|
|
@@ -99,6 +101,7 @@ export default class VisibleElements extends Accessor {
|
|
|
99
101
|
accessor snappingControls: boolean;
|
|
100
102
|
/**
|
|
101
103
|
* The available [SnappingControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SnappingControls/) elements within the widget.
|
|
104
|
+
* These visibility properties are preserved but ignored while [Editor.useViewOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#useViewOptions) is `true`.
|
|
102
105
|
*
|
|
103
106
|
* @since 5.0
|
|
104
107
|
*/
|
|
@@ -113,6 +116,7 @@ export default class VisibleElements extends Accessor {
|
|
|
113
116
|
accessor splitButton: boolean;
|
|
114
117
|
/**
|
|
115
118
|
* Indicates whether to display the tooltips toggle. Default value is `true`.
|
|
119
|
+
* This property is preserved but ignored while [Editor.useViewOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#useViewOptions) is `true`.
|
|
116
120
|
*
|
|
117
121
|
* @default true
|
|
118
122
|
* @since 5.0
|
package/widgets/Editor.d.ts
CHANGED
|
@@ -590,6 +590,8 @@ export default class Editor extends Widget {
|
|
|
590
590
|
* - Snapping and tooltip options are inherited from the view. The widget's
|
|
591
591
|
* [snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#snappingOptions) and [tooltipOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#tooltipOptions) are preserved but ignored.
|
|
592
592
|
* - Snapping controls and the tooltip toggle are hidden from the widget's Settings menu.
|
|
593
|
+
* The [VisibleElements.snappingControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/VisibleElements/#snappingControls), [VisibleElements.snappingControlsElements](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/VisibleElements/#snappingControlsElements),
|
|
594
|
+
* and [VisibleElements.tooltipsToggle](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/VisibleElements/#tooltipsToggle) visibility properties are preserved but ignored.
|
|
593
595
|
* - Units set through [valueOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#valueOptions) override the corresponding units on the view,
|
|
594
596
|
* such as length or area, without changing the view's options. Setting a unit to `null` or `undefined` restores
|
|
595
597
|
* inheritance for that measurement type.
|