@arcgis/core 6.0.0-next.27 → 6.0.0-next.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Map.d.ts +6 -0
- package/analysis/AreaMeasurementAnalysis.d.ts +4 -2
- package/analysis/DirectLineMeasurementAnalysis.d.ts +8 -4
- package/arcgisGlobal.d.ts +0 -2
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/131185d26343a997495e.js +1 -0
- package/assets/esri/core/workers/chunks/144bad0c2415c345736a.js +1 -0
- package/assets/esri/core/workers/chunks/176d0a06ebff5a29dedf.js +1 -0
- package/assets/esri/core/workers/chunks/{b0ca81a07cff25df19d2.js → 176d75e76318bfc25a53.js} +1 -1
- package/assets/esri/core/workers/chunks/18776a130d96879a68b1.js +1 -0
- package/assets/esri/core/workers/chunks/{e35641a3a4da8cfbcf54.js → 189321d88026bd7e6d3e.js} +1 -1
- package/assets/esri/core/workers/chunks/18e7fa4d3e0b1a084cc6.js +1 -0
- package/assets/esri/core/workers/chunks/{1168bc5c9f0a7e1f63a2.js → 1989410a618865f02dec.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c0cb214fedb29487eef.js → 199a7f97916679e0257c.js} +1 -1
- package/assets/esri/core/workers/chunks/1c406ab2bf99ac563316.js +1 -0
- package/assets/esri/core/workers/chunks/1d96fbad881a7d14a950.js +1 -0
- package/assets/esri/core/workers/chunks/{42d44c7d532df5ee70e9.js → 1deca3de77b1a9a07da4.js} +1 -1
- package/assets/esri/core/workers/chunks/{45f826554499c38968c6.js → 1ee4df0fd61440cb5f02.js} +1 -1
- package/assets/esri/core/workers/chunks/22e73501e1435a896826.js +1 -0
- package/assets/esri/core/workers/chunks/25657f70c5f04a4ed978.js +1 -0
- package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +1 -0
- package/assets/esri/core/workers/chunks/{56e903ccef66cbe18f92.js → 2cd60fd062d954322c1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad96132bc89671e595f3.js → 2d3e0e4442dbc6ec6def.js} +1 -1
- package/assets/esri/core/workers/chunks/2de4296590bf9f9e9add.js +1 -0
- package/assets/esri/core/workers/chunks/2f5d014d6a72108b0b3a.js +1 -0
- package/assets/esri/core/workers/chunks/{0363d29fc665d169ebc4.js → 3105336a05f38a95ebea.js} +1 -1
- package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +1 -0
- package/assets/esri/core/workers/chunks/3aafdb905c697bc9b1ad.js +1 -0
- package/assets/esri/core/workers/chunks/40c2674dae73f0942751.js +1 -0
- package/assets/esri/core/workers/chunks/418addce122dbb8897b4.js +1 -0
- package/assets/esri/core/workers/chunks/4419732baf3459a80e6d.js +1 -0
- package/assets/esri/core/workers/chunks/4976f5567fc7f1b63d10.js +1 -0
- package/assets/esri/core/workers/chunks/4e17665dd9048c300d87.js +1 -0
- package/assets/esri/core/workers/chunks/5396b6e99a0546a25d19.js +1 -0
- package/assets/esri/core/workers/chunks/53c7510df09b71ab5646.js +1 -0
- package/assets/esri/core/workers/chunks/561c48cb4d49b150765b.js +1 -0
- package/assets/esri/core/workers/chunks/{d90a3bfd45b5ed4092e0.js → 590fe0f56bc4c33a50e7.js} +1 -1
- package/assets/esri/core/workers/chunks/5bb6c255bdc8aa9ba23e.js +1 -0
- package/assets/esri/core/workers/chunks/5f1cb79aec9c4a9b7ddc.js +29 -0
- package/assets/esri/core/workers/chunks/{23a4806b4cdf7cc32e4d.js → 5f787809b74eed7b9a91.js} +1 -1
- package/assets/esri/core/workers/chunks/636e9c4ac1f9ae98f9d1.js +1 -0
- package/assets/esri/core/workers/chunks/654f5441227579d2b6b4.js +1 -0
- package/assets/esri/core/workers/chunks/692f0093c444fcc752b5.js +1 -0
- package/assets/esri/core/workers/chunks/69627b2634da64dd885f.js +1 -0
- package/assets/esri/core/workers/chunks/6a7de221cea4426cb490.js +1 -0
- package/assets/esri/core/workers/chunks/7030a4d0714a35995a58.js +1 -0
- package/assets/esri/core/workers/chunks/72d20d3957d612f86431.js +1 -0
- package/assets/esri/core/workers/chunks/7862abd24fb5c3b12e6b.js +1 -0
- package/assets/esri/core/workers/chunks/7a0b4dc0cda190367a39.js +1 -0
- package/assets/esri/core/workers/chunks/{ab1660f5f8a5268c2fac.js → 84038dd85005fea413eb.js} +1 -1
- package/assets/esri/core/workers/chunks/849f446c718e892f39ce.js +1 -0
- package/assets/esri/core/workers/chunks/{8ac2098ecdc40ad41055.js → 8502274806ea52308822.js} +1 -1
- package/assets/esri/core/workers/chunks/865cebc5c982c040ab6f.js +1 -0
- package/assets/esri/core/workers/chunks/{76196c414e48834f7b92.js → 8f008eedb11685ee2048.js} +1 -1
- package/assets/esri/core/workers/chunks/90d797ab82d4a68ba32f.js +1 -0
- package/assets/esri/core/workers/chunks/9184c947cdefe06bf551.js +1 -0
- package/assets/esri/core/workers/chunks/9976eaa81085c0d17e14.js +1 -0
- package/assets/esri/core/workers/chunks/{177f353ce72133e2eeed.js → 9c2436464b7dfd666678.js} +1 -1
- package/assets/esri/core/workers/chunks/a125650edbed802e419a.js +1 -0
- package/assets/esri/core/workers/chunks/{23fd4de56de352f63e2d.js → a2196a49f89d57a0a1c7.js} +1 -1
- package/assets/esri/core/workers/chunks/ad21757d78e372fa2ed6.js +1 -0
- package/assets/esri/core/workers/chunks/b01688ccc29d33bfc82d.js +1 -0
- package/assets/esri/core/workers/chunks/b5eff28cf482d920b9ea.js +1 -0
- package/assets/esri/core/workers/chunks/{04ecf15524ff3838c01c.js → ba4520ddcb6a49988da6.js} +1 -1
- package/assets/esri/core/workers/chunks/be55771758e4bcef0976.js +1 -0
- package/assets/esri/core/workers/chunks/bead830a677690eeb6fb.js +1 -0
- package/assets/esri/core/workers/chunks/c131e0dd180a4c10e12e.js +1 -0
- package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +1 -0
- package/assets/esri/core/workers/chunks/c4f78a481f43cfae7b63.js +1 -0
- package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +1 -0
- package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +1 -0
- package/assets/esri/core/workers/chunks/c9feffb9884cfed52c4b.js +1 -0
- package/assets/esri/core/workers/chunks/cc97e4fd0dacad970a23.js +1 -0
- package/assets/esri/core/workers/chunks/ce324dde6d7daea33638.js +1 -0
- package/assets/esri/core/workers/chunks/d1d6154b4af1c9cc497b.js +1 -0
- package/assets/esri/core/workers/chunks/d3c3fb079ad97970f834.js +1 -0
- package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +1 -0
- package/assets/esri/core/workers/chunks/dc2f93453dfa40f623ab.js +1 -0
- package/assets/esri/core/workers/chunks/dcf6024dc19428ff2b9d.js +1 -0
- package/assets/esri/core/workers/chunks/dd30b02c5978c1c5f511.js +1 -0
- package/assets/esri/core/workers/chunks/de3f140058aa0b907b65.js +1 -0
- package/assets/esri/core/workers/chunks/df375d1b0dab5ecbd1be.js +1 -0
- package/assets/esri/core/workers/chunks/{ef2c3febcceedc44b3ac.js → dfd4782b11d6fdca0492.js} +1 -1
- package/assets/esri/core/workers/chunks/{48cc58890fddbcf69cef.js → e121d15b883184ee83e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{67e06d606c7fd2064adf.js → e2c6cd8dac01e129ccfe.js} +1 -1
- package/assets/esri/core/workers/chunks/e3b212f8af448ec29eef.js +1 -0
- package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +1 -0
- package/assets/esri/core/workers/chunks/e480e7d5f40049a2053b.js +1 -0
- package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +1 -0
- package/assets/esri/core/workers/chunks/edd36a1fc80b1d29907e.js +1 -0
- package/assets/esri/core/workers/chunks/ee0dc906cc7979080329.js +1 -0
- package/assets/esri/core/workers/chunks/f07fb9b3fa30d7ee1681.js +1 -0
- package/assets/esri/core/workers/chunks/f09bc86cd52224febfcb.js +1 -0
- package/assets/esri/core/workers/chunks/{037c67ef5c4398d5954d.js → f2dab9fcd90ce38ae3d1.js} +1 -1
- package/assets/esri/core/workers/chunks/f39c700f3db7db52b522.js +1 -0
- package/assets/esri/core/workers/chunks/f3b4159c0722df8ffe13.js +1 -0
- package/assets/esri/core/workers/chunks/f3dc0bc0e00635855a7a.js +1 -0
- package/assets/esri/core/workers/chunks/f45064066e1ab041a0b2.js +1 -0
- package/assets/esri/core/workers/chunks/f7398cfd8bbd041bd635.js +1 -0
- package/assets/esri/core/workers/chunks/f9dc38761b314d33890f.js +1 -0
- package/assets/esri/core/workers/chunks/fe6dcb21570395e46ce8.js +1 -0
- package/assets/esri/core/workers/chunks/{00580a68835aac653038.js → fefdd10bdd5a4c8d8ed0.js} +45 -48
- package/assets/esri/core/workers/chunks/ffe49d9e7df081bef4a5.js +1 -0
- package/assets/esri/themes/base/_core.scss +0 -2
- 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/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/Component.glsl.js +51 -54
- package/chunks/EmissionComposite.glsl.js +1 -1
- package/chunks/Fog.glsl.js +1 -1
- package/chunks/GaussianSplat.glsl.js +65 -21
- package/chunks/GaussianSplatDepth.glsl.js +53 -4
- package/chunks/GaussianSplatShadow.glsl.js +83 -19
- package/chunks/GlobalIllumination.glsl.js +2 -17
- package/chunks/LineMarker.glsl.js +32 -31
- package/chunks/OITAddEmission.glsl.js +1 -1
- package/chunks/RasterColorizer.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +34 -34
- package/chunks/Terrain.glsl.js +3 -4
- package/chunks/Water.glsl.js +22 -23
- package/config.d.ts +12 -9
- package/config.js +1 -1
- package/form/FormTemplate.d.ts +1 -1
- package/form/elements/AttachmentElement.d.ts +2 -0
- package/form/elements/FieldElement.d.ts +2 -2
- package/form/elements/FieldElement.js +1 -1
- package/form/elements/RelationshipElement.d.ts +1 -1
- package/form/elements/TextElement.d.ts +2 -2
- package/form/elements/UtilityNetworkAssociationsElement.d.ts +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
- package/form/elements/inputs/inputUtils.js +1 -1
- package/form/elements/inputs/types.d.ts +19 -0
- package/form/elements/inputs.d.ts +3 -2
- package/form/elements/inputs.js +1 -1
- package/geometry/operators/containsOperator.d.ts +1 -1
- package/geometry/operators/densifyOperator.d.ts +1 -1
- package/geometry/operators/differenceOperator.d.ts +6 -4
- package/geometry/operators/distanceOperator.d.ts +1 -1
- package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
- package/geometry/operators/graphicBufferOperator.d.ts +6 -6
- package/geometry/operators/integrateOperator.d.ts +2 -2
- package/geometry/operators/intersectsOperator.d.ts +3 -3
- package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
- package/geometry/operators/locateBetweenOperator.d.ts +2 -2
- package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
- package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
- package/geometry/operators/projectOperator.d.ts +2 -2
- package/geometry/operators/proximityOperator.d.ts +15 -15
- package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
- package/geometry/operators/simplifyOperator.d.ts +2 -2
- package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
- package/geometry/operators/support/Transformation.d.ts +8 -8
- package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
- package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
- package/geometry/operators/withinOperator.d.ts +3 -3
- package/interfaces.d.ts +0 -14
- package/kernel.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +2 -2
- package/layers/ParquetLayer.d.ts +1 -1
- package/layers/VideoLayer.d.ts +5 -5
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/rotationUtils.js +2 -0
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/save/parquetLayerUtils.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/package.json +2 -2
- package/popup/FeaturesModel.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/rest/featureService/FeatureService.d.ts +0 -5
- package/rest/networks/support/TraceLocation.d.ts +2 -1
- package/rest/networks/support/TraceResult.d.ts +0 -4
- package/rest/support/OutDistance.d.ts +0 -1
- package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/support/BasemapStyle.d.ts +2 -2
- package/symbols/cim/types.d.ts +7 -9
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js +1 -1
- package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
- package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +2 -0
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/support/projectionUtils.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +15 -2
- package/views/3d/environment/VirtualLighting.d.ts +15 -2
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/ground/GroundMouseWheelMove.js +2 -0
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/navigation/Navigation3D.js +1 -1
- package/views/3d/state/controllers/GroundMouseWheelController.js +2 -0
- package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/terrain/BlendLayers.glsl.js +1 -1
- package/views/3d/terrain/RasterColorizer.glsl.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +23 -26
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +18 -21
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js +7 -8
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +10 -12
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +22 -25
- package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +6 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/getLocalUp.glsl.js +4 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/{TileBackground.glsl.js → blendLayers.glsl.js} +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginContext.js +2 -0
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +3 -3
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeUtil.glsl.js +30 -35
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/EmissiveTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +70 -108
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/VideoView.d.ts +10 -0
- package/views/VideoView.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawScreenTool.js +1 -1
- package/views/input/types.d.ts +2 -4
- package/views/interactive/options/LabelOptions.d.ts +5 -5
- package/views/interactive/options/SnappingOptions.d.ts +2 -2
- package/views/layers/LayerView.d.ts +10 -2
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +2 -3
- package/widgets/Editor/EditorViewModel.d.ts +10 -12
- package/widgets/Editor/VisibleElements.d.ts +4 -0
- package/widgets/Editor.d.ts +2 -0
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/ImageMeasurementWorker.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementWorkerUtils.js +2 -0
- package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
- package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
- package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Search/LayerSearchSource.d.ts +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +4 -0
- package/widgets/Sketch.d.ts +2 -0
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/010f57ec7fdbedf78d02.js +0 -1
- package/assets/esri/core/workers/chunks/0487e1d7a7cecf7c1c25.js +0 -1
- package/assets/esri/core/workers/chunks/09300e74e5b014ce6269.js +0 -1
- package/assets/esri/core/workers/chunks/0bd04bcd4b2710838d48.js +0 -1
- package/assets/esri/core/workers/chunks/0d9c4c6c571ce26d356b.js +0 -1
- package/assets/esri/core/workers/chunks/112ed86f812e4400a7e0.js +0 -1
- package/assets/esri/core/workers/chunks/151e5799ede763a03ee2.js +0 -1
- package/assets/esri/core/workers/chunks/173f89c55a5c79ff065b.js +0 -1
- package/assets/esri/core/workers/chunks/2447d2e2a4a3ab8fcf94.js +0 -1
- package/assets/esri/core/workers/chunks/2a36fe3f3f257a779a1b.js +0 -1
- package/assets/esri/core/workers/chunks/2a97268000c6d03ef720.js +0 -1
- package/assets/esri/core/workers/chunks/2cf8172be83b10b11bdc.js +0 -1
- package/assets/esri/core/workers/chunks/2df37a9a95ceebb87a5f.js +0 -1
- package/assets/esri/core/workers/chunks/2e00c155e447e4930442.js +0 -1
- package/assets/esri/core/workers/chunks/2f91fd61019d2a37476d.js +0 -1
- package/assets/esri/core/workers/chunks/30af63b3b750142faadb.js +0 -1
- package/assets/esri/core/workers/chunks/3a47fc97c400fca2c736.js +0 -1
- package/assets/esri/core/workers/chunks/3cd04d23b73beaf79650.js +0 -1
- package/assets/esri/core/workers/chunks/426b4eb500fdfe9df325.js +0 -1
- package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +0 -1
- package/assets/esri/core/workers/chunks/47c97640ec525676918b.js +0 -1
- package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +0 -1
- package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +0 -1
- package/assets/esri/core/workers/chunks/4cb751dc8d00bdaeb04c.js +0 -1
- package/assets/esri/core/workers/chunks/518ab22f80c3300bcfff.js +0 -1
- package/assets/esri/core/workers/chunks/53ff68d4f9e365fc15cd.js +0 -1
- package/assets/esri/core/workers/chunks/58609bf94f72bc4f1952.js +0 -1
- package/assets/esri/core/workers/chunks/586a929bc037e23857af.js +0 -1
- package/assets/esri/core/workers/chunks/5c7780f804d789cb37f5.js +0 -1
- package/assets/esri/core/workers/chunks/5d76f4d97beee494bbbf.js +0 -1
- package/assets/esri/core/workers/chunks/603fdbbe9534c614928f.js +0 -1
- package/assets/esri/core/workers/chunks/611e3cdf67283c11576f.js +0 -1
- package/assets/esri/core/workers/chunks/6431480ba0fa8c8d487f.js +0 -1
- package/assets/esri/core/workers/chunks/652faf4359ac072c5dde.js +0 -1
- package/assets/esri/core/workers/chunks/65c98f3449044fa4fd79.js +0 -1
- package/assets/esri/core/workers/chunks/6b9961261241fdce0e94.js +0 -1
- package/assets/esri/core/workers/chunks/6dfe96b056bec30068df.js +0 -1
- package/assets/esri/core/workers/chunks/6f897b4e7ddd1dd1672b.js +0 -1
- package/assets/esri/core/workers/chunks/70cc2d79653d66e85b58.js +0 -1
- package/assets/esri/core/workers/chunks/7159d9c36869cd82599e.js +0 -29
- package/assets/esri/core/workers/chunks/7393f63043a1da3d05a6.js +0 -1
- package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +0 -1
- package/assets/esri/core/workers/chunks/75d551a449bba61ce238.js +0 -1
- package/assets/esri/core/workers/chunks/7748c2886d0122b40eeb.js +0 -1
- package/assets/esri/core/workers/chunks/78643f116677950ea29a.js +0 -1
- package/assets/esri/core/workers/chunks/78fbe330f16bdbdb886e.js +0 -1
- package/assets/esri/core/workers/chunks/7e0f04a5038e2a4f6e4b.js +0 -1
- package/assets/esri/core/workers/chunks/7f16ae01ccd9b6114d1c.js +0 -1
- package/assets/esri/core/workers/chunks/90153b5230b3a4985c14.js +0 -1
- package/assets/esri/core/workers/chunks/9189dfe19a2a2ccd5173.js +0 -1
- package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +0 -1
- package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +0 -1
- package/assets/esri/core/workers/chunks/99f51d5d9da6e9bfc430.js +0 -1
- package/assets/esri/core/workers/chunks/9aebe876b1a2fb075f9c.js +0 -1
- package/assets/esri/core/workers/chunks/9b6929faf649e81265fb.js +0 -1
- package/assets/esri/core/workers/chunks/9dd1fc56eb1ea6eb705e.js +0 -1
- package/assets/esri/core/workers/chunks/9dd48e75b4e8d9811d81.js +0 -1
- package/assets/esri/core/workers/chunks/a163c6005aba3378edaa.js +0 -1
- package/assets/esri/core/workers/chunks/a8286febe371dc186aaa.js +0 -1
- package/assets/esri/core/workers/chunks/acb265a22be5e12f38e5.js +0 -1
- package/assets/esri/core/workers/chunks/b12acf1f694f82e00df9.js +0 -1
- package/assets/esri/core/workers/chunks/b83cef2d3f528726d492.js +0 -1
- package/assets/esri/core/workers/chunks/b9596d862da1ec342cd3.js +0 -1
- package/assets/esri/core/workers/chunks/bc1fcc9c897461e68e29.js +0 -1
- package/assets/esri/core/workers/chunks/bdc221d94300c225665a.js +0 -1
- package/assets/esri/core/workers/chunks/be97a629e2ae4d13ceb3.js +0 -1
- package/assets/esri/core/workers/chunks/bfb39590c548188f5052.js +0 -1
- package/assets/esri/core/workers/chunks/c2318c014e97ba519be8.js +0 -1
- package/assets/esri/core/workers/chunks/c29091fe157564cffcf7.js +0 -1
- package/assets/esri/core/workers/chunks/c62237c344e341619341.js +0 -1
- package/assets/esri/core/workers/chunks/c8eae00b0ec87d8b2ff3.js +0 -1
- package/assets/esri/core/workers/chunks/cdb5c26fed7d9a97db49.js +0 -1
- package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +0 -1
- package/assets/esri/core/workers/chunks/cea0db3ee326f60610eb.js +0 -1
- package/assets/esri/core/workers/chunks/d7f2f1708d2a2668676c.js +0 -1
- package/assets/esri/core/workers/chunks/daf9b691817e83a11f3c.js +0 -1
- package/assets/esri/core/workers/chunks/db41490bd39d863305bf.js +0 -1
- package/assets/esri/core/workers/chunks/ddc95cdac6c06fc4794c.js +0 -1
- package/assets/esri/core/workers/chunks/df26ec0b508cf4716e0a.js +0 -1
- package/assets/esri/core/workers/chunks/e11159e3dc3353b27c57.js +0 -1
- package/assets/esri/core/workers/chunks/e4a57a0a9629faafd6c6.js +0 -1
- package/assets/esri/core/workers/chunks/ebc1a2ef3aed8aa29424.js +0 -1
- package/assets/esri/core/workers/chunks/ec1c4d66142b6efb0e8b.js +0 -1
- package/assets/esri/core/workers/chunks/ef12fa3574d4cbf8b084.js +0 -1
- package/assets/esri/core/workers/chunks/f2d56f5c15d5977e1d19.js +0 -1
- package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +0 -1
- package/assets/esri/core/workers/chunks/f905f1a1aa4c123cbe83.js +0 -1
- package/assets/esri/core/workers/chunks/fc139f251dc0523074e7.js +0 -1
- package/assets/esri/themes/base/widgets/_VideoPlayer.scss +0 -129
- package/assets/esri/widgets/VideoPlayer/t9n/messages.ar.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.bg.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.bs.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.ca.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.cs.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.da.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.de.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.el.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.en.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.es.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.et.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.fi.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.fr.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.he.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.hr.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.hu.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.id.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.it.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.ja.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.ko.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.lt.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.lv.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.nl.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.no.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.pl.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.pt-BR.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.pt-PT.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.ro.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.ru.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.sk.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.sl.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.sr.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.sv.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.th.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.tr.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.uk.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.vi.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-CN.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-HK.json +0 -1
- package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-TW.json +0 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +0 -232
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +0 -2
- package/widgets/VideoPlayer/components/MetadataSection.js +0 -2
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +0 -2
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +0 -2
- package/widgets/VideoPlayer/components/SettingsButton.js +0 -2
- package/widgets/VideoPlayer/css.js +0 -2
- package/widgets/VideoPlayer.d.ts +0 -119
- package/widgets/VideoPlayer.js +0 -2
|
@@ -159,11 +159,6 @@ export default class FeatureService extends FeatureServiceSuperclass {
|
|
|
159
159
|
* > Example: The service has a horizontal spatial reference with `feet` units, and `applyEdits()` is called with z-values based on `meter` units,
|
|
160
160
|
* > then the method will automatically convert the z values from `meter` to `feet` units. `applyEdits()` will pass in a `sessionId` during an active edit session.
|
|
161
161
|
*
|
|
162
|
-
* > [!WARNING]
|
|
163
|
-
* >
|
|
164
|
-
* > The `deleteAssociations`, `combineGroupedObjects`, and `divideGroupedObjects` edits are in beta and are reserved for
|
|
165
|
-
* > future use in a telecom domain network.
|
|
166
|
-
*
|
|
167
162
|
* @param edits - Object containing features and attachments to be added, updated or deleted.
|
|
168
163
|
* @param options - Additional edit options to specify when editing features or attachments.
|
|
169
164
|
* @returns Results returned from the [applyEdits()](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/FeatureService/#applyEdits) method. It contains features
|
|
@@ -67,9 +67,10 @@ export default class TraceLocation extends TraceLocationSuperclass {
|
|
|
67
67
|
accessor percentAlong: number;
|
|
68
68
|
/**
|
|
69
69
|
* The terminal Id to place the starting location at. Applicable for junction/device sources only. Users can use `getTerminalConfiguration()` in [UtilityNetwork](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/) to get the terminal.
|
|
70
|
+
*
|
|
70
71
|
* > [!NOTE]
|
|
71
72
|
* >
|
|
72
|
-
* >
|
|
73
|
+
* > Point features and junction objects used as a `TraceLocation` in a telecom domain network must specify `terminalId: 1`, or the trace location cannot be found.
|
|
73
74
|
*
|
|
74
75
|
* @see [Terminal](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Terminal/)
|
|
75
76
|
*/
|
|
@@ -31,10 +31,6 @@ export default class TraceResult extends JSONSupport {
|
|
|
31
31
|
/**
|
|
32
32
|
* An array of network elements returned by the trace. The network element is a representation of how the network topology defines its graph.
|
|
33
33
|
* This is returned only if the elements result type is defined in the trace configuration.
|
|
34
|
-
* > [!WARNING]
|
|
35
|
-
* >
|
|
36
|
-
* > The elements property returning a [TelecomNetworkElement](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TelecomNetworkElement/) is in beta and is reserved for
|
|
37
|
-
* > future use in a telecom domain network.
|
|
38
34
|
*
|
|
39
35
|
* @see [NetworkElement](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/NetworkElement/)
|
|
40
36
|
* @see [TelecomNetworkElement](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TelecomNetworkElement/)
|
|
@@ -45,7 +45,6 @@ export default class OutDistance extends OutDistanceSuperclass {
|
|
|
45
45
|
* Indicates whether to return features sorted by distance.
|
|
46
46
|
* The `"ascending"` option returns the nearest features first while the `"descending"` option returns farthest
|
|
47
47
|
* features first, and null indicates there should be no distance-based ordering.
|
|
48
|
-
* A `null` value indicates that there should be no distance-based ordering.
|
|
49
48
|
*
|
|
50
49
|
* @since 5.2
|
|
51
50
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"./histogram.js";import
|
|
2
|
+
import{throwIfAborted as e}from"../../core/promiseUtils.js";import{getSourceLayer as t}from"../../layers/support/dataSeriesUtils.js";import n from"./histogram.js";import r from"./summaryStatisticsForTimeSeries.js";import{processTimeSeriesParams as i,combineHistograms as a}from"./support/timeSeriesUtils.js";import{createLayerAdapter as o,featureCapableLayerTypes as s}from"../support/adapters/support/layerUtils.js";async function c(c){let{statisticInputs:l,...u}=await i(c,`histogram-for-time-series`),d=u.minValue==null||u.maxValue==null?await r({...c,minValue:void 0,maxValue:void 0}):void 0,f=u.minValue??d?.min,p=u.maxValue??d?.max;if(f==null||p==null)return{bins:[],minValue:f,maxValue:p};let m=l.flatMap(e=>`field`in e?[e.field]:[]);if(!u.forBinning&&m.length>1&&m.length<=50&&m.length===l.length){let r=o(u.layer,s,u.forBinning);if(r){await r.load(u.signal==null?null:{signal:u.signal});let i=t(r),a=r.getField(m[0])?.type;if(r.supportsSQLExpression&&i?.capabilities?.operations?.supportsQueryPivot&&m.every(e=>r.getField(e)?.type===a))try{return await n({...u,fields:m,classificationMethod:`equal-interval`,minValue:f,maxValue:p})}catch{e(u.signal)}}}let h=await Promise.all(l.map(e=>n({...u,...e,classificationMethod:`equal-interval`,minValue:f,maxValue:p})));return a(h)}export{c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"./summaryStatistics.js";import{processTimeSeriesParams as t,combineSummaryStatistics as n}from"./support/timeSeriesUtils.js";import{
|
|
2
|
+
import e from"./summaryStatistics.js";import{processTimeSeriesParams as t,combineSummaryStatistics as n}from"./support/timeSeriesUtils.js";import{createLayerAdapter as r,featureCapableLayerTypes as i}from"../support/adapters/support/layerUtils.js";import{processSummaryStatisticsResult as a}from"../../statistics/utils.js";async function o(o){let{statisticInputs:s,...c}=await t(o,`summary-statistics-for-time-series`),l=s.flatMap(e=>`field`in e?[e.field]:[]);if(!c.forBinning&&l.length>1&&l.length===s.length){let t=r(c.layer,i,c.forBinning);if(t){await t.load(c.signal==null?null:{signal:c.signal});let n=t.getField(l[0])?.type;if(l.every(e=>t.getField(e)?.type===n)){let t=await e({...c,fields:l,outStatisticTypes:{exclude:[`median`]}});return a(t,c.outStatisticTypes)}}}let u=await Promise.all(s.map(t=>e({...c,...t,outStatisticTypes:{exclude:[`median`]}})));return a(n(u),c.outStatisticTypes)}export{o as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{resolveTimeZone as t}from"../../../../intl/date.js";import{isTimeOnlyField as n,isDateField as r,isTimestampOffsetField as i,isDateOnlyField as a}from"../../../../layers/support/fieldUtils.js";import o from"../../../../rest/support/AttributeBinsQuery.js";import s from"../../../../rest/support/AutoIntervalBinParameters.js";import c from"../../../../rest/support/DateBinParameters.js";import l from"../../../../rest/support/FixedBoundariesBinParameters.js";import u from"../../../../rest/support/FixedIntervalBinParameters.js";import d from"../../../../rest/support/GenerateRendererParameters.js";import f from"../../../../rest/support/StatisticDefinition.js";import{getSQLFilterForNormalization as p,mergeWhereClauses as m,getRangeExpr as h}from"../../../statistics/support/utils.js";import{isAnyDateField as g}from"../../utils.js";import{getSQLExpressionForDateOrTimeField as _,getFieldExpr as v,updateQueryWithFeatureFilter as y,defaultNumBins as b,generateBinParams as x,getViewInfoParams as S}from"./utils.js";import{createClassBreaksDefinition as C}from"../../../../statistics/utils.js";const w=`countOFExpr`;function T(e,t,r){let i=e.valueExpression||e.sqlExpression,a=e.signal;if(!i){let{field:i,normalizationType:o,normalizationField:s}=e,c=i?t.getField(i):null,l=g(c)||n(c);return{sqlExpression:l?_(t,c):v({field:i,normalizationType:o,normalizationField:s,normalizationTotal:r,layer:t}),sqlWhere:l?null:e.sqlWhere||p({field:i,normalizationType:o,normalizationField:s}),filter:e.filter,signal:a}}return{valueExpression:e.valueExpression,sqlExpression:e.sqlExpression,sqlWhere:e.sqlWhere,filter:e.filter,signal:a}}async function E(e,t,n){let{field:r,normalizationType:i,normalizationField:a,signal:o}=e,s=p({field:r,normalizationType:i,normalizationField:a}),c=new d({classificationDefinition:C({field:r,normalizationType:i,normalizationField:a,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,definedInterval:e.definedInterval,breakCount:e.numBins||b}),where:m(s,n)});return t.generateRenderer(c,o).then(e=>{let{normalizationTotal:n,classBreaks:o}=e;return x({field:r,normalizationType:i,normalizationField:a,normalizationTotal:n,classBreaks:o,where:s,layer:t})})}async function D(t,r,i,o,d){let{field:f,sqlExpression:p,normalizationField:m,classificationMethod:g,normalizationType:_}=t,y=f?r.getField(f):null,x=n(y),S=a(y)||x,C=t.numBins||b;if(S){if(_||g)throw new e(`${r.adapterName}:not-supported`,`NormalizationType and classificationMethod are not supported for date-only and time-only fields`);let t=(o-i)/C/1e3,n=t/86400;return new c({field:f,expression:p,expressionValueType:p?`double`:void 0,interval:{unit:x?`seconds`:`days`,value:Math.ceil(x?t:n)},start:i,end:o})}if(g===`defined-interval`)return new u({field:f,expression:p,expressionValueType:p?`double`:void 0,normalizationField:m,normalizationTotal:d,normalizationType:_,interval:t.definedInterval??Math.ceil((o-i)/C),start:_?null:i,end:_?null:o,normalizationMinValue:_?i:null,normalizationMaxValue:_?o:null});if(g===`manual`)throw new e(`${r.adapterName}:not-supported`,`Layer does not support manual classificationMethod`);if(g===`natural-breaks`||g===`quantile`||g===`standard-deviation`){let n=v({field:f,normalizationField:m,normalizationTotal:d,normalizationType:_,layer:r}),a=await E(t,r,t.minValue!==null&&t.maxValue!==null?h(n,t.minValue,t.maxValue):void 0);if(!a.intervals)throw new e(`${r.adapterName}:invalid`,`Invalid intervals returned from generate renderer`);let o=[i,...a.intervals.map(e=>e[1])];return new l({field:_?null:f,expression:_?n:p,expressionValueType:p?`double`:void 0,boundaries:o})}return new s({field:f,normalizationField:m,normalizationTotal:d,normalizationType:_,expression:p,expressionValueType:p?`double`:void 0,numBins:C,start:_?null:i,end:_?null:o,normalizationMinValue:_?i:null,normalizationMaxValue:_?o:null})}function O(e,t,n,r){return n!=null&&r!=null?Promise.resolve({min:n,max:r}):t.summaryStatistics({...e,outStatisticTypes:{include:[`min`,`max`]}}).then(e=>({min:e.min,max:e.max}))}async function k(e,n,a,s){let{field:c,minValue:l,maxValue:u,filter:d,view:p}=e,h=c?n.getField(c):null,g=r(h)||i(h),_=T(e,n,a),{min:v,max:b}=await O(_,n,l,u);if(v==null||b==null)return{query:null,min:v,max:b};let x=new f({statisticType:`count`,outStatisticFieldName:w,onStatisticField:`1`}),{where:
|
|
2
|
+
import e from"../../../../core/Error.js";import{resolveTimeZone as t}from"../../../../intl/date.js";import{isTimeOnlyField as n,isDateField as r,isTimestampOffsetField as i,isDateOnlyField as a}from"../../../../layers/support/fieldUtils.js";import o from"../../../../rest/support/AttributeBinsQuery.js";import s from"../../../../rest/support/AutoIntervalBinParameters.js";import c from"../../../../rest/support/DateBinParameters.js";import l from"../../../../rest/support/FixedBoundariesBinParameters.js";import u from"../../../../rest/support/FixedIntervalBinParameters.js";import d from"../../../../rest/support/GenerateRendererParameters.js";import f from"../../../../rest/support/StatisticDefinition.js";import{getSQLFilterForNormalization as p,mergeWhereClauses as m,getRangeExpr as h}from"../../../statistics/support/utils.js";import{isAnyDateField as g}from"../../utils.js";import{getSQLExpressionForDateOrTimeField as _,getFieldExpr as v,updateQueryWithFeatureFilter as y,defaultNumBins as b,generateBinParams as x,getViewInfoParams as S}from"./utils.js";import{createClassBreaksDefinition as C}from"../../../../statistics/utils.js";const w=`countOFExpr`;function T(e,t,r){let i=e.valueExpression||e.sqlExpression,a=e.signal;if(!i){let{field:i,normalizationType:o,normalizationField:s}=e,c=i?t.getField(i):null,l=g(c)||n(c);return{sqlExpression:l?_(t,c):v({field:i,normalizationType:o,normalizationField:s,normalizationTotal:r,layer:t}),sqlWhere:l?null:e.sqlWhere||p({field:i,normalizationType:o,normalizationField:s}),filter:e.filter,signal:a}}return{valueExpression:e.valueExpression,sqlExpression:e.sqlExpression,sqlWhere:e.sqlWhere,filter:e.filter,signal:a}}async function E(e,t,n){let{field:r,normalizationType:i,normalizationField:a,signal:o}=e,s=p({field:r,normalizationType:i,normalizationField:a}),c=new d({classificationDefinition:C({field:r,normalizationType:i,normalizationField:a,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,definedInterval:e.definedInterval,breakCount:e.numBins||b}),where:m(s,n)});return t.generateRenderer(c,o).then(e=>{let{normalizationTotal:n,classBreaks:o}=e;return x({field:r,normalizationType:i,normalizationField:a,normalizationTotal:n,classBreaks:o,where:s,layer:t})})}async function D(t,r,i,o,d){let{field:f,sqlExpression:p,normalizationField:m,classificationMethod:g,normalizationType:_}=t,y=f?r.getField(f):null,x=n(y),S=a(y)||x,C=t.numBins||b;if(S){if(_||g)throw new e(`${r.adapterName}:not-supported`,`NormalizationType and classificationMethod are not supported for date-only and time-only fields`);let t=(o-i)/C/1e3,n=t/86400;return new c({field:f,expression:p,expressionValueType:p?`double`:void 0,interval:{unit:x?`seconds`:`days`,value:Math.ceil(x?t:n)},start:i,end:o})}if(g===`defined-interval`)return new u({field:f,expression:p,expressionValueType:p?`double`:void 0,normalizationField:m,normalizationTotal:d,normalizationType:_,interval:t.definedInterval??Math.ceil((o-i)/C),start:_?null:i,end:_?null:o,normalizationMinValue:_?i:null,normalizationMaxValue:_?o:null});if(g===`manual`)throw new e(`${r.adapterName}:not-supported`,`Layer does not support manual classificationMethod`);if(g===`natural-breaks`||g===`quantile`||g===`standard-deviation`){let n=v({field:f,normalizationField:m,normalizationTotal:d,normalizationType:_,layer:r}),a=await E(t,r,t.minValue!==null&&t.maxValue!==null?h(n,t.minValue,t.maxValue):void 0);if(!a.intervals)throw new e(`${r.adapterName}:invalid`,`Invalid intervals returned from generate renderer`);let o=[i,...a.intervals.map(e=>e[1])];return new l({field:_?null:f,expression:_?n:p,expressionValueType:p?`double`:void 0,boundaries:o})}return new s({field:f,normalizationField:m,normalizationTotal:d,normalizationType:_,expression:p,expressionValueType:p?`double`:void 0,numBins:C,start:_?null:i,end:_?null:o,normalizationMinValue:_?i:null,normalizationMaxValue:_?o:null})}function O(e,t,n,r){return n!=null&&r!=null?Promise.resolve({min:n,max:r}):t.summaryStatistics({...e,outStatisticTypes:{include:[`min`,`max`]}}).then(e=>({min:e.min,max:e.max}))}async function k(e,n,a,s){let{field:c,minValue:l,maxValue:u,filter:d,view:p}=e,h=c?n.getField(c):null,g=r(h)||i(h),_=T(e,n,a),{min:v,max:b}=await O(_,n,l,u);if(v==null||b==null)return{query:null,min:v,max:b};let x=n.objectIdField,S=new f({statisticType:`count`,outStatisticFieldName:w,onStatisticField:x&&n.getField(x)?x:`1`}),{where:C,timeExtent:E}=s||{},k=m(C,_.sqlWhere),A=new o({binParameters:await D(e,n,v,b,a),outStatistics:[S],binOrder:e.sortOrder,where:k,timeExtent:E,lowerBoundaryAlias:`lowerBoundary`,upperBoundaryAlias:`upperBoundary`,outTimeZone:p?.timeZone&&g?t(p.timeZone):null,returnAggregateIds:e.returnAggregateIds??void 0});return y(A,d),{query:A,min:v,max:b}}function A(e,t=!1){return typeof e==`string`?(t?new Date(`1970-01-01T${e}Z`):new Date(e)).getTime():e}function j(e,t,r){let i=n(t),a=e.features.map(e=>{let t={minValue:A(e.attributes.lowerBoundary,i),maxValue:A(e.attributes.upperBoundary,i),count:e.attributes[w]};return e.statisticsAggregatedIds&&(t.aggregateIds=e.statisticsAggregatedIds),t});return{...r,bins:a}}function M(e,t,n){let{valueExpression:r,view:i}=e,{featuresJSON:a,graphics:o,fieldInfos:s}=t,c={field:e.field,valueExpression:r,sqlExpression:e.sqlExpression,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:n,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numBins:e.numBins};return r&&i&&(a||o)&&(c.viewInfoParams=S(i),c.timeZone=i.timeZone,c.fieldInfos=s),c}export{E as binParamsFromGenRend,A as formatHistogramBinValue,k as getAttributeBinsQuery,O as getDataRange,M as getHistogramAttributeDefinition,T as getQueryParamsForExpr,j as processQueryAttributeBinsResult};
|
|
@@ -16,8 +16,8 @@ export interface BasemapStyleProperties extends Partial<Pick<BasemapStyle, "apiK
|
|
|
16
16
|
*
|
|
17
17
|
* > [!CAUTION]
|
|
18
18
|
* >
|
|
19
|
-
* > Use of the basemap style service requires authentication via an [API key](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-apiKey) or [user authentication](https://developers.arcgis.com/javascript/latest/
|
|
20
|
-
* > see the [API
|
|
19
|
+
* > Use of the basemap style service requires authentication via an [API key](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-apiKey) or [user authentication](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/#user-authentication). To learn more about API keys,
|
|
20
|
+
* > see the [API key authentication](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/#api-key-authentication) section.
|
|
21
21
|
*
|
|
22
22
|
* @since 4.28
|
|
23
23
|
* @see [Basemap styles service (v2)](https://developers.arcgis.com/rest/basemap-styles/)
|
package/symbols/cim/types.d.ts
CHANGED
|
@@ -266,13 +266,13 @@ export interface CIMLineCallout extends CIMCallout {
|
|
|
266
266
|
* Represents the leader line style for callouts. Line leaders will always be drawn with their own geometry.
|
|
267
267
|
*
|
|
268
268
|
* Supported values:
|
|
269
|
-
* - `Base`: The line callout leader is a single line originating from the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the
|
|
269
|
+
* - `Base`: The line callout leader is a single line originating from the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
|
|
270
270
|
* - `MidPoint`: The line callout leader is a single line originating from the midpoint of the left or right side of the text box with the gap applied or from the midpoint of the accent bar if the callout has one.
|
|
271
271
|
* - `ThreePoint`: The line callout leader is a 3-point line originating from the midpoint of the left or right side of the text box with the gap applied or the midpoint of the accent bar if the callout has one.
|
|
272
272
|
* - `FourPoint`: The line callout leader is a 4-point line originating from the midpoint of the left or right side of the text box with the gap applied or the midpoint of the accent bar if the callout has one.
|
|
273
|
-
* - `Underline`: The line callout draws a line that connects to the closest of the four corners of the text with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar. Additionally, either
|
|
274
|
-
* - `CircularCW`: The line callout leader is curved (clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the
|
|
275
|
-
* - `CircularCCW`: The line callout leader is curved (counter-clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the
|
|
273
|
+
* - `Underline`: The line callout draws a line that connects to the closest of the four corners of the text with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar. Additionally, either an underline or an "overline" is drawn along the closest side (bottom or top) of the text.
|
|
274
|
+
* - `CircularCW`: The line callout leader is curved (clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
|
|
275
|
+
* - `CircularCCW`: The line callout leader is curved (counter-clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
|
|
276
276
|
*
|
|
277
277
|
* @since 5.2
|
|
278
278
|
*/
|
|
@@ -343,7 +343,7 @@ export type LeaderLineStyle = "Base" | "MidPoint" | "ThreePoint" | "FourPoint" |
|
|
|
343
343
|
* "accentBarSymbol": {
|
|
344
344
|
* "type": "CIMLineSymbol",
|
|
345
345
|
* "symbolLayers": [
|
|
346
|
-
*
|
|
346
|
+
* {
|
|
347
347
|
* "type": "CIMSolidStroke",
|
|
348
348
|
* "enable": true,
|
|
349
349
|
* "capStyle": "Round",
|
|
@@ -2693,7 +2693,6 @@ export interface CIMSymbolAnimationOffset extends CIMBaseAnimation {
|
|
|
2693
2693
|
*
|
|
2694
2694
|
* @since 5.1
|
|
2695
2695
|
* @see [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine)
|
|
2696
|
-
* @beta
|
|
2697
2696
|
*/
|
|
2698
2697
|
export type MovementAlongLineType = "Distance" | "Speed";
|
|
2699
2698
|
|
|
@@ -2703,7 +2702,6 @@ export type MovementAlongLineType = "Distance" | "Speed";
|
|
|
2703
2702
|
* The starting position of the marker(s) on the line geometry is determined by the [CIMMarkerPlacement](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMMarkerPlacement) properties of the symbol layer.
|
|
2704
2703
|
*
|
|
2705
2704
|
* @since 5.1
|
|
2706
|
-
* @beta
|
|
2707
2705
|
*/
|
|
2708
2706
|
export interface CIMSymbolAnimationMoveAlongLine extends CIMBaseAnimation {
|
|
2709
2707
|
/**
|
|
@@ -2756,7 +2754,7 @@ export interface CIMSymbolAnimationMoveAlongLine extends CIMBaseAnimation {
|
|
|
2756
2754
|
* [CIMSymbolAnimationTransparency](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationTransparency) | Represents a symbol animation that changes the transparency of a symbol.
|
|
2757
2755
|
* [CIMSymbolAnimationRotation](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationRotation) | Represents a symbol animation that rotates a symbol to a given value.
|
|
2758
2756
|
* [CIMSymbolAnimationOffset](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationOffset) | Represents a symbol animation that offsets a symbol to a given X or Y value.
|
|
2759
|
-
* [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine)
|
|
2757
|
+
* [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine) | Represents a symbol animation that moves a symbol along a line geometry.
|
|
2760
2758
|
*
|
|
2761
2759
|
* > [!WARNING]
|
|
2762
2760
|
* >
|
|
@@ -3025,7 +3023,7 @@ export interface CIMPointSymbolCallout extends CIMLineCallout {
|
|
|
3025
3023
|
*/
|
|
3026
3024
|
pointSymbol: CIMPointSymbol;
|
|
3027
3025
|
/**
|
|
3028
|
-
* Defines how the background is scaled to fit the dimensions of the symbol.
|
|
3026
|
+
* Defines how the background is scaled to fit the dimensions of the text symbol.
|
|
3029
3027
|
*
|
|
3030
3028
|
* @since 5.2
|
|
3031
3029
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{removeMaybe as e,abortMaybe as t}from"../../../../core/maybe.js";import{throwIfNotAbortError as n,throwIfAbortError as r,isAbortError as i,eachAlways as a}from"../../../../core/promiseUtils.js";import{addQueryParameters as o}from"../../../../core/urlUtils.js";import{open as s}from"../../../../core/workers.js";import c from"./SpriteMosaic.js";import l from"../../tiling/TileKey.js";class u{constructor(e,t,n,r,i){this._layer=e,this._styleRepository=t,this.devicePixelRatio=n,this._sourceDataMaxLOD=r,this._glyphMosaic=i,this._spriteMosaic=null,this._connection=null,this._spriteSourceAbortController=null,this._onClientConnectedHandle=null,this.type=`TileHandler2D`,this._startOptionsInputSignal=null,this._inputSignalEventListener=null}destroy(){this._onClientConnectedHandle=e(this._onClientConnectedHandle),this._connection?.close(),this._connection=null,this._styleRepository=null,this._layer=null,this._spriteMosaic?.destroy(),this._spriteMosaic=null,this._glyphMosaic=null,this._spriteSourceAbortController=t(this._spriteSourceAbortController),this._spriteSourcePromise=null,this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener(`abort`,this._inputSignalEventListener),this._startOptionsInputSignal=null,this._inputSignalEventListener=null}get spriteMosaic(){return this._spriteSourcePromise.then(()=>this._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(t){this._requestSprite(t),this._baseUrl=this._getBaseUrl()??``,this._onClientConnectedHandle=e(this._onClientConnectedHandle);let r=s(`WorkerTileHandler`,{client:this,schedule:t.schedule,signal:t.signal});this._broadcastPromise=r;let i=await r;if(this._connection?.close(),this._connection=i,this._onClientConnectedHandle=i.onClientConnected(e=>{this._layer&&!this._connection.closed&&(e.invoke(`initializeGlyphWorker`).catch(e=>n(e)),e.invoke(`setStyle`,{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD}).catch(e=>n(e)))}),this._layer&&!this._connection.closed){let e=i.broadcast(`setStyle`,{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD});Promise.all(e).catch(e=>n(e))}}async openGlyphPorts(){let e=await this._glyphMosaic.openMessagePorts();return{result:e,transferList:e}}_requestSprite(e){this._spriteSourceAbortController?.abort();let t=new AbortController;this._spriteSourceAbortController=t;let n=e?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener(`abort`,this._inputSignalEventListener),this._startOptionsInputSignal=null,n&&(this._inputSignalEventListener=d(t),n.addEventListener(`abort`,this._inputSignalEventListener,{once:!0}));let{signal:i}=t,a={...e,signal:i};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,a),this._spriteSourcePromise.then(e=>{r(i),this._spriteMosaic=new c(1024,1024,250),this._spriteMosaic.setSpriteSource(e)})}async updateStyle(e){let t=[];for(let n of e)n.type===4?t.push({type:4,data:{spriteSource:null}}):t.push(n);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast(`updateStyle`,t)),this._broadcastPromise}setSpriteSource(e){let t=new c(1024,1024,250);return t.setSpriteSource(e),this._spriteMosaic=t,this._spriteSourcePromise=Promise.resolve(e),this._spriteSourceAbortController=null,t}async setStyle(e,t,n){return await this._broadcastPromise,this._styleRepository=e,this._sourceDataMaxLOD=n,this._requestSprite(),this._baseUrl=this._getBaseUrl()??``,this._broadcastPromise=Promise.all(this._connection.broadcast(`setStyle`,{style:t,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(e,t){let n=await this._getRefKeys(e,t);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),n,t)}async fetchTilePBFs(e){let t=Object.keys(this._layer.sourceNameToSource),n={},r=await this._getRefKeys(e,n),i=[],a=[];for(let e=0;e<r.length;e++)if(r[e].value==null||t[e]==null)a.push(null);else{let o=r[e].value,s=this._getTilePayload(o,t[e],n);s.then(e=>{i.push({...e,key:o})}),a.push(s)}return Promise.all(a).then(()=>i)}async parseTileData(e,t){let n=e&&e.data;if(!n)return null;let{sourceName2DataAndRefKey:r,transferList:i}=n;return Object.keys(r).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke(`createTileAndParse`,{key:e.key.id,sourceName2DataAndRefKey:r,styleLayerUIDs:e.styleLayerUIDs,baseUrl:this._baseUrl},{...t,transferList:i}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}async _getTilePayload(e,t,n){let r=l.pool.acquire(e.id),a=this._layer.sourceNameToSource[t],{level:o,row:s,col:c}=r;l.pool.release(r);try{return{protobuff:await a.requestTile(o,s,c,n),sourceName:t}}catch(e){if(i(e))throw e;return{protobuff:null,sourceName:t}}}async _getRefKeys(e,t){let n=this._layer.sourceNameToSource,r=[];for(let i in n){let a=n[i].getRefKey(e,t);r.push(a)}return a(r)}_getSourcesData(e,t,n){let r=[];for(let i=0;i<t.length;i++)if(t[i].value==null||e[i]==null)r.push(null);else{let a=t[i].value,o=this._getTilePayload(a,e[i],n);r.push(o)}return a(r).then(e=>{let n={},r=[];for(let i=0;i<e.length;i++){let a=e[i].value;if(a&&a.protobuff&&a.protobuff.byteLength>0){let e=t[i].value.id;n[a.sourceName]={refKey:e,protobuff:a.protobuff},r.push(a.protobuff)}}return{sourceName2DataAndRefKey:n,transferList:r}})}_getBaseUrl(){let e=this._layer.currentStyleInfo.glyphsUrl;return e&&o(e,{...this._layer.customParameters,token:this._layer.apiKey})}}function d(e){return()=>e.abort()}export{u as TileHandler};
|
|
2
|
+
import{removeMaybe as e,abortMaybe as t}from"../../../../core/maybe.js";import{throwIfNotAbortError as n,throwIfAbortError as r,isAbortError as i,eachAlways as a}from"../../../../core/promiseUtils.js";import{addQueryParameters as o}from"../../../../core/urlUtils.js";import{open as s}from"../../../../core/workers.js";import c from"./SpriteMosaic.js";import l from"../../tiling/TileKey.js";class u{constructor(e,t,n,r,i,a){this._layer=e,this._styleRepository=t,this.devicePixelRatio=n,this._sourceDataMaxLOD=r,this._glyphMosaic=i,this._getTileInfo=a,this._spriteMosaic=null,this._connection=null,this._spriteSourceAbortController=null,this._onClientConnectedHandle=null,this.type=`TileHandler2D`,this._startOptionsInputSignal=null,this._inputSignalEventListener=null}destroy(){this._onClientConnectedHandle=e(this._onClientConnectedHandle),this._connection?.close(),this._connection=null,this._styleRepository=null,this._layer=null,this._spriteMosaic?.destroy(),this._spriteMosaic=null,this._glyphMosaic=null,this._spriteSourceAbortController=t(this._spriteSourceAbortController),this._spriteSourcePromise=null,this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener(`abort`,this._inputSignalEventListener),this._startOptionsInputSignal=null,this._inputSignalEventListener=null}get spriteMosaic(){return this._spriteSourcePromise.then(()=>this._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(t){this._requestSprite(t),this._baseUrl=this._getBaseUrl()??``,this._onClientConnectedHandle=e(this._onClientConnectedHandle);let r=s(`WorkerTileHandler`,{client:this,schedule:t.schedule,signal:t.signal});this._broadcastPromise=r;let i=await r;if(this._connection?.close(),this._connection=i,this._onClientConnectedHandle=i.onClientConnected(e=>{this._layer&&!this._connection.closed&&(e.invoke(`initializeGlyphWorker`).catch(e=>n(e)),e.invoke(`setStyle`,{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD}).catch(e=>n(e)))}),this._layer&&!this._connection.closed){let e=i.broadcast(`setStyle`,{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD});Promise.all(e).catch(e=>n(e))}}async openGlyphPorts(){let e=await this._glyphMosaic.openMessagePorts();return{result:e,transferList:e}}_requestSprite(e){this._spriteSourceAbortController?.abort();let t=new AbortController;this._spriteSourceAbortController=t;let n=e?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener(`abort`,this._inputSignalEventListener),this._startOptionsInputSignal=null,n&&(this._inputSignalEventListener=d(t),n.addEventListener(`abort`,this._inputSignalEventListener,{once:!0}));let{signal:i}=t,a={...e,signal:i};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,a),this._spriteSourcePromise.then(e=>{r(i),this._spriteMosaic=new c(1024,1024,250),this._spriteMosaic.setSpriteSource(e)})}async updateStyle(e){let t=[];for(let n of e)n.type===4?t.push({type:4,data:{spriteSource:null}}):t.push(n);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast(`updateStyle`,t)),this._broadcastPromise}setSpriteSource(e){let t=new c(1024,1024,250);return t.setSpriteSource(e),this._spriteMosaic=t,this._spriteSourcePromise=Promise.resolve(e),this._spriteSourceAbortController=null,t}async setStyle(e,t,n){return await this._broadcastPromise,this._styleRepository=e,this._sourceDataMaxLOD=n,this._requestSprite(),this._baseUrl=this._getBaseUrl()??``,this._broadcastPromise=Promise.all(this._connection.broadcast(`setStyle`,{style:t,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(e,t){let n=await this._getRefKeys(e,t);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),n,t)}async fetchTilePBFs(e){let t=Object.keys(this._layer.sourceNameToSource),n={},r=await this._getRefKeys(e,n),i=[],a=[];for(let e=0;e<r.length;e++)if(r[e].value==null||t[e]==null)a.push(null);else{let o=r[e].value,s=this._getTilePayload(o,t[e],n);s.then(e=>{i.push({...e,key:o})}),a.push(s)}return Promise.all(a).then(()=>i)}async parseTileData(e,t){let n=e&&e.data;if(!n)return null;let{sourceName2DataAndRefKey:r,transferList:i}=n;return Object.keys(r).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke(`createTileAndParse`,{key:e.key.id,sourceName2DataAndRefKey:r,styleLayerUIDs:e.styleLayerUIDs,baseUrl:this._baseUrl},{...t,transferList:i}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}async _getTilePayload(e,t,n){let r=l.pool.acquire(e.id),a=this._layer.sourceNameToSource[t],{level:o,row:s,col:c}=r;l.pool.release(r);try{return{protobuff:await a.requestTile(o,s,c,n,this._getTileInfo?.()),sourceName:t}}catch(e){if(i(e))throw e;return{protobuff:null,sourceName:t}}}async _getRefKeys(e,t){let n=this._layer.sourceNameToSource,r=[];for(let i in n){let a=n[i].getRefKey(e,t);r.push(a)}return a(r)}_getSourcesData(e,t,n){let r=[];for(let i=0;i<t.length;i++)if(t[i].value==null||e[i]==null)r.push(null);else{let a=t[i].value,o=this._getTilePayload(a,e[i],n);r.push(o)}return a(r).then(e=>{let n={},r=[];for(let i=0;i<e.length;i++){let a=e[i].value;if(a&&a.protobuff&&a.protobuff.byteLength>0){let e=t[i].value.id;n[a.sourceName]={refKey:e,protobuff:a.protobuff},r.push(a.protobuff)}}return{sourceName2DataAndRefKey:n,transferList:r}})}_getBaseUrl(){let e=this._layer.currentStyleInfo.glyphsUrl;return e&&o(e,{...this._layer.customParameters,token:this._layer.apiKey})}}function d(e){return()=>e.abort()}export{u as TileHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{throwIfAborted as e,createAbortError as t}from"../../../../../core/promiseUtils.js";import{open as n}from"../../../../../core/workers.js";import r from"./VectorTileSource.js";import i from"../../../tiling/TileKey.js";class a extends r{static async create(t,r,i,s,c){if(s.cluster===!0)throw Error(`Clustered GeoJSON vector tile sources are not supported.`);if(s.data==null)throw Error(`GeoJSON source '${t}' must define a data property.`);let l=s.maxzoom??18,u=await n(`GeoJSONVectorTileSourceWorker`,{signal:c?.signal,strategy:`dedicated`}),d;try{d=await u.invoke(`initialize`,{definition:s,name:t,requestOptions:o(c)},{signal:c?.signal}),e(c)}catch(e){throw u.close(),e}return new a(t,r,i,u,s.minzoom??0,l,d.geometryTypes)}constructor(e,t,n,r,i,a,o){super(e,t,n),this._connection=r,this._minZoom=i,this._maxZoom=a,this.geometryTypes=o}destroy(){super.destroy(),this._connection?.close(),this._connection=null}async getRefKey(t,n){if(e(n),t.level<this._minZoom)return null;if(t.level<=this._maxZoom)return t;let r=t.level-this._maxZoom;return new i(this._maxZoom,t.row>>r,t.col>>r,t.world)}requestTile(n,r,i,a){return e(a),this._connection?this._connection.invoke(`requestTile`,{col:i,
|
|
2
|
+
import{throwIfAborted as e,createAbortError as t}from"../../../../../core/promiseUtils.js";import{open as n}from"../../../../../core/workers.js";import r from"./VectorTileSource.js";import i from"../../../tiling/TileKey.js";class a extends r{static async create(t,r,i,s,c){if(s.cluster===!0)throw Error(`Clustered GeoJSON vector tile sources are not supported.`);if(s.data==null)throw Error(`GeoJSON source '${t}' must define a data property.`);let l=s.maxzoom??18,u=await n(`GeoJSONVectorTileSourceWorker`,{signal:c?.signal,strategy:`dedicated`}),d;try{d=await u.invoke(`initialize`,{definition:s,name:t,requestOptions:o(c)},{signal:c?.signal}),e(c)}catch(e){throw u.close(),e}return new a(t,r,i,u,s.minzoom??0,l,d.geometryTypes)}constructor(e,t,n,r,i,a,o){super(e,t,n),this._connection=r,this._minZoom=i,this._maxZoom=a,this.geometryTypes=o,this.type=`geojson`}destroy(){super.destroy(),this._connection?.close(),this._connection=null}async getRefKey(t,n){if(e(n),t.level<this._minZoom)return null;if(t.level<=this._maxZoom)return t;let r=t.level-this._maxZoom;return new i(this._maxZoom,t.row>>r,t.col>>r,t.world)}requestTile(n,r,i,a,o=this.tileInfo){return e(a),this._connection?this._connection.invoke(`requestTile`,{col:i,row:r,origin:{x:o.origin.x,y:o.origin.y},tileSpan:o.size[0]*o.lodAt(n).resolution,spatialReference:o.spatialReference.toJSON()},a):Promise.reject(t())}}function o(e){if(!e)return{};let{signal:t,...n}=e;return n}export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../request.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{fromValues as n}from"../../../../../geometry/support/aaBoundingRect.js";import{
|
|
2
|
+
import e from"../../../../../request.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{fromValues as n}from"../../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as r,getInfo as i,webMercator as a,wgs84 as o}from"../../../../../geometry/support/spatialReferenceUtils.js";import{TileClipper as s}from"../../../../../geometry/support/TileClipper.js";import{convertFromGeometry as c,convertToGeometry as l,generalizeOptimizedGeometry as u,quantizeOptimizedGeometry as d}from"../../../../../layers/graphics/featureConversionUtils.js";import f from"../../../../../layers/graphics/OptimizedGeometry.js";import p from"../../../../../layers/graphics/data/FeatureStore.js";import{project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{validateGeoJSON as h,createOptimizedFeatures as g,getGeometryType as _}from"../../../../../layers/graphics/sources/geojson/geojson.js";import{encodeVectorTileFeatures as v}from"./encodeVectorTileFeatures.js";const y=4096,b=[{geometryType:`esriGeometryPolygon`,vectorTileGeometryType:3},{geometryType:`esriGeometryPolyline`,vectorTileGeometryType:2},{geometryType:`esriGeometryPoint`,vectorTileGeometryType:1},{geometryType:`esriGeometryMultipoint`,vectorTileGeometryType:1}];class x{constructor(){this._buffer=128,this._featureIds=new Map,this._name=``,this._stores=[],this._webMercatorStores=null,this._tolerance=.375}destroy(){for(let{store:e}of this._stores)e.clear();for(let{store:e}of this._webMercatorStores??[])e.clear();this._webMercatorStores=null,this._featureIds.clear(),this._stores.length=0}async initialize({definition:n,name:r,requestOptions:i},a={}){if(n.data==null)throw Error(`GeoJSON source '${r}' must define a data property.`);if(n.lineMetrics===!0)throw Error(`GeoJSON lineMetrics are not supported.`);if(n.promoteId&&n.generateId)throw Error(`GeoJSON promoteId and generateId cannot be used together.`);let o=typeof n.data==`string`?(await e(n.data,{...i,responseType:`json`,signal:a.signal})).data:n.data;t(a),h(o),this.destroy(),this._buffer=n.buffer??128,this._name=r,this._tolerance=n.tolerance??.375;let s=0;for(let{geometryType:e,vectorTileGeometryType:t}of b){let r=g(o,{geometryType:e,hasZ:!1}),i=S(o,e,n);if(r.length===0)continue;let a=new p({geometryType:e,hasM:!1,hasZ:!1}),c=[];for(let[e,t]of r.entries())t.geometry&&(t.objectId=s++,this._featureIds.set(t.objectId,i[e]??null),c.push(t));c.length>0&&(a.addMany(c),this._stores.push({geometryType:e,store:a,vectorTileGeometryType:t}))}return t(a),{geometryTypes:[`polygon`,`line`,`point`].filter(e=>this._stores.some(({vectorTileGeometryType:t})=>t===E(e)))}}requestTile(e,n={}){t(n);let r=this._getTileFeatures(e),i=r.length>0?v(this._name,new D(r),y):new ArrayBuffer(0);return t(n),{result:i,transferList:[i]}}_getStores(e){return r(e)?(this._webMercatorStores||=this._stores.map(({geometryType:e,store:t,vectorTileGeometryType:n})=>{let r=new p({geometryType:e,hasM:!1,hasZ:!1});return t.forEach(t=>{let n=C(t.geometry,e);if(n){let e=t.weakClone();e.geometry=n,r.add(e)}}),{geometryType:e,store:r,vectorTileGeometryType:n}}),this._webMercatorStores):this._stores}_getTileFeatures({col:e,row:t,origin:r,tileSpan:a,spatialReference:o}){let s=r.x+e*a,c=r.y-t*a,{valid:l}=i(o),u=l[1]-l[0],d=this._getStores(o),f=a/y,p=this._buffer*f,m=this._tolerance*f,h=[];for(let e of[-u,0,u]){let t=n(s-p-e,c-a-p,s+a+p-e,c+p),r={scale:[f,-f,1,1],translate:[s-e,c,0,0]};for(let{geometryType:e,store:n,vectorTileGeometryType:i}of d)n.forEachInBounds(t,t=>{let n=w(t,e,i,r,m,this._buffer);n&&h.push({attributes:t.attributes,geometry:n,id:this._featureIds.get(t.objectId),type:i})})}return h}}function S(e,t,n){let r=[],i=e.type===`FeatureCollection`?e.features:[e];for(let e=0;e<i.length;e++){let a=i[e];if(!a.geometry||_(a.geometry.type)!==t)continue;let o=n.promoteId?a.properties?.[n.promoteId]:n.generateId===!0?e:a.id;r.push(typeof o==`number`||typeof o==`string`?o:null)}return r}function C(e,t){return e?c(m(l(e,t,!1,!1),o,a))??null:null}function w(e,t,n,r,i,a){if(!e.geometry)return null;let o=i>0?u(e.geometry,t,i,!1,!1):e.geometry;return T(d(o,t,r,!1,!1,!0),n,a)}function T(e,t,n){if(!e)return null;let r=new s(0,0,0,8,n/8);if(r.setExtent(y),r.reset(t),t===1)for(let t=0;t<e.size;t++){let n=t*e.stride;r.moveTo(e.coords[n],e.coords[n+1])}else{let n=0;for(let i of e.lengths){r.moveTo(e.coords[n],e.coords[n+1]);for(let t=1;t<i;t++){let i=n+t*e.stride;r.lineTo(e.coords[i],e.coords[i+1])}t===3&&r.close(),n+=i*e.stride}}let i=r.result();if(!i)return null;let a=t===1?[i.length]:i.map(e=>e.length),o=[];for(let e of i)for(let t of e)o.push(t.x,t.y);return new f(a,o)}function E(e){switch(e){case`polygon`:return 3;case`line`:return 2;case`point`:return 1}}class D{constructor(e){this._features=e,this._index=-1,this._pathOffsets=[]}get _feature(){return this._features[this._index]}destroy(){}getAttributes(){return this._feature.attributes}getId(){return this._feature.id}getPathCount(){return this._feature.type===1?1:this._feature.geometry.lengths.length}getPathLength(e){return this._feature.type===1?this._feature.geometry.size:this._feature.geometry.lengths[e]}getType(){return this._feature.type}getX(e,t){return this._feature.geometry.coords[this._getCoordinateIndex(e,t)]}getY(e,t){return this._feature.geometry.coords[this._getCoordinateIndex(e,t)+1]}next(){return++this._index>=this._features.length?!1:(this._pathOffsets=O(this._feature.geometry),!0)}_getCoordinateIndex(e,t){return(this._feature.type===1?t:this._pathOffsets[e]+t)*this._feature.geometry.stride}}function O(e){let t=Array(e.lengths.length),n=0;for(let r=0;r<e.lengths.length;r++)t[r]=n,n+=e.lengths[r];return t}export{x as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{getScaleForResolution as e}from"../../../../../geometry/support/scaleUtils.js";import{getInfo as t,equals as n}from"../../../../../geometry/support/spatialReferenceUtils.js";import{project as r}from"../../../../../geometry/support/webMercatorUtils.js";import i from"../../../../../layers/support/TileInfo.js";import a from"../../../tiling/TileInfoViewPOT.js";function o(n,r=22){let a=t(n),o=n.isWGS84?360/512:78271.51696400007,s=n.isWGS84?e(o,n):295828763.7957775;return i.fromJSON({rows:512,cols:512,dpi:96,format:`pbf`,origin:{x:a.origin[0],y:a.origin[1]},spatialReference:n.toJSON(),lods:Array.from({length:r+1},(e,t)=>({level:t,resolution:o/2**t,scale:s/2**t}))})}function s(e,t){return n(e.tileInfo?.spatialReference,t)||l(e)&&(t.isWGS84||t.isWebMercator)}function c(e,t){let i=l(e)&&s(e,t)?o(t,e.tileInfo.lods.length-1):e.tileInfo,c=n(e.spatialReference,i.spatialReference)?e.fullExtent:r(e.fullExtent,i.spatialReference);return c&&i.spatialReference.isWebMercator&&e.spatialReference.isWGS84&&(c.ymin=Math.max(c.ymin,-i.origin.y),c.ymax=Math.min(c.ymax,i.origin.y)),new a(i,c)}function l(e){let t=Object.values(e.sourceNameToSource);return t.length>0&&t.every(e=>e.type===`geojson`)}export{o as createTileInfo,c as createTileInfoView,s as supportsSpatialReference};
|
|
@@ -8,5 +8,5 @@ class e{generateSource(e){let t=[];for(let n=1;n<this.length;n++)t.push(`vec4 at
|
|
|
8
8
|
cos1 * s1 * x2 - sin1 * s1 * y2 + x1,
|
|
9
9
|
sin1 * s1 * x2 + cos1 * s1 * y2 + y1
|
|
10
10
|
);
|
|
11
|
-
`,`out0 = vec4(translation, rotation, scale);`]}encode(e){return[[this.opcode,0,0,0],[e.translation.from[0],e.translation.from[1],e.translation.to[0],e.translation.to[1]],[e.rotation.from,e.rotation.to,e.scale.from,e.scale.to],...p(e.translation.timing),...p(e.rotation.timing),...p(e.scale.timing),[+!!e.relativeTranslation,+!!e.absoluteScale,+!!e.selectGlobalRotation,0]]}}class h extends e{constructor(){super(...arguments),this.opcode=++t,this.length=7,this.ins=1,this.outs=1,this.microcode=[`float fromOpacity = atom0.y;`,`float toOpacity = atom0.z;`,`vec4 fromColor = atom1;`,`vec4 toColor = atom2;`,`float fColor;`,`{`,...c({duration:`atom3.x`,startTimeOffset:`atom3.y`,repeatDelay:`atom3.z`,timeOriginSelector:`atom3.w`,repeatType:`atom4.x`,easing:`atom4.y`,playAnimation:`atom4.z`,reverseAnimation:`atom4.w`,out:`fColor`}),`}`,`float fOpacity;`,`{`,...c({duration:`atom5.x`,startTimeOffset:`atom5.y`,repeatDelay:`atom5.z`,timeOriginSelector:`atom5.w`,repeatType:`atom6.x`,easing:`atom6.y`,playAnimation:`atom6.z`,reverseAnimation:`atom6.w`,out:`fOpacity`}),`}`,`vec4 aColor = mix(fromColor, toColor, fColor);`,`aColor.a *= mix(fromOpacity, toOpacity, fOpacity);`,`vec4 pColor = in0;`,`out0 = aColor * pColor;`]}encode(e){return[[this.opcode,e.opacity.from,e.opacity.to,0],[e.color.from[0],e.color.from[1],e.color.from[2],e.color.from[3]],[e.color.to[0],e.color.to[1],e.color.to[2],e.color.to[3]],...p(e.color.timing),...p(e.opacity.timing)]}}class g extends e{constructor(){super(...arguments),this.opcode=++t,this.length=4,this.ins=1,this.outs=1,this.microcode=[`float fromShift = atom0.y;`,`float toShift = atom0.z;`,`float duration = atom1.x;`,`bool multiplyToByLineLength = atom3.x == 1.0;`,`bool multiplyDurationByLineLength = atom3.y == 1.0;`,`bool continuous = atom3.z == 1.0;`,`toShift *= multiplyToByLineLength ? lineLength : 1.0;`,`duration *= multiplyDurationByLineLength ? lineLength : 1.0;`,`float fShift;`,`if (continuous) {`,...l({duration:`duration`,startTimeOffset:`atom1.y`,repeatDelay:`atom1.z`,timeOriginSelector:`atom1.w`,easing:`atom2.y`,playAnimation:`atom2.z`,reverseAnimation:`atom2.w`,out:`fShift`}),`} else {`,...c({duration:`duration`,startTimeOffset:`atom1.y`,repeatDelay:`atom1.z`,timeOriginSelector:`atom1.w`,repeatType:`atom2.x`,easing:`atom2.y`,playAnimation:`atom2.z`,reverseAnimation:`atom2.w`,out:`fShift`}),`}`,`float aShift = mix(fromShift, toShift, fShift);`,`vec4 pShift = in0;`,`out0 = mod(aShift + pShift, lineLength);`]}encode(e){return[[this.opcode,e.shift.from,e.shift.to,0],...p(e.shift.timing),[+!!e.multiplyToByLineLength,+!!e.multiplyDurationByLineLength,+!!e.continuous,0]]}}const _={scalar:new r,vector3:new i,vector4:new a,animatedTransform:new m,animatedColor:new h,animatedShift:new g,ret:new n},v=4;function y(e){let t=[];t.push(`float globalTime = ${e.globalTime};`),t.push(`float localTimeOrigin = ${e.localTimeOrigin};`),t.push(`float lineLength = ${e.lineLength};`),t.push(`float globalRotation = ${e.globalRotation};`),t.push(`vec2 pointer = ${e.animationPointer};`),t.push(`vec2 size = ${e.animationTextureSize};`),t.push(`int top = 0;`),t.push(`vec4 stack[4];`),t.push(`for (int counter = 0; counter < 40; counter++) {`),t.push(`vec4 atom0 = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push(`pointer.x += 1.0;`),t.push(`vec2 pixelDimensions = ${e.pixelDimensions};`),t.push(`if (false) {`);for(let n in _){let r=_[n];t.push(`} else if (int(atom0.x) == ${r.opcode}) {`);for(let n of r.generateSource(e))t.push(n)}return t.push(`} // End if-else.`),t.push(`} // End for.`),t.push(`${e.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),t.join(`
|
|
11
|
+
`,`out0 = vec4(translation, rotation, scale);`]}encode(e){return[[this.opcode,0,0,0],[e.translation.from[0],e.translation.from[1],e.translation.to[0],e.translation.to[1]],[e.rotation.from,e.rotation.to,e.scale.from,e.scale.to],...p(e.translation.timing),...p(e.rotation.timing),...p(e.scale.timing),[+!!e.relativeTranslation,+!!e.absoluteScale,+!!e.selectGlobalRotation,0]]}}class h extends e{constructor(){super(...arguments),this.opcode=++t,this.length=7,this.ins=1,this.outs=1,this.microcode=[`float fromOpacity = atom0.y;`,`float toOpacity = atom0.z;`,`vec4 fromColor = atom1;`,`vec4 toColor = atom2;`,`float fColor;`,`{`,...c({duration:`atom3.x`,startTimeOffset:`atom3.y`,repeatDelay:`atom3.z`,timeOriginSelector:`atom3.w`,repeatType:`atom4.x`,easing:`atom4.y`,playAnimation:`atom4.z`,reverseAnimation:`atom4.w`,out:`fColor`}),`}`,`float fOpacity;`,`{`,...c({duration:`atom5.x`,startTimeOffset:`atom5.y`,repeatDelay:`atom5.z`,timeOriginSelector:`atom5.w`,repeatType:`atom6.x`,easing:`atom6.y`,playAnimation:`atom6.z`,reverseAnimation:`atom6.w`,out:`fOpacity`}),`}`,`vec4 aColor = mix(fromColor, toColor, fColor);`,`aColor.a *= mix(fromOpacity, toOpacity, fOpacity);`,`vec4 pColor = in0;`,`out0 = aColor * pColor;`]}encode(e){return[[this.opcode,e.opacity.from,e.opacity.to,0],[e.color.from[0],e.color.from[1],e.color.from[2],e.color.from[3]],[e.color.to[0],e.color.to[1],e.color.to[2],e.color.to[3]],...p(e.color.timing),...p(e.opacity.timing)]}}class g extends e{constructor(){super(...arguments),this.opcode=++t,this.length=4,this.ins=1,this.outs=1,this.microcode=[`float fromShift = atom0.y;`,`float toShift = atom0.z;`,`float duration = atom1.x;`,`bool multiplyToByLineLength = atom3.x == 1.0;`,`bool multiplyDurationByLineLength = atom3.y == 1.0;`,`bool continuous = atom3.z == 1.0;`,`toShift *= multiplyToByLineLength ? lineLength : 1.0;`,`duration *= multiplyDurationByLineLength ? lineLength : 1.0;`,`float fShift;`,`if (continuous) {`,...l({duration:`duration`,startTimeOffset:`atom1.y`,repeatDelay:`atom1.z`,timeOriginSelector:`atom1.w`,easing:`atom2.y`,playAnimation:`atom2.z`,reverseAnimation:`atom2.w`,out:`fShift`}),`} else {`,...c({duration:`duration`,startTimeOffset:`atom1.y`,repeatDelay:`atom1.z`,timeOriginSelector:`atom1.w`,repeatType:`atom2.x`,easing:`atom2.y`,playAnimation:`atom2.z`,reverseAnimation:`atom2.w`,out:`fShift`}),`}`,`if (lineLength < 50.0) {`,` fShift = 0.0;`,`}`,`float aShift = mix(fromShift, toShift, fShift);`,`vec4 pShift = in0;`,`out0 = mod(aShift + pShift, lineLength);`]}encode(e){return[[this.opcode,e.shift.from,e.shift.to,0],...p(e.shift.timing),[+!!e.multiplyToByLineLength,+!!e.multiplyDurationByLineLength,+!!e.continuous,0]]}}const _={scalar:new r,vector3:new i,vector4:new a,animatedTransform:new m,animatedColor:new h,animatedShift:new g,ret:new n},v=4;function y(e){let t=[];t.push(`float globalTime = ${e.globalTime};`),t.push(`float localTimeOrigin = ${e.localTimeOrigin};`),t.push(`float lineLength = ${e.lineLength};`),t.push(`float globalRotation = ${e.globalRotation};`),t.push(`vec2 pointer = ${e.animationPointer};`),t.push(`vec2 size = ${e.animationTextureSize};`),t.push(`int top = 0;`),t.push(`vec4 stack[4];`),t.push(`for (int counter = 0; counter < 40; counter++) {`),t.push(`vec4 atom0 = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push(`pointer.x += 1.0;`),t.push(`vec2 pixelDimensions = ${e.pixelDimensions};`),t.push(`if (false) {`);for(let n in _){let r=_[n];t.push(`} else if (int(atom0.x) == ${r.opcode}) {`);for(let n of r.generateSource(e))t.push(n)}return t.push(`} // End if-else.`),t.push(`} // End for.`),t.push(`${e.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),t.join(`
|
|
12
12
|
`)}export{e as AAnimationInstruction,h as AnimatedColorInstruction,g as AnimatedShiftInstruction,m as AnimatedTransformInstruction,n as RetInstruction,r as ScalarInstruction,i as Vector3Instruction,a as Vector4Instruction,u as easingCodes,y as generateVirtualMachineSource,c as getTweenFactor,l as getUnclampedTweenFactor,_ as instructions,d as repeatTypeCodes,f as timeOriginSelectorCodes};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{pt2px as e}from"../../../../../core/screenUtils.js";import{labelPlacementOffsetPadding as t}from"../definitions.js";import n from"./BoundingBox.js";import{serializeList as r,deserializeList as i}from"../util/serializationUtils.js";class a{constructor(e,t,n,r,i,a,o,s,c,l,u,d=[],f=0,p=0,m=[]){this.displayId=e,this.labelClassId=t,this.labelIdHash=n,this.hash=r,this.anchorX=i,this.anchorY=a,this.directionX=o,this.directionY=s,this.maxScale=c,this.minScale=l,this.referenceBounds=u,this.bounds=d,this.recordStart=f,this.recordCount=p,this.additionalRecordRanges=m,this.priority=0,this._colliders=null,this.referenceSymbolVVOffset=[0,0],this.uniqueSymbol=null,this.labelStoreId=null,this.selectedForRendering=!1,this._calloutCollisionBounds=null}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(n,r){if(!this._colliders||r!=null&&r!==this._collidersScale){if(!n||r==null)throw Error(`InternalError: Label collision context and view scale are required to compute colliders`);let i=n.attributeView,a=t,o=this.referenceBounds?.size??0,s=Math.round(e(o)),c=n.labelingCollisionInfos[0].vvEvaluators[0];if(this.referenceSymbolVVOffset=[0,0],c!=null){let e=c(i.getVisualVariableData(this.displayId,0),r);if(!isNaN(e)&&e!=null&&e!==1/0){o=e;let t=(o-s)/2;this.referenceSymbolVVOffset=[this.directionX*t,this.directionY*t]}}let l=this.minScale?n.tilingScheme.scaleToZoom(this.minScale):0,u=this.maxScale?n.tilingScheme.scaleToZoom(this.maxScale):25,d=e(this.referenceBounds?.offsetX??0)+this.directionX*(a+o/2),f=-e(this.referenceBounds?.offsetY??0)+this.directionY*(a+o/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+f,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:l,maxLod:u})),this._collidersScale=r}return this._colliders}get id(){return this.displayId}includeRecordRange(e,t){t!==0&&(e===this.recordStart+this.recordCount?this.recordCount+=t:this.additionalRecordRanges.push({recordStart:e,recordCount:t}))}includeCalloutCollisionBounds(e){let t=o(e);t&&(this._calloutCollisionBounds?this._calloutCollisionBounds.extend(t):(this._calloutCollisionBounds=t,this.bounds.push(t)),this.
|
|
2
|
+
import{pt2px as e}from"../../../../../core/screenUtils.js";import{labelPlacementOffsetPadding as t}from"../definitions.js";import n from"./BoundingBox.js";import{serializeList as r,deserializeList as i}from"../util/serializationUtils.js";class a{constructor(e,t,n,r,i,a,o,s,c,l,u,d=[],f=0,p=0,m=[]){this.displayId=e,this.labelClassId=t,this.labelIdHash=n,this.hash=r,this.anchorX=i,this.anchorY=a,this.directionX=o,this.directionY=s,this.maxScale=c,this.minScale=l,this.referenceBounds=u,this.bounds=d,this.recordStart=f,this.recordCount=p,this.additionalRecordRanges=m,this.priority=0,this._colliders=null,this.referenceSymbolVVOffset=[0,0],this.uniqueSymbol=null,this.labelStoreId=null,this.selectedForRendering=!1,this._calloutCollisionBounds=null}get xTile(){return this.anchorX}get yTile(){return this.anchorY}invalidateColliders(){this._colliders=null}colliders(n,r){if(!this._colliders||r!=null&&r!==this._collidersScale){if(!n||r==null)throw Error(`InternalError: Label collision context and view scale are required to compute colliders`);let i=n.attributeView,a=t,o=this.referenceBounds?.size??0,s=Math.round(e(o)),c=n.labelingCollisionInfos[0].vvEvaluators[0];if(this.referenceSymbolVVOffset=[0,0],c!=null){let e=c(i.getVisualVariableData(this.displayId,0),r);if(!isNaN(e)&&e!=null&&e!==1/0){o=e;let t=(o-s)/2;this.referenceSymbolVVOffset=[this.directionX*t,this.directionY*t]}}let l=this.minScale?n.tilingScheme.scaleToZoom(this.minScale):0,u=this.maxScale?n.tilingScheme.scaleToZoom(this.maxScale):25,d=e(this.referenceBounds?.offsetX??0)+this.directionX*(a+o/2),f=-e(this.referenceBounds?.offsetY??0)+this.directionY*(a+o/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+f,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:l,maxLod:u})),this._collidersScale=r}return this._colliders}get id(){return this.displayId}includeRecordRange(e,t){t!==0&&(e===this.recordStart+this.recordCount?this.recordCount+=t:this.additionalRecordRanges.push({recordStart:e,recordCount:t}))}includeCalloutCollisionBounds(e){let t=o(e);t&&(this._calloutCollisionBounds?this._calloutCollisionBounds.extend(t):(this._calloutCollisionBounds=t,this.bounds.push(t)),this.invalidateColliders())}includeCalloutPartCollisionBounds(e){let t=o(e);t&&!this.bounds.some(e=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height)&&(this.bounds.push(t),this.invalidateColliders())}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.push(this.additionalRecordRanges.length);for(let t of this.additionalRecordRanges)e.push(t.recordStart),e.push(t.recordCount);e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),r(e,this.bounds)}static deserialize(e){let t=e.readInt32(),r=e.readInt32(),o=e.readInt32(),s=e.readInt32(),c=e.readInt32(),l=e.readInt32(),u=e.readInt32(),d=[];for(let t=0;t<u;t++)d.push({recordStart:e.readInt32(),recordCount:e.readInt32()});let f=e.readF32(),p=e.readF32(),m=e.readF32(),h=e.readF32(),g=e.readF32(),_=e.readF32(),v=e.readF32(),y=e.readF32(),b=e.readF32(),x=i(e,n)??[];return new a(t,r,o,s,f,p,m,h,g,_,{size:v,offsetX:y,offsetY:b},x,c,l,d)}}function o(e){let t=e.xmax-e.xmin,r=e.ymax-e.ymin;return e.xmin==null||isNaN(e.xmin)||e.ymin==null||isNaN(e.ymin)||e.xmax==null||isNaN(e.xmax)||e.ymax==null||isNaN(e.ymax)||t<=0||r<=0?null:new n(e.xmin+t/2,-(e.ymin+r/2),t,r)}export{a as LabelMetric};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../core/Logger.js";import{labelAnchorStoreUnit as t,labelStoreUnit as n}from"../definitions.js";import{PixelType as r}from"../../../../webgl/enums.js";import i from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";const o=()=>e.getLogger(`esri.views.2d.engine.webgl.collisions.LabelStore`);class s{constructor(){this._data=new Uint8Array(4096),this._anchors=new Float32Array(4096),this._dirtyStart=0,this._dirtyEnd=0,this._entries=new Map,this._freeIds=[],this._nextId=1,this._size=32,this._data[3]=255}get size(){return this._size}get usedMemory(){return this._data.byteLength+this._anchors.byteLength}destroy(){this._entries.size&&o().warn(`InternalError: Leaking label store entries`),this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._entries.clear(),this._freeIds.length=0}acquire(e){if(e.labelStoreId!=null)return e.labelStoreId;let t=this._freeIds.pop()??this._nextId++;return this._ensureCapacity(t),this._entries.set(t,e),this._writeFeatureId(t,e.displayId),this._writeAnchor(t,e.anchorX,e.anchorY),this._data[t*4+3]=255,this._markDirty(t),e.labelStoreId=t,t}release(e){let t=e.labelStoreId;if(t!=null){if(this._entries.get(t)!==e)throw Error(`InternalError: expected label store entry`);this._entries.delete(t),this._data.fill(0,t*4,t*4+4),this._data[t*4+3]=255,this._anchors.fill(0,t*4,t*4+4),this._markDirty(t),e.labelStoreId=null,this._freeIds.push(t)}}setVisibility(e,t){let n=e.labelStoreId;if(n==null||this._entries.get(n)!==e)throw Error(`InternalError: expected label metric to have a store id`);let r=t?0:255,i=n*4+3;this._writeReferenceSymbolVVOffset(n,e.referenceSymbolVVOffset),this._data[i]!==r&&(this._data[i]=r,this._markDirty(n))}getVisibility(e){let t=e.labelStoreId;return t==null?255:this._data[t*4+3]}has(e){return e.labelStoreId!=null&&this._entries.get(e.labelStoreId)===e}getAnchor(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t],this._anchors[t+1]]}getReferenceSymbolVVOffset(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t+2],this._anchors[t+3]]}upload(e){let t=this._texture??this._createTexture(e,!1),n=this._anchorTexture??this._createTexture(e,!0);this._uploadDirty(t,n)}getTexture(e){let r=this._texture??this._createTexture(e,!1),i=this._anchorTexture??this._createTexture(e,!0);if(this._dirtyStart!==1/0)throw Error(`InternalError: expected label store to be uploaded before rendering`);return{labelStoreTexture:{texture:r,unit:n},labelAnchorStoreTexture:{texture:i,unit:t}}}_createTexture(e,t){let n=new a(this._size);n.wrapMode=33071,n.samplingMode=9728,n.pixelFormat=6408,n.dataType=t?r.FLOAT:r.UNSIGNED_BYTE;let o=new i(e,n,t?this._anchors:this._data);return t?this._anchorTexture=o:this._texture=o,o}_ensureCapacity(e){if(e<this._size*this._size)return;let t=this._size;for(;e>=t*t;)t*=2;let n=new Uint8Array(t*t*4);n.set(this._data),this._data=n;let r=new Float32Array(t*t*4);r.set(this._anchors),this._anchors=r,this._size=t,this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._dirtyStart=0,this._dirtyEnd=e}_writeFeatureId(e,t){let n=e*4;this._data[n]=t&255,this._data[n+1]=t>>8&255,this._data[n+2]=t>>16&255,this._markDirty(e)}_writeAnchor(e,t,n){let r=e*4;this._anchors[r]=t,this._anchors[r+1]=n,this._markDirty(e)}_writeReferenceSymbolVVOffset(e,[t,n]){let r=e*4;(this._anchors[r+2]!==t||this._anchors[r+3]!==n)&&(this._anchors[r+2]=t,this._anchors[r+3]=n,this._markDirty(e))}_markDirty(e){this._dirtyStart=Math.min(this._dirtyStart,e),this._dirtyEnd=Math.max(this._dirtyEnd,e)}_uploadDirty(e,t){if(this._dirtyStart===1/0)return;let n=Math.floor(this._dirtyStart/this._size),r=Math.floor(this._dirtyEnd/this._size),i=n*this._size*4,a=(r+1)*this._size*4;e.updateData(0,0,n,this._size,r-n+1,this._data.subarray(i,a)),t.updateData(0,0,n,this._size,r-n+1,this._anchors.subarray(i,a)),this._dirtyStart=1/0,this._dirtyEnd=0}}export{s as LabelStore};
|
|
2
|
+
import e from"../../../../../core/Logger.js";import{labelAnchorStoreUnit as t,labelStoreUnit as n}from"../definitions.js";import{PixelType as r}from"../../../../webgl/enums.js";import i from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";const o=()=>e.getLogger(`esri.views.2d.engine.webgl.collisions.LabelStore`);class s{constructor(){this._data=new Uint8Array(4096),this._anchors=new Float32Array(4096),this._dirtyStart=0,this._dirtyEnd=0,this._entries=new Map,this._freeIds=[],this._nextId=1,this._size=32,this._data[3]=255}get size(){return this._size}get usedMemory(){return this._data.byteLength+this._anchors.byteLength}destroy(){this._entries.size&&o().warn(`InternalError: Leaking label store entries`),this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._entries.clear(),this._freeIds.length=0}acquire(e){if(e.labelStoreId!=null)return e.labelStoreId;let t=this._freeIds.pop()??this._nextId++;return this._ensureCapacity(t),this._entries.set(t,e),this._writeFeatureId(t,e.displayId),this._writeAnchor(t,e.anchorX,e.anchorY),this._data[t*4+3]=255,this._markDirty(t),e.labelStoreId=t,t}release(e){let t=e.labelStoreId;if(t!=null){if(this._entries.get(t)!==e)throw Error(`InternalError: expected label store entry`);this._entries.delete(t),this._data.fill(0,t*4,t*4+4),this._data[t*4+3]=255,this._anchors.fill(0,t*4,t*4+4),this._markDirty(t),e.labelStoreId=null,this._freeIds.push(t)}}invalidateColliders(){for(let e of this._entries.values())e.invalidateColliders()}setVisibility(e,t){let n=e.labelStoreId;if(n==null||this._entries.get(n)!==e)throw Error(`InternalError: expected label metric to have a store id`);let r=t?0:255,i=n*4+3;this._writeReferenceSymbolVVOffset(n,e.referenceSymbolVVOffset),this._data[i]!==r&&(this._data[i]=r,this._markDirty(n))}getVisibility(e){let t=e.labelStoreId;return t==null?255:this._data[t*4+3]}has(e){return e.labelStoreId!=null&&this._entries.get(e.labelStoreId)===e}getAnchor(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t],this._anchors[t+1]]}getReferenceSymbolVVOffset(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t+2],this._anchors[t+3]]}upload(e){let t=this._texture??this._createTexture(e,!1),n=this._anchorTexture??this._createTexture(e,!0);this._uploadDirty(t,n)}getTexture(e){let r=this._texture??this._createTexture(e,!1),i=this._anchorTexture??this._createTexture(e,!0);if(this._dirtyStart!==1/0)throw Error(`InternalError: expected label store to be uploaded before rendering`);return{labelStoreTexture:{texture:r,unit:n},labelAnchorStoreTexture:{texture:i,unit:t}}}_createTexture(e,t){let n=new a(this._size);n.wrapMode=33071,n.samplingMode=9728,n.pixelFormat=6408,n.dataType=t?r.FLOAT:r.UNSIGNED_BYTE;let o=new i(e,n,t?this._anchors:this._data);return t?this._anchorTexture=o:this._texture=o,o}_ensureCapacity(e){if(e<this._size*this._size)return;let t=this._size;for(;e>=t*t;)t*=2;let n=new Uint8Array(t*t*4);n.set(this._data),this._data=n;let r=new Float32Array(t*t*4);r.set(this._anchors),this._anchors=r,this._size=t,this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._dirtyStart=0,this._dirtyEnd=e}_writeFeatureId(e,t){let n=e*4;this._data[n]=t&255,this._data[n+1]=t>>8&255,this._data[n+2]=t>>16&255,this._markDirty(e)}_writeAnchor(e,t,n){let r=e*4;this._anchors[r]=t,this._anchors[r+1]=n,this._markDirty(e)}_writeReferenceSymbolVVOffset(e,[t,n]){let r=e*4;(this._anchors[r+2]!==t||this._anchors[r+3]!==n)&&(this._anchors[r+2]=t,this._anchors[r+3]=n,this._markDirty(e))}_markDirty(e){this._dirtyStart=Math.min(this._dirtyStart,e),this._dirtyEnd=Math.max(this._dirtyEnd,e)}_uploadDirty(e,t){if(this._dirtyStart===1/0)return;let n=Math.floor(this._dirtyStart/this._size),r=Math.floor(this._dirtyEnd/this._size),i=n*this._size*4,a=(r+1)*this._size*4;e.updateData(0,0,n,this._size,r-n+1,this._data.subarray(i,a)),t.updateData(0,0,n,this._size,r-n+1,this._anchors.subarray(i,a)),this._dirtyStart=1/0,this._dirtyEnd=0}}export{s as LabelStore};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import has from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{createScreenPoint as o,isScreenPoint as s,isScreenRect as c,isScreenPolygon as l,pt2px as u}from"../../../core/screenUtils.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{diff as p,hasDiff as m}from"../../../core/accessorSupport/diffUtils.js";import h from"../../../geometry/Point.js";import{fromValues as g,create as _}from"../../../geometry/support/aaBoundingRect.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{isVectorTileGraphicOrigin as y}from"../../../graphic/isVectorTileGraphicOrigin.js";import b from"../../../graphic/VectorTileGraphicOrigin.js";import{tileSizeInTileUnits as x,tileSizeInPixels as S}from"../engine/vectorTiles/constants.js";import{TileHandler as C}from"../engine/vectorTiles/TileHandler.js";import{TileManager as w}from"../engine/vectorTiles/TileManager.js";import{VectorTile as T}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as E}from"../engine/vectorTiles/VectorTileContainer.js";import D from"../engine/vectorTiles/VectorTileFeatureIndex.js";import{isSearchCircleOverlappingSymbol as O,isSearchPolygonOverlappingSymbol as k}from"../engine/vectorTiles/decluttering/util.js";import A from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2D as j}from"./LayerView2D.js";import{getBbox as M,getMapPointsFromScreen as N}from"../support/hitTestUtils.js";import P from"../tiling/TileInfoViewPOT.js";import F from"../tiling/TileQueue.js";import I from"../../layers/VectorTileLayerView.js";import{TaskPriority as L}from"../../support/Scheduler.js";let R=class extends j(I){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return(this._vectorTileContainer?.fading||this._tileManager?.isFading())??!1}get hasVisibleFeatures(){let e=this._vectorTileContainer.children;for(let t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){let n=this._tileHandlerPromise,r=this._vectorTileContainer?.symbolFader;if(!n||!this._isTileHandlerReady||!r)return;await n;let i=[],a,d=c(t),f=l(t);if(d){let e=t;i=[o(e.x,e.y+e.height),o(e.x+e.width,e.y+e.height),o(e.x+e.width,e.y),o(e.x,e.y)],a=`rect`}else f?(i=t.map(e=>e),a=`polygon`):(i=[t],a=`point`);let p=has(`esri-vtl-search-tolerance`)??0,m=p>0?p:2.5,h=this.view.state,{rotation:_,pixelRatio:v}=this.view.state,y=u(m)*v,b=null,x=this._vectorTileContainer?.symbolRepository;x&&(b=x.querySymbols());let S=[];if(b)for(let e of b){let{styleLayerUID:t,vtlSymbol:n,tileKey:o}=e;a===`point`&&O(n,i[0],y,r.decluttererOffset)&&S.push({vtlSymbol:n,styleLayerUID:t,tileKey:o}),k(n,i,r.decluttererOffset)&&S.push({vtlSymbol:n,styleLayerUID:t,tileKey:o})}let C;if(s(t)){let e=[0,0],n=[0,0];h.toMap(e,t.x-y,t.y+y),h.toMap(n,t.x+y,t.y-y),C=g(Math.min(e[0],n[0]),Math.min(e[1],n[1]),Math.max(e[0],n[0]),Math.max(e[1],n[1]))}else{let e=i.map(({x:e,y:t})=>{let n=[0,0];return h.toMap(n,e,t),n});C=M([e])}let w=this._tileManager.getIntersectingTiles(C,S);if(S=S?.filter(e=>this._styleRepository.getStyleLayerVisibility(e.styleLayerUID)),(!w||w.length===0)&&S?.length===0)return null;let T=N(this.view,i),E=[],D=[];for(let e of w)E.push(this._queryTile(D,T,y,_,e,S?.filter(t=>t.tileKey.id===e.id),d?`rect`:f?`polygon`:`point`));return await Promise.all(E),D}update(e){this._tileHandlerPromise&&this._isTileHandlerReady&&(e.pixelRatio===this._tileHandler.devicePixelRatio?this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()):(this._tileHandler.devicePixelRatio=e.pixelRatio,this._loadStyle()))}attach(){let{style:e}=this.layer.currentStyleInfo;this._styleRepository=new A(e),this._tileInfoView=new P(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new E(this._tileInfoView),this._tileHandler=new C(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1,this.view.glyphMosaic()),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on(`paint-change`,e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:0,data:e}),this.requestUpdate();else{let t=this._styleRepository,n=t.getLayerById(e.layer);if(!n)return;let r=n.type===3;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on(`layout-change`,e=>{let t=this._styleRepository,n=t.getLayerById(e.layer);if(!n)return;this._styeChanged=!0;let r=p(n.layout,e.layout);r!=null&&(m(r,`visibility`)&&z(r)===1?(t.setLayoutProperties(e.layer,e.layout),n.type===3&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()):(this._styleChanges.push({type:1,data:e}),this.requestUpdate()))}),this.layer.on(`style-layer-visibility-change`,e=>{let t=this._styleRepository,n=t.getLayerById(e.layer);n&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),n.type===3&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on(`style-layer-change`,e=>{this._styleChanges.push({type:2,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on(`delete-style-layer`,e=>{this._styleChanges.push({type:3,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on(`load-style`,()=>this._loadStyle()),this.layer.on(`spriteSource-change`,e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:4,data:e});let t=this._styleRepository.layers;for(let e of t)switch(e.type){case 3:e.getLayoutProperty(`icon-image`)&&this._styleChanges.push({type:1,data:{layer:e.id,layout:e.layout}});break;case 2:e.getPaintProperty(`line-pattern`)&&this._styleChanges.push({type:0,data:{layer:e.id,paint:e.paint,isDataDriven:e.isPainterDataDriven()}});break;case 1:e.getLayoutProperty(`fill-pattern`)&&this._styleChanges.push({type:0,data:{layer:e.id,paint:e.paint,isDataDriven:e.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=i(this._vectorTileContainer),this._tileHandler=i(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return v(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume(),{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){let n=this.view.scale,{minScale:r,maxScale:i}=t.layerDefinition;t?.layerDefinition&&(r&&r<n&&(e=!1),i&&i>n&&(e=!1))}return e}isUpdating(){return this.fading||!this._isTileHandlerReady}acquireTile(e){let t=this._createVectorTile(e);return this._updatingHandles.consumePromise(this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once(`attach`,()=>this.requestUpdate()),t.setData(e),this.requestUpdate()}).catch(e=>{a(e)||r.getLogger(this).error(e)})),t}releaseTile(e){let t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended){this._tileManager.clear(),this.requestUpdate();return}this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();let e=this._vectorTileContainer.children,t=[];try{for(let n of e){let e=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(e=>this._parseQueue.push({key:n.key,data:e})).then(e=>n.setData(e)).finally(()=>n.featureIndex=null));t.push(e)}await Promise.all(t)}catch(e){r.getLogger(this).error(`error refreshing vector-tiles layer-view`,e),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new w({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;let e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new F({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:L.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new F({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:L.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;let e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=i(this._fetchQueue),this._parseQueue=i(this._parseQueue),this._tileManager=i(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();let e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(e){r.getLogger(this).error(`error applying vector-tiles style update`,e.message),this._resumeQueues(),this._isTileHandlerReady=!0}let t=this._styleRepository,n=new Set,i=new Set;for(let r of e){if(r.type!==3&&r.type!==2)continue;let e=r.type===2?r.data.layer.id:r.data.layer,a=t.getLayerById(e);a&&(n.add(a.uid),a.type===3&&i.add(a.uid))}let a=this._vectorTileContainer.children,o=this._vectorTileContainer?.symbolFader?.symbolRepository;o&&i.size>0&&o.deleteStyleLayers(Array.from(i));let s=new Set;if(e.forEach(e=>{let n;switch(e.type){case 0:t.setPaintProperties(e.data.layer,e.data.paint),n=e.data.layer;break;case 1:t.setLayoutProperties(e.data.layer,e.data.layout),n=e.data.layer;break;case 3:t.deleteStyleLayer(e.data.layer);return;case 2:t.setStyleLayer(e.data.layer,e.data.index),n=e.data.layer.id;break;case 4:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(n){let e=t.getLayerById(n);e&&s.add(e.uid)}}),n.size>0){let e=Array.from(n);this._vectorTileContainer.deleteStyleLayers(e);for(let t of a)t.deleteLayerData(e)}if(this._resumeQueues(),s.size>0){let e=Array.from(s),t=[];for(let n of a){let r=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(t=>this._parseQueue.push({key:n.key,data:t,styleLayerUIDs:e})).then(e=>n.setData(e)).finally(()=>n.featureIndex=null));t.push(r)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){let{style:e}=this.layer.currentStyleInfo,t=n(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new A(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;let{signal:r}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(e){if(!a(e))throw e}if(r.aborted){this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,this.requestUpdate();return}let i=await this._tileHandler.spriteMosaic,o=this._vectorTileContainer;this._tileInfoView=new P(this.layer.tileInfo,this.layer.fullExtent),o.setStyleResources(i,this.view.glyphMosaic(),this._styleRepository,this._tileInfoView),this._tileManager=new w({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){let t=this._tileInfoView.getTileBounds(_(),e),n=this._tileInfoView.getTileResolution(e.level);return new T(e,n,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,n,r,i,a,o,s){if(a.layerData.size===0)return;let c=this._ensureTileIndex(a),l=this._tileInfoView.getTileBounds(_(),a.key,!0),u=n.map(e=>{let[t,n,r,i]=l;return[x*((e.x-t)/(r-t)),x*(1-(e.y-n)/(i-n))]}),d=this.view.featuresTilingScheme.tileInfo.scaleToZoom(this.view.state.scale)-a.key.level,f=d>0?2**d:1,p=r/f*(x/S),m=await c.queryAttributes(u,p,s);for(let r of m){let{layer:a,feature:o}=r;this._styleRepository.getStyleLayerVisibility(a.uid)&&a.isIntersectingFeature(u,p,o,c.tileKey.level,i,f,r,s)&&e.push({type:`graphic`,layer:this.layer,graphic:new t({attributes:o.values,origin:new b(this.layer,r.layer.id,r.layer.uid)}),mapPoint:s===`point`?n[0].clone():null})}(await c.getSymbolHitResults([],o)).map(t=>{t.graphic.geometry=this._tileToMapPoint(t.tilePoint,a.transforms.tileUnitsToPixels),e.push({type:`graphic`,layer:this.layer,graphic:t.graphic,mapPoint:s===`point`?n[0].clone():null})}),e.sort((e,t)=>(y(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(y(e.graphic.origin)?e.graphic.origin.layerIndex:0))}_tileToMapPoint(e,t){if(!e)return null;let n=e[0]*t[0]+e[1]*t[3]+t[6],r=e[0]*t[1]+e[1]*t[4]+t[7],i=this.view.state,a=[0,0];return i.toMap(a,[n,r]),new h({x:a[0],y:a[1],spatialReference:i.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=D.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};e([d()],R.prototype,`_isTileHandlerReady`,void 0),R=e([f(`esri.views.2d.layers.VectorTileLayerView2D`)],R);function z(e){if(e==null)return 0;switch(e.type){case`partial`:return Object.keys(e.diff).length;case`complete`:return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case`collection`:return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}const B=R;export{B as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import has from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{createScreenPoint as o,isScreenPoint as s,isScreenRect as c,isScreenPolygon as l,pt2px as u}from"../../../core/screenUtils.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{diff as p,hasDiff as m}from"../../../core/accessorSupport/diffUtils.js";import h from"../../../geometry/Point.js";import{fromValues as g,create as _}from"../../../geometry/support/aaBoundingRect.js";import{isVectorTileGraphicOrigin as v}from"../../../graphic/isVectorTileGraphicOrigin.js";import y from"../../../graphic/VectorTileGraphicOrigin.js";import{tileSizeInTileUnits as b,tileSizeInPixels as x}from"../engine/vectorTiles/constants.js";import{TileHandler as S}from"../engine/vectorTiles/TileHandler.js";import{TileManager as C}from"../engine/vectorTiles/TileManager.js";import{VectorTile as w}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as T}from"../engine/vectorTiles/VectorTileContainer.js";import E from"../engine/vectorTiles/VectorTileFeatureIndex.js";import{isSearchCircleOverlappingSymbol as D,isSearchPolygonOverlappingSymbol as O}from"../engine/vectorTiles/decluttering/util.js";import{createTileInfoView as k,supportsSpatialReference as A}from"../engine/vectorTiles/style/geoJSONVectorTileUtils.js";import j from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2D as M}from"./LayerView2D.js";import{getBbox as N,getMapPointsFromScreen as P}from"../support/hitTestUtils.js";import F from"../tiling/TileQueue.js";import I from"../../layers/VectorTileLayerView.js";import{TaskPriority as L}from"../../support/Scheduler.js";let R=class extends M(I){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return(this._vectorTileContainer?.fading||this._tileManager?.isFading())??!1}get hasVisibleFeatures(){let e=this._vectorTileContainer.children;for(let t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){let n=this._tileHandlerPromise,r=this._vectorTileContainer?.symbolFader;if(!n||!this._isTileHandlerReady||!r)return;await n;let i=[],a,d=c(t),f=l(t);if(d){let e=t;i=[o(e.x,e.y+e.height),o(e.x+e.width,e.y+e.height),o(e.x+e.width,e.y),o(e.x,e.y)],a=`rect`}else f?(i=t.map(e=>e),a=`polygon`):(i=[t],a=`point`);let p=has(`esri-vtl-search-tolerance`)??0,m=p>0?p:2.5,h=this.view.state,{rotation:_,pixelRatio:v}=this.view.state,y=u(m)*v,b=null,x=this._vectorTileContainer?.symbolRepository;x&&(b=x.querySymbols());let S=[];if(b)for(let e of b){let{styleLayerUID:t,vtlSymbol:n,tileKey:o}=e;a===`point`&&D(n,i[0],y,r.decluttererOffset)&&S.push({vtlSymbol:n,styleLayerUID:t,tileKey:o}),O(n,i,r.decluttererOffset)&&S.push({vtlSymbol:n,styleLayerUID:t,tileKey:o})}let C;if(s(t)){let e=[0,0],n=[0,0];h.toMap(e,t.x-y,t.y+y),h.toMap(n,t.x+y,t.y-y),C=g(Math.min(e[0],n[0]),Math.min(e[1],n[1]),Math.max(e[0],n[0]),Math.max(e[1],n[1]))}else{let e=i.map(({x:e,y:t})=>{let n=[0,0];return h.toMap(n,e,t),n});C=N([e])}let w=this._tileManager.getIntersectingTiles(C,S);if(S=S?.filter(e=>this._styleRepository.getStyleLayerVisibility(e.styleLayerUID)),(!w||w.length===0)&&S?.length===0)return null;let T=P(this.view,i),E=[],k=[];for(let e of w)E.push(this._queryTile(k,T,y,_,e,S?.filter(t=>t.tileKey.id===e.id),d?`rect`:f?`polygon`:`point`));return await Promise.all(E),k}update(e){this._tileHandlerPromise&&this._isTileHandlerReady&&(e.pixelRatio===this._tileHandler.devicePixelRatio?this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()):(this._tileHandler.devicePixelRatio=e.pixelRatio,this._loadStyle()))}attach(){let{style:e}=this.layer.currentStyleInfo;this._styleRepository=new j(e),this._tileInfoView=k(this.layer,this.view.spatialReference),this._vectorTileContainer=new T(this._tileInfoView),this._tileHandler=new S(this.layer,this._styleRepository,window.devicePixelRatio||1,this._tileInfoView.tileInfo.lods.length-1,this.view.glyphMosaic(),()=>this._tileInfoView.tileInfo),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on(`paint-change`,e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:0,data:e}),this.requestUpdate();else{let t=this._styleRepository,n=t.getLayerById(e.layer);if(!n)return;let r=n.type===3;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on(`layout-change`,e=>{let t=this._styleRepository,n=t.getLayerById(e.layer);if(!n)return;this._styeChanged=!0;let r=p(n.layout,e.layout);r!=null&&(m(r,`visibility`)&&z(r)===1?(t.setLayoutProperties(e.layer,e.layout),n.type===3&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()):(this._styleChanges.push({type:1,data:e}),this.requestUpdate()))}),this.layer.on(`style-layer-visibility-change`,e=>{let t=this._styleRepository,n=t.getLayerById(e.layer);n&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),n.type===3&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on(`style-layer-change`,e=>{this._styleChanges.push({type:2,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on(`delete-style-layer`,e=>{this._styleChanges.push({type:3,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on(`load-style`,()=>this._loadStyle()),this.layer.on(`spriteSource-change`,e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:4,data:e});let t=this._styleRepository.layers;for(let e of t)switch(e.type){case 3:e.getLayoutProperty(`icon-image`)&&this._styleChanges.push({type:1,data:{layer:e.id,layout:e.layout}});break;case 2:e.getPaintProperty(`line-pattern`)&&this._styleChanges.push({type:0,data:{layer:e.id,paint:e.paint,isDataDriven:e.isPainterDataDriven()}});break;case 1:e.getLayoutProperty(`fill-pattern`)&&this._styleChanges.push({type:0,data:{layer:e.id,paint:e.paint,isDataDriven:e.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=i(this._vectorTileContainer),this._tileHandler=i(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return A(this.layer,e)}canResume(){let e=super.canResume(),{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){let n=this.view.scale,{minScale:r,maxScale:i}=t.layerDefinition;t?.layerDefinition&&(r&&r<n&&(e=!1),i&&i>n&&(e=!1))}return e}isUpdating(){return this.fading||!this._isTileHandlerReady}acquireTile(e){let t=this._createVectorTile(e);return this._updatingHandles.consumePromise(this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once(`attach`,()=>this.requestUpdate()),t.setData(e),this.requestUpdate()}).catch(e=>{a(e)||r.getLogger(this).error(e)})),t}releaseTile(e){let t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended){this._tileManager.clear(),this.requestUpdate();return}this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();let e=this._vectorTileContainer.children,t=[];try{for(let n of e){let e=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(e=>this._parseQueue.push({key:n.key,data:e})).then(e=>n.setData(e)).finally(()=>n.featureIndex=null));t.push(e)}await Promise.all(t)}catch(e){r.getLogger(this).error(`error refreshing vector-tiles layer-view`,e),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new C({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;let e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new F({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:L.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new F({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:L.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;let e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=i(this._fetchQueue),this._parseQueue=i(this._parseQueue),this._tileManager=i(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();let e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(e){r.getLogger(this).error(`error applying vector-tiles style update`,e.message),this._resumeQueues(),this._isTileHandlerReady=!0}let t=this._styleRepository,n=new Set,i=new Set;for(let r of e){if(r.type!==3&&r.type!==2)continue;let e=r.type===2?r.data.layer.id:r.data.layer,a=t.getLayerById(e);a&&(n.add(a.uid),a.type===3&&i.add(a.uid))}let a=this._vectorTileContainer.children,o=this._vectorTileContainer?.symbolFader?.symbolRepository;o&&i.size>0&&o.deleteStyleLayers(Array.from(i));let s=new Set;if(e.forEach(e=>{let n;switch(e.type){case 0:t.setPaintProperties(e.data.layer,e.data.paint),n=e.data.layer;break;case 1:t.setLayoutProperties(e.data.layer,e.data.layout),n=e.data.layer;break;case 3:t.deleteStyleLayer(e.data.layer);return;case 2:t.setStyleLayer(e.data.layer,e.data.index),n=e.data.layer.id;break;case 4:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(n){let e=t.getLayerById(n);e&&s.add(e.uid)}}),n.size>0){let e=Array.from(n);this._vectorTileContainer.deleteStyleLayers(e);for(let t of a)t.deleteLayerData(e)}if(this._resumeQueues(),s.size>0){let e=Array.from(s),t=[];for(let n of a){let r=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(t=>this._parseQueue.push({key:n.key,data:t,styleLayerUIDs:e})).then(e=>n.setData(e)).finally(()=>n.featureIndex=null));t.push(r)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){let{style:e}=this.layer.currentStyleInfo,t=n(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new j(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;let{signal:r}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(e){if(!a(e))throw e}if(r.aborted){this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,this.requestUpdate();return}let i=await this._tileHandler.spriteMosaic,o=this._vectorTileContainer;this._tileInfoView=k(this.layer,this.view.spatialReference),o.setStyleResources(i,this.view.glyphMosaic(),this._styleRepository,this._tileInfoView),this._tileManager=new C({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){let t=this._tileInfoView.getTileBounds(_(),e),n=this._tileInfoView.getTileResolution(e.level);return new w(e,n,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,n,r,i,a,o,s){if(a.layerData.size===0)return;let c=this._ensureTileIndex(a),l=this._tileInfoView.getTileBounds(_(),a.key,!0),u=n.map(e=>{let[t,n,r,i]=l;return[b*((e.x-t)/(r-t)),b*(1-(e.y-n)/(i-n))]}),d=this.view.featuresTilingScheme.tileInfo.scaleToZoom(this.view.state.scale)-a.key.level,f=d>0?2**d:1,p=r/f*(b/x),m=await c.queryAttributes(u,p,s);for(let r of m){let{layer:a,feature:o}=r;this._styleRepository.getStyleLayerVisibility(a.uid)&&a.isIntersectingFeature(u,p,o,c.tileKey.level,i,f,r,s)&&e.push({type:`graphic`,layer:this.layer,graphic:new t({attributes:o.values,origin:new y(this.layer,r.layer.id,r.layer.uid)}),mapPoint:s===`point`?n[0].clone():null})}(await c.getSymbolHitResults([],o)).map(t=>{t.graphic.geometry=this._tileToMapPoint(t.tilePoint,a.transforms.tileUnitsToPixels),e.push({type:`graphic`,layer:this.layer,graphic:t.graphic,mapPoint:s===`point`?n[0].clone():null})}),e.sort((e,t)=>(v(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(v(e.graphic.origin)?e.graphic.origin.layerIndex:0))}_tileToMapPoint(e,t){if(!e)return null;let n=e[0]*t[0]+e[1]*t[3]+t[6],r=e[0]*t[1]+e[1]*t[4]+t[7],i=this.view.state,a=[0,0];return i.toMap(a,[n,r]),new h({x:a[0],y:a[1],spatialReference:i.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=E.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};e([d()],R.prototype,`_isTileHandlerReady`,void 0),R=e([f(`esri.views.2d.layers.VectorTileLayerView2D`)],R);function z(e){if(e==null)return 0;switch(e.type){case`partial`:return Object.keys(e.diff).length;case`complete`:return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case`collection`:return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}const B=R;export{B as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/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 n}from"../../../../core/signal.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{ClipMesh as i}from"../../engine/webgl/ClipMesh.js";import{effectFlag0 as a,filterFlag0 as o}from"../../engine/webgl/definitions.js";import s from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as c}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as l}from"./FeatureTilePresentStrategy.js";import{RenderState as u}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";import{createHittestQuery as f}from"../../support/hitTestUtils.js";import p from"../../../layers/support/Path.js";class m{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class h{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class g{constructor(e,t){this.id=e,this.version=t}}class _ extends r{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=n(!1),this._hitTestsRequests=[],this._firstDrawTime=null,this._renderState=n(null),this._renderStateNext=n(null),this._store=new s,this._subscriptions=new Map,this._presentation=new l,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){this.removeAllChildren(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value),super.destroy()}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(){let e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,n=!!this._renderStateNext.value,r=this.attributeView.updating;return e||t||n||r}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this.labelSchema!==null}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 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(this._instanceStore==null||!(e.drawPhase&c.heatmap.drawPhase))return null;for(let e of this._instanceStore.values())if(v(e))return e;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){let e=new Set;for(let t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(let t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(let 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&&this._schema?.mesh.factory.symbology.type!==`dictionary`,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,n){return this._updateResolver=new m({schema:e,deconflictionInfo:t,invalidateMesh:n}),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(let{tileId:t,version:n}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=n;else{let e=new g(t,n);this._subscriptions.set(t,e)}for(let t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){let t=this.attributeView.getFilterFlags(e),n=t&o,r=this._layerView.featureEffectView.featureEffect==null||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&a;return!(n&&r)}getDisplayStatistics(e,t){let n=this._statisticsByLevel.get(e);return n?n.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates){this._updateStatisticsRequests.push({level:e,statistics:t});return}let n=this._statisticsByLevel.get(e);n||(n=new Map,this._statisticsByLevel.set(e,n));for(let e of t)n.set(e.fieldName,{minValue:e.minValue,maxValue:e.maxValue})}beginLevelMeshUpdate(e){if(this._pendingLevelUpdate!=null)throw Error(`InternalError: Pending level mesh update in progress`);return this._pendingLevelUpdate=new h(e),has(`esri-2d-update-debug`)&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(this._pendingLevelUpdate==null)throw Error(`InternalError: No level mesh update to apply`);if(this._pendingLevelUpdate.id!==e)throw Error(`InternalError: Unexpected id`);if(has(`esri-2d-update-debug`)){let{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}let{level:t,messages:n}=this._pendingLevelUpdate,r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.enqueueLevelReplace(t,n),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(),!1),this._lockStatisticUpdates=!1;for(let 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 Error(`InternalError: renderStateNext already exists`);has(`esri-2d-update-debug`)&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new u(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme,this.labelStore)}async swapRenderState(){if(!this._renderStateNext.value)throw Error(`InternalError: renderStateNext not yet created`);if(this._renderStateSwapResolver)throw Error(`InternalError: renderState swap already in progress`);this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,n){if(t(n),this._pendingLevelUpdate)this._pendingLevelUpdate.messages.push(e);else return this._applyMessage(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){let n=f(e,t);if(!n)return console.warn(`Unexpected hittest input:`,e),{trueHitIds:[],candidateHitIds:[]};let r=this._hitTestsRequests.find(({query:e})=>n.hittestType===e.hittestType&&n.input===e.input&&n.options===e.options),a=Promise.withResolvers();if(r)r.resolvers.push(a);else{if(n.hittestType===`polygon`&&(n.polygonMesh=await i.create(new p({path:[n.input.map(e=>[e.x,e.y])]})),!n.polygonMesh))return a.resolve({trueHitIds:[],candidateHitIds:[]}),a.promise;this._hitTestsRequests.push({query:n,resolvers:[a]})}return this.requestRender(),a.promise}getSortKeys(e){let t=new Set(e),n=new Map;for(let e of this.children)if(e.getSortKeys(t).forEach((e,t)=>n.set(t,e)),n.size===t.size)break;return n}get hasAnimation(){return this.hasLabels}doRender(e){let{minScale:t,maxScale:n}=this._layerView.layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=n&&super.doRender(e)}setStencilReference(e){if(this._getHeatmapInstance(e)!=null)for(let e of this.children)e.stencilRef=c.heatmap.getStencilReference(e);else super.setStencilReference(e)}createRenderParams(e){let t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){let t=e.inner;if(!this._subscriptions.has(t.id))return;let n=this._subscriptions.get(t.id);if(n.version!==t.subscriptionVesrion){if(has(`esri-2d-update-debug`)){let e=`${t.subscriptionVesrion} != ${n.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}let r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;let{schema:e,deconflictionInfo:t,invalidateMesh:n}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),this.instanceStore.updateEnd(this._supportsInstanceCleanup),n&&(this.restartAllAnimations(),this.swapRenderState());let r=e.mesh.factory.symbology.type===`heatmap`?`target-defer`:`eager`;this._presentation.updateStrategy(r),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`);let e=this._renderState.value,t=new Set,n=new Set;for(let r of e?.tiles()??[])r.decluttering&&t.add(r.id),r.presenting&&n.add(r.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(let e of this._renderState.value.tiles())t.has(e.id)&&(e.decluttering=!0),n.has(e.id)&&(e.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&&d(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){let t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){let t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){let t=e.painter.effects.hittest,n=this._hitTestsRequests.shift(),r=n.query.hittestType;t.prepareResources(e,r),t.render(e,n,e=>{let r=t.getHittestableTiles(e,this.children,n.query);for(let t of r)this._renderTile(t,e,0)}),r===`polygon`&&n.query.polygonMesh&&n.query.polygonMesh.destroy(),t.readback(e,n)}_renderFeatures(e,t){let n=this._getHeatmapInstance(e);n==null?this._renderGeometryFeatures(e,t):this._renderHeatmapFeatures(e,t,n)}_renderGeometryFeatures(e,t){for(let n of this.children)n.visible&&this._renderTile(n,e,t)}_renderHeatmapFeatures(e,t,n){for(let n of this.children)n.visible&&this._renderTile(n,e,t,19);n.techniqueRef.renderResolvePass(e,n)}_renderTile(e,t,n,r){t.selection=n;let i=e.getDisplayList()?.render(t,r)??!1;this._firstDrawTime==null&&i&&t.drawPhase===1&&(this._firstDrawTime=performance.now(),this._layerView.emitFirstDraw(this._firstDrawTime))}}function v(e){return e.techniqueRef.type===19}export{_ 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 n}from"../../../../core/signal.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{ClipMesh as i}from"../../engine/webgl/ClipMesh.js";import{effectFlag0 as a,filterFlag0 as o}from"../../engine/webgl/definitions.js";import s from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as c}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as l}from"./FeatureTilePresentStrategy.js";import{RenderState as u}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";import{createHittestQuery as f}from"../../support/hitTestUtils.js";import p from"../../../layers/support/Path.js";class m{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class h{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class g{constructor(e,t){this.id=e,this.version=t}}class _ extends r{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=n(!1),this._hitTestsRequests=[],this._firstDrawTime=null,this._renderState=n(null),this._renderStateNext=n(null),this._store=new s,this._subscriptions=new Map,this._presentation=new l,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){this.removeAllChildren(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value),super.destroy()}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(){let e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,n=!!this._renderStateNext.value,r=this.attributeView.updating;return e||t||n||r}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this.labelSchema!==null}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 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(this._instanceStore==null||!(e.drawPhase&c.heatmap.drawPhase))return null;for(let e of this._instanceStore.values())if(v(e))return e;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){let e=new Set;for(let t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(let t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(let 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&&this._schema?.mesh.factory.symbology.type!==`dictionary`,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,n){return this._updateResolver=new m({schema:e,deconflictionInfo:t,invalidateMesh:n}),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(let{tileId:t,version:n}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=n;else{let e=new g(t,n);this._subscriptions.set(t,e)}for(let t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){let t=this.attributeView.getFilterFlags(e),n=t&o,r=this._layerView.featureEffectView.featureEffect==null||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&a;return!(n&&r)}getDisplayStatistics(e,t){let n=this._statisticsByLevel.get(e);return n?n.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates){this._updateStatisticsRequests.push({level:e,statistics:t});return}let n=this._statisticsByLevel.get(e);n||(n=new Map,this._statisticsByLevel.set(e,n));for(let e of t)n.set(e.fieldName,{minValue:e.minValue,maxValue:e.maxValue})}beginLevelMeshUpdate(e){if(this._pendingLevelUpdate!=null)throw Error(`InternalError: Pending level mesh update in progress`);return this._pendingLevelUpdate=new h(e),has(`esri-2d-update-debug`)&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(this._pendingLevelUpdate==null)throw Error(`InternalError: No level mesh update to apply`);if(this._pendingLevelUpdate.id!==e)throw Error(`InternalError: Unexpected id`);if(has(`esri-2d-update-debug`)){let{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}let{level:t,messages:n}=this._pendingLevelUpdate,r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.enqueueLevelReplace(t,n),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(),!1),this._lockStatisticUpdates=!1;for(let 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 Error(`InternalError: renderStateNext already exists`);has(`esri-2d-update-debug`)&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new u(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme,this.labelStore)}async swapRenderState(){if(!this._renderStateNext.value)throw Error(`InternalError: renderStateNext not yet created`);if(this._renderStateSwapResolver)throw Error(`InternalError: renderState swap already in progress`);this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,n){if(t(n),this._pendingLevelUpdate)this._pendingLevelUpdate.messages.push(e);else return this._applyMessage(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){let n=f(e,t);if(!n)return console.warn(`Unexpected hittest input:`,e),{trueHitIds:[],candidateHitIds:[]};let r=this._hitTestsRequests.find(({query:e})=>n.hittestType===e.hittestType&&n.input===e.input&&n.options===e.options),a=Promise.withResolvers();if(r)r.resolvers.push(a);else{if(n.hittestType===`polygon`&&(n.polygonMesh=await i.create(new p({path:[n.input.map(e=>[e.x,e.y])]})),!n.polygonMesh))return a.resolve({trueHitIds:[],candidateHitIds:[]}),a.promise;this._hitTestsRequests.push({query:n,resolvers:[a]})}return this.requestRender(),a.promise}getSortKeys(e){let t=new Set(e),n=new Map;for(let e of this.children)if(e.getSortKeys(t).forEach((e,t)=>n.set(t,e)),n.size===t.size)break;return n}get hasAnimation(){return this.hasLabels}doRender(e){let{minScale:t,maxScale:n}=this._layerView.layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=n&&super.doRender(e)}setStencilReference(e){if(this._getHeatmapInstance(e)!=null)for(let e of this.children)e.stencilRef=c.heatmap.getStencilReference(e);else super.setStencilReference(e)}createRenderParams(e){let t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){let t=e.inner;if(!this._subscriptions.has(t.id))return;let n=this._subscriptions.get(t.id);if(n.version!==t.subscriptionVesrion){if(has(`esri-2d-update-debug`)){let e=`${t.subscriptionVesrion} != ${n.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}let r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;let{schema:e,deconflictionInfo:t,invalidateMesh:n}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads(),this.hasLabels&&(this.labelStore.invalidateColliders(),this.requestDeclutter()),this.instanceStore.updateEnd(this._supportsInstanceCleanup),n&&(this.restartAllAnimations(),this.swapRenderState());let r=e.mesh.factory.symbology.type===`heatmap`?`target-defer`:`eager`;this._presentation.updateStrategy(r),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`);let e=this._renderState.value,t=new Set,n=new Set;for(let r of e?.tiles()??[])r.decluttering&&t.add(r.id),r.presenting&&n.add(r.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(let e of this._renderState.value.tiles())t.has(e.id)&&(e.decluttering=!0),n.has(e.id)&&(e.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&&d(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){let t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){let t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){let t=e.painter.effects.hittest,n=this._hitTestsRequests.shift(),r=n.query.hittestType;t.prepareResources(e,r),t.render(e,n,e=>{let r=t.getHittestableTiles(e,this.children,n.query);for(let t of r)this._renderTile(t,e,0)}),r===`polygon`&&n.query.polygonMesh&&n.query.polygonMesh.destroy(),t.readback(e,n)}_renderFeatures(e,t){let n=this._getHeatmapInstance(e);n==null?this._renderGeometryFeatures(e,t):this._renderHeatmapFeatures(e,t,n)}_renderGeometryFeatures(e,t){for(let n of this.children)n.visible&&this._renderTile(n,e,t)}_renderHeatmapFeatures(e,t,n){for(let n of this.children)n.visible&&this._renderTile(n,e,t,19);n.techniqueRef.renderResolvePass(e,n)}_renderTile(e,t,n,r){t.selection=n;let i=e.getDisplayList()?.render(t,r)??!1;this._firstDrawTime==null&&i&&t.drawPhase===1&&(this._firstDrawTime=performance.now(),this._layerView.emitFirstDraw(this._firstDrawTime))}}function v(e){return e.techniqueRef.type===19}export{_ as FeatureContainer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../../../core/Logger.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{CIMSymbolHelper as n}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as r}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as i}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{defineMeshWriterReferences as a}from"../../../../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js";import{getMaxSizeVVSize as o,noVisualVariables as s}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as c,hasSizeVVUniform as l}from"./utils.js";function u(t,n){if(t&&n){let r=t.toLowerCase(),i=n.get(r);if(i!==void 0)return{name:r,index:i};e.getLogger(`esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema`).warn(`Invalid symbol layer name: "${t}"`)}return null}function d(e,t){if(!t?.enabled||!t.drawOrder)return null;let n=t.drawOrder.map(e=>e.toLowerCase()).reverse(),r=new Map;for(let t of e){if(!t.name)continue;let e=f(t,n);if(e===-1)continue;let i=t.name.toLowerCase(),a=r.get(e);a?a.push(i):r.set(e,[i])}let i=new Map,a=0;for(let[e,t]of n.entries()){let n=r.get(e)??[t];for(let e of n)i.set(e,a++)}return i}function f(e,t){for(let n of[e.name,...e.groupNames??[]]){if(!n)continue;let e=t.indexOf(n.toLowerCase());if(e!==-1)return e}return-1}function p(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function m(e){if(e==null)return null;if(Array.isArray(e)){let[t,n,r,i]=e;return[t,n,r,i*255]}return typeof e==`string`?e:{...e,defaultValue:m(e?.defaultValue)}}async function h(e,t,n=!1){return _(e,t,n,!0)}async function g(e,t,n=!1){return _(e,t,n,!1)}async function _(e,t,r,i){let{cimResourceManager:o,cimAnalyzer:s,scaleExpression:c,symbolLayerDrawing:l}=t.schemaOptions,u=e.symbol;if(u==null)return[];await n.normalizeSymbolAndFetchResources(u,o);let f=s.analyzeSymbolReference(e,!1),m=p(e),h=d(f,l),g=v(u,f,r),_=u.type===`CIMPointSymbol`&&u.angleAlignment!==`Map`,y=_||g?t.schemaOptions.viewRotation:null,x={scaleInfo:m,scaleExpression:c,rotationVariable:t.rotationVariable??null,viewRotation:y,viewRotationForCalloutsOnly:g&&!_,layerOrderMap:h},S=[];for(let e of f)switch(e.type){case`marker`:S.push(...b(e,t,x));break;case`fill`:S.push(...O(e,t,x));break;case`outlineFill`:S.push(...T(e,t,x));break;case`gradientFill`:S.push(...A(e,t,x));break;case`line`:S.push(...M(e,t,x));break;case`gradientStroke`:S.push(...L(e,t,x));break;case`text`:S.push(...z(e,t,x))}if(r)for(let e of S)e.inputParams.collisionVisibility=!0;return i?a(S):S}function v(e,t,n){return!n&&e.type===`CIMLineSymbol`&&t.some(e=>(e.type===`marker`||e.type===`text`)&&e.alignment===0)&&t.some(y)}function y(e){return[...e.effects??[],...`outlineEffects`in e?e.outlineEffects??[]:[]].some(({effect:e})=>e.type===`CIMSimpleLineCallout`||e.type===`CIMBackgroundCallout`||e.type===`CIMBalloonCallout`||e.type===`CIMPointSymbolCallout`)}function b(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l=e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation};if(e.animationParams){let{hasShiftAnimation:t}=e.animationParams.params,r=t?i.animatedMarkerShift:i.animatedMarker;return x(o.ensureInstance(r,{uniforms:l,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:t}},u(e.name,c)),e,s,n)}return C(o.ensureInstance(i.marker,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,r,n)}function x(e,t,n,r){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,sprite:c(t),animations:t.animationParams,scaleInfo:r.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===1,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,placement:t.markerPlacement,referenceSize:t.referenceSize,angleToLine:t.markerPlacement?t.markerPlacement.placement&&`angleToLine`in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine:!1,sizeRatio:t.sizeRatio,patternHeight:null})]:[]}function S(e,t,n,r){return t.animationParams?[e.createMeshInfo({effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,sprite:c(t),animations:t.animationParams,scaleInfo:r.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:t.colorLocked||!1,isStroke:!1,baseSize:`width`in t?t.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:t.type===`fill`&&t.spriteRasterizationParam?t.height:null,joinType:`join`in t?t.join:`round`,capType:`cap`in t?t.cap:`round`,miterLimit:`miterLimit`in t&&t.miterLimit||2,angle:`angle`in t?t.angle:0})]:[]}function C(e,t,n,{scaleInfo:i,scaleExpression:a}){let s=l(n);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:m(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:i,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:m(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||r.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:a??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:s,placement:t.markerPlacement,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:o(n)})]}function w(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l={visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity};if(e.animationParams){let t=i.animatedFill;return S(o.ensureInstance(t,{uniforms:{...l,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},u(e.name,c)),e,s,n)}return D(o.ensureInstance(i.fill,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,n)}function T(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return E(o.ensureInstance(i.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,s)),e,n)}function E(e,n,r){let i=m(n.color)??[0,0,0,0],a=m(n.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:i,outlineColor:a,width:n.outlineWidth,referenceWidth:n.referenceWidth,minPixelBuffer:n.pixelBufferSize==null?0:t(n.pixelBufferSize)+1,capType:n.cap,joinType:n.join,miterLimit:n.miterLimit,outlineUsesColorVV:!n.outlineColorLocked,hasSizeVV:!1,scaleInfo:r.scaleInfo,...P(n,r),effects:n.effects?{type:`cim-effect-infos`,effectInfos:n.effects}:null,outlineEffects:n.outlineEffects?{type:`cim-effect-infos`,effectInfos:n.outlineEffects}:null})]}function D(e,t,n){let{scaleInfo:r}=n;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],scaleInfo:r,...P(t,n),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function O(e,t,n){let{layerOrderMap:r}=n;if(!e.spriteRasterizationParam)return w(e,t,n);let{uniforms:a,schemaOptions:o}=t,{store:c}=o,l={visualVariableColor:e.colorLocked?null:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity};if(e.animationParams){let t=i.animatedFill;return S(c.ensureInstance(t,{uniforms:{...l,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},u(e.name,r)),e,s,n)}return k(c.ensureInstance(i.complexFill,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,r)),e,a.visualVariableColor!=null,n)}function k(e,t,n,r){let{scaleInfo:i}=r;if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let a=!!t.hasUnresolvedReplacementColor&&(!n||t.colorLocked),o=t.sampleAlphaOnly&&!a,s=t.spriteRasterizationParam;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:s.resource.type===`CIMHatchFill`,sprite:s,scaleInfo:i,...P(t,r),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function A(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return j(o.ensureInstance(i.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,s)),e,n)}function j(e,t,n){let{scaleInfo:r}=n;if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let i=t.spriteRasterizationParam;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],angle:t.angle,gradientMethod:t.gradientMethod,gradientSize:t.gradientSize,gradientSizeUnits:t.gradientSizeUnits,gradientType:t.gradientType,sprite:i,scaleInfo:r,...P(t,n),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function M(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l=e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue};if(e.animationParams){let{hasShiftAnimation:t}=e.animationParams.params,r=i.animatedLine;return S(o.ensureInstance(r,{uniforms:{...l,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:t,angle:!1}},u(e.name,c)),e,s,n)}let d={uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},f=!!(l.visualVariableSizeMinMaxValue||l.visualVariableSizeScaleStops||l.visualVariableSizeStops||l.visualVariableSizeUnitValue);return e.spriteRasterizationParam?I(o.ensureInstance(i.texturedLine,d,u(e.name,c)),e,f,n):F(o.ensureInstance(i.line,d,u(e.name,c)),e,f,n)}function N(e,t,n){let{scaleInfo:r}=n;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:r,hasSizeVV:t,...P(e,n),effects:e.effects?{type:`cim-effect-infos`,effectInfos:e.effects}:null}}function P(e,{rotationVariable:t,viewRotation:n,viewRotationForCalloutsOnly:r}){if(!e.effects?.length&&!e.outlineEffects?.length)return{};let i={};if(e.effectsChangeGeometryType&&(i.useEffectOrigin=!0),n!=null&&(!r||e.type!==`text`&&y(e))&&(i.viewRotation=n),!t)return i;let a=t.valueExpression??(t.field?`$feature[${JSON.stringify(t.field)}]`:null);return a&&(i.effectRotation={valueExpressionInfo:{type:`CIMExpressionInfo`,expression:a},defaultValue:0},i.effectRotationType=t.rotationType),i}function F(e,t,n,r){if(t.spriteRasterizationParam)throw Error(`InternalError: Sprite should not be defined`);let i=N(t,n,r);return[e.createMeshInfo(i)]}function I(e,t,n,r){let{spriteRasterizationParam:i,scaleDash:a,sampleAlphaOnly:o}=t;if(!i)throw Error(`InternalError: Sprite should be defined`);return[e.createMeshInfo({...N(t,n,r),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:o,isSDF:i.resource.type!==`CIMPictureStroke`&&i.resource.type!==`CIMGradientStroke`,sprite:i})]}function L(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n;return R(o.ensureInstance(i.gradientStroke,{uniforms:e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,n)}function R(e,t,n){if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let r=t.spriteRasterizationParam;return[e.createMeshInfo({...N(t,!1,n),gradientMethod:t.gradientMethod,gradientSize:t.gradientSize,gradientSizeUnits:t.gradientSizeUnits,gradientType:t.gradientType,sprite:r,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function z(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return B(o.ensureInstance(i.text,{uniforms:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!n.scaleInfo,referenceSymbol:!1,clipAngle:!1}},u(e.name,s)),e,r,n)}function B(e,t,n,{scaleInfo:r,scaleExpression:i}){return[e.createMeshInfo({alignment:t.alignment,boxBackgroundColor:null,boxBorderLineColor:null,boxBorderLineSize:0,backgroundColor:m(t.backgroundColor),borderLineColor:m(t.borderLineColor),borderLineWidth:t.borderLineWidth??0,useBackgroundCallout:t.useBackgroundCallout,color:m(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:m(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:m(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??`center`,verticalAlignment:t.verticalAlignment??`baseline`,useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:r,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:i??1,minPixelBuffer:o(n),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{x as createAnimatedMarkerMeshInfos,S as createAnimatedPolyMeshInfos,k as createComplexFillMeshInfos,C as createComplexMarkerMeshInfos,D as createComplexSimpleFillMeshInfos,F as createComplexSimpleLineMeshInfos,E as createComplexSimpleOutlineFillMeshInfos,h as createComplexSymbolInstances,g as createComplexSymbolPartSchemas,B as createComplexTextMeshInfos,I as createComplexTexturedLineMeshInfos,j as createGradientFillMeshInfos,R as createGradientStrokeMeshInfos,p as getScaleInfo};
|
|
2
|
+
import e from"../../../../../../../core/Logger.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{CIMSymbolHelper as n}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as r}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as i}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{defineMeshWriterReferences as a}from"../../../../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js";import{getMaxSizeVVSize as o,noVisualVariables as s}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as c,hasSizeVVUniform as l}from"./utils.js";function u(t,n){if(t&&n){let r=t.toLowerCase(),i=n.get(r);if(i!==void 0)return{name:r,index:i};e.getLogger(`esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema`).warn(`Invalid symbol layer name: "${t}"`)}return null}function d(e,t){if(!t?.enabled||!t.drawOrder)return null;let n=t.drawOrder.map(e=>e.toLowerCase()).reverse(),r=new Map;for(let t of e){if(!t.name)continue;let e=f(t,n);if(e===-1)continue;let i=t.name.toLowerCase(),a=r.get(e);a?a.push(i):r.set(e,[i])}let i=new Map,a=0;for(let[e,t]of n.entries()){let n=r.get(e)??[t];for(let e of n)i.set(e,a++)}return i}function f(e,t){for(let n of[e.name,...e.groupNames??[]]){if(!n)continue;let e=t.indexOf(n.toLowerCase());if(e!==-1)return e}return-1}function p(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function m(e){if(e==null)return null;if(Array.isArray(e)){let[t,n,r,i]=e;return[t,n,r,i*255]}return typeof e==`string`?e:{...e,defaultValue:m(e?.defaultValue)}}async function h(e,t,n=!1){return _(e,t,n,!0)}async function g(e,t,n=!1){return _(e,t,n,!1)}async function _(e,t,r,i){let{cimResourceManager:o,cimAnalyzer:s,scaleExpression:c,symbolLayerDrawing:l}=t.schemaOptions,u=e.symbol;if(u==null)return[];await n.normalizeSymbolAndFetchResources(u,o);let f=s.analyzeSymbolReference(e,!1),m=p(e),h=d(f,l),g=v(u,f,r),_=u.type===`CIMPointSymbol`&&u.angleAlignment!==`Map`,y=_||g?t.schemaOptions.viewRotation:null,x={scaleInfo:m,scaleExpression:c,rotationVariable:t.rotationVariable??null,viewRotation:y,viewRotationForCalloutsOnly:g&&!_,layerOrderMap:h},S=[];for(let e of f)switch(e.type){case`marker`:S.push(...b(e,t,x));break;case`fill`:S.push(...O(e,t,x));break;case`outlineFill`:S.push(...T(e,t,x));break;case`gradientFill`:S.push(...A(e,t,x));break;case`line`:S.push(...M(e,t,x));break;case`gradientStroke`:S.push(...L(e,t,x));break;case`text`:S.push(...z(e,t,x))}if(r)for(let e of S)e.inputParams.collisionVisibility=!0;return i?a(S):S}function v(e,t,n){return!n&&e.type===`CIMLineSymbol`&&t.some(e=>(e.type===`marker`||e.type===`text`)&&e.alignment===0)&&t.some(y)}function y(e){return[...e.effects??[],...`outlineEffects`in e?e.outlineEffects??[]:[]].some(({effect:e})=>e.type===`CIMSimpleLineCallout`||e.type===`CIMBackgroundCallout`||e.type===`CIMBalloonCallout`||e.type===`CIMPointSymbolCallout`)}function b(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l=e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation};if(e.animationParams){let{hasShiftAnimation:t}=e.animationParams.params,r=t?i.animatedMarkerShift:i.animatedMarker;return x(o.ensureInstance(r,{uniforms:l,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:t}},u(e.name,c)),e,s,n)}return C(o.ensureInstance(i.marker,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,r,n)}function x(e,t,n,r){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,sprite:c(t),animations:t.animationParams,scaleInfo:r.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===1,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,placement:t.markerPlacement,referenceSize:t.referenceSize,angleToLine:t.markerPlacement?t.markerPlacement.placement&&`angleToLine`in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine:!1,sizeRatio:t.sizeRatio,patternHeight:null})]:[]}function S(e,t,n,r){return t.animationParams?[e.createMeshInfo({effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,sprite:c(t),animations:t.animationParams,scaleInfo:r.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:t.colorLocked||!1,isStroke:!1,baseSize:`width`in t?t.width:-1,placement:null,referenceSize:t.type===`line`?t.referenceWidth:2,angleToLine:!1,sizeRatio:1,patternHeight:t.type===`fill`&&t.spriteRasterizationParam?t.height:null,joinType:`join`in t?t.join:`round`,capType:`cap`in t?t.cap:`round`,miterLimit:`miterLimit`in t&&t.miterLimit||2,angle:`angle`in t?t.angle:0})]:[]}function C(e,t,n,{scaleInfo:i,scaleExpression:a}){let s=l(n);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:m(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:i,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:m(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||r.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:a??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:s,placement:t.markerPlacement,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:o(n)})]}function w(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l={visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity};if(e.animationParams){let t=i.animatedFill;return S(o.ensureInstance(t,{uniforms:{...l,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},u(e.name,c)),e,s,n)}return D(o.ensureInstance(i.fill,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,n)}function T(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return E(o.ensureInstance(i.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,s)),e,n)}function E(e,n,r){let i=m(n.color)??[0,0,0,0],a=m(n.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:i,outlineColor:a,width:n.outlineWidth,referenceWidth:n.referenceWidth,minPixelBuffer:n.pixelBufferSize==null?0:t(n.pixelBufferSize)+1,capType:n.cap,joinType:n.join,miterLimit:n.miterLimit,outlineUsesColorVV:!n.outlineColorLocked,hasSizeVV:!1,scaleInfo:r.scaleInfo,...P(n,r),effects:n.effects?{type:`cim-effect-infos`,effectInfos:n.effects}:null,outlineEffects:n.outlineEffects?{type:`cim-effect-infos`,effectInfos:n.outlineEffects}:null})]}function D(e,t,n){let{scaleInfo:r}=n;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],scaleInfo:r,...P(t,n),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function O(e,t,n){let{layerOrderMap:r}=n;if(!e.spriteRasterizationParam)return w(e,t,n);let{uniforms:a,schemaOptions:o}=t,{store:c}=o,l={visualVariableColor:e.colorLocked?null:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity};if(e.animationParams){let t=i.animatedFill;return S(c.ensureInstance(t,{uniforms:{...l,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},u(e.name,r)),e,s,n)}return k(c.ensureInstance(i.complexFill,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,r)),e,a.visualVariableColor!=null,n)}function k(e,t,n,r){let{scaleInfo:i}=r;if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let a=!!t.hasUnresolvedReplacementColor&&(!n||t.colorLocked),o=t.sampleAlphaOnly&&!a,s=t.spriteRasterizationParam;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:s.resource.type===`CIMHatchFill`,sprite:s,scaleInfo:i,...P(t,r),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function A(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return j(o.ensureInstance(i.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,s)),e,n)}function j(e,t,n){let{scaleInfo:r}=n;if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let i=t.spriteRasterizationParam;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],angle:t.angle,gradientMethod:t.gradientMethod,gradientSize:t.gradientSize,gradientSizeUnits:t.gradientSizeUnits,gradientType:t.gradientType,sprite:i,scaleInfo:r,...P(t,n),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function M(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l=e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue};if(e.animationParams){let{hasShiftAnimation:t}=e.animationParams.params,r=i.animatedLine;return S(o.ensureInstance(r,{uniforms:{...l,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:t,angle:!1}},u(e.name,c)),e,s,n)}let d={uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},f=!!(l.visualVariableSizeMinMaxValue||l.visualVariableSizeScaleStops||l.visualVariableSizeStops||l.visualVariableSizeUnitValue);return e.spriteRasterizationParam?I(o.ensureInstance(i.texturedLine,d,u(e.name,c)),e,f,n):F(o.ensureInstance(i.line,d,u(e.name,c)),e,f,n)}function N(e,t,n){let{scaleInfo:r}=n;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:r,hasSizeVV:t,...P(e,n),effects:e.effects?{type:`cim-effect-infos`,effectInfos:e.effects}:null}}function P(e,{rotationVariable:t,viewRotation:n,viewRotationForCalloutsOnly:r}){if(!e.effects?.length&&!e.outlineEffects?.length)return{};let i={};if(e.effectsChangeGeometryType&&(i.useEffectOrigin=!0),n!=null&&(!r||e.type!==`text`&&y(e))&&(i.viewRotation=n),!t)return i;let a=t.valueExpression??(t.field?`$feature[${JSON.stringify(t.field)}]`:null);return a&&(i.effectRotation={valueExpressionInfo:{type:`CIMExpressionInfo`,expression:a},defaultValue:0},i.effectRotationType=t.rotationType),i}function F(e,t,n,r){if(t.spriteRasterizationParam)throw Error(`InternalError: Sprite should not be defined`);let i=N(t,n,r);return[e.createMeshInfo(i)]}function I(e,t,n,r){let{spriteRasterizationParam:i,scaleDash:a,sampleAlphaOnly:o}=t;if(!i)throw Error(`InternalError: Sprite should be defined`);return[e.createMeshInfo({...N(t,n,r),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:o,isSDF:i.resource.type!==`CIMPictureStroke`&&i.resource.type!==`CIMGradientStroke`,sprite:i})]}function L(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n;return R(o.ensureInstance(i.gradientStroke,{uniforms:e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,n)}function R(e,t,n){if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let r=t.spriteRasterizationParam;return[e.createMeshInfo({...N(t,!1,n),gradientMethod:t.gradientMethod,gradientSize:t.gradientSize,gradientSizeUnits:t.gradientSizeUnits,gradientType:t.gradientType,sprite:r,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function z(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return B(o.ensureInstance(i.text,{uniforms:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!n.scaleInfo,referenceSymbol:!1,clipAngle:!1}},u(e.name,s)),e,r,n)}function B(e,t,n,{scaleInfo:r,scaleExpression:i}){return[e.createMeshInfo({alignment:t.alignment,boxBackgroundColor:null,boxBorderLineColor:null,boxBorderLineSize:0,backgroundColor:m(t.backgroundColor),borderLineColor:m(t.borderLineColor),borderLineWidth:t.borderLineWidth??0,useBackgroundCallout:t.useBackgroundCallout,color:m(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:m(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:m(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??`center`,verticalAlignment:t.verticalAlignment??`baseline`,useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:r,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:i??1,minPixelBuffer:o(n),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{x as createAnimatedMarkerMeshInfos,S as createAnimatedPolyMeshInfos,k as createComplexFillMeshInfos,C as createComplexMarkerMeshInfos,D as createComplexSimpleFillMeshInfos,F as createComplexSimpleLineMeshInfos,E as createComplexSimpleOutlineFillMeshInfos,h as createComplexSymbolInstances,g as createComplexSymbolPartSchemas,B as createComplexTextMeshInfos,I as createComplexTexturedLineMeshInfos,j as createGradientFillMeshInfos,R as createGradientStrokeMeshInfos,p as getScaleInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{meterIn as t}from"../../../../renderers/support/lengthUtils.js";const n=Math.PI;function r(e,t,n){switch(t.transformationType){case`additive`:return a(e,t,n);case`constant`:return o(t,e,n);case`clamped-linear`:return s(e,t,n);case`proportional`:return c(e,t,n);case`stops`:return l(e,t,n);case`real-world-size`:return u(e,t);case`identity`:return e;case`unknown`:return null}}function i(e,t,n){return typeof e==`number`?e:r(
|
|
2
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{meterIn as t}from"../../../../renderers/support/lengthUtils.js";const n=Math.PI;function r(e,t,n){switch(t.valueExpression===`$view.scale`&&(e=n),t.transformationType){case`additive`:return a(e,t,n);case`constant`:return o(t,e,n);case`clamped-linear`:return s(e,t,n);case`proportional`:return c(e,t,n);case`stops`:return l(e,t,n);case`real-world-size`:return u(e,t);case`identity`:return e;case`unknown`:return null}}function i(e,t,n){return typeof e==`number`?e:r(t,e,n)}function a(e,t,n){return e+(i(t.minSize,e,n)||t.minDataValue)}function o(e,t,n){let r=e.stops,a=r?.length&&r[0].size;return a??=e.minSize,i(a,t,n)}function s(e,t,n){let r=t.minDataValue,a=t.maxDataValue,o=(e-r)/(a-r),s=i(t.minSize,e,n),c=i(t.maxSize,e,n);return e<=r?s:e>=a?c:s+o*(c-s)}function c(t,n,r){let a=t/n.minDataValue,o=i(n.minSize,t,r),s=i(n.maxSize,t,r),c=null;return c=a*o,e(c,o,s)}function l(e,t,n){let[r,a,o]=d(e,t.cache.ipData);if(r===a)return i(t.stops[r].size,e,n);{let s=i(t.stops[r].size,e,n);return s+(i(t.stops[a].size,e,n)-s)*o}}function u(e,r){let i=t[r.valueUnit],{valueRepresentation:a}=r,o=null;return o=a===`area`?2*Math.sqrt(e/n)/i:a===`radius`||a===`distance`?2*e/i:e/i,o}function d(e,t){if(!t)return;let n=0,r=t.length-1;return t.some((t,i)=>e<t?(r=i,!0):(n=i,!1)),[n,r,(e-t[n])/(t[r]-t[n])]}export{r as getSizeForValueSimple};
|