@arcgis/core 5.2.0-next.120 → 5.2.0-next.121
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/containerUtils.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcgisGlobal.d.ts +7 -0
- package/assets/components/assets/icon/addCellAbove16.json +1 -0
- package/assets/components/assets/icon/addCellAbove24.json +1 -0
- package/assets/components/assets/icon/addCellAbove32.json +1 -0
- package/assets/components/assets/icon/addCellBelow16.json +1 -0
- package/assets/components/assets/icon/addCellBelow24.json +1 -0
- package/assets/components/assets/icon/addCellBelow32.json +1 -0
- package/assets/components/assets/icon/linkedChart16.json +1 -0
- package/assets/components/assets/icon/linkedChart24.json +1 -0
- package/assets/components/assets/icon/linkedChart32.json +1 -0
- package/assets/components/assets/icon/polygonFromFeature16.json +1 -0
- package/assets/components/assets/icon/polygonFromFeature24.json +1 -0
- package/assets/components/assets/icon/polygonFromFeature32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/015cb790262a59857c5f.js +1 -0
- package/assets/esri/core/workers/chunks/025da54eef112d7e8f66.js +1 -0
- package/assets/esri/core/workers/chunks/033debcbf6b3683dc4fe.js +2 -0
- package/assets/esri/core/workers/chunks/064445e6f9512817ac87.js +2 -0
- package/assets/esri/core/workers/chunks/{304462b049116f59accc.js → 09676cfa99b90fe0cc63.js} +1 -1
- package/assets/esri/core/workers/chunks/0aadee0437fa061e4ff5.js +1 -0
- package/assets/esri/core/workers/chunks/{b0058619e0363002ad86.js → 0e9f54d7f158195bd203.js} +1 -1
- package/assets/esri/core/workers/chunks/1086f190f94c715bbfe4.js +1 -0
- package/assets/esri/core/workers/chunks/1846296be959e28c42bb.js +1 -0
- package/assets/esri/core/workers/chunks/{ea9e770efc85594e4dd2.js → 216d8cb86548e92a8196.js} +1 -1
- package/assets/esri/core/workers/chunks/{d629708bf23da24ee523.js → 298f234f11a10c5120a2.js} +1 -1
- package/assets/esri/core/workers/chunks/29ae19206bbeb480be0f.js +1 -0
- package/assets/esri/core/workers/chunks/{dc1944a7601b518a9c48.js → 2ca49fb4590cc34a02bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{f890359d972cce54459e.js → 2f829321bfbd3bacd64f.js} +1 -1
- package/assets/esri/core/workers/chunks/{7232fc11b23777b6be94.js → 369012c032ea6882607c.js} +1 -1
- package/assets/esri/core/workers/chunks/39c5e0f6262f69a62c66.js +1 -0
- package/assets/esri/core/workers/chunks/{9f760dc4492a03e0504c.js → 45d87af48a21644590c2.js} +1 -1
- package/assets/esri/core/workers/chunks/463d69f596d1d34ef275.js +2 -0
- package/assets/esri/core/workers/chunks/49affbed22e201f7c32b.js +1 -0
- package/assets/esri/core/workers/chunks/4adad3312caa24af98ac.js +1 -0
- package/assets/esri/core/workers/chunks/{8f0ecf4d06ec7b67d4ed.js → 52744dfd430cd0c0edfb.js} +1 -1
- package/assets/esri/core/workers/chunks/58a17fb3c0dd07c63d57.js +2 -0
- package/assets/esri/core/workers/chunks/5993db944b9e7825e0bc.js +1 -0
- package/assets/esri/core/workers/chunks/{090c9c2dbf92f2cac0b8.js → 770ca70d363184e39d60.js} +1 -1
- package/assets/esri/core/workers/chunks/83c7c4218bc6ba2f16ee.js +1 -0
- package/assets/esri/core/workers/chunks/{cfd8317ecd2e63af7c40.js → 8a103b6e9534516421e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{49e8ff5ed079a9e3be4b.js → 91a51d959ee5c6123c46.js} +1 -1
- package/assets/esri/core/workers/chunks/92f35b2c3c5f13778308.js +1 -0
- package/assets/esri/core/workers/chunks/97cd4145c016cf379120.js +1 -0
- package/assets/esri/core/workers/chunks/99ebc99e8d1bca105b5e.js +1 -0
- package/assets/esri/core/workers/chunks/{e18b8646c7378213b618.js → 9b3813e39992b1b99941.js} +1 -1
- package/assets/esri/core/workers/chunks/{32fc7d1db4b311f6b880.js → 9e5b30b907102bc0c201.js} +1 -1
- package/assets/esri/core/workers/chunks/a005efcde3ca9def4e6b.js +1 -0
- package/assets/esri/core/workers/chunks/a3c1a5a5c5cbf27b376d.js +1 -0
- package/assets/esri/core/workers/chunks/a70c59129ea808857d07.js +1 -0
- package/assets/esri/core/workers/chunks/b5b30c8447a0f967fa79.js +1 -0
- package/assets/esri/core/workers/chunks/bb5ed2a796a45c41b0b4.js +1 -0
- package/assets/esri/core/workers/chunks/bcb06a0643b4c83535ee.js +1 -0
- package/assets/esri/core/workers/chunks/{066b7f6866d602f963e0.js → c3008b20cb5fd38bd900.js} +1 -1
- package/assets/esri/core/workers/chunks/{22e85819e23202a8ba90.js → c39ebd8d469f1e8bb61e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f2ac03efaa4a4898ba2.js → c3b96d1d43afccd23e45.js} +2 -2
- package/assets/esri/core/workers/chunks/{cb983f65995e57fff7a1.js → c44cbe04efddbbbaec13.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ce14dd209462f88b163.js → c70a32ac0fa49f4493ca.js} +1 -1
- package/assets/esri/core/workers/chunks/ce08e3369641da0d7a27.js +2 -0
- package/assets/esri/core/workers/chunks/d1b5be1aeab16d36d4b1.js +1 -0
- package/assets/esri/core/workers/chunks/{da6583e8d88441a1c02a.js → d38252956c3d9e2168f7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1742dbc6a827cfda471b.js → d3d48401462ef3bf0ad9.js} +1 -1
- package/assets/esri/core/workers/chunks/d9b761104ab6e4acaf91.js +1 -0
- package/assets/esri/core/workers/chunks/{723478607badcde5706b.js → d9d5f50af047ee7af129.js} +87 -86
- package/assets/esri/core/workers/chunks/{354912041363502c6a89.js → da161f8cbe1cfc5fcf7c.js} +1 -1
- package/assets/esri/core/workers/chunks/{862e1acd80c4e43831dc.js → dc923e50958b68a50014.js} +1 -1
- package/assets/esri/core/workers/chunks/e86f83a6514a35255f64.js +1 -0
- package/assets/esri/core/workers/chunks/ea49721fdd2172d1c799.js +1 -0
- package/assets/esri/core/workers/chunks/{98a5327fd96d9542b39f.js → f90cad9f007a11154c0d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f18ee2eaa96d103627a6.js → fa3f824c874f29d24953.js} +1 -1
- package/assets/esri/core/workers/chunks/fbb390c0d92d1536fce3.js +1 -0
- package/assets/esri/core/workers/chunks/fbc5f275c4e5e6bfffaa.js +1 -0
- package/assets/esri/core/workers/chunks/{6ab7bb3834841834f839.js → fd5e61cb6f936eadcfe3.js} +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/basemaps/BasemapCollection.d.ts +148 -0
- package/basemaps/BasemapCollection.js +2 -0
- package/basemaps/BasemapsSource.d.ts +39 -0
- package/basemaps/BasemapsSource.js +2 -0
- package/basemaps/LocalBasemapsSource.d.ts +55 -0
- package/basemaps/LocalBasemapsSource.js +2 -0
- package/basemaps/PortalBasemapsSource.d.ts +98 -0
- package/basemaps/PortalBasemapsSource.js +2 -0
- package/basemaps/support/BasemapItem.d.ts +74 -0
- package/basemaps/support/BasemapItem.js +2 -0
- package/basemaps/support/basemapCompatibilityUtils.js +2 -0
- package/basemaps/types.d.ts +42 -0
- package/chunks/CheckerBoard.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +1 -1
- package/chunks/Component.glsl.js +11 -11
- package/chunks/DeepSky.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +4 -4
- package/chunks/EdgeShader.glsl.js +1 -1
- package/chunks/FocusArea.glsl.js +1 -1
- package/chunks/GaussianSplat.glsl.js +9 -9
- package/chunks/HUDMaterial.glsl.js +1 -1
- package/chunks/ImageMaterial.glsl.js +1 -1
- package/chunks/LineCallout.glsl.js +1 -1
- package/chunks/LineMarker.glsl.js +97 -89
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +8 -7
- package/chunks/Pattern.glsl.js +1 -1
- package/chunks/PointRenderer.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +4 -4
- package/chunks/RibbonLine.glsl.js +58 -56
- package/chunks/ShadowCastAccumulate.glsl.js +3 -3
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/ShadowHighlightBuffer.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +12 -14
- package/chunks/Viewshed.glsl.js +1 -1
- package/chunks/Water.glsl.js +3 -3
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.d.ts +10 -0
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/support/LabelClass.d.ts +13 -4
- package/layers/support/LabelClass.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/legend/ActiveLayerInfo.d.ts +130 -0
- package/legend/ActiveLayerInfo.js +2 -0
- package/legend/LegendContent.d.ts +118 -0
- package/legend/LegendContent.js +2 -0
- package/legend/support/clusterUtils.js +2 -0
- package/legend/support/colorRampUtils.js +2 -0
- package/legend/support/heatmapRampUtils.js +2 -0
- package/legend/support/relationshipRampUtils.js +2 -0
- package/legend/support/sizeRampUtils.js +2 -0
- package/legend/support/utils.js +2 -0
- package/legend/types.d.ts +403 -0
- package/libs/i3s/I3SModule.js +1 -1
- package/package.json +5 -5
- package/support/revision.js +1 -1
- package/support/userTypeGuards/isBasemapsSource.js +2 -0
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/callouts/effects/BackgroundCallout.js +2 -0
- package/symbols/cim/callouts/effects/BalloonCallout.js +2 -0
- package/symbols/cim/callouts/effects/PointSymbolCallout.js +2 -0
- package/symbols/cim/callouts/effects/SimpleLineCallout.js +2 -0
- package/symbols/cim/callouts/effects/calloutUtils.js +2 -0
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/typeUtils.js +1 -1
- package/views/2d/LabelManager.js +1 -1
- package/views/2d/engine/AFeatureContainer.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
- package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/GlyphWorker.js +1 -1
- package/views/2d/engine/webgl/TileCpuState.js +1 -1
- package/views/2d/engine/webgl/TileGpuState.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelStore.js +2 -0
- package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/GpuMeshState.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js +2 -0
- package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +2 -0
- package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueInstance.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/dataViewUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
- package/views/2d/engine/webgl/util/LabelMatcher.js +1 -1
- package/views/2d/engine/webgl/util/MapMatcher.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/engine/webgl/util/MatcherContext.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
- package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +1 -1
- package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/2d/layers/support/annodime/debugUtils.js +1 -1
- package/views/2d/layers/support/annodime/virtualFields.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +2 -0
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +1 -3
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/forwardLinearDepthToReadShadow.glsl.js +4 -0
- package/views/3d/webgl-engine/core/shaderLibrary/{ForwardLinearDepthToWriteShadowMap.glsl.js → forwardLinearDepthToWriteShadow.glsl.js} +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +3 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/readFragmentShadow.glsl.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +24 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusArea.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/{AnimatedLine.glsl.js → animatedAlpha.glsl.js} +11 -17
- package/views/ToolViewManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +3 -0
- package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -0
- package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -0
- package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -0
- package/widgets/BasemapGallery/types.d.ts +6 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +2 -0
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +2 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor.d.ts +2 -1
- package/widgets/Editor.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.d.ts +1 -0
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Legend/LegendViewModel.d.ts +1 -0
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.d.ts +1 -0
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.d.ts +1 -0
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.d.ts +2 -0
- package/widgets/Legend.js +1 -1
- package/assets/esri/core/workers/chunks/03918a862455191a8910.js +0 -1
- package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +0 -1
- package/assets/esri/core/workers/chunks/1a39335aa2dce6d564d9.js +0 -1
- package/assets/esri/core/workers/chunks/25bb07d3c32b16a08813.js +0 -1
- package/assets/esri/core/workers/chunks/25cc6d7178a52f2f46b7.js +0 -1
- package/assets/esri/core/workers/chunks/2e999b05ce179dd9fa08.js +0 -1
- package/assets/esri/core/workers/chunks/36792b8a85e88044cb49.js +0 -1
- package/assets/esri/core/workers/chunks/3acc1299c1382c3b034d.js +0 -1
- package/assets/esri/core/workers/chunks/430802108b63194b7ddd.js +0 -2
- package/assets/esri/core/workers/chunks/4396ef5ab3eb9e9a7df2.js +0 -1
- package/assets/esri/core/workers/chunks/4efe5827a5c61db3b19d.js +0 -2
- package/assets/esri/core/workers/chunks/5938d5f6e37f49867d5a.js +0 -1
- package/assets/esri/core/workers/chunks/70347d25968975126fa7.js +0 -1
- package/assets/esri/core/workers/chunks/8628c027198982baed7c.js +0 -1
- package/assets/esri/core/workers/chunks/8c521caf050a486b6548.js +0 -1
- package/assets/esri/core/workers/chunks/a6d4132a16c51323a38a.js +0 -1
- package/assets/esri/core/workers/chunks/add834f867900a7091d2.js +0 -1
- package/assets/esri/core/workers/chunks/b56c5883a5468b18b122.js +0 -1
- package/assets/esri/core/workers/chunks/b5a102cf9f4377fb9842.js +0 -1
- package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +0 -1
- package/assets/esri/core/workers/chunks/c118b88a7c4359e68d9b.js +0 -1
- package/assets/esri/core/workers/chunks/c5e288d57bacb8451e2d.js +0 -2
- package/assets/esri/core/workers/chunks/ce3fb992f6c6ae7378a3.js +0 -1
- package/assets/esri/core/workers/chunks/ceda1e08c9ff26248db0.js +0 -1
- package/assets/esri/core/workers/chunks/d5e3f8e5b8d2576d3cb3.js +0 -2
- package/assets/esri/core/workers/chunks/ddb5d29a8998d0a76fd4.js +0 -1
- package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +0 -1
- package/assets/esri/core/workers/chunks/e707534a700a2de687ca.js +0 -1
- package/assets/esri/core/workers/chunks/f465fb26541372fdc908.js +0 -2
- package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +0 -1
- package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToReadShadowMap.glsl.js +0 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +0 -18
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +0 -4
- /package/assets/esri/core/workers/chunks/{430802108b63194b7ddd.js.LICENSE.txt → 033debcbf6b3683dc4fe.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4efe5827a5c61db3b19d.js.LICENSE.txt → 064445e6f9512817ac87.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c5e288d57bacb8451e2d.js.LICENSE.txt → 463d69f596d1d34ef275.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d5e3f8e5b8d2576d3cb3.js.LICENSE.txt → 58a17fb3c0dd07c63d57.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7f2ac03efaa4a4898ba2.js.LICENSE.txt → c3b96d1d43afccd23e45.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f465fb26541372fdc908.js.LICENSE.txt → ce08e3369641da0d7a27.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{AFeatureContainer as s}from"../../engine/AFeatureContainer.js";import{ClipMesh as i}from"../../engine/webgl/ClipMesh.js";import{effectFlag0 as n,filterFlag0 as a}from"../../engine/webgl/definitions.js";import o from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as l}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as h}from"./FeatureTilePresentStrategy.js";import{RenderState as d}from"./RenderState.js";import{renderHighlight as u}from"../support/util.js";import{createHittestQuery as c}from"../../support/hitTestUtils.js";import p from"../../../layers/support/Path.js";class f{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class _{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class v{constructor(e,t){this.id=e,this.version=t}}class g extends s{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=r(!1),this._hitTestsRequests=[],this._firstDrawTime=null,this._renderState=r(null),this._renderStateNext=r(null),this._store=new o,this._subscriptions=new Map,this._presentation=new h,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){super.destroy(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value)}get batching(){return has("featurelayer-strict-draw-order")?1:has("featurelayer-force-marker-text-draw-order")?2:0}get firstDrawTime(){return this._firstDrawTime}get updating(){const e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,r=!!this._renderStateNext.value,s=this.attributeView.updating;return e||t||r||s}subscriptions(){return this._subscriptions.values()}get hasLabels(){return null!==this.labelSchema}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState.value?this._renderState.value.tiles().filter(e=>e.presenting):[]}get usedMemory(){let e=0;return this._renderState.value&&(e+=this._renderState.value.usedMemory),this._renderStateNext.value&&(e+=this._renderStateNext.value.usedMemory),e+=this.attributeView.usedMemory,e}get instanceStore(){return this._store}get labelingCollisionInfos(){if(!this._deconflictionInfo)throw new Error("InternalError: DeconflictionInfo not defined. Was update called?");return this._deconflictionInfo}get labelSchema(){return this._schema?.mesh.factory.labels??null}get layerOrder(){return this._layerView.view.allLayerViews.items.indexOf(this._layerView)}get tiles(){return this._renderState.value?.tiles()}get requiresRefresh(){return!!this._renderState.value?.requiresRefresh}get _instanceStore(){return this._store}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&l.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(S(t))return t;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){const e=new Set;for(const t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(const t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(const e of this._renderState.value.tiles())e.upload(this._instanceStore,this.batching)}this._updatingChildren.value=!this.children.every(e=>e.ended&&e.presenting)}}renderChildren(e){switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 8:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}afterRender(e){super.afterRender(e),e.decluttering||(this._finializeUpdate(),this._updateAttributeView(),this._handleSwapRenderState(),this._renderState.value?.update(this.attributeView.currentEpoch)),this._hitTestsRequests.length&&this.requestRender()}updateStart(e){return this.attributeView.lockTextureUploads(),this._supportsInstanceCleanup=!e&&"dictionary"!==this._schema?.mesh.factory.symbology.type,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,r){return this._updateResolver=new f({schema:e,deconflictionInfo:t,invalidateMesh:r}),this.requestRender(),e.mesh.factory.referenceScale&&(this.referenceScale=e.mesh.factory.referenceScale),this._updateResolver.resolver.promise}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e)}updateSubscriptions(e){for(const{tileId:t,version:r}of e.subscribe){if(!this._subscriptions.has(t)){const e=new v(t,r);this._subscriptions.set(t,e);continue}this._subscriptions.get(t).version=r}for(const t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){const t=this.attributeView.getFilterFlags(e),r=t&a,s=null==this._layerView.featureEffectView.featureEffect||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&n;return!(r&&s)}getDisplayStatistics(e,t){const r=this._statisticsByLevel.get(e);return r?r.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let r=this._statisticsByLevel.get(e);r||(r=new Map,this._statisticsByLevel.set(e,r));for(const s of t)r.set(s.fieldName,{minValue:s.minValue,maxValue:s.maxValue})}beginLevelMeshUpdate(e){if(null!=this._pendingLevelUpdate)throw new Error("InternalError: Pending level mesh update in progress");return this._pendingLevelUpdate=new _(e),has("esri-2d-update-debug")&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(null==this._pendingLevelUpdate)throw new Error("InternalError: No level mesh update to apply");if(this._pendingLevelUpdate.id!==e)throw new Error("InternalError: Unexpected id");if(has("esri-2d-update-debug")){const{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}const{level:t,messages:r}=this._pendingLevelUpdate,s=this._renderStateNext.value??this._renderState.value;if(!s)throw new Error("InternalError: No renderState defined");s.enqueueLevelReplace(t,r),this._pendingLevelUpdate=null,this.requestRender()}lockForOverrides(){this._renderState.value?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState.value?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState.value?.flush(this.attributeView.currentEpoch),this.requestRender()}async updateRenderState(e){if(this._renderStateNext.value)throw new Error("InternalError: renderStateNext already exists");has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new d(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme)}async swapRenderState(){if(!this._renderStateNext.value)throw new Error("InternalError: renderStateNext not yet created");if(this._renderStateSwapResolver)throw new Error("InternalError: renderState swap already in progress");this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,r){if(t(r),!this._pendingLevelUpdate)return this._applyMessage(e);this._pendingLevelUpdate.messages.push(e)}removeTile(e){(this._renderState.value||this._renderStateNext.value)&&(this._renderState.value&&this._renderState.value.removeTile(e),this._renderStateNext.value&&this._renderStateNext.value.removeTile(e))}async hitTest(e,t){const r=c(e,t);if(!r)return console.warn("Unexpected hittest input:",e),{trueHitIds:[],candidateHitIds:[]};const s=this._hitTestsRequests.find(({query:e})=>r.hittestType===e.hittestType&&r.input===e.input&&r.options===e.options),n=Promise.withResolvers();if(s)s.resolvers.push(n);else{if("polygon"===r.hittestType&&(r.polygonMesh=await i.create(new p({path:[r.input.map(e=>[e.x,e.y])]})),!r.polygonMesh))return n.resolve({trueHitIds:[],candidateHitIds:[]}),n.promise;this._hitTestsRequests.push({query:r,resolvers:[n]})}return this.requestRender(),n.promise}getSortKeys(e){const t=new Set(e),r=new Map;for(const s of this.children)if(s.getSortKeys(t).forEach((e,t)=>r.set(t,e)),r.size===t.size)break;return r}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:r}=this._layerView.layer.effectiveScaleRange,s=e.state.scale;s<=(t||1/0)&&s>=r&&super.doRender(e)}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=l.heatmap.getStencilReference(t)}createRenderParams(e){const t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){const t=e.inner;if(!this._subscriptions.has(t.id))return;const r=this._subscriptions.get(t.id);if(r.version!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}const s=this._renderStateNext.value??this._renderState.value;if(!s)throw new Error("InternalError: No renderState defined");s.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${t.version}]`),s.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;const{schema:e,deconflictionInfo:t,invalidateMesh:r}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),this.instanceStore.updateEnd(this._supportsInstanceCleanup),r&&(this.restartAllAnimations(),this.swapRenderState());const s="heatmap"===e.mesh.factory.symbology.type?"target-defer":"eager";this._presentation.updateStrategy(s),this._updateResolver.resolver.resolve(),this._updateResolver=null,this.requestRender()}_handleSwapRenderState(){if(this._renderStateSwapResolver&&this._renderStateNext.value){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.value}] FeatureContainer.update.swapRenderState`);const e=this._renderState.value,t=new Set,r=new Set;for(const s of e?.tiles()??[])s.decluttering&&t.add(s.id),s.presenting&&r.add(s.id);this._renderState.value=this._renderStateNext.value,this._renderStateNext.value=null,this._renderState.value.flush(this.attributeView.currentEpoch),e?.destroy(),this._renderStateSwapResolver.resolve(),this._renderStateSwapResolver=null;for(const s of this._renderState.value.tiles())t.has(s.id)&&(s.decluttering=!0),r.has(s.id)&&(s.presenting=!0);this.requestRender(),this.hasLabels&&this.requestDeclutter()}}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&u(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const t=e.painter.effects.hittest,r=this._hitTestsRequests.shift(),s=r.query.hittestType;t.prepareResources(e,s),t.render(e,r,e=>{const s=t.getHittestableTiles(e,this.children,r.query);for(const t of s)this._renderTile(t,e,0)}),"polygon"===s&&r.query.polygonMesh&&r.query.polygonMesh.destroy(),t.readback(e,r)}_renderFeatures(e,t){const r=this._getHeatmapInstance(e);null!=r?this._renderHeatmapFeatures(e,t,r):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const r of this.children)r.visible&&this._renderTile(r,e,t)}_renderHeatmapFeatures(e,t,r){for(const s of this.children)s.visible&&this._renderTile(s,e,t,19);r.techniqueRef.renderResolvePass(e,r)}_renderTile(e,t,r,s){t.selection=r;const i=e.getDisplayList()?.render(t,s)??!1;null==this._firstDrawTime&&i&&1===t.drawPhase&&(this._firstDrawTime=performance.now(),this._layerView.emitFirstDraw(this._firstDrawTime))}}function S(e){return 19===e.techniqueRef.type}export{g as FeatureContainer};
|
|
2
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{AFeatureContainer as s}from"../../engine/AFeatureContainer.js";import{ClipMesh as i}from"../../engine/webgl/ClipMesh.js";import{effectFlag0 as n,filterFlag0 as a}from"../../engine/webgl/definitions.js";import o from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as l}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as h}from"./FeatureTilePresentStrategy.js";import{RenderState as d}from"./RenderState.js";import{renderHighlight as u}from"../support/util.js";import{createHittestQuery as c}from"../../support/hitTestUtils.js";import p from"../../../layers/support/Path.js";class f{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class _{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class v{constructor(e,t){this.id=e,this.version=t}}class g extends s{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=r(!1),this._hitTestsRequests=[],this._firstDrawTime=null,this._renderState=r(null),this._renderStateNext=r(null),this._store=new o,this._subscriptions=new Map,this._presentation=new h,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){super.destroy(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value)}get batching(){return has("featurelayer-strict-draw-order")?1:has("featurelayer-force-marker-text-draw-order")?2:0}get firstDrawTime(){return this._firstDrawTime}get updating(){const e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,r=!!this._renderStateNext.value,s=this.attributeView.updating;return e||t||r||s}subscriptions(){return this._subscriptions.values()}get hasLabels(){return null!==this.labelSchema}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState.value?this._renderState.value.tiles().filter(e=>e.presenting):[]}get usedMemory(){let e=0;return this._renderState.value&&(e+=this._renderState.value.usedMemory),this._renderStateNext.value&&(e+=this._renderStateNext.value.usedMemory),e+=this.attributeView.usedMemory,e+=this.labelStore.usedMemory,e}get instanceStore(){return this._store}get labelingCollisionInfos(){if(!this._deconflictionInfo)throw new Error("InternalError: DeconflictionInfo not defined. Was update called?");return this._deconflictionInfo}get labelSchema(){return this._schema?.mesh.factory.labels??null}get layerOrder(){return this._layerView.view.allLayerViews.items.indexOf(this._layerView)}get tiles(){return this._renderState.value?.tiles()}get requiresRefresh(){return!!this._renderState.value?.requiresRefresh}get _instanceStore(){return this._store}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&l.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(S(t))return t;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){const e=new Set;for(const t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(const t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(const e of this._renderState.value.tiles())e.upload(this._instanceStore,this.batching)}this.labelStore.upload(e.context),this._updatingChildren.value=!this.children.every(e=>e.ended&&e.presenting)}}renderChildren(e){switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 8:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}afterRender(e){super.afterRender(e),e.decluttering||(this._finializeUpdate(),this._updateAttributeView(),this._handleSwapRenderState(),this._renderState.value?.update(this.attributeView.currentEpoch)),this._hitTestsRequests.length&&this.requestRender()}updateStart(e){return this.attributeView.lockTextureUploads(),this._supportsInstanceCleanup=!e&&"dictionary"!==this._schema?.mesh.factory.symbology.type,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,r){return this._updateResolver=new f({schema:e,deconflictionInfo:t,invalidateMesh:r}),this.requestRender(),e.mesh.factory.referenceScale&&(this.referenceScale=e.mesh.factory.referenceScale),this._updateResolver.resolver.promise}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e)}updateSubscriptions(e){for(const{tileId:t,version:r}of e.subscribe){if(!this._subscriptions.has(t)){const e=new v(t,r);this._subscriptions.set(t,e);continue}this._subscriptions.get(t).version=r}for(const t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){const t=this.attributeView.getFilterFlags(e),r=t&a,s=null==this._layerView.featureEffectView.featureEffect||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&n;return!(r&&s)}getDisplayStatistics(e,t){const r=this._statisticsByLevel.get(e);return r?r.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let r=this._statisticsByLevel.get(e);r||(r=new Map,this._statisticsByLevel.set(e,r));for(const s of t)r.set(s.fieldName,{minValue:s.minValue,maxValue:s.maxValue})}beginLevelMeshUpdate(e){if(null!=this._pendingLevelUpdate)throw new Error("InternalError: Pending level mesh update in progress");return this._pendingLevelUpdate=new _(e),has("esri-2d-update-debug")&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(null==this._pendingLevelUpdate)throw new Error("InternalError: No level mesh update to apply");if(this._pendingLevelUpdate.id!==e)throw new Error("InternalError: Unexpected id");if(has("esri-2d-update-debug")){const{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}const{level:t,messages:r}=this._pendingLevelUpdate,s=this._renderStateNext.value??this._renderState.value;if(!s)throw new Error("InternalError: No renderState defined");s.enqueueLevelReplace(t,r),this._pendingLevelUpdate=null,this.requestRender()}lockForOverrides(){this._renderState.value?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState.value?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState.value?.flush(this.attributeView.currentEpoch),this.requestRender()}async updateRenderState(e){if(this._renderStateNext.value)throw new Error("InternalError: renderStateNext already exists");has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new d(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme,this.labelStore)}async swapRenderState(){if(!this._renderStateNext.value)throw new Error("InternalError: renderStateNext not yet created");if(this._renderStateSwapResolver)throw new Error("InternalError: renderState swap already in progress");this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,r){if(t(r),!this._pendingLevelUpdate)return this._applyMessage(e);this._pendingLevelUpdate.messages.push(e)}removeTile(e){(this._renderState.value||this._renderStateNext.value)&&(this._renderState.value&&this._renderState.value.removeTile(e),this._renderStateNext.value&&this._renderStateNext.value.removeTile(e))}async hitTest(e,t){const r=c(e,t);if(!r)return console.warn("Unexpected hittest input:",e),{trueHitIds:[],candidateHitIds:[]};const s=this._hitTestsRequests.find(({query:e})=>r.hittestType===e.hittestType&&r.input===e.input&&r.options===e.options),n=Promise.withResolvers();if(s)s.resolvers.push(n);else{if("polygon"===r.hittestType&&(r.polygonMesh=await i.create(new p({path:[r.input.map(e=>[e.x,e.y])]})),!r.polygonMesh))return n.resolve({trueHitIds:[],candidateHitIds:[]}),n.promise;this._hitTestsRequests.push({query:r,resolvers:[n]})}return this.requestRender(),n.promise}getSortKeys(e){const t=new Set(e),r=new Map;for(const s of this.children)if(s.getSortKeys(t).forEach((e,t)=>r.set(t,e)),r.size===t.size)break;return r}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:r}=this._layerView.layer.effectiveScaleRange,s=e.state.scale;s<=(t||1/0)&&s>=r&&super.doRender(e)}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=l.heatmap.getStencilReference(t)}createRenderParams(e){const t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){const t=e.inner;if(!this._subscriptions.has(t.id))return;const r=this._subscriptions.get(t.id);if(r.version!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}const s=this._renderStateNext.value??this._renderState.value;if(!s)throw new Error("InternalError: No renderState defined");s.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${t.version}]`),s.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;const{schema:e,deconflictionInfo:t,invalidateMesh:r}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),this.instanceStore.updateEnd(this._supportsInstanceCleanup),r&&(this.restartAllAnimations(),this.swapRenderState());const s="heatmap"===e.mesh.factory.symbology.type?"target-defer":"eager";this._presentation.updateStrategy(s),this._updateResolver.resolver.resolve(),this._updateResolver=null,this.requestRender()}_handleSwapRenderState(){if(this._renderStateSwapResolver&&this._renderStateNext.value){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.value}] FeatureContainer.update.swapRenderState`);const e=this._renderState.value,t=new Set,r=new Set;for(const s of e?.tiles()??[])s.decluttering&&t.add(s.id),s.presenting&&r.add(s.id);this._renderState.value=this._renderStateNext.value,this._renderStateNext.value=null,this._renderState.value.flush(this.attributeView.currentEpoch),e?.destroy(),this._renderStateSwapResolver.resolve(),this._renderStateSwapResolver=null;for(const s of this._renderState.value.tiles())t.has(s.id)&&(s.decluttering=!0),r.has(s.id)&&(s.presenting=!0);this.requestRender(),this.hasLabels&&this.requestDeclutter()}}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&u(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const t=e.painter.effects.hittest,r=this._hitTestsRequests.shift(),s=r.query.hittestType;t.prepareResources(e,s),t.render(e,r,e=>{const s=t.getHittestableTiles(e,this.children,r.query);for(const t of s)this._renderTile(t,e,0)}),"polygon"===s&&r.query.polygonMesh&&r.query.polygonMesh.destroy(),t.readback(e,r)}_renderFeatures(e,t){const r=this._getHeatmapInstance(e);null!=r?this._renderHeatmapFeatures(e,t,r):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const r of this.children)r.visible&&this._renderTile(r,e,t)}_renderHeatmapFeatures(e,t,r){for(const s of this.children)s.visible&&this._renderTile(s,e,t,19);r.techniqueRef.renderResolvePass(e,r)}_renderTile(e,t,r,s){t.selection=r;const i=e.getDisplayList()?.render(t,s)??!1;null==this._firstDrawTime&&i&&1===t.drawPhase&&(this._firstDrawTime=performance.now(),this._layerView.emitFirstDraw(this._firstDrawTime))}}function S(e){return 19===e.techniqueRef.type}export{g as FeatureContainer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,ignoreAbortErrors as r}from"../../../../core/promiseUtils.js";import o from"../../../../core/RandomLCG.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{pt2px as u}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import d from"../../../../layers/support/TileInfo.js";import{tileSize as c}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as p}from"./PipelineConnectionHandlers.js";import h from"./Processor.js";import{FeatureSource as l}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as g}from"./support/Tile.js";import f from"../../tiling/TileInfoView.js";class b{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class m{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._didSourceRefresh=!1,this._refreshRequested=!0,this._updateSubscriptionRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=d.fromJSON(e.tileInfoJSON);this._tileInfoView=new f(i),this._viewExtent=e.initialViewExtent,this._source=new l(this._aggregateAdapter,this._subscriptions,s),this._processor=new h(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),n(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),r(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new p(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}
|
|
2
|
+
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,ignoreAbortErrors as r}from"../../../../core/promiseUtils.js";import o from"../../../../core/RandomLCG.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{pt2px as u}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import d from"../../../../layers/support/TileInfo.js";import{tileSize as c}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as p}from"./PipelineConnectionHandlers.js";import h from"./Processor.js";import{FeatureSource as l}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as g}from"./support/Tile.js";import f from"../../tiling/TileInfoView.js";class b{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class m{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._didSourceRefresh=!1,this._refreshRequested=!0,this._updateSubscriptionRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=d.fromJSON(e.tileInfoJSON);this._tileInfoView=new f(i),this._viewExtent=e.initialViewExtent,this._source=new l(this._aggregateAdapter,this._subscriptions,s),this._processor=new h(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),n(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),r(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new p(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}updateViewExtent(e,t){t&&(this._refreshRequested=!0,this._requestUpdate()),this._viewExtent=e}async updateSchema(e){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new b({version:e}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new b(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new b(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(u(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),a=this._source.chunks(),d=t**2,p=3/(Math.PI*d),h=2*t,l=Math.ceil(c/h);for(const u of n){const t=u.tile,n=new Float64Array(l*l);for(const s of a){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),c=Math.floor(i);if(a<0||c<0||a>=l||c>=l)continue;const _=((.5+a-s)*h)**2+((.5+c-i)*h)**2;if(_>d)continue;const g=t*(p*(1-_/d)**2);n[c+a*l]+=g}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),n=new o,u=3*e.sampleSize;for(let o=0;o<u&&i.length<e.sampleSize;o++){const e=r[n.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const o=n.getIntRange(0,e.getSize()-1);e.setIndex(o);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=a(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new g(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{version:s}=e.inner,i=await this._connection.layerView.updateSchemaStart();i&&(t=await this._doUpdateSchema(i,s))}const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);await this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}await this._source.applyCacheUpdate();const r=this._source.chunks(),o=this._source.updateTracking.updating;this._processor.requiresInvalidation(r)&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),this._refreshRequested&&(this._refreshRequested=!1,t=!0),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const n=this._source.cleanup();this._processor.removeChunks(n);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e,this._viewExtent)}catch(u){has("esri-2d-update-debug")&&console.debug("InternalError",u)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(r,o,this._viewExtent),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(u){i(u)}e?await this._connection.layerView.updateSchemaEnd(t):t&&await this._connection.container.swapRenderState(),null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e.source,e.processor.storage.filters,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/CircularArray.js";import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{signal as s}from"../../../../core/signal.js";import{create as r}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import n from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{FeatureTile as o}from"../../engine/webgl/FeatureTile.js";const a=1e3;class d{constructor(t,i,r,n){this.getStage=t,this.getSubscriptionVersion=i,this.version=r,this._tileInfoView=n,this._pendingUpdates=new e(a),this._locked=!1,this._tiles=new Map,this._updating=s(!1)}destroy(){for(const e of this.tiles())this._fader?.unregisterFeatureTile(e),e.destroy();this._pendingUpdates.clear(),this._tiles.clear()}get _fader(){return this.getStage()?.labelManager.symbolFader}tiles(){return Array.from(this._tiles.values())}size(){return this._tiles.size}get usedMemory(){let e=0;for(const t of this._tiles.values())e+=t.usedMemory;for(const t of this._pendingUpdates.entries)t&&(e+=
|
|
2
|
+
import e from"../../../../core/CircularArray.js";import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{signal as s}from"../../../../core/signal.js";import{create as r}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import n from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{FeatureTile as o}from"../../engine/webgl/FeatureTile.js";const a=1e3;class d{constructor(t,i,r,n,o){this.getStage=t,this.getSubscriptionVersion=i,this.version=r,this._tileInfoView=n,this._labelStore=o,this._pendingUpdates=new e(a),this._locked=!1,this._tiles=new Map,this._updating=s(!1)}destroy(){for(const e of this.tiles())this._fader?.unregisterFeatureTile(e),e.destroy();this._pendingUpdates.clear(),this._tiles.clear()}get _fader(){return this.getStage()?.labelManager.symbolFader}tiles(){return Array.from(this._tiles.values())}size(){return this._tiles.size}get usedMemory(){let e=0;for(const t of this._tiles.values())e+=t.usedMemory;for(const t of this._pendingUpdates.entries)t&&(e+=u(t)?t.messages.reduce((e,t)=>e+l(t.inner),0):l(t.inner));return e}get requiresRefresh(){for(const e of this._tiles.values())if(e.requiresRefresh)return!0;return!1}get updating(){return this._updating.value}getTile(e){return this._tiles.get(e)}setTiles(e){this._tiles.clear();for(const t of e)this._tiles.set(t.key.id,t)}lockUploads(){this._locked=!0}unlockUploads(){this._locked=!1}enqueueUpdate(e){this._pendingUpdates.enqueue(e),this._notify()}enqueueLevelReplace(e,t){this._pendingUpdates.enqueue({type:"level-replace",level:e,messages:t}),this._notify()}update(e){if(!this._locked)for(;this._pendingUpdates.size;){const t=this._pendingUpdates.peek();if(null==t||p(t)>e)break;this._applyUpdate(t),this._pendingUpdates.dequeue()}this._notify()}flush(e){for(;this._pendingUpdates.size;){const t=this._pendingUpdates.dequeue();if(null!=t){const i=p(t);i>e&&console.warn("Tried to flush RenderState, but patch more recent than current",{patchEpoch:i,currentEpoch:e}),this._applyUpdate(t)}}this._notify()}removeTile(e){const t=this._tiles.get(e);has("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t&&(this._fader?.unregisterFeatureTile(t),t.destroy()),this._tiles.delete(e)}_clearLevelCpuState(e){for(const t of this._tiles.values())t.key.level===e&&t.clearCpuState()}_notify(){this._updating.mutate(e=>0!==this._pendingUpdates.size)}_applyUpdate(e){if(u(e)){this._clearLevelCpuState(e.level);for(const t of e.messages)this._updateTile(t)}else this._updateTile(e)}_updateTile(e){const{inner:t,objectIdMap:i}=e,s=this.getSubscriptionVersion(t.id);if(s!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${s}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(has("esri-2d-update-debug")){const e=t.debugInfo?.chunkId??"<EnsureEnd>";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${e}] RenderState.updateTile [${t.type}]`,t)}const r=this._ensureTile(t.id);if("update"===t.type){const[e,...s]=t.modify;r.update({type:"update",modify:e,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const r of s){const e=this._tiles.get(r.tileId);e&&e.update({type:"update",modify:r,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(null==t.append)return void r.update({type:"append",debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[n,...o]=t.append;r.update({type:"append",append:n,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const a of o){const e=this._tiles.get(a.tileId);e&&e.update({type:"update",modify:a,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){has("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const s=new n(e),a=this._tileInfoView.getTileBounds(r(),s),d=a[0],l=a[3],u=this._tileInfoView.getTileResolution(s.level),p=new o(s,u,d,l,this._labelStore,this._fader);if(this._fader?.registerFeatureTile(p),p.stage=this.getStage(),!p.stage){const e=new t("featurelayerview:webgl","Cannot create tile with empty stage");i.getLogger("esri.views.2d.layers.features.RenderState").error(e)}return p}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let s=-1;s<=1;s++)for(let r=-1;r<=1;r++){if(0===s&&0===r)continue;const n=e.key.getNormalizedNeighbor(r,s,i).id,o=this._tiles.get(n);if(null!=o){const i=1<<t;e.copyPixelBufferedEntitesFrom(o,i,r,s)}t--}}}function l(e){switch(e.type){case"update":return e.modify.reduce((e,t)=>e+c(t),0);case"append":return e.append?e.append.reduce((e,t)=>e+c(t),0):0}}function u(e){return"type"in e&&"level-replace"===e.type}function p(e){if(!u(e))return e.inner.attributeEpoch;let t=-1/0;for(const i of e.messages)t=Math.max(t,i.inner.attributeEpoch);return t}function c(e){return e.entities.byteLength+e.data.reduce((e,t)=>e+h(t),0)}function h(e){return e.indices.byteLength+e.vertices.byteLength+(e.metrics?.byteLength??0)}export{d as RenderState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../../../core/Logger.js";import{pt2px as a}from"../../../../../../../core/screenUtils.js";import{CIMSymbolHelper as i}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as n}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as t}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{getMaxSizeVVSize as l,noVisualVariables as o}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as r,hasSizeVVUniform as s}from"./utils.js";function c(a,i){if(a&&i){const n=a.toLowerCase(),t=i.get(n);if(void 0!==t)return{name:n,index:t};e.getLogger("esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema").warn(`Invalid symbol layer name: "${a}"`)}return null}function u(e,a){if(a?.enabled&&a.drawOrder){const i=a.drawOrder.map(e=>e.toLowerCase()).slice().reverse(),n=new Map;for(const a of e)if(a.groupName&&a.name){const e=a.name.toLowerCase(),t=a.groupName.toLowerCase(),l=i.indexOf(t);-1!==l&&(n.has(l)||n.set(l,[]),n.get(l).push(e))}const t=[];i.forEach((e,a)=>{n.has(a)?t.push(...n.get(a)):t.push(e)});const l=new Map;return t.forEach((e,a)=>{l.set(e,a)}),l}return null}function f(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function m(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,n,t]=e;return[a,i,n,255*t]}return"string"==typeof e?e:{...e,defaultValue:m(e?.defaultValue)}}async function p(e,a){const{cimResourceManager:n,cimAnalyzer:t,scaleExpression:l,symbolLayerDrawing:o}=a.schemaOptions,r=e.symbol;if(null==r)return[];await i.normalizeSymbolAndFetchResources(r,n);const s=t.analyzeSymbolReference(e,!1),c=f(e),m=u(s,o),p="CIMPointSymbol"===r.type&&"Map"!==r.angleAlignment?a.schemaOptions.viewRotation:null,b={scaleInfo:c,scaleExpression:l,rotationVariable:a.rotationVariable??null,viewRotation:p,layerOrderMap:m},V=[];for(const i of s)switch(i.type){case"marker":V.push(...S(i,a,b));break;case"fill":V.push(...g(i,a,b));break;case"outlineFill":V.push(...z(i,a,b));break;case"gradientFill":V.push(...M(i,a,b));break;case"line":V.push(...O(i,a,b));break;case"gradientStroke":V.push(...k(i,a,b));break;case"text":V.push(...A(i,a,b))}return V}function S(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:r}=l,{layerOrderMap:s}=i,u=e.isOutline?{...o,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue,visualVariableRotation:n.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=a?t.animatedMarkerShift:t.animatedMarker;return b(r.ensureInstance(n,{uniforms:u,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}},c(e.name,s)),e,o,i)}return h(r.ensureInstance(t.marker,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,s)),e,n,i)}function b(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:r(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:1===a.alignment,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function V(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:r(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2,angle:"angle"in a?a.angle:0})]}function h(e,a,i,{scaleInfo:t,scaleExpression:o}){const r=s(i);return[e.createMeshInfo({size:a.size,scaleX:a.scaleX,anchorX:a.anchorPoint.x,anchorY:a.anchorPoint.y,angle:a.rotation,color:m(a.color)??[0,0,0,0],colorLocked:a.colorLocked,frameHeight:a.frameHeight,widthRatio:a.widthRatio,scaleInfo:t,offsetX:a.offsetX,offsetY:a.offsetY,outlineColor:m(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineWidth,referenceSize:a.referenceSize||n.CIMVectorMarker.size,rotateClockwise:a.rotateClockwise,scaleFactor:o??1,sizeRatio:a.sizeRatio,alignment:a.alignment,isAbsoluteAnchorPoint:a.isAbsoluteAnchorPoint,scaleSymbolsProportionally:a.scaleSymbolsProportionally,sprite:a.spriteRasterizationParam,hasSizeVV:r,placement:a.markerPlacement,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,transforms:a.transform,minPixelBuffer:l(i)})]}function d(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:r}=l,{layerOrderMap:s}=i,u={visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity};if(e.animationParams){const a=t.animatedFill;return V(r.ensureInstance(a,{uniforms:{...u,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},c(e.name,s)),e,o,i)}return y(r.ensureInstance(t.fill,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,s)),e,i)}function z(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return v(o.ensureInstance(t.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,r)),e,i)}function v(e,i,n){const t=m(i.color)??[0,0,0,0],l=m(i.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:t,outlineColor:l,width:i.outlineWidth,referenceWidth:i.referenceWidth,minPixelBuffer:null!=i.pixelBufferSize?a(i.pixelBufferSize)+1:0,capType:i.cap,joinType:i.join,miterLimit:i.miterLimit,outlineUsesColorVV:!i.outlineColorLocked,hasSizeVV:!1,scaleInfo:n.scaleInfo,...C(i,n),effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,outlineEffects:i.outlineEffects?{type:"cim-effect-infos",effectInfos:i.outlineEffects}:null})]}function y(e,a,i){const{scaleInfo:n}=i;return[e.createMeshInfo({color:m(a.color)??[0,0,0,0],scaleInfo:n,...C(a,i),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function g(e,a,i){const{layerOrderMap:n}=i;if(!e.spriteRasterizationParam)return d(e,a,i);const{uniforms:l,schemaOptions:r}=a,{store:s}=r,u={visualVariableColor:e.colorLocked?null:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity};if(e.animationParams){const a=t.animatedFill;return V(s.ensureInstance(a,{uniforms:{...u,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},c(e.name,n)),e,o,i)}return I(s.ensureInstance(t.complexFill,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,n)),e,null!=l.visualVariableColor,i)}function I(e,a,i,n){const{scaleInfo:t}=n;if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),o=a.sampleAlphaOnly&&!l,r=a.spriteRasterizationParam;return[e.createMeshInfo({color:m(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:"CIMHatchFill"===r.resource.type,sprite:r,scaleInfo:t,...C(a,n),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function M(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return R(o.ensureInstance(t.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,r)),e,i)}function R(e,a,i){const{scaleInfo:n}=i;if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const t=a.spriteRasterizationParam;return[e.createMeshInfo({color:m(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:t,scaleInfo:n,...C(a,i),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function O(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:r}=l,{layerOrderMap:s}=i,u=e.isOutline?{...o,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=t.animatedLine;return V(r.ensureInstance(n,{uniforms:{...u,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a,angle:!1}},c(e.name,s)),e,o,i)}const f={uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},m=!!(u.visualVariableSizeMinMaxValue||u.visualVariableSizeScaleStops||u.visualVariableSizeStops||u.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return x(r.ensureInstance(t.line,f,c(e.name,s)),e,m,i)}return L(r.ensureInstance(t.texturedLine,f,c(e.name,s)),e,m,i)}function P(e,a,i){const{scaleInfo:n}=i;return{color:m(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:n,hasSizeVV:a,...C(e,i),effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function C(e,{rotationVariable:a,viewRotation:i}){if(!e.effects?.length&&!e.outlineEffects?.length)return{};const n={};if(e.effectsChangeGeometryType&&(n.useEffectOrigin=!0),null!=i&&(n.viewRotation=i),!a)return n;const t=a.valueExpression??(a.field?`$feature[${JSON.stringify(a.field)}]`:null);return t?(n.effectRotation={valueExpressionInfo:{type:"CIMExpressionInfo",expression:t},defaultValue:0},n.effectRotationType=a.rotationType,n):n}function x(e,a,i,n){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=P(a,i,n);return[e.createMeshInfo(t)]}function L(e,a,i,n){const{spriteRasterizationParam:t,scaleDash:l,sampleAlphaOnly:o}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...P(a,i,n),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:l??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function k(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:r}=l,{layerOrderMap:s}=i;return w(r.ensureInstance(t.gradientStroke,{uniforms:e.isOutline?{...o,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,s)),e,i)}function w(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=a.spriteRasterizationParam;return[e.createMeshInfo({...P(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function A(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return E(o.ensureInstance(t.text,{uniforms:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableRotation:n.visualVariableRotation,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1,visibility:!1}},c(e.name,r)),e,n,i)}function E(e,a,i,{scaleInfo:n,scaleExpression:t}){return[e.createMeshInfo({alignment:a.alignment,boxBackgroundColor:m(a.backgroundColor),boxBorderLineColor:m(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:m(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:m(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:m(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:t??1,minPixelBuffer:l(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{b as createAnimatedMarkerMeshInfos,V as createAnimatedPolyMeshInfos,I as createComplexFillMeshInfos,h as createComplexMarkerMeshInfos,y as createComplexSimpleFillMeshInfos,x as createComplexSimpleLineMeshInfos,v as createComplexSimpleOutlineFillMeshInfos,p as createComplexSymbolInstances,E as createComplexTextMeshInfos,L as createComplexTexturedLineMeshInfos,R as createGradientFillMeshInfos,w as createGradientStrokeMeshInfos,f as getScaleInfo};
|
|
2
|
+
import e from"../../../../../../../core/Logger.js";import{pt2px as a}from"../../../../../../../core/screenUtils.js";import{CIMSymbolHelper as i}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as n}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as t}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{defineMeshWriterReferences as l}from"../../../../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js";import{getMaxSizeVVSize as o,noVisualVariables as r}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as s,hasSizeVVUniform as c}from"./utils.js";function u(a,i){if(a&&i){const n=a.toLowerCase(),t=i.get(n);if(void 0!==t)return{name:n,index:t};e.getLogger("esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema").warn(`Invalid symbol layer name: "${a}"`)}return null}function f(e,a){if(a?.enabled&&a.drawOrder){const i=a.drawOrder.map(e=>e.toLowerCase()).slice().reverse(),n=new Map;for(const a of e)if(a.groupName&&a.name){const e=a.name.toLowerCase(),t=a.groupName.toLowerCase(),l=i.indexOf(t);-1!==l&&(n.has(l)||n.set(l,[]),n.get(l).push(e))}const t=[];i.forEach((e,a)=>{n.has(a)?t.push(...n.get(a)):t.push(e)});const l=new Map;return t.forEach((e,a)=>{l.set(e,a)}),l}return null}function m(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function p(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,n,t]=e;return[a,i,n,255*t]}return"string"==typeof e?e:{...e,defaultValue:p(e?.defaultValue)}}async function S(e,a,i=!1){return V(e,a,i,!0)}async function b(e,a,i=!1){return V(e,a,i,!1)}async function V(e,a,n,t){const{cimResourceManager:o,cimAnalyzer:r,scaleExpression:s,symbolLayerDrawing:c}=a.schemaOptions,u=e.symbol;if(null==u)return[];await i.normalizeSymbolAndFetchResources(u,o);const p=r.analyzeSymbolReference(e,!1),S=m(e),b=f(p,c),V=h(u,p,n),d="CIMPointSymbol"===u.type&&"Map"!==u.angleAlignment,y=d||V?a.schemaOptions.viewRotation:null,v={scaleInfo:S,scaleExpression:s,rotationVariable:a.rotationVariable??null,viewRotation:y,viewRotationForCalloutsOnly:V&&!d,layerOrderMap:b},g=[];for(const i of p)switch(i.type){case"marker":g.push(...z(i,a,v));break;case"fill":g.push(...O(i,a,v));break;case"outlineFill":g.push(...M(i,a,v));break;case"gradientFill":g.push(...k(i,a,v));break;case"line":g.push(...x(i,a,v));break;case"gradientStroke":g.push(...T(i,a,v));break;case"text":g.push(...F(i,a,v))}if(n)for(const i of g)i.inputParams.collisionVisibility=!0;return t?l(g):g}function h(e,a,i){return!i&&"CIMLineSymbol"===e.type&&a.some(e=>("marker"===e.type||"text"===e.type)&&0===e.alignment)&&a.some(d)}function d(e){return[...e.effects??[],..."outlineEffects"in e?e.outlineEffects??[]:[]].some(({effect:e})=>"CIMSimpleLineCallout"===e.type||"CIMBackgroundCallout"===e.type||"CIMBalloonCallout"===e.type||"CIMPointSymbolCallout"===e.type)}function z(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:s}=i,c=e.isOutline?{...r,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue,visualVariableRotation:n.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=a?t.animatedMarkerShift:t.animatedMarker;return y(o.ensureInstance(n,{uniforms:c,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}},u(e.name,s)),e,r,i)}return g(o.ensureInstance(t.marker,{uniforms:c,optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,s)),e,n,i)}function y(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:s(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:1===a.alignment,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function v(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:s(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2,angle:"angle"in a?a.angle:0})]}function g(e,a,i,{scaleInfo:t,scaleExpression:l}){const r=c(i);return[e.createMeshInfo({size:a.size,scaleX:a.scaleX,anchorX:a.anchorPoint.x,anchorY:a.anchorPoint.y,angle:a.rotation,color:p(a.color)??[0,0,0,0],colorLocked:a.colorLocked,frameHeight:a.frameHeight,widthRatio:a.widthRatio,scaleInfo:t,offsetX:a.offsetX,offsetY:a.offsetY,outlineColor:p(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineWidth,referenceSize:a.referenceSize||n.CIMVectorMarker.size,rotateClockwise:a.rotateClockwise,scaleFactor:l??1,sizeRatio:a.sizeRatio,alignment:a.alignment,isAbsoluteAnchorPoint:a.isAbsoluteAnchorPoint,scaleSymbolsProportionally:a.scaleSymbolsProportionally,sprite:a.spriteRasterizationParam,hasSizeVV:r,placement:a.markerPlacement,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,transforms:a.transform,minPixelBuffer:o(i)})]}function I(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:s}=i,c={visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity};if(e.animationParams){const a=t.animatedFill;return v(o.ensureInstance(a,{uniforms:{...c,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},u(e.name,s)),e,r,i)}return R(o.ensureInstance(t.fill,{uniforms:c,optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,s)),e,i)}function M(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return C(o.ensureInstance(t.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,r)),e,i)}function C(e,i,n){const t=p(i.color)??[0,0,0,0],l=p(i.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:t,outlineColor:l,width:i.outlineWidth,referenceWidth:i.referenceWidth,minPixelBuffer:null!=i.pixelBufferSize?a(i.pixelBufferSize)+1:0,capType:i.cap,joinType:i.join,miterLimit:i.miterLimit,outlineUsesColorVV:!i.outlineColorLocked,hasSizeVV:!1,scaleInfo:n.scaleInfo,...A(i,n),effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,outlineEffects:i.outlineEffects?{type:"cim-effect-infos",effectInfos:i.outlineEffects}:null})]}function R(e,a,i){const{scaleInfo:n}=i;return[e.createMeshInfo({color:p(a.color)??[0,0,0,0],scaleInfo:n,...A(a,i),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function O(e,a,i){const{layerOrderMap:n}=i;if(!e.spriteRasterizationParam)return I(e,a,i);const{uniforms:l,schemaOptions:o}=a,{store:s}=o,c={visualVariableColor:e.colorLocked?null:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity};if(e.animationParams){const a=t.animatedFill;return v(s.ensureInstance(a,{uniforms:{...c,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},u(e.name,n)),e,r,i)}return P(s.ensureInstance(t.complexFill,{uniforms:c,optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,n)),e,null!=l.visualVariableColor,i)}function P(e,a,i,n){const{scaleInfo:t}=n;if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),o=a.sampleAlphaOnly&&!l,r=a.spriteRasterizationParam;return[e.createMeshInfo({color:p(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:"CIMHatchFill"===r.resource.type,sprite:r,scaleInfo:t,...A(a,n),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function k(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return L(o.ensureInstance(t.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,r)),e,i)}function L(e,a,i){const{scaleInfo:n}=i;if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const t=a.spriteRasterizationParam;return[e.createMeshInfo({color:p(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:t,scaleInfo:n,...A(a,i),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function x(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:s}=i,c=e.isOutline?{...r,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=t.animatedLine;return v(o.ensureInstance(n,{uniforms:{...c,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a,angle:!1}},u(e.name,s)),e,r,i)}const f={uniforms:c,optionalAttributes:{zoomRange:!!i.scaleInfo}},m=!!(c.visualVariableSizeMinMaxValue||c.visualVariableSizeScaleStops||c.visualVariableSizeStops||c.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return E(o.ensureInstance(t.line,f,u(e.name,s)),e,m,i)}return U(o.ensureInstance(t.texturedLine,f,u(e.name,s)),e,m,i)}function w(e,a,i){const{scaleInfo:n}=i;return{color:p(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:n,hasSizeVV:a,...A(e,i),effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function A(e,{rotationVariable:a,viewRotation:i,viewRotationForCalloutsOnly:n}){if(!e.effects?.length&&!e.outlineEffects?.length)return{};const t={};if(e.effectsChangeGeometryType&&(t.useEffectOrigin=!0),null!=i&&(!n||"text"!==e.type&&d(e))&&(t.viewRotation=i),!a)return t;const l=a.valueExpression??(a.field?`$feature[${JSON.stringify(a.field)}]`:null);return l?(t.effectRotation={valueExpressionInfo:{type:"CIMExpressionInfo",expression:l},defaultValue:0},t.effectRotationType=a.rotationType,t):t}function E(e,a,i,n){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=w(a,i,n);return[e.createMeshInfo(t)]}function U(e,a,i,n){const{spriteRasterizationParam:t,scaleDash:l,sampleAlphaOnly:o}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...w(a,i,n),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:l??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function T(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:s}=i;return j(o.ensureInstance(t.gradientStroke,{uniforms:e.isOutline?{...r,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,s)),e,i)}function j(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=a.spriteRasterizationParam;return[e.createMeshInfo({...w(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function F(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return W(o.ensureInstance(t.text,{uniforms:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableRotation:n.visualVariableRotation,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1}},u(e.name,r)),e,n,i)}function W(e,a,i,{scaleInfo:n,scaleExpression:t}){return[e.createMeshInfo({alignment:a.alignment,boxBackgroundColor:null,boxBorderLineColor:null,boxBorderLineSize:0,backgroundColor:p(a.backgroundColor),borderLineColor:p(a.borderLineColor),borderLineWidth:a.borderLineWidth??0,useBackgroundCallout:a.useBackgroundCallout,color:p(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:p(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:p(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:t??1,minPixelBuffer:o(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{y as createAnimatedMarkerMeshInfos,v as createAnimatedPolyMeshInfos,P as createComplexFillMeshInfos,g as createComplexMarkerMeshInfos,R as createComplexSimpleFillMeshInfos,E as createComplexSimpleLineMeshInfos,C as createComplexSimpleOutlineFillMeshInfos,S as createComplexSymbolInstances,b as createComplexSymbolPartSchemas,W as createComplexTextMeshInfos,U as createComplexTexturedLineMeshInfos,L as createGradientFillMeshInfos,j as createGradientStrokeMeshInfos,m as getScaleInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../../../core/Logger.js";import{pt2px as i}from"../../../../../../../core/screenUtils.js";import{generateGradient as a}from"../../../../../../../renderers/support/heatmapUtils.js";import l from"../../../../../../../symbols/SimpleFillSymbol.js";import r from"../../../../../../../symbols/SimpleLineSymbol.js";import t from"../../../../../../../symbols/SimpleMarkerSymbol.js";import{CIMSymbolHelper as o,slsDashToTemplateArray as s}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{hasRichTextFormattingTags as n}from"../../../../../../../symbols/cim/richTextUtils.js";import{getSDFInfo as u}from"../../../../../../../symbols/cim/SDFHelper.js";import{getAlignmentFromPlacement as c}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as p}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as f}from"../../../../../engine/webgl/definitions.js";import{Techniques as b}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{maxPieChartFields as m}from"../../../../../engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js";import{premultiplyColor as S}from"../schemaUtils.js";import{createVisualVariableUniforms as y,getMaxSizeVVSize as V,noVisualVariables as v}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as h}from"./ComplexSymbolSchema.js";import{hasSizeVVUniform as z,hasRotationVVUniform as d}from"./utils.js";async function g(i,a){if(!i)return[];switch(i.type){case"simple-fill":return F(i,a);case"picture-fill":return P(i,a);case"simple-marker":return w(i,a);case"picture-marker":return O(i,a);case"simple-line":return B(i,a,!1);case"text":return L(i,a);case"label":return R(i,a);case"cim":return h(i.data,a);case"web-style":return g(await i.fetchSymbol({acceptedFormats:["cim","web"]}),a);case"line-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-line`),B(new r,a,!1);case"point-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-marker`),w(new t,a);case"polygon-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-fill`),F(new l,a);case"mesh-3d":case"label-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function x(e,i){const{schemaOptions:a}=i,{store:r}=a,t=new Array(f),o=new Array(f/4);for(let l=0;l<f;l++){const i=l<e.attributes.length?e.attributes[l].color:null;t[l]=[0,0,0,0],p(t[l],i)}for(let l=0;l<f/4;l++)o[l]=[0,0,0,0],o[l][0]=4*l<e.attributes.length?1:0,o[l][1]=4*l+1<e.attributes.length?1:0,o[l][2]=4*l+2<e.attributes.length?1:0,o[l][3]=4*l+3<e.attributes.length?1:0;const s={uniforms:{isActive:o,colors:t,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},optionalAttributes:{}},n=r.ensureInstance(b.dotDensity,s).createMeshInfo({effects:null}),u=[],c=new l({color:e.backgroundColor??[0,0,0,0],outline:null}),m=await g(c,i);if(u.push(...m),u.push(n),e.outline){const a=B(e.outline,i,!0);u.push(...a)}return u}async function M(e,l){const{store:r}=l,{radius:t,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:c,colorStops:p}=e,f=a(p);return[r.ensureInstance(b.heatmap,{uniforms:{radius:i(t),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!c),gradient:f,gradientHash:f.join(",")},optionalAttributes:{}}).createMeshInfo({effects:null})]}async function C(e,a){const{store:l}=a,r=e.outline?.width||0,t=y(e),o=Math.min(e.attributes.length,m),s=e.attributes.slice(0,o).map(e=>S(e.color));for(;s.length<m;)s.push([0,0,0,0]);const n=l.ensureInstance(b.pieChart,{uniforms:{shader:{chart:{outlineWidth:Math.round(i(r)),defaultColor:S(e.defaultColor),outlineColor:S(e.outline?.color),othersColor:S(e.othersCategory?.color),donutRatio:e.holePercentage,sectorThreshold:e.othersCategory?.threshold||0,colors:s,fieldCount:o},visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},optionalAttributes:{zoomRange:!0}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:V(t)});return[...e.backgroundFillSymbol?await F(e.backgroundFillSymbol,{schemaOptions:a,uniforms:v}):[],n]}function I(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const i=o.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:i.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:u(i),overrides:[]}}async function w(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const l=o.fromSimpleMarker(e);if(!l||!l.symbolLayers)throw new Error("Error handling marker! ");if(a.visualVariableRotation&&(l.angleAlignment="Map"),"path"!==e.style){const e=l.symbolLayers[0];if(z(i.uniforms)){const a=V(i.uniforms,0,1);if(a>e.size){const i=a/e.size;e.size=a;const l=e.markerGraphics?.[0].symbol;(l.symbolLayers&&l.symbolLayers[0]).width*=i}}}return h({type:"CIMSymbolReference",symbol:l},i)}const t=r.ensureInstance(b.marker,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue,visualVariableRotation:a.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=I(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===s.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,c=e.size,p=c*u,f=null!=a.visualVariableColor&&("cross"===e.style||"x"===e.style);return[t.createMeshInfo({type:"simple",color:n,height:c,width:p,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:d(a)?1:0,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:c,sprite:s,overrideOutlineColor:f,hasSizeVV:z(a),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:V(a)})]}function O(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=r.ensureInstance(b.marker,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue,visualVariableRotation:a.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=o.createPictureMarkerRasterizationParam(e);if(!s)return[];return[t.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:d(a)?1:0,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:s,overrideOutlineColor:!1,hasSizeVV:z(a),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:V(a)})]}function A(e,i,a){const{uniforms:l,schemaOptions:r}=a,{store:t}=r,o=t.ensureInstance(b.marker,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=I(e),n=6,u=n*i.width,c=u,p=e.color?.toArray()??i.color?.toArray()??[0,0,0,0],f="cross"===e.style||"x"===e.style;let m;switch(e.placement){case"begin-end":m="Both";break;case"begin":m="JustBegin";break;case"end":m="JustEnd";break;default:m="None"}const S={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:m,offsetAlongLine:0},overrides:[]};return[o.createMeshInfo({type:"simple",color:p,height:c,width:u,offsetX:0,offsetY:0,angle:0,alignment:d(l)?1:0,outlineColor:p,outlineSize:f?i.width:0,referenceSize:c/n,sprite:s,overrideOutlineColor:f&&null!=l.visualVariableColor,hasSizeVV:z(l),placement:S,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:V(l)})]}function L(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l;return[r.ensureInstance(b.text,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableRotation:a.visualVariableRotation,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1,visibility:!1}}).createMeshInfo({alignment:0,boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:o.createCIMTextSymbolfromTextSymbol(e),supportsRichText:n(e.text)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:V(a),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}function R(e,a){const{schemaOptions:l,uniforms:r}=a,{store:t}=l,s=e.symbol,{allowOverrun:n,repeatLabel:u,repeatLabelDistance:p}=e,f={maxScale:e.maxScale??0,minScale:e.minScale??0},m=t.ensureInstance(b.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0,visibility:!0}}),S=e.labelPlacement,[y,v]=c(S);return[m.createMeshInfo({alignment:0,boxBackgroundColor:s.backgroundColor?.toArray(),boxBorderLineColor:s.borderLineColor?.toArray(),boxBorderLineSize:s.borderLineSize??0,color:s.color?.toArray()??[0,0,0,0],offsetX:s.xoffset,offsetY:s.yoffset,postAngle:s.angle,fontSize:s.font.size,decoration:s.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:s.haloColor?.toArray()??[0,0,0,0],haloSize:s.haloSize??0,lineWidth:s.lineWidth,lineHeightRatio:s.lineHeight,horizontalAlignment:y,verticalAlignment:v,repeatLabel:u,repeatLabelDistance:i(p),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:f,minPixelBuffer:V(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:s.font.toJSON(),textString:s.text,symbol:o.createCIMTextSymbolfromTextSymbol(s),primitiveName:"label-override",supportsRichText:!0},useLegacyLabelEvaluationRules:null==e.labelExpressionInfo?.expression,overrides:[{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,layerId:a.layerId,labelClassId:a.labelClassId})]}function k(e,i){const a=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:a,referenceWidth:a,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:i,outlineUsesColorVV:!1}}function j(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[r.ensureInstance(b.patternOutlineFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeScaleStops:a.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,...k(e.outline,!!a.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null})]}const s=[],n=r.ensureInstance(b.patternFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null});return s.push(n),e.outline&&s.push(...B(e.outline,i,!0)),s}function U(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[r.ensureInstance(b.outlineFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeScaleStops:a.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,...k(e.outline,!!a.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})]}const o=[];if("none"!==e.style){const e=r.ensureInstance(b.fill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,scaleInfo:null,effects:null});o.push(e)}return e.outline&&o.push(...B(e.outline,i,!0)),o}async function F(e,i){if("cim"===e.type)return h(e.data,i);const{style:a}=e;return a&&"none"!==a&&"solid"!==a?j(e,i):U(e,i)}function P(e,i){const{outline:a}=e,{uniforms:l,schemaOptions:r}=i,{store:t}=r,s=[],n=o.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:c,xoffset:p,yoffset:f,xscale:m,yscale:S}=e,y={color:[255,255,255,255],sprite:n,height:c,aspectRatio:u/c,offsetX:p,offsetY:f,scaleX:m,scaleY:S,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===a?.style){return[t.ensureInstance(b.complexOutlineFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...y,...k(a,!!l.visualVariableSizeOutlineScaleStops)})]}const V=t.ensureInstance(b.complexFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return s.push(V.createMeshInfo(y)),a&&s.push(...B(a,i,!0)),s}function B(e,i,a){const{color:l,style:r,width:t,cap:o,join:n}=e,{schemaOptions:u}=i,{store:c}=u,p=[],f=a?{...v,visualVariableSizeScaleStops:i.uniforms.visualVariableSizeOutlineScaleStops}:i.uniforms,m={uniforms:{visualVariableColor:f.visualVariableColor,visualVariableOpacity:f.visualVariableOpacity,visualVariableSizeMinMaxValue:f.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:f.visualVariableSizeScaleStops,visualVariableSizeStops:f.visualVariableSizeStops,visualVariableSizeUnitValue:f.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},S={color:l?.toArray()??[0,0,0,0],width:t,referenceWidth:t,capType:o,joinType:n,miterLimit:e.miterLimit,hasSizeVV:z(f),effects:null,scaleInfo:null};if(null==r||"solid"===r){const e=c.ensureInstance(b.line,m).createMeshInfo(S);p.push(e)}else if("none"!==r){const e=c.ensureInstance(b.texturedLine,m).createMeshInfo({...S,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:s(r,o)},overrides:[]}});p.push(e)}return null!=e.marker&&p.push(...A(e.marker,e,i)),p}export{x as createDotDensityMeshSchemas,M as createHeatmapMeshSchemas,B as createLineInstance,C as createPieChartMeshSchemas,g as createSymbolMeshSchemas};
|
|
2
|
+
import{getFontFamily as e}from"../../../../../../../core/fontUtils.js";import a from"../../../../../../../core/Logger.js";import{pt2px as l}from"../../../../../../../core/screenUtils.js";import{generateGradient as i}from"../../../../../../../renderers/support/heatmapUtils.js";import t from"../../../../../../../symbols/SimpleFillSymbol.js";import r from"../../../../../../../symbols/SimpleLineSymbol.js";import o from"../../../../../../../symbols/SimpleMarkerSymbol.js";import{CIMSymbolHelper as s,slsDashToTemplateArray as n}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{fromCIMFontStyle as u}from"../../../../../../../symbols/cim/fromCIMFontStyle.js";import{hasRichTextFormattingTags as c}from"../../../../../../../symbols/cim/richTextUtils.js";import{getSDFInfo as p}from"../../../../../../../symbols/cim/SDFHelper.js";import{getFillColor as f,getStrokeColor as m,getStrokeWidth as b,fromCIMFontDecoration as S}from"../../../../../../../symbols/cim/utils.js";import{getAlignmentFromPlacement as y}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as V}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as h}from"../../../../../engine/webgl/definitions.js";import{Techniques as v}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{defineMeshWriterReferences as d}from"../../../../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js";import{maxPieChartFields as z}from"../../../../../engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js";import{premultiplyColor as g}from"../schemaUtils.js";import{createVisualVariableUniforms as C,getMaxSizeVVSize as M,noVisualVariables as x}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as I,createComplexSymbolPartSchemas as w}from"./ComplexSymbolSchema.js";import{hasSizeVVUniform as O,hasRotationVVUniform as A}from"./utils.js";async function L(e,l){if(!e)return[];switch(e.type){case"simple-fill":return d(await q(e,l));case"picture-fill":return d(await G(e,l));case"simple-marker":return d(await F(e,l));case"picture-marker":return d(await P(e,l));case"simple-line":return d(J(e,l,!1));case"text":return d(E(e,l));case"label":return T(e,l);case"cim":return I(e.data,l);case"web-style":return L(await e.fetchSymbol({acceptedFormats:["cim","web"]}),l);case"line-3d":return a.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-line`),d(await J(new r,l,!1));case"point-3d":return a.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-marker`),d(await F(new o,l));case"polygon-3d":return a.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-fill`),d(await q(new t,l));case"mesh-3d":case"label-3d":return a.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function R(e,a){const{schemaOptions:l}=a,{store:i}=l,r=new Array(h),o=new Array(h/4);for(let t=0;t<h;t++){const a=t<e.attributes.length?e.attributes[t].color:null;r[t]=[0,0,0,0],V(r[t],a)}for(let t=0;t<h/4;t++)o[t]=[0,0,0,0],o[t][0]=4*t<e.attributes.length?1:0,o[t][1]=4*t+1<e.attributes.length?1:0,o[t][2]=4*t+2<e.attributes.length?1:0,o[t][3]=4*t+3<e.attributes.length?1:0;const s={uniforms:{isActive:o,colors:r,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},optionalAttributes:{}},n=i.ensureInstance(v.dotDensity,s).createMeshInfo({effects:null}),u=[],c=new t({color:e.backgroundColor??[0,0,0,0],outline:null}),p=await L(c,a);if(u.push(...p),u.push(n),e.outline){const l=J(e.outline,a,!0);u.push(...l)}return u}async function k(e,a){const{store:t}=a,{radius:r,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:c,colorStops:p}=e,f=i(p);return[t.ensureInstance(v.heatmap,{uniforms:{radius:l(r),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!c),gradient:f,gradientHash:f.join(",")},optionalAttributes:{}}).createMeshInfo({effects:null})]}async function j(e,a){const{store:i}=a,t=e.outline?.width||0,r=C(e),o=Math.min(e.attributes.length,z),s=e.attributes.slice(0,o).map(e=>g(e.color));for(;s.length<z;)s.push([0,0,0,0]);const n=i.ensureInstance(v.pieChart,{uniforms:{shader:{chart:{outlineWidth:Math.round(l(t)),defaultColor:g(e.defaultColor),outlineColor:g(e.outline?.color),othersColor:g(e.othersCategory?.color),donutRatio:e.holePercentage,sectorThreshold:e.othersCategory?.threshold||0,colors:s,fieldCount:o},visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue}},optionalAttributes:{zoomRange:!0}}).createMeshInfo({size:e.size,outlineWidth:t,effects:null,scaleInfo:null,minPixelBuffer:M(r)});return[...e.backgroundFillSymbol?await q(e.backgroundFillSymbol,{schemaOptions:a,uniforms:x}):[],n]}function U(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const a=s.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!a||!a.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:a.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:p(a),overrides:[]}}async function F(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const i=s.fromSimpleMarker(e);if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");if(l.visualVariableRotation&&(i.angleAlignment="Map"),"path"!==e.style){const e=i.symbolLayers[0];if(O(a.uniforms)){const l=M(a.uniforms,0,1);if(l>e.size){const a=l/e.size;e.size=l;const i=e.markerGraphics?.[0].symbol;(i.symbolLayers&&i.symbolLayers[0]).width*=a}}}return I({type:"CIMSymbolReference",symbol:i},a)}const r=t.ensureInstance(v.marker,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=U(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===o.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,c=e.size,p=c*u,f=null!=l.visualVariableColor&&("cross"===e.style||"x"===e.style);return[r.createMeshInfo({type:"simple",color:n,height:c,width:p,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:A(l)?1:0,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:c,sprite:o,overrideOutlineColor:f,hasSizeVV:O(l),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:M(l)})]}function P(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i,r=t.ensureInstance(v.marker,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=s.createPictureMarkerRasterizationParam(e);if(!o)return[];return[r.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:A(l)?1:0,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:o,overrideOutlineColor:!1,hasSizeVV:O(l),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:M(l)})]}function B(e,a,l){const{uniforms:i,schemaOptions:t}=l,{store:r}=t,o=r.ensureInstance(v.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=U(e),n=6,u=n*a.width,c=u,p=e.color?.toArray()??a.color?.toArray()??[0,0,0,0],f="cross"===e.style||"x"===e.style;let m;switch(e.placement){case"begin-end":m="Both";break;case"begin":m="JustBegin";break;case"end":m="JustEnd";break;default:m="None"}const b={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:m,offsetAlongLine:0},overrides:[]};return[o.createMeshInfo({type:"simple",color:p,height:c,width:u,offsetX:0,offsetY:0,angle:0,alignment:A(i)?1:0,outlineColor:p,outlineSize:f?a.width:0,referenceSize:c/n,sprite:s,overrideOutlineColor:f&&null!=i.visualVariableColor,hasSizeVV:O(i),placement:b,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:M(i)})]}function E(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i;return[t.ensureInstance(v.text,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableRotation:l.visualVariableRotation,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}}).createMeshInfo({alignment:0,boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:s.createCIMTextSymbolfromTextSymbol(e),supportsRichText:c(e.text)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:M(l),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}async function T(e,a){const{schemaOptions:i,uniforms:t}=a,{store:r}=i,o=e.symbol,n="cim"===o.type?o:null,u="CIMTextSymbol"===n?.data.symbol?.type?n.data.symbol:null;if(n&&!u)throw new Error("InternalError: CIM label symbols must contain a CIMTextSymbol");const c=u?null:o,{allowOverrun:p,repeatLabel:S,repeatLabelDistance:V}=e,h={maxScale:e.maxScale??0,minScale:e.minScale??0},d=u?D(u):null,z=u??s.createCIMTextSymbolfromTextSymbol(c),g=W(u?.callout)?u.callout:null,C=g?await w({type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[],callout:g},primitiveOverrides:n.data.primitiveOverrides},a,!0):[],x=r.ensureInstance(v.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}}),I=e.labelPlacement,[O,A]=y(I),L={...x.createMeshInfo({alignment:0,boxBackgroundColor:c?.backgroundColor?.toArray(),boxBorderLineColor:c?.borderLineColor?.toArray(),boxBorderLineSize:c?.borderLineSize??0,color:u?N(f(u),[0,0,0,255]):c?.color?.toArray()??[0,0,0,0],offsetX:u?u.offsetX??0:c.xoffset,offsetY:u?u.offsetY??0:c.yoffset,labelOffsetDistance:g?e.offsetDistance:0,postAngle:u?u.angle??0:c.angle,fontSize:u?u.height??10:c.font.size,decoration:d?.decoration??c.font.decoration,outlineColor:u?N(m(u),[0,0,0,0]):[0,0,0,0],outlineSize:u?b(u)??0:0,haloColor:u?N(f(u.haloSymbol)??m(u.haloSymbol),[0,0,0,0]):c?.haloColor?.toArray()??[0,0,0,0],haloSize:u?u.haloSize??0:c.haloSize??0,lineWidth:u?u.lineWidth??512:c.lineWidth,lineHeightRatio:c?.lineHeight??1,horizontalAlignment:O,verticalAlignment:A,repeatLabel:S,repeatLabelDistance:l(V),allowOverrun:p,labelPosition:e.labelPosition,scaleInfo:h,minPixelBuffer:M(t),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:d??c.font.toJSON(),textString:c?.text??"",symbol:z,primitiveName:"label-override",supportsRichText:!0},useLegacyLabelEvaluationRules:null==e.labelExpressionInfo?.expression,overrides:[{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,layerId:a.layerId,labelClassId:a.labelClassId,collisionVisibility:!0}),references:{externalDependencies:["label-reference-symbol"],...g?{exports:["callout-body"]}:null}};return[...g?C.map(e=>({...e,id:r.ensureLabelPhaseInstanceId(e.id),references:{...e.references,dependencies:["callout-body"]}})):C,L]}function D(a){return{family:e(a.fontFamilyName),decoration:S(a),...u(a.fontStyleName)}}function W(e){return"CIMSimpleLineCallout"===e?.type||"CIMBackgroundCallout"===e?.type||"CIMBalloonCallout"===e?.type||"CIMPointSymbolCallout"===e?.type}function N(e,a){return 4===e?.length?[e[0],e[1],e[2],e[3]]:a}function X(e,a){const l=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:l,referenceWidth:l,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:a,outlineUsesColorVV:!1}}function Y(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i,r=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[t.ensureInstance(v.patternOutlineFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:r,...X(e.outline,!!l.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null})]}const s=[],n=t.ensureInstance(v.patternFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null});return s.push(n),e.outline&&s.push(...J(e.outline,a,!0)),s}function H(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i,r=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[t.ensureInstance(v.outlineFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:r,...X(e.outline,!!l.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})]}const o=[];if("none"!==e.style){const e=t.ensureInstance(v.fill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:r,scaleInfo:null,effects:null});o.push(e)}return e.outline&&o.push(...J(e.outline,a,!0)),o}async function q(e,a){if("cim"===e.type)return I(e.data,a);const{style:l}=e;return l&&"none"!==l&&"solid"!==l?Y(e,a):H(e,a)}function G(e,a){const{outline:l}=e,{uniforms:i,schemaOptions:t}=a,{store:r}=t,o=[],n=s.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:c,xoffset:p,yoffset:f,xscale:m,yscale:b}=e,S={color:[255,255,255,255],sprite:n,height:c,aspectRatio:u/c,offsetX:p,offsetY:f,scaleX:m,scaleY:b,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===l?.style){return[r.ensureInstance(v.complexOutlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...S,...X(l,!!i.visualVariableSizeOutlineScaleStops)})]}const y=r.ensureInstance(v.complexFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return o.push(y.createMeshInfo(S)),l&&o.push(...J(l,a,!0)),o}function J(e,a,l){const{color:i,style:t,width:r,cap:o,join:s}=e,{schemaOptions:u}=a,{store:c}=u,p=[],f=l?{...x,visualVariableSizeScaleStops:a.uniforms.visualVariableSizeOutlineScaleStops}:a.uniforms,m={uniforms:{visualVariableColor:f.visualVariableColor,visualVariableOpacity:f.visualVariableOpacity,visualVariableSizeMinMaxValue:f.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:f.visualVariableSizeScaleStops,visualVariableSizeStops:f.visualVariableSizeStops,visualVariableSizeUnitValue:f.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},b={color:i?.toArray()??[0,0,0,0],width:r,referenceWidth:r,capType:o,joinType:s,miterLimit:e.miterLimit,hasSizeVV:O(f),effects:null,scaleInfo:null};if(null==t||"solid"===t){const e=c.ensureInstance(v.line,m).createMeshInfo(b);p.push(e)}else if("none"!==t){const e=c.ensureInstance(v.texturedLine,m).createMeshInfo({...b,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:n(t,o)},overrides:[]}});p.push(e)}return null!=e.marker&&p.push(...B(e.marker,e,a)),p}export{R as createDotDensityMeshSchemas,k as createHeatmapMeshSchemas,J as createLineInstance,j as createPieChartMeshSchemas,L as createSymbolMeshSchemas};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as r,isGeometryWithZ as s,isGeometryWithM as i}from"../../../../../geometry/support/jsonTypeUtils.js";import{convertFromGeometry as o,generalizeOptimizedGeometry as n,quantizeOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import u from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as c}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as d}from"./FeatureSetReader.js";class a extends d{static from(e,t,r){return new a(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const s=t.lod;s.wrap&&(this._wrappingInfo={worldSizeX:s.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return null!=this._current.attributes[e]}field(e){return this.readAttribute(e)}get geometryType(){const e=r(this._current.geometry);return"esriGeometryPoint"===e?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new a(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw new Error("InternalError: exceededTransferLimit not implemented for graphics.")}get hasZ(){return s(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw new Error("InternalError: Setting displayId not supported for graphics.")}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw new Error("InternalError: readGeometryArea not supported for graphics.")}_readGeometry(){if(!this._cachedGeometry){let e=o(this._current.projectedGeometry);if("esriGeometryPolyline"===this.geometryType&&(e=n(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=h(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;const{worldSizeX:t}=this._wrappingInfo;if(e.isPoint)return 1===t?(e.coords.push(c,0),e.coords.push(2*-c,0),void e.lengths.push(3)):2===t?(e.coords.push(2*c,0),e.coords.push(4*-c,0),void e.lengths.push(3)):void this._wrapVertex(e.coords,0,2,t);if("esriGeometryMultipoint"!==this.geometryType);else{if(1===t){const t=e.coords.slice();t[0]-=512;const r=e.coords.slice();r[0]+=512,e.coords.push(...t,...r);const s=e.lengths[0];return void e.lengths.push(s,s)}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,r,s){const i=t*r,o=e[i];o<-c*(s-2)?e[i]=o+c*s:o>c*(s-1)&&(e[i]=o-c*s)}_readX(){const e=this._readGeometry();return null!=e?e.coords[0]:0}_readY(){const e=this._readGeometry();return null!=e?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=t(this._current.projectedGeometry),r=new u([],e,this.hasZ,!1);return h(r,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const t=this._current.projectedGeometry,r=e(t.paths,this.hasZ),s=new u([],r,this.hasZ,!1);return h(s,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(void 0!==r)return r;const s=e.toLowerCase();for(const i in this._current.attributes)if(i.toLowerCase()===s)return this._current.attributes[i]}_readAttributes(){return this._current.attributes}}export{a as GraphicsReader};
|
|
2
|
+
import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as r,isGeometryWithZ as s,isGeometryWithM as i}from"../../../../../geometry/support/jsonTypeUtils.js";import{convertFromGeometry as o,generalizeOptimizedGeometry as n,quantizeOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import u from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as c}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as d}from"./FeatureSetReader.js";class a extends d{static from(e,t,r){return new a(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const s=t.lod;s.wrap&&(this._wrappingInfo={worldSizeX:s.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??{writers:[],dependencies:new Map,exports:new Map,requiresCoordination:!1}}hasField(e){return null!=this._current.attributes[e]}field(e){return this.readAttribute(e)}get geometryType(){const e=r(this._current.geometry);return"esriGeometryPoint"===e?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new a(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw new Error("InternalError: exceededTransferLimit not implemented for graphics.")}get hasZ(){return s(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw new Error("InternalError: Setting displayId not supported for graphics.")}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw new Error("InternalError: readGeometryArea not supported for graphics.")}_readGeometry(){if(!this._cachedGeometry){let e=o(this._current.projectedGeometry);if("esriGeometryPolyline"===this.geometryType&&(e=n(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=h(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;const{worldSizeX:t}=this._wrappingInfo;if(e.isPoint)return 1===t?(e.coords.push(c,0),e.coords.push(2*-c,0),void e.lengths.push(3)):2===t?(e.coords.push(2*c,0),e.coords.push(4*-c,0),void e.lengths.push(3)):void this._wrapVertex(e.coords,0,2,t);if("esriGeometryMultipoint"!==this.geometryType);else{if(1===t){const t=e.coords.slice();t[0]-=512;const r=e.coords.slice();r[0]+=512,e.coords.push(...t,...r);const s=e.lengths[0];return void e.lengths.push(s,s)}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,r,s){const i=t*r,o=e[i];o<-c*(s-2)?e[i]=o+c*s:o>c*(s-1)&&(e[i]=o-c*s)}_readX(){const e=this._readGeometry();return null!=e?e.coords[0]:0}_readY(){const e=this._readGeometry();return null!=e?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=t(this._current.projectedGeometry),r=new u([],e,this.hasZ,!1);return h(r,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const t=this._current.projectedGeometry,r=e(t.paths,this.hasZ),s=new u([],r,this.hasZ,!1);return h(s,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(void 0!==r)return r;const s=e.toLowerCase();for(const i in this._current.attributes)if(i.toLowerCase()===s)return this._current.attributes[i]}_readAttributes(){return this._current.attributes}}export{a as GraphicsReader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{destroyMaybe as e}from"../../../../core/maybe.js";import{AFeatureContainer as t}from"../../engine/AFeatureContainer.js";import{GraphicInstanceStore as
|
|
2
|
+
import{destroyMaybe as e}from"../../../../core/maybe.js";import{AFeatureContainer as t}from"../../engine/AFeatureContainer.js";import{GraphicInstanceStore as i}from"../../engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js";import s from"./GraphicBoundsRenderer.js";class r extends t{constructor(e,t=!1){super(e),this.drawOnTop=t,this._hasHighlight=!1,this._instanceStore=new i}destroy(){super.destroy(),this._boundsRenderer=e(this._boundsRenderer)}get instanceStore(){return this._instanceStore}get hasHighlight(){return this._hasHighlight}enableRenderingBounds(e){this._boundsRenderer=new s(e),this.requestRender()}setHighlightActive(e){this._hasHighlight=e}onTileData(e,t){e.update(t),this.contains(e)||this.addChild(e),this.requestRender()}_renderChildren(e,t){e.selection=t;for(const i of this.children)i.visible&&i.upload(this._instanceStore,1);this.labelStore.upload(e.context);for(const i of this.children)i.visible&&i.getDisplayList()?.render(e)}}export{r as AGraphicContainer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import f from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as g,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as b,errorPolylineSymbol2D as w,errorPolygonSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as M}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as R}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createStorageSchema as j}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as x}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as U}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as C}from"../features/support/FeatureMetadata.js";import{GraphicsReader as q}from"../features/support/GraphicsReader.js";import F from"./GraphicStore.js";import{FeatureCommandQueue as G}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as O}from"../support/UpdateTracking2D.js";class P{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new P(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new P(e,s);for(const i of t)r.append(i);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||(this._reader=q.from(this.addedOrModified,this.tile,this.metadata)),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let k=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._highlightFlagsByObjectId=new Map,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new O({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new G({process:e=>{if("update"===e.type)return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new U({spatialReference:this.view.spatialReference,fields:new f}),this._attributeStore=new x({isLocal:!0,update:e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=j(null,[]);this._attributeStore.update(e,this._storage,null)}initialize(){this._initAttributeStore(),this._metadata=C.createGraphics(this.view.spatialReference),this._resourceProxy=new M({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")},fetchMesh:e=>{throw new Error("InternalError: Graphics do not support Mesh requests")}}),this.addHandles([n(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new F(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){return!this._attached||this._updateTracking.updating}hitTest(e,t){if(!this.view||this.view.suspended)return[];const{resolution:r,rotation:i}=this.view.state,o=this._graphicStore.hitTest(e,t,r,i),a=new Set(o),n=this.graphics.items.reduce((e,t)=>(a.has(t.uid)&&e.set(t.uid,t),e),new Map);return o.map(e=>n.get(e)).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlightFilters(e){this._highlightFlagsByObjectId.clear();for(const{order:t,filters:s}of e){const e=1<<t;for(const t of s)for(const s of t.objectIds??[]){const t=this._highlightFlagsByObjectId.get(s)??0;this._highlightFlagsByObjectId.set(s,t|e)}}if(this.container.setHighlightActive(this._highlightFlagsByObjectId.size>0),this._attached)for(const t of this._graphicStore.items())this._setFilterState(t);this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{if(has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;const e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(const s of e.updated)this.container.restartAnimation(s.objectId);if(!e.hasAnyUpdate())return void this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){P.getOrCreate(r,t,this._metadata).append(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const i of e){P.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){P.getOrCreate(i,t,this._metadata).append(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){P.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _densifyItemsForDisplay(e){const t=new Map;for(const s of e)for(const e of s.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){const t={timeZone:null,timeExtent:null};for(const{tile:s,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${s.id}] GraphicsView fetchResources`,e);const i=r.getCursor();for(;i.next();)for(const e of i.getMeshWriters())e.enqueueRequest(this._resourceProxy,i,s.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){const t={timeZone:null,timeExtent:null},s=new T(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());for(const i of r.getMeshWriters())i.write(s,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(t),e.tile.level);s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){const t=e.displayId,s=this._highlightFlagsByObjectId.get(e.objectId)??0;this._attributeStore.setData(t,0,0,s|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter(e=>"text"===e.type);if(s.length>0){const r=await this._getTextResources(e,s);return void(e.symbolResource={symbolInfo:t,textInfo:r})}e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r)}}async _convertToCIMSymbol(e){const t=g(e);return"web-style"===t.type?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:["cim","web"]})):t}async _createLinearCIM(e){return await y.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const s=this.container.instanceStore,r=this.view.stage.meshWriterRegistry,i=await R(e,t,s);return Promise.all(i.map(e=>r.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.consumePromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new v(e,s,t[0],t[3]);return r.presenting=!0,this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=P.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.update({type:"append",append:i,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return t?l(t)?w:p(t)||u(t)?S:this.defaultPointSymbolEnabled?b:null:this.defaultPointSymbolEnabled?b:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""}),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],k.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],k.prototype,"layerId",void 0),e([h({constructOnly:!0})],k.prototype,"requestUpdateCallback",void 0),e([h()],k.prototype,"container",void 0),e([h({constructOnly:!0})],k.prototype,"graphics",void 0),e([h()],k.prototype,"renderer",void 0),e([h()],k.prototype,"_updateTracking",void 0),e([h()],k.prototype,"updating",null),e([h()],k.prototype,"view",void 0),e([h()],k.prototype,"updateRequested",void 0),e([h()],k.prototype,"defaultPointSymbolEnabled",void 0),k=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],k);const A=k;export{A as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import f from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as g,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as b,errorPolylineSymbol2D as w,errorPolygonSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as M}from"../../engine/webgl/mesh/MeshData.js";import{createCalloutMeshWriterCoordinator as T}from"../../engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js";import{MeshWriterGroupCoordinator as R}from"../../engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js";import{ResourceProxy as j}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as x}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createMeshWriterGroup as C}from"../../engine/webgl/util/Matcher.js";import{createStorageSchema as U}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as F}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as q}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as G}from"../features/support/FeatureMetadata.js";import{GraphicsReader as O}from"../features/support/GraphicsReader.js";import P from"./GraphicStore.js";import{FeatureCommandQueue as k}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as A}from"../support/UpdateTracking2D.js";class E{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new E(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new E(e,s);for(const i of t)r.append(i);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||(this._reader=O.from(this.addedOrModified,this.tile,this.metadata)),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let D=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._highlightFlagsByObjectId=new Map,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new A({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new k({process:e=>{if("update"===e.type)return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new q({spatialReference:this.view.spatialReference,fields:new f}),this._attributeStore=new F({isLocal:!0,update:e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=U(null,[]);this._attributeStore.update(e,this._storage,null)}initialize(){this._initAttributeStore(),this._metadata=G.createGraphics(this.view.spatialReference),this._resourceProxy=new j({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")},fetchMesh:e=>{throw new Error("InternalError: Graphics do not support Mesh requests")}}),this.addHandles([n(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new P(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){return!this._attached||this._updateTracking.updating}hitTest(e,t){if(!this.view||this.view.suspended)return[];const{resolution:r,rotation:i}=this.view.state,o=this._graphicStore.hitTest(e,t,r,i),a=new Set(o),n=this.graphics.items.reduce((e,t)=>(a.has(t.uid)&&e.set(t.uid,t),e),new Map);return o.map(e=>n.get(e)).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlightFilters(e){this._highlightFlagsByObjectId.clear();for(const{order:t,filters:s}of e){const e=1<<t;for(const t of s)for(const s of t.objectIds??[]){const t=this._highlightFlagsByObjectId.get(s)??0;this._highlightFlagsByObjectId.set(s,t|e)}}if(this.container.setHighlightActive(this._highlightFlagsByObjectId.size>0),this._attached)for(const t of this._graphicStore.items())this._setFilterState(t);this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{if(has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;const e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(const s of e.updated)this.container.restartAnimation(s.objectId);if(!e.hasAnyUpdate())return void this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){E.getOrCreate(r,t,this._metadata).append(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const i of e){E.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){E.getOrCreate(i,t,this._metadata).append(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){E.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _densifyItemsForDisplay(e){const t=new Map;for(const s of e)for(const e of s.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){const t={timeZone:null,timeExtent:null};for(const{tile:s,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${s.id}] GraphicsView fetchResources`,e);const i=r.getCursor();for(;i.next();)for(const e of i.getMeshWriters().writers)e.enqueueRequest(this._resourceProxy,i,s.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){const t={timeZone:null,timeExtent:null},s=new M(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());new R({out:s,proxy:this._resourceProxy,feature:r,options:e.tile.createArcadeEvaluationOptions(t),level:e.tile.level,coordinatorFactories:[T]}).coordinateAndWrite(r.getMeshWriters()),s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){const t=e.displayId,s=this._highlightFlagsByObjectId.get(e.objectId)??0;this._attributeStore.setData(t,0,0,s|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter(e=>"text"===e.type);if(s.length>0){const r=await this._getTextResources(e,s);return void(e.symbolResource={symbolInfo:t,textInfo:r})}e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r,"text"===t.type)}}async _convertToCIMSymbol(e){const t=g(e);return"web-style"===t.type?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:["cim","web"]})):t}async _createLinearCIM(e){return await y.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t,s){a(this._controller.signal);const r=this.container.instanceStore,i=this.view.stage.meshWriterRegistry,o=await x(e,t,r,s),n=await Promise.all(o.map(e=>i.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)));return C(n,o)}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.consumePromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new v(e,s,t[0],t[3],this.container.labelStore);return r.presenting=!0,this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=E.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.update({type:"append",append:i,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return t?l(t)?w:p(t)||u(t)?S:this.defaultPointSymbolEnabled?b:null:this.defaultPointSymbolEnabled?b:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""}),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],D.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],D.prototype,"layerId",void 0),e([h({constructOnly:!0})],D.prototype,"requestUpdateCallback",void 0),e([h()],D.prototype,"container",void 0),e([h({constructOnly:!0})],D.prototype,"graphics",void 0),e([h()],D.prototype,"renderer",void 0),e([h()],D.prototype,"_updateTracking",void 0),e([h()],D.prototype,"updating",null),e([h()],D.prototype,"view",void 0),e([h()],D.prototype,"updateRequested",void 0),e([h()],D.prototype,"defaultPointSymbolEnabled",void 0),D=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],D);const V=D;export{V as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{rad2deg as e}from"../../../../../core/mathUtils.js";import t from"../../../../../geometry/Point.js";import{normalizeTransform as r,quantizeY as n,quantizeX as
|
|
2
|
+
import{rad2deg as e}from"../../../../../core/mathUtils.js";import t from"../../../../../geometry/Point.js";import{normalizeTransform as r,quantizeY as n,quantizeX as i}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as o}from"../../../../../layers/graphics/featureConversionUtils.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{DimensionRealFieldName as s,projectLinearDimensionPoints as u,normalizeExtensionAngle as y,angleFromXAxis as l}from"./dimensionUtils.js";import{getAttributeValue as p,parseElement as f,reprojectAndQuantize as c,quantizeYf as g,quantizeXf as d}from"./utils.js";import{featureFields as b}from"./virtualFields.js";function N(e){const t=e.readAttribute("element");if(!t)return null;const n=e.getInTransform()??e.getDisplayTransform();if(!n)throw new Error("Quantization transform is required to read annotation features.");if(!e.geometryType)return null;const i=e.metadata.outSpatialReference,o=e.metadata.attributeSpatialReference??e.metadata.spatialReference??i,a=r(n),m=f(t),{geometry:s}=m;if(!s)return null;const u=c(s,o,i,a);if(!u)return null;const y=h(m,o,i,a),l=T(m),p={annotationGeometryType:l,annotationGraphic:m,attributes:{},geometryOverride:{geometry:u,geometryType:g(l),absoluteCalloutAnchor:y}};for(const r of b)r.setOnFeature(p,m);function g(e){switch(e){case"line":return"esriGeometryPolyline";case"multipoint":return"esriGeometryMultipoint";case"point":return"esriGeometryPoint"}}return p}function h(e,r,n,i){const[o,a]=e.anchorPoint;if(!o?.trim()||!a?.trim())return;const s=Number(o),u=Number(a);if(!Number.isFinite(s)||!Number.isFinite(u))return;const y=m(new t({x:s,y:u,spatialReference:r}),r,n);return{x:d(i,y.x),y:g(i,y.y)}}function x(o){const f=o.getInTransform()??o.getDisplayTransform();if(!f)throw new Error("Quantization transform is required to read dimension features.");const c=o.geometryType;if(!c)return null;const g={...o.readAttributes()},d=o.metadata.outSpatialReference,b=o.metadata.attributeSpatialReference??o.metadata.spatialReference??d,N=r(f),h={x:Number(p(s.beginX,g)),y:Number(p(s.beginY,g)),spatialReference:b},x={x:Number(p(s.endX,g)),y:Number(p(s.endY,g)),spatialReference:b},w={x:Number(p(s.dimX,g)),y:Number(p(s.dimY,g)),spatialReference:b};if(isNaN(h.x)||isNaN(h.y)||isNaN(x.x)||isNaN(x.y))return console.error(`Feature with ${s.objectId}=${p(s.objectId,g)} is missing valid begin, end, or dimension points and will be skipped.`),null;(isNaN(w.x)||isNaN(w.y))&&(w.x=h.x,w.y=h.y);const T=m(new t(h),b,d),j=m(new t(x),b,d),R=m(new t(w),b,d),P=[T,j,R],_=j.x-T.x,E=j.y-T.y;let M=Math.PI/2;0!==_?M=Math.atan2(E,_):E<0&&(M=-Math.PI/2);let G=Math.sqrt(_*_+E*E);if(1===Number(p(s.dimType,g))){const e=u([T.x,T.y],[j.x,j.y],[R.x,R.y],y(p(s.extAngle,g)));if(e){const t=e.endDimensionPoint[0]-e.beginDimensionPoint[0],r=e.endDimensionPoint[1]-e.beginDimensionPoint[1];G=Math.sqrt(t*t+r*r),M=l([t,r])}}const I=p(s.textX,g),S=p(s.textY,g);if(null!=I&&null!=S){const e=new t({x:Number(I),y:Number(S),spatialReference:b}),r=m(e,b,d);P.push(r)}const D=P.map(e=>({x:i(N,e.x),y:n(N,e.y)})).flatMap(e=>[e.x,e.y]);return g.__SYSTEM_LENGTH__=G,g.__DIMENSION_ANGLE__=360-e(M),{attributes:g,geometryOverride:{geometry:new a([D.length],D),geometryType:c}}}function w(e,t){const{geometry:r,geometryType:n}=t.geometryOverride,i=o(r,n,!1,!1);return i?{attributes:{...e.readAttributes(),...t.attributes},centroid:null,geometry:i}:null}function T(e){if(e.geometry){if("custom-two-point"===e.geometry.type)return"line";if("custom-multipoint"===e.geometry.type)return"multipoint";if("geometry-bag"===e.geometry.type){if("custom-multipoint"===e.geometry.geometries[0].type)return"multipoint";throw new Error("Unable to determine geometry type from annotation graphic")}if("custom-point"===e.geometry.type)return"point";if("polyline"===e.geometry.type)return"line";if("point"===e.geometry.type)return"point";throw new Error("Unable to determine geometry type from annotation graphic")}throw new Error("Unable to determine geometry type from annotation graphic")}export{N as createAnnotationMatcherFeatureInfo,x as createDimensionMatcherFeatureInfo,T as getAnnotationGeometryType,w as mixFeature};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{GeometryCursor as t}from"../../../../../geometry/GeometryCursor.js";import{createTileObjectId as e}from"./TileObjectId.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,r){return new n(t,r)}}class n{constructor(t,e){this._cursor=t,this._context=e}next(){const r=this._cursor.next();if(!r||0===r.totalSize)return null;const{matcher:n,target:
|
|
2
|
+
import{GeometryCursor as t}from"../../../../../geometry/GeometryCursor.js";import{createTileObjectId as e}from"./TileObjectId.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,r){return new n(t,r)}}class n{constructor(t,e){this._cursor=t,this._context=e}next(){const r=this._cursor.next();if(!r||0===r.totalSize)return null;if(this._context.calloutBodyBounds)return r;const{matcher:n,target:o,tileKey:c}=this._context,s=n&&o&&null!=c?n.getMatcherGeometryOverride(e(c,o.getObjectId())):null;if(!s)return r;const i=t.fromOptimizedCIM(s.geometry.clone(),s.geometryType);return i.invertY(),i}}export{r as PrivateMatcherGeometryOverrideEffect};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../core/Logger.js";import t from"../../../../../core/pbf.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{base64ToArrayBuffer as
|
|
2
|
+
import e from"../../../../../core/Logger.js";import t from"../../../../../core/pbf.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{base64ToArrayBuffer as r}from"../../../../../support/base64Utils.js";function o(e){const a={leader:[],anchorPoint:[],fontVariations:[]},o=r(e.toString()),s=new t(new Uint8Array(o),new DataView(o));for(;s.next();)switch(s.tag()){case 1:a.version=n(s);break;case 2:a.bloated=s.getBool();break;case 3:if(a.bloated){const e=i(n(s));e&&l(a,e)}else s.skip();break;case 4:a.geometryStorageType=s.getEnum();break;case 5:a.bloated?s.skip():a.geometry=u(n(s),a.geometryStorageType);break;case 6:a.bloated?s.skip():a.text=n(s);break;case 7:a.bloated?s.skip():a.symbolID=s.getUInt32();break;case 8:a.textAngle=s.getDouble();break;case 9:a.xOffset=s.getDouble();break;case 10:a.yOffset=s.getDouble();break;case 11:a.horizontalAlignment=s.getEnum();break;case 12:a.verticalAlignment=s.getEnum();break;case 13:a.flipAngle=s.getDouble();break;case 14:s.skip(),a.leader=[];break;case 15:a.anchorPoint.push(n(s));break;case 16:a.size=s.getDouble();break;case 17:a.color=n(s);break;case 18:a.characterSpacing=s.getDouble();break;case 19:a.characterWidth=s.getDouble();break;case 20:a.wordSpacing=s.getDouble();break;case 21:a.leading=s.getDouble();break;case 22:a.fontFamilyName=n(s);break;case 23:a.fontStyleName=n(s);break;case 24:a.underline=s.getBool();break;case 25:a.callout=n(s);break;case 26:s.skip(),a.fontVariations=[];break;default:s.skip()}return a}function n(e){return s(e.getString()||"")}function s(e){return e.replaceAll(/\r\n?/g,"\n").replaceAll(/\p{Cc}/gu,e=>"\n"===e?e:"")}function i(e){return e?JSON.parse(e):null}function p(e){if(e?.ga){const t=e?.ga?.map(e=>p(e)).filter(e=>e);return{type:"geometry-bag",geometries:t}}const t=e?.g?.points;if(t)return{type:"custom-multipoint",points:t};const r=a(e);return r&&("point"===r.type||"polyline"===r.type)?r:void 0}function c(t){return"x"in t&&"y"in t?{type:"custom-point",x:t.x,y:t.y}:"paths"in t?{type:"custom-two-point",from:t.paths[0][0],to:t.paths[0][1]}:(e.getLogger("esri.layers.AnnotationFeatureLayer").warnOnce("CIMTextGraphic.shape must be a point or a polyline."),{type:"custom-point",x:0,y:0})}function l(e,t){e.symbol=t.symbol,e.text=t.text,e.geometry=c(t.shape)}function u(e,t){if(!e||null==t)return;if(1===t||4===t){const t=e.split(",").map(e=>parseFloat(e));return{type:"custom-point",x:t[0],y:t[1]}}if(2===t||5===t){const t=e.split(";").map(e=>e.split(",").map(e=>parseFloat(e)));return{type:"custom-two-point",from:[t[0][0],t[0][1]],to:[t[1][0],t[1][1]]}}if(3===t||6===t){return{type:"custom-multipoint",points:e.split(";").map(e=>e.split(",").map(e=>parseFloat(e)))}}return p(JSON.parse(e))}export{u as parseAnnotationGeometry,p as parseAnnotationGeometryJson,o as parseAnnotationGraphic,i as parseTextGraphic};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{featureFields as
|
|
2
|
+
import{nonPointFeatureFields as e,featureFields as t}from"./virtualFields.js";function i(i,r){let o,n,a=[];if("line"===r){let t;switch(o="CIMLineSymbol",(i={...i,angle:0}).horizontalAlignment){case"Center":case"Justify":default:t=.5;break;case"Left":t=0;break;case"Right":t=1}n={type:"CIMMarkerPlacementAtRatioPositions",angleToLine:!0,placePerPart:!1,keepUpright:!1,positionArray:[t],flipFirst:!1},a=e}else"multipoint"===r?(o="CIMLineSymbol",n={type:"PrivatePlacementMultipoint"},a=e):(o="CIMPointSymbol",n=void 0,a=t);const l={type:"CIMSymbolReference",primitiveOverrides:[],symbol:{type:o,symbolLayers:[{type:"CIMVectorMarker",markerPlacement:n,enable:!0,size:40,colorLocked:!1,anchorPointUnits:"Relative",frame:{xmin:-20,ymin:-20,xmax:20,ymax:20},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:i}],scaleSymbolsProportionally:!0,respectFrame:!0}]}};for(const e of a)e.addPrimitiveOverride(l);return{data:l}}function r(e){return{point:i(e,"point"),line:i(e,"line"),multipoint:i(e,"multipoint")}}function o(e){const t={};for(const i of e){const e=i.iD??0,{symbol:o}=i,n=r(o);t[e]=n}return t}export{i as getCIMSymbol,o as getCIMSymbols,r as getTrio};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
import{createMeshWriterGroup as e}from"../../../engine/webgl/util/Matcher.js";const o={type:"CIMSolidStroke",enable:!0,color:[255,0,0,255],width:1.5};async function t(o,t,n){const s=r(n);if(!s)return e([],[]);const i=await t.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:s});return o.createMeshWriters(i?.meshes||[])}function r(e){return"esriGeometryPolygon"!==e?(e&&console.error(`Annotation/dimension debug overlay expects polygon footprint geometry, but received ${e}.`),null):{type:"CIMSymbolReference",symbol:n()}}function n(){return{type:"CIMPolygonSymbol",symbolLayers:[{...o}]}}export{t as createDebugWriters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fixUnsupportedCIM as e}from"../../../../../symbols/cim/supportUtils.js";let t=0;class i{constructor(e,t,i,r){this.cimPropertyName=e,this.findTargetNode=i,this.getValue=r,this.realFieldName=`__virtual_fi_${t}`}setOnFeature(e,t){const i=this.getValue(t);e.attributes[this.realFieldName]=i}addPrimitiveOverride(e){const i=this.findTargetNode(e.symbol);let{primitiveName:r}=i;r||(t++,r=`primitive_${t}`,i.primitiveName=r);const s={type:"CIMPrimitiveOverride",primitiveName:r,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realFieldName};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(s)}}const r=new i("TextString","text",e=>e.symbolLayers[0].markerGraphics[0],e=>e.text),s=new i("Color","color",e=>e.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type),t=>{const i=t.color||"#000000";if(i.startsWith("#"))return i;if(i.startsWith("rgb"))return i;const r=JSON.parse(i),s=e(r);return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/255})`}),n=new i("Rotation","rotation",e=>e.symbolLayers[0],e=>null!=e.textAngle?-e.textAngle:void 0),o=new i("OffsetX","offsetX",e=>e.symbolLayers[0],e=>e.xOffset),l=new i("OffsetY","offsetY",e=>e.symbolLayers[0],e=>e.yOffset);class a{constructor(e,t,i){this.cimPropertyName=e,this.findTargetNode=t,this.getValue=i}setOnSymbol(e,t){const i=this.getValue(t);if(null==i)return;this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=i}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}const m=new a("VerticalAlignment",e=>e,e=>null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]),f=
|
|
2
|
+
import{fixUnsupportedCIM as e}from"../../../../../symbols/cim/supportUtils.js";let t=0;class i{constructor(e,t,i,r){this.cimPropertyName=e,this.findTargetNode=i,this.getValue=r,this.realFieldName=`__virtual_fi_${t}`}setOnFeature(e,t){const i=this.getValue(t);e.attributes[this.realFieldName]=i}addPrimitiveOverride(e){const i=this.findTargetNode(e.symbol);let{primitiveName:r}=i;r||(t++,r=`primitive_${t}`,i.primitiveName=r);const s={type:"CIMPrimitiveOverride",primitiveName:r,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realFieldName};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(s)}}const r=new i("TextString","text",e=>e.symbolLayers[0].markerGraphics[0],e=>e.text),s=new i("Color","color",e=>e.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type),t=>{const i=t.color||"#000000";if(i.startsWith("#"))return i;if(i.startsWith("rgb"))return i;const r=JSON.parse(i),s=e(r);return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/255})`}),n=new i("Rotation","rotation",e=>e.symbolLayers[0],e=>null!=e.textAngle?-e.textAngle:void 0),o=new i("OffsetX","offsetX",e=>e.symbolLayers[0],e=>e.xOffset),l=new i("OffsetY","offsetY",e=>e.symbolLayers[0],e=>e.yOffset);class a{constructor(e,t,i){this.cimPropertyName=e,this.findTargetNode=t,this.getValue=i}setOnSymbol(e,t){const i=this.getValue(t);if(null==i)return;this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=i}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}const m=new a("VerticalAlignment",e=>e,e=>null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]),f=new a("HorizontalAlignment",e=>e,e=>null==e.horizontalAlignment?null:["Left","Right","Center","Justify"][e.horizontalAlignment]),y=new a("FontFamilyName",e=>e,e=>e.fontFamilyName),c=new a("FontStyleName",e=>e,e=>e.fontStyleName),u=new a("Height",e=>e,e=>e.size),p=new a("Underline",e=>e,e=>e.underline),h=[r,s,o,l],d=[...h,n],g=[f,m,y,c,u,p];function N(e){let t=!1;for(const i of g)t=t||null!=i.getValue(e);return t}export{d as featureFields,N as hasSymbolFields,h as nonPointFeatureFields,g as symbolFields};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import o from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as e}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{DragZoomBox as g}from"./handlers/DragZoomBox.js";import{GamepadNavigation as h}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as l}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as u}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as c}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as v}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as w}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as f}from"./handlers/TwoFingerTilt.js";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import o from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as e}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{DragZoomBox as g}from"./handlers/DragZoomBox.js";import{GamepadNavigation as h}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as l}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as u}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as c}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as v}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as w}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as f}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as _}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundNavigation as y}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as D}from"../../input/BrowserEventSource.js";import{InputManager as j,ViewEventPriorities as N}from"../../input/InputManager.js";import{PreventContextMenu as P}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as A}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as M}from"../../input/handlers/support.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as R}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as T}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as k}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as I}from"../../input/recognizers/VerticalTwoFingerDrag.js";const S="modeDependentNavigation";let G=class extends o{constructor(){super(...arguments),this.mode="default",this._keys={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"]},modifier:["b","B"],zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]},precisionPanModifier:"Alt",coarsePanModifier:"Shift"},this._updateMode=({mode:t,dragPrimary:o,dragSecondary:e,dragTertiary:r})=>{"pro"===t&&(e="zoom",r="pan"===o?"rotate":"pan");const i={dragPrimary:o,dragSecondary:e,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=M("pan",i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=M("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=M("rotate",i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=M("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=M("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(t){const{actionMap:o}=this.view.navigation;o.dragPrimary=t,o.dragSecondary="pan"===t?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=e(this._inputManager),this._source=e(this._source)}connect(){const t=this.view;this._source=new D(this.view.surface,t.input);const o=[new R,new T,new k,new b(this.view.navigation),new I],e=new j({eventSource:this._source,recognizers:o});this._inputManager=e,e.installHandlers("prevent-context-menu",[new P],N.INTERNAL),e.installHandlers("prevent-touch-text-selection-gesture",[new A(this.view)],N.INTERNAL),this._modeDragPan=new v(t,["primary"]),this._modeDragRotate=new m(t,["secondary"],0),this._modeDragZoom=new p(t,["tertiary"],this._keys.fov),this._modeKeyboardNavigation=new l(t,this._keys);const a=[new w(t),new d(t),new h(t),new u(t,this._keys.fov),new c(t),new g(t),new m(t,["primary"],1,this._keys.modifier),new y(t,["secondary"],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new f(t)];this._modeGroundNavigation=new y(t,["primary"]),this._modeGroundNavigationDragRotate=new m(t,["secondary"],1);const s=[this._modeGroundNavigation,new u(t,this._keys.fov),new y(t,["tertiary"]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new _(t)];this.view.viewEvents.connect(e),this.addHandles([r(()=>this.view.navigation.mode,t=>{switch(e.hasHandlers(S)&&e.uninstallHandlers(S),t.type){case"default":e.installHandlers(S,a,N.INTERNAL);break;case"ground":e.installHandlers(S,s,N.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,t=>{this._source.browserTouchPanningEnabled=!t},i),r(()=>{const{actionMap:t}=this.view.navigation,{dragPrimary:o,dragSecondary:e,dragTertiary:r}=t;return{mode:this.mode,dragPrimary:o,dragSecondary:e,dragTertiary:r}},this._updateMode,n)])}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}get test(){}};t([a()],G.prototype,"view",void 0),t([a({type:["default","pro"]})],G.prototype,"mode",void 0),t([a({readOnly:!0})],G.prototype,"updating",null),t([a()],G.prototype,"latestPointerInfo",null),t([a()],G.prototype,"latestPenInfo",null),t([a()],G.prototype,"multiTouchActive",null),t([a()],G.prototype,"_inputManager",void 0),G=t([s("esri.views.3d.input.SceneInputManager")],G);const z=G;export{z as default};
|