@arcgis/core 4.23.0-next.20220127 → 4.23.0-next.20220131
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/{8001b0e514bfffe9d7f8.js → 0c15d77d8e817cf45a9a.js} +1 -1
- 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/{e93dfdede0532a89ffa5.js → 2b25fc7945a187c2bb9d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5948923e07bd1662c24a.js → 37c03cfc19086ce631c6.js} +1 -1
- 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/56657f890e0f79f5d2ad.js +1 -0
- 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/70d6bb3c7112cb702389.js +1 -0
- package/assets/esri/core/workers/chunks/810a763373d7f78ae398.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/{9d77467aa71d345fc1b6.js → bcc01bbffaa3bb5f60a8.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/d98dab12b71912fa397b.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/f7150547d7e3259a0f29.js +981 -0
- package/assets/esri/core/workers/chunks/fc046a15466c25d081ff.js +1 -0
- package/assets/esri/images/portal/mediaservice16.png +0 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
- 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 +653 -55
- package/layers/RouteLayer.d.ts +4 -0
- package/layers/RouteLayer.js +1 -1
- 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/portal/PortalItem.js +1 -1
- package/rest/support/DirectionLine.d.ts +4 -0
- package/rest/support/DirectionPoint.d.ts +4 -0
- package/rest/support/RouteInfo.d.ts +4 -0
- package/rest/support/RouteInfo.js +1 -1
- package/rest/support/RouteSolveResult.d.ts +4 -0
- 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/2d/layers/RouteLayerView2D.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/CloudsComposition.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/NoiseTextureAtlas.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/I3SCrossfadeHelper.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.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/TileRenderer.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/RenderPass.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/CompositingHelper.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/HighlightHelper.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/RenderingContext.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/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowHighlightHelper.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/LodRenderer.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/materials/renderers/MergedRenderer.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/webdoc/support/{Thumbnail.js → SlideThumbnail.js} +1 -1
- package/webmap/Bookmark.js +1 -1
- package/webmap/Version.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/Version.js +1 -1
- package/webscene/support/SlideVisibleLayer.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions/support/directionsUtils.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.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/widgets/TimeSlider.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/c093dff4592832ac0973.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
- package/assets/esri/core/workers/chunks/fc7e31d87555beb63291.js +0 -1
- package/assets/esri/core/workers/chunks/fff6b0338f06dad0c45d.js +0 -1
- package/widgets/Directions/support/CostSummary.js +0 -5
- package/widgets/Directions/support/RouteSection.js +0 -5
- package/widgets/Directions/support/RouteSections.js +0 -5
- package/widgets/Directions/support/maneuverUtils.js +0 -5
package/layers/RouteLayer.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 t from"../config.js";import"../geometry.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import s from"../core/Collection.js";import n from"../core/Error.js";import{isSome as l,isNone as a}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{convertUnit as y}from"../core/unitUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import S from"../geometry/Extent.js";import{WGS84 as h}from"../geometry/support/spatialReferenceUtils.js";import g from"./Layer.js";import{BlendLayer as b}from"./mixins/BlendLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import P from"./support/DefaultSymbols.js";import{fetchServiceDescription as N}from"../rest/networkService.js";import{solve as I}from"../rest/route.js";import D from"../rest/support/DirectionLine.js";import O from"../rest/support/DirectionPoint.js";import{directionsTimeUnitJsonMap as j,directionsLengthUnitJsonMap as L}from"../rest/support/networkEnums.js";import C from"../rest/support/PointBarrier.js";import _ from"../rest/support/PolygonBarrier.js";import T from"../rest/support/PolylineBarrier.js";import J from"../rest/support/RouteInfo.js";import R from"../rest/support/RouteParameters.js";import x from"../rest/support/RouteSettings.js";import F from"../rest/support/Stop.js";import k from"../geometry/SpatialReference.js";import A from"../geometry/Multipoint.js";function G(e){return e.length?e:null}function U(e){return"layers"in e}function M(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function W(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function E(e,t,r){var o,i,s,a,p,u,y,m,f,c,d;const S=t.networkDataset.networkAttributes.filter((e=>"esriNAUTCost"===e.usageType)),h=t.supportedTravelModes.find((e=>e.id===t.defaultTravelMode)),g=null!=(o=r.travelMode)?o:h,{timeAttributeName:b,distanceAttributeName:w}=g,v=S.find((e=>e.name===b)),B=S.find((e=>e.name===w)),P=null!=(i=null!=(s=null==(a=r.travelMode)?void 0:a.impedanceAttributeName)?s:r.impedanceAttribute)?i:t.impedance,N=j.fromJSON(null==v?void 0:v.units),I=L.fromJSON(null==B?void 0:B.units);if(!N||!I)throw new n("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const D=null!=(p=r.directionsLanguage)?p:t.directionsLanguage,O=null!=(u=null!=(y=r.accumulateAttributes)?y:t.accumulateAttributeNames)?u:[],C=new Set(S.filter((({name:e})=>e===b||e===w||e===P||O.includes(e))).map((({name:e})=>e))),_=e=>{for(const t in e)C.has(t)||delete e[t]};for(const n of e.pointBarriers){var T;if(l(n.costs))n.addedCost=null!=(T=n.costs[P])?T:0,_(n.costs)}for(const n of e.polygonBarriers){var J;if(l(n.costs))n.scaleFactor=null!=(J=n.costs[P])?J:1,_(n.costs)}for(const n of e.polylineBarriers){var R;if(l(n.costs))n.scaleFactor=null!=(R=n.costs[P])?R:1,_(n.costs)}const{routeInfo:F}=e,{findBestSequence:k,preserveFirstStop:A,preserveLastStop:G,startTimeIsUTC:U,timeWindowsAreUTC:M}=r;F.analysisSettings=new x({accumulateAttributes:O,directionsLanguage:D,findBestSequence:k,preserveFirstStop:A,preserveLastStop:G,startTimeIsUTC:U,timeWindowsAreUTC:M,travelMode:g}),F.totalDuration=q(null!=(m=F.totalCosts[b])?m:0,N),F.totalDistance=V(null!=(f=F.totalCosts[w])?f:0,I),F.totalLateDuration=q(null!=(c=F.totalViolations[b])?c:0,N),F.totalWaitDuration=q(null!=(d=F.totalWait[b])?d:0,N),l(F.totalCosts)&&_(F.totalCosts),l(F.totalViolations)&&_(F.totalViolations),l(F.totalWait)&&_(F.totalWait);for(const n of e.stops){var W,E,H,K,Q,Z;if(l(n.serviceCosts))n.serviceDuration=q(null!=(W=n.serviceCosts[b])?W:0,N),n.serviceDistance=V(null!=(E=n.serviceCosts[w])?E:0,I),_(n.serviceCosts);if(l(n.cumulativeCosts))n.cumulativeDuration=q(null!=(H=n.cumulativeCosts[b])?H:0,N),n.cumulativeDistance=V(null!=(K=n.cumulativeCosts[w])?K:0,I),_(n.cumulativeCosts);if(l(n.violations))n.lateDuration=q(null!=(Q=n.violations[b])?Q:0,N),_(n.violations);if(l(n.wait))n.waitDuration=q(null!=(Z=n.wait[b])?Z:0,N),_(n.wait)}}function q(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function V(e,t){return"decimal-degrees"===t||"points"===t?e:y(e,t,"meters")}const H=s.ofType(D),K=s.ofType(O),Q=s.ofType(C),Z=s.ofType(_),$=s.ofType(T),z=s.ofType(F);let X=class extends(b(B(w(v(p(g)))))){constructor(...e){super(...e),this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new P,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Q,this.polygonBarriers=new Z,this.polylineBarriers=new $,this.routeInfo=null,this.spatialReference=k.WGS84,this.stops=new z,this.title="Route",this.type="route"}writeFeatureCollectionWebmap(e,t){const r=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),o=r.map(((e,t)=>t));u("featureCollection.layers",r,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=o}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>D.fromPortalJSON(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>O.fromPortalJSON(e)))}get fullExtent(){if(l(this.routeInfo)&&l(this.routeInfo.geometry))return this.routeInfo.geometry.extent;if(this.stops.length>1){const{spatialReference:e}=this.stops[0],t=new A({spatialReference:e}),r=this.stops.toArray().map((e=>e.geometry));for(const o of r)l(o)&&t.addPoint(o);return t.extent}return new S({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:k.WGS84})}readMaxScale(e,t){var r;const o=(U(t)?t.layers:t.featureCollection.layers).find((e=>l(e.layerDefinition.maxScale)));return null!=(r=null==o?void 0:o.layerDefinition.maxScale)?r:0}readMinScale(e,t){var r;const o=(U(t)?t.layers:t.featureCollection.layers).find((e=>l(e.layerDefinition.minScale)));return null!=(r=null==o?void 0:o.layerDefinition.minScale)?r:0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>C.fromPortalJSON(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>_.fromPortalJSON(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>T.fromPortalJSON(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,"RouteInfo",(e=>J.fromPortalJSON(e)));return r.length>0?r.getItemAt(0):null}get routeServiceUrl(){var e,r,o,i;return null!=(e=this.portalItem)&&e.id&&null!=(r=null==(o=this.portalItem.portal.helperServices)||null==(i=o.route)?void 0:i.url)?r:t.routeServiceUrl}readSpatialReference(e,t){var r,o;const i=U(t)?t.layers:t.featureCollection.layers;if(!i.length)return k.WGS84;const{layerDefinition:s}=i[0],n=null!=(r=null!=(o=s.spatialReference)?o:s.extent.spatialReference)?r:h;return k.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>F.fromPortalJSON(e)),(e=>this._setStopSymbol(e)))}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}async solve(e,t){var r,o,i,l;const p=null!=(r=null==e?void 0:e.stops)?r:this.stops,u=null!=(o=null==e?void 0:e.pointBarriers)?o:G(this.pointBarriers),y=null!=(i=null==e?void 0:e.polylineBarriers)?i:G(this.polylineBarriers),m=null!=(l=null==e?void 0:e.polygonBarriers)?l:G(this.polygonBarriers);if(a(p))throw new n("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((M(p)||W(p))&&p.features.length<2||s.isCollection(p)&&p.length<2)throw new n("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");const f=await N(this.routeServiceUrl,null==e?void 0:e.apiKey,t),c={startTime:new Date},d={directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:u,polylineBarriers:y,polygonBarriers:m,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!u,returnDirections:!0,returnPolygonBarriers:!!m,returnPolylineBarriers:!!y,returnRoutes:!0,returnStops:!0,stops:p},S=e?R.from(e):new R;for(const s in c)null==S[s]&&(S[s]=c[s]);S.set(d);const h=await I(this.routeServiceUrl,S,t),g=this._toRouteLayerSolution(h);return E(g,f,S),g}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:l}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",l)}_getLayerDefinition(){return{capabilities:"Query,Update,Editing",extent:this.fullExtent.toJSON(),hasM:!1,hasZ:!1,maxScale:this.maxScale,minScale:this.minScale,objectIdField:"__OBJECTID",spatialReference:this.spatialReference.toJSON(),type:"Feature Layer",typeIdField:""}}_getNetworkFeatures(e,t,n,l){const p=(U(e)?e.layers:e.featureCollection.layers).find((e=>e.layerDefinition.name===t));if(a(p))return new s;const{layerDefinition:u,popupInfo:y,featureSet:m}=p,f=u.drawingInfo.renderer,{features:c}=m,d=f&&i(f),S=c.map((e=>{var i;const s=n(e),{attributes:l}=e,a=new r({attributes:l});return null!=s.symbol||(s.symbol=null!=(i=null==d?void 0:d.getSymbol(a))?i:this._getNetworkSymbol(t)),null!=s.popupTemplate||(s.popupTemplate=y&&o.fromJSON(y)),s}));return l&&S.some((e=>!e.symbol))&&l(S),new s(S)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}_setStopSymbol(e){if(!e)return;if(e.length<2){for(const t of e)t.symbol=this.defaultSymbols.invalidStop;return}const t=e.map((e=>e.sequence)).filter((e=>l(e))),r=Math.min(...t),o=Math.max(...t);for(const i of e)i.sequence!==r?i.sequence!==o?"ok"===i.status||"not-located-on-closest"===i.status?"waypoint"!==i.locationType?"break"!==i.locationType?i.symbol=this.defaultSymbols.middleStop:i.symbol=this.defaultSymbols.breakStop:i.symbol=this.defaultSymbols.waypointStop:i.symbol=this.defaultSymbols.invalidStop:i.symbol=this.defaultSymbols.lastStop:i.symbol=this.defaultSymbols.firstStop}_toRouteLayerSolution(e){var t,r,o;const i=e.routeResults[0].stops.map((e=>F.fromJSON(e.toJSON())));this._setStopSymbol(i);const s=new z(i),n=new Z(null==(t=e.polygonBarriers)?void 0:t.map((e=>{const t=_.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),l=new $(null==(r=e.polylineBarriers)?void 0:r.map((e=>{const t=T.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),a=new Q(null==(o=e.pointBarriers)?void 0:o.map((e=>{const t=C.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),p=J.fromJSON(e.routeResults[0].route.toJSON());p.symbol=this.defaultSymbols.routeInfo;const u=new K(e.routeResults[0].directionPoints.features.map((e=>{const t=O.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new H(e.routeResults[0].directionLines.features.map((e=>{const t=D.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:u,pointBarriers:a,polygonBarriers:n,polylineBarriers:l,routeInfo:p,stops:s}}_writeDirectionLines(){return a(this.directionLines)||!this.directionLines.length?null:{featureSet:{features:this.directionLines.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionLines.toJSON()}},fields:D.fields,geometryType:"esriGeometryPolyline",name:"DirectionLines",title:"Direction Lines"},popupInfo:D.popupInfo}}_writeDirectionPoints(){return a(this.directionPoints)||!this.directionPoints.length?null:{featureSet:{features:this.directionPoints.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionPoints.toJSON()}},fields:O.fields,geometryType:"esriGeometryPoint",name:"DirectionPoints",title:"Direction Points"},popupInfo:O.popupInfo}}_writePointBarriers(){return a(this.pointBarriers)||!this.pointBarriers.length?null:{featureSet:{features:this.pointBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.pointBarriers.toJSON()}},fields:C.fields,geometryType:"esriGeometryPoint",name:"Barrier",title:"Point Barrier"},popupInfo:C.popupInfo}}_writePolygonBarriers(){return a(this.polygonBarriers)||!this.polygonBarriers.length?null:{featureSet:{features:this.polygonBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolygon"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polygonBarriers.toJSON()}},fields:_.fields,geometryType:"esriGeometryPolygon",name:"PolygonBarriers",title:"Polygon Barriers"},popupInfo:_.popupInfo}}_writePolylineBarriers(){return a(this.polylineBarriers)||!this.polylineBarriers.length?null:{featureSet:{features:this.polylineBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polylineBarriers.toJSON()}},fields:T.fields,geometryType:"esriGeometryPolyline",name:"PolylineBarriers",title:"Line Barriers"},popupInfo:T.popupInfo}}_writeRouteInfo(){return a(this.routeInfo)?null:{featureSet:{features:[this.routeInfo.toPortalJSON()],geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.routeInfo.toJSON()}},fields:J.fields,geometryType:"esriGeometryPolyline",name:"RouteInfo",title:"Route Details"},popupInfo:J.popupInfo}}_writeStops(){return a(this.stops)||!this.stops.length?null:{featureSet:{features:this.stops.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"uniqueValue",field1:"Sequence",defaultSymbol:this.defaultSymbols.middleStop.toJSON(),uniqueValueInfos:[{value:"1",symbol:this.defaultSymbols.firstStop.toJSON(),label:"First Stop"},{value:`${this.stops.length}`,symbol:this.defaultSymbols.lastStop.toJSON(),label:"Last Stop"}]}},fields:F.fields,geometryType:"esriGeometryPoint",name:"Stops",title:"Stops"},popupInfo:F.popupInfo}}};e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],X.prototype,"_featureCollection",void 0),e([d("web-map","_featureCollection")],X.prototype,"writeFeatureCollectionWebmap",null),e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],X.prototype,"_type",void 0),e([m({nonNullable:!0,type:P})],X.prototype,"defaultSymbols",void 0),e([m({readOnly:!0})],X.prototype,"directionLines",void 0),e([f(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],X.prototype,"readDirectionLines",null),e([m({readOnly:!0})],X.prototype,"directionPoints",void 0),e([f(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],X.prototype,"readDirectionPoints",null),e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],X.prototype,"featureCollectionType",void 0),e([m({readOnly:!0})],X.prototype,"fullExtent",null),e([m({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],X.prototype,"legendEnabled",void 0),e([m({type:["show","hide"]})],X.prototype,"listMode",void 0),e([m({type:Number,nonNullable:!0,json:{write:!1}})],X.prototype,"maxScale",void 0),e([f(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],X.prototype,"readMaxScale",null),e([m({type:Number,nonNullable:!0,json:{write:!1}})],X.prototype,"minScale",void 0),e([f(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],X.prototype,"readMinScale",null),e([m({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],X.prototype,"operationalLayerType",void 0),e([m({nonNullable:!0,type:s.ofType(C)})],X.prototype,"pointBarriers",void 0),e([f(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],X.prototype,"readPointBarriers",null),e([m({nonNullable:!0,type:s.ofType(_)})],X.prototype,"polygonBarriers",void 0),e([f(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],X.prototype,"readPolygonBarriers",null),e([m({nonNullable:!0,type:s.ofType(T)})],X.prototype,"polylineBarriers",void 0),e([f(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],X.prototype,"readPolylineBarriers",null),e([m({readOnly:!0})],X.prototype,"routeInfo",void 0),e([f(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],X.prototype,"readRouteInfo",null),e([m({nonNullable:!0})],X.prototype,"routeServiceUrl",null),e([m({type:k})],X.prototype,"spatialReference",void 0),e([f(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],X.prototype,"readSpatialReference",null),e([m({nonNullable:!0,type:s.ofType(F)})],X.prototype,"stops",void 0),e([f(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],X.prototype,"readStops",null),e([m()],X.prototype,"title",void 0),e([m({readOnly:!0,json:{read:!1}})],X.prototype,"type",void 0),X=e([c("esri.layers.RouteLayer")],X);const Y=X;export{Y as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import"../geometry.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import s from"../core/Collection.js";import n from"../core/Error.js";import{isSome as l,isNone as a}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{convertUnit as y}from"../core/unitUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import h from"../geometry/Extent.js";import{WGS84 as S}from"../geometry/support/spatialReferenceUtils.js";import g from"./Layer.js";import{BlendLayer as b}from"./mixins/BlendLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import P from"./support/DefaultSymbols.js";import{fetchServiceDescription as N}from"../rest/networkService.js";import{solve as I}from"../rest/route.js";import D from"../rest/support/DirectionLine.js";import O from"../rest/support/DirectionPoint.js";import{directionsTimeUnitJsonMap as j,directionsLengthUnitJsonMap as L}from"../rest/support/networkEnums.js";import _ from"../rest/support/PointBarrier.js";import C from"../rest/support/PolygonBarrier.js";import T from"../rest/support/PolylineBarrier.js";import J from"../rest/support/RouteInfo.js";import R from"../rest/support/RouteParameters.js";import x from"../rest/support/RouteSettings.js";import A from"../rest/support/Stop.js";import F from"../geometry/SpatialReference.js";import k from"../geometry/Multipoint.js";function G(e){return e.length?e:null}function U(e){return"layers"in e}function M(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function W(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function E(e,t,r){var o,i,s,a,p,u,y,m,f,c,d;const h=t.networkDataset.networkAttributes.filter((e=>"esriNAUTCost"===e.usageType)),S=t.supportedTravelModes.find((e=>e.id===t.defaultTravelMode)),g=null!=(o=r.travelMode)?o:S,{timeAttributeName:b,distanceAttributeName:w}=g,v=h.find((e=>e.name===b)),B=h.find((e=>e.name===w)),P=null!=(i=null!=(s=null==(a=r.travelMode)?void 0:a.impedanceAttributeName)?s:r.impedanceAttribute)?i:t.impedance,N=j.fromJSON(null==v?void 0:v.units),I=L.fromJSON(null==B?void 0:B.units);if(!N||!I)throw new n("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const D=null!=(p=r.directionsLanguage)?p:t.directionsLanguage,O=null!=(u=null!=(y=r.accumulateAttributes)?y:t.accumulateAttributeNames)?u:[],_=new Set(h.filter((({name:e})=>e===b||e===w||e===P||O.includes(e))).map((({name:e})=>e))),C=e=>{for(const t in e)_.has(t)||delete e[t]};for(const n of e.pointBarriers){var T;if(l(n.costs))n.addedCost=null!=(T=n.costs[P])?T:0,C(n.costs)}for(const n of e.polygonBarriers){var J;if(l(n.costs))n.scaleFactor=null!=(J=n.costs[P])?J:1,C(n.costs)}for(const n of e.polylineBarriers){var R;if(l(n.costs))n.scaleFactor=null!=(R=n.costs[P])?R:1,C(n.costs)}const{routeInfo:A}=e,{findBestSequence:F,preserveFirstStop:k,preserveLastStop:G,startTimeIsUTC:U,timeWindowsAreUTC:M}=r;A.analysisSettings=new x({accumulateAttributes:O,directionsLanguage:D,findBestSequence:F,preserveFirstStop:k,preserveLastStop:G,startTimeIsUTC:U,timeWindowsAreUTC:M,travelMode:g}),A.totalDuration=q(null!=(m=A.totalCosts[b])?m:0,N),A.totalDistance=V(null!=(f=A.totalCosts[w])?f:0,I),A.totalLateDuration=q(null!=(c=A.totalViolations[b])?c:0,N),A.totalWaitDuration=q(null!=(d=A.totalWait[b])?d:0,N),l(A.totalCosts)&&C(A.totalCosts),l(A.totalViolations)&&C(A.totalViolations),l(A.totalWait)&&C(A.totalWait);for(const n of e.stops){var W,E,H,K,Q,Z;if(l(n.serviceCosts))n.serviceDuration=q(null!=(W=n.serviceCosts[b])?W:0,N),n.serviceDistance=V(null!=(E=n.serviceCosts[w])?E:0,I),C(n.serviceCosts);if(l(n.cumulativeCosts))n.cumulativeDuration=q(null!=(H=n.cumulativeCosts[b])?H:0,N),n.cumulativeDistance=V(null!=(K=n.cumulativeCosts[w])?K:0,I),C(n.cumulativeCosts);if(l(n.violations))n.lateDuration=q(null!=(Q=n.violations[b])?Q:0,N),C(n.violations);if(l(n.wait))n.waitDuration=q(null!=(Z=n.wait[b])?Z:0,N),C(n.wait)}}function q(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function V(e,t){return"decimal-degrees"===t||"points"===t?e:y(e,t,"meters")}const H=s.ofType(D),K=s.ofType(O),Q=s.ofType(_),Z=s.ofType(C),$=s.ofType(T),z=s.ofType(A);let X=class extends(b(B(w(v(p(g)))))){constructor(...e){super(...e),this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new P,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Q,this.polygonBarriers=new Z,this.polylineBarriers=new $,this.routeInfo=null,this.spatialReference=F.WGS84,this.stops=new z,this.title="Route",this.type="route"}writeFeatureCollectionWebmap(e,t){const r=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),o=r.map(((e,t)=>t));u("featureCollection.layers",r,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=o}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>D.fromPortalJSON(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>O.fromPortalJSON(e)))}get fullExtent(){if(l(this.routeInfo)&&l(this.routeInfo.geometry))return this.routeInfo.geometry.extent;if(this.stops.length>1){const{spatialReference:e}=this.stops[0],t=new k({spatialReference:e}),r=this.stops.toArray().map((e=>e.geometry));for(const o of r)l(o)&&t.addPoint(o);return t.extent}return new h({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:F.WGS84})}readMaxScale(e,t){var r;const o=(U(t)?t.layers:t.featureCollection.layers).find((e=>l(e.layerDefinition.maxScale)));return null!=(r=null==o?void 0:o.layerDefinition.maxScale)?r:0}readMinScale(e,t){var r;const o=(U(t)?t.layers:t.featureCollection.layers).find((e=>l(e.layerDefinition.minScale)));return null!=(r=null==o?void 0:o.layerDefinition.minScale)?r:0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>_.fromPortalJSON(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>C.fromPortalJSON(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>T.fromPortalJSON(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,"RouteInfo",(e=>J.fromPortalJSON(e)));return r.length>0?r.getItemAt(0):null}get routeServiceUrl(){var e,r,o,i;return null!=(e=this.portalItem)&&e.id&&null!=(r=null==(o=this.portalItem.portal.helperServices)||null==(i=o.route)?void 0:i.url)?r:t.routeServiceUrl}readSpatialReference(e,t){var r,o;const i=U(t)?t.layers:t.featureCollection.layers;if(!i.length)return F.WGS84;const{layerDefinition:s}=i[0],n=null!=(r=null!=(o=s.spatialReference)?o:s.extent.spatialReference)?r:S;return F.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>A.fromPortalJSON(e)),(e=>this._setStopSymbol(e)))}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){l(this.directionLines)&&(this.directionLines.removeAll(),this._set("directionLines",null)),l(this.directionPoints)&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),l(this.routeInfo)&&this._set("routeInfo",null),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}async solve(e,t){var r,o,i,l;const p=null!=(r=null==e?void 0:e.stops)?r:this.stops,u=null!=(o=null==e?void 0:e.pointBarriers)?o:G(this.pointBarriers),y=null!=(i=null==e?void 0:e.polylineBarriers)?i:G(this.polylineBarriers),m=null!=(l=null==e?void 0:e.polygonBarriers)?l:G(this.polygonBarriers);if(a(p))throw new n("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((M(p)||W(p))&&p.features.length<2||s.isCollection(p)&&p.length<2)throw new n("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");const f=await N(this.routeServiceUrl,null==e?void 0:e.apiKey,t),c={startTime:new Date},d={directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:u,polylineBarriers:y,polygonBarriers:m,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!u,returnDirections:!0,returnPolygonBarriers:!!m,returnPolylineBarriers:!!y,returnRoutes:!0,returnStops:!0,stops:p},h=e?R.from(e):new R;for(const s in c)null==h[s]&&(h[s]=c[s]);h.set(d);const S=await I(this.routeServiceUrl,h,t),g=this._toRouteLayerSolution(S);return E(g,f,h),g}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:l}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",l)}_getLayerDefinition(){return{capabilities:"Query,Update,Editing",extent:this.fullExtent.toJSON(),hasM:!1,hasZ:!1,maxScale:this.maxScale,minScale:this.minScale,objectIdField:"__OBJECTID",spatialReference:this.spatialReference.toJSON(),type:"Feature Layer",typeIdField:""}}_getNetworkFeatures(e,t,n,l){const p=(U(e)?e.layers:e.featureCollection.layers).find((e=>e.layerDefinition.name===t));if(a(p))return new s;const{layerDefinition:u,popupInfo:y,featureSet:m}=p,f=u.drawingInfo.renderer,{features:c}=m,d=f&&i(f),h=c.map((e=>{var i;const s=n(e),{attributes:l}=e,a=new r({attributes:l});return null!=s.symbol||(s.symbol=null!=(i=null==d?void 0:d.getSymbol(a))?i:this._getNetworkSymbol(t)),null!=s.popupTemplate||(s.popupTemplate=y&&o.fromJSON(y)),s}));return l&&h.some((e=>!e.symbol))&&l(h),new s(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}_setStopSymbol(e){if(!e)return;if(e.length<2){for(const t of e)t.symbol=this.defaultSymbols.invalidStop;return}const t=e.map((e=>e.sequence)).filter((e=>l(e))),r=Math.min(...t),o=Math.max(...t);for(const i of e)i.sequence!==r?i.sequence!==o?"ok"===i.status||"not-located-on-closest"===i.status?"waypoint"!==i.locationType?"break"!==i.locationType?i.symbol=this.defaultSymbols.middleStop:i.symbol=this.defaultSymbols.breakStop:i.symbol=this.defaultSymbols.waypointStop:i.symbol=this.defaultSymbols.invalidStop:i.symbol=this.defaultSymbols.lastStop:i.symbol=this.defaultSymbols.firstStop}_toRouteLayerSolution(e){var t,r,o;const i=e.routeResults[0].stops.map((e=>A.fromJSON(e.toJSON())));this._setStopSymbol(i);const s=new z(i),n=new Z(null==(t=e.polygonBarriers)?void 0:t.map((e=>{const t=C.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),l=new $(null==(r=e.polylineBarriers)?void 0:r.map((e=>{const t=T.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),a=new Q(null==(o=e.pointBarriers)?void 0:o.map((e=>{const t=_.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),p=J.fromJSON(e.routeResults[0].route.toJSON());p.symbol=this.defaultSymbols.routeInfo;const u=new K(e.routeResults[0].directionPoints.features.map((e=>{const t=O.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new H(e.routeResults[0].directionLines.features.map((e=>{const t=D.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:u,pointBarriers:a,polygonBarriers:n,polylineBarriers:l,routeInfo:p,stops:s}}_writeDirectionLines(){return a(this.directionLines)||!this.directionLines.length?null:{featureSet:{features:this.directionLines.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionLines.toJSON()}},fields:D.fields,geometryType:"esriGeometryPolyline",name:"DirectionLines",title:"Direction Lines"},popupInfo:D.popupInfo}}_writeDirectionPoints(){return a(this.directionPoints)||!this.directionPoints.length?null:{featureSet:{features:this.directionPoints.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionPoints.toJSON()}},fields:O.fields,geometryType:"esriGeometryPoint",name:"DirectionPoints",title:"Direction Points"},popupInfo:O.popupInfo}}_writePointBarriers(){return a(this.pointBarriers)||!this.pointBarriers.length?null:{featureSet:{features:this.pointBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.pointBarriers.toJSON()}},fields:_.fields,geometryType:"esriGeometryPoint",name:"Barrier",title:"Point Barrier"},popupInfo:_.popupInfo}}_writePolygonBarriers(){return a(this.polygonBarriers)||!this.polygonBarriers.length?null:{featureSet:{features:this.polygonBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolygon"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polygonBarriers.toJSON()}},fields:C.fields,geometryType:"esriGeometryPolygon",name:"PolygonBarriers",title:"Polygon Barriers"},popupInfo:C.popupInfo}}_writePolylineBarriers(){return a(this.polylineBarriers)||!this.polylineBarriers.length?null:{featureSet:{features:this.polylineBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polylineBarriers.toJSON()}},fields:T.fields,geometryType:"esriGeometryPolyline",name:"PolylineBarriers",title:"Line Barriers"},popupInfo:T.popupInfo}}_writeRouteInfo(){return a(this.routeInfo)?null:{featureSet:{features:[this.routeInfo.toPortalJSON()],geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.routeInfo.toJSON()}},fields:J.fields,geometryType:"esriGeometryPolyline",name:"RouteInfo",title:"Route Details"},popupInfo:J.popupInfo}}_writeStops(){return a(this.stops)||!this.stops.length?null:{featureSet:{features:this.stops.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"uniqueValue",field1:"Sequence",defaultSymbol:this.defaultSymbols.middleStop.toJSON(),uniqueValueInfos:[{value:"1",symbol:this.defaultSymbols.firstStop.toJSON(),label:"First Stop"},{value:`${this.stops.length}`,symbol:this.defaultSymbols.lastStop.toJSON(),label:"Last Stop"}]}},fields:A.fields,geometryType:"esriGeometryPoint",name:"Stops",title:"Stops"},popupInfo:A.popupInfo}}};e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],X.prototype,"_featureCollection",void 0),e([d("web-map","_featureCollection")],X.prototype,"writeFeatureCollectionWebmap",null),e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],X.prototype,"_type",void 0),e([m({nonNullable:!0,type:P})],X.prototype,"defaultSymbols",void 0),e([m({readOnly:!0})],X.prototype,"directionLines",void 0),e([f(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],X.prototype,"readDirectionLines",null),e([m({readOnly:!0})],X.prototype,"directionPoints",void 0),e([f(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],X.prototype,"readDirectionPoints",null),e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],X.prototype,"featureCollectionType",void 0),e([m({readOnly:!0})],X.prototype,"fullExtent",null),e([m({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],X.prototype,"legendEnabled",void 0),e([m({type:["show","hide"]})],X.prototype,"listMode",void 0),e([m({type:Number,nonNullable:!0,json:{write:!1}})],X.prototype,"maxScale",void 0),e([f(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],X.prototype,"readMaxScale",null),e([m({type:Number,nonNullable:!0,json:{write:!1}})],X.prototype,"minScale",void 0),e([f(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],X.prototype,"readMinScale",null),e([m({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],X.prototype,"operationalLayerType",void 0),e([m({nonNullable:!0,type:s.ofType(_)})],X.prototype,"pointBarriers",void 0),e([f(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],X.prototype,"readPointBarriers",null),e([m({nonNullable:!0,type:s.ofType(C)})],X.prototype,"polygonBarriers",void 0),e([f(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],X.prototype,"readPolygonBarriers",null),e([m({nonNullable:!0,type:s.ofType(T)})],X.prototype,"polylineBarriers",void 0),e([f(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],X.prototype,"readPolylineBarriers",null),e([m({readOnly:!0})],X.prototype,"routeInfo",void 0),e([f(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],X.prototype,"readRouteInfo",null),e([m({nonNullable:!0})],X.prototype,"routeServiceUrl",null),e([m({type:F})],X.prototype,"spatialReference",void 0),e([f(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],X.prototype,"readSpatialReference",null),e([m({nonNullable:!0,type:s.ofType(A)})],X.prototype,"stops",void 0),e([f(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],X.prototype,"readStops",null),e([m()],X.prototype,"title",void 0),e([m({readOnly:!0,json:{read:!1}})],X.prototype,"type",void 0),X=e([c("esri.layers.RouteLayer")],X);const Y=X;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{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s,createTask as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s,createTask as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as v}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as g}from"./mixins/ArcGISCachedService.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{checkWebPSupport as I}from"./support/imageUtils.js";import x from"./support/SpriteSource.js";import U from"./support/TileInfo.js";import{loadMetadata as P}from"./support/vectorTileLayerLoader.js";import{createForItem as R}from"../portal/support/jsonContext.js";import{areSchemasOverlapping as O,unionTileInfos as M}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import V from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGL1Capabilities as D}from"../views/webgl/capabilities.js";let C=class extends(j(T(g(_(w(L(b(v(i(f)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.style=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.type="vector-tile",this.url=null,this.symbolCollisionBoxesVisible=!1,this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))null==e||e.destroy();this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(s).then((async()=>{if(!this.portalItem||!this.portalItem.id)return;const r=`${this.portalItem.itemUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},R(this.portalItem))})).catch(s).then((()=>this._loadStyle(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e&&e.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){var e;return(null==(e=this.primarySource)?void 0:e.fullExtent)||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null}get spatialReference(){return this.tileInfo&&this.tileInfo.spatialReference||null}get styleUrl(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`),t.styleUrl=e}get tileInfo(){var e;const t=[];for(const o in this.sourceNameToSource)t.push(this.sourceNameToSource[o]);let r=(null==(e=this.primarySource)?void 0:e.tileInfo)||new U;if(t.length>1)for(let o=0;o<t.length;o++)O(r,t[o].tileInfo)&&(r=M(r,t[o].tileInfo));return r}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){var r;const o=D().maxTextureSize,i=null!=(r=this.currentStyleInfo)&&r.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,s=new x(i,e,o,this.currentStyleInfo.spriteFormat);await s.load(t),this._spriteSourceMap.set(e,s)}return Promise.resolve(this._spriteSourceMap.get(e))}async loadStyle(e,t){var r;const o=e||this.style||this.url;return this._loadingTask&&"string"==typeof o&&this.url===o||(null==(r=this._loadingTask)||r.abort(),this._loadingTask=l((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(o,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const o=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||o})}getStyleLayer(e){return o(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return o(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return null!=t&&t.origin&&!this.styleUrl?(t.messages&&t.messages.push(new r("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await P(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await I("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new V(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const o=t[2]&&t[2].toLowerCase();if(!o)return;const i=t[1]||"";for(const s of r)if(s.toLowerCase().includes(o))return y(`//static.arcgis.com/attribution/Vector${i}/${s}`)}async _loadStyle(e){var t,r;return null!=(t=null==(r=this._loadingTask)?void 0:r.promise)?t:this.loadStyle(null,e)}};e([u({readOnly:!0})],C.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],C.prototype,"listMode",void 0),e([u({readOnly:!0,json:{read:!1}})],C.prototype,"capabilities",null),e([u({readOnly:!0})],C.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],C.prototype,"fullExtent",null),e([u()],C.prototype,"style",void 0),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],C.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],C.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],C.prototype,"parsedUrl",null),e([u({readOnly:!0})],C.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],C.prototype,"spatialReference",null),e([u({readOnly:!0})],C.prototype,"styleRepository",void 0),e([u({readOnly:!0})],C.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],C.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],C.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],C.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:U})],C.prototype,"tileInfo",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],C.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],C.prototype,"url",void 0),e([u({readOnly:!0})],C.prototype,"version",void 0),e([c("version",["version","currentVersion"])],C.prototype,"readVersion",null),e([u({type:Boolean})],C.prototype,"symbolCollisionBoxesVisible",void 0),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],C.prototype,"path",void 0),C=e([m("esri.layers.VectorTileLayer")],C);const N=C;export{N 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 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)||s("enable-feature:psl-server-lod"))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