@arcgis/core 4.23.0-next.20220127 → 4.23.0-next.20220128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
- package/assets/esri/core/workers/chunks/{e657ba0cab29f05d02da.js → 0cd0a6eef51fc5b9ea61.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4896cf85fb2da8a9cc7.js → 17de7a324dfa7f57ad5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0317f37b6c8705b363fd.js → 1c733b7db092a2a88ef3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d835b2a683fcd8aeeed8.js → 27474b007988855bea9d.js} +1 -1
- package/assets/esri/core/workers/chunks/{8001b0e514bfffe9d7f8.js → 357033117dfe61eb81ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{5948923e07bd1662c24a.js → 37c03cfc19086ce631c6.js} +1 -1
- package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
- package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
- package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
- package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
- package/assets/esri/core/workers/chunks/{5f1dcb6556820cd0aa31.js → 4be35af7d6babbfe9d84.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9ff3eaf4eb324429fbd.js → 5457962a70bd3c557a75.js} +1 -1
- package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
- package/assets/esri/core/workers/chunks/{56274b37ff74ca0d68a6.js → 5d11b97b667921d67ae7.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba5eb394f098968c22d2.js → 655b55ac0cd533d7e9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
- package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
- package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
- package/assets/esri/core/workers/chunks/{601e697dc7414bda128a.js → 952980635afc7ec81804.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8741bf421f80213f1d3.js → 9876a1bae350795fab36.js} +1 -1
- package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
- package/assets/esri/core/workers/chunks/{3f343f792fd9f44d6f25.js → b3f5e91116112b0b612a.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c76146014dc15143ba3.js → be588873c16770ceb9ef.js} +1 -1
- package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
- package/assets/esri/core/workers/chunks/{b62e3dccd9f662c0afeb.js → db3c729ce0c0b2690dc9.js} +1 -1
- package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
- package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
- package/assets/esri/core/workers/chunks/{c9cbf8135e95f0f42cd9.js → e287f49184d076af17e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e6a3c5866e8d8820457.js → eb82ff10cef2bde6e57f.js} +1 -1
- package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
- package/assets/esri/core/workers/chunks/{842db82733635dbf25cb.js → ee6e0db58dc64410e687.js} +1 -1
- package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
- package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
- package/chunks/BlendLayers.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +17 -17
- package/chunks/CheckerBoard.glsl.js +3 -3
- package/chunks/Clouds.glsl.js +2 -2
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +12 -12
- package/chunks/ComponentShader.glsl.js +3 -3
- package/chunks/Compositing.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +33 -33
- package/chunks/EdgeShaderProgram.glsl.js +7 -7
- package/chunks/Fog.glsl.js +10 -12
- package/chunks/HUDMaterial.glsl.js +2 -2
- package/chunks/HighlightComposition.glsl.js +5 -5
- package/chunks/ImageMaterial.glsl.js +6 -6
- package/chunks/LaserlinePath.glsl.js +8 -8
- package/chunks/LineCallout.glsl.js +6 -6
- package/chunks/MeasurementArrow.glsl.js +1 -1
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +5 -5
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +14 -14
- package/chunks/Precipitation.glsl.js +2 -2
- package/chunks/RealisticTree.glsl.js +21 -21
- package/chunks/RibbonLine.glsl.js +11 -11
- package/chunks/SMAA.glsl.js +40 -40
- package/chunks/ShadedColorMaterial.glsl.js +12 -12
- package/chunks/ShadowCast.glsl.js +6 -6
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/SimpleAtmosphere.glsl.js +3 -3
- package/chunks/SlicePlaneMaterial.glsl.js +3 -3
- package/chunks/Stars.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +11 -11
- package/chunks/TextureOnly.glsl.js +2 -2
- package/chunks/WaterSurface.glsl.js +5 -5
- package/chunks/boundedPlane.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/loadAll.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +204 -10
- package/layers/VectorTileLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/package.json +1 -1
- package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
- package/support/revision.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/Symbol3D.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/support/IconSymbol3DLayerResource.js +1 -1
- package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Thumbnail.js +1 -1
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/Fog.glsl.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.glsl.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/Stars.glsl.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/symbolComplexity.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
- package/views/3d/layers/support/overlayImageUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
- package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +10 -10
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureUniformName.js +4 -0
- package/views/3d/webgl-engine/lib/UniformName.js +4 -0
- package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
- package/views/SceneView.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/support/WatchUpdatingTracking.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/assets/esri/core/workers/chunks/12c0cabb6c59e65d8546.js +0 -1
- package/assets/esri/core/workers/chunks/322d917e8cb398816a93.js +0 -1
- package/assets/esri/core/workers/chunks/392b6382e06652dd4c80.js +0 -1
- package/assets/esri/core/workers/chunks/3aa73119b055e05bbbeb.js +0 -1
- package/assets/esri/core/workers/chunks/52ea678ba1da0e349919.js +0 -1
- package/assets/esri/core/workers/chunks/5ee497d5d7b0e580526a.js +0 -1
- package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
- package/assets/esri/core/workers/chunks/83b8fec1650e061aaa56.js +0 -1
- package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
- package/assets/esri/core/workers/chunks/d07440469fe7d181c4fd.js +0 -1
- package/assets/esri/core/workers/chunks/dbf192b4ce7e608610f6.js +0 -1
- package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
- package/assets/esri/core/workers/chunks/dee9929d95e9fe26929c.js +0 -1
- package/assets/esri/core/workers/chunks/e12d91ef44d6f879a02a.js +0 -1
- package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import s from"../../../core/has.js";import a from"../../../core/Logger.js";import{isSome as r,isNone as d}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{EsriPromiseMixin as n}from"../../../core/Promise.js";import{isAbortError as h}from"../../../core/promiseUtils.js";import{init as l}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection.js";import{create as p,intersectsSphere as g}from"../../../geometry/support/aaBoundingRect.js";import{makeDehydratedPoint as m}from"../dehydratedFeatures.js";import{PromiseQueue as y}from"../../support/PromiseQueue.js";import{addTask as x}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as f}from"../../../views/3d/layers/i3s/I3SIndex.js";import b from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as w,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import v from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as C}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as D,getIndexCrs as L,findIntersectingNodes as S}from"../../../views/3d/layers/i3s/I3SUtil.js";import V from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as I}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{ClientType as U,maxDownloadSlots as F}from"../../../views/3d/support/index.js";import{extractSafeScaleBounds as P,scaleBoundsPredicate as O}from"../../../views/support/layerViewUtils.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const q=a.getLogger("esri.layers.graphics.controllers.I3SOnDemandController"),G=100,j=2,Q=1e4,T=1e-4,E=1.2,B=500,H=1.5;let k=class extends(n(t)){constructor(e){super(e),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new o({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new o,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new i,this._idleQueue=new y,this._elevationUpdateNodes=new o({deallocator:null}),this._errorCount=0}get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store.lodType}get isGraphics3D(){return"points"===this.layer.profile}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_INDEX);return new C(e,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_DATA);return new C(e,this.layer.apiKey)}get crsVertex(){return D(this.layer)}get crsIndex(){return L(this.layer)}get rootNodeVisible(){if(r(this._index)){const e=this._index.rootNode;if(r(e))return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}initialize(){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData,this._lodHandling=new b(this.layerView);const e=this.layerView.i3slayer;this.layer=e,this._defaultGeometrySchema=e.store.defaultGeometrySchema,this.disableIDBCache=s("disable-feature:idb-cache"),"fields"in e&&(this._fields=e.fields,this._attributeStorageInfo=e.attributeStorageInfo),this.addResolvingPromise(Promise.all([this.layer.indexInfo,this.layer.when(),this.layerView.when()]).then((([t])=>{var i;if(this.destroyed||!this.layerView||this.layerView.destroyed)return;const s=this.layerView.view;this._setClippingArea(s.clippingArea);const a=this.layerView.view.resourceController;this._handles.add([l(s,"pointsOfInterest.focus.renderLocation",(e=>this._pointOfInterestChanged(e))),a.memoryController.events.on("quality-changed",(()=>this._setCameraDirty())),l(this.layerView,"suspended",(e=>{const t=e?()=>this._updateViewData():()=>this._updateIdleState(!0),i=e?()=>{}:()=>this._updateIdleState(!1);this._idleStateCallbacks?(e&&this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=a.scheduler.registerIdleStateCallbacks(t,i)})),x(this.layerView.view.resourceController.scheduler,{update:(e,t)=>this._frame(e,t),needsUpdate:()=>this.updating}),this.watch("uncompressedTextureDownsamplingEnabled",(()=>this.restartNodeLoading())),this.watch(["featureTarget","fixedFeatureTarget"],(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),s.state.watch("contentCamera",(()=>this._setCameraDirty())),this.layer.watch("elevationInfo",(()=>this._elevationInfoChanged())),this.layer.watch("effectiveScaleRange",(()=>this._scaleBoundsChanged())),this.layerView.watch("lodFactor",(()=>this._setCameraDirty())),this.layerView.watch("availableFields?",(()=>this._requiredFieldsChange())),this.layerView.watch("holeFilling",(e=>r(this._index)&&(this._index.holeFilling=e)))]),this._updateScaleHandles(),this._viewportQueries=new V(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,s.elevationProvider,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this.lod,angleDependentLoD:this.lod<.5}),this._index=new f(e,t,this.indexStreamController,this._viewportQueries,q,this.layerView.holeFilling,(e=>this.layerView.isNodeLoaded(e)),(e=>this.layerView.isNodeReloading(e)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,w.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(e=>this.layerView.computeVisibilityObb?this.layerView.computeVisibilityObb(e):null),null!=(i=this.layerView)&&i.computeNodeFiltering?e=>this.layerView.computeNodeFiltering(e):void 0),this._index.imModificationsChanged(!!this.layerView.hasModifications),this._startNodeLoading()}))),this._tmpPoint=m(0,0,0,this.crsIndex)}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;r(t)&&i&&i.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);r(i)&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,R.prune(),r(z)&&(z.hide(),z=null)}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=X(e,i),a=X(t,i);return s>=0&&a>=0?{index:s,name:t[a].name,field:t[a],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();K(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=p();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){r(this._viewportQueries)&&(this._viewportQueries.setPointOfInterest(e),r(this._index)&&(this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),r(this._viewportQueries)&&r(this._index)&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this.notifyChange("rootNodeVisible"),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateElevationChanged(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;if(d(s))return;const a=this._elevationUpdateNodes;a.clear(),S(e,t,s,this.crsIndex,i,(e=>a.push(e.index))),a.forAll((e=>{i.invalidateBoundingVolumeCache(e),e===s.index&&this.notifyChange("rootNodeVisible")})),a.length&&this.restartNodeLoading()}getParentIndex(e){return r(this._index)&&this._index.getParentIndex(e)}_elevationInfoChanged(){r(this._index)&&this._index.updateElevationInfo(this.layer.elevationInfo),this._setCameraDirty()}_updateScaleHandles(){const e="scale-bounds";this._handles.remove(e),this.areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),e)}_scaleBoundsChanged(){this.areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(e){this._updateScaleInBoundingRect(e.extent,e.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;!d(s)&&_(e,t,J,this.crsIndex)&&this._loadedNodeScales.forEach(((e,t)=>{const s=i.getNode(t);r(s)&&g(J,s.mbs)&&this._loadedNodeScales.set(t,this._computeScale(s))}))}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get areScaleBoundsActive(){const{minScale:e,maxScale:t}=P(this.layer);return this.scaleVisibilityEnabled&&(e>0||t>0)}get unloadedMemoryEstimate(){return d(this._index)||this.layerView.suspended?0:this._index.getUnloadedMemoryEstimate()*this.lodDropFactor}get indexDepth(){return r(this._index)?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=e}_frame(e,t){return this.layerView.suspended?(this._updateViewData(),this._evaluateUpdating(),-1/0):!this.layerView.visible||d(this._index)?-1/0:(this._processLogError(e,t),this._index.getPriority())}_processLogError(e,t){try{this._process(e,t)}catch(i){this._errorCount<50?q.error("Error during processing: "+i):50===this._errorCount&&q.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null==this._nodeLoader||d(this._index)||(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this.isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this.isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.getIndexLoading(),t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(d(this._index))return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update([...this._loadingNodes.keys()],e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading()||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(d(this._index)||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.isGraphics3D||d(this._index)||d(this._viewportQueries))return;const e=!this._index.isLoading(),t=this.featureTarget*this.baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.getIndexMissing()>B){if(this._featureLOD<=T)return;this._featureLOD/=H,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=Q||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this.lod,a=this._index.checkFeatureTarget(t,s);a!==s&&(this._featureLOD=a/this.baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*E||e&&i.estimate>t))return;if(this._featureLOD<=T)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(Q,Math.max(T,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(d(t))return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);r(s)&&(!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s));s=t.getParent(s.index))if(this._enableFromGPUCache(s,w.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(d(this._index))return!1;let i=(this._isIdle?G:j)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());r(t)&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const a=this._index.getNode(s.add.back());if(d(a)||a.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(a),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=j)&&(this._downloadingCount<F&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView.suspended)e=this._cameraDirty,t=e?0:1;else{const i=(r(this._index)?this._index.getIndexMissing():0)+3*(r(this._index)?this._index.updates.add.length:0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}this.updating=e,this.updatingProgress=t}_updateViewData(){if(!this._cameraDirty||d(this._index)||d(this._viewportQueries))return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this.screenSizeFactor=1/(t.perScreenPixelRatio/2),this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get lod(){return this._featureLOD*this.baseLOD}get baseLOD(){const e=this.layerView.lodFactor,t=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*t}get lodDropFactor(){if(this.fixedFeatureTarget)return 1;const e=this.layerView.view.resourceController.memoryController;return(Math.min(e.memoryFactor,.5)-e.minQuality)/(.5-e.minQuality)}isGeometryVisible(e){return r(this._index)&&this._index.isGeometryVisible(e.index)}updateVisibility(e){r(this._index)&&this._index.invalidateNodeVisibilityCache(e)}updateBoundingVolume(e){r(this._index)&&this._index.invalidateBoundingVolumeCache(e)}invalidateGeometryVisibility(e){r(this._index)&&this._index.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){r(this._index)&&this._index.invalidateVisibilityObbs()}modificationsChanged(){r(this._index)&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&(!(!r(this._index)||!this._index.isGeometryVisible(e.index))&&this._isNodeInScaleBounds(e))}_shouldDropNode(e){if(d(this._viewportQueries))return!1;const t=this.lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||d(e)||d(this._viewportQueries))return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:!this.isMeshPyramid};this._nodeLoader=new v(this.layer,this.dataStreamController,q,this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e=>this._isNodeInScaleBounds(e)),((e,t)=>this._removeNodes(e,t,W.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(d(t)||d(this._viewportQueries))return!1;R.clear(),this.layerView.getLoadedNodeIndices(R);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return R.filterInPlace((e=>{const i=t.getNode(e);return d(i)||!t.isGeometryVisible(e)||s(i)||!this._isNodeInScaleBounds(i)})),R.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(R,e,W.pop),!(i&&this.lodDropFactor<1)&&(0===R.length||(R.clear(),!1))}markNodeToRemove(e){R.push(e)}removeMarkedNodes(){this._removeNodes(R,M,W.pop)}_removeNodes(e,t,i){const s=e.length;if(0!==s&&!t.done){for(r(this._index)&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),a=this._index;i===W.fadeout&&this.layerView.nodeFadeoutEnabled&&r(a)&&a.isGeometryVisible(s)?this.layerView.fadeNode(s,I.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}if(this._loadedNodeScales.size>0)for(let t=e.length;t<s;t++){const i=e.data[t];this._loadedNodeScales.delete(i)}}}_needsUpdate(e){if(!e.resources.hasFeatureData||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}_updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t);(K(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes)?Promise.resolve(this.layerView.getAttributeData(e.index)):this._nodeLoader.loadAttributes(e,this._requiredAttributes,t.signal)).then((i=>this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:i},t.signal)),t.signal))).catch((i=>{if(!h(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)})).catch((()=>{})).then((()=>{this._updatingNodes.delete(e.index),this._evaluateUpdating()})),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void q.error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((e=>{e&&r(this._index)&&this._index.requestUpdate()})).catch((e=>{if(!h(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!h(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||d(this._index))return!1;if(t===w.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e);return r(t)&&r(t.attributeInfo)&&K(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){r(this._index)&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_loadCached(e,t){if(this._enableFromGPUCache(e,w.Leaf))return Promise.resolve(!0);const i=this.layerView;return!this.disableIDBCache&&i.loadCachedNodeData&&i.addCachedNodeData?this.schedule((()=>i.loadCachedNodeData(e,t,((t,i)=>this._nodeLoader.loadTextures(e,t,i)))),t).then((s=>{if(d(s))return!1;const a=this._requiredAttributes;return this.reschedule((()=>this._nodeLoader.loadAttributes(e,a,t)),t).then((r=>this.reschedule((()=>i.addCachedNodeData(e,s,{loadedAttributes:a,attributeData:r},t)),t))).then((()=>(this._nodeAdded(),!0)))})):Promise.resolve(!1)}_loadUncached(e,t){return this._downloadingCount++,this._nodeLoader.loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=N.Cached})).catch((t=>{if(!h(t))throw q.error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,r(this._index)&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&r(this._index)&&this._index.resetFailedNodes())}_getScale(e){if(this._loadedNodeScales.has(e.index))return this._loadedNodeScales.get(e.index);const t=this._computeScale(e);return this.layerView.isNodeLoaded(e.index)&&this._loadedNodeScales.set(e.index,t),t}_computeScale(e){this._tmpPoint.x=e.mbs[0],this._tmpPoint.y=e.mbs[1],this._tmpPoint.z=e.mbs[2];const t=e.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,t)}_isNodeInScaleBounds(e){if(!this.areScaleBoundsActive)return!0;const t=this._getScale(e),{minScale:i,maxScale:s}=P(this.layer);return O(t,i,s)}updateStats(e){e.index=r(this._index)?this._index.size:0,this.isGraphics3D&&(e.detail=this._featureLOD,e.target=this.featureTarget*this.baseLOD),r(this._index)&&this._index.updateStats(e)}get test(){const e=this;return{index:this._index,set disableUpdates(t){e._updatesDisabled=t,t?e.cancelNodeLoading():e.requestUpdate()},set disableIDBCache(t){e.disableIDBCache=t},set ignoreServiceObb(t){r(e._index)&&(e._index.ignoreServiceObb=t)},shouldLoadNode:t=>e._shouldLoadNode(t)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),r(this._index)&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;r(t)&&t.layerFilterChanged(e),this.requestUpdate()}};e([u({readOnly:!0})],k.prototype,"isMeshPyramid",null),e([u({readOnly:!0})],k.prototype,"isGraphics3D",null),e([u({readOnly:!0})],k.prototype,"indexStreamController",null),e([u({readOnly:!0})],k.prototype,"dataStreamController",null),e([u({readOnly:!0})],k.prototype,"crsVertex",null),e([u({readOnly:!0})],k.prototype,"crsIndex",null),e([u()],k.prototype,"screenSizeFactor",void 0),e([u()],k.prototype,"featureTarget",void 0),e([u()],k.prototype,"fixedFeatureTarget",void 0),e([u()],k.prototype,"layerView",void 0),e([u()],k.prototype,"layer",void 0),e([u({})],k.prototype,"updating",void 0),e([u({})],k.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],k.prototype,"leavesReached",void 0),e([u({constructOnly:!0})],k.prototype,"scaleVisibilityEnabled",void 0),e([u({readOnly:!0,dependsOn:[]})],k.prototype,"rootNodeVisible",null),k=e([c("esri.layers.graphics.controllers.I3SOnDemandController")],k);const R=new o({deallocator:null});let z;function K(e,t){return r(e)&&e.length===t.length&&e.every((e=>X(t,e.name)>=0))}function X(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const $={factorIM:.2,factor3dObject:.05,distancePenalty:10},J=p();var W;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(W||(W={}));const Y=k;export{Y as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import s from"../../../core/has.js";import a from"../../../core/Logger.js";import{isSome as r,isNone as d}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{EsriPromiseMixin as n}from"../../../core/Promise.js";import{isAbortError as h}from"../../../core/promiseUtils.js";import{init as l}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection.js";import{create as p,intersectsSphere as g}from"../../../geometry/support/aaBoundingRect.js";import{makeDehydratedPoint as m}from"../dehydratedFeatures.js";import{PromiseQueue as y}from"../../support/PromiseQueue.js";import{addTask as x}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as f}from"../../../views/3d/layers/i3s/I3SIndex.js";import b from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as w,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import v from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as C}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as D,getIndexCrs as L,findIntersectingNodes as S}from"../../../views/3d/layers/i3s/I3SUtil.js";import V from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as I}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{ClientType as U,maxDownloadSlots as F}from"../../../views/3d/support/index.js";import{extractSafeScaleBounds as P,scaleBoundsPredicate as O}from"../../../views/support/layerViewUtils.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const q=a.getLogger("esri.layers.graphics.controllers.I3SOnDemandController"),G=100,j=2,Q=1e4,T=1e-4,E=1.2,B=500,H=1.5;let k=class extends(n(t)){constructor(e){super(e),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new o({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new o,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new i,this._idleQueue=new y,this._elevationUpdateNodes=new o({deallocator:null}),this._errorCount=0}get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store.lodType}get isGraphics3D(){return"points"===this.layer.profile}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_INDEX);return new C(e,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_DATA);return new C(e,this.layer.apiKey)}get crsVertex(){return D(this.layer)}get crsIndex(){return L(this.layer)}get rootNodeVisible(){if(r(this._index)){const e=this._index.rootNode;if(r(e))return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}initialize(){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData,this._lodHandling=new b(this.layerView);const e=this.layerView.i3slayer;this.layer=e,this._defaultGeometrySchema=e.store.defaultGeometrySchema,this.disableIDBCache=s("disable-feature:idb-cache"),"fields"in e&&(this._fields=e.fields,this._attributeStorageInfo=e.attributeStorageInfo),this.addResolvingPromise(Promise.all([this.layer.indexInfo,this.layer.when(),this.layerView.when()]).then((([t])=>{var i;if(this.destroyed||!this.layerView||this.layerView.destroyed)return;const s=this.layerView.view;this._setClippingArea(s.clippingArea);const a=this.layerView.view.resourceController;this._handles.add([l(s,"pointsOfInterest.focus.renderLocation",(e=>this._pointOfInterestChanged(e))),a.memoryController.events.on("quality-changed",(()=>this._setCameraDirty())),l(this.layerView,"suspended",(e=>{const t=e?()=>this._updateViewData():()=>this._updateIdleState(!0),i=e?()=>{}:()=>this._updateIdleState(!1);this._idleStateCallbacks?(e&&this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=a.scheduler.registerIdleStateCallbacks(t,i)})),x(this.layerView.view.resourceController.scheduler,{update:(e,t)=>this._frame(e,t),needsUpdate:()=>this.updating}),this.watch("uncompressedTextureDownsamplingEnabled",(()=>this.restartNodeLoading())),this.watch(["featureTarget","fixedFeatureTarget"],(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),s.state.watch("contentCamera",(()=>this._setCameraDirty())),this.layer.watch("elevationInfo",(()=>this._elevationInfoChanged())),this.layer.watch("effectiveScaleRange",(()=>this._scaleBoundsChanged())),this.layerView.watch("lodFactor",(()=>this._setCameraDirty())),this.layerView.watch("availableFields?",(()=>this._requiredFieldsChange())),this.layerView.watch("holeFilling",(e=>r(this._index)&&(this._index.holeFilling=e)))]),this._updateScaleHandles(),this._viewportQueries=new V(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,s.elevationProvider,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this.lod,angleDependentLoD:this.lod<.5}),this._index=new f(e,t,this.indexStreamController,this._viewportQueries,q,this.layerView.holeFilling,(e=>this.layerView.isNodeLoaded(e)),(e=>this.layerView.isNodeReloading(e)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,w.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(e=>this.layerView.computeVisibilityObb?this.layerView.computeVisibilityObb(e):null),null!=(i=this.layerView)&&i.computeNodeFiltering?e=>this.layerView.computeNodeFiltering(e):void 0),this._index.imModificationsChanged(!!this.layerView.hasModifications),this._startNodeLoading()}))),this._tmpPoint=m(0,0,0,this.crsIndex)}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;r(t)&&i&&i.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);r(i)&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,R.prune(),r(z)&&(z.hide(),z=null)}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=X(e,i),a=X(t,i);return s>=0&&a>=0?{index:s,name:t[a].name,field:t[a],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();K(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=p();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){r(this._viewportQueries)&&(this._viewportQueries.setPointOfInterest(e),r(this._index)&&(this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),r(this._viewportQueries)&&r(this._index)&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this.notifyChange("rootNodeVisible"),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateElevationChanged(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;if(d(s))return;const a=this._elevationUpdateNodes;a.clear(),S(e,t,s,this.crsIndex,i,(e=>a.push(e.index))),a.forAll((e=>{i.invalidateBoundingVolumeCache(e),e===s.index&&this.notifyChange("rootNodeVisible")})),a.length&&this.restartNodeLoading()}getParentIndex(e){return r(this._index)&&this._index.getParentIndex(e)}_elevationInfoChanged(){r(this._index)&&this._index.updateElevationInfo(this.layer.elevationInfo),this._setCameraDirty()}_updateScaleHandles(){const e="scale-bounds";this._handles.remove(e),this.areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),e)}_scaleBoundsChanged(){this.areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(e){this._updateScaleInBoundingRect(e.extent,e.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;!d(s)&&_(e,t,J,this.crsIndex)&&this._loadedNodeScales.forEach(((e,t)=>{const s=i.getNode(t);r(s)&&g(J,s.mbs)&&this._loadedNodeScales.set(t,this._computeScale(s))}))}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get areScaleBoundsActive(){const{minScale:e,maxScale:t}=P(this.layer);return this.scaleVisibilityEnabled&&(e>0||t>0)}get unloadedMemoryEstimate(){return d(this._index)||this.layerView.suspended?0:this._index.getUnloadedMemoryEstimate()*this.lodDropFactor}get indexDepth(){return r(this._index)?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=e}_frame(e,t){return this.layerView.suspended?(this._updateViewData(),this._evaluateUpdating(),-1/0):!this.layerView.visible||d(this._index)?-1/0:(this._processLogError(e,t),this._index.getPriority())}_processLogError(e,t){try{this._process(e,t)}catch(i){this._errorCount<50?q.error("Error during processing: "+i):50===this._errorCount&&q.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null==this._nodeLoader||d(this._index)||(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this.isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this.isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.getIndexLoading(),t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(d(this._index))return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update([...this._loadingNodes.keys()],e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading()||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(d(this._index)||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.isGraphics3D||d(this._index)||d(this._viewportQueries))return;const e=!this._index.isLoading(),t=this.featureTarget*this.baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.getIndexMissing()>B){if(this._featureLOD<=T)return;this._featureLOD/=H,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=Q||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this.lod,a=this._index.checkFeatureTarget(t,s);a!==s&&(this._featureLOD=a/this.baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*E||e&&i.estimate>t))return;if(this._featureLOD<=T)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(Q,Math.max(T,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(d(t))return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);r(s)&&(!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s));s=t.getParent(s.index))if(this._enableFromGPUCache(s,w.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(d(this._index))return!1;let i=(this._isIdle?G:j)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());r(t)&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const a=this._index.getNode(s.add.back());if(d(a)||a.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(a),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=j)&&(this._downloadingCount<F&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView.suspended)e=this._cameraDirty,t=e?0:1;else{const i=(r(this._index)?this._index.getIndexMissing():0)+3*(r(this._index)?this._index.updates.add.length:0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}this.updating=e,this.updatingProgress=t}_updateViewData(){if(!this._cameraDirty||d(this._index)||d(this._viewportQueries))return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this.screenSizeFactor=1/(t.perScreenPixelRatio/2),this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get lod(){return this._featureLOD*this.baseLOD}get baseLOD(){const e=this.layerView.lodFactor,t=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*t}get lodDropFactor(){if(this.fixedFeatureTarget)return 1;const e=this.layerView.view.resourceController.memoryController;return(Math.min(e.memoryFactor,.5)-e.minQuality)/(.5-e.minQuality)}isGeometryVisible(e){return r(this._index)&&this._index.isGeometryVisible(e.index)}updateVisibility(e){r(this._index)&&this._index.invalidateNodeVisibilityCache(e)}updateBoundingVolume(e){r(this._index)&&this._index.invalidateBoundingVolumeCache(e)}invalidateGeometryVisibility(e){r(this._index)&&this._index.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){r(this._index)&&this._index.invalidateVisibilityObbs()}modificationsChanged(){r(this._index)&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&(!(!r(this._index)||!this._index.isGeometryVisible(e.index))&&this._isNodeInScaleBounds(e))}_shouldDropNode(e){if(d(this._viewportQueries))return!1;const t=this.lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||d(e)||d(this._viewportQueries))return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:!this.isMeshPyramid};this._nodeLoader=new v(this.layer,this.dataStreamController,q,this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e=>this._isNodeInScaleBounds(e)),((e,t)=>this._removeNodes(e,t,W.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(d(t)||d(this._viewportQueries))return!1;R.clear(),this.layerView.getLoadedNodeIndices(R);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return R.filterInPlace((e=>{const i=t.getNode(e);return d(i)||!t.isGeometryVisible(e)||s(i)||!this._isNodeInScaleBounds(i)})),R.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(R,e,W.pop),!(i&&this.lodDropFactor<1)&&(0===R.length||(R.clear(),!1))}markNodeToRemove(e){R.push(e)}removeMarkedNodes(){this._removeNodes(R,M,W.pop)}_removeNodes(e,t,i){const s=e.length;if(0!==s&&!t.done){for(r(this._index)&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),a=this._index;i===W.fadeout&&this.layerView.nodeFadeoutEnabled&&r(a)&&a.isGeometryVisible(s)?this.layerView.fadeNode(s,I.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}if(this._loadedNodeScales.size>0)for(let t=e.length;t<s;t++){const i=e.data[t];this._loadedNodeScales.delete(i)}}}_needsUpdate(e){if(!e.resources.hasFeatureData||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}_updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t);(K(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes)?Promise.resolve(this.layerView.getAttributeData(e.index)):this._nodeLoader.loadAttributes(e,this._requiredAttributes,t.signal)).then((i=>this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:i},t.signal)),t.signal))).catch((i=>{if(!h(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)})).catch((()=>{})).then((()=>{this._updatingNodes.delete(e.index),this._evaluateUpdating()})),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void q.error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((i=>{i&&r(this._index)&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())})).catch((e=>{if(!h(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!h(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||d(this._index))return!1;if(t===w.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e);return r(t)&&r(t.attributeInfo)&&K(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){r(this._index)&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_loadCached(e,t){if(this._enableFromGPUCache(e,w.Leaf))return Promise.resolve(!0);const i=this.layerView;return!this.disableIDBCache&&i.loadCachedNodeData&&i.addCachedNodeData?this.schedule((()=>i.loadCachedNodeData(e,t,((t,i)=>this._nodeLoader.loadTextures(e,t,i)))),t).then((s=>{if(d(s))return!1;const a=this._requiredAttributes;return this.reschedule((()=>this._nodeLoader.loadAttributes(e,a,t)),t).then((r=>this.reschedule((()=>i.addCachedNodeData(e,s,{loadedAttributes:a,attributeData:r},t)),t))).then((()=>(this._nodeAdded(),!0)))})):Promise.resolve(!1)}_loadUncached(e,t){return this._downloadingCount++,this._nodeLoader.loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=N.Cached})).catch((t=>{if(!h(t))throw q.error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,r(this._index)&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&r(this._index)&&this._index.resetFailedNodes())}_getScale(e){if(this._loadedNodeScales.has(e.index))return this._loadedNodeScales.get(e.index);const t=this._computeScale(e);return this.layerView.isNodeLoaded(e.index)&&this._loadedNodeScales.set(e.index,t),t}_computeScale(e){this._tmpPoint.x=e.mbs[0],this._tmpPoint.y=e.mbs[1],this._tmpPoint.z=e.mbs[2];const t=e.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,t)}_isNodeInScaleBounds(e){if(!this.areScaleBoundsActive)return!0;const t=this._getScale(e),{minScale:i,maxScale:s}=P(this.layer);return O(t,i,s)}updateStats(e){e.index=r(this._index)?this._index.size:0,this.isGraphics3D&&(e.detail=this._featureLOD,e.target=this.featureTarget*this.baseLOD),r(this._index)&&this._index.updateStats(e)}get test(){const e=this;return{index:this._index,set disableUpdates(t){e._updatesDisabled=t,t?e.cancelNodeLoading():e.requestUpdate()},set disableIDBCache(t){e.disableIDBCache=t},set ignoreServiceObb(t){r(e._index)&&(e._index.ignoreServiceObb=t)},shouldLoadNode:t=>e._shouldLoadNode(t)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),r(this._index)&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;r(t)&&t.layerFilterChanged(e),this.requestUpdate()}};e([u({readOnly:!0})],k.prototype,"isMeshPyramid",null),e([u({readOnly:!0})],k.prototype,"isGraphics3D",null),e([u({readOnly:!0})],k.prototype,"indexStreamController",null),e([u({readOnly:!0})],k.prototype,"dataStreamController",null),e([u({readOnly:!0})],k.prototype,"crsVertex",null),e([u({readOnly:!0})],k.prototype,"crsIndex",null),e([u()],k.prototype,"screenSizeFactor",void 0),e([u()],k.prototype,"featureTarget",void 0),e([u()],k.prototype,"fixedFeatureTarget",void 0),e([u()],k.prototype,"layerView",void 0),e([u()],k.prototype,"layer",void 0),e([u({})],k.prototype,"updating",void 0),e([u({})],k.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],k.prototype,"leavesReached",void 0),e([u({constructOnly:!0})],k.prototype,"scaleVisibilityEnabled",void 0),e([u({readOnly:!0,dependsOn:[]})],k.prototype,"rootNodeVisible",null),k=e([c("esri.layers.graphics.controllers.I3SOnDemandController")],k);const R=new o({deallocator:null});let z;function K(e,t){return r(e)&&e.length===t.length&&e.every((e=>X(t,e.name)>=0))}function X(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const $={factorIM:.2,factor3dObject:.05,distancePenalty:10},J=p();var W;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(W||(W={}));const Y=k;export{Y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../core/Error.js";import e from"../../core/Logger.js";import{isNone as n,isSome as o}from"../../core/maybe.js";import{isPoint as r,isPolygon as s,isPolyline as c,isMultipoint as l}from"../../geometry/support/jsonUtils.js";import u from"./OptimizedFeature.js";import i from"./OptimizedFeatureSet.js";import f from"./OptimizedGeometry.js";function h(t,e){return t?e?4:3:e?3:2}const a=e.getLogger("esri.tasks.support.optimizedFeatureSet"),g={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0},d=(t,e,n,o,r,s)=>{t[n]=r,t[n+1]=s},m=(t,e,n,o,r,s)=>{t[n]=r,t[n+1]=s,t[n+2]=e[o+2]},y=(t,e,n,o,r,s)=>{t[n]=r,t[n+1]=s,t[n+2]=e[o+3]},p=(t,e,n,o,r,s)=>{t[n]=r,t[n+1]=s,t[n+2]=e[o+2],t[n+3]=e[o+3]};function I(t,e,n,o){if(t){if(n)return e&&o?p:m;if(e&&o)return y}else if(e&&o)return m;return d}function b({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function M({scale:t,translate:e},n){return Math.round((e[1]-n)/t[1])}function w({scale:t,translate:e},n){return n*t[0]+e[0]}function N({scale:t,translate:e},n){return e[1]-n*t[1]}function G(t,e,n){return t?e?n?k(t):P(t):n?Z(t):T(t):null}function T(t){const e=t.coords;return{x:e[0],y:e[1]}}function F(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t}function P(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2]}}function x(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t}function Z(t){const e=t.coords;return{x:e[0],y:e[1],m:e[2]}}function j(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.m,t}function k(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function E(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t.coords[3]=e.m,t}function z(t,e,n,r){let s=T;n&&r?s=k:n?s=P:r&&(s=Z);for(const c of e){const{geometry:e,attributes:n}=c,r=o(e)?s(e):null;t.push({attributes:n,geometry:r})}return t}function S(t,e){return t&&e?E:t?x:e?j:F}function v(t,e,n,o,r){const s=S(n,o);for(const c of e){const{geometry:e,attributes:n}=c;let o;e&&(o=s(new f,e)),t.push(new u(o,n,null,n[r]))}return t}function V(t,e,n=S(null!=e.z,null!=e.m)){return n(t,e)}function Y(t,e,n,o){for(const r of e){const{geometry:e,attributes:s}=r;let c;e&&(c=_(e,n,o)),t.push({attributes:s,geometry:c})}return t}function _(t,e,o){if(n(t))return null;const r=h(e,o),s=[];for(let n=0;n<t.coords.length;n+=r){const e=[];for(let o=0;o<r;o++)e.push(t.coords[n+o]);s.push(e)}return e?o?{points:s,hasZ:e,hasM:o}:{points:s,hasZ:e}:o?{points:s,hasM:o}:{points:s}}function O(t,e,n,o,r){const s=h(n,o);for(const c of e){const e=c.geometry,n=c.attributes;let o;e&&(o=A(new f,e,s)),t.push(new u(o,n,null,n[r]))}return t}function A(t,e,n=h(e.hasZ,e.hasM)){t.lengths[0]=e.points.length;const o=t.coords;let r=0;for(const s of e.points)for(let t=0;t<n;t++)o[r++]=s[t];return t}function L(t,e,n,r){for(const s of e){const{geometry:e,attributes:c}=s;let l;o(e)&&(l=U(e,n,r)),t.push({attributes:c,geometry:l})}return t}function U(t,e,n){if(!t)return null;const o=h(e,n),{coords:r,lengths:s}=t,c=[];let l=0;for(const u of s){const t=[];for(let e=0;e<u;e++){const e=[];for(let t=0;t<o;t++)e.push(r[l++]);t.push(e)}c.push(t)}return e?n?{paths:c,hasZ:e,hasM:n}:{paths:c,hasZ:e}:n?{paths:c,hasM:n}:{paths:c}}function q(t,e,n,o,r){const s=h(n,o);for(const c of e){const e=c.geometry,n=c.attributes;let o;e&&(o=$(new f,e,s)),t.push(new u(o,n,null,n[r]))}return t}function $(t,e,n=h(e.hasZ,e.hasM)){const{lengths:o,coords:r}=t;let s=0;for(const c of e.paths){for(const t of c)for(let e=0;e<n;e++)r[s++]=t[e];o.push(c.length)}return t}function R(t,e,n,r){for(const s of e){const{geometry:e,attributes:c,centroid:l}=s;let u;if(o(e)&&(u=C(e,n,r)),l){const e=T(l);t.push({attributes:c,centroid:e,geometry:u})}else t.push({attributes:c,geometry:u})}return t}function C(t,e,n){if(!t)return null;const o=h(e,n),{coords:r,lengths:s}=t,c=[];let l=0;for(const u of s){const t=[];for(let e=0;e<u;e++){const e=[];for(let t=0;t<o;t++)e.push(r[l++]);t.push(e)}c.push(t)}return e?n?{rings:c,hasZ:e,hasM:n}:{rings:c,hasZ:e}:n?{rings:c,hasM:n}:{rings:c}}function B(t,e,n,r,s){for(const c of e){const e=c.geometry,l=c.centroid,i=c.attributes;let h;e&&(h=D(new f,e,n,r)),o(l)?t.push(new u(h,i,F(new f,l),i[s])):t.push(new u(h,i,null,i[s]))}return t}function D(t,e,n=e.hasZ,o=e.hasM){return H(t,e.rings,n,o),t}function H(t,e,n,o){const r=h(n,o),{lengths:s,coords:c}=t;let l=0;s.length=c.length=0;for(const u of e){for(const t of u)for(let e=0;e<r;e++)c[l++]=t[e];s.push(u.length)}return t}const J=[],K=[];function Q(t,e,n,o,r){J[0]=t;const[s]=W(K,J,e,n,o,r);return J.length=K.length=0,s}function W(e,n,o,r,s,c){if(e.length=0,!o){for(const t of n){const n=t.attributes[c];e.push(new u(null,t.attributes,null,n))}return e}switch(o){case"esriGeometryPoint":return v(e,n,r,s,c);case"esriGeometryMultipoint":return O(e,n,r,s,c);case"esriGeometryPolyline":return q(e,n,r,s,c);case"esriGeometryPolygon":return B(e,n,r,s,c);default:a.error("convertToFeatureSet:unknown-geometry",new t(`Unable to parse unknown geometry type '${o}'`)),e.length=0}return e}function X(e,n,o,r,s,c){const l=e.length;switch(o){case"esriGeometryPoint":v(e,n,r,s,c);break;case"esriGeometryMultipoint":O(e,n,r,s,c);break;case"esriGeometryPolyline":q(e,n,r,s,c);break;case"esriGeometryPolygon":B(e,n,r,s,c);break;default:a.error("convertToFeatureSet:unknown-geometry",new t(`Unable to parse unknown geometry type '${o}'`))}for(let t=0;t<n.length;t++)e[t+l].geometryType=o,e[t+l].insertAfter=n[t].insertAfter,e[t+l].groupId=n[t].groupId;return e}function tt(t,e,n,o){K[0]=t,rt(J,K,e,n,o);const r=J[0];return J.length=K.length=0,r}function et(e,o,u){if(n(e))return null;const i=new f;if("hasZ"in e&&null==o&&(o=e.hasZ),"hasM"in e&&null==u&&(u=e.hasM),r(e)){return S(null!=o?o:null!=e.z,null!=u?u:null!=e.m)(i,e)}return s(e)?D(i,e,o,u):c(e)?$(i,e,h(o,u)):l(e)?A(i,e,h(o,u)):void a.error("convertFromGeometry:unknown-geometry",new t(`Unable to parse unknown geometry type '${e}'`))}function nt(e,o,r,s){const c=e&&("coords"in e?e:e.geometry);if(n(c))return null;switch(o){case"esriGeometryPoint":{let t=T;return r&&s?t=k:r?t=P:s&&(t=Z),t(c)}case"esriGeometryMultipoint":return _(c,r,s);case"esriGeometryPolyline":return U(c,r,s);case"esriGeometryPolygon":return C(c,r,s);default:return void a.error("convertToGeometry:unknown-geometry",new t(`Unable to parse unknown geometry type '${o}'`))}}function ot(t,e){for(const n of e)t.push({attributes:n.attributes});return t}function rt(e,o,r,s,c){if(e.length=0,n(r))return ot(e,o);switch(r){case"esriGeometryPoint":return z(e,o,s,c);case"esriGeometryMultipoint":return Y(e,o,s,c);case"esriGeometryPolyline":return L(e,o,s,c);case"esriGeometryPolygon":return R(e,o,s,c);default:a.error("convertToFeatureSet:unknown-geometry",new t(`Unable to parse unknown geometry type '${r}'`))}return e}function st(t){const{objectIdFieldName:e,spatialReference:n,transform:o,fields:r,hasM:s,hasZ:c,features:l,geometryType:u,exceededTransferLimit:i,uniqueIdField:f,queryGeometry:h,queryGeometryType:a}=t,g={features:rt([],l,u,c,s),fields:r,geometryType:u,objectIdFieldName:e,spatialReference:n,uniqueIdField:f,queryGeometry:nt(h,a,!1,!1)};return o&&(g.transform=o),i&&(g.exceededTransferLimit=i),s&&(g.hasM=s),c&&(g.hasZ=c),g}function ct(e,n){const o=new i,{hasM:r,hasZ:s,features:c,objectIdFieldName:l,spatialReference:u,geometryType:f,exceededTransferLimit:h,transform:g,fields:d}=e;return d&&(o.fields=d),o.geometryType=f,o.objectIdFieldName=l||n,o.spatialReference=u,o.objectIdFieldName?(c&&W(o.features,c,f,s,r,o.objectIdFieldName),h&&(o.exceededTransferLimit=h),r&&(o.hasM=r),s&&(o.hasZ=s),g&&(o.transform=g),o):(a.error(new t("optimized-features:invalid-objectIdFieldName","objectIdFieldName is missing")),o)}function lt(t){const{transform:e,features:n,hasM:r,hasZ:s}=t;if(!e)return t;for(const c of n)o(c.geometry)&&mt(c.geometry,c.geometry,r,s,e),c.centroid&&mt(c.centroid,c.centroid,r,s,e);return t.transform=null,t}function ut(t,e){const{geometryType:n,features:o,hasM:r,hasZ:s}=e;if(!t)return e;for(let c=0;c<o.length;c++){const e=o[c],l=e.weakClone();l.geometry=new f,it(l.geometry,e.geometry,r,s,n,t),e.centroid&&(l.centroid=new f,it(l.centroid,e.centroid,r,s,"esriGeometryPoint",t)),o[c]=l}return e.transform=t,e}function it(t,e,o,r,s,c,l=o,u=r){if(t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0),n(e)||!e.coords.length)return null;const i=g[s],{coords:f,lengths:a}=e,d=h(o,r),m=h(o&&l,r&&u),y=I(o,r,l,u);if(!a.length)return y(t.coords,f,0,0,b(c,f[0]),M(c,f[1])),t.lengths.length&&(t.lengths.length=0),t.coords.length=d,t;let p,w,N,G,T=0,F=0,P=F;for(const n of a){if(n<i)continue;let e=0;F=P,N=p=b(c,f[T]),G=w=M(c,f[T+1]),y(t.coords,f,F,T,N,G),e++,T+=d,F+=m;for(let o=1;o<n;o++,T+=d)N=b(c,f[T]),G=M(c,f[T+1]),N===p&&G===w||(y(t.coords,f,F,T,N-p,G-w),F+=m,e++,p=N,w=G);e>=i&&(t.lengths.push(e),P=F)}return t.coords.length=P,t.coords.length?t:null}function ft(t,e,n,o,r,s,c=n,l=o){if(t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0),!e||!e.coords.length)return null;const u=g[r],{coords:i,lengths:f}=e,a=h(n,o),d=h(n&&c,o&&l),m=I(n,o,c,l);if(!f.length)return m(t.coords,i,0,0,i[0],i[1]),t.lengths.length&&(t.lengths.length=0),t.coords.length=a,t;let y=0;const p=s*s;for(const h of f){if(h<u){y+=h*a;continue}const e=t.coords.length/d,n=y,o=y+(h-1)*a;m(t.coords,i,t.coords.length,n,i[n],i[n+1]),at(t.coords,i,a,p,m,n,o),m(t.coords,i,t.coords.length,o,i[o],i[o+1]);const r=t.coords.length/d-e;r>=u?t.lengths.push(r):t.coords.length=e*d,y+=h*a}return t.coords.length?t:null}function ht(t,e,n,o){const r=t[e],s=t[e+1],c=t[n],l=t[n+1],u=t[o],i=t[o+1];let f=c,h=l,a=u-f,g=i-h;if(0!==a||0!==g){const t=((r-f)*a+(s-h)*g)/(a*a+g*g);t>1?(f=u,h=i):t>0&&(f+=a*t,h+=g*t)}return a=r-f,g=s-h,a*a+g*g}function at(t,e,n,o,r,s,c){let l,u=o,i=0;for(let f=s+n;f<c;f+=n)l=ht(e,f,s,c),l>u&&(i=f,u=l);u>o&&(i-s>n&&at(t,e,n,o,r,s,i),r(t,e,t.length,i,e[i],e[i+1]),c-i>n&&at(t,e,n,o,r,i,c))}function gt(t,e,o,r){if(n(e)||!e.coords||!e.coords.length)return null;const s=h(o,r);let c=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(e&&e.coords){const t=e.coords;for(let e=0;e<t.length;e+=s){const n=t[e],o=t[e+1];c=Math.min(c,n),u=Math.max(u,n),l=Math.min(l,o),i=Math.max(i,o)}}return t[0]=c,t[1]=l,t[2]=u,t[3]=i,t}function dt(t,e,n,o){const r=h(n,o),{lengths:s,coords:c}=e;let l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,f=Number.NEGATIVE_INFINITY,a=0;for(const h of s){let t=c[a],e=c[a+1];l=Math.min(t,l),u=Math.min(e,u),i=Math.max(t,i),f=Math.max(e,f),a+=r;for(let n=1;n<h;n++,a+=r){const n=c[a],o=c[a+1];t+=n,e+=o,n<0&&(l=Math.min(l,t)),n>0&&(i=Math.max(i,t)),o<0?u=Math.min(u,e):o>0&&(f=Math.max(f,e))}}return t[0]=l,t[1]=u,t[2]=i,t[3]=f,t}function mt(t,e,n,o,r){const{coords:s,lengths:c}=e,l=n?o?p:m:o?m:d,u=h(n,o);if(!s.length)return t!==e&&(t.lengths.length=0,t.coords.length=0),t;if(!c.length)return l(t.coords,s,0,0,w(r,s[0]),N(r,s[1])),t!==e&&(t.lengths.length=0,t.coords.length=u),t;const[i,f]=r.scale;let a=0;for(let h=0;h<c.length;h++){const e=c[h];t.lengths[h]=e;let n=w(r,s[a]),o=N(r,s[a+1]);l(t.coords,s,a,a,n,o),a+=u;for(let r=1;r<e;r++,a+=u)n+=s[a]*i,o-=s[a+1]*f,l(t.coords,s,a,a,n,o)}return t!==e&&(t.lengths.length=c.length,t.coords.length=s.length),t}function yt(t,e,n,o,r,s){const c=h(n,o),l=I(n,o,r,s),u=e.coords;t.coords.length=0,t.lengths.length=0,t.lengths.push(...e.lengths);for(let i=0;i<u.length;i+=c)l(t.coords,u,t.coords.length,i,u[i],u[i+1]);return t}function pt(t,e,n,o,r){if(!e||!e.coords||!e.coords.length)return null;const s=g[n],{coords:c,lengths:l}=e,u=I(o,r,o,r),i=h(o,r);let f=0,a=0,d=0,m=0;for(const h of l){a=m,u(t.coords,c,a,f,c[f],c[f+1]),f+=i;let e=c[f],n=c[f+1],o=e,r=n,l=n/e;a+=i,u(t.coords,c,a,f,o,r),f+=i;for(let s=2;s<h;s++){e=c[f],n=c[f+1];const s=n/e,h=l===s||!isFinite(l)&&!isFinite(s),g=h&&isFinite(s)?l>=0&&s>=0||l<=0&&s<=0:r>=0&&n>=0||r<=0&&n<=0;h&&g?(o+=e,r+=n):(o=e,r=n,a+=i),u(t.coords,c,a,f,o,r),f+=i,l=s}a+=i;const g=(a-m)/i;g>=s&&(t.lengths[d]=g,m=a,d++)}return t.coords.length>m&&(t.coords.length=m),t.lengths.length>d&&(t.lengths.length=d),t.coords.length&&t.lengths.length?t:null}function It(t,e,n,o){let r=0,s=t[o*e],c=t[o*(e+1)];for(let l=1;l<n;l++){const n=s+t[o*(e+l)],u=c+t[o*(e+l)+1],i=(n-s)*(u+c);s=n,c=u,r+=i}return.5*r}function bt(t,e){const{coords:n,lengths:o}=t;let r=0,s=0;for(let c=0;c<o.length;c++){s+=It(n,r,o[c],e),r+=c}return Math.abs(s)}function Mt(t,e){const n=t.clone(),o=t.coords,r=t.lengths;let s=0;for(let c=0;c<r.length;c++){const t=r[c];let l=o[e*s],u=o[e*s+1];for(let r=1;r<t;r++){const t=o[e*(s+r)],c=o[e*(s+r)+1],i=t-l,f=c-u;n.coords[e*(s+r)]=i,n.coords[e*(s+r)+1]=f,l=t,u=c}s+=t}return n}function wt(t,e){if(n(t))return null;const o=t.clone(),r=t.coords,s=t.lengths;let c=0;for(let n=0;n<s.length;n++){const t=s[n];let l=r[e*c],u=r[e*c+1];for(let n=1;n<t;n++){const t=l+r[e*(c+n)],s=u+r[e*(c+n)+1];o.coords[e*(c+n)]=t,o.coords[e*(c+n)+1]=s,l=t,u=s}c+=t}return o}export{Q as convertFromFeature,ct as convertFromFeatureSet,W as convertFromFeatures,et as convertFromGeometry,X as convertFromGraphics,A as convertFromMultipoint,O as convertFromMultipointFeatures,H as convertFromNestedArray,V as convertFromPoint,v as convertFromPointFeatures,D as convertFromPolygon,$ as convertFromPolyline,q as convertFromPolylineFeatures,tt as convertToFeature,st as convertToFeatureSet,rt as convertToFeatures,nt as convertToGeometry,_ as convertToMultipoint,Y as convertToMultipointFeatures,G as convertToPoint,C as convertToPolygon,U as convertToPolyline,wt as deltaDecodeGeometry,Mt as deltaEncodeGeometry,ft as generalizeOptimizedGeometry,gt as getBoundsOptimizedGeometry,bt as getQuantizedArea,dt as getQuantizedBoundsOptimizedGeometry,It as getSignedQuantizedRingArea,ut as quantizeOptimizedFeatureSet,it as quantizeOptimizedGeometry,b as quantizeX,M as quantizeY,pt as removeCollinearVectices,yt as removeZMValues,lt as unquantizeOptimizedFeatureSet,mt as unquantizeOptimizedGeometry,w as unquantizeX,N as unquantizeY};
|
|
5
|
+
import e from"../../core/Error.js";import t from"../../core/Logger.js";import{isNone as n,isSome as o}from"../../core/maybe.js";import{isPoint as r,isPolygon as s,isPolyline as c,isMultipoint as l}from"../../geometry/support/jsonUtils.js";import u from"./OptimizedFeature.js";import i from"./OptimizedFeatureSet.js";import f from"./OptimizedGeometry.js";function h(e,t){return e?t?4:3:t?3:2}const a=t.getLogger("esri.layers.graphics.featureConversionUtils"),g={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0},d=(e,t,n,o,r,s)=>{e[n]=r,e[n+1]=s},m=(e,t,n,o,r,s)=>{e[n]=r,e[n+1]=s,e[n+2]=t[o+2]},y=(e,t,n,o,r,s)=>{e[n]=r,e[n+1]=s,e[n+2]=t[o+3]},p=(e,t,n,o,r,s)=>{e[n]=r,e[n+1]=s,e[n+2]=t[o+2],e[n+3]=t[o+3]};function I(e,t,n,o){if(e){if(n)return t&&o?p:m;if(t&&o)return y}else if(t&&o)return m;return d}function b({scale:e,translate:t},n){return Math.round((n-t[0])/e[0])}function M({scale:e,translate:t},n){return Math.round((t[1]-n)/e[1])}function w({scale:e,translate:t},n){return n*e[0]+t[0]}function N({scale:e,translate:t},n){return t[1]-n*e[1]}function G(e,t,n){return e?t?n?k(e):P(e):n?Z(e):T(e):null}function T(e){const t=e.coords;return{x:t[0],y:t[1]}}function F(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e}function P(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2]}}function x(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e}function Z(e){const t=e.coords;return{x:t[0],y:t[1],m:t[2]}}function j(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.m,e}function k(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2],m:t[3]}}function E(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e.coords[3]=t.m,e}function z(e,t,n,r){let s=T;n&&r?s=k:n?s=P:r&&(s=Z);for(const c of t){const{geometry:t,attributes:n}=c,r=o(t)?s(t):null;e.push({attributes:n,geometry:r})}return e}function v(e,t){return e&&t?E:e?x:t?j:F}function S(e,t,n,o,r){const s=v(n,o);for(const c of t){const{geometry:t,attributes:n}=c;let o;t&&(o=s(new f,t)),e.push(new u(o,n,null,n[r]))}return e}function V(e,t,n=v(null!=t.z,null!=t.m)){return n(e,t)}function Y(e,t,n,o){for(const r of t){const{geometry:t,attributes:s}=r;let c;t&&(c=_(t,n,o)),e.push({attributes:s,geometry:c})}return e}function _(e,t,o){if(n(e))return null;const r=h(t,o),s=[];for(let n=0;n<e.coords.length;n+=r){const t=[];for(let o=0;o<r;o++)t.push(e.coords[n+o]);s.push(t)}return t?o?{points:s,hasZ:t,hasM:o}:{points:s,hasZ:t}:o?{points:s,hasM:o}:{points:s}}function O(e,t,n,o,r){const s=h(n,o);for(const c of t){const t=c.geometry,n=c.attributes;let o;t&&(o=U(new f,t,s)),e.push(new u(o,n,null,n[r]))}return e}function U(e,t,n=h(t.hasZ,t.hasM)){e.lengths[0]=t.points.length;const o=e.coords;let r=0;for(const s of t.points)for(let e=0;e<n;e++)o[r++]=s[e];return e}function A(e,t,n,r){for(const s of t){const{geometry:t,attributes:c}=s;let l;o(t)&&(l=L(t,n,r)),e.push({attributes:c,geometry:l})}return e}function L(e,t,n){if(!e)return null;const o=h(t,n),{coords:r,lengths:s}=e,c=[];let l=0;for(const u of s){const e=[];for(let t=0;t<u;t++){const t=[];for(let e=0;e<o;e++)t.push(r[l++]);e.push(t)}c.push(e)}return t?n?{paths:c,hasZ:t,hasM:n}:{paths:c,hasZ:t}:n?{paths:c,hasM:n}:{paths:c}}function q(e,t,n,o,r){const s=h(n,o);for(const c of t){const t=c.geometry,n=c.attributes;let o;t&&(o=$(new f,t,s)),e.push(new u(o,n,null,n[r]))}return e}function $(e,t,n=h(t.hasZ,t.hasM)){const{lengths:o,coords:r}=e;let s=0;for(const c of t.paths){for(const e of c)for(let t=0;t<n;t++)r[s++]=e[t];o.push(c.length)}return e}function R(e,t,n,r){for(const s of t){const{geometry:t,attributes:c,centroid:l}=s;let u;if(o(t)&&(u=C(t,n,r)),l){const t=T(l);e.push({attributes:c,centroid:t,geometry:u})}else e.push({attributes:c,geometry:u})}return e}function C(e,t,n){if(!e)return null;const o=h(t,n),{coords:r,lengths:s}=e,c=[];let l=0;for(const u of s){const e=[];for(let t=0;t<u;t++){const t=[];for(let e=0;e<o;e++)t.push(r[l++]);e.push(t)}c.push(e)}return t?n?{rings:c,hasZ:t,hasM:n}:{rings:c,hasZ:t}:n?{rings:c,hasM:n}:{rings:c}}function B(e,t,n,r,s){for(const c of t){const t=c.geometry,l=c.centroid,i=c.attributes;let h;t&&(h=D(new f,t,n,r)),o(l)?e.push(new u(h,i,F(new f,l),i[s])):e.push(new u(h,i,null,i[s]))}return e}function D(e,t,n=t.hasZ,o=t.hasM){return H(e,t.rings,n,o),e}function H(e,t,n,o){const r=h(n,o),{lengths:s,coords:c}=e;let l=0;s.length=c.length=0;for(const u of t){for(const e of u)for(let t=0;t<r;t++)c[l++]=e[t];s.push(u.length)}return e}const J=[],K=[];function Q(e,t,n,o,r){J[0]=e;const[s]=W(K,J,t,n,o,r);return J.length=K.length=0,s}function W(t,n,o,r,s,c){if(t.length=0,!o){for(const e of n){const n=e.attributes[c];t.push(new u(null,e.attributes,null,n))}return t}switch(o){case"esriGeometryPoint":return S(t,n,r,s,c);case"esriGeometryMultipoint":return O(t,n,r,s,c);case"esriGeometryPolyline":return q(t,n,r,s,c);case"esriGeometryPolygon":return B(t,n,r,s,c);default:a.error("convertToFeatureSet:unknown-geometry",new e(`Unable to parse unknown geometry type '${o}'`)),t.length=0}return t}function X(t,n,o,r,s,c){const l=t.length;switch(o){case"esriGeometryPoint":S(t,n,r,s,c);break;case"esriGeometryMultipoint":O(t,n,r,s,c);break;case"esriGeometryPolyline":q(t,n,r,s,c);break;case"esriGeometryPolygon":B(t,n,r,s,c);break;default:a.error("convertToFeatureSet:unknown-geometry",new e(`Unable to parse unknown geometry type '${o}'`))}for(let e=0;e<n.length;e++)t[e+l].geometryType=o,t[e+l].insertAfter=n[e].insertAfter,t[e+l].groupId=n[e].groupId;return t}function ee(e,t,n,o){K[0]=e,re(J,K,t,n,o);const r=J[0];return J.length=K.length=0,r}function te(t,o,u){if(n(t))return null;const i=new f;if("hasZ"in t&&null==o&&(o=t.hasZ),"hasM"in t&&null==u&&(u=t.hasM),r(t)){return v(null!=o?o:null!=t.z,null!=u?u:null!=t.m)(i,t)}return s(t)?D(i,t,o,u):c(t)?$(i,t,h(o,u)):l(t)?U(i,t,h(o,u)):void a.error("convertFromGeometry:unknown-geometry",new e(`Unable to parse unknown geometry type '${t}'`))}function ne(t,o,r,s){const c=t&&("coords"in t?t:t.geometry);if(n(c))return null;switch(o){case"esriGeometryPoint":{let e=T;return r&&s?e=k:r?e=P:s&&(e=Z),e(c)}case"esriGeometryMultipoint":return _(c,r,s);case"esriGeometryPolyline":return L(c,r,s);case"esriGeometryPolygon":return C(c,r,s);default:return void a.error("convertToGeometry:unknown-geometry",new e(`Unable to parse unknown geometry type '${o}'`))}}function oe(e,t){for(const n of t)e.push({attributes:n.attributes});return e}function re(t,o,r,s,c){if(t.length=0,n(r))return oe(t,o);switch(r){case"esriGeometryPoint":return z(t,o,s,c);case"esriGeometryMultipoint":return Y(t,o,s,c);case"esriGeometryPolyline":return A(t,o,s,c);case"esriGeometryPolygon":return R(t,o,s,c);default:a.error("convertToFeatureSet:unknown-geometry",new e(`Unable to parse unknown geometry type '${r}'`))}return t}function se(e){const{objectIdFieldName:t,spatialReference:n,transform:o,fields:r,hasM:s,hasZ:c,features:l,geometryType:u,exceededTransferLimit:i,uniqueIdField:f,queryGeometry:h,queryGeometryType:a}=e,g={features:re([],l,u,c,s),fields:r,geometryType:u,objectIdFieldName:t,spatialReference:n,uniqueIdField:f,queryGeometry:ne(h,a,!1,!1)};return o&&(g.transform=o),i&&(g.exceededTransferLimit=i),s&&(g.hasM=s),c&&(g.hasZ=c),g}function ce(t,n){const o=new i,{hasM:r,hasZ:s,features:c,objectIdFieldName:l,spatialReference:u,geometryType:f,exceededTransferLimit:h,transform:g,fields:d}=t;return d&&(o.fields=d),o.geometryType=f,o.objectIdFieldName=l||n,o.spatialReference=u,o.objectIdFieldName?(c&&W(o.features,c,f,s,r,o.objectIdFieldName),h&&(o.exceededTransferLimit=h),r&&(o.hasM=r),s&&(o.hasZ=s),g&&(o.transform=g),o):(a.error(new e("optimized-features:invalid-objectIdFieldName","objectIdFieldName is missing")),o)}function le(e){const{transform:t,features:n,hasM:r,hasZ:s}=e;if(!t)return e;for(const c of n)o(c.geometry)&&me(c.geometry,c.geometry,r,s,t),c.centroid&&me(c.centroid,c.centroid,r,s,t);return e.transform=null,e}function ue(e,t){const{geometryType:n,features:o,hasM:r,hasZ:s}=t;if(!e)return t;for(let c=0;c<o.length;c++){const t=o[c],l=t.weakClone();l.geometry=new f,ie(l.geometry,t.geometry,r,s,n,e),t.centroid&&(l.centroid=new f,ie(l.centroid,t.centroid,r,s,"esriGeometryPoint",e)),o[c]=l}return t.transform=e,t}function ie(e,t,o,r,s,c,l=o,u=r){if(e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0),n(t)||!t.coords.length)return null;const i=g[s],{coords:f,lengths:a}=t,d=h(o,r),m=h(o&&l,r&&u),y=I(o,r,l,u);if(!a.length)return y(e.coords,f,0,0,b(c,f[0]),M(c,f[1])),e.lengths.length&&(e.lengths.length=0),e.coords.length=d,e;let p,w,N,G,T=0,F=0,P=F;for(const n of a){if(n<i)continue;let t=0;F=P,N=p=b(c,f[T]),G=w=M(c,f[T+1]),y(e.coords,f,F,T,N,G),t++,T+=d,F+=m;for(let o=1;o<n;o++,T+=d)N=b(c,f[T]),G=M(c,f[T+1]),N===p&&G===w||(y(e.coords,f,F,T,N-p,G-w),F+=m,t++,p=N,w=G);t>=i&&(e.lengths.push(t),P=F)}return e.coords.length=P,e.coords.length?e:null}function fe(e,t,n,o,r,s,c=n,l=o){if(e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0),!t||!t.coords.length)return null;const u=g[r],{coords:i,lengths:f}=t,a=h(n,o),d=h(n&&c,o&&l),m=I(n,o,c,l);if(!f.length)return m(e.coords,i,0,0,i[0],i[1]),e.lengths.length&&(e.lengths.length=0),e.coords.length=a,e;let y=0;const p=s*s;for(const h of f){if(h<u){y+=h*a;continue}const t=e.coords.length/d,n=y,o=y+(h-1)*a;m(e.coords,i,e.coords.length,n,i[n],i[n+1]),ae(e.coords,i,a,p,m,n,o),m(e.coords,i,e.coords.length,o,i[o],i[o+1]);const r=e.coords.length/d-t;r>=u?e.lengths.push(r):e.coords.length=t*d,y+=h*a}return e.coords.length?e:null}function he(e,t,n,o){const r=e[t],s=e[t+1],c=e[n],l=e[n+1],u=e[o],i=e[o+1];let f=c,h=l,a=u-f,g=i-h;if(0!==a||0!==g){const e=((r-f)*a+(s-h)*g)/(a*a+g*g);e>1?(f=u,h=i):e>0&&(f+=a*e,h+=g*e)}return a=r-f,g=s-h,a*a+g*g}function ae(e,t,n,o,r,s,c){let l,u=o,i=0;for(let f=s+n;f<c;f+=n)l=he(t,f,s,c),l>u&&(i=f,u=l);u>o&&(i-s>n&&ae(e,t,n,o,r,s,i),r(e,t,e.length,i,t[i],t[i+1]),c-i>n&&ae(e,t,n,o,r,i,c))}function ge(e,t,o,r){if(n(t)||!t.coords||!t.coords.length)return null;const s=h(o,r);let c=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(t&&t.coords){const e=t.coords;for(let t=0;t<e.length;t+=s){const n=e[t],o=e[t+1];c=Math.min(c,n),u=Math.max(u,n),l=Math.min(l,o),i=Math.max(i,o)}}return e[0]=c,e[1]=l,e[2]=u,e[3]=i,e}function de(e,t,n,o){const r=h(n,o),{lengths:s,coords:c}=t;let l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,f=Number.NEGATIVE_INFINITY,a=0;for(const h of s){let e=c[a],t=c[a+1];l=Math.min(e,l),u=Math.min(t,u),i=Math.max(e,i),f=Math.max(t,f),a+=r;for(let n=1;n<h;n++,a+=r){const n=c[a],o=c[a+1];e+=n,t+=o,n<0&&(l=Math.min(l,e)),n>0&&(i=Math.max(i,e)),o<0?u=Math.min(u,t):o>0&&(f=Math.max(f,t))}}return e[0]=l,e[1]=u,e[2]=i,e[3]=f,e}function me(e,t,n,o,r){const{coords:s,lengths:c}=t,l=n?o?p:m:o?m:d,u=h(n,o);if(!s.length)return e!==t&&(e.lengths.length=0,e.coords.length=0),e;if(!c.length)return l(e.coords,s,0,0,w(r,s[0]),N(r,s[1])),e!==t&&(e.lengths.length=0,e.coords.length=u),e;const[i,f]=r.scale;let a=0;for(let h=0;h<c.length;h++){const t=c[h];e.lengths[h]=t;let n=w(r,s[a]),o=N(r,s[a+1]);l(e.coords,s,a,a,n,o),a+=u;for(let r=1;r<t;r++,a+=u)n+=s[a]*i,o-=s[a+1]*f,l(e.coords,s,a,a,n,o)}return e!==t&&(e.lengths.length=c.length,e.coords.length=s.length),e}function ye(e,t,n,o,r,s){const c=h(n,o),l=I(n,o,r,s),u=t.coords;e.coords.length=0,e.lengths.length=0,e.lengths.push(...t.lengths);for(let i=0;i<u.length;i+=c)l(e.coords,u,e.coords.length,i,u[i],u[i+1]);return e}function pe(e,t,n,o,r){if(!t||!t.coords||!t.coords.length)return null;const s=g[n],{coords:c,lengths:l}=t,u=I(o,r,o,r),i=h(o,r);let f=0,a=0,d=0,m=0;for(const h of l){a=m,u(e.coords,c,a,f,c[f],c[f+1]),f+=i;let t=c[f],n=c[f+1],o=t,r=n,l=n/t;a+=i,u(e.coords,c,a,f,o,r),f+=i;for(let s=2;s<h;s++){t=c[f],n=c[f+1];const s=n/t,h=l===s||!isFinite(l)&&!isFinite(s),g=h&&isFinite(s)?l>=0&&s>=0||l<=0&&s<=0:r>=0&&n>=0||r<=0&&n<=0;h&&g?(o+=t,r+=n):(o=t,r=n,a+=i),u(e.coords,c,a,f,o,r),f+=i,l=s}a+=i;const g=(a-m)/i;g>=s&&(e.lengths[d]=g,m=a,d++)}return e.coords.length>m&&(e.coords.length=m),e.lengths.length>d&&(e.lengths.length=d),e.coords.length&&e.lengths.length?e:null}function Ie(e,t,n,o){let r=0,s=e[o*t],c=e[o*(t+1)];for(let l=1;l<n;l++){const n=s+e[o*(t+l)],u=c+e[o*(t+l)+1],i=(n-s)*(u+c);s=n,c=u,r+=i}return.5*r}function be(e,t){const{coords:n,lengths:o}=e;let r=0,s=0;for(let c=0;c<o.length;c++){s+=Ie(n,r,o[c],t),r+=c}return Math.abs(s)}function Me(e,t){const n=e.clone(),o=e.coords,r=e.lengths;let s=0;for(let c=0;c<r.length;c++){const e=r[c];let l=o[t*s],u=o[t*s+1];for(let r=1;r<e;r++){const e=o[t*(s+r)],c=o[t*(s+r)+1],i=e-l,f=c-u;n.coords[t*(s+r)]=i,n.coords[t*(s+r)+1]=f,l=e,u=c}s+=e}return n}function we(e,t){if(n(e))return null;const o=e.clone(),r=e.coords,s=e.lengths;let c=0;for(let n=0;n<s.length;n++){const e=s[n];let l=r[t*c],u=r[t*c+1];for(let n=1;n<e;n++){const e=l+r[t*(c+n)],s=u+r[t*(c+n)+1];o.coords[t*(c+n)]=e,o.coords[t*(c+n)+1]=s,l=e,u=s}c+=e}return o}export{Q as convertFromFeature,ce as convertFromFeatureSet,W as convertFromFeatures,te as convertFromGeometry,X as convertFromGraphics,U as convertFromMultipoint,O as convertFromMultipointFeatures,H as convertFromNestedArray,V as convertFromPoint,S as convertFromPointFeatures,D as convertFromPolygon,$ as convertFromPolyline,q as convertFromPolylineFeatures,ee as convertToFeature,se as convertToFeatureSet,re as convertToFeatures,ne as convertToGeometry,_ as convertToMultipoint,Y as convertToMultipointFeatures,G as convertToPoint,C as convertToPolygon,L as convertToPolyline,we as deltaDecodeGeometry,Me as deltaEncodeGeometry,fe as generalizeOptimizedGeometry,ge as getBoundsOptimizedGeometry,be as getQuantizedArea,de as getQuantizedBoundsOptimizedGeometry,Ie as getSignedQuantizedRingArea,ue as quantizeOptimizedFeatureSet,ie as quantizeOptimizedGeometry,b as quantizeX,M as quantizeY,pe as removeCollinearVectices,ye as removeZMValues,le as unquantizeOptimizedFeatureSet,me as unquantizeOptimizedGeometry,w as unquantizeX,N as unquantizeY};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import i from"../../core/Loadable.js";import{isNone as s,unwrap as r}from"../../core/maybe.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{parse as l}from"./arcgisLayerUrl.js";import u from"./Contingency.js";import c from"./ContingencyConstraintViolation.js";import p from"./ContingentValue.js";import d from"./ContingentValuesResult.js";import f from"./FieldGroup.js";import y from"./Subtype.js";var h;let m=h=class extends(n(i)){constructor(e){super(e),this.request=t,this.fieldGroups=null,this.fieldGroupDefinitions=null}initialize(){}static async createLoadedLayerContingentValuesCache(e){await e.load();const t=e.sourceJSON.hasContingentValuesDefinition;if(t)return new h({layer:e}).load();if(void 0===t){const t=l(e.url);if(s(t))return null;const n=t.url.path;if((await h._staticFetchEnterpriseFeatureRoot(n)).supportsQueryDataElements){const t=e.layerId.toString(),i=await h._staticFetchEnterpriseFieldGroup(n,t);if(i){const t=i.map((e=>({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fieldNames.names})));return new h({layer:e,fieldGroupDefinitions:t}).load()}}}return null}async load(e){const t=this.layer.load(e).then((()=>this._initializeContingentValues(this.fieldGroupDefinitions,e)));return this.addResolvingPromise(t),this}validateContingencyConstraints(e){const t=this.layer.typeIdField,n=[];for(const i of this.fieldGroups){let s=!1;const r=e.attributes[t],o=i.contingencies.filter((e=>!(!e.isRetired&&e.subtype)||e.subtype.code===r));for(const t of o){let n=!0;for(const i in t.values){const s=t.values[i];if("any"!==s.objectType)if("null"===s.objectType){if(null!==e.attributes[i]&&void 0!==e.attributes[i]){n=!1;break}}else if("code"===s.objectType){if(e.attributes[i]!==s.codedValue.code){n=!1;break}}else if("range"===s.objectType){const t=e.attributes[i];if(t<s.minValue||t>s.maxValue){n=!1;break}}}if(n){s=!0;break}}if(!s){const e=i.isEditingRestrictive?"error":"warning";n.push(new c({fieldGroup:i,type:e}))}}return n}getContingentValues(e,t){const n=this.layer.typeIdField,i=e.attributes[n],s={},r=[];for(const o of this.fieldGroups){const n=[],a=o.contingencies.filter((e=>!(!e.isRetired&&e.subtype)||e.subtype.code===i));for(const i of a){let s,o=!0;for(const n in i.values){const r=i.values[n];if(t!==n){if("any"!==r.objectType)if("null"===r.objectType)null!==e.attributes[n]&&void 0!==e.attributes[n]&&(o=!1);else if("code"===r.objectType)e.attributes[n]!==r.codedValue.code&&(o=!1);else if("range"===r.objectType){const t=e.attributes[n];(t<r.minValue||t>r.maxValue)&&(o=!1)}}else s=r}s&&o&&(n.push(s),r.push(s))}s[o.name]=n}return new d({contingentValuesAllGroups:r,contingentValuesByFieldGroup:s})}static async _staticFetchEnterpriseFeatureRoot(e,n){return t(e,{responseType:"json",query:{f:"json"},...n}).then((e=>e.data))}static async _staticFetchEnterpriseFieldGroup(e,n,i){return t(`${e}/queryDataElements`,{responseType:"json",query:{layers:JSON.stringify([n]),f:"json"},...i}).then((e=>{var t;return null==(t=e.data.layerDataElements)?void 0:t[0].dataElement.fieldGroups}))}async _initializeContingentValues(e,t){const n=e||await this._fetchFieldGroupDefs(t);if(0===n.length)return void(this.fieldGroups=[]);const i=await this._fetchContingentValues(n,t);this.fieldGroups=i}async _fetchFieldGroupDefs(e){const t=this.layer.sourceJSON,n=this.layer.layerId.toString(),i=r(l(this.layer.url)).url.path;if(t.hasContingentValuesDefinition){return(await this._fetchAGOLFieldGroup(i,n,e)).map((e=>({name:e.name,isEditingRestrictive:e.restrictive,fields:e.fields})))}return void 0!==t.hasContingentValuesDefinition?[]:this._fetchEnterpriseFeatureRoot(i,e).then((async t=>{if(t.supportsQueryDataElements){return(await this._fetchEnterpriseFieldGroup(i,n,e)).map((e=>({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fieldNames.names})))}return[]}))}async _fetchAGOLFieldGroup(e,n,i){return t(`${e}/${n}/fieldgroups`,{responseType:"json",query:{f:"json"},...i}).then((e=>e.data.fieldGroups))}async _fetchEnterpriseFieldGroup(e,t,n){return h._staticFetchEnterpriseFieldGroup(e,t,n)}async _fetchEnterpriseFeatureRoot(e,t){return h._staticFetchEnterpriseFeatureRoot(e,t)}async _fetchContingentValues(e,t){const n=this.layer.sourceJSON,i=this.layer.layerId.toString(),s=r(l(this.layer.url)).url.path;if(n.hasContingentValuesDefinition){const n=await this._fetchAGOLContingentValues(s,i,t);return this._constructFieldGroupsAGOL(e,n)}const o=await this._fetchEnterpriseContingentValues(s,i,t);return this._constructFieldGroupsEnterprise(e,o)}_constructFieldGroupsAGOL(e,t){return e.map((e=>{const n=t.contingentValuesDefinition.fieldGroups.find((t=>t.name===e.name));if(n){let i=[];return i=t.contingentValuesDefinition.hasSubType?this._parseAGOLFieldGroupSubtype(e,t,n.subTypes):this._parseAGOLFieldGroup(e,t,n.contingentValues),new f({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fields,contingencies:i})}return null})).filter((e=>null!==e))}_parseAGOLFieldGroupSubtype(e,t,n){let i=[];return n.forEach((n=>{const s=this._getSubtypeAGOL(n.name);i=i.concat(this._parseAGOLFieldGroup(e,t,n.contingentValues,s))})),i}_parseAGOLFieldGroup(e,t,n,i){const s=[];for(const r of n){const n=this._parseAGOLContingency(r,e,t,i);s.push(n)}return s}_parseAGOLContingency(e,t,n,i){const s=e.id,r=!!e.retired&&1===e.retired,o={};for(let a=0,l=0;a<t.fields.length;a++){const s=t.fields[a],r=n.typeCodes[e.types[a]];if("Code"===r){let t=e.values[l];l++;const r=this._getDomain(i,s);if("string"===this.layer.getField(s).type){const e=n.stringDicts.find((e=>e.domain===r.name));e&&(t=e.entries[t])}const a=r.codedValues.find((e=>e.code===t)),u=new p({codedValue:a,objectType:"code"});o[s]=u}else if("Range"===r){const t=e.values[l];l++;const n=t.range[0],i=t.range[1],r=new p({minValue:n,maxValue:i,objectType:"range"});o[s]=r}else if("Any"===r){const e=new p({objectType:"any"});o[s]=e}else{const e=new p({objectType:"null"});o[s]=e}}return new u({id:s,isRetired:r,subtype:i,values:o})}_constructFieldGroupsEnterprise(e,t){const n=t.fieldGroups;return e.map((e=>{const i=n.find((t=>t.name===e.name));if(i){const n=i.contingencies.map((n=>{const i=n.id,s=n.isRetired,r=this._getSubtypeEnterprise(n.subtypeCode),o={};for(let a=0;a<e.fields.length;a++){const i=e.fields[a];let s=n.values[a];if("number"==typeof s||"string"==typeof s){const e=this._getDomain(r,i),n=this.layer.getField(i);if("string"===n.type)s=t.stringDictionary[s];else if("date"===n.type){const e=new Date(`${s}+00:00`);s=e.getTime()}const a=e.codedValues.find((e=>e.code===s)),l=new p({codedValue:a,objectType:"code"});o[i]=l}else if("object"==typeof s){const e=s.minValue,t=s.maxValue,n=new p({minValue:e,maxValue:t,objectType:"range"});o[i]=n}else if(s){const e=new p({objectType:"any"});o[i]=e}else{const e=new p({objectType:"null"});o[i]=e}}return new u({id:i,isRetired:s,subtype:r,values:o})}));return new f({name:e.name,isEditingRestrictive:e.isEditingRestrictive,fields:e.fields,contingencies:n})}return null})).filter((e=>null!==e))}async _fetchEnterpriseContingentValues(e,n,i){return t(`${e}/queryContingentValues`,{responseType:"json",query:{layers:JSON.stringify([n]),f:"json"},...i}).then((e=>{var t;return null==(t=e.data.contingentValueSets)?void 0:t[0]}))}async _fetchAGOLContingentValues(e,n,i){return t(`${e}/${n}/contingentValues`,{responseType:"json",query:{f:"json"},...i}).then((e=>e.data))}_getSubtypeEnterprise(e){const t=this.layer.sourceJSON;if(t.subtypes){const n=t.subtypes.find((t=>t.code===e));return y.fromJSON(n)}return null}_getSubtypeAGOL(e){const t=this.layer.sourceJSON;if(t.subtypes){const n=t.subtypes.find((t=>t.name===e));return y.fromJSON(n)}return null}_getDomain(e,t){const n=e?e.domains[t]:this.layer.getFieldDomain(t);return"inherited"===n.type?this.layer.getFieldDomain(t):n}};e([o({constructOnly:!0})],m.prototype,"layer",void 0),e([o({constructOnly:!0})],m.prototype,"request",void 0),e([o({type:[f]})],m.prototype,"fieldGroups",void 0),e([o()],m.prototype,"fieldGroupDefinitions",void 0),m=h=e([a("esri.layers.support.LayerContingentValuesCache")],m);const g=m;export{g as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{isNone as r}from"../../core/maybe.js";import{getMetersPerUnitForSR as s}from"../../core/unitUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{Integer as l}from"../../core/accessorSupport/ensureType.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import c from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{create as f}from"../../geometry/support/aaBoundingRect.js";import{isValid as h,getInfo as m,isGeographic as d,equals as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{isNone as r}from"../../core/maybe.js";import{getMetersPerUnitForSR as s}from"../../core/unitUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{Integer as l}from"../../core/accessorSupport/ensureType.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import c from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{create as f}from"../../geometry/support/aaBoundingRect.js";import{isValid as h,getInfo as m,isGeographic as d,equals as g}from"../../geometry/support/spatialReferenceUtils.js";import{project as y}from"../../geometry/support/webMercatorUtils.js";import v from"./LOD.js";var w;const x=new t({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let O=w=class extends o{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:o,size:r=256,spatialReference:i=u.WebMercator,numLODs:l=24}=e;if(!h(i)){const e=[];if(o)for(let t=0;t<o.length;t++){const r=o[t];e.push({level:t,scale:r,resolution:r})}else{let t=5e-4;for(let o=l-1;o>=0;o--)e.unshift({level:o,scale:t,resolution:t}),t*=2}return new w({dpi:96,lods:e,origin:new c(0,0,i),size:[r,r],spatialReference:i})}const n=m(i),a=e.origin?new c({x:e.origin.x,y:e.origin.y,spatialReference:i}):new c(n?{x:n.origin[0],y:n.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),p=96,f=1/(s(i)*39.37*p),g=[];if(o)for(let s=0;s<o.length;s++){const e=o[s],t=e*f;g.push({level:s,scale:e,resolution:t})}else{let e=d(i)?512/r*591657527.5917094:256/r*591657527.591555;const o=Math.ceil(l/t);g.push({level:0,scale:e,resolution:e*f});for(let r=1;r<o;r++){const o=e/2**t,s=o*f;g.push({level:r,scale:o,resolution:s}),e=o}}return new w({dpi:p,lods:g,origin:a,size:[r,r],spatialReference:i})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const o=m(e);return e.isWrappable&&Math.abs(o.origin[0]-t.x)<=o.dx}return!1}readOrigin(e,t){return c.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,o=0;const r=[];this._levelToLOD={},e&&(t=-1/0,o=1/0,e.forEach((e=>{r.push(e.scale),t=e.scale>t?e.scale:t,o=e.scale<o?e.scale:o,this._levelToLOD[e.level]=e}))),this._set("scales",r),this._set("minScale",t),this._set("maxScale",o),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];{const o=Math.floor(e),r=o+1;return t[o]/(t[o]/t[r])**(e-o)}}scaleToZoom(e){const t=this.scales,o=t.length-1;let r=0;for(;r<o;r++){const o=t[r],s=t[r+1];if(o<=e)return r;if(s===e)return r+1;if(o>e&&s<e)return r+Math.log(o/e)/Math.log(o/s)}return r}snapScale(e,t=.95){const o=this.scaleToZoom(e);return o%Math.floor(o)>=t?this.zoomToScale(Math.ceil(o)):this.zoomToScale(Math.floor(o))}tileAt(e,t,o,s){const i=this.lodAt(e);if(!i)return null;let l,n;if("number"==typeof t)l=t,n=o;else if(g(t.spatialReference,this.spatialReference))l=t.x,n=t.y,s=o;else{const e=y(t,this.spatialReference);if(r(e))return null;l=e.x,n=e.y,s=o}const a=i.resolution*this.size[0],p=i.resolution*this.size[1];return s||(s={id:null,level:0,row:0,col:0,extent:f()}),s.level=e,s.row=Math.floor((this.origin.y-n)/p+.001),s.col=Math.floor((l-this.origin.x)/a+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=w.ExtrapolateOptions.NONE){let o=this.lodAt(e.level);if(!o&&t===w.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(o=t)}if(!o)return;const r=e.level-o.level,s=o.resolution*this.size[0]/2**r,i=o.resolution*this.size[1]/2**r;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=f()),e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*i,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+i}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel)&&(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),!0)}getTileBounds(e,t){const{resolution:o}=this.lodAt(t.level),r=o*this.size[0],s=o*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+r,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return w.fromJSON(this.write({}))}getOrCreateCompatible(e){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const t=this.spatialReference.isGeographic,o=[],r=this.lods.length;for(let s=0;s<r;s++){const r=this.lods[s],i=512===e?.5*r.resolution:t?r.resolution:2*r.resolution;o.push(new v({level:r.level,scale:r.scale,resolution:i}))}return new w({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:o})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let o=0;o<e.length;o++){const r=e[o];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};e([i({type:Number,json:{write:!0}})],O.prototype,"compressionQuality",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"dpi",void 0),e([i({type:String,json:{read:x.read,write:x.write,origins:{"web-scene":{read:!1,write:!1}}}})],O.prototype,"format",void 0),e([i({readOnly:!0})],O.prototype,"isWrappable",null),e([i({type:c,json:{write:!0}})],O.prototype,"origin",void 0),e([n("origin")],O.prototype,"readOrigin",null),e([i({type:[v],value:null,json:{write:!0}})],O.prototype,"lods",null),e([i({readOnly:!0})],O.prototype,"minScale",void 0),e([i({readOnly:!0})],O.prototype,"maxScale",void 0),e([i({readOnly:!0})],O.prototype,"scales",void 0),e([i({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],O.prototype,"size",void 0),e([n("size",["rows","cols"])],O.prototype,"readSize",null),e([p("size",{cols:{type:l},rows:{type:l}})],O.prototype,"writeSize",null),e([i({type:u,json:{write:!0}})],O.prototype,"spatialReference",void 0),O=w=e([a("esri.layers.support.TileInfo")],O),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(O||(O={}));const S=O;export{S as default};
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const e="20220128",a="ae1460a2a0d9d5de33b7ea4e9735e8918e0cf028";export{e as buildDate,a as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{isSome as o}from"../core/maybe.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as l}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import s from"./Symbol3DLayer.js";import{symbol3dEdgesProperty as i}from"./edges/utils.js";import n from"./patterns/LineStylePattern3D.js";import a from"./patterns/StylePattern3D.js";import{symbol3dPatternProperty as p}from"./patterns/utils.js";import{white as u,transparentWhite as m}from"./support/colors.js";import{Symbol3DFillMaterial as c}from"./support/Symbol3DFillMaterial.js";import y
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{isSome as o}from"../core/maybe.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as l}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import s from"./Symbol3DLayer.js";import{symbol3dEdgesProperty as i}from"./edges/utils.js";import n from"./patterns/LineStylePattern3D.js";import a from"./patterns/StylePattern3D.js";import{symbol3dPatternProperty as p}from"./patterns/utils.js";import{white as u,transparentWhite as m}from"./support/colors.js";import{Symbol3DFillMaterial as c}from"./support/Symbol3DFillMaterial.js";import{Symbol3DOutline as y}from"./support/Symbol3DOutline.js";var d;let h=d=class extends s{constructor(t){super(t),this.type="fill",this.material=null,this.pattern=null,this.castShadows=!0,this.outline=null,this.edges=null}clone(){const t={edges:o(this.edges)?this.edges.clone():null,enabled:this.enabled,material:o(this.material)?this.material.clone():null,pattern:o(this.pattern)?this.pattern.clone():null,castShadows:this.castShadows,outline:o(this.outline)?this.outline.clone():null};return new d(t)}static fromSimpleFillSymbol(t){var o,e,l,r,s,i;const p=t.outline&&t.outline.style&&"inside-frame"!==t.outline.style&&"solid"!==t.outline.style?new n({style:t.outline.style}):null,y={size:null!=(o=null==(e=t.outline)?void 0:e.width)?o:0,color:(null!=(l=null==(r=t.outline)?void 0:r.color)?l:u).clone(),pattern:p};return p&&null!=(s=t.outline)&&s.cap&&(y.patternCap=t.outline.cap),new d({material:new c({color:(null!=(i=t.color)?i:m).clone()}),pattern:t.style&&"solid"!==t.style?new a({style:t.style}):null,outline:y})}};t([l({Fill:"fill"},{readOnly:!0})],h.prototype,"type",void 0),t([e({type:c,json:{write:!0}})],h.prototype,"material",void 0),t([e(p)],h.prototype,"pattern",void 0),t([e({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],h.prototype,"castShadows",void 0),t([e({type:y,json:{write:!0}})],h.prototype,"outline",void 0),t([e(i)],h.prototype,"edges",void 0),h=d=t([r("esri.symbols.FillSymbol3DLayer")],h);const f=h;export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../chunks/tslib.es6.js";import t from"../core/Logger.js";import{isSome as r}from"../core/maybe.js";import{makeData as e}from"../core/urlUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import c from"./Symbol3DLayer.js";import{white as l,isBlack as a}from"./support/colors.js";import p
|
|
5
|
+
import{_ as o}from"../chunks/tslib.es6.js";import t from"../core/Logger.js";import{isSome as r}from"../core/maybe.js";import{makeData as e}from"../core/urlUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import c from"./Symbol3DLayer.js";import{white as l,isBlack as a}from"./support/colors.js";import{IconSymbol3DLayerResource as p}from"./support/IconSymbol3DLayerResource.js";import{screenSizeProperty as m}from"./support/materialUtils.js";import{Symbol3DAnchorPosition2D as u}from"./support/Symbol3DAnchorPosition2D.js";import{Symbol3DIconOutline as h}from"./support/Symbol3DIconOutline.js";import{Symbol3DMaterial as y}from"./support/Symbol3DMaterial.js";var d;const f=t.getLogger("esri.symbols.IconSymbol3DLayer");let b=d=class extends c{constructor(o){super(o),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=void 0,this.outline=void 0}clone(){return new d({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:r(this.material)?this.material.clone():null,outline:r(this.outline)?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(o){const t=o.color||l,r=j(o),e=o.outline&&o.outline.width>0?{size:o.outline.width,color:(o.outline.color||l).clone()}:null;return new d({size:o.size,resource:{primitive:w(o.style)},material:{color:t},outline:e,anchor:r?"relative":void 0,anchorPosition:r})}static fromPictureMarkerSymbol(o){const t=!o.color||a(o.color)?l:o.color,r=j(o);return new d({size:o.width<=o.height?o.height:o.width,resource:{href:o.url},material:{color:t.clone()},anchor:r?"relative":void 0,anchorPosition:r})}static fromCIMSymbol(o){return new d({resource:{href:e({mediaType:"application/json",data:JSON.stringify(o.data)})}})}};function j(o){const t="width"in o?o.width:o.size,r="height"in o?o.height:o.size,e=v(o.xoffset),i=v(o.yoffset);return(e||i)&&t&&r?{x:-e/t,y:i/r}:null}function v(o){return isFinite(o)?o:0}o([i({type:y,json:{write:!0}})],b.prototype,"material",void 0),o([i({type:p,json:{write:!0}})],b.prototype,"resource",void 0),o([s({Icon:"icon"},{readOnly:!0})],b.prototype,"type",void 0),o([i(m)],b.prototype,"size",void 0),o([s({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),i({json:{default:"center"}})],b.prototype,"anchor",void 0),o([i({type:u,json:{type:[Number],read:{reader:o=>new u({x:o[0],y:o[1]})},write:{writer:(o,t)=>{t.anchorPosition=[o.x,o.y]},overridePolicy(){return{enabled:"relative"===this.anchor}}}}})],b.prototype,"anchorPosition",void 0),o([i({type:h,json:{write:!0}})],b.prototype,"outline",void 0),b=d=o([n("esri.symbols.IconSymbol3DLayer")],b);const g={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function w(o){const t=g[o];return t||(f.warn(`${o} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const S=b;export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../chunks/tslib.es6.js";import{isSome as t}from"../core/maybe.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as r}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import s from"./Symbol3DLayer.js";import p
|
|
5
|
+
import{_ as o}from"../chunks/tslib.es6.js";import{isSome as t}from"../core/maybe.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as r}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import s from"./Symbol3DLayer.js";import{ObjectSymbol3DLayerResource as p}from"./support/ObjectSymbol3DLayerResource.js";import{Symbol3DAnchorPosition3D as a}from"./support/Symbol3DAnchorPosition3D.js";import{Symbol3DMaterial as h}from"./support/Symbol3DMaterial.js";var n;let c=n=class extends s{constructor(o){super(o),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){return new n({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:t(this.material)?this.material.clone():null,castShadows:this.castShadows,resource:this.resource&&this.resource.clone(),width:this.width})}get isPrimitive(){return!this.resource||"string"!=typeof this.resource.href}};o([e({type:h,json:{write:!0}})],c.prototype,"material",void 0),o([e({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],c.prototype,"castShadows",void 0),o([e({type:p,json:{write:!0}})],c.prototype,"resource",void 0),o([r({Object:"object"},{readOnly:!0})],c.prototype,"type",void 0),o([e({type:Number,json:{write:!0}})],c.prototype,"width",void 0),o([e({type:Number,json:{write:!0}})],c.prototype,"height",void 0),o([e({type:Number,json:{write:!0}})],c.prototype,"depth",void 0),o([r({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),e({json:{default:"origin"}})],c.prototype,"anchor",void 0),o([e({type:a,json:{type:[Number],read:{reader:o=>new a({x:o[0],y:o[1],z:o[2]})},write:{writer:(o,t)=>{t.anchorPosition=[o.x,o.y,o.z]},overridePolicy(){return{enabled:"relative"===this.anchor}}}}})],c.prototype,"anchorPosition",void 0),o([e({type:Number,json:{write:!0}})],c.prototype,"heading",void 0),o([e({type:Number,json:{write:!0}})],c.prototype,"tilt",void 0),o([e({type:Number,json:{write:!0}})],c.prototype,"roll",void 0),o([e({readOnly:!0})],c.prototype,"isPrimitive",null),c=n=o([i("esri.symbols.ObjectSymbol3DLayer")],c);const l=c;export{l as default};
|
package/symbols/Symbol3D.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/Collection.js";import{referenceSetter as t,castForReferenceSetter as o}from"../core/collectionUtils.js";import s from"../core/Logger.js";import{isAbsolute as l,normalize as i,hasSamePortal as a}from"../core/urlUtils.js";import m from"../core/Warning.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as b}from"../core/accessorSupport/decorators/writer.js";import u from"../portal/Portal.js";import{f,t as d}from"../chunks/persistableUrlUtils.js";import g from"./ExtrudeSymbol3DLayer.js";import j from"./FillSymbol3DLayer.js";import S from"./IconSymbol3DLayer.js";import h from"./LineSymbol3DLayer.js";import L from"./ObjectSymbol3DLayer.js";import O from"./PathSymbol3DLayer.js";import U from"./Symbol.js";import _ from"./Symbol3DLayer.js";import D from"./TextSymbol3DLayer.js";import w from"./WaterSymbol3DLayer.js";import N from"./support/StyleOrigin.js";import x
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/Collection.js";import{referenceSetter as t,castForReferenceSetter as o}from"../core/collectionUtils.js";import s from"../core/Logger.js";import{isAbsolute as l,normalize as i,hasSamePortal as a}from"../core/urlUtils.js";import m from"../core/Warning.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as b}from"../core/accessorSupport/decorators/writer.js";import u from"../portal/Portal.js";import{f,t as d}from"../chunks/persistableUrlUtils.js";import g from"./ExtrudeSymbol3DLayer.js";import j from"./FillSymbol3DLayer.js";import S from"./IconSymbol3DLayer.js";import h from"./LineSymbol3DLayer.js";import L from"./ObjectSymbol3DLayer.js";import O from"./PathSymbol3DLayer.js";import U from"./Symbol.js";import _ from"./Symbol3DLayer.js";import D from"./TextSymbol3DLayer.js";import w from"./WaterSymbol3DLayer.js";import N from"./support/StyleOrigin.js";import{Thumbnail as x}from"./support/Thumbnail.js";const v={icon:S,object:L,line:h,path:O,fill:j,extrude:g,text:D,water:w},C=r.ofType({base:_,key:"type",typeMap:v,errorContext:"symbol-layer"}),T=s.getLogger("esri.symbols.Symbol3D");let k=class extends U{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const t=this.__accessor__&&this.__accessor__.metadatas&&this.__accessor__.metadatas.symbolLayers,o=t&&t.type||r;this._set("symbolLayers",new o)}get color(){return null}set color(e){this.initialized&&T.error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){t(e,this._get("symbolLayers"))}readStyleOrigin(e,r,t){if(e.styleUrl&&e.name){const r=f(e.styleUrl,t);return new N({styleUrl:r,name:e.name})}if(e.styleName&&e.name)return new N({portal:t&&t.portal||u.getDefault(),styleName:e.styleName,name:e.name});t&&t.messages&&t.messages.push(new m("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:t,definition:e}))}writeStyleOrigin(e,r,t,o){if(e.styleUrl&&e.name){let t=d(e.styleUrl,o);l(t)&&(t=i(t)),r.styleOrigin={styleUrl:t,name:e.name}}else e.styleName&&e.name&&(e.portal&&o&&o.portal&&!a(e.portal.restUrl,o.portal.restUrl)?o&&o.messages&&o.messages.push(new m("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):r.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof _||e&&v[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};e([y({json:{read:!1,write:!1}})],k.prototype,"color",null),e([y({type:C,nonNullable:!0,json:{write:!0}}),n(o)],k.prototype,"symbolLayers",null),e([y({type:N})],k.prototype,"styleOrigin",void 0),e([p("styleOrigin")],k.prototype,"readStyleOrigin",null),e([b("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],k.prototype,"writeStyleOrigin",null),e([y({type:x,json:{read:!1}})],k.prototype,"thumbnail",void 0),e([y({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],k.prototype,"type",void 0),k=e([c("esri.symbols.Symbol3D")],k);const A=k;export{A as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import o from"../core/Logger.js";import{throwIfAborted as r}from"../core/promiseUtils.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../portal/Portal.js";import{r as i,w as m}from"../chunks/persistableUrlUtils.js";import a from"./Symbol.js";import y
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import o from"../core/Logger.js";import{throwIfAborted as r}from"../core/promiseUtils.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../portal/Portal.js";import{r as i,w as m}from"../chunks/persistableUrlUtils.js";import a from"./Symbol.js";import{Thumbnail as y}from"./support/Thumbnail.js";var c;const n=o.getLogger("esri.symbols.WebStyleSymbol");let u=c=class extends a{constructor(t){super(t),this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}read(t,o){this.portal=o?o.portal:void 0,super.read(t,o)}clone(){return new c({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(t){return this._fetchSymbol("webRef",t)}fetchCIMSymbol(t){return this._fetchSymbol("cimRef",t)}async _fetchSymbol(t,o){const e=await b();r(o);const s=e.resolveWebStyleSymbol(this,{portal:this.portal},t,o);return s.catch((t=>{n.error("#fetchSymbol()","Failed to create symbol from style",t)})),s}};function b(){return import("./support/webStyleSymbolUtils.js")}t([e({json:{write:!1}})],u.prototype,"color",void 0),t([e({type:String,json:{write:!0}})],u.prototype,"styleName",void 0),t([e({type:p,json:{write:!1}})],u.prototype,"portal",void 0),t([e({type:String,json:{read:i,write:m}})],u.prototype,"styleUrl",void 0),t([e({type:y,json:{read:!1}})],u.prototype,"thumbnail",void 0),t([e({type:String,json:{write:!0}})],u.prototype,"name",void 0),t([s({styleSymbolReference:"web-style"},{readOnly:!0})],u.prototype,"type",void 0),u=c=t([l("esri.symbols.WebStyleSymbol")],u);const h=u;export{h as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Color.js";import t from"../../request.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{pt2px as a}from"../../core/screenUtils.js";import{numericHash as i}from"../../core/string.js";import{getJsonType as s,isPolygon as o,isPolyline as n}from"../../geometry/support/jsonUtils.js";import{analyzeCIMSymbol as c,analyzeCIMResource as l}from"./cimAnalyzer.js";import m from"./CIMResourceManager.js";import h from"./Rasterizer.js";import{TextRasterizer as f}from"./TextRasterizer.js";import{createLabelOverrideFunction as g,evaluateValueOrFunction as u,colorToArray as y}from"./utils.js";import{scaleCIMMarker as p}from"../support/cimSymbolUtils.js";import d from"../support/Symbol3DAnchorPosition2D.js";var M;!function(e){e.Legend="legend",e.Preview="preview"}(M||(M={}));const C=(e,t,r)=>{if(e&&e.targetSize){let i;if(r){const t=Math.max(r.frame.xmax-r.frame.xmin,r.frame.ymax-r.frame.ymin);i=e.targetSize/a(t)}else i=e.targetSize/t.referenceSize;return i}return e&&e.scaleFactor?e.scaleFactor:1},I={fill:{legend:{frame:{xmax:15,xmin:0,ymax:15,ymin:0},geometry:{rings:[[[0,15],[15,7.5],[15,0],[0,0],[0,15]]]},canvasPaths:{rings:[[[0,15],[0,0],[15,7.5],[15,15],[0,15]]]}},preview:{frame:{xmax:100,xmin:0,ymax:100,ymin:0},geometry:{rings:[[[0,100],[100,100],[100,0],[0,0],[0,100]]]},canvasPaths:{rings:[[[0,100],[0,0],[100,0],[100,100],[0,100]]]}}},stroke:{legend:{frame:{xmax:24,xmin:0,ymax:2,ymin:-2},geometry:{paths:[[[0,0],[12,0],[24,0]]]},canvasPaths:{paths:[[[0,2],[12,2],[24,2]]]}},preview:{frame:{xmax:100,xmin:0,ymax:2,ymin:-2},geometry:{paths:[[[0,0],[50,0],[100,0]]]},canvasPaths:{paths:[[[0,2],[50,2],[100,2]]]}}}};class z{constructor(e,t){this._spatialReference=e,this._avoidSDF=t,this._resourceCache=new Map,this._pictureMarkerCache=new Map,this._textRasterizer=new f,this._cimResourceManager=new m,this._rasterizer=new h(this._cimResourceManager)}async rasterizeCIMSymbolAsync(e,t,r,a,i,o,n,c){a=a||(t?null!=t.centroid?"esriGeometryPolygon":s(t.geometry):null)||x(e);const l=await this.analyzeCIMSymbol(e,t?P(t.attributes):null,r,a,c);return this.rasterizeCIMSymbol(l,t,a,i,o,n)}async analyzeCIMSymbol(e,t,a,i,s){const o=[],n=t?{geometryType:i,spatialReference:this._spatialReference,fields:t}:null;let l;await c(e.data,n,this._cimResourceManager,o,this._avoidSDF),r(s);for(const r of o)"CIMPictureMarker"!==r.cim.type&&"CIMPictureFill"!==r.cim.type&&"CIMPictureStroke"!==r.cim.type||(l||(l=[]),l.push(this._fetchPictureMarkerResource(r,s))),a&&"text"===r.type&&"string"==typeof r.text&&r.text.indexOf("[")>-1&&(r.text=g(a,r.text,r.cim.textCase));return l&&await Promise.all(l),o}async _fetchPictureMarkerResource(e,r){const a=e.materialHash;if(!this._pictureMarkerCache.get(a)){const i=(await t(e.cim.url,{responseType:"image",signal:r&&r.signal})).data;this._pictureMarkerCache.set(a,i)}}rasterizeCIMSymbol(e,t,r,a,i,s){const o=[];for(const n of e){a&&"function"==typeof a.scaleFactor&&(a.scaleFactor=a.scaleFactor(t,i,s));const e=this._getRasterizedResource(n,t,r,a,i,s);if(!e)continue;let c=0,l=e.anchorX||0,m=e.anchorY||0,h=!1,f=0,g=0;if("esriGeometryPoint"===r){const e=C(a,n,null);if(f=u(n.offsetX,t,i,s)*e||0,g=u(n.offsetY,t,i,s)*e||0,"marker"===n.type)c=u(n.rotation,t,i,s)||0,h=!!n.rotateClockwise&&n.rotateClockwise;else if("text"===n.type){if(c=u(n.angle,t,i,s)||0,void 0!==n.horizontalAlignment)switch(n.horizontalAlignment){case"left":l=-.5;break;case"right":l=.5;break;default:l=0}if(void 0!==n.verticalAlignment)switch(n.verticalAlignment){case"top":m=.5;break;case"bottom":m=-.5;break;case"baseline":m=-.25;break;default:m=0}}}null!=e&&o.push({angle:c,rotateClockWise:h,anchorX:l,anchorY:m,offsetX:f,offsetY:g,rasterizedResource:e})}return this.getSymbolImage(o)}getSymbolImage(e){const t=document.createElement("canvas"),r=t.getContext("2d");let i=0,s=0,o=0,n=0;const c=[];for(let f=0;f<e.length;f++){const t=e[f],l=t.rasterizedResource;if(!l)continue;const m=l.size,h=t.offsetX,g=t.offsetY,u=t.anchorX,y=t.anchorY,p=t.rotateClockWise||!1;let d=t.angle,M=a(h)-m[0]*(.5+u),C=a(g)-m[1]*(.5+y),I=M+m[0],z=C+m[1];if(d){p&&(d=-d);const e=Math.sin(d*Math.PI/180),t=Math.cos(d*Math.PI/180),r=M*t-C*e,a=M*e+C*t,i=M*t-z*e,s=M*e+z*t,o=I*t-z*e,n=I*e+z*t,c=I*t-C*e,l=I*e+C*t;M=Math.min(r,i,o,c),C=Math.min(a,s,n,l),I=Math.max(r,i,o,c),z=Math.max(a,s,n,l)}i=M<i?M:i,s=C<s?C:s,o=I>o?I:o,n=z>n?z:n;const P=r.createImageData(l.size[0],l.size[1]);P.data.set(new Uint8ClampedArray(l.image.buffer));const x={offsetX:h,offsetY:g,rotateClockwise:p,angle:d,rasterizedImage:P,anchorX:u,anchorY:y};c.push(x)}t.width=o-i,t.height=n-s;const l=-i,m=n;for(let f=0;f<c.length;f++){const e=c[f],t=this._imageDataToCanvas(e.rasterizedImage),i=e.rasterizedImage.width,s=e.rasterizedImage.height,o=l-i*(.5+e.anchorX),n=m-s*(.5-e.anchorY);if(e.angle){const i=(360-e.angle)*Math.PI/180;r.save(),r.translate(a(e.offsetX),-a(e.offsetY)),r.translate(l,m),r.rotate(i),r.translate(-l,-m),r.drawImage(t,o,n),r.restore()}else r.drawImage(t,o+a(e.offsetX),n-a(e.offsetY))}const h=new d({x:l/t.width-.5,y:m/t.height-.5});return{imageData:0!==t.width&&0!==t.height?r.getImageData(0,0,t.width,t.height):r.createImageData(1,1),anchorPosition:h}}_imageDataToCanvas(e){this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas"));const t=this._imageDataCanvas,r=t.getContext("2d");return t.width=e.width,t.height=e.height,r.putImageData(e,0,0),t}_imageTo32Array(t,r,a,i){this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas"));const s=this._imageDataCanvas,o=s.getContext("2d");if(s.width=r,s.height=a,o.drawImage(t,0,0,r,a),i){o.save();const s=new e(i);o.fillStyle=s.toHex(),o.globalCompositeOperation="multiply",o.fillRect(0,0,r,a),o.globalCompositeOperation="destination-atop",o.drawImage(t,0,0,r,a),o.restore()}return new Uint32Array(o.getImageData(0,0,r,a).data.buffer)}_getRasterizedResource(e,t,r,a,s,o){let n,c,l,m,h=null,f=null;if("esriGeometryPolyline"===r||"esriGeometryPolygon"===r){const m=a&&a.style?a.style:M.Legend,g="esriGeometryPolyline"===r?I.stroke[m]:I.fill[m];if("line"===e.type){if("CIMSolidStroke"!==e.cim.type){if("CIMPictureStroke"===e.cim.type){const r=u(e.width,t,s,o),a=u(e.color,t,s,o),{image:i,width:n,height:c}=this._getPictureResource(e,r,a);return this._rasterizePictureResource(e,i,n,c,g,r)}return null}({analyzedCIM:n,hash:l}=w(e,t,s,o)),c=this._embedCIMLayerInVectorMarker(n,g)}else if("marker"===e.type){if("CIMPictureMarker"===e.cim.type){const r=u(e.size,t,s,o),a=u(e.color,t,s,o),{image:i,width:n,height:c}=this._getPictureResource(e,r,a);return this._rasterizePictureResource(e,i,n,c,g,r)}if("CIMVectorMarker"!==e.cim.type)return null;e.cim.offsetX=u(e.offsetX,t,s,o),e.cim.offsetY=u(e.offsetY,t,s,o),e.cim.rotation=u(e.rotation,t,s,o),e.cim.markerPlacement=e.markerPlacement,({analyzedCIM:n}=w(e,t,s,o)),l=i(JSON.stringify(n)).toString(),c=this._embedCIMLayerInVectorMarker(n,g),h=u(e.size,t,s,o),f=e.path}else{if("text"===e.type)return null;if("fill"===e.type){if("CIMHatchFill"===e.cim.type||"CIMVectorMarker"===e.cim.type||"CIMPictureMarker"===e.cim.type||"CIMPictureFill"===e.cim.type){const r=e.cim.size||e.cim.height;let a,i,c;if("CIMPictureMarker"===e.cim.type||"CIMPictureFill"===e.cim.type)({image:a,width:i,height:c}=this._getPictureResource(e,r,u(e.color,t,s,o)));else{({analyzedCIM:n,hash:l}=w(e,t,s,o));const m=this._rasterizer.rasterizeJSONResource({cim:n,type:e.type,url:e.url,mosaicHash:l,size:r,path:f},1,this._avoidSDF);a=m.image,i=m.size[0],c=m.size[1]}return this._rasterizePictureResource(e,a,i,c,g,null)}if("CIMSolidFill"!==e.cim.type)return null;({analyzedCIM:n,hash:l}=w(e,t,s,o)),c=this._embedCIMLayerInVectorMarker(n,g)}}}else{if("text"===e.type)return m=this._rasterizeTextResource(e,t,a,s,o),m;({analyzedCIM:n,hash:l}=w(e,t,s,o));const r=C(a,e,null);if("CIMPictureMarker"===e.cim.type){const a=u(e.size,t,s,o)*r,{image:i,width:n,height:c}=this._getPictureResource(e,a,u(e.color,t,s,o));return m={image:i,size:[n,c],sdf:!1,simplePattern:!1,anchorX:e.anchorPoint?e.anchorPoint.x:0,anchorY:e.anchorPoint?e.anchorPoint.y:0},m}p(n,r,{preserveOutlineWidth:!1}),c=n}l+=r,a&&(l+=JSON.stringify(a));const g=this._resourceCache;return g.has(l)?g.get(l):(m=this._rasterizer.rasterizeJSONResource({cim:c,type:e.type,url:e.url,mosaicHash:l,size:h,path:f},window.devicePixelRatio||1,this._avoidSDF),g.set(l,m),m)}_rasterizeTextResource(e,t,r,a,i){const s=C(r,e,null),o=u(e.text,t,a,i);if(!o||0===o.length)return null;const n=u(e.fontName,t,a,i),c=u(e.style,t,a,i),l=u(e.weight,t,a,i),m=u(e.decoration,t,a,i),h=u(e.size,t,a,i)*s,f=u(e.horizontalAlignment,t,a,i),g=u(e.verticalAlignment,t,a,i),p=y(u(e.color,t,a,i)),d=y(u(e.outlineColor,t,a,i)),M={color:p,size:h,horizontalAlignment:f,verticalAlignment:g,font:{family:n,style:c,weight:l,decoration:m},halo:{size:u(e.outlineSize,t,a,i)||0,color:d,style:c},pixelRatio:1,premultiplyColors:!this._avoidSDF};return this._textRasterizer.rasterizeText(o,M)}_rasterizePictureResource(e,t,r,i,s,c){const l=document.createElement("canvas"),m=l.getContext("2d");l.height=a(Math.max(s.frame.ymax-s.frame.ymin,c)),l.width=a(s.frame.xmax-s.frame.xmin);const h=m.createImageData(r,i);h.data.set(new Uint8ClampedArray(t.buffer));const f=this._imageDataToCanvas(h),g=m.createPattern(f,"repeat"),u=Math.cos((-e.cim.rotation||0)*Math.PI/180),y=Math.sin((-e.cim.rotation||0)*Math.PI/180);g.setTransform({m11:u,m12:y,m21:-y,m22:u,m41:a(e.cim.offsetX)||0,m42:a(e.cim.offsetY)||0});const p=s.canvasPaths;let d,M,C;o(p)?(d=p.rings,m.fillStyle=g,M=m.fill,C=["evenodd"]):n(p)&&(d=p.paths,m.strokeStyle=g,m.lineWidth=c,M=m.stroke,d[0][0][1]=l.height/2,d[0][1][1]=l.height/2),m.beginPath();for(const o of d){const e=o?o.length:0;if(e>1){let t=o[0];m.moveTo(a(t[0]),a(t[1]));for(let r=1;r<e;++r)t=o[r],m.lineTo(a(t[0]),a(t[1]));m.closePath()}}M.apply(m,C);const I=m.getImageData(0,0,l.width,l.height),z=new Uint8Array(I.data);return{size:[l.width,l.height],image:new Uint32Array(z.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}_getPictureResource(e,t,r){const i=this._pictureMarkerCache.get(e.materialHash);if(!i)return null;const s=i.height/i.width,o=t?s>1?a(t):a(t)/s:i.width,n=t?s>1?a(t)*s:a(t):i.height;return{image:this._imageTo32Array(i,o,n,r),width:o,height:n}}_embedCIMLayerInVectorMarker(e,t){const r=o(t.geometry)?"CIMPolygonSymbol":"CIMLineSymbol",a=t.frame;return{type:"CIMVectorMarker",frame:a,size:a.ymax-a.ymin,markerGraphics:[{type:"CIMMarkerGraphic",geometry:t.geometry,symbol:{type:r,symbolLayers:[e]}}]}}}function P(e){return(e?Object.keys(e):[]).map((t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"})))}function x(e){if(!(e&&e.data&&e.data.symbol))return null;switch(e.data.symbol.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function w(e,t,r,a){let i,s;if("function"==typeof e.materialHash){i=(0,e.materialHash)(t,r,a),s=l(e.cim,e.materialOverrides)}else i=e.materialHash,s=e.cim;return{analyzedCIM:s,hash:i}}export{z as CIMSymbolRasterizer,M as GeometryStyle};
|
|
5
|
+
import e from"../../Color.js";import t from"../../request.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{pt2px as a}from"../../core/screenUtils.js";import{numericHash as i}from"../../core/string.js";import{getJsonType as s,isPolygon as o,isPolyline as n}from"../../geometry/support/jsonUtils.js";import{analyzeCIMSymbol as c,analyzeCIMResource as l}from"./cimAnalyzer.js";import m from"./CIMResourceManager.js";import h from"./Rasterizer.js";import{TextRasterizer as f}from"./TextRasterizer.js";import{createLabelOverrideFunction as g,evaluateValueOrFunction as u,colorToArray as y}from"./utils.js";import{scaleCIMMarker as p}from"../support/cimSymbolUtils.js";import{Symbol3DAnchorPosition2D as d}from"../support/Symbol3DAnchorPosition2D.js";var M;!function(e){e.Legend="legend",e.Preview="preview"}(M||(M={}));const C=(e,t,r)=>{if(e&&e.targetSize){let i;if(r){const t=Math.max(r.frame.xmax-r.frame.xmin,r.frame.ymax-r.frame.ymin);i=e.targetSize/a(t)}else i=e.targetSize/t.referenceSize;return i}return e&&e.scaleFactor?e.scaleFactor:1},I={fill:{legend:{frame:{xmax:15,xmin:0,ymax:15,ymin:0},geometry:{rings:[[[0,15],[15,7.5],[15,0],[0,0],[0,15]]]},canvasPaths:{rings:[[[0,15],[0,0],[15,7.5],[15,15],[0,15]]]}},preview:{frame:{xmax:100,xmin:0,ymax:100,ymin:0},geometry:{rings:[[[0,100],[100,100],[100,0],[0,0],[0,100]]]},canvasPaths:{rings:[[[0,100],[0,0],[100,0],[100,100],[0,100]]]}}},stroke:{legend:{frame:{xmax:24,xmin:0,ymax:2,ymin:-2},geometry:{paths:[[[0,0],[12,0],[24,0]]]},canvasPaths:{paths:[[[0,2],[12,2],[24,2]]]}},preview:{frame:{xmax:100,xmin:0,ymax:2,ymin:-2},geometry:{paths:[[[0,0],[50,0],[100,0]]]},canvasPaths:{paths:[[[0,2],[50,2],[100,2]]]}}}};class z{constructor(e,t){this._spatialReference=e,this._avoidSDF=t,this._resourceCache=new Map,this._pictureMarkerCache=new Map,this._textRasterizer=new f,this._cimResourceManager=new m,this._rasterizer=new h(this._cimResourceManager)}async rasterizeCIMSymbolAsync(e,t,r,a,i,o,n,c){a=a||(t?null!=t.centroid?"esriGeometryPolygon":s(t.geometry):null)||x(e);const l=await this.analyzeCIMSymbol(e,t?P(t.attributes):null,r,a,c);return this.rasterizeCIMSymbol(l,t,a,i,o,n)}async analyzeCIMSymbol(e,t,a,i,s){const o=[],n=t?{geometryType:i,spatialReference:this._spatialReference,fields:t}:null;let l;await c(e.data,n,this._cimResourceManager,o,this._avoidSDF),r(s);for(const r of o)"CIMPictureMarker"!==r.cim.type&&"CIMPictureFill"!==r.cim.type&&"CIMPictureStroke"!==r.cim.type||(l||(l=[]),l.push(this._fetchPictureMarkerResource(r,s))),a&&"text"===r.type&&"string"==typeof r.text&&r.text.indexOf("[")>-1&&(r.text=g(a,r.text,r.cim.textCase));return l&&await Promise.all(l),o}async _fetchPictureMarkerResource(e,r){const a=e.materialHash;if(!this._pictureMarkerCache.get(a)){const i=(await t(e.cim.url,{responseType:"image",signal:r&&r.signal})).data;this._pictureMarkerCache.set(a,i)}}rasterizeCIMSymbol(e,t,r,a,i,s){const o=[];for(const n of e){a&&"function"==typeof a.scaleFactor&&(a.scaleFactor=a.scaleFactor(t,i,s));const e=this._getRasterizedResource(n,t,r,a,i,s);if(!e)continue;let c=0,l=e.anchorX||0,m=e.anchorY||0,h=!1,f=0,g=0;if("esriGeometryPoint"===r){const e=C(a,n,null);if(f=u(n.offsetX,t,i,s)*e||0,g=u(n.offsetY,t,i,s)*e||0,"marker"===n.type)c=u(n.rotation,t,i,s)||0,h=!!n.rotateClockwise&&n.rotateClockwise;else if("text"===n.type){if(c=u(n.angle,t,i,s)||0,void 0!==n.horizontalAlignment)switch(n.horizontalAlignment){case"left":l=-.5;break;case"right":l=.5;break;default:l=0}if(void 0!==n.verticalAlignment)switch(n.verticalAlignment){case"top":m=.5;break;case"bottom":m=-.5;break;case"baseline":m=-.25;break;default:m=0}}}null!=e&&o.push({angle:c,rotateClockWise:h,anchorX:l,anchorY:m,offsetX:f,offsetY:g,rasterizedResource:e})}return this.getSymbolImage(o)}getSymbolImage(e){const t=document.createElement("canvas"),r=t.getContext("2d");let i=0,s=0,o=0,n=0;const c=[];for(let f=0;f<e.length;f++){const t=e[f],l=t.rasterizedResource;if(!l)continue;const m=l.size,h=t.offsetX,g=t.offsetY,u=t.anchorX,y=t.anchorY,p=t.rotateClockWise||!1;let d=t.angle,M=a(h)-m[0]*(.5+u),C=a(g)-m[1]*(.5+y),I=M+m[0],z=C+m[1];if(d){p&&(d=-d);const e=Math.sin(d*Math.PI/180),t=Math.cos(d*Math.PI/180),r=M*t-C*e,a=M*e+C*t,i=M*t-z*e,s=M*e+z*t,o=I*t-z*e,n=I*e+z*t,c=I*t-C*e,l=I*e+C*t;M=Math.min(r,i,o,c),C=Math.min(a,s,n,l),I=Math.max(r,i,o,c),z=Math.max(a,s,n,l)}i=M<i?M:i,s=C<s?C:s,o=I>o?I:o,n=z>n?z:n;const P=r.createImageData(l.size[0],l.size[1]);P.data.set(new Uint8ClampedArray(l.image.buffer));const x={offsetX:h,offsetY:g,rotateClockwise:p,angle:d,rasterizedImage:P,anchorX:u,anchorY:y};c.push(x)}t.width=o-i,t.height=n-s;const l=-i,m=n;for(let f=0;f<c.length;f++){const e=c[f],t=this._imageDataToCanvas(e.rasterizedImage),i=e.rasterizedImage.width,s=e.rasterizedImage.height,o=l-i*(.5+e.anchorX),n=m-s*(.5-e.anchorY);if(e.angle){const i=(360-e.angle)*Math.PI/180;r.save(),r.translate(a(e.offsetX),-a(e.offsetY)),r.translate(l,m),r.rotate(i),r.translate(-l,-m),r.drawImage(t,o,n),r.restore()}else r.drawImage(t,o+a(e.offsetX),n-a(e.offsetY))}const h=new d({x:l/t.width-.5,y:m/t.height-.5});return{imageData:0!==t.width&&0!==t.height?r.getImageData(0,0,t.width,t.height):r.createImageData(1,1),anchorPosition:h}}_imageDataToCanvas(e){this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas"));const t=this._imageDataCanvas,r=t.getContext("2d");return t.width=e.width,t.height=e.height,r.putImageData(e,0,0),t}_imageTo32Array(t,r,a,i){this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas"));const s=this._imageDataCanvas,o=s.getContext("2d");if(s.width=r,s.height=a,o.drawImage(t,0,0,r,a),i){o.save();const s=new e(i);o.fillStyle=s.toHex(),o.globalCompositeOperation="multiply",o.fillRect(0,0,r,a),o.globalCompositeOperation="destination-atop",o.drawImage(t,0,0,r,a),o.restore()}return new Uint32Array(o.getImageData(0,0,r,a).data.buffer)}_getRasterizedResource(e,t,r,a,s,o){let n,c,l,m,h=null,f=null;if("esriGeometryPolyline"===r||"esriGeometryPolygon"===r){const m=a&&a.style?a.style:M.Legend,g="esriGeometryPolyline"===r?I.stroke[m]:I.fill[m];if("line"===e.type){if("CIMSolidStroke"!==e.cim.type){if("CIMPictureStroke"===e.cim.type){const r=u(e.width,t,s,o),a=u(e.color,t,s,o),{image:i,width:n,height:c}=this._getPictureResource(e,r,a);return this._rasterizePictureResource(e,i,n,c,g,r)}return null}({analyzedCIM:n,hash:l}=w(e,t,s,o)),c=this._embedCIMLayerInVectorMarker(n,g)}else if("marker"===e.type){if("CIMPictureMarker"===e.cim.type){const r=u(e.size,t,s,o),a=u(e.color,t,s,o),{image:i,width:n,height:c}=this._getPictureResource(e,r,a);return this._rasterizePictureResource(e,i,n,c,g,r)}if("CIMVectorMarker"!==e.cim.type)return null;e.cim.offsetX=u(e.offsetX,t,s,o),e.cim.offsetY=u(e.offsetY,t,s,o),e.cim.rotation=u(e.rotation,t,s,o),e.cim.markerPlacement=e.markerPlacement,({analyzedCIM:n}=w(e,t,s,o)),l=i(JSON.stringify(n)).toString(),c=this._embedCIMLayerInVectorMarker(n,g),h=u(e.size,t,s,o),f=e.path}else{if("text"===e.type)return null;if("fill"===e.type){if("CIMHatchFill"===e.cim.type||"CIMVectorMarker"===e.cim.type||"CIMPictureMarker"===e.cim.type||"CIMPictureFill"===e.cim.type){const r=e.cim.size||e.cim.height;let a,i,c;if("CIMPictureMarker"===e.cim.type||"CIMPictureFill"===e.cim.type)({image:a,width:i,height:c}=this._getPictureResource(e,r,u(e.color,t,s,o)));else{({analyzedCIM:n,hash:l}=w(e,t,s,o));const m=this._rasterizer.rasterizeJSONResource({cim:n,type:e.type,url:e.url,mosaicHash:l,size:r,path:f},1,this._avoidSDF);a=m.image,i=m.size[0],c=m.size[1]}return this._rasterizePictureResource(e,a,i,c,g,null)}if("CIMSolidFill"!==e.cim.type)return null;({analyzedCIM:n,hash:l}=w(e,t,s,o)),c=this._embedCIMLayerInVectorMarker(n,g)}}}else{if("text"===e.type)return m=this._rasterizeTextResource(e,t,a,s,o),m;({analyzedCIM:n,hash:l}=w(e,t,s,o));const r=C(a,e,null);if("CIMPictureMarker"===e.cim.type){const a=u(e.size,t,s,o)*r,{image:i,width:n,height:c}=this._getPictureResource(e,a,u(e.color,t,s,o));return m={image:i,size:[n,c],sdf:!1,simplePattern:!1,anchorX:e.anchorPoint?e.anchorPoint.x:0,anchorY:e.anchorPoint?e.anchorPoint.y:0},m}p(n,r,{preserveOutlineWidth:!1}),c=n}l+=r,a&&(l+=JSON.stringify(a));const g=this._resourceCache;return g.has(l)?g.get(l):(m=this._rasterizer.rasterizeJSONResource({cim:c,type:e.type,url:e.url,mosaicHash:l,size:h,path:f},window.devicePixelRatio||1,this._avoidSDF),g.set(l,m),m)}_rasterizeTextResource(e,t,r,a,i){const s=C(r,e,null),o=u(e.text,t,a,i);if(!o||0===o.length)return null;const n=u(e.fontName,t,a,i),c=u(e.style,t,a,i),l=u(e.weight,t,a,i),m=u(e.decoration,t,a,i),h=u(e.size,t,a,i)*s,f=u(e.horizontalAlignment,t,a,i),g=u(e.verticalAlignment,t,a,i),p=y(u(e.color,t,a,i)),d=y(u(e.outlineColor,t,a,i)),M={color:p,size:h,horizontalAlignment:f,verticalAlignment:g,font:{family:n,style:c,weight:l,decoration:m},halo:{size:u(e.outlineSize,t,a,i)||0,color:d,style:c},pixelRatio:1,premultiplyColors:!this._avoidSDF};return this._textRasterizer.rasterizeText(o,M)}_rasterizePictureResource(e,t,r,i,s,c){const l=document.createElement("canvas"),m=l.getContext("2d");l.height=a(Math.max(s.frame.ymax-s.frame.ymin,c)),l.width=a(s.frame.xmax-s.frame.xmin);const h=m.createImageData(r,i);h.data.set(new Uint8ClampedArray(t.buffer));const f=this._imageDataToCanvas(h),g=m.createPattern(f,"repeat"),u=Math.cos((-e.cim.rotation||0)*Math.PI/180),y=Math.sin((-e.cim.rotation||0)*Math.PI/180);g.setTransform({m11:u,m12:y,m21:-y,m22:u,m41:a(e.cim.offsetX)||0,m42:a(e.cim.offsetY)||0});const p=s.canvasPaths;let d,M,C;o(p)?(d=p.rings,m.fillStyle=g,M=m.fill,C=["evenodd"]):n(p)&&(d=p.paths,m.strokeStyle=g,m.lineWidth=c,M=m.stroke,d[0][0][1]=l.height/2,d[0][1][1]=l.height/2),m.beginPath();for(const o of d){const e=o?o.length:0;if(e>1){let t=o[0];m.moveTo(a(t[0]),a(t[1]));for(let r=1;r<e;++r)t=o[r],m.lineTo(a(t[0]),a(t[1]));m.closePath()}}M.apply(m,C);const I=m.getImageData(0,0,l.width,l.height),z=new Uint8Array(I.data);return{size:[l.width,l.height],image:new Uint32Array(z.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}_getPictureResource(e,t,r){const i=this._pictureMarkerCache.get(e.materialHash);if(!i)return null;const s=i.height/i.width,o=t?s>1?a(t):a(t)/s:i.width,n=t?s>1?a(t)*s:a(t):i.height;return{image:this._imageTo32Array(i,o,n,r),width:o,height:n}}_embedCIMLayerInVectorMarker(e,t){const r=o(t.geometry)?"CIMPolygonSymbol":"CIMLineSymbol",a=t.frame;return{type:"CIMVectorMarker",frame:a,size:a.ymax-a.ymin,markerGraphics:[{type:"CIMMarkerGraphic",geometry:t.geometry,symbol:{type:r,symbolLayers:[e]}}]}}}function P(e){return(e?Object.keys(e):[]).map((t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"})))}function x(e){if(!(e&&e.data&&e.data.symbol))return null;switch(e.data.symbol.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function w(e,t,r,a){let i,s;if("function"==typeof e.materialHash){i=(0,e.materialHash)(t,r,a),s=l(e.cim,e.materialOverrides)}else i=e.materialHash,s=e.cim;return{analyzedCIM:s,hash:i}}export{z as CIMSymbolRasterizer,M as GeometryStyle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../chunks/tslib.es6.js";import{strict as e}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{isDataProtocol as t,isAbsolute as s,normalize as p}from"../../core/urlUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as i}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{writer as f}from"../../core/accessorSupport/decorators/writer.js";import{f as u,t as
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import{strict as e}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{isDataProtocol as t,isAbsolute as s,normalize as p}from"../../core/urlUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as i}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{writer as f}from"../../core/accessorSupport/decorators/writer.js";import{f as u,t as n}from"../../chunks/persistableUrlUtils.js";var l;const d=e()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let h=l=class extends o{constructor(r){super(r)}readHref(r,e,o){return r?u(r,o):e.dataURI}writeHref(r,e,o,c){r&&(t(r)?e.dataURI=r:(e.href=n(r,c),s(e.href)&&(e.href=p(e.href))))}clone(){return new l({href:this.href,primitive:this.primitive})}};r([c({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],h.prototype,"href",void 0),r([a("href")],h.prototype,"readHref",null),r([f("href",{href:{type:String},dataURI:{type:String}})],h.prototype,"writeHref",null),r([i(d)],h.prototype,"primitive",void 0),h=l=r([m("esri.symbols.support.IconSymbol3DLayerResource")],h);const j="circle";export{h as IconSymbol3DLayerResource,j as defaultPrimitive};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../chunks/tslib.es6.js";import{strict as e}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as t}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{r as i,w as c}from"../../chunks/persistableUrlUtils.js";var
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import{strict as e}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as t}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{r as i,w as c}from"../../chunks/persistableUrlUtils.js";var n;const a=e()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let m=n=class extends o{clone(){return new n({href:this.href,primitive:this.primitive})}};r([s({type:String,json:{read:i,write:c}})],m.prototype,"href",void 0),r([t(a)],m.prototype,"primitive",void 0),m=n=r([p("esri.symbols.support.ObjectSymbol3DLayerResource")],m);const d="sphere";export{m as ObjectSymbol3DLayerResource,d as defaultPrimitive};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";var e;let p=e=class extends o{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new e({x:this.x,y:this.y})}};r([s({type:Number})],p.prototype,"x",void 0),r([s({type:Number})],p.prototype,"y",void 0),p=e=r([t("esri.symbols.support.Symbol3DAnchorPosition2D")],p);
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";var e;let p=e=class extends o{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new e({x:this.x,y:this.y})}};r([s({type:Number})],p.prototype,"x",void 0),r([s({type:Number})],p.prototype,"y",void 0),p=e=r([t("esri.symbols.support.Symbol3DAnchorPosition2D")],p);export{p as Symbol3DAnchorPosition2D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";var e;let p=e=class extends o{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new e({x:this.x,y:this.y,z:this.z})}};r([s({type:Number})],p.prototype,"x",void 0),r([s({type:Number})],p.prototype,"y",void 0),r([s({type:Number})],p.prototype,"z",void 0),p=e=r([t("esri.symbols.support.Symbol3DAnchorPosition3D")],p);export{p as Symbol3DAnchorPosition3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../chunks/tslib.es6.js";import{isSome as r}from"../../core/maybe.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/set.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import{Symbol3DMaterial as t}from"./Symbol3DMaterial.js";var c;let l=c=class extends t{constructor(o){super(o),this.colorMixMode=null}clone(){const o={color:r(this.color)?this.color.clone():null,colorMixMode:this.colorMixMode};return new c(o)}};o([s({multiply:"multiply",replace:"replace",tint:"tint"})],l.prototype,"colorMixMode",void 0),l=c=o([e("esri.symbols.support.Symbol3DFillMaterial")],l);
|
|
5
|
+
import{_ as o}from"../../chunks/tslib.es6.js";import{isSome as r}from"../../core/maybe.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/set.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import{Symbol3DMaterial as t}from"./Symbol3DMaterial.js";var c;let l=c=class extends t{constructor(o){super(o),this.colorMixMode=null}clone(){const o={color:r(this.color)?this.color.clone():null,colorMixMode:this.colorMixMode};return new c(o)}};o([s({multiply:"multiply",replace:"replace",tint:"tint"})],l.prototype,"colorMixMode",void 0),l=c=o([e("esri.symbols.support.Symbol3DFillMaterial")],l);export{l as Symbol3DFillMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{isSome as t}from"../../core/maybe.js";import{px2pt as e}from"../../core/screenUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{colorAndTransparencyProperty as i,screenSizeProperty as m}from"./materialUtils.js";var l;let a=l=class extends s{constructor(o){super(o),this.color=new r([0,0,0,1]),this.size=e(1)}clone(){const o={color:t(this.color)?this.color.clone():null,size:this.size};return new l(o)}};o([c(i)],a.prototype,"color",void 0),o([c(m)],a.prototype,"size",void 0),a=l=o([p("esri.symbols.support.Symbol3DIconOutline")],a);
|
|
5
|
+
import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{isSome as t}from"../../core/maybe.js";import{px2pt as e}from"../../core/screenUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{colorAndTransparencyProperty as i,screenSizeProperty as m}from"./materialUtils.js";var l;let a=l=class extends s{constructor(o){super(o),this.color=new r([0,0,0,1]),this.size=e(1)}clone(){const o={color:t(this.color)?this.color.clone():null,size:this.size};return new l(o)}};o([c(i)],a.prototype,"color",void 0),o([c(m)],a.prototype,"size",void 0),a=l=o([p("esri.symbols.support.Symbol3DIconOutline")],a);export{a as Symbol3DIconOutline};
|