@arcgis/core 4.29.0 → 4.29.1
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/arcade/treeAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{b43fde3e25d0c3b020b5.js → 039a872509872ce67ba4.js} +1 -1
- package/assets/esri/core/workers/chunks/{5243f9ff21e768c620c2.js → 23a5d750d93a7829174f.js} +1 -1
- package/assets/esri/core/workers/chunks/{47e6119be4a4a5ed640d.js → 2447a4d5886aeb0ff72a.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f45a9e9bdbcffc2d6e0.js → 348bcc57b99a975902a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c9fb2601488998013ba.js → 3523789a2948a4ab8cc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{24649b410b757599a549.js → 48db6e0bbb1a9c043193.js} +1 -1
- package/assets/esri/core/workers/chunks/{752082be991f1cc8558f.js → 4984e2b79d862114d6a6.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d9736fd15cdb54d9855.js → 5227f9eea6988aadad7f.js} +1 -1
- package/assets/esri/core/workers/chunks/58723274ef657fe212eb.js +1 -0
- package/assets/esri/core/workers/chunks/60ab18c6a04d4b2f1d4c.js +1 -0
- package/assets/esri/core/workers/chunks/647515801d94180b8402.js +1 -0
- package/assets/esri/core/workers/chunks/6c3ae96ec90e9ed7dd50.js +1 -0
- package/assets/esri/core/workers/chunks/7a8bba91769ee18cc39f.js +1 -0
- package/assets/esri/core/workers/chunks/7a98d2e026f63a581b1e.js +1 -0
- package/assets/esri/core/workers/chunks/8c360923cd1850767d3e.js +1 -0
- package/assets/esri/core/workers/chunks/{1a25ba411b89e050fbb7.js → a61f337802ae963d7f65.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0c5318d7ef2e923aad0.js → a8ac511280f873960d46.js} +1 -1
- package/assets/esri/core/workers/chunks/b125ab84b7761e761734.js +1 -0
- package/assets/esri/core/workers/chunks/{b34d6e58b125fe111f91.js → b42a83db83851cb57d44.js} +1 -1
- package/assets/esri/core/workers/chunks/{1497dd943df7eede0704.js → b9c55ff1f21db198ce03.js} +1 -1
- package/assets/esri/core/workers/chunks/bb3322ddb89c0bd444f0.js +1 -0
- package/assets/esri/core/workers/chunks/becfdaeeb07f089d8be7.js +1 -0
- package/assets/esri/core/workers/chunks/{b26e39a399963c176d33.js → c527692694688a5b3b07.js} +2 -2
- package/assets/esri/core/workers/chunks/{210a93e0b96c5bff44a3.js → c556644bb0cf88770939.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5e7b4acae17f88e2208.js → ce93027b6b81428ce9b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8ece275abac93f3dccf.js → d14f16bfa6c12909929c.js} +1 -1
- package/assets/esri/core/workers/chunks/{1594f06a2d7d9439c62e.js → e2147c99cc5839654be1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d33ed3a2a0d4b640bd4a.js → e4c7d8c69e4957c9d27c.js} +1 -1
- package/assets/esri/core/workers/chunks/{7709248f59520aee6f51.js → eceaa46f622f6fa31128.js} +1 -1
- package/assets/esri/core/workers/chunks/{2286db4c83ff1b6fb088.js → ef3e6209e6ac6a56960b.js} +1 -1
- package/assets/esri/core/workers/chunks/f59b5ea05caca8a1a398.js +1 -0
- package/chunks/Laserlines.glsl.js +3 -3
- package/chunks/Precipitation.glsl.js +1 -1
- package/chunks/SSAOBlur.glsl.js +2 -2
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/terrainUtilsPlanar.js +1 -1
- package/chunks/vec32.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/libs/gl-matrix-2/vec3.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +5 -0
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/ray.js +1 -1
- package/geometry/support/triangle.js +1 -1
- package/geometry/support/vector.js +1 -1
- package/interfaces.d.ts +6 -6
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/FeatureReductionLayer.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/layers/voxel/voxelPlaneUtils.js +1 -1
- package/libs/linkchartlayout/LinkChartLayout.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/arcade/callExpressionWithCursor.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/DrillDownTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/PagedTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/StreamSourceChunk.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/features/support/Tile.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/support/measurementUtils.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/common.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/extentUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/support/Segment.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LoDUtil.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/global/ZoomController.js +1 -1
- package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomController.js +1 -1
- package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/state/utils/viewUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/cameraUtilsInternal.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/mathUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/angularMeasurementUtils.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0e83f3718a0b45652b5e.js +0 -1
- package/assets/esri/core/workers/chunks/1fa5c8af69a09a3730b3.js +0 -1
- package/assets/esri/core/workers/chunks/4736f79b5c94ce103d43.js +0 -1
- package/assets/esri/core/workers/chunks/65f7adaaf1f535310c11.js +0 -1
- package/assets/esri/core/workers/chunks/79c041b292648c5eaecc.js +0 -1
- package/assets/esri/core/workers/chunks/7c4c2c0beddabac672b6.js +0 -1
- package/assets/esri/core/workers/chunks/9307d485a9e5f9fa77d1.js +0 -1
- package/assets/esri/core/workers/chunks/9a758de08dfa57735879.js +0 -1
- package/assets/esri/core/workers/chunks/a4c3da057ec2a07bbbe8.js +0 -1
- package/assets/esri/core/workers/chunks/b252270b100351779f1f.js +0 -1
- package/assets/esri/core/workers/chunks/dc57aa9f2fc69e654559.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../../../../core/arrayUtils.js";import r from"../../../../../../../core/Error.js";import{clone as t}from"../../../../../../../core/lang.js";import s from"../../../../../../../core/Logger.js";import{getStartGroup as a}from"../../../grouping.js";import{applyComputedValue as o}from"./utils.js";import{DictionaryValue as i}from"../../../../../layers/features/support/DictionaryValue.js";const n=()=>s.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function c(e,r,t=!1){const{defaultValue:s,valueExpressionInfo:a,value:o}=r;if(a){const{expression:o}=a,i=await e.createComputedField({expression:o},t);return i?{...r,computed:i,defaultValue:s}:null}return{...r,computed:new i(o),defaultValue:s}}async function m(e,r){const{defaultValue:t,valueExpressionInfo:s}=r,{expression:a}=s,o=await e.createComputedField({expression:a});return o?{...r,computed:o,defaultValue:t}:null}const p=e=>"boolean"!=typeof e&&"number"!=typeof e&&"valueExpressionInfo"in e,f=e=>e.some((e=>{for(const r in e){const t=e[r];if(p(t))return!0}return!1}));class l{static async create(r,t,s){const a={},o=new Map,i=new Map,n=new Map,u=new Map,d=new Map;for(const l in s.params){const h=s.params[l];if(null!=h&&"object"==typeof h)if(Array.isArray(h)){if("object"==typeof h[0])throw new Error(`InternalError: Cannot handle ${l}. Nested array params are not supported`);a[l]=h}else if("valueExpressionInfo"in h){if(h.value){a[l]=h.value;continue}const e=await m(r,h);if(!e){a[l]=h.defaultValue;continue}o.set(l,e),a[l]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some((e=>e.overrides.length))){i.set(l,{effects:await Promise.all(h.effectInfos.map((async t=>{const s=t.overrides.map((e=>c(r,e)));return{effect:t.effect,compiledOverrides:(await Promise.all(s)).filter(e)}})))});break}a[l]=h.effectInfos.map((e=>e.effect));break;case"cim-marker-placement-info":h.overrides.length&&n.set(l,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map((e=>c(r,e))))).filter(e)}),a[l]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const t=h.overrides.map((e=>c(r,e,h.useLegacyLabelEvaluationRules)));u.set(l,{compiledOverrides:(await Promise.all(t)).filter(e),rasterizationParam:h,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:h.resource};a[l]=await t.fetchResourceImmediate(s)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const t=h.overrides.map((e=>c(r,e)));u.set(l,{compiledOverrides:(await Promise.all(t)).filter(e),rasterizationParam:h,objectIdToResourceId:new Map});continue}if("animated"===h.resource.type){u.set(l,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:h.resource};a[l]=await t.fetchResourceImmediate(s)??null;break}case"cim-marker-transform-param":{const{params:e}=h;if(f(e)){const t={compiledMarkerInfos:[]};await Promise.all(e.map((async e=>{const s={props:{}};for(const t in e)if(p(e[t])){const a=await m(r,e[t]);s.compiledExpressionMap||(s.compiledExpressionMap=new Map);const o=s.compiledExpressionMap;a&&o.set(t,a)}else s.props[t]=e[t];t.compiledMarkerInfos.push(s)}))),d.set(l,t)}else a[l]={type:"cim-marker-transform-info",infos:e};break}default:a[l]=h}else a[l]=h}return new l(s,a,o,i,n,u,d)}constructor(e,r,t,s,a,o,i){this.inputMeshParams=e,this._resolvedMeshParams=r,this._dynamicProperties=t,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=a,this._dynamicAsyncProperties=o,this._dynamicTransformProperties=i,this.evaluator=e=>e}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,s,i){for(const m of this._dynamicAsyncProperties.values()){const p=t(m.rasterizationParam.resource);"animated"===m.rasterizationParam.resource.type&&m.rasterizationParam.resource.randomizeStartTime&&(p.startGroup=a(s.getObjectId()||0));for(const{primitiveName:e,propertyName:t,computed:a,defaultValue:l,valueExpressionInfo:u}of m.compiledOverrides)try{o(p,
|
|
5
|
+
import{isSome as e}from"../../../../../../../core/arrayUtils.js";import r from"../../../../../../../core/Error.js";import{clone as t}from"../../../../../../../core/lang.js";import s from"../../../../../../../core/Logger.js";import{getStartGroup as a}from"../../../grouping.js";import{applyComputedValue as o}from"./utils.js";import{DictionaryValue as i}from"../../../../../layers/features/support/DictionaryValue.js";const n=()=>s.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function c(e,r,t=!1){const{defaultValue:s,valueExpressionInfo:a,value:o}=r;if(a){const{expression:o}=a,i=await e.createComputedField({expression:o},t);return i?{...r,computed:i,defaultValue:s}:null}return{...r,computed:new i(o),defaultValue:s}}async function m(e,r){const{defaultValue:t,valueExpressionInfo:s}=r,{expression:a}=s,o=await e.createComputedField({expression:a});return o?{...r,computed:o,defaultValue:t}:null}const p=e=>"boolean"!=typeof e&&"number"!=typeof e&&"valueExpressionInfo"in e,f=e=>e.some((e=>{for(const r in e){const t=e[r];if(p(t))return!0}return!1}));class l{static async create(r,t,s){const a={},o=new Map,i=new Map,n=new Map,u=new Map,d=new Map;for(const l in s.params){const h=s.params[l];if(null!=h&&"object"==typeof h)if(Array.isArray(h)){if("object"==typeof h[0])throw new Error(`InternalError: Cannot handle ${l}. Nested array params are not supported`);a[l]=h}else if("valueExpressionInfo"in h){if(h.value){a[l]=h.value;continue}const e=await m(r,h);if(!e){a[l]=h.defaultValue;continue}o.set(l,e),a[l]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some((e=>e.overrides.length))){i.set(l,{effects:await Promise.all(h.effectInfos.map((async t=>{const s=t.overrides.map((e=>c(r,e)));return{effect:t.effect,compiledOverrides:(await Promise.all(s)).filter(e)}})))});break}a[l]=h.effectInfos.map((e=>e.effect));break;case"cim-marker-placement-info":h.overrides.length&&n.set(l,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map((e=>c(r,e))))).filter(e)}),a[l]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const t=h.overrides.map((e=>c(r,e,h.useLegacyLabelEvaluationRules)));u.set(l,{compiledOverrides:(await Promise.all(t)).filter(e),rasterizationParam:h,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:h.resource};a[l]=await t.fetchResourceImmediate(s)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const t=h.overrides.map((e=>c(r,e)));u.set(l,{compiledOverrides:(await Promise.all(t)).filter(e),rasterizationParam:h,objectIdToResourceId:new Map});continue}if("animated"===h.resource.type){u.set(l,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:h.resource};a[l]=await t.fetchResourceImmediate(s)??null;break}case"cim-marker-transform-param":{const{params:e}=h;if(f(e)){const t={compiledMarkerInfos:[]};await Promise.all(e.map((async e=>{const s={props:{}};for(const t in e)if(p(e[t])){const a=await m(r,e[t]);s.compiledExpressionMap||(s.compiledExpressionMap=new Map);const o=s.compiledExpressionMap;a&&o.set(t,a)}else s.props[t]=e[t];t.compiledMarkerInfos.push(s)}))),d.set(l,t)}else a[l]={type:"cim-marker-transform-info",infos:e};break}default:a[l]=h}else a[l]=h}return new l(s,a,o,i,n,u,d)}constructor(e,r,t,s,a,o,i){this.inputMeshParams=e,this._resolvedMeshParams=r,this._dynamicProperties=t,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=a,this._dynamicAsyncProperties=o,this._dynamicTransformProperties=i,this.evaluator=e=>e}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,s,i){for(const m of this._dynamicAsyncProperties.values()){const p=t(m.rasterizationParam.resource);"animated"===m.rasterizationParam.resource.type&&m.rasterizationParam.resource.randomizeStartTime&&(p.primitiveName="__RESERVED__PRIMITIVE__NAME__",p.startGroup=a(s.getObjectId()||0));for(const{primitiveName:e,propertyName:t,computed:a,defaultValue:l,valueExpressionInfo:u}of m.compiledOverrides)try{const r="animated"===m.rasterizationParam.resource.type?p.primitiveName:e;o(p,r,t,a,s,i,l)}catch(c){n().errorOnce(new r("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${e}', property: '${t}')`,c))}const f=e.enqueueRequest({type:"cim-rasterization-info",resource:p});m.objectIdToResourceId.set(s.getObjectId(),f)}}evaluateMeshParams(e,r,t){for(const[s,a]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=a.computed.readWithDefault(r,t,a.defaultValue);for(const[s,a]of this._dynamicPlacementProperties.entries())for(const{computed:e,defaultValue:o,propertyName:i}of a.compiledOverrides){const n=e.readWithDefault(r,t,o);a.placementInfo.placement[i]=n,this._resolvedMeshParams[s]=a.placementInfo.placement}for(const[s,a]of this._dynamicEffectProperties.entries())for(const e of a.effects){for(const{computed:s,defaultValue:a,propertyName:o}of e.compiledOverrides){const i=s.readWithDefault(r,t,a);e.effect[o]=i}this._resolvedMeshParams[s]=a.effects.map((e=>e.effect))}for(const[s,a]of this._dynamicTransformProperties.entries()){const e={type:"cim-marker-transform-info",infos:[]};for(const s of a.compiledMarkerInfos){const a={...s.props};if(s.compiledExpressionMap)for(const[e,o]of s.compiledExpressionMap){const s=o.computed.readWithDefault(r,t,o.defaultValue);a[e]="number"==typeof s||"boolean"==typeof s?s:o.defaultValue}e.infos.push(a)}this._resolvedMeshParams[s]=e}for(const[s,a]of this._dynamicAsyncProperties.entries()){const t=a.objectIdToResourceId.get(r.getObjectId());if(null==t)continue;const o=e.getResource(t);this._resolvedMeshParams[s]=o}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}export{l as MeshWriterInputEvaluator};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../Graphic.js";import"../../../../symbols.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{subtract as h,normalize as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,UNIT_X as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as _,l as m,n as d,g as y,k as u,f as g}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as v,initializeProjection as G}from"../../../../geometry/projection.js";import{a as w,c as R}from"../../../../chunks/boundedPlane.js";import{equals as b}from"../../../../geometry/support/spatialReferenceUtils.js";import k from"../../../../layers/GraphicsLayer.js";import{ViewingMode as j}from"../../../ViewingMode.js";import{DragManipulation as P}from"./manipulations/DragManipulation.js";import{RotateManipulation as A}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as C}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as S,SnapRotation as M}from"./manipulations/utils.js";import{primaryKey as T}from"../../../input/keys.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as O}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as D}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehavior as U}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as E}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as L}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as B}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as H}from"../../../support/screenUtils.js";import V from"../../../../geometry/Polygon.js";import I from"../../../../geometry/Point.js";import z from"../../../../symbols/SimpleFillSymbol.js";import K from"../../../../symbols/SimpleMarkerSymbol.js";const N={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:T},W=80,q=10,F=30,J=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Q=1,X=10;let Y=class extends x{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=w(),this._displayPlaneCache=w(),this._mainAxisCache=l(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new S,this._snapRotation=new M,this._graphicsLayer=new k({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((e=>e.destroy())),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],s=h(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);c(s,s);let o=W*this.view.resolution;const a=this.view.spatialReference;return b(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),L(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;R(e,t);const i=q*this.view.resolution;return _(t.basis1,t.basis1,1+i/m(t.basis1)),_(t.basis2,t.basis2,1+i/m(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new V({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return d(t,e.basis1),_(t,t,F*this.view.resolution),y(t,t,e.origin),y(t,t,e.basis1),new I({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=u(this._avgAB,i,s,.5),n=u(this._avgBC,s,o,.5),h=u(this._avgCD,o,r,.5),c=u(this._avgDA,r,i,.5);return[new I({x:i[0],y:i[1],spatialReference:t}),new I({x:s[0],y:s[1],spatialReference:t}),new I({x:o[0],y:o[1],spatialReference:t}),new I({x:r[0],y:r[1],spatialReference:t}),new I({x:a[0],y:a[1],spatialReference:t}),new I({x:n[0],y:n[1],spatialReference:t}),new I({x:h[0],y:h[1],spatialReference:t}),new I({x:c[0],y:c[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=O.fromGeometry(v(i,e.spatialReference),j.Local).components[0].vertices;o.forEach(((e,t)=>{s.setVertexPosition(e,r[t].pos)})),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((e,t)=>{this._scaleGraphics[t].geometry=e}))}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=D.fromGeometry(v(this._graphic.geometry,e.spatialReference),j.Local),this._backgroundGraphic=new t({symbol:new z({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new K({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((s=>new t({symbol:new K({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new P({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new A({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((t,i)=>new C({tool:this,view:e,graphic:t,direction:J[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),o((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),e.on("click",(async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=H(t),o=[];e.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=B(r.results),i="georeference"in s,o=a.map((e=>"media"===e.type?e.element:null)).filter(Boolean),n=new Set([...this._graphicsLayer.graphics,i?null:s].filter(Boolean));i&&o.includes(s)||null!=t&&n.has(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}}))]);const r=e=>{this.addHandles(e.events.on("grab-changed",(e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))})))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach((e=>e.forEachManipulator(r))),this.addHandles([e.on("key-down",(t=>{e.activeTool===this&&(t.key!==N.shift||t.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,t.stopPropagation()),t.key!==N.toggleOpacity||t.repeat||("georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),t.stopPropagation()),t.key!==N.primaryKey||t.repeat||(this._factor=X,t.stopPropagation()),this._isModifierActive&&(t.key===N.plus&&(this._scale(this._factor),t.stopPropagation()),t.key===N.minus&&(this._scale(-this._factor),t.stopPropagation()),t.key===N.up&&(this._move(0,this._factor),t.stopPropagation()),t.key===N.down&&(this._move(0,-this._factor),t.stopPropagation()),t.key===N.left&&(this._move(-this._factor,0),t.stopPropagation()),t.key===N.right&&(this._move(this._factor,0),t.stopPropagation())))})),e.on("key-up",(t=>{e.activeTool===this&&(t.key===N.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,t.stopPropagation()),t.key===N.primaryKey&&(this._factor=Q,t.stopPropagation()))}))])}async _loadProjectionEngine(){const e=this._graphic.geometry;return G(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;y(o,s,t),y(o,o,i);const r=this._cornerB;y(r,s,t),g(r,r,i);const a=this._cornerC;g(a,s,t),g(a,a,i);const n=this._cornerD;g(n,s,t),y(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=[];for(const a of t.data.components)i.push(...a.vertices);const s=t.data.geometry.extent?.width,o=(s+e*this.view.resolution)/s,r=t.scaleVertices(i,this._plane.origin,p,o,o,U.NEW_STEP,E.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,e*this.view.resolution,t*this.view.resolution,0,U.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],Y.prototype,"_plane",null),e([a()],Y.prototype,"_backgroundGraphicGeometry",null),e([a()],Y.prototype,"_rotateGraphicGeometry",null),e([a()],Y.prototype,"_scaleGraphicGeometries",null),e([a()],Y.prototype,"preserveAspectRatio",void 0),e([a()],Y.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],Y.prototype,"target",void 0),e([a({constructOnly:!0})],Y.prototype,"view",void 0),Y=e([n("esri.views.2d.interactive.editingTools.TransformTool")],Y);export{Y as TransformTool,N as keys};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../Graphic.js";import"../../../../symbols.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{subtract as h,normalize as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,UNIT_X as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as _,l as m,n as d,g as y,m as u,f as g}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as v,initializeProjection as G}from"../../../../geometry/projection.js";import{a as w,c as R}from"../../../../chunks/boundedPlane.js";import{equals as b}from"../../../../geometry/support/spatialReferenceUtils.js";import j from"../../../../layers/GraphicsLayer.js";import{ViewingMode as k}from"../../../ViewingMode.js";import{DragManipulation as P}from"./manipulations/DragManipulation.js";import{RotateManipulation as A}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as C}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as S,SnapRotation as M}from"./manipulations/utils.js";import{primaryKey as T}from"../../../input/keys.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as O}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as D}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehavior as U}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as E}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as L}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as B}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as H}from"../../../support/screenUtils.js";import V from"../../../../geometry/Polygon.js";import I from"../../../../geometry/Point.js";import z from"../../../../symbols/SimpleFillSymbol.js";import K from"../../../../symbols/SimpleMarkerSymbol.js";const N={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:T},W=80,q=10,F=30,J=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Q=1,X=10;let Y=class extends x{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=w(),this._displayPlaneCache=w(),this._mainAxisCache=l(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new S,this._snapRotation=new M,this._graphicsLayer=new j({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((e=>e.destroy())),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],s=h(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);c(s,s);let o=W*this.view.resolution;const a=this.view.spatialReference;return b(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),L(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;R(e,t);const i=q*this.view.resolution;return _(t.basis1,t.basis1,1+i/m(t.basis1)),_(t.basis2,t.basis2,1+i/m(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new V({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return d(t,e.basis1),_(t,t,F*this.view.resolution),y(t,t,e.origin),y(t,t,e.basis1),new I({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=u(this._avgAB,i,s,.5),n=u(this._avgBC,s,o,.5),h=u(this._avgCD,o,r,.5),c=u(this._avgDA,r,i,.5);return[new I({x:i[0],y:i[1],spatialReference:t}),new I({x:s[0],y:s[1],spatialReference:t}),new I({x:o[0],y:o[1],spatialReference:t}),new I({x:r[0],y:r[1],spatialReference:t}),new I({x:a[0],y:a[1],spatialReference:t}),new I({x:n[0],y:n[1],spatialReference:t}),new I({x:h[0],y:h[1],spatialReference:t}),new I({x:c[0],y:c[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=O.fromGeometry(v(i,e.spatialReference),k.Local).components[0].vertices;o.forEach(((e,t)=>{s.setVertexPosition(e,r[t].pos)})),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((e,t)=>{this._scaleGraphics[t].geometry=e}))}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=D.fromGeometry(v(this._graphic.geometry,e.spatialReference),k.Local),this._backgroundGraphic=new t({symbol:new z({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new K({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((s=>new t({symbol:new K({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new P({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new A({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((t,i)=>new C({tool:this,view:e,graphic:t,direction:J[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),o((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),e.on("click",(async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=H(t),o=[];e.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=B(r.results),i="georeference"in s,o=a.map((e=>"media"===e.type?e.element:null)).filter(Boolean),n=new Set([...this._graphicsLayer.graphics,i?null:s].filter(Boolean));i&&o.includes(s)||null!=t&&n.has(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}}))]);const r=e=>{this.addHandles(e.events.on("grab-changed",(e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))})))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach((e=>e.forEachManipulator(r))),this.addHandles([e.on("key-down",(t=>{e.activeTool===this&&(t.key!==N.shift||t.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,t.stopPropagation()),t.key!==N.toggleOpacity||t.repeat||("georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),t.stopPropagation()),t.key!==N.primaryKey||t.repeat||(this._factor=X,t.stopPropagation()),this._isModifierActive&&(t.key===N.plus&&(this._scale(this._factor),t.stopPropagation()),t.key===N.minus&&(this._scale(-this._factor),t.stopPropagation()),t.key===N.up&&(this._move(0,this._factor),t.stopPropagation()),t.key===N.down&&(this._move(0,-this._factor),t.stopPropagation()),t.key===N.left&&(this._move(-this._factor,0),t.stopPropagation()),t.key===N.right&&(this._move(this._factor,0),t.stopPropagation())))})),e.on("key-up",(t=>{e.activeTool===this&&(t.key===N.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,t.stopPropagation()),t.key===N.primaryKey&&(this._factor=Q,t.stopPropagation()))}))])}async _loadProjectionEngine(){const e=this._graphic.geometry;return G(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;y(o,s,t),y(o,o,i);const r=this._cornerB;y(r,s,t),g(r,r,i);const a=this._cornerC;g(a,s,t),g(a,a,i);const n=this._cornerD;g(n,s,t),y(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=[];for(const a of t.data.components)i.push(...a.vertices);const s=t.data.geometry.extent?.width,o=(s+e*this.view.resolution)/s,r=t.scaleVertices(i,this._plane.origin,p,o,o,U.NEW_STEP,E.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,e*this.view.resolution,t*this.view.resolution,0,U.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],Y.prototype,"_plane",null),e([a()],Y.prototype,"_backgroundGraphicGeometry",null),e([a()],Y.prototype,"_rotateGraphicGeometry",null),e([a()],Y.prototype,"_scaleGraphicGeometries",null),e([a()],Y.prototype,"preserveAspectRatio",void 0),e([a()],Y.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],Y.prototype,"target",void 0),e([a({constructOnly:!0})],Y.prototype,"view",void 0),Y=e([n("esri.views.2d.interactive.editingTools.TransformTool")],Y);export{Y as TransformTool,N as keys};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../core/Handles.js";import{set as i,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{l as s,c as a,
|
|
5
|
+
import t from"../../../../../core/Handles.js";import{set as i,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{l as s,c as a,r as n,f as o,k as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as h,c as p}from"../../../../../chunks/boundedPlane.js";import{getInfo as u}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Manipulation as _,ManipulatorType as m}from"./Manipulation.js";import{onGrabChangedHandle as d}from"./utils.js";import{createManipulatorDragEventPipeline as f,screenToMap as v}from"../../../../interactive/dragEventPipeline.js";import{GraphicManipulator as g}from"../../../../interactive/GraphicManipulator.js";import{AccumulationBehavior as b}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as x}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{apply as C}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";const E=10,S=1e-6,y=.3;function j(t){const i=s(t.basis1),e=s(t.basis2);return y*Math.min(i,e)}class w extends _{constructor(i){super(),this._handles=new t,this._planeStart=h(),this._displayPlaneStart=h(),this._originCache=c(),this._axisCache=r(),this._renderStartCache=c(),this._renderEndCache=c(),this._resizeOriginCache=c(),this._view=i.view,this._tool=i.tool,this._graphic=i.graphic,this._direction=i.direction,this._preserveAspectRatio=i.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",(t=>d(t,this._manipulator)))]),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,m.SCALE)}createDragPipeline(t,r){let c=null,h=null,_=null,m=0,d=null,g=null;const y=this._planeStart,w=this._displayPlaneStart,P=this._direction;return f(this._manipulator,((f,M)=>{M.next((i=>{if("start"===i.action){f.cursor="grabbing";const i=t();c=i.plane,h=i.displayPlane,_=i.editGeometryOperations,m=E*this._view.resolution,p(c,y),p(h,w);const e=u(_.data.spatialReference);d=e?e.valid[1]-e.valid[0]-3*E*this._view.resolution:null}return i})).next(v(this._view)).next((t=>{const i=a(this._renderStartCache,[t.mapStart.x,t.mapStart.y,0]),e=a(this._renderEndCache,[t.mapEnd.x,t.mapEnd.y,0]),r=a(this._resizeOriginCache,w.origin);n(r,r,w.basis1,-P[0]),n(r,r,w.basis2,-P[1]),o(e,e,r),o(i,i,r);const c=0!==P[0]&&0!==P[1],p=j(w),u=j(h)/p,_=(t,r)=>{if(0===t)return 1;let a=s(r),n=.5*t*l(r,e)/a;const o=n<0?-1:1;if(c){n+=(a-.5*t*l(r,i)/a)*o*u}const h=a<1.5*m?1:S;return a=Math.max(a-m,S),o>0&&(n-=E*this._view.resolution),o*Math.max(o*(n/a),h)},d=_(P[0],w.basis1),f=_(P[1],w.basis2);return{...t,direction:P,factor1:d,factor2:f}})).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next((t=>{const s=a(this._originCache,y.origin);n(s,s,y.basis1,-P[0]),n(s,s,y.basis2,-P[1]);const o=i(this._axisCache,y.basis1[0],y.basis1[1]);e(o,o);const l=[];for(const i of _.data.components)l.push(...i.vertices);const h="start"===t.action?b.NEW_STEP:b.ACCUMULATE_STEPS,u=_.scaleVertices(l,s,o,t.factor1,t.factor2,h,x.REPLACE);return d&&d<_.data.geometry.extent.width&&g?_.updateVertices(l,g):(p(y,c),C(u,c),g=u.operation,r(t,u)),t})).next((t=>("end"===t.action&&(f.cursor="grab"),t)))}))}_createManipulator(){return new g({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}export{w as ScaleManipulation,j as calculateDiagonalResizeHandleScale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{ignoreAbortErrors as e,throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i,hasDiff as a}from"../../../../core/accessorSupport/diffUtils.js";import o from"../../../../geometry/SpatialReference.js";import
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{ignoreAbortErrors as e,throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i,hasDiff as a}from"../../../../core/accessorSupport/diffUtils.js";import o from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{BinningStrategy as u}from"./processor/BinningStrategy.js";import{ClusterStrategy as g}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as d}from"./processor/FeatureUpdateStrategy.js";import{AttributeStore as y}from"./support/AttributeStore.js";import{ComputedAttributeStorage as _}from"./support/ComputedAttributeStorage.js";import{QueueProcessor as p}from"../../../support/QueueProcessor.js";class l{constructor(t,s){this._connection=t,this._source=s,this._version=1,this._queue=new p({concurrency:1,process:t=>this._process(t)}),this._proxy=new h({fetch:(t,e)=>this._connection.layerView.fetch(t,e),fetchDictionary:(t,e)=>this._connection.layerView.fetchDictionary(t,e)}),this._attributeStore=new y({isLocal:!1,update:t=>e(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destory(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(t){return this._strategy?this._strategy.getDisplayFeatures(t):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(t){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(t):[]}onSubscribe(t){this._strategy?.onSubscribe(t)}onUnsubscribe(t){this._strategy?.onUnsubscribe(t)}async update(t,e,s,r,n){const h=t.processor,u=i(this._schema,h);if(!u&&!r)return;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:u,schema:h}),this._schema=h;const g=o.fromJSON(t.source.mutable.dataFilter.outSpatialReference),d=new _({fields:this._source.metadata.fieldsIndex,spatialReference:g});return await this._attributeStore.update(h.storage,d,this._source.metadata,g,e),this._strategy?.invalidateAttributeData(),r||a(u,"mesh")?(a(u,"mesh.strategy")&&await this._updateStrategy(h.mesh.strategy,g,n),this._updateSortKey(d,"sortKey"in h.mesh?h.mesh.sortKey:null),(a(u,"mesh.factory")||"dictionary"===h.mesh.factory.symbology.type)&&(this._factory=await c.create(d,this._proxy,h.mesh.factory,s)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(t){if(!this._strategy)return;const e=this._strategy.applyOverride(t);for await(const r of e)try{await this._process(r)}catch(s){}this._source.applyOverride(t)}async updateChunks(){return this._doUpdateChunks()}async removeChunks(t){this._strategy?.removeChunks(t),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:t}){if(!this._strategy)return void this._attributeStore.setHighlight(t.map((({objectId:t,highlightFlags:e})=>({objectId:t,highlightFlags:e,displayId:-1}))),t);const e=this._strategy.displayMap(t,(({objectId:t})=>t),((t,{highlightFlags:e},s)=>({objectId:s,displayId:t,highlightFlags:e})));this._attributeStore.setHighlight(e,t)}async _doUpdateChunks(){if(!this._strategy)return;const t=this._strategy.updateChunks(),e=[];for await(const i of t){const t=this._queue.push(i).catch((t=>s(t)));e.push(t)}try{await Promise.all(e)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(t,e,s){switch(this._strategy?.destroy(),t.type){case"feature":this._strategy=new d(this._source,this._attributeStore);break;case"binning":this._strategy=await u.create(t,e,this._source,this._attributeStore);break;case"cluster":this._strategy=await g.create(this._connection,t,e,this._source,this._attributeStore)}for(const r of s)this._strategy.onSubscribe(r)}async _updateSortKey(e,s){if(this._sortInfo=t(this._sortInfo?.computed),null!=s){const t=s.byRenderer?null:await e.createComputedField(s);this._sortInfo={...s,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(t){const e=t.subscription,s=this._source.metadata.createArcadeEvalOptions(e.tile);if(has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process`)}await this._fetchResources(t,s),r(e.signal);const i=await this._write(t,s),a=e.tile.tileInfoView.tileInfo.isWrappable,{message:o,transferList:n}=i.serialize(a),c=t.createMessage(o,this._version,this._attributeStore.epoch);if(r(e.signal),await this._connection.container.onMessage(c,{signal:e.signal,transferList:n}),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process.await`)}}async _fetchResources(t,e){await this._fetchMatcherResources(t),await this._fetchWriterResources(t,e)}async _fetchMatcherResources(t){if(t.reader)return this._factory.enqueueMatcherRequests(this._proxy,t.reader)}async _fetchWriterResources(t,e){if(!t.reader)return;const s=t.reader.getCursor();for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,e);await this._proxy.fetchEnqueuedResources()}async _write(t,e){const s=t.subscription.tile,r=t.reader?.getCursor(),i=r?.getSize()??0,a=new n(s.key.id,this._strategy.enablePixelBuffering,i);if(!r)return a;for(;r.next();){const t=this._getSortKeyValue(r,e);a.entityStart(r.getDisplayId(),t),this._factory.write(a,this._proxy,r,e,s.level),a.entityEnd()}return a}_getSortKeyValue(t,e){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(t,e):s?.read(t,e);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeohashTree as e}from"../../../../../geohash/GeohashTree.js";import{getGeohash as
|
|
5
|
+
import{GeohashTree as e}from"../../../../../geohash/GeohashTree.js";import{getGeohash as t}from"../../../../../geohash/geohashUtils.js";import{tileSize as r}from"../../../engine/webgl/definitions.js";class o{constructor(t){this._options=t,this._tree=new e(t.fields)}insert(e,t){const r=e.getCursor(),o={$view:{scale:0,timeZone:this._options.timeZone}};for(;r.next();)this._insertFeature(r,o,t)}putBins(e,t){this._tree.putBins(e,t)}_insertFeature(e,o,s){const{featureFilter:i,geohashLevel:n,spatialReference:a}=this._options;if(null!==i&&!i.check(e))return;let l=0,c=0;if("esriGeometryPoint"===e.geometryType)l=e.readXWorldSpace(),c=e.readYWorldSpace();else{if(s){const t=e.readCentroidForDisplay();if(null==t)return;const[o,s]=t.coords;if(o<0||o>r||s<0||s>r)return}const t=e.readCentroidWorldSpace();if(null==t)return;l=t.coords[0],c=t.coords[1]}const h=t(l,c,n,a);h&&this._tree.insert(e,l,c,h[0],h[1],n,o)}}export{o as GeohashSpatialIndex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getMetersPerUnitForSR as e,inchesPerMeter as t}from"../../../../../core/unitUtils.js";import{tileSize as i}from"../../../engine/webgl/definitions.js";import{GridCell as s}from"./GridCell.js";const o=96;function l(i,s){return e(i)*t*o/s}class r{constructor(e){this._options=e,this._cells=new Map,this._pixelsPerMapUnit=l(e.spatialReference,e.scale)}insert(e,t){const i=e.getCursor(),s={$view:{scale:this._options.scale}};for(;i.next();)this._insertFeature(i,s,t)}putCellsInBounds(e,t){const[i,s,o,l]=t,r=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),n=Math.floor(s*this._pixelsPerMapUnit/this._options.cellSize),c=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize),p=Math.ceil(l*this._pixelsPerMapUnit/this._options.cellSize);for(let a=n;a<=p;a++)for(let t=r;t<=c;t++){const i=`${t}.${a}`,s=this._cells.get(i);if(!s)continue;const o=e.get(s.id);o?s&&!e.has(s.id)&&o.merge(s):e.set(s.id,s.clone())}}putCells(e){for(const t of this._cells.values()){const i=e.get(t.id);i?i.merge(t):e.set(t.id,t.clone())}}_insertFeature(e,t,s){const{featureFilter:o}=this._options;if(null!==o&&!o.check(e))return;let l=0,r=0;if("esriGeometryPoint"===e.geometryType)l=e.readXWorldSpace(),r=e.readYWorldSpace();else{if(s){const t=e.readCentroidForDisplay();if(null==t)return;const[s,o]=t.coords;if(s<0||s>i||o<0||o>i)return}const t=e.readCentroidWorldSpace();if(null==t)return;l=t.coords[0],r=t.coords[1]}const n=l*this._pixelsPerMapUnit,c=r*this._pixelsPerMapUnit,p=Math.floor(n/this._options.cellSize),a=Math.floor(c/this._options.cellSize);this._getCellOrCreate(p,a).insert(e,t,l,r)}_getCellOrCreate(e,t){const i=s.createId(e,t);let o=this._cells.get(i);if(!o){const l=1*this._options.cellSize/this._pixelsPerMapUnit;o=s.create(e,t,this._options.fields,l),this._cells.set(i,o)}return o}}export{r as GridSpatialIndex,l as pixelsPerMapUnit};
|
|
5
|
+
import{getMetersPerUnitForSR as e,inchesPerMeter as t}from"../../../../../core/unitUtils.js";import{tileSize as i}from"../../../engine/webgl/definitions.js";import{GridCell as s}from"./GridCell.js";const o=96;function l(i,s){return e(i)*t*o/s}class r{constructor(e){this._options=e,this._cells=new Map,this._pixelsPerMapUnit=l(e.spatialReference,e.scale)}insert(e,t){const i=e.getCursor(),s={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;i.next();)this._insertFeature(i,s,t)}putCellsInBounds(e,t){const[i,s,o,l]=t,r=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),n=Math.floor(s*this._pixelsPerMapUnit/this._options.cellSize),c=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize),p=Math.ceil(l*this._pixelsPerMapUnit/this._options.cellSize);for(let a=n;a<=p;a++)for(let t=r;t<=c;t++){const i=`${t}.${a}`,s=this._cells.get(i);if(!s)continue;const o=e.get(s.id);o?s&&!e.has(s.id)&&o.merge(s):e.set(s.id,s.clone())}}putCells(e){for(const t of this._cells.values()){const i=e.get(t.id);i?i.merge(t):e.set(t.id,t.clone())}}_insertFeature(e,t,s){const{featureFilter:o}=this._options;if(null!==o&&!o.check(e))return;let l=0,r=0;if("esriGeometryPoint"===e.geometryType)l=e.readXWorldSpace(),r=e.readYWorldSpace();else{if(s){const t=e.readCentroidForDisplay();if(null==t)return;const[s,o]=t.coords;if(s<0||s>i||o<0||o>i)return}const t=e.readCentroidWorldSpace();if(null==t)return;l=t.coords[0],r=t.coords[1]}const n=l*this._pixelsPerMapUnit,c=r*this._pixelsPerMapUnit,p=Math.floor(n/this._options.cellSize),a=Math.floor(c/this._options.cellSize);this._getCellOrCreate(p,a).insert(e,t,l,r)}_getCellOrCreate(e,t){const i=s.createId(e,t);let o=this._cells.get(i);if(!o){const l=1*this._options.cellSize/this._pixelsPerMapUnit;o=s.create(e,t,this._options.fields,l),this._cells.set(i,o)}return o}}export{r as GridSpatialIndex,l as pixelsPerMapUnit};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as s,createLabelVVEvaluator as o}from"./labelingUtils.js";import{createFeatureSourceSchema as
|
|
5
|
+
import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as s,createLabelVVEvaluator as o}from"./labelingUtils.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=s(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(s){const o=this.layer,n=o.parent,a=t(n),{capabilities:l,editingInfo:d,objectIdField:p,globalIdField:c,datesInUnknownTimezone:m,orderBy:y,subtypeField:f,parsedUrl:u}=n,b=n.fieldsIndex.toJSON(),g=i(o),h=n.timeInfo?.toJSON(),I=o.spatialReference.toJSON(),S=e(u);let j=p;if(y?.length){const e=!y[0].valueExpression&&y[0].field;e&&(j=e)}return{type:"feature-service",source:S,isSourceHosted:r(S.path),orderByFields:j,metadata:{timeReferenceUnknownClient:m,subtypeField:f,globalIdField:c,fieldsIndex:b,geometryType:g,objectIdField:p,timeInfo:h,spatialReference:I,subtypes:null,typeIdField:null,types:null,timeZone:s.timeZone},queryMetadata:{capabilities:l,effectiveCapabilities:a,lastEditDate:d?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,r,t){const{definitionExpression:i,customParameters:s,timeExtent:o,apiKey:a}=this.layer.parent;return n(e,{definitionExpression:i,customParameters:s,timeExtent:o},r,t,a)}createProcessorSchema(e,r,t){const{parent:{fields:i,geometryType:s,orderBy:o,objectIdField:n},renderer:l,labelingInfo:d,labelsVisible:p}=this.layer,c={featureReduction:null,fields:i.map((e=>e.toJSON())),geometryType:s,labelingInfo:d,labelsVisible:p,objectIdField:n,orderBy:o??"default",renderer:l?.clone()};return a(e,r,c,t)}get hasRequiredSupport(){return l(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{parent:t,parent:{definitionExpression:i,apiKey:s},renderer:o}=r,n=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:s,customParameters:JSON.stringify(t.customParameters),definitionExpression:i,labelingInfo:n,orderBy:JSON.stringify(t.orderBy),renderer:o}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}}export{d as CatalogFootprintLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as i}from"./featureServiceUtils.js";import{hasFloorFilter as o,addFloorFilter as a}from"./floorFilterUtils.js";import{getEffectiveGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as d,createLabelVVEvaluator as p}from"./labelingUtils.js";import{createFeatureSourceSchema as
|
|
5
|
+
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as i}from"./featureServiceUtils.js";import{hasFloorFilter as o,addFloorFilter as a}from"./floorFilterUtils.js";import{getEffectiveGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as d,createLabelVVEvaluator as p}from"./labelingUtils.js";import{createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as y}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=n(t,e)??d(t);return[{vvEvaluators:{0:p(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(s){const o=this.layer,a=r(o),{capabilities:n,editingInfo:d,objectIdField:p,typeIdField:m,globalIdField:y,datesInUnknownTimezone:c,orderBy:u,subtypeField:f,refreshInterval:h}=o,b=o.fieldsIndex.toJSON(),g=b.fields,S=l(o),I=o.timeInfo?.toJSON(),j=o.spatialReference.toJSON(),F=o.types?.map((e=>e.toJSON())),x=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(x.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let E=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(E=e)}const U=!(null!=d?.lastEditDate)&&h>0,v=has("featurelayer-snapshot-enabled")&&"point"===o.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!U,O=v&&i(s,o.fullExtent);return{type:"feature-service",source:x,isSourceHosted:t(x.path),orderByFields:E,metadata:{typeIdField:m??void 0,types:F,timeReferenceUnknownClient:c,subtypeField:f,globalIdField:y,fields:g,fieldsIndex:b,geometryType:S,objectIdField:p,timeInfo:I,spatialReference:j,subtypes:this.layer.subtypes?.map((e=>e.toJSON())),timeZone:s.timeZone},queryMetadata:{capabilities:n,effectiveCapabilities:a,lastEditDate:d?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:v,supportsSnapshotMaxThreshold:O,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:i,gdbVersion:o,historicMoment:a,subtypeCode:l,subtypeField:n,timeExtent:d,apiKey:p}=this.layer;return m(e,{definitionExpression:s,customParameters:i,gdbVersion:o,historicMoment:a,subtypeCode:l,subtypeField:n,timeExtent:d},t,r,p)}createProcessorSchema(e,t,r){const{fields:i,renderer:o,geometryType:a,labelingInfo:l,labelsVisible:n,orderBy:d,objectIdField:p}=this.layer,m={fields:i.map((e=>e.toJSON())),renderer:o?.clone(),featureReduction:s(this.layer,t),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:d??"default"};return y(e,t,m,r)}get hasRequiredSupport(){return c(this.layer.renderer)}hasFilters(e){return o(this.layer,e)}addFilters(e,t){return a(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:i,gdbVersion:a,apiKey:l,subtypeCode:n}=t,d=this.layer.labelsVisible?this.layer.labelingInfo:null,p=t.historicMoment?.getTime()??void 0,m=JSON.stringify(t.customParameters),y=s(t,e)?.toJSON(),c=JSON.stringify(t.orderBy);return{apiKey:l,customParameters:m,definitionExpression:r,featureReduction:y,floors:o(this.layer,e)?e.floors:null,gdbVersion:a,historicMoment:p,labelingInfo:d,orderBy:c,renderer:i,subtypeCode:n}}}export{u as FeatureLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/Error.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as
|
|
5
|
+
import e from"../../../../../core/Error.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as n,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";function d(r){if(!("openPorts"in r))throw new e("source-not-supported")}class p{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??n(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(e){const t=this.layer,o=r(t),{capabilities:n,objectIdField:s}=t,l=t.fieldsIndex.toJSON(),a=i(t),c=t.timeInfo?.toJSON(),p=t.spatialReference.toJSON();d(t.source);return{type:"memory",source:await t.source.openPorts(),orderByFields:s,metadata:{fieldsIndex:l,geometryType:a,objectIdField:s,timeInfo:c,spatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null,timeZone:e.timeZone},queryMetadata:{capabilities:n,effectiveCapabilities:o,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r,t){const{definitionExpression:i,timeExtent:o}=this.layer;return l(e,{definitionExpression:i,timeExtent:o,customParameters:null},r,t,null)}createProcessorSchema(e,r,i){const{fields:o,renderer:n,geometryType:s,labelingInfo:l,labelsVisible:c,orderBy:d,objectIdField:p}=this.layer,u={fields:o.map((e=>e.toJSON())),renderer:n?.clone(),featureReduction:t(this.layer,r),geometryType:s,labelingInfo:l,labelsVisible:c,objectIdField:p,orderBy:d??"default"};return a(e,r,u,i)}get hasRequiredSupport(){return c(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{definitionExpression:i,renderer:o}=r,n=this.layer.labelsVisible?this.layer.labelingInfo:null,s=t(r,e)?.toJSON();return{orderBy:JSON.stringify(r.orderBy),definitionExpression:i,renderer:o,labelingInfo:n,featureReduction:s}}}export{p as InMemoryLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getEffectiveLayerCapabilities as e}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as
|
|
5
|
+
import{getEffectiveLayerCapabilities as e}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as o}from"./labelingUtils.js";import{createFeatureSourceSchema as s}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as a}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??l(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(r){const i=this.layer,l=e(i),{capabilities:o,objectIdField:s}=i,n=i.fieldsIndex.toJSON(),a=t(i),c=i.spatialReference.toJSON();return{type:"memory",source:await i.source.openPorts(),orderByFields:s,metadata:{fieldsIndex:n,geometryType:a,objectIdField:s,spatialReference:c,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null,timeZone:r.timeZone},queryMetadata:{capabilities:o,effectiveCapabilities:l,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r,t){const{definitionExpression:i}=this.layer;return s(e,{definitionExpression:i,customParameters:null},r,t,null)}createProcessorSchema(e,t,i){const{fields:l,renderer:o,geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:d}=this.layer,p={fields:l.map((e=>e.toJSON())),renderer:o?.clone(),featureReduction:r(this.layer,t),geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:d,orderBy:"default"};return n(e,t,p,i)}get hasRequiredSupport(){return a(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:l}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null,s=r(t,e)?.toJSON();return{definitionExpression:i,renderer:l,labelingInfo:o,featureReduction:s}}}export{c as KnowledgeGraphSublayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../../../core/lang.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as o}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??l(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(t){const i=this.layer,l=r(i),{capabilities:s,objectIdField:a}=i,n=i.fieldsIndex.toJSON(),c=o(i),d=i.timeInfo?.toJSON(),m=i.spatialReference.toJSON(),u=i.source.getSource(),p=this.layer.objectIdField,y=e(s);return y.query.maxRecordCount=u.maxRecordCount,{type:"ogc",source:u,orderByFields:p,metadata:{fieldsIndex:n,geometryType:c,objectIdField:a,timeInfo:d,spatialReference:m,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:y,effectiveCapabilities:l,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r,t){const{customParameters:o,timeExtent:i,apiKey:l}=this.layer;return a(e,{customParameters:o,timeExtent:i},r,t,l)}createProcessorSchema(e,r,o){const{fields:i,renderer:l,geometryType:s,labelingInfo:a,labelsVisible:c,orderBy:d,objectIdField:m}=this.layer,u={fields:i.map((e=>e.toJSON())),renderer:l?.clone(),featureReduction:t(this.layer,r),geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:m,orderBy:d??"default"};return n(e,r,u,o)}get hasRequiredSupport(){return c(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{renderer:o,apiKey:i}=r,l=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(r.customParameters),a=t(r,e)?.toJSON();return{apiKey:i,customParameters:s,featureReduction:a,labelingInfo:l,orderBy:JSON.stringify(r.orderBy),renderer:o}}}export{d as OGCFeatureLayerAdapter};
|
|
5
|
+
import{clone as e}from"../../../../../core/lang.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as o}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??l(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(t){const i=this.layer,l=r(i),{capabilities:s,objectIdField:a}=i,n=i.fieldsIndex.toJSON(),c=o(i),d=i.timeInfo?.toJSON(),m=i.spatialReference.toJSON(),u=i.source.getSource(),p=this.layer.objectIdField,y=e(s);return y.query.maxRecordCount=u.maxRecordCount,{type:"ogc",source:u,orderByFields:p,metadata:{fieldsIndex:n,geometryType:c,objectIdField:a,timeInfo:d,spatialReference:m,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null,timeZone:t.timeZone},queryMetadata:{capabilities:y,effectiveCapabilities:l,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r,t){const{customParameters:o,timeExtent:i,apiKey:l}=this.layer;return a(e,{customParameters:o,timeExtent:i},r,t,l)}createProcessorSchema(e,r,o){const{fields:i,renderer:l,geometryType:s,labelingInfo:a,labelsVisible:c,orderBy:d,objectIdField:m}=this.layer,u={fields:i.map((e=>e.toJSON())),renderer:l?.clone(),featureReduction:t(this.layer,r),geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:m,orderBy:d??"default"};return n(e,r,u,o)}get hasRequiredSupport(){return c(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{renderer:o,apiKey:i}=r,l=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(r.customParameters),a=t(r,e)?.toJSON();return{apiKey:i,customParameters:s,featureReduction:a,labelingInfo:l,orderBy:JSON.stringify(r.orderBy),renderer:o}}}export{d as OGCFeatureLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as i,addFloorFilter as l}from"./floorFilterUtils.js";import{getEffectiveGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as p,createLabelVVEvaluator as d}from"./labelingUtils.js";import{createFeatureSourceSchema as
|
|
5
|
+
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as i,addFloorFilter as l}from"./floorFilterUtils.js";import{getEffectiveGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as p,createLabelVVEvaluator as d}from"./labelingUtils.js";import{createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as c}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as f}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=n(r,e)??p(r);return[{vvEvaluators:{0:d(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(s){const i=this.layer,l=t(i),{capabilities:n,objectIdField:p,globalIdField:d,orderBy:m,refreshInterval:c}=i,f=i.fieldsIndex.toJSON(),u=f.fields,y=a(i),h=i.timeInfo?.toJSON(),b=i.spatialReference.toJSON(),g=e(this.layer.parsedUrl);let S=this.layer.objectIdField;if(m?.length){const e=!m[0].valueExpression&&m[0].field;e&&(S=e)}const I=c>0,j=has("featurelayer-snapshot-enabled")&&"point"===i.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!I,x=j&&o(s,i.fullExtent);return{type:"feature-service",source:g,isSourceHosted:r(g.path),orderByFields:S,metadata:{globalIdField:d,fields:u,fieldsIndex:f,geometryType:y,objectIdField:p,timeInfo:h,spatialReference:b,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null,timeZone:s.timeZone},queryMetadata:{capabilities:n,effectiveCapabilities:l,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:j,supportsSnapshotMaxThreshold:x,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,r,t){const{definitionExpression:s,customParameters:o,timeExtent:i}=this.layer;return m(e,{definitionExpression:s,customParameters:o,timeExtent:i},r,t,null)}createProcessorSchema(e,r,t){const{fields:o,renderer:i,geometryType:l,labelingInfo:a,labelsVisible:n,orderBy:p,objectIdField:d}=this.layer,m={fields:o.map((e=>e.toJSON())),renderer:i?.clone(),featureReduction:s(this.layer,r),geometryType:l,labelingInfo:a,labelsVisible:n,objectIdField:d,orderBy:p??"default"};return c(e,r,m,t)}get hasRequiredSupport(){return f(this.layer.renderer)}hasFilters(e){return i(this.layer,e)}addFilters(e,r){return l(this.layer,e,r)}getUpdateHashProperties(e){const r=this.layer,{definitionExpression:t,renderer:o}=r,l=this.layer.labelsVisible?this.layer.labelingInfo:null,a=JSON.stringify(r.customParameters),n=s(r,e)?.toJSON();return{orderBy:JSON.stringify(r.orderBy),definitionExpression:t,renderer:o,labelingInfo:l,featureReduction:n,customParameters:a,floors:i(this.layer,e)?e.floors:null}}}export{u as OrientedImageryLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as r,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,o=r(t,e)??i(t);return[{vvEvaluators:{0:n(t.renderer)},deconflictionEnabled:o}]}async createServiceOptions(e){const r=this.layer,{objectIdField:i}=r,n=t(r),o=r.timeInfo?.toJSON()||null,l=r.spatialReference?r.spatialReference.toJSON():null;return{source:this.layer.parsedUrl,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:n,objectIdField:i,timeInfo:o,timeReferenceUnknownClient:null,spatialReference:l,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(e,t,r){const{definitionExpression:i,geometryDefinition:n,customParameters:o}=this.layer;return{type:"stream",service:e,tileInfoJSON:t.tileInfoJSON,mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{geometryDefinition:n?.toJSON(),definitionExpression:i,outSpatialReference:t.outSpatialReference.toJSON(),customParameters:o??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,r,i){const{fields:n,renderer:l,geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:
|
|
5
|
+
import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as r,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,o=r(t,e)??i(t);return[{vvEvaluators:{0:n(t.renderer)},deconflictionEnabled:o}]}async createServiceOptions(e){const r=this.layer,{objectIdField:i}=r,n=t(r),o=r.timeInfo?.toJSON()||null,l=r.spatialReference?r.spatialReference.toJSON():null;return{source:this.layer.parsedUrl,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:n,objectIdField:i,timeInfo:o,timeReferenceUnknownClient:null,spatialReference:l,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null,timeZone:e.timeZone}}}createSourceSchema(e,t,r){const{definitionExpression:i,geometryDefinition:n,customParameters:o}=this.layer;return{type:"stream",service:e,tileInfoJSON:t.tileInfoJSON,mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{geometryDefinition:n?.toJSON(),definitionExpression:i,outSpatialReference:t.outSpatialReference.toJSON(),customParameters:o??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,r,i){const{fields:n,renderer:l,geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:m}=this.layer,d={fields:n.map((e=>e.toJSON())),renderer:l?.clone(),featureReduction:e(this.layer,r),geometryType:s,labelingInfo:a,labelsVisible:c,objectIdField:m,orderBy:"default"};return o(t,r,d,i)}get hasRequiredSupport(){return l(this.layer.renderer)}getUpdateHashProperties(t){const r=this.layer,{definitionExpression:i,renderer:n}=r,o=this.layer.labelsVisible?this.layer.labelingInfo:null,l=JSON.stringify(r.customParameters),s=e(r,t)?.toJSON();return{definitionExpression:i,renderer:n,labelingInfo:o,featureReduction:s,customParameters:l,streamFilter:`${JSON.stringify(r.geometryDefinition)}${r.definitionExpression}`}}}export{s as StreamLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as a}from"../../../../../layers/support/layerUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as l,addFloorFilter as n}from"./floorFilterUtils.js";import{getEffectiveGeometryType as p}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as y}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as m}from"../schema/processor/SubtypeProcessorSchema.js";class c{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every((e=>y(e)))}]}async createServiceOptions(t){const r=this.layer,i=a(r),{capabilities:l,datesInUnknownTimezone:n,editingInfo:y,globalIdField:u,objectIdField:m,refreshInterval:c,subtypeField:d}=r,h=r.fieldsIndex.toJSON(),b=p(r),f=r.timeInfo?.toJSON(),g=r.spatialReference.toJSON(),S=e(this.layer.parsedUrl),F=m,I=!(null!=y?.lastEditDate)&&c>0,j=has("featurelayer-snapshot-enabled")&&"point"===r.geometryType&&l?.query.supportsPagination&&!l?.operations.supportsEditing&&!I,x=j&&o(t,r.fullExtent);return{type:"feature-service",source:S,isSourceHosted:s(S.path),orderByFields:F,metadata:{timeReferenceUnknownClient:n,subtypeField:d,globalIdField:u,fieldsIndex:h,geometryType:b,objectIdField:m,timeInfo:f,spatialReference:g,subtypes:this.layer.subtypes?.map((e=>e.toJSON())),typeIdField:null,types:null},queryMetadata:{capabilities:l,effectiveCapabilities:i,lastEditDate:y?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:j,supportsSnapshotMaxThreshold:x,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,s){const{definitionExpression:i,customParameters:a,gdbVersion:o,historicMoment:l,subtypeField:n,timeExtent:p,apiKey:y}=this.layer,m=this.layer.sublayers.map((e=>e.subtypeCode)).join(","),c=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${m})`:"1=2",d={definitionExpression:r(i,c),customParameters:a,gdbVersion:o,historicMoment:l,subtypeField:n,timeExtent:p};return u(e,d,t,s,y)}createProcessorSchema(e,t,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null})))};return m(e,t,s,r)}hasFilters(e){return l(this.layer,e)||d(this.layer,e)}addFilters(e,t){e=n(this.layer,e,t);const s=this.layer.sublayers.filter((e=>!h(e,t))).map((e=>e.subtypeCode));if(!s.length)return e;e??=new i;const a=`NOT ${this.layer.subtypeField} IN (${s.join(",")})`;return e.where=r(e.where,a),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:i}=t,a=t.historicMoment?.getTime()??void 0,o=JSON.stringify(t.customParameters),n=l(this.layer,e)?e.floors:null;return{gdbVersion:s,definitionExpression:r,historicMoment:a,customParameters:o,apiKey:i,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),floors:n}}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],s=this.layer.sublayers.find((e=>e.subtypeCode===r));e.layer=e.sourceLayer=s}}function d(e,t){return e.sublayers.some((e=>!h(e,t)))}function h(e,r){return e.visible&&(0===e.minScale||t(r.scale,e.minScale)||r.scale<e.minScale)&&(0===e.maxScale||t(r.scale,e.maxScale)||r.scale>e.maxScale)}export{c as SubtypeGroupLayerAdapter};
|
|
5
|
+
import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as a}from"../../../../../layers/support/layerUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as l,addFloorFilter as n}from"./floorFilterUtils.js";import{getEffectiveGeometryType as p}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as y}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as m}from"../schema/processor/SubtypeProcessorSchema.js";class c{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every((e=>y(e)))}]}async createServiceOptions(t){const r=this.layer,i=a(r),{capabilities:l,datesInUnknownTimezone:n,editingInfo:y,globalIdField:u,objectIdField:m,refreshInterval:c,subtypeField:d}=r,h=r.fieldsIndex.toJSON(),b=p(r),f=r.timeInfo?.toJSON(),g=r.spatialReference.toJSON(),S=e(this.layer.parsedUrl),F=m,I=!(null!=y?.lastEditDate)&&c>0,j=has("featurelayer-snapshot-enabled")&&"point"===r.geometryType&&l?.query.supportsPagination&&!l?.operations.supportsEditing&&!I,x=j&&o(t,r.fullExtent);return{type:"feature-service",source:S,isSourceHosted:s(S.path),orderByFields:F,metadata:{timeReferenceUnknownClient:n,subtypeField:d,globalIdField:u,fieldsIndex:h,geometryType:b,objectIdField:m,timeInfo:f,timeZone:t.timeZone,spatialReference:g,subtypes:this.layer.subtypes?.map((e=>e.toJSON())),typeIdField:null,types:null},queryMetadata:{capabilities:l,effectiveCapabilities:i,lastEditDate:y?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:j,supportsSnapshotMaxThreshold:x,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,s){const{definitionExpression:i,customParameters:a,gdbVersion:o,historicMoment:l,subtypeField:n,timeExtent:p,apiKey:y}=this.layer,m=this.layer.sublayers.map((e=>e.subtypeCode)).join(","),c=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${m})`:"1=2",d={definitionExpression:r(i,c),customParameters:a,gdbVersion:o,historicMoment:l,subtypeField:n,timeExtent:p};return u(e,d,t,s,y)}createProcessorSchema(e,t,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null})))};return m(e,t,s,r)}hasFilters(e){return l(this.layer,e)||d(this.layer,e)}addFilters(e,t){e=n(this.layer,e,t);const s=this.layer.sublayers.filter((e=>!h(e,t))).map((e=>e.subtypeCode));if(!s.length)return e;e??=new i;const a=`NOT ${this.layer.subtypeField} IN (${s.join(",")})`;return e.where=r(e.where,a),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:i}=t,a=t.historicMoment?.getTime()??void 0,o=JSON.stringify(t.customParameters),n=l(this.layer,e)?e.floors:null;return{gdbVersion:s,definitionExpression:r,historicMoment:a,customParameters:o,apiKey:i,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),floors:n}}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],s=this.layer.sublayers.find((e=>e.subtypeCode===r));e.layer=e.sourceLayer=s}}function d(e,t){return e.sublayers.some((e=>!h(e,t)))}function h(e,r){return e.visible&&(0===e.minScale||t(r.scale,e.minScale)||r.scale<e.minScale)&&(0===e.maxScale||t(r.scale,e.maxScale)||r.scale>e.maxScale)}export{c as SubtypeGroupLayerAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getGeohashBounds as e}from"../../../../../geohash/geohashUtils.js";import{unquantizeOptimizedGeometry as t,convertToFeature as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as i}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as n}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as
|
|
5
|
+
import{getGeohashBounds as e}from"../../../../../geohash/geohashUtils.js";import{unquantizeOptimizedGeometry as t,convertToFeature as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as i}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as n}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as l}from"../support/ComputedAttributeStorage.js";import d from"../support/FeatureFilter.js";import{FeatureMetadata as c}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as u}from"../support/FeatureSetReaderJSON.js";import p from"../../../tiling/TileKey.js";class f extends i{constructor(e,t){super(e),this.bins=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.bins.clear(),this.done=!1,this.handledChunks.clear()}destroy(){const e=this.subscription.tile.key.level;for(const t of this.bins.values()){const s=t.cachedFeature?.objectId;null!=s&&this._store.releaseDisplayIdForObjectId(`${s}.${e}`)}}*featuresWorldSpace(){for(const e of this.bins.values()){const s=e.cachedFeature;if(s){const e=s.clone();t(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}}getGeohashBounds(t,s){const r=this.subscription.tile;return e(r.extent,r.resolution,s,t)}}class h extends o{static async create(e,t,s,r){const o=new l({spatialReference:t}),i=e.fixedBinLevel,n=await Promise.all(e.fields.map((async e=>a.create(o,e)))),c=e.featureFilter?await d.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return new h({fields:n,geohashLevel:i,spatialReference:t,featureFilter:c,timeZone:s.metadata.timeZone},e.fields,s,r)}constructor(e,t,s,r){super(s,r,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new c({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:t,globalIdField:null,spatialReference:s.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null,timeZone:this._indexOptions.timeZone})}createState(e){return new f(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset()}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),a=[];for(const o of this._sendStates.values())for(const e of o.featuresWorldSpace()){const{objectId:t,displayId:o}=e,i=r.get(t);if(null!=i){const e=s(o,i,t);a.push(e),r.delete(t)}}return a}getDisplayFeatures(e){const t=new Set(e),r=new Set,a=[];for(const o of this._sendStates.values())for(const e of o.featuresWorldSpace())t.has(e.displayId)&&!r.has(e.objectId)&&(e.geometry&&a.push({...s(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),r.add(e.objectId));return{features:[],aggregates:a}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const s of t.featuresWorldSpace())e(s)}async*_update(e,t){const{handledChunks:s,subscription:a,bins:o}=e,{spatialReference:i,geohashLevel:l}=this._indexOptions,d=a.tile;if(e.done)return;for(const r of t.chunks()){if(s.has(r.chunkId))continue;s.add(r.chunkId);const t=r.queryInfo;if("tileId"in t){const e=new p(t.tileId);if(e.level!==d.level||e.world!==d.key.world)continue}const a=r.getGeohashIndex(this._indexOptions),n=e.getGeohashBounds(i,l);a.putBins(o,n)}const c=[],f=a.tile.transform,h=a.tile.key.level;for(const n of o.values()){if(n.cachedFeature)n.cachedFeature.attributes=n.getAttributes();else{const e=n.getGeometry(this.spatialReference,f),t=new r(e,n.getAttributes(),null);e||(t.centroid=n.getGeometryCentroid(this.spatialReference,f)),t.objectId=n.id,t.displayId=this._attributeStore.createDisplayIdForObjectId(`${t.objectId}.${h}`),n.cachedFeature=t}c.push(n.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const m=u.fromOptimizedFeatures(c,this._metadata,f),g=m.getCursor(),y=this._metadata.createArcadeEvalOptions(e.subscription.tile);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,y);const b=new n(e.subscription,m,[],e.done,{});yield b}}export{f as BinningState,h as BinningStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import{tileSize as s}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as i}from"../aggregation/ComputedAggregateField.js";import{GridCell as r}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as
|
|
5
|
+
import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import{tileSize as s}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as i}from"../aggregation/ComputedAggregateField.js";import{GridCell as r}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as a}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as n}from"./AAggregateStrategy.js";import{ASendState as l}from"./AProcessorStrategy.js";import{WithDisplayId as o}from"./support/WithDisplayId.js";import{FeatureTileAppendMessage as d}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as c}from"../support/ComputedAttributeStorage.js";import u from"../support/FeatureFilter.js";import{FeatureMetadata as h}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as p}from"../support/FeatureSetReaderJSON.js";import f from"../../../tiling/TileKey.js";const g=128;class m extends l{constructor(e){super(e),this.didSend=!1,this.done=!1}}class _{constructor(e,t,s,i,r){this._level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const s=e.inner.getCentroid(null),i=new t(s,e.inner.getAttributes(),null);i.objectId=e.inner.id,i.displayId=e.displayId,yield i}}clusters(){return this._clusters.values()}updateChunks(e){let t=!1;for(const s of e){const e=s.queryInfo;if("tileId"in e){if(new f(e.tileId).level!==this._level)continue}if(!this._handledChunks.has(s.normalizedChunkId)){this._handledChunks.add(s.normalizedChunkId),t=!0;s.getGridIndex({...this._indexOptions,scale:this._scale}).putCells(this._cells)}}return t&&this._clusterCells(),t}async updateStatistics(e){let t=!1;for(const s of this._clusters.values())s.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,s.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map((([e,t])=>({fieldName:e,minValue:t.minValue,maxValue:t.maxValue})));await e.container.updateStatistics(this._level,t)}}createAggregateFeatures(e,i){const r=e.subscription,a=[],n=r.tile.transform;for(const l of this._clusters.values()){const e=l.inner.getCentroid(n),i=new t(e,l.inner.getAttributes(),null);i.objectId=l.inner.id,i.displayId=l.displayId;const o=i.geometry.coords,d=r.tile.lod,c=d.wrap?d.worldSize[0]:null;if(null!=c)if(1===c){const e=i.clone();e.geometry.coords[0]-=s,a.push(e);const t=i.clone();t.geometry.coords[0]+=s,a.push(t)}else o[0]>s+s/2?o[0]-=c*s:o[0]<-s/2&&(o[0]+=c*s);const[u,h]=i.geometry.coords;u<s+g&&u>=-g&&h<s+g&&h>=-g&&a.push(i)}return p.fromOptimizedFeatures(a,i,r.tile.transform)}_clusterCells(){let e=Array.from(this._cells.values());e=e.sort(((e,t)=>t.count-e.count));const t=[];for(const i of this._clusters.values())t.push(i.inner.id);this._clusters.clear();const s=new Set;for(const i of e){if(s.has(i.id))continue;const e=this._store.createDisplayIdForObjectId(i.id),t=new o(i.clone(),e);s.add(i.id),this._clusters.set(i.id,t);const n=this._clusterRadius*(1/a(this._indexOptions.spatialReference,this._scale)),l=1+this._clusterRadius/this._indexOptions.cellSize,d=i.centroidXWorld,c=i.centroidYWorld;for(let a=i.gridY-l;a<=i.gridY+l;a++)for(let e=i.gridX-l;e<=i.gridX+l;e++){if(a===i.gridY&&e===i.gridX)continue;const l=this._cells.get(r.createId(e,a));if(!l||s.has(l.id))continue;const o=Math.abs(l.centroidXWorld-d),u=Math.abs(l.centroidYWorld-c);o<n&&u<n&&(t.inner.merge(l),s.add(l.id))}}for(const i of t)this._store.releaseDisplayIdForObjectId(i)}_updateAggregateStatistics(e,t){let s=!1;for(const i of t.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const t=i.value,r=i.field,a=e.get(r.name);if(a){const{minValue:e,maxValue:i}=a,r=Math.min(a.minValue,t),n=Math.max(a.maxValue,t);e===r&&i===n||(a.minValue=r,a.maxValue=n,s=!0)}else e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class y extends n{static async create(e,t,s,r,a){const n=new c({spatialReference:s}),l={fields:await Promise.all(t.fields.map((async e=>i.create(n,e)))),spatialReference:s,featureFilter:t.featureFilter?await u.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:s,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:r.metadata.timeZone};return new y(e,t.clusterRadius,l,t.fields,r,a)}constructor(e,t,s,i,r,a){super(r,a,s.spatialReference,s.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._cellsPerScale=new Map,this._metadata=new h({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fields:[...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],globalIdField:null,spatialReference:r.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null,timeZone:r.metadata.timeZone})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new m(e)}async*applyOverride(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,s){const i=new Map(e.map((e=>[t(e),e]))),r=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const n of a.clusters()){const e=i.get(n.inner.id);if(null==e){if(1===n.inner.count){const e=i.get(n.inner.firstObjectId);if(null!=e){const t=s(n.displayId,e,n.inner.firstObjectId);r.push(t),i.delete(n.inner.firstObjectId)}}}else{const t=s(n.displayId,e,n.inner.id);r.push(t),i.delete(n.inner.id)}}return r}getDisplayFeatures(t){const s=new Set(t),i=new Set,r=[],a=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const l of n.aggregatesWorldSpace())if(s.has(l.displayId)&&!i.has(l.displayId)){const t=e(l,this._metadata.geometryType,!1,!1);if(i.add(l.displayId),1===t.attributes.cluster_count){r.push({...t,displayId:l.displayId});continue}a.push({...t,displayId:l.displayId})}return{features:r,aggregates:a}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.clusters())if(s.inner.id===e)return Array.from(s.inner.objectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);if(t.updateChunks(e)||!this._source.updateTracking.updating)for(const r of this._sendStates.values())r.subscription.tile.level===this._requiredLevel&&(r.didSend=!1,r.done=!1);const s=Array.from(this._sendStates.values()).filter((e=>e.done)).map((e=>e.subscription.tile.key)),i=new Set(s);for(const r of this._sendStates.values()){if(this._source.updateTracking.updating){if(s.some((e=>e.containsChild(r.subscription.tile.key))))continue;if(r.subscription.tile.key.getChildKeys().every((e=>i.has(e))))continue}r.didSend||r.subscription.tile.level!==this._requiredLevel||(r.didSend=!0,yield*this._update(r,t,this._source))}await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(null==this._requiredLevel||null==this._requiredScale)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.aggregatesWorldSpace())e(s)}_getClusterState(e,t){if(null==e||null==t)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(t);return s||(s=new _(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,s)),s}async*_update(e,t,s){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!s.updateTracking.updating;const r=i.getCursor(),a=this._metadata.createArcadeEvalOptions(e.subscription.tile);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,a);const n=new d(e.subscription,i,!0,e.done,{});yield n}}export{m as ClusterState,y as ClusterStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ASendState as t,AProcessorStrategy as e}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as n}from"../sources/strategies/chunks/OverrideChunk.js";class o extends t{}class a extends e{constructor(t,e){super(t,e),this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set}destroy(){super.destroy();for(const t of this._source.chunks())this._cleanupChunkIds(t)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(t){super.onSubscribe(t),this._evalOptions=t.tile
|
|
5
|
+
import{ASendState as t,AProcessorStrategy as e}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as n}from"../sources/strategies/chunks/OverrideChunk.js";class o extends t{}class a extends e{constructor(t,e){super(t,e),this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set}destroy(){super.destroy();for(const t of this._source.chunks())this._cleanupChunkIds(t)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(t){super.onSubscribe(t),this._evalOptions=this._source.metadata.createArcadeEvalOptions(t.tile)}createState(t){return new o(t)}get aggregateQueryEngine(){return null}displayMap(t,e,s){const r=new Map(t.map((t=>[e(t),t]))),n=[];for(const o of this._source.chunks()){const t=o.reader.getCursor();for(;t.next();){const e=t.getObjectId(),o=t.getDisplayId(),a=r.get(e);if(null!=a){const t=s(o,a,e);n.push(t),r.delete(e)}}}return n}getDisplayFeatures(t){const e=new Set(t),s=new Set,r=[];for(const n of this._source.chunks()){const t=n.reader.getCursor();for(;t.next();){const n=t.getObjectId(),o=t.getDisplayId();e.has(o)&&!s.has(n)&&(r.push({...t.readLegacyFeatureWorldSpace(),displayId:o}),s.add(n))}}return{features:r,aggregates:[]}}async*applyOverride(t){const e=[],r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId();e.push(t);const s=this._attributeStore.createDisplayIdForObjectId(t);r.setDisplayId(s),this._attributeStore.setAttributeData(s,r,this._evalOptions)}const o=this.getDisplayIds(e),a=this.getDisplayIds(t.removed),i=new n;i.applyOverrides(t);for(const n of this._sendStates.values())yield new s(n.subscription,null,o,!1,i.queryInfo);for(const n of this._sendStates.values()){const t=i.getTileReader(n.subscription.tile);yield new s(n.subscription,t,a,!1,i.queryInfo)}for(const s of t.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const t of this._sendStates.values())yield*this._update(t)}}removeChunks(t){for(const e of t)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}_cleanupChunkIds(t){if(this.handledChunksForIdCreation.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(t.chunkId)}}async _updateAttributeData(){for(const t of this._source.chunks()){const{chunkId:e,reader:s}=t;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const t=s.getCursor();for(;t.next();){const e=this._attributeStore.createDisplayIdForObjectId(t.getObjectId());t.setDisplayId(e)}}}for(const t of this._source.chunks())if(!this.handledChunksForAttributeData.has(t.chunkId)){this.handledChunksForAttributeData.add(t.chunkId);const e=t.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions)}}}*_update(t){const{subscription:e,handledChunks:s}=t;for(const n of this._source.chunks()){const{chunkId:o}=n;if(s.has(o))continue;s.add(o);const a=n.getTileReader(e.tile);a&&(yield new r(t.subscription,a,!1,n.end,n.queryInfo))}}}export{o as DefaultSendState,a as FeatureUpdateStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ASourceChunk as e}from"./ASourceChunk.js";class
|
|
5
|
+
import{ASourceChunk as e}from"./ASourceChunk.js";class i extends e{constructor(e,i,t,r,s,h){super(),this._reader=e,this._queryJSON=i,this._tile=t,this._sourceTile=r,this._sourceTileDepth=s,this._end=h,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return 0===this._sourceTileDepth}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}}export{i as DrillDownTileSourceChunk};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ASourceChunk as e}from"./ASourceChunk.js";class t extends e{constructor(e,t,r,s){super(),this._reader=e,this._queryJSON=t,this._page=r,this._end=s,this.chunkId=`${this._page}${this.end?"e":""}
|
|
5
|
+
import{ASourceChunk as e}from"./ASourceChunk.js";class t extends e{constructor(e,t,r,s){super(),this._reader=e,this._queryJSON=t,this._page=r,this._end=s,this.chunkId=`${this._page}${this.end?"e":""}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader}get first(){return 0===this._page}get end(){return this._end}get queryInfo(){return{type:"snapshot",chunkId:this.chunkId,queryJSON:this._queryJSON,page:this._page,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}export{t as FeatureSnapshotSourceChunk};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderJSON as r}from"../../../support/FeatureSetReaderJSON.js";class t extends e{constructor(){super(...arguments),this.chunkId="override",this.removed=new Set,this.overridenIds=new Set,this._features=[]}get reader(){return r.fromOptimizedFeatures(this._features,this._layerSchema??{fields:[]})}get queryInfo(){return{}}get first(){return!1}get end(){return!1}get isTiled(){return!1}applyOverrides(e){super.invalidate(),this._layerSchema||(this._layerSchema=e.reader.fullSchema());const{reader:r,removed:t}=e,s=[],d=new Set,o=r.getCursor(),i=new Set(t);for(this.overridenIds.clear();o.next();){const e=o.readOptimizedFeatureWorldSpace(),r=e.objectId;s.push(e),d.add(r),this.overridenIds.add(r),this.removed.delete(r)}for(const a of this._features){const e=a.objectId;i.has(e)||d.has(e)||(s.push(a),this.overridenIds.add(e))}this._features=s;for(const a of d.values())this.removed.delete(a);for(const a of t)this.removed.add(a),this.overridenIds.add(a)}getTileReader(e){if(!this._features.length)return null;const r=this.queryFeaturesInBounds(e.bounds);return r.setTransformForDisplay(e.transform),r}}export{t as OverrideChunk};
|
|
5
|
+
import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderJSON as r}from"../../../support/FeatureSetReaderJSON.js";class t extends e{constructor(){super(...arguments),this.chunkId="override",this.normalizedChunkId="override",this.removed=new Set,this.overridenIds=new Set,this._features=[]}get reader(){return r.fromOptimizedFeatures(this._features,this._layerSchema??{fields:[]})}get queryInfo(){return{}}get first(){return!1}get end(){return!1}get isTiled(){return!1}applyOverrides(e){super.invalidate(),this._layerSchema||(this._layerSchema=e.reader.fullSchema());const{reader:r,removed:t}=e,s=[],d=new Set,o=r.getCursor(),i=new Set(t);for(this.overridenIds.clear();o.next();){const e=o.readOptimizedFeatureWorldSpace(),r=e.objectId;s.push(e),d.add(r),this.overridenIds.add(r),this.removed.delete(r)}for(const a of this._features){const e=a.objectId;i.has(e)||d.has(e)||(s.push(a),this.overridenIds.add(e))}this._features=s;for(const a of d.values())this.removed.delete(a);for(const a of t)this.removed.add(a),this.overridenIds.add(a)}getTileReader(e){if(!this._features.length)return null;const r=this.queryFeaturesInBounds(e.bounds);return r.setTransformForDisplay(e.transform),r}}export{t as OverrideChunk};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ASourceChunk as e}from"./ASourceChunk.js";class t extends e{constructor(e,t,i,r,s){super(),this._reader=e,this._queryJSON=t,this._tile=i,this._page=r,this._end=s,this.chunkId=`${this._tile.key.id}.${this._page}${this.end?"e":""}`}get queryInfo(){return{type:"paged-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,page:this._page,size:this.size(),end:this.end}}get reader(){return this._reader}get first(){return 0===this._page}get end(){return this._end}get page(){return this._page}get tile(){return this._tile}get isTiled(){return!0}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}}export{t as PagedTileSourceChunk};
|
|
5
|
+
import{ASourceChunk as e}from"./ASourceChunk.js";class t extends e{constructor(e,t,i,r,s){super(),this._reader=e,this._queryJSON=t,this._tile=i,this._page=r,this._end=s,this.chunkId=`${this._tile.key.id}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._page}${this.end?"e":""}`}get queryInfo(){return{type:"paged-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,page:this._page,size:this.size(),end:this.end}}get reader(){return this._reader}get first(){return 0===this._page}get end(){return this._end}get page(){return this._page}get tile(){return this._tile}get isTiled(){return!0}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}}export{t as PagedTileSourceChunk};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ASourceChunk as e}from"./ASourceChunk.js";class r extends e{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const r=this.queryFeaturesInBounds(e.bounds);return r.setTransformForDisplay(e.transform),r}}export{r as StreamSourceChunk};
|
|
5
|
+
import{ASourceChunk as e}from"./ASourceChunk.js";class r extends e{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const r=this.queryFeaturesInBounds(e.bounds);return r.setTransformForDisplay(e.transform),r}}export{r as StreamSourceChunk};
|