@arcgis/core 6.0.0-next.33 → 6.0.0-next.35
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/Basemap.d.ts +2 -2
- package/README.md +2 -2
- package/analysis/ShadowCastAnalysis.d.ts +11 -5
- package/applications/Urban/meshUtils.d.ts +1 -0
- package/applications/Urban/meshUtils.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
- package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01f55004d64309f8538b.js +1 -0
- package/assets/esri/core/workers/chunks/0202eb8c2b2865f99981.js +1 -0
- package/assets/esri/core/workers/chunks/{67e533748435253aaba6.js → 0284f608d25c654fcc11.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3dc0bc0e00635855a7a.js → 03daf6f235c6edef6268.js} +1 -1
- package/assets/esri/core/workers/chunks/04a1d08c3b5b1dc7628f.js +1 -0
- package/assets/esri/core/workers/chunks/{1eaf8bfdd3765a90ccc2.js → 0523f893870a1546d7d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{1ee4df0fd61440cb5f02.js → 06102715e9a8f218e07c.js} +1 -1
- package/assets/esri/core/workers/chunks/{6029773458ab98600f67.js → 07e5482e1fc69be5de09.js} +1 -1
- package/assets/esri/core/workers/chunks/08140725277de5d2e41a.js +1 -0
- package/assets/esri/core/workers/chunks/{72d20d3957d612f86431.js → 0a508e25ec05363e1f04.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d9a1f23ec6ce90723ac.js → 0d99bfb75dcb9fa29080.js} +1 -1
- package/assets/esri/core/workers/chunks/10ad7b35b6800d40444e.js +1 -0
- package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +1 -0
- package/assets/esri/core/workers/chunks/{84038dd85005fea413eb.js → 139e753d95cfc9470e74.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd30b02c5978c1c5f511.js → 155861fbd0e5fc2db80c.js} +1 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +1 -0
- package/assets/esri/core/workers/chunks/165ca7a97b611c8f26c4.js +1 -0
- package/assets/esri/core/workers/chunks/{418addce122dbb8897b4.js → 1a614bac5db42c6263f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{0cc7fba402a93e6d2455.js → 1ae0c9345626e70affd3.js} +2 -2
- package/assets/esri/core/workers/chunks/{58c3ae6030def2ed5f31.js → 1b17f5f720f6cf3f6d73.js} +1 -1
- package/assets/esri/core/workers/chunks/{cd355baab983033c3ef0.js → 1ec772eaa63eb6937231.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9dc38761b314d33890f.js → 1f51567f47c2e2fc8a23.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c04835b0b52461183cd.js → 1fd82fcba2758741996a.js} +1 -1
- package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +1 -0
- package/assets/esri/core/workers/chunks/2211ff0a1f1ae8100231.js +1 -0
- package/assets/esri/core/workers/chunks/{096b2bf1c0d69d27f20c.js → 247617c0dbae2386ab3b.js} +1 -1
- package/assets/esri/core/workers/chunks/{97ec46605f16333144b7.js → 26ea39dfdf887f357fce.js} +1 -1
- package/assets/esri/core/workers/chunks/{85de980c5b296ec69323.js → 279089a6a3f08022c678.js} +1 -1
- package/assets/esri/core/workers/chunks/29c610ce1c81ebb84a6b.js +1 -0
- package/assets/esri/core/workers/chunks/2b4dd42920d37b1ff0a9.js +2 -0
- package/assets/esri/core/workers/chunks/{8da2a10318f49d0dc73a.js → 31ef7b7074b3e3829763.js} +1 -1
- package/assets/esri/core/workers/chunks/{b657363113f4a37e634b.js → 3223f9fbc76ba9ef8d13.js} +1 -1
- package/assets/esri/core/workers/chunks/322b22a5d54e404bebd5.js +1 -0
- package/assets/esri/core/workers/chunks/{122e75b21699a4e83b15.js → 338d800d4efcc91cead1.js} +1 -1
- package/assets/esri/core/workers/chunks/3537fe95b83a13b156cc.js +1 -0
- package/assets/esri/core/workers/chunks/{360c944c610efa2051fc.js → 379db67f78161ebd5468.js} +2 -2
- package/assets/esri/core/workers/chunks/{f09bc86cd52224febfcb.js → 3b380e64566a6cce59e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{be55771758e4bcef0976.js → 3e406043a374ee17475b.js} +1 -1
- package/assets/esri/core/workers/chunks/{e3b212f8af448ec29eef.js → 3fe4c89acd325d36618d.js} +1 -1
- package/assets/esri/core/workers/chunks/449a2dee17b54946f245.js +1 -0
- package/assets/esri/core/workers/chunks/46c290108a90518ef695.js +1 -0
- package/assets/esri/core/workers/chunks/{a596779eaeec7310671d.js → 478a89317a12e9b4d146.js} +1 -1
- package/assets/esri/core/workers/chunks/{fcc3902d6d9eda6f09f5.js → 48b8b57f559a53c6c513.js} +1 -1
- package/assets/esri/core/workers/chunks/{55a9eaeb152a3abada67.js → 4e5405134d079bdf9b7a.js} +1 -1
- package/assets/esri/core/workers/chunks/4f3e0d583cfa9d1d6727.js +2 -0
- package/assets/esri/core/workers/chunks/{d070fcb73ce274ab80e4.js → 5504ec9bd9ee4d10af07.js} +1 -1
- package/assets/esri/core/workers/chunks/552c36b40e5a5ec117fb.js +1 -0
- package/assets/esri/core/workers/chunks/5622f3faa59434772857.js +1 -0
- package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js → 5864bce1498a13ee5b7e.js} +2 -2
- package/assets/esri/core/workers/chunks/59a1b637d2c107504a04.js +1 -0
- package/assets/esri/core/workers/chunks/59a88dd53f8806bbec06.js +1 -0
- package/assets/esri/core/workers/chunks/{f4d91d470ca5fea0bd26.js → 5bd1414220e42cb8ebcf.js} +1 -1
- package/assets/esri/core/workers/chunks/5c2fe67527c9d7b4dba3.js +1 -0
- package/assets/esri/core/workers/chunks/5c3aa8386705c5e40358.js +1 -0
- package/assets/esri/core/workers/chunks/5d781c2c6204cffffd0d.js +1 -0
- package/assets/esri/core/workers/chunks/{176d75e76318bfc25a53.js → 60c8eedd06080edab3e3.js} +1 -1
- package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +1 -0
- package/assets/esri/core/workers/chunks/6604272ef6fe85279032.js +1 -0
- package/assets/esri/core/workers/chunks/{29cc6b1705418b1be5d7.js → 687deb918eb48a963c8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{0694c7bcfe71692e2ccf.js → 723df53cfa0189837d01.js} +1 -1
- package/assets/esri/core/workers/chunks/{90c1d10eae7ae71889b0.js → 7400b8c454b47ee4fb3c.js} +1 -1
- package/assets/esri/core/workers/chunks/796c6195b6bf59dcc9bd.js +1 -0
- package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +1 -0
- package/assets/esri/core/workers/chunks/{2de077c7b971f2c215a6.js → 7ddbde8fdd1cf3c53f50.js} +1 -1
- package/assets/esri/core/workers/chunks/804606b194dc9e71d088.js +1 -0
- package/assets/esri/core/workers/chunks/8102f0bf5707c3be3310.js +1 -0
- package/assets/esri/core/workers/chunks/{1a8d8274df292d65f82e.js → 81bcc495e6eaf2cf7474.js} +1 -1
- package/assets/esri/core/workers/chunks/90360c0bd053d3e3fd77.js +1 -0
- package/assets/esri/core/workers/chunks/{d1d6154b4af1c9cc497b.js → 934e1f2153e6fad6ed23.js} +1 -1
- package/assets/esri/core/workers/chunks/{e096c1d9d53af74d3207.js → 990e96139b5a1dccb061.js} +1 -1
- package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +1 -0
- package/assets/esri/core/workers/chunks/{f28b63c1179366dac8a2.js → 9e2c30b67bab5795306e.js} +1 -1
- package/assets/esri/core/workers/chunks/{9184c947cdefe06bf551.js → a18c3cbe505a19d29569.js} +1 -1
- package/assets/esri/core/workers/chunks/aa6ee2aa4ff6e6d41efb.js +1 -0
- package/assets/esri/core/workers/chunks/{3fd5c3cd8457ddc68798.js → aa779896fd9e5c341349.js} +1 -1
- package/assets/esri/core/workers/chunks/ac10c7d2c4829a150037.js +1 -0
- package/assets/esri/core/workers/chunks/{fe6dcb21570395e46ce8.js → afc8a9847f31bb66b13b.js} +1 -1
- package/assets/esri/core/workers/chunks/c5bf19da62a3d31009fe.js +2 -0
- package/assets/esri/core/workers/chunks/{2226c20c38e20713bcb5.js.LICENSE.txt → c5bf19da62a3d31009fe.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/c7adb7b77721c75891f4.js +1 -0
- package/assets/esri/core/workers/chunks/cd55cad81accf51d2989.js +1 -0
- package/assets/esri/core/workers/chunks/{bead830a677690eeb6fb.js → ce8ef2eec290e1df6b2a.js} +1 -1
- package/assets/esri/core/workers/chunks/d3369ffed19f4c264dcd.js +1 -0
- package/assets/esri/core/workers/chunks/d3412518a7b518860fbb.js +1 -0
- package/assets/esri/core/workers/chunks/{3048e74e6246324ce6fc.js → d5916500514a41a4758f.js} +1 -1
- package/assets/esri/core/workers/chunks/{89dc49e784f7ba3b93ea.js → dac69c0047488fdf986d.js} +1 -1
- package/assets/esri/core/workers/chunks/db1f7b2562de495b3401.js +2 -0
- package/assets/esri/core/workers/chunks/dcc782e4bf9e8a8202f9.js +1 -0
- package/assets/esri/core/workers/chunks/dcdf837a452dc0cac582.js +1 -0
- package/assets/esri/core/workers/chunks/e0a37d3bcb9a944e53dd.js +1 -0
- package/assets/esri/core/workers/chunks/{19a4fa965b70fc6f78f6.js → e209cb1f3f14bf576ebe.js} +1 -1
- package/assets/esri/core/workers/chunks/e67ea2f1714e5abeae44.js +1 -0
- package/assets/esri/core/workers/chunks/e8fb2ba7b7a4f0916325.js +1 -0
- package/assets/esri/core/workers/chunks/{636e9c4ac1f9ae98f9d1.js → ea81f9d71b0842a4be26.js} +1 -1
- package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js → eaa0e906b46ae4c84d72.js} +2 -2
- package/assets/esri/core/workers/chunks/efcd38aad9aa667001b2.js +1 -0
- package/assets/esri/core/workers/chunks/{3aafdb905c697bc9b1ad.js → f372f4eb5527238c46f5.js} +1 -1
- package/assets/esri/core/workers/chunks/f497968055af459c5da4.js +1 -0
- package/assets/esri/core/workers/chunks/f7123ba1286f64e13e91.js +1 -0
- package/assets/esri/core/workers/chunks/fcb4707c2e95099b9f30.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/BlurEmission.glsl.js +9 -4
- package/chunks/GlobalIllumination.glsl.js +55 -46
- package/chunks/GlobalIlluminationBlur.glsl.js +13 -9
- package/chunks/RibbonLine.glsl.js +90 -88
- package/chunks/Terrain.glsl.js +9 -9
- package/chunks/libtess-f32.js +1 -1
- package/chunks/libtess-f64.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +2 -2
- package/config.d.ts +3 -3
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/mathUtils.js +1 -1
- package/core/workers.d.ts +1 -0
- package/form/FormTemplate.d.ts +1 -1
- package/geometry/libtess.js +1 -1
- package/geometry/projection/projectors.js +1 -1
- package/geometry/support/MeshLocalVertexSpace.d.ts +3 -3
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/identity/Credential.d.ts +1 -1
- package/identity/IdentityManager.d.ts +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/identity/OAuthInfo.d.ts +1 -1
- package/identity/ServerInfo.d.ts +1 -1
- package/kernel.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VectorTileLayer.d.ts +2 -2
- package/layers/VideoLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/WFSLayer.d.ts +8 -4
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +2 -2
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/graphics/sources/support/timeQueryUtils.js +2 -0
- package/layers/mixins/APIKeyMixin.d.ts +1 -1
- package/layers/mixins/ArcGISMapService.d.ts +17 -0
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/ogc/types.d.ts +1 -1
- package/layers/ogc/wfsUtils.d.ts +7 -2
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/ogc/xmlUtils.js +1 -1
- package/layers/support/TelemetryData.d.ts +28 -4
- package/layers/support/TimeInformation.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/timeInfoUtils.js +2 -0
- package/layers/video/videoUtils.js +1 -1
- package/package.json +4 -4
- package/rest/query/executeAttributeBinsQuery.js +1 -1
- package/rest/query/executeForExtent.js +1 -1
- package/rest/query/executeForTopCount.js +1 -1
- package/rest/query/executeForTopExtents.js +1 -1
- package/rest/query/executeForTopIds.js +1 -1
- package/rest/query/executeTopFeaturesQuery.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/query/operations/queryAttributeBins.js +1 -1
- package/rest/query/operations/queryTopFeatures.js +1 -1
- package/rest/route.d.ts +1 -1
- package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
- package/rest/support/LengthsParameters.d.ts +1 -1
- package/rest/support/timeUtils.js +1 -1
- package/symbols/TextSymbol.d.ts +0 -1
- package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/GlyphWorker.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/materialKeyUtils.js +2 -0
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastError.d.ts +40 -0
- package/views/3d/analysis/ShadowCast/ShadowCastError.js +2 -0
- package/views/3d/analysis/ShadowCast/sunlightUtils.js +2 -0
- package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +16 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/support/FeatureMemory.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
- package/views/3d/state/Constraints.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ScreenSizePerspective.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/support/RenderCoordsHelper.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/sphereExtentUtils.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/NavigationDepthCache.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RibbonLineVertexInfo.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl.d.ts +1 -1
- package/views/SceneView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/widgets/Directions.d.ts +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/assets/esri/core/workers/chunks/0e445ec3523de9f2dfa2.js +0 -1
- package/assets/esri/core/workers/chunks/0f6c0d42100c21367e5c.js +0 -1
- package/assets/esri/core/workers/chunks/131185d26343a997495e.js +0 -1
- package/assets/esri/core/workers/chunks/176d0a06ebff5a29dedf.js +0 -1
- package/assets/esri/core/workers/chunks/18776a130d96879a68b1.js +0 -1
- package/assets/esri/core/workers/chunks/1a3f71c4d97c36050030.js +0 -1
- package/assets/esri/core/workers/chunks/20a698709c3c11ff2c16.js +0 -1
- package/assets/esri/core/workers/chunks/2226c20c38e20713bcb5.js +0 -2
- package/assets/esri/core/workers/chunks/277263466837e1673f56.js +0 -1
- package/assets/esri/core/workers/chunks/2981e904ab62f3ed80d0.js +0 -2
- package/assets/esri/core/workers/chunks/32cc59e126df8c96a0cf.js +0 -2
- package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +0 -1
- package/assets/esri/core/workers/chunks/38d852676677e5697864.js +0 -1
- package/assets/esri/core/workers/chunks/46453ebfee17b5421d9d.js +0 -1
- package/assets/esri/core/workers/chunks/5a9b7eb26f936f03d02e.js +0 -1
- package/assets/esri/core/workers/chunks/5bb6c255bdc8aa9ba23e.js +0 -1
- package/assets/esri/core/workers/chunks/5f07f52bb8b7721f08d3.js +0 -1
- package/assets/esri/core/workers/chunks/654f5441227579d2b6b4.js +0 -1
- package/assets/esri/core/workers/chunks/6b5c073dddd89d06ed80.js +0 -1
- package/assets/esri/core/workers/chunks/6bb191b19ce43a27f205.js +0 -1
- package/assets/esri/core/workers/chunks/6ddc29a144640acb1192.js +0 -1
- package/assets/esri/core/workers/chunks/6ebe73f69ae822053b70.js +0 -1
- package/assets/esri/core/workers/chunks/6f6d1873753a9c6994aa.js +0 -1
- package/assets/esri/core/workers/chunks/7084dd6e10c6c1393e92.js +0 -1
- package/assets/esri/core/workers/chunks/7566321c6a2913f2852b.js +0 -1
- package/assets/esri/core/workers/chunks/7b5cd150a4d0139850be.js +0 -1
- package/assets/esri/core/workers/chunks/7cc9d7a88b64e25fce14.js +0 -1
- package/assets/esri/core/workers/chunks/7e211d8a8ad6c6a7cf3e.js +0 -1
- package/assets/esri/core/workers/chunks/844eedda8f749972f707.js +0 -2
- package/assets/esri/core/workers/chunks/849f446c718e892f39ce.js +0 -1
- package/assets/esri/core/workers/chunks/87177e0f82e8a6ae3189.js +0 -1
- package/assets/esri/core/workers/chunks/9976eaa81085c0d17e14.js +0 -1
- package/assets/esri/core/workers/chunks/a2196a49f89d57a0a1c7.js +0 -1
- package/assets/esri/core/workers/chunks/a504a5e06cb89a620799.js +0 -1
- package/assets/esri/core/workers/chunks/a65951f1d5702cfd996e.js +0 -1
- package/assets/esri/core/workers/chunks/aba259a70bee68d2edb7.js +0 -1
- package/assets/esri/core/workers/chunks/b8fd7c3b36981261378b.js +0 -1
- package/assets/esri/core/workers/chunks/b9cb92858a576eb6aa06.js +0 -1
- package/assets/esri/core/workers/chunks/c33a9635c294c8774977.js +0 -1
- package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +0 -1
- package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +0 -1
- package/assets/esri/core/workers/chunks/cf1ec61eb2ad147bb931.js +0 -1
- package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +0 -1
- package/assets/esri/core/workers/chunks/dc2f93453dfa40f623ab.js +0 -1
- package/assets/esri/core/workers/chunks/e81173724e8de8c1e65b.js +0 -1
- package/assets/esri/core/workers/chunks/e83f9abee611c5b80009.js +0 -1
- package/assets/esri/core/workers/chunks/f39c700f3db7db52b522.js +0 -1
- package/assets/esri/core/workers/chunks/f45064066e1ab041a0b2.js +0 -1
- package/assets/esri/core/workers/chunks/ffe49d9e7df081bef4a5.js +0 -1
- package/views/2d/engine/webgl/hashMosaic.js +0 -2
- /package/assets/esri/core/workers/chunks/{0cc7fba402a93e6d2455.js.LICENSE.txt → 1ae0c9345626e70affd3.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{844eedda8f749972f707.js.LICENSE.txt → 2b4dd42920d37b1ff0a9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{32cc59e126df8c96a0cf.js.LICENSE.txt → 4f3e0d583cfa9d1d6727.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js.LICENSE.txt → 5864bce1498a13ee5b7e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2981e904ab62f3ed80d0.js.LICENSE.txt → db1f7b2562de495b3401.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js.LICENSE.txt → eaa0e906b46ae4c84d72.js.LICENSE.txt} +0 -0
|
@@ -34,7 +34,7 @@ export interface VectorTileLayerProperties extends LayerProperties, APIKeyMixinP
|
|
|
34
34
|
* apiKey: "YOUR_API_KEY"
|
|
35
35
|
* });
|
|
36
36
|
* @see [Item access privileges](https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/api-key-credentials/#item-access-privileges)
|
|
37
|
-
* @see [
|
|
37
|
+
* @see [Authentication and access tokens](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/#api-keys)
|
|
38
38
|
* @example
|
|
39
39
|
* // set the api key to access a protected service
|
|
40
40
|
* const layer = new FeatureLayer({
|
|
@@ -427,7 +427,7 @@ export default class VectorTileLayer extends VectorTileLayerSuperclass {
|
|
|
427
427
|
* apiKey: "YOUR_API_KEY"
|
|
428
428
|
* });
|
|
429
429
|
* @see [Item access privileges](https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/api-key-credentials/#item-access-privileges)
|
|
430
|
-
* @see [
|
|
430
|
+
* @see [Authentication and access tokens](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/#api-keys)
|
|
431
431
|
* @example
|
|
432
432
|
* // set the api key to access a protected service
|
|
433
433
|
* const layer = new FeatureLayer({
|
package/layers/VideoLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import n from"../request.js";import{deprecatedProperty as r}from"../core/deprecate.js";import i from"../core/Error.js";import a from"../core/Logger.js";import{clamp as o}from"../core/mathUtils.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as c}from"../core/promiseUtils.js";import{watch as l,initial as u,whenOnce as d}from"../core/reactiveUtils.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{Integer as m}from"../core/accessorSupport/ensureType.js";import h from"../geometry/Extent.js";import g from"../geometry/Point.js";import _ from"../geometry/Polygon.js";import v from"../geometry/Polyline.js";import y from"../geometry/SpatialReference.js";import ee from"./Layer.js";import{ArcGISService as b}from"./mixins/ArcGISService.js";import{BlendLayer as te,effectProperty as ne}from"./mixins/BlendLayer.js";import{CustomParametersMixin as re}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as x}from"./mixins/OperationalLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{parse as w,cleanTitle as T,titleFromUrlAndName as ie}from"./support/arcgisLayerUrl.js";import{opacity as ae,id as oe}from"./support/commonProperties.js";import{normalizeParsedUrlObject as se,urlProperty as ce}from"./support/multiLayerServiceUtils.js";import le from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as ue}from"./support/serviceCapabilitiesUtils.js";import de from"./support/TelemetryData.js";import E from"./support/TelemetryDisplay.js";import fe from"./support/VideoFrame.js";import D from"./support/VideoTimeExtent.js";import O from"./video/VideoController.js";import{getFrameHorizonPoints as k,getGroundControlPoints as A,getTelemetryData as j,getServiceLayersInfo as M,getStyledTelemetrySymbol as N,getLineOfSight as P,getSensorTrailPoints as F,readVideoTimeExtent as I}from"./video/videoUtils.js";import L from"../symbols/CIMSymbol.js";import R from"../symbols/PictureMarkerSymbol.js";import z from"../symbols/SimpleFillSymbol.js";import B from"../symbols/SimpleLineSymbol.js";import V from"../symbols/SimpleMarkerSymbol.js";import pe from"../symbols/Symbol.js";import{write as me}from"../symbols/support/jsonUtils.js";import{addLayerUnsupportedError as he}from"../webdoc/support/unsupportedErrors.js";import{reader as H}from"../core/accessorSupport/decorators/reader.js";function U(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}const W=new t([255,127,0]),G=new t([0,0,0,.05]),K=new V({angle:0,color:W,size:10,style:`cross`}),q=new z({color:G,outline:new B({color:W,width:2})}),J=new B({color:W,style:`dash`,width:1}),Y=new B({color:W,width:1}),X=new V({angle:0,color:W,outline:{color:[255,255,255],width:1.33},size:10,style:`circle`}),Z=new B({color:W,width:1}),ge={types:{base:pe,key:`type`,typeMap:{"simple-marker":V,"picture-marker":R,cim:L}},json:{name:`drawingInfo.sensorSymbol`,write:{writer:me,overridePolicy:U}}};function Q(e,t){return{type:t,json:{name:e,write:{overridePolicy:U}}}}let $=class extends te(C(b(x(S(s(re(ee))))))){constructor(e){super(e),this._trailPoints=[],this.cameraInfo=null,this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new O,this.copyright=null,this.coverage=null,this.created=null,this.customParameters=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=K.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=q.clone(),this.fullExtent=null,this.fullTimeExtent=null,this.initialExtent=null,this.layerId=null,this.previewsInfo=null,this.operationalLayerType=`ArcGISVideoLayer`,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbolOrientation={source:`platformHeading`,symbolOffset:0},this.sensorPathSymbol=J.clone(),this.sensorSymbol=X.clone(),this.sensorSightLineSymbol=Y.clone(),this.sensorTrailSymbol=Z.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=y.WGS84,this.start=0,this.telemetryDisplay=new E,this.sublayerTitleMode=`item-title`,this.type=`video`,this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([l(()=>this.metadata,()=>{this.notifyChange(`telemetry`),this.notifyChange(`groundControlPoints`),this.notifyChange(`frameHorizonPoints`)}),l(()=>this.telemetry?.sensorLocation,e=>{this._setSensorPath(e),this._setSensorTrail(e)},u)]),d(()=>this.loaded&&this.state===`can-play`&&this.duration>0).then(()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)})}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:[`Video Service`],supportsData:!0},e).catch(c).then(()=>this._fetchService(t)).then(()=>this._fetchCoverage(t)).then(()=>this._fetchPreviewsInfo(t));return this.addResolvingPromise(n),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return ue(t)}readConnectionInfo(e,t){let n=Object.values(t.connectionUrl);return n?.length&&(this.controller.startMode=t.serviceType===`ondemand`?`auto`:`metadata`,this.controller.playerUrl=n[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return k(this.metadata)}get groundControlPoints(){return A(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return se(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return j(this.metadata)}readTitleFromService(e,t){let{url:n}=this,r=t.name||w(n)?.title;switch(this.sublayerTitleMode){case`item-title`:if(n)return ie(n,r);break;case`item-title-and-service-name`:{let e=this.portalItem?.title;if(e&&e!==r)return e=T(e),r?`${e} - ${T(r)}`:e;break}}return r?T(r):void 0}readTitleFromPortalItem(e){return this.sublayerTitleMode===`item-title`?e:void 0}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return M(t)}get videoTimeExtent(){return r(a.getLogger(this),`videoTimeExtent`,{replacement:`fullTimeExtent`,version:`4.33`,warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this._trailPoints=[],this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;let t=o(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;let t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}updateTelemetryColor(e,n){if(!e)return;let r=new t(e);(!n||n?.frameCenter)&&(this.frameCenterSymbol=N(this.frameCenterSymbol,r)??K),(!n||n?.frameOutline)&&(this.frameOutlineSymbol=N(this.frameOutlineSymbol,r,G)??q),(!n||n?.lineOfSight)&&(this.sensorSightLineSymbol=N(this.sensorSightLineSymbol,r)??Y),(!n||n?.sensorLocation)&&(this.sensorSymbol=N(this.sensorSymbol,r)??X),(!n||n?.sensorPath)&&(this.sensorPathSymbol=N(this.sensorPathSymbol,r)??J),(!n||n?.sensorTrail)&&(this.sensorTrailSymbol=N(this.sensorTrailSymbol,r)??Z)}write(e,t){return this.layerId==null?(he(t,this,`the ArcGIS server version must be greater than 11.2.`),null):super.write(e,t)}async _fetchCoverage(e){if(!this.capabilities?.operations?.supportsCoverageQuery||typeof this.layerId!=`number`)return;let t=`${this.parsedUrl.path}/coverage`,{data:r}=await n(t,{query:{f:`json`,...this.customParameters},signal:e}),{area:i=null,sensorPoints:a=null,telemetry:o=null}=r,s={area:null,path:null};if(i?.rings?.length&&(s.area=_.fromJSON(i)),a?.points?.length){let e=a.points;s.path=new v({hasM:!0,hasZ:!0,paths:[e]})}if(o?.start){let{frameCenter:e=null,frameOutline:t=null,sensor:n=null}=o?.start||{};if(t&&(this.telemetry.frameOutline=_.fromJSON(t)),n&&(this.telemetry.sensorLocation=g.fromJSON(n)),e&&(this.telemetry.frameCenter=g.fromJSON(e)),n&&e){let{sensorLocation:e,frameCenter:t}=this.telemetry;this.telemetry.lineOfSight=P(e,t)}}this._set(`coverage`,s)}async _fetchPreviewsInfo(e){if(typeof this.layerId!=`number`||!this.capabilities?.operations?.supportsPreviews)return;let t=`${this.parsedUrl.path}/content/preview/preview.json`,{data:r}=await n(t,{query:{f:`json`},signal:e});if(!r?.preview)return;let{frameCount:i=0,frameInterval:a=0,frames:o=[],height:s,nCol:c,nRow:l,preview:u,width:d}=r||{},f={count:i,height:s,interval:a,numCols:c,numRows:l,thumbnailInfo:o,urlFragment:u,width:d};this.read({previewsInfo:f},{origin:`service`})}async _fetchService(e){if(this.sourceJSON){this.read(this.sourceJSON,{origin:`service`,url:this.parsedUrl});return}let{data:t,ssl:r}=await n(this.url,{query:{f:`json`,...this.parsedUrl.query,...this.customParameters},signal:e});if(r&&(this.url=this.url.replace(/^http:/i,`https:`)),!t?.currentVersion){t.currentVersion=`11.2`,this.sourceJSON=t,this.read(this.sourceJSON,{origin:`service`,url:this.parsedUrl});return}if(this.layerId??=t.layers?.[0]?.id??null,this.layerId==null)throw new i(`arcgis-layers:url-mismatch`,`The url is not a valid arcgis resource`);let{data:a}=await n(this.parsedUrl.path,{query:{f:`json`,...this.customParameters},signal:e});this.sourceJSON={...t,...a},this.read(this.sourceJSON,{origin:`service`,url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;let t=F(e,this._trailPoints);this._trailPoints=[...t];let n=this._trailPoints.map(e=>e.toArray()),r=new v({hasZ:e.hasZ,paths:[n]});this.telemetry.sensorTrail=r.clone()}_setSensorPath(e){if(!e||this.coverage?.path?.type!==`polyline`)return;let t=this.telemetry?.sensorPath??this.coverage.path.clone(),{spatialReference:n,hasZ:r,hasM:i,paths:a}=t;if(!i)return;let o=t.hasZ?3:2,s=this.currentTime*1e3,c=[];for(let e of a){let t=0,n=e.length,r=s>500?s+1500:s;for(;t<n&&e[t][o]<=r;)t++;t<e.length&&c.push(...e.slice(t))}this.telemetry.sensorPath=new v({hasZ:r,hasM:i,paths:[c],spatialReference:n})}};e([f({type:Boolean,json:{write:{ignoreOrigin:!0}}})],$.prototype,`autoplay`,null),e([f({readOnly:!0})],$.prototype,`buffered`,null),e([f({readOnly:!0})],$.prototype,`cameraInfo`,void 0),e([f({readOnly:!0,json:{read:!1}})],$.prototype,`capabilities`,void 0),e([H(`service`,`capabilities`,[`supportsAppend`,`supportsCoverageQuery`,`supportsExportClip`,`supportsExportFrameset`,`supportsMensuration`,`supportsPreviews`,`supportsUpdate`])],$.prototype,`readCapabilitiesFromService`,null),e([f({readOnly:!0})],$.prototype,`codecs`,void 0),e([f({readOnly:!0})],$.prototype,`connectionInfo`,void 0),e([H(`connectionInfo`,[`connectionUrl`])],$.prototype,`readConnectionInfo`,null),e([f()],$.prototype,`controller`,void 0),e([f({type:String})],$.prototype,`copyright`,void 0),e([f({readOnly:!0})],$.prototype,`coverage`,void 0),e([f({readOnly:!0,type:Date})],$.prototype,`created`,void 0),e([f({type:Number})],$.prototype,`currentTime`,null),e([f({json:{write:!1}})],$.prototype,`customParameters`,void 0),e([f({type:String})],$.prototype,`description`,void 0),e([f({type:Number})],$.prototype,`duration`,null),e([f({readOnly:!0})],$.prototype,`elevationSource`,void 0),e([f({type:Boolean})],$.prototype,`ended`,null),e([f({type:fe})],$.prototype,`frame`,void 0),e([f(Q(`drawingInfo.frameCenterSymbol`,V))],$.prototype,`frameCenterSymbol`,void 0),e([f({readOnly:!0,type:m})],$.prototype,`frameCount`,void 0),e([f(ne)],$.prototype,`frameEffect`,void 0),e([f(ae)],$.prototype,`frameOpacity`,void 0),e([f(Q(`drawingInfo.frameOutlineSymbol`,z))],$.prototype,`frameOutlineSymbol`,void 0),e([f({type:h})],$.prototype,`fullExtent`,void 0),e([f({readOnly:!0})],$.prototype,`frameHorizonPoints`,null),e([f({readOnly:!0,json:{read:{reader:I,source:`time`}},type:D})],$.prototype,`fullTimeExtent`,void 0),e([f({readOnly:!0})],$.prototype,`groundControlPoints`,null),e([f(oe)],$.prototype,`id`,void 0),e([f({type:h})],$.prototype,`initialExtent`,void 0),e([f({readOnly:!0})],$.prototype,`isLive`,null),e([f({type:m,json:{read:!1,origins:{service:{read:{source:`id`}}}}})],$.prototype,`layerId`,void 0),e([f({readOnly:!0})],$.prototype,`livestreamStatus`,null),e([f({type:Boolean,json:{write:{ignoreOrigin:!0}}})],$.prototype,`loop`,null),e([f({readOnly:!0})],$.prototype,`metadata`,null),e([f({readOnly:!0})],$.prototype,`mimeType`,null),e([f({type:Boolean,json:{write:{ignoreOrigin:!0}}})],$.prototype,`muted`,null),e([f({readOnly:!0})],$.prototype,`previewsInfo`,void 0),e([f({type:[`ArcGISVideoLayer`]})],$.prototype,`operationalLayerType`,void 0),e([f({readOnly:!0})],$.prototype,`parsedUrl`,null),e([f({type:le})],$.prototype,`playbackInfo`,void 0),e([f({type:Number,json:{write:{ignoreOrigin:!0}}})],$.prototype,`playbackRate`,null),e([f({readOnly:!0,type:String})],$.prototype,`playerUrl`,null),e([f({readOnly:!0})],$.prototype,`playing`,null),e([f({readOnly:!0,json:{read:{source:`poster`}}})],$.prototype,`posterUrl`,void 0),e([f({readOnly:!0})],$.prototype,`qualities`,void 0),e([f()],$.prototype,`sensorSymbolOrientation`,void 0),e([f(Q(`drawingInfo.sensorPathSymbol`,B))],$.prototype,`sensorPathSymbol`,void 0),e([f(ge)],$.prototype,`sensorSymbol`,void 0),e([f(Q(`drawingInfo.sensorSightLineSymbol`,B))],$.prototype,`sensorSightLineSymbol`,void 0),e([f(Q(`drawingInfo.sensorTrailSymbol`,B))],$.prototype,`sensorTrailSymbol`,void 0),e([f({readOnly:!0})],$.prototype,`serviceItemId`,void 0),e([f()],$.prototype,`sourceJSON`,void 0),e([f({readOnly:!0})],$.prototype,`sourceQuality`,void 0),e([f({readOnly:!0,json:{name:`serviceType`}})],$.prototype,`sourceType`,void 0),e([f({type:y})],$.prototype,`spatialReference`,void 0),e([f({json:{write:!0}})],$.prototype,`start`,void 0),e([f({readOnly:!0})],$.prototype,`started`,null),e([f({readOnly:!0,type:String})],$.prototype,`state`,null),e([f({readOnly:!0,type:de})],$.prototype,`telemetry`,null),e([f({type:E,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],$.prototype,`telemetryDisplay`,void 0),e([H(`service`,`title`,[`name`])],$.prototype,`readTitleFromService`,null),e([H(`portal-item`,`title`)],$.prototype,`readTitleFromPortalItem`,null),e([f({type:String})],$.prototype,`sublayerTitleMode`,void 0),e([f({readOnly:!0})],$.prototype,`type`,void 0),e([f(ce())],$.prototype,`url`,void 0),e([f({readOnly:!0,type:Number,json:{read:{source:`currentVersion`}}})],$.prototype,`version`,void 0),e([f({readOnly:!0})],$.prototype,`videoElement`,null),e([f({readOnly:!0})],$.prototype,`videoHeight`,null),e([f({readOnly:!0,json:{read:!1}})],$.prototype,`videoLayersInfo`,void 0),e([H(`service`,`videoLayersInfo`,[`id`,`name`,`poster`,`serviceType`,`type`])],$.prototype,`readLayerInfosFromService`,null),e([f({type:D,readOnly:!0})],$.prototype,`videoTimeExtent`,null),e([f({readOnly:!0})],$.prototype,`videoWidth`,null),e([f()],$.prototype,`volume`,null),e([f({readOnly:!0})],$.prototype,`waiting`,null),$=e([p(`esri.layers.VideoLayer`)],$);const _e=$;export{_e as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import n from"../request.js";import{deprecatedProperty as r}from"../core/deprecate.js";import i from"../core/Error.js";import a from"../core/Logger.js";import{clamp as o}from"../core/mathUtils.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as c}from"../core/promiseUtils.js";import{watch as l,initial as u,whenOnce as d}from"../core/reactiveUtils.js";import{property as f,subclass as ee}from"../core/accessorSupport/decorators.js";import{Integer as p}from"../core/accessorSupport/ensureType.js";import m from"../geometry/Extent.js";import h from"../geometry/Point.js";import g from"../geometry/Polygon.js";import _ from"../geometry/Polyline.js";import v from"../geometry/SpatialReference.js";import te from"./Layer.js";import{ArcGISService as ne}from"./mixins/ArcGISService.js";import{BlendLayer as re,effectProperty as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as ie}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as ae}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{parse as S,cleanTitle as C,titleFromUrlAndName as w}from"./support/arcgisLayerUrl.js";import{opacity as T,id as oe}from"./support/commonProperties.js";import{normalizeParsedUrlObject as se,urlProperty as ce}from"./support/multiLayerServiceUtils.js";import le from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as ue}from"./support/serviceCapabilitiesUtils.js";import de from"./support/TelemetryData.js";import E from"./support/TelemetryDisplay.js";import fe from"./support/VideoFrame.js";import D from"./support/VideoTimeExtent.js";import O from"./video/VideoController.js";import{getFrameHorizonPoints as k,getGroundControlPoints as A,getTelemetryData as j,getServiceLayersInfo as M,getStyledTelemetrySymbol as N,getLineOfSight as P,getSensorTrailPoints as F,readVideoTimeExtent as I}from"./video/videoUtils.js";import L from"../symbols/CIMSymbol.js";import R from"../symbols/PictureMarkerSymbol.js";import z from"../symbols/SimpleFillSymbol.js";import B from"../symbols/SimpleLineSymbol.js";import V from"../symbols/SimpleMarkerSymbol.js";import pe from"../symbols/Symbol.js";import{write as me}from"../symbols/support/jsonUtils.js";import{addLayerUnsupportedError as he}from"../webdoc/support/unsupportedErrors.js";import{reader as H}from"../core/accessorSupport/decorators/reader.js";function U(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}const W=new t([255,127,0]),G=new t([0,0,0,.05]),K=new V({angle:0,color:W,size:10,style:`cross`}),q=new z({color:G,outline:new B({color:W,width:2})}),J=new B({color:W,style:`dash`,width:1}),Y=new B({color:W,width:1}),X=new V({angle:0,color:W,outline:{color:[255,255,255],width:1.33},size:10,style:`circle`}),Z=new B({color:W,width:1}),ge={types:{base:pe,key:`type`,typeMap:{"simple-marker":V,"picture-marker":R,cim:L}},json:{name:`drawingInfo.sensorSymbol`,write:{writer:me,overridePolicy:U}}};function Q(e,t){return{type:t,json:{name:e,write:{overridePolicy:U}}}}let $=class extends re(x(ne(b(ae(s(ie(te))))))){constructor(e){super(e),this._trailPoints=[],this.cameraInfo=null,this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new O,this.copyright=null,this.coverage=null,this.created=null,this.customParameters=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=K.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=q.clone(),this.fullExtent=null,this.fullTimeExtent=null,this.initialExtent=null,this.layerId=null,this.previewsInfo=null,this.operationalLayerType=`ArcGISVideoLayer`,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbolOrientation={source:`platformHeading`,symbolOffset:0},this.sensorPathSymbol=J.clone(),this.sensorSymbol=X.clone(),this.sensorSightLineSymbol=Y.clone(),this.sensorTrailSymbol=Z.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=v.WGS84,this.start=0,this.telemetryDisplay=new E,this.sublayerTitleMode=`item-title`,this.type=`video`,this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([l(()=>this.metadata,()=>{this.notifyChange(`telemetry`),this.notifyChange(`groundControlPoints`),this.notifyChange(`frameHorizonPoints`)}),l(()=>({telemetry:this.telemetry,sensorLocation:this.telemetry.sensorLocation,path:this.coverage?.path,currentTime:this.currentTime}),(e,t)=>this._updateSensorGeometry({...e,previous:t}),u)]),d(()=>this.loaded&&this.state===`can-play`&&this.duration>0).then(()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)})}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:[`Video Service`],supportsData:!0},e).catch(c).then(()=>this._fetchService(t)).then(()=>this._fetchCoverage(t)).then(()=>this._fetchPreviewsInfo(t));return this.addResolvingPromise(n),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return ue(t)}readConnectionInfo(e,t){let n=Object.values(t.connectionUrl);return n?.length&&(this.controller.startMode=t.serviceType===`ondemand`?`auto`:`metadata`,this.controller.playerUrl=n[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return k(this.metadata)}get groundControlPoints(){return A(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return se(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return j(this.metadata)}readTitleFromService(e,t){let{url:n}=this,r=t.name||S(n)?.title;switch(this.sublayerTitleMode){case`item-title`:if(n)return w(n,r);break;case`item-title-and-service-name`:{let e=this.portalItem?.title;if(e&&e!==r)return e=C(e),r?`${e} - ${C(r)}`:e;break}}return r?C(r):void 0}readTitleFromPortalItem(e){return this.sublayerTitleMode===`item-title`?e:void 0}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return M(t)}get videoTimeExtent(){return r(a.getLogger(this),`videoTimeExtent`,{replacement:`fullTimeExtent`,version:`4.33`,warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this._trailPoints=[],this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;let t=o(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;let t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}updateTelemetryColor(e,n){if(!e)return;let r=new t(e);(!n||n?.frameCenter)&&(this.frameCenterSymbol=N(this.frameCenterSymbol,r)??K),(!n||n?.frameOutline)&&(this.frameOutlineSymbol=N(this.frameOutlineSymbol,r,G)??q),(!n||n?.lineOfSight)&&(this.sensorSightLineSymbol=N(this.sensorSightLineSymbol,r)??Y),(!n||n?.sensorLocation)&&(this.sensorSymbol=N(this.sensorSymbol,r)??X),(!n||n?.sensorPath)&&(this.sensorPathSymbol=N(this.sensorPathSymbol,r)??J),(!n||n?.sensorTrail)&&(this.sensorTrailSymbol=N(this.sensorTrailSymbol,r)??Z)}write(e,t){return this.layerId==null?(he(t,this,`the ArcGIS server version must be greater than 11.2.`),null):super.write(e,t)}async _fetchCoverage(e){if(!this.capabilities?.operations?.supportsCoverageQuery||typeof this.layerId!=`number`)return;let t=`${this.parsedUrl.path}/coverage`,{data:r}=await n(t,{query:{f:`json`,...this.customParameters},signal:e}),{area:i=null,sensorPoints:a=null,telemetry:o=null}=r,s={area:null,path:null};if(i?.rings?.length&&(s.area=g.fromJSON(i)),a?.points?.length){let e=a.points;s.path=new _({hasM:a.hasM??!0,hasZ:a.hasZ??!0,paths:[e],spatialReference:v.fromJSON(a.spatialReference)})}if(o?.start){let{frameCenter:e=null,frameOutline:t=null,sensor:n=null}=o?.start||{};if(t&&(this.telemetry.frameOutline=g.fromJSON(t)),n&&(this.telemetry.sensorLocation=h.fromJSON(n)),e&&(this.telemetry.frameCenter=h.fromJSON(e)),n&&e){let{sensorLocation:e,frameCenter:t}=this.telemetry;this.telemetry.lineOfSight=P(e,t)}}this._set(`coverage`,s)}async _fetchPreviewsInfo(e){if(typeof this.layerId!=`number`||!this.capabilities?.operations?.supportsPreviews)return;let t=`${this.parsedUrl.path}/content/preview/preview.json`,{data:r}=await n(t,{query:{f:`json`},signal:e});if(!r?.preview)return;let{frameCount:i=0,frameInterval:a=0,frames:o=[],height:s,nCol:c,nRow:l,preview:u,width:d}=r||{},f={count:i,height:s,interval:a,numCols:c,numRows:l,thumbnailInfo:o,urlFragment:u,width:d};this.read({previewsInfo:f},{origin:`service`})}async _fetchService(e){if(this.sourceJSON){this.read(this.sourceJSON,{origin:`service`,url:this.parsedUrl});return}let{data:t,ssl:r}=await n(this.url,{query:{f:`json`,...this.parsedUrl.query,...this.customParameters},signal:e});if(r&&(this.url=this.url.replace(/^http:/i,`https:`)),!t?.currentVersion){t.currentVersion=`11.2`,this.sourceJSON=t,this.read(this.sourceJSON,{origin:`service`,url:this.parsedUrl});return}if(this.layerId??=t.layers?.[0]?.id??null,this.layerId==null)throw new i(`arcgis-layers:url-mismatch`,`The url is not a valid arcgis resource`);let{data:a}=await n(this.parsedUrl.path,{query:{f:`json`,...this.customParameters},signal:e});this.sourceJSON={...t,...a},this.read(this.sourceJSON,{origin:`service`,url:this.parsedUrl})}_setSensorRoute(e,t,n){let{spatialReference:r,hasZ:i,hasM:a,paths:o}=e,s=i?3:2,c=[],l=[];for(let e of o){let r=0,a=e.length;for(;r<a;){let t=Math.floor((r+a)/2);e[t][s]<=n?r=t+1:a=t}let o=e.slice(0,r),u=e.slice(r);if(r>0&&n<=e[e.length-1][s]){let a=e[r-1],c=a[s]===n,l=a.slice();if(!c){let t=e[r],i=(n-a[s])/(t[s]-a[s]);for(let e=0;e<s;e++)l[e]=a[e]+(t[e]-a[e])*i}t&&(l[0]=t.x,l[1]=t.y,i&&t.hasZ&&(l[2]=t.z)),l[s]=n,c?o[o.length-1]=l:o.push(l),u.length&&u.unshift(l.slice())}o.length&&c.push(o),u.length&&l.push(u)}this.telemetry.sensorTrail=new _({hasZ:i,hasM:a,paths:c,spatialReference:r}),this.telemetry.sensorPath=new _({hasZ:i,hasM:a,paths:l,spatialReference:r})}_setSensorTrail(e){if(!e)return;this._trailPoints=F(e,this._trailPoints,this.currentTime*1e3);let t=this._trailPoints.map(e=>e.toArray()),n=new _({hasZ:e.hasZ,hasM:!0,paths:[t],spatialReference:e.spatialReference});this.telemetry.sensorTrail=n.clone()}_updateSensorGeometry(e){let{telemetry:t,sensorLocation:n,path:r,currentTime:i,previous:a}=e;r?.hasM&&r.paths.some(e=>e.length>0)?this._setSensorRoute(r,n,i*1e3):(t.sensorPath=null,a?.path!==r&&(this._trailPoints=[],t.sensorTrail=null),(a?.sensorLocation!==n||a?.path!==r)&&this._setSensorTrail(n))}};e([f({type:Boolean,json:{write:{ignoreOrigin:!0}}})],$.prototype,`autoplay`,null),e([f({readOnly:!0})],$.prototype,`buffered`,null),e([f({readOnly:!0})],$.prototype,`cameraInfo`,void 0),e([f({readOnly:!0,json:{read:!1}})],$.prototype,`capabilities`,void 0),e([H(`service`,`capabilities`,[`supportsAppend`,`supportsCoverageQuery`,`supportsExportClip`,`supportsExportFrameset`,`supportsMensuration`,`supportsPreviews`,`supportsUpdate`])],$.prototype,`readCapabilitiesFromService`,null),e([f({readOnly:!0})],$.prototype,`codecs`,void 0),e([f({readOnly:!0})],$.prototype,`connectionInfo`,void 0),e([H(`connectionInfo`,[`connectionUrl`])],$.prototype,`readConnectionInfo`,null),e([f()],$.prototype,`controller`,void 0),e([f({type:String})],$.prototype,`copyright`,void 0),e([f({readOnly:!0})],$.prototype,`coverage`,void 0),e([f({readOnly:!0,type:Date})],$.prototype,`created`,void 0),e([f({type:Number})],$.prototype,`currentTime`,null),e([f({json:{write:!1}})],$.prototype,`customParameters`,void 0),e([f({type:String})],$.prototype,`description`,void 0),e([f({type:Number})],$.prototype,`duration`,null),e([f({readOnly:!0})],$.prototype,`elevationSource`,void 0),e([f({type:Boolean})],$.prototype,`ended`,null),e([f({type:fe})],$.prototype,`frame`,void 0),e([f(Q(`drawingInfo.frameCenterSymbol`,V))],$.prototype,`frameCenterSymbol`,void 0),e([f({readOnly:!0,type:p})],$.prototype,`frameCount`,void 0),e([f(y)],$.prototype,`frameEffect`,void 0),e([f(T)],$.prototype,`frameOpacity`,void 0),e([f(Q(`drawingInfo.frameOutlineSymbol`,z))],$.prototype,`frameOutlineSymbol`,void 0),e([f({type:m})],$.prototype,`fullExtent`,void 0),e([f({readOnly:!0})],$.prototype,`frameHorizonPoints`,null),e([f({readOnly:!0,json:{read:{reader:I,source:`time`}},type:D})],$.prototype,`fullTimeExtent`,void 0),e([f({readOnly:!0})],$.prototype,`groundControlPoints`,null),e([f(oe)],$.prototype,`id`,void 0),e([f({type:m})],$.prototype,`initialExtent`,void 0),e([f({readOnly:!0})],$.prototype,`isLive`,null),e([f({type:p,json:{read:!1,origins:{service:{read:{source:`id`}}}}})],$.prototype,`layerId`,void 0),e([f({readOnly:!0})],$.prototype,`livestreamStatus`,null),e([f({type:Boolean,json:{write:{ignoreOrigin:!0}}})],$.prototype,`loop`,null),e([f({readOnly:!0})],$.prototype,`metadata`,null),e([f({readOnly:!0})],$.prototype,`mimeType`,null),e([f({type:Boolean,json:{write:{ignoreOrigin:!0}}})],$.prototype,`muted`,null),e([f({readOnly:!0})],$.prototype,`previewsInfo`,void 0),e([f({type:[`ArcGISVideoLayer`]})],$.prototype,`operationalLayerType`,void 0),e([f({readOnly:!0})],$.prototype,`parsedUrl`,null),e([f({type:le})],$.prototype,`playbackInfo`,void 0),e([f({type:Number,json:{write:{ignoreOrigin:!0}}})],$.prototype,`playbackRate`,null),e([f({readOnly:!0,type:String})],$.prototype,`playerUrl`,null),e([f({readOnly:!0})],$.prototype,`playing`,null),e([f({readOnly:!0,json:{read:{source:`poster`}}})],$.prototype,`posterUrl`,void 0),e([f({readOnly:!0})],$.prototype,`qualities`,void 0),e([f()],$.prototype,`sensorSymbolOrientation`,void 0),e([f(Q(`drawingInfo.sensorPathSymbol`,B))],$.prototype,`sensorPathSymbol`,void 0),e([f(ge)],$.prototype,`sensorSymbol`,void 0),e([f(Q(`drawingInfo.sensorSightLineSymbol`,B))],$.prototype,`sensorSightLineSymbol`,void 0),e([f(Q(`drawingInfo.sensorTrailSymbol`,B))],$.prototype,`sensorTrailSymbol`,void 0),e([f({readOnly:!0})],$.prototype,`serviceItemId`,void 0),e([f()],$.prototype,`sourceJSON`,void 0),e([f({readOnly:!0})],$.prototype,`sourceQuality`,void 0),e([f({readOnly:!0,json:{name:`serviceType`}})],$.prototype,`sourceType`,void 0),e([f({type:v})],$.prototype,`spatialReference`,void 0),e([f({json:{write:!0}})],$.prototype,`start`,void 0),e([f({readOnly:!0})],$.prototype,`started`,null),e([f({readOnly:!0,type:String})],$.prototype,`state`,null),e([f({readOnly:!0,type:de})],$.prototype,`telemetry`,null),e([f({type:E,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],$.prototype,`telemetryDisplay`,void 0),e([H(`service`,`title`,[`name`])],$.prototype,`readTitleFromService`,null),e([H(`portal-item`,`title`)],$.prototype,`readTitleFromPortalItem`,null),e([f({type:String})],$.prototype,`sublayerTitleMode`,void 0),e([f({readOnly:!0})],$.prototype,`type`,void 0),e([f(ce())],$.prototype,`url`,void 0),e([f({readOnly:!0,type:Number,json:{read:{source:`currentVersion`}}})],$.prototype,`version`,void 0),e([f({readOnly:!0})],$.prototype,`videoElement`,null),e([f({readOnly:!0})],$.prototype,`videoHeight`,null),e([f({readOnly:!0,json:{read:!1}})],$.prototype,`videoLayersInfo`,void 0),e([H(`service`,`videoLayersInfo`,[`id`,`name`,`poster`,`serviceType`,`type`])],$.prototype,`readLayerInfosFromService`,null),e([f({type:D,readOnly:!0})],$.prototype,`videoTimeExtent`,null),e([f({readOnly:!0})],$.prototype,`videoWidth`,null),e([f()],$.prototype,`volume`,null),e([f({readOnly:!0})],$.prototype,`waiting`,null),$=e([ee(`esri.layers.VideoLayer`)],$);const _e=$;export{_e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import has from"../core/has.js";import n from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{convertTime as o}from"../core/timeUtils.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import{distance as l}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderSRFromViewSR as d}from"../geometry/support/coordinateSystem.js";import{loadVoxelWASM as f}from"../libs/vxl/VxlModule.js";import{InternalRenderCategory as p}from"../views/3d/webgl.js";import{VoxelGraphic as m}from"../views/3d/layers/VoxelGraphic.js";import{VoxelTarget as h}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as g}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as _}from"../views/3d/support/RenderCoordsHelper.js";import v from"../views/3d/webgl/RenderNode.js";import{IntersectorResultRay as y}from"../views/3d/webgl-engine/lib/IntersectorResult.js";let b=class extends v{constructor(e){super(e),this._havePreparedWithAllLayers=!1,this.consumes={required:[p.VOXEL]},this.produces=`disabled`,this._vxlPromise=null,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.type=9,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerViewUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(e===4?n.getLogger(this).error(t):n.getLogger(this).warn(t))}initialize(){this._dbg(1,`--initialize--`);for(let e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([i(()=>this.view.viewingMode===`local`,e=>{e?(this._dbg(1,`view switched to local view, enabling rendering`),this.produces=p.VOXEL,this.view.sceneIntersectionHelper.addIntersectionHandler(this)):(this._dbg(1,`view switched to global view, disabling rendering`),this.view.sceneIntersectionHelper.removeIntersectionHandler(this),this.produces=`disabled`)},a),i(()=>this.view?.qualityProfile,e=>{this._dbg(3,`qualityProfile changed to `+e),this._vxl?.set_quality(this._toWasmQuality(e))},a),i(()=>this.view?.timeExtent,()=>{if(this._vxl){let e=this._getTimeArgs(this.view?.timeExtent);this._dbg(3,`sceneView timeExtent changed to useTime=`+e.hasTime+` st=`+e.startTime+` et=`+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.hasTime),this.requestRender(1)}},a),i(()=>this.view?.stationary,e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this.requestRender(1)})])}get _rctx(){return this.renderContext?.rctx}get _halfIntTexturesAvailable(){return!!this._rctx?.capabilities.textureNorm16}get _textureFloatLinearAvailable(){return!!this._rctx?.capabilities.textureFloatLinear}_restoreFramebuffer(){if(!this._renderTargetToRestore||!this._rctx)return;let e=this._renderTargetToRestore.fbo;if(!this._rctx){this._dbg(4,`no context in restoreFramebuffer!`);return}this._rctx.bindFramebuffer(e,!0);let t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){if(!this._rctx||!this._renderTargetToRestore)return 0;let n=this._renderTargetToRestore.fbo?.depthStencilTexture;return n?(t===0?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(n,e,!0),1):(this._dbg(4,`no depth/stencil texture exists!`),0)}_modifyResourceCount(e,t,n){if(!this._rctx){this._dbg(4,`modifyAllocation callback has no rendering context!`);return}let r=e;n===1?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,n,r){this._rctx?(this._rctx.setBlendingEnabled(e===1),this._rctx.setBlendFunction(t,n),this._rctx.setBlendEquation(r)):this._dbg(4,`setBlendState callback has no rendering context!`)}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(4,`setFrontFace callback has no rendering context!`)}_setDepthStencilStateFunction(e,t,n){this._rctx?(this._rctx.setDepthFunction(n),this._rctx.setDepthTestEnabled(e===1),this._rctx.setDepthWriteEnabled(t===1),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(519,0,255),this._rctx.setStencilOpSeparate(1028,7680,7682,7680),this._rctx.setStencilOpSeparate(1029,7680,7683,7680)):this._dbg(4,`setDepthStencilStateFunction callback has no rendering context!`)}_setRasterizerState(e){if(!this._rctx)this._dbg(4,`setRasterizerState callback has no rendering context!`);else switch(e){case 1:this._rctx.setFaceCullingEnabled(!1);break;case 3:this._rctx.setCullFace(1029),this._rctx.setFaceCullingEnabled(!0);break;case 2:this._rctx.setCullFace(1028),this._rctx.setFaceCullingEnabled(!0)}}_setViewport(e,t,n,r){this._rctx?this._rctx.setViewport(e,t,n,r):this._dbg(4,`setViewport callback has no rendering context!`)}_updateMemoryUsage(){this._layers.forEach((e,t)=>{if(e.needMemoryUsageUpdate){let n=this._vxl?.estimate_memory_usage(t)??0;n>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(n))}})}_syncRequestsResponses(){this._vxl&&this._layers.forEach((e,n)=>{let i=[];e.responses.forEach((t,r)=>{i.push(r),this._dbg(2,`responding for requestID:`+r+` size:`+t.size),this._vxl?.respond(n,r,t),(t.requestType===0||t.requestType===4)&&(e.needMemoryUsageUpdate=!0)});let a=e.responses;for(let e of i)a.delete(e);let o=this._vxl.get_new_requests(n),s=e.abortController.signal;for(let n in o){e.outstandingRequestCount+=1,e.outstandingRequestCount===1&&e.layerView.updatingFlagChanged();let i=o[n],c={responseType:`array-buffer`,signal:s,query:{...e.layerView.layer.customParameters,token:e.layerView.layer.apiKey}};this._dbg(2,`making requestID:`+n+` url:`+i.url),t(i.url,c).then(t=>{--e.outstandingRequestCount,e.outstandingRequestCount===0&&e.layerView.updatingFlagChanged(),this._dbg(2,`have response for requestID:`+n);let r=0;if(t.data.byteLength>0&&this._vxl){r=this._vxl._malloc(t.data.byteLength);let e=new Uint8Array(this._vxl.HEAPU8.buffer,r,t.data.byteLength),n=new Uint8Array(t.data);for(let r=0;r<t.data.byteLength;++r)e[r]=n[r]}a.set(+n,{responseType:i.responseType,ptr:r,size:t.data.byteLength,success:!0,requestType:i.requestType})}).catch(t=>{--e.outstandingRequestCount,e.outstandingRequestCount===0&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(4,`requestID:${n} failed, error=${t.toString()}`),a.set(+n,{responseType:i.responseType,ptr:0,size:0,success:!1,requestType:i.requestType}))})}})}updateWasmCamera(e){this._vxl?.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl?.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl?.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;let t=this._layers.get(e);return t?t.outstandingRequestCount>0:!1}getLayerTimes(e){let t=[];return this._vxl&&this._layers.forEach((n,r)=>{if(n.layerView.wasmLayerId===e.wasmLayerId){let n=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let e=0;e<n.length;++e)t.push(n[e])}}),t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach((n,r)=>{n.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl?.get_layer_current_time_id(r)??0)}),t}setEnabled(e,t){this._layers.forEach((n,r)=>{n.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl?.set_enabled(r,t),n.needMemoryUsageUpdate=!0,this.requestRender(1))})}setIsInScaleRange(e,t){let n=this._layers.get(e.wasmLayerId);n&&t!==n.isInScaleRange&&(n.isInScaleRange=t,this._vxl?.set_is_in_scale_range(e.wasmLayerId,t),n.needMemoryUsageUpdate=!t,this.requestRender(1))}setStaticSections(e,t){let n={mask:1,staticSections:t};return this._doMaskedUIUpdate(e,n,!0)}setCurrentVariable(e,t){let n={mask:1024,currentVariable:t};return this._doMaskedUIUpdate(e,n,!0)}setRenderMode(e,t){let n={mask:8192,renderMode:t};return this._doMaskedUIUpdate(e,n,!0)}setVerticalExaggerationAndOffset(e,t,n,r){let i={mask:256,volStyleDesc:{volumeId:t,verticalExaggeration:n,verticalOffset:r}};return this._doMaskedUIUpdate(e,i,!0)}setVariableStyles(e,t){let n={mask:32768,variableStyles:t};return this._doMaskedUIUpdate(e,n,!0)}setVolumeStyles(e,t){let n={mask:65536,volumeStyles:t};return this._doMaskedUIUpdate(e,n,!0)}setEnableDynamicSections(e,t){let n={mask:4096,containerIsVisible:t,container:1};return this._doMaskedUIUpdate(e,n,!0)}setEnableIsosurfaces(e,t){let n={mask:4096,containerIsVisible:t,container:0};return this._doMaskedUIUpdate(e,n,!0)}setEnableSections(e,t){let n={mask:4096,containerIsVisible:t,container:2};return this._doMaskedUIUpdate(e,n,!0)}setAnalysisSlice(e,t,n,r){let i={mask:131072,analysisSlice:{point:n,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,i,!0)}updateLayerTimeProperties(e){if(!this._vxl)return;let t=this._layers.get(e.wasmLayerId);if(t){let n=t.layerView.layer,r=0;n.timeOffset&&(r=o(n.timeOffset.value,n.timeOffset.unit,`seconds`));let i=this._getTimeArgs(n.timeExtent);this._vxl?.set_layer_time_properties(e.wasmLayerId,i.startTime,i.endTime,i.hasTime,n.useViewTime,r),this.requestRender(1)}}_doMaskedUIUpdate(e,t,n){if(!this._vxl)return!1;let r=!1;return this._layers.forEach((n,i)=>{if(n.layerView.wasmLayerId===e.wasmLayerId){let e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(r=this._vxl?.handle_masked_ui_update(i,e.ptr,e.byteCount)===1,e.isReusable||this._vxl?._free(e.ptr))}}),r&&n&&this.requestRender(1),r}_addTriangleToWasmBuffer(e,t,n,r,i){return e[t*3]=n[0],e[t*3+1]=n[1],e[t*3+2]=n[2],t+=1,e[t*3]=r[0],e[t*3+1]=r[1],e[t*3+2]=r[2],t+=1,e[t*3]=i[0],e[t*3+1]=i[1],e[t*3+2]=i[2],t+=1,t}_addNormalToWasmBuffer(e,t,n){return e[t*3]=n[0],e[t*3+1]=n[1],e[t*3+2]=n[2],t+=1,t}_doCaptureFrustum(){if(!this._vxl)return;let e=this._vxl._malloc(108*Float32Array.BYTES_PER_ELEMENT),t=new Float32Array(this._vxl.HEAPF32.buffer,e,108),n=this._vxl._malloc(36*Float32Array.BYTES_PER_ELEMENT),r=new Float32Array(this._vxl.HEAPF32.buffer,n,36),i=this._frustum.points[0],a=this._frustum.points[1],o=this._frustum.points[2],s=this._frustum.points[3],c=this._frustum.points[4],l=this._frustum.points[5],u=this._frustum.points[6],d=this._frustum.points[7],f=0,p=0,m=this._frustum.planes[4];f=this._addTriangleToWasmBuffer(t,f,o,a,i),p=this._addNormalToWasmBuffer(r,p,m),f=this._addTriangleToWasmBuffer(t,f,i,s,o),p=this._addNormalToWasmBuffer(r,p,m);let h=this._frustum.planes[5];f=this._addTriangleToWasmBuffer(t,f,c,l,u),p=this._addNormalToWasmBuffer(r,p,h),f=this._addTriangleToWasmBuffer(t,f,u,d,c),p=this._addNormalToWasmBuffer(r,p,h);let g=this._frustum.planes[3];f=this._addTriangleToWasmBuffer(t,f,u,o,s),p=this._addNormalToWasmBuffer(r,p,g),f=this._addTriangleToWasmBuffer(t,f,s,d,u),p=this._addNormalToWasmBuffer(r,p,g);let _=this._frustum.planes[2];f=this._addTriangleToWasmBuffer(t,f,i,a,l),p=this._addNormalToWasmBuffer(r,p,_),f=this._addTriangleToWasmBuffer(t,f,l,c,i),p=this._addNormalToWasmBuffer(r,p,_);let v=this._frustum.planes[0];f=this._addTriangleToWasmBuffer(t,f,s,i,c),p=this._addNormalToWasmBuffer(r,p,v),f=this._addTriangleToWasmBuffer(t,f,c,d,s),p=this._addNormalToWasmBuffer(r,p,v);let y=this._frustum.planes[1];f=this._addTriangleToWasmBuffer(t,f,o,u,l),p=this._addNormalToWasmBuffer(r,p,y),this._addTriangleToWasmBuffer(t,f,l,a,o),this._addNormalToWasmBuffer(r,p,y),this._frustumRenderableId!==-1&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(e,108,n,36,255,0,0,64),this._vxl._free(e),this._vxl._free(n),this._captureFrustum=!1,this.requestRender(1)}captureFrustum(){this._renderCoordsHelper===null&&(this._renderCoordsHelper=_.create(2,d(!1,this.view.spatialReference))),this._frustum===null&&(this._frustum=new g(this._renderCoordsHelper)),this._captureFrustum=!0,this.requestRender(1)}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach((t,n)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl?.toggle_full_volume_extent_draw(n),this.requestRender(1))})}dropQueryRenderTarget(){this._vxl?.drop_query_rt()}addVoxelLayer(e){if(!this._vxl){let t={layerView:e,resolveCallback:null,rejectCallback:null},n=new Promise((e,n)=>{t.resolveCallback=e,t.rejectCallback=n});return this._newLayers.push(t),n}let t=this._addVoxelLayer(e,this._vxl);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){let t=this._newLayers.findIndex(t=>e.uid===t.layerView.uid);t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));let n=this._newLayers.length;return n===0&&(this._dbg(1,`No voxel layers left after removing a layer, destroying render node`),this.destroy()),n}let t=-1;this._layers.forEach((n,r)=>{if(n.layerView.wasmLayerId===e.wasmLayerId){t=r,n.abortController.abort(),this._vxl?.remove_layer(t);let i=this.layerViewUid.indexOf(e.uid);i!==-1&&this.layerViewUid.splice(i,1)}}),t>=0&&this._layers.delete(t);let n=this._layers.size;return n===0&&(this._dbg(1,`No voxel layers left after removing a layer, destroying render node`),this.destroy()),n}_getBlockSize(e){for(let t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){if(!this._vxl)return!1;e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;let t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),e.ptr===0&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),e.ptr!==0&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,n=Number.MAX_VALUE,r=!1;return e!=null&&(e.isAllTime?r=!0:(e.start!=null&&(r=!0,t=e.start.getTime()/1e3),e.end!=null&&(r=!0,n=e.end.getTime()/1e3))),{startTime:t,endTime:n,hasTime:r}}_addVoxelLayer(e,t){let r=e.layer,i=-1,a=r.getConfiguration();if(a.length<1)return-1;let s={str:a,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(s))return-1;let c=this._getTimeArgs(r.timeExtent),l=this.view.spatialReference.isWGS84&&r.spatialReference.isWGS84?111319.49079327357:1,u=0;if(r.timeOffset&&(u=o(r.timeOffset.value,r.timeOffset.unit,`seconds`)),i=t.add_layer(r.serviceRoot,s.ptr,s.byteCount,l,l,c.startTime,c.endTime,c.hasTime,r.useViewTime,u,this._toWasmQuality(this.view.qualityProfile)),s.isReusable||t._free(s.ptr),i>=0){r.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));let t=new AbortController;if(this._layers.set(i,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:t,needMemoryUsageUpdate:!1,isInScaleRange:!0}),this.layerViewUid.push(e.uid),!this._halfIntTexturesAvailable||has(`mac`)){let t=[],r=``;for(let n of e.layer.variables)(n.renderingFormat.type===`Int16`||n.renderingFormat.type===`UInt16`)&&(t.push(n.name),n.id===e.layer.currentVariableId&&(r=n.name));r!==``&&n.getLogger(this).error(`#addVoxelLayer_error()`,e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&n.getLogger(this).warn(`#addVoxelLayer_warning()`,e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){let t=[],r=``;for(let n of e.layer.variables)n.renderingFormat.type===`Float32`&&(t.push(n.name),n.id===e.layer.currentVariableId&&(r=n.name));r!==``&&n.getLogger(this).error(`#addVoxelLayer_error()`,e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&n.getLogger(this).warn(`#addVoxelLayer_warning()`,e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has(`esri-mobile`)&&n.getLogger(this).warnOnce(`Mobile support differs across devices. Voxel layer might not display as expected.`),i}return-1}_prepareRender(){if(!this._vxl){this._initializeWasm();return}let e=this.bindParameters.camera.viewForward,t=this.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(t[0],t[1],t[2],e[0],e[1],e[2]);let n=this._vxl.cull();this._dbg(2,`missingResourceCount=`+n),this._moreToLoad=n>0,this._havePreparedWithAllLayers=this._newLayers.length===0,this._updateMemoryUsage()}render(){this._prepareRender();let e=this.bindRenderTarget();if(!this._vxl||!this._rctx)return this.requestRender(1),e;for(let e of this._newLayers){let t=this._addVoxelLayer(e.layerView,this._vxl);t===-1?e.rejectCallback(-1):e.resolveCallback(t)}if(this._newLayers=[],this._layers.size===0)return this._dbg(4,`No voxel layers but RenderNode is being asked to render!`),e;this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(this._rctx),this._vxl.begin_color_frame(!this.view.stage.renderer.isFeatureEnabled(1),this.bindParameters.lighting.mainLight.direction[0],this.bindParameters.lighting.mainLight.direction[1],this.bindParameters.lighting.mainLight.direction[2]);let t=this._renderTargetToRestore.viewport;return(t.width!==this._viewportWidth||t.height!==this._viewportHeight)&&(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach(e=>e.needMemoryUsageUpdate=!0)),(t.x!==0||t.y!==0)&&this._dbg(4,`Unsupported viewport parameters detected!`),this.updateWasmCamera(this.bindParameters.camera),this._captureFrustum&&(this._frustum.update(this.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(this._rctx,this._vxl),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this.requestRender(1),e}destroy(){this._dbg(1,`--destroy--`),this._vxl&&=(this._layers.forEach(e=>{e.abortController.abort()}),this._wasmMemBlocks.forEach(e=>{e!==0&&this._vxl?._free(e)}),this._vxl.uninitialize_voxel_wasm(),null)}_initializeWasm(){if(this._vxl||this._vxlPromise||!this._rctx?.gl)return;let e=this._rctx.gl;this._vxlPromise=f(e).then(t=>{let n=t.specialHTMLTargets;if(n.jsAPI3DRenderingContext=e,this._vxl=t,this._vxlPromise=null,this._newLayers.length<=0){this._dbg(1,` no voxel layers left after WASM downloaded, removing RenderNode and destroying`),this.destroy();return}let r=this._getTimeArgs(this.view?.timeExtent),i=this._vxl.addFunction(this._restoreFramebuffer.bind(this),`v`),a=this._vxl.addFunction(this._setBlendState.bind(this),`viiii`),o=this._vxl.addFunction(this._setFrontFace.bind(this),`vi`),s=this._vxl.addFunction(this._setRasterizerState.bind(this),`vi`),c=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),`viii`),l=this._vxl.addFunction(this._setViewport.bind(this),`viiii`),u=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),`iii`),d=this._vxl.addFunction(this._modifyResourceCount.bind(this),`viii`),f=this._halfIntTexturesAvailable&&!has(`mac`),p=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(i,a,o,s,c,l,u,d,r.startTime,r.endTime,r.hasTime,f,p),this.requestRender(1)}).catch(()=>{for(let e of this._newLayers)e.rejectCallback(-2);this._dbg(4,` WASM failed to download, destroying render node`),this.destroy()})}pickDepth(e,t,n){if(!this._vxl||!this._rctx||this._layers.size===0)return null;let r=n.viewport[3]-t;if(e<0||e>n.viewport[2]||t<0||t>n.viewport[3])return this._dbg(4,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw(this._rctx);let i=n.viewForward,a=n.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],i[0],i[1],i[2]),this.updateWasmCamera(n),this._vxl.begin_frame();let o=this._vxl.pick_depth(e,r);return this._afterDraw(this._rctx,this._vxl),o.success?o.distanceToCamera:null}pickObject(e,t,n,r){if(!this._vxl||!this._rctx||this._layers.size===0)return null;let i=Math.round(e),a=Math.round(t);if(i<0||i>n.viewport[2]||a<0||a>n.viewport[3])return this._dbg(4,`[js] pickObject: outOfRange, screenXY=[${i}, ${a}], vp=[${n.viewport.toString()}]`),null;this._beforeDraw(this._rctx);let o=n.viewForward,s=n.eye;this._vxl.update_camera_pos_and_direction(s[0],s[1],s[2],o[0],o[1],o[2]),this.updateWasmCamera(n),this._vxl.begin_frame();let c=null;if(r.length===0)c=this._vxl.pick_object(i,a,0,0);else{let e={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(c=this._vxl.pick_object(i,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(this._rctx,this._vxl),c}async getOtherFieldPopupValues(e,n){if(!this._vxl)return[];for(let r of e){let e=r.gpuResult;if(!e)continue;let i=this._layers.get(e.layerId);if(!i||!i.layerView.layer.url)continue;let a=i.layerView.layer,o={responseType:`array-buffer`,signal:i.abortController.signal,query:{...i.layerView.layer.customParameters,token:i.layerView.layer.apiKey}},s=e.voxelSpacePosition,c=[Math.floor(s[0]/32),Math.floor(s[1]/32),Math.floor(s[2]/32)],l=[c[0]&-4,c[1]&-4,c[2]&-4],u=0;if(e.epochTime){let t=this._vxl.get_layer_epoch_times(i.layerView.wasmLayerId,a.currentVariableId);for(let n=0;n<t.length;++n)if(t[n]===e.epochTime/1e3){u=n;break}}let d=[],f={varIds:[],ptrs:[],sizes:[]};for(let e of n){let n=a.variables.findIndex(t=>t.name===e);if(n===-1)continue;let r=a.variables.getItemAt(n)?.id;if(r==null)continue;let i=`${a.url}/variables/${r}/${u}/bundles/0/${l[0]}-${l[1]}-${l[2]}`;d.push(t(i,o).then(e=>e.data)),f.varIds.push(r)}let p=await Promise.allSettled(d),m=p.length;for(let e=0;e<m;++e){let t=p[e];if(t.status===`fulfilled`){let e=t.value,n=this._vxl._malloc(e.byteLength);new Uint8Array(this._vxl.HEAPU8.buffer,n,e.byteLength).set(new Uint8Array(e)),f.ptrs.push(n),f.sizes.push(e.byteLength)}else f.varIds.splice(e,1)}let h=this._vxl.get_other_field_popup_values(e,f);for(let e=0;e<f.ptrs.length;++e)this._vxl._free(f.ptrs[e]);if(h.continuousValues)for(let e in h.continuousValues)r.attributes[e]=h.continuousValues[e];if(h.uniqueValues)for(let e in h.uniqueValues)r.attributes[e]=h.uniqueValues[e]}return e}_beforeDraw(e){this._renderTargetToRestore={fbo:e.boundFramebuffer,viewport:e.getViewport()},e.setPolygonOffsetFillEnabled(!1),e.setScissorTestEnabled(!1),e.setColorMask(!0,!0,!0,!0)}_afterDraw(e,t){this._renderTargetToRestore.fbo=null,e.externalTextureUnitUpdate(t.get_texture_units_bound_in_frame(),t.get_active_texture_unit()),e.externalVertexArrayObjectUpdate(),e.externalVertexBufferUpdate(),e.externalProgramUpdate()}intersectRay(e,t,n,r,i){if(!this._vxl||!this._rctx||this._layers.size===0||!e.options.selectionMode||e.options.isFiltered||!e.camera)return;if(i==null||i[0]<0||i[0]>e.camera.viewport[2]||i[1]<0||i[1]>e.camera.viewport[3])return this._dbg(4,i?`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${i[0].toFixed(0)}, ${i[1].toFixed(0)}]`:`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=null`),null;let a=[];this._layers.forEach(t=>{e.options.filteredLayerViewUids.includes(t.layerView.uid)&&a.push(t.layerView.wasmLayerId)});let o=this.pickObject(i[0],i[1],e.camera,a);if(o==null||o.layerId===-1)return;let s=this._layers.get(o.layerId);if(s){let t=s.layerView.layer.uid,i=o.distanceToCamera/l(n,r),a=u();a[0]=o.worldX,a[1]=o.worldY,a[2]=o.worldZ;let c={},d=s.layerView.layer,f=d.variables.findIndex(e=>e.id===d.currentVariableId);if(f>=0){let e=d.variables.getItemAt(f);e!=null&&(o.continuousValue==null?o.uniqueValueLabel!=null&&o.uniqueValue!=null?c[e.name]=`${o.uniqueValueLabel} (${o.uniqueValue})`:o.uniqueValue!=null&&(c[e.name]=`${o.uniqueValue}`):c[e.name]=o.continuousValue,e.description.length>0?c[`Voxel.CurrentVariable`]=e.description:e.name?.length>0&&(c[`Voxel.CurrentVariable`]=e.name))}c[`Voxel.Position`]=`[${o.voxelSpacePosition.toString()}]`,o.epochTime!=null&&o.nativeTime!=null&&o.nativeTimeUnits!=null&&(c[`Voxel.LocalTime`]=new Date(o.epochTime),c[`Voxel.SourceTime`]=`${o.nativeTime.toLocaleString()} ${o.nativeTimeUnits}`),o.depth!=null&&(c[`Voxel.Depth`]=o.depth);let p=o.faceNormal;c[`Voxel.WorldPosition`]=`[${a[0]}, ${a[1]}, ${a[2]}]`;let m=e=>{let n=new h(a,t,()=>this._createVoxelGraphic(s.layerView.layer,c,o));e.set(this.type,n,i,i,p)},g=e.results,_=e.options.store===2;if((g.min.renderDistance==null||i<g.min.renderDistance)&&m(g.min),(g.max.renderDistance==null||i>g.max.renderDistance)&&m(g.max),_){let t=new y(e.ray);m(t),e.results.all.push(t)}}}_createVoxelGraphic(e,t,n){return new m({layer:e,sourceLayer:e,origin:e.graphicOrigin,attributes:t,gpuResult:n})}_toWasmQuality(e){switch(e){case`low`:return 0;case`medium`:return 1;case`high`:return 2}}_setUpscalingLimits(e,t,n){this._vxl&&this._vxl.set_upscaling_limits(e,t,n)}};e([s()],b.prototype,`consumes`,void 0),e([s()],b.prototype,`produces`,void 0),b=e([c(`esri.layers.VoxelWasmPerSceneView`)],b);const x=b;export{x as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import has from"../core/has.js";import n from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{convertTime as o}from"../core/timeUtils.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import{distance as l}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderSRFromViewSR as d}from"../geometry/support/coordinateSystem.js";import{loadVoxelWASM as f}from"../libs/vxl/VxlModule.js";import{InternalRenderCategory as p}from"../views/3d/webgl.js";import{VoxelGraphic as m}from"../views/3d/layers/VoxelGraphic.js";import{VoxelTarget as h}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as g}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as _}from"../views/3d/support/RenderCoordsHelper.js";import v from"../views/3d/webgl/RenderNode.js";import{IntersectorResultRay as y}from"../views/3d/webgl-engine/lib/IntersectorResult.js";let b=class extends v{constructor(e){super(e),this._havePreparedWithAllLayers=!1,this.consumes={required:[p.VOXEL]},this.produces=`disabled`,this._vxlPromise=null,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustumRenderableId=-1,this.type=9,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerViewUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(e===4?n.getLogger(this).error(t):n.getLogger(this).warn(t))}initialize(){this._dbg(1,`--initialize--`);for(let e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([i(()=>this.view.viewingMode===`local`,e=>{e?(this._dbg(1,`view switched to local view, enabling rendering`),this.produces=p.VOXEL,this.view.sceneIntersectionHelper.addIntersectionHandler(this)):(this._dbg(1,`view switched to global view, disabling rendering`),this.view.sceneIntersectionHelper.removeIntersectionHandler(this),this.produces=`disabled`)},a),i(()=>this.view?.qualityProfile,e=>{this._dbg(3,`qualityProfile changed to `+e),this._vxl?.set_quality(this._toWasmQuality(e))},a),i(()=>this.view?.timeExtent,()=>{if(this._vxl){let e=this._getTimeArgs(this.view?.timeExtent);this._dbg(3,`sceneView timeExtent changed to useTime=`+e.hasTime+` st=`+e.startTime+` et=`+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.hasTime),this.requestRender(1)}},a),i(()=>this.view?.stationary,e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this.requestRender(1)})])}get _rctx(){return this.renderContext?.rctx}get _halfIntTexturesAvailable(){return!!this._rctx?.capabilities.textureNorm16}get _textureFloatLinearAvailable(){return!!this._rctx?.capabilities.textureFloatLinear}_restoreFramebuffer(){if(!this._renderTargetToRestore||!this._rctx)return;let e=this._renderTargetToRestore.fbo;if(!this._rctx){this._dbg(4,`no context in restoreFramebuffer!`);return}this._rctx.bindFramebuffer(e,!0);let t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){if(!this._rctx||!this._renderTargetToRestore)return 0;let n=this._renderTargetToRestore.fbo?.depthStencilTexture;return n?(t===0?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(n,e,!0),1):(this._dbg(4,`no depth/stencil texture exists!`),0)}_modifyResourceCount(e,t,n){if(!this._rctx){this._dbg(4,`modifyAllocation callback has no rendering context!`);return}let r=e;n===1?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,n,r){this._rctx?(this._rctx.setBlendingEnabled(e===1),this._rctx.setBlendFunction(t,n),this._rctx.setBlendEquation(r)):this._dbg(4,`setBlendState callback has no rendering context!`)}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(4,`setFrontFace callback has no rendering context!`)}_setDepthStencilStateFunction(e,t,n){this._rctx?(this._rctx.setDepthFunction(n),this._rctx.setDepthTestEnabled(e===1),this._rctx.setDepthWriteEnabled(t===1),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(519,0,255),this._rctx.setStencilOpSeparate(1028,7680,7682,7680),this._rctx.setStencilOpSeparate(1029,7680,7683,7680)):this._dbg(4,`setDepthStencilStateFunction callback has no rendering context!`)}_setRasterizerState(e){if(!this._rctx)this._dbg(4,`setRasterizerState callback has no rendering context!`);else switch(e){case 1:this._rctx.setFaceCullingEnabled(!1);break;case 3:this._rctx.setCullFace(1029),this._rctx.setFaceCullingEnabled(!0);break;case 2:this._rctx.setCullFace(1028),this._rctx.setFaceCullingEnabled(!0)}}_setViewport(e,t,n,r){this._rctx?this._rctx.setViewport(e,t,n,r):this._dbg(4,`setViewport callback has no rendering context!`)}_updateMemoryUsage(){this._layers.forEach((e,t)=>{if(e.needMemoryUsageUpdate){let n=this._vxl?.estimate_memory_usage(t)??0;n>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(n))}})}_syncRequestsResponses(){this._vxl&&this._layers.forEach((e,n)=>{let i=[];e.responses.forEach((t,r)=>{i.push(r),this._dbg(2,`responding for requestID:`+r+` size:`+t.size),this._vxl?.respond(n,r,t),(t.requestType===0||t.requestType===4)&&(e.needMemoryUsageUpdate=!0)});let a=e.responses;for(let e of i)a.delete(e);let o=this._vxl.get_new_requests(n),s=e.abortController.signal;for(let n in o){e.outstandingRequestCount+=1,e.outstandingRequestCount===1&&e.layerView.updatingFlagChanged();let i=o[n],c={responseType:`array-buffer`,signal:s,query:{...e.layerView.layer.customParameters,token:e.layerView.layer.apiKey}};this._dbg(2,`making requestID:`+n+` url:`+i.url),t(i.url,c).then(t=>{--e.outstandingRequestCount,e.outstandingRequestCount===0&&e.layerView.updatingFlagChanged(),this._dbg(2,`have response for requestID:`+n);let r=0;if(t.data.byteLength>0&&this._vxl){r=this._vxl._malloc(t.data.byteLength);let e=new Uint8Array(this._vxl.HEAPU8.buffer,r,t.data.byteLength),n=new Uint8Array(t.data);for(let r=0;r<t.data.byteLength;++r)e[r]=n[r]}a.set(+n,{responseType:i.responseType,ptr:r,size:t.data.byteLength,success:!0,requestType:i.requestType})}).catch(t=>{--e.outstandingRequestCount,e.outstandingRequestCount===0&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(4,`requestID:${n} failed, error=${t.toString()}`),a.set(+n,{responseType:i.responseType,ptr:0,size:0,success:!1,requestType:i.requestType}))})}})}updateWasmCamera(e){this._vxl?.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl?.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl?.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;let t=this._layers.get(e);return t?t.outstandingRequestCount>0:!1}getLayerTimes(e){let t=[];return this._vxl&&this._layers.forEach((n,r)=>{if(n.layerView.wasmLayerId===e.wasmLayerId){let n=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let e=0;e<n.length;++e)t.push(n[e])}}),t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach((n,r)=>{n.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl?.get_layer_current_time_id(r)??0)}),t}setEnabled(e,t){this._layers.forEach((n,r)=>{n.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl?.set_enabled(r,t),n.needMemoryUsageUpdate=!0,this.requestRender(1))})}setIsInScaleRange(e,t){let n=this._layers.get(e.wasmLayerId);n&&t!==n.isInScaleRange&&(n.isInScaleRange=t,this._vxl?.set_is_in_scale_range(e.wasmLayerId,t),n.needMemoryUsageUpdate=!t,this.requestRender(1))}setStaticSections(e,t){let n={mask:1,staticSections:t};return this._doMaskedUIUpdate(e,n,!0)}setCurrentVariable(e,t){let n={mask:1024,currentVariable:t};return this._doMaskedUIUpdate(e,n,!0)}setRenderMode(e,t){let n={mask:8192,renderMode:t};return this._doMaskedUIUpdate(e,n,!0)}setVerticalExaggerationAndOffset(e,t,n,r){let i={mask:256,volStyleDesc:{volumeId:t,verticalExaggeration:n,verticalOffset:r}};return this._doMaskedUIUpdate(e,i,!0)}setVariableStyles(e,t){let n={mask:32768,variableStyles:t};return this._doMaskedUIUpdate(e,n,!0)}setVolumeStyles(e,t){let n={mask:65536,volumeStyles:t};return this._doMaskedUIUpdate(e,n,!0)}setEnableDynamicSections(e,t){let n={mask:4096,containerIsVisible:t,container:1};return this._doMaskedUIUpdate(e,n,!0)}setEnableIsosurfaces(e,t){let n={mask:4096,containerIsVisible:t,container:0};return this._doMaskedUIUpdate(e,n,!0)}setEnableSections(e,t){let n={mask:4096,containerIsVisible:t,container:2};return this._doMaskedUIUpdate(e,n,!0)}setAnalysisSlice(e,t,n,r){let i={mask:131072,analysisSlice:{point:n,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,i,!0)}updateLayerTimeProperties(e){if(!this._vxl)return;let t=this._layers.get(e.wasmLayerId);if(t){let n=t.layerView.layer,r=0;n.timeOffset&&(r=o(n.timeOffset.value,n.timeOffset.unit,`seconds`));let i=this._getTimeArgs(n.timeExtent);this._vxl?.set_layer_time_properties(e.wasmLayerId,i.startTime,i.endTime,i.hasTime,n.useViewTime,r),this.requestRender(1)}}_doMaskedUIUpdate(e,t,n){if(!this._vxl)return!1;let r=!1;return this._layers.forEach((n,i)=>{if(n.layerView.wasmLayerId===e.wasmLayerId){let e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(r=this._vxl?.handle_masked_ui_update(i,e.ptr,e.byteCount)===1,e.isReusable||this._vxl?._free(e.ptr))}}),r&&n&&this.requestRender(1),r}_addTriangleToWasmBuffer(e,t,n,r,i){return e[t*3]=n[0],e[t*3+1]=n[1],e[t*3+2]=n[2],t+=1,e[t*3]=r[0],e[t*3+1]=r[1],e[t*3+2]=r[2],t+=1,e[t*3]=i[0],e[t*3+1]=i[1],e[t*3+2]=i[2],t+=1,t}_addNormalToWasmBuffer(e,t,n){return e[t*3]=n[0],e[t*3+1]=n[1],e[t*3+2]=n[2],t+=1,t}_doCaptureFrustum(e){if(!this._vxl)return;let t=this._vxl._malloc(108*Float32Array.BYTES_PER_ELEMENT),n=new Float32Array(this._vxl.HEAPF32.buffer,t,108),r=this._vxl._malloc(36*Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(this._vxl.HEAPF32.buffer,r,36),a=e.points[0],o=e.points[1],s=e.points[2],c=e.points[3],l=e.points[4],u=e.points[5],d=e.points[6],f=e.points[7],p=0,m=0,h=e.planes[4];p=this._addTriangleToWasmBuffer(n,p,s,o,a),m=this._addNormalToWasmBuffer(i,m,h),p=this._addTriangleToWasmBuffer(n,p,a,c,s),m=this._addNormalToWasmBuffer(i,m,h);let g=e.planes[5];p=this._addTriangleToWasmBuffer(n,p,l,u,d),m=this._addNormalToWasmBuffer(i,m,g),p=this._addTriangleToWasmBuffer(n,p,d,f,l),m=this._addNormalToWasmBuffer(i,m,g);let _=e.planes[3];p=this._addTriangleToWasmBuffer(n,p,d,s,c),m=this._addNormalToWasmBuffer(i,m,_),p=this._addTriangleToWasmBuffer(n,p,c,f,d),m=this._addNormalToWasmBuffer(i,m,_);let v=e.planes[2];p=this._addTriangleToWasmBuffer(n,p,a,o,u),m=this._addNormalToWasmBuffer(i,m,v),p=this._addTriangleToWasmBuffer(n,p,u,l,a),m=this._addNormalToWasmBuffer(i,m,v);let y=e.planes[0];p=this._addTriangleToWasmBuffer(n,p,c,a,l),m=this._addNormalToWasmBuffer(i,m,y),p=this._addTriangleToWasmBuffer(n,p,l,f,c),m=this._addNormalToWasmBuffer(i,m,y);let b=e.planes[1];p=this._addTriangleToWasmBuffer(n,p,s,d,u),m=this._addNormalToWasmBuffer(i,m,b),this._addTriangleToWasmBuffer(n,p,u,o,s),this._addNormalToWasmBuffer(i,m,b),this._frustumRenderableId!==-1&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(t,108,r,36,255,0,0,64),this._vxl._free(t),this._vxl._free(r),this._captureFrustum=!1,this.requestRender(1)}captureFrustum(){this._renderCoordsHelper??=new _({viewingMode:2,spatialReference:d(!1,this.view.spatialReference)}),this._frustum??=new g(this._renderCoordsHelper),this._captureFrustum=!0,this.requestRender(1)}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach((t,n)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl?.toggle_full_volume_extent_draw(n),this.requestRender(1))})}dropQueryRenderTarget(){this._vxl?.drop_query_rt()}addVoxelLayer(e){if(!this._vxl){let t={layerView:e,resolveCallback:null,rejectCallback:null},n=new Promise((e,n)=>{t.resolveCallback=e,t.rejectCallback=n});return this._newLayers.push(t),n}let t=this._addVoxelLayer(e,this._vxl);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){let t=this._newLayers.findIndex(t=>e.uid===t.layerView.uid);t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));let n=this._newLayers.length;return n===0&&(this._dbg(1,`No voxel layers left after removing a layer, destroying render node`),this.destroy()),n}let t=-1;this._layers.forEach((n,r)=>{if(n.layerView.wasmLayerId===e.wasmLayerId){t=r,n.abortController.abort(),this._vxl?.remove_layer(t);let i=this.layerViewUid.indexOf(e.uid);i!==-1&&this.layerViewUid.splice(i,1)}}),t>=0&&this._layers.delete(t);let n=this._layers.size;return n===0&&(this._dbg(1,`No voxel layers left after removing a layer, destroying render node`),this.destroy()),n}_getBlockSize(e){for(let t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){if(!this._vxl)return!1;e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;let t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),e.ptr===0&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),e.ptr!==0&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,n=Number.MAX_VALUE,r=!1;return e!=null&&(e.isAllTime?r=!0:(e.start!=null&&(r=!0,t=e.start.getTime()/1e3),e.end!=null&&(r=!0,n=e.end.getTime()/1e3))),{startTime:t,endTime:n,hasTime:r}}_addVoxelLayer(e,t){let r=e.layer,i=-1,a=r.getConfiguration();if(a.length<1)return-1;let s={str:a,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(s))return-1;let c=this._getTimeArgs(r.timeExtent),l=this.view.spatialReference.isWGS84&&r.spatialReference.isWGS84?111319.49079327357:1,u=0;if(r.timeOffset&&(u=o(r.timeOffset.value,r.timeOffset.unit,`seconds`)),i=t.add_layer(r.serviceRoot,s.ptr,s.byteCount,l,l,c.startTime,c.endTime,c.hasTime,r.useViewTime,u,this._toWasmQuality(this.view.qualityProfile)),s.isReusable||t._free(s.ptr),i>=0){r.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));let t=new AbortController;if(this._layers.set(i,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:t,needMemoryUsageUpdate:!1,isInScaleRange:!0}),this.layerViewUid.push(e.uid),!this._halfIntTexturesAvailable||has(`mac`)){let t=[],r=``;for(let n of e.layer.variables)(n.renderingFormat.type===`Int16`||n.renderingFormat.type===`UInt16`)&&(t.push(n.name),n.id===e.layer.currentVariableId&&(r=n.name));r!==``&&n.getLogger(this).error(`#addVoxelLayer_error()`,e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&n.getLogger(this).warn(`#addVoxelLayer_warning()`,e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){let t=[],r=``;for(let n of e.layer.variables)n.renderingFormat.type===`Float32`&&(t.push(n.name),n.id===e.layer.currentVariableId&&(r=n.name));r!==``&&n.getLogger(this).error(`#addVoxelLayer_error()`,e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&n.getLogger(this).warn(`#addVoxelLayer_warning()`,e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has(`esri-mobile`)&&n.getLogger(this).warnOnce(`Mobile support differs across devices. Voxel layer might not display as expected.`),i}return-1}_prepareRender(){if(!this._vxl){this._initializeWasm();return}let e=this.bindParameters.camera.viewForward,t=this.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(t[0],t[1],t[2],e[0],e[1],e[2]);let n=this._vxl.cull();this._dbg(2,`missingResourceCount=`+n),this._moreToLoad=n>0,this._havePreparedWithAllLayers=this._newLayers.length===0,this._updateMemoryUsage()}render(){this._prepareRender();let e=this.bindRenderTarget();if(!this._vxl||!this._rctx)return this.requestRender(1),e;for(let e of this._newLayers){let t=this._addVoxelLayer(e.layerView,this._vxl);t===-1?e.rejectCallback(-1):e.resolveCallback(t)}if(this._newLayers=[],this._layers.size===0)return this._dbg(4,`No voxel layers but RenderNode is being asked to render!`),e;this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(this._rctx),this._vxl.begin_color_frame(!this.view.stage.renderer.isFeatureEnabled(1),this.bindParameters.lighting.mainLight.direction[0],this.bindParameters.lighting.mainLight.direction[1],this.bindParameters.lighting.mainLight.direction[2]);let t=this._renderTargetToRestore.viewport;return(t.width!==this._viewportWidth||t.height!==this._viewportHeight)&&(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach(e=>e.needMemoryUsageUpdate=!0)),(t.x!==0||t.y!==0)&&this._dbg(4,`Unsupported viewport parameters detected!`),this.updateWasmCamera(this.bindParameters.camera),this._captureFrustum&&this._frustum&&(this._frustum.update(this.bindParameters.camera),this._doCaptureFrustum(this._frustum)),this._vxl.draw(),this._afterDraw(this._rctx,this._vxl),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this.requestRender(1),e}destroy(){this._dbg(1,`--destroy--`),this._vxl&&=(this._layers.forEach(e=>{e.abortController.abort()}),this._wasmMemBlocks.forEach(e=>{e!==0&&this._vxl?._free(e)}),this._vxl.uninitialize_voxel_wasm(),null)}_initializeWasm(){if(this._vxl||this._vxlPromise||!this._rctx?.gl)return;let e=this._rctx.gl;this._vxlPromise=f(e).then(t=>{let n=t.specialHTMLTargets;if(n.jsAPI3DRenderingContext=e,this._vxl=t,this._vxlPromise=null,this._newLayers.length<=0){this._dbg(1,` no voxel layers left after WASM downloaded, removing RenderNode and destroying`),this.destroy();return}let r=this._getTimeArgs(this.view?.timeExtent),i=this._vxl.addFunction(this._restoreFramebuffer.bind(this),`v`),a=this._vxl.addFunction(this._setBlendState.bind(this),`viiii`),o=this._vxl.addFunction(this._setFrontFace.bind(this),`vi`),s=this._vxl.addFunction(this._setRasterizerState.bind(this),`vi`),c=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),`viii`),l=this._vxl.addFunction(this._setViewport.bind(this),`viiii`),u=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),`iii`),d=this._vxl.addFunction(this._modifyResourceCount.bind(this),`viii`),f=this._halfIntTexturesAvailable&&!has(`mac`),p=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(i,a,o,s,c,l,u,d,r.startTime,r.endTime,r.hasTime,f,p),this.requestRender(1)}).catch(()=>{for(let e of this._newLayers)e.rejectCallback(-2);this._dbg(4,` WASM failed to download, destroying render node`),this.destroy()})}pickDepth(e,t,n){if(!this._vxl||!this._rctx||this._layers.size===0)return null;let r=n.viewport[3]-t;if(e<0||e>n.viewport[2]||t<0||t>n.viewport[3])return this._dbg(4,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw(this._rctx);let i=n.viewForward,a=n.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],i[0],i[1],i[2]),this.updateWasmCamera(n),this._vxl.begin_frame();let o=this._vxl.pick_depth(e,r);return this._afterDraw(this._rctx,this._vxl),o.success?o.distanceToCamera:null}pickObject(e,t,n,r){if(!this._vxl||!this._rctx||this._layers.size===0)return null;let i=Math.round(e),a=Math.round(t);if(i<0||i>n.viewport[2]||a<0||a>n.viewport[3])return this._dbg(4,`[js] pickObject: outOfRange, screenXY=[${i}, ${a}], vp=[${n.viewport.toString()}]`),null;this._beforeDraw(this._rctx);let o=n.viewForward,s=n.eye;this._vxl.update_camera_pos_and_direction(s[0],s[1],s[2],o[0],o[1],o[2]),this.updateWasmCamera(n),this._vxl.begin_frame();let c=null;if(r.length===0)c=this._vxl.pick_object(i,a,0,0);else{let e={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(c=this._vxl.pick_object(i,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(this._rctx,this._vxl),c}async getOtherFieldPopupValues(e,n){if(!this._vxl)return[];for(let r of e){let e=r.gpuResult;if(!e)continue;let i=this._layers.get(e.layerId);if(!i||!i.layerView.layer.url)continue;let a=i.layerView.layer,o={responseType:`array-buffer`,signal:i.abortController.signal,query:{...i.layerView.layer.customParameters,token:i.layerView.layer.apiKey}},s=e.voxelSpacePosition,c=[Math.floor(s[0]/32),Math.floor(s[1]/32),Math.floor(s[2]/32)],l=[c[0]&-4,c[1]&-4,c[2]&-4],u=0;if(e.epochTime){let t=this._vxl.get_layer_epoch_times(i.layerView.wasmLayerId,a.currentVariableId);for(let n=0;n<t.length;++n)if(t[n]===e.epochTime/1e3){u=n;break}}let d=[],f={varIds:[],ptrs:[],sizes:[]};for(let e of n){let n=a.variables.findIndex(t=>t.name===e);if(n===-1)continue;let r=a.variables.getItemAt(n)?.id;if(r==null)continue;let i=`${a.url}/variables/${r}/${u}/bundles/0/${l[0]}-${l[1]}-${l[2]}`;d.push(t(i,o).then(e=>e.data)),f.varIds.push(r)}let p=await Promise.allSettled(d),m=p.length;for(let e=0;e<m;++e){let t=p[e];if(t.status===`fulfilled`){let e=t.value,n=this._vxl._malloc(e.byteLength);new Uint8Array(this._vxl.HEAPU8.buffer,n,e.byteLength).set(new Uint8Array(e)),f.ptrs.push(n),f.sizes.push(e.byteLength)}else f.varIds.splice(e,1)}let h=this._vxl.get_other_field_popup_values(e,f);for(let e=0;e<f.ptrs.length;++e)this._vxl._free(f.ptrs[e]);if(h.continuousValues)for(let e in h.continuousValues)r.attributes[e]=h.continuousValues[e];if(h.uniqueValues)for(let e in h.uniqueValues)r.attributes[e]=h.uniqueValues[e]}return e}_beforeDraw(e){this._renderTargetToRestore={fbo:e.boundFramebuffer,viewport:e.getViewport()},e.setPolygonOffsetFillEnabled(!1),e.setScissorTestEnabled(!1),e.setColorMask(!0,!0,!0,!0)}_afterDraw(e,t){this._renderTargetToRestore.fbo=null,e.externalTextureUnitUpdate(t.get_texture_units_bound_in_frame(),t.get_active_texture_unit()),e.externalVertexArrayObjectUpdate(),e.externalVertexBufferUpdate(),e.externalProgramUpdate()}intersectRay(e,t,n,r,i){if(!this._vxl||!this._rctx||this._layers.size===0||!e.options.selectionMode||e.options.isFiltered||!e.camera)return;if(i==null||i[0]<0||i[0]>e.camera.viewport[2]||i[1]<0||i[1]>e.camera.viewport[3])return this._dbg(4,i?`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${i[0].toFixed(0)}, ${i[1].toFixed(0)}]`:`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=null`),null;let a=[];this._layers.forEach(t=>{e.options.filteredLayerViewUids.includes(t.layerView.uid)&&a.push(t.layerView.wasmLayerId)});let o=this.pickObject(i[0],i[1],e.camera,a);if(o==null||o.layerId===-1)return;let s=this._layers.get(o.layerId);if(s){let t=s.layerView.layer.uid,i=o.distanceToCamera/l(n,r),a=u();a[0]=o.worldX,a[1]=o.worldY,a[2]=o.worldZ;let c={},d=s.layerView.layer,f=d.variables.findIndex(e=>e.id===d.currentVariableId);if(f>=0){let e=d.variables.getItemAt(f);e!=null&&(o.continuousValue==null?o.uniqueValueLabel!=null&&o.uniqueValue!=null?c[e.name]=`${o.uniqueValueLabel} (${o.uniqueValue})`:o.uniqueValue!=null&&(c[e.name]=`${o.uniqueValue}`):c[e.name]=o.continuousValue,e.description.length>0?c[`Voxel.CurrentVariable`]=e.description:e.name?.length>0&&(c[`Voxel.CurrentVariable`]=e.name))}c[`Voxel.Position`]=`[${o.voxelSpacePosition.toString()}]`,o.epochTime!=null&&o.nativeTime!=null&&o.nativeTimeUnits!=null&&(c[`Voxel.LocalTime`]=new Date(o.epochTime),c[`Voxel.SourceTime`]=`${o.nativeTime.toLocaleString()} ${o.nativeTimeUnits}`),o.depth!=null&&(c[`Voxel.Depth`]=o.depth);let p=o.faceNormal;c[`Voxel.WorldPosition`]=`[${a[0]}, ${a[1]}, ${a[2]}]`;let m=e=>{let n=new h(a,t,()=>this._createVoxelGraphic(s.layerView.layer,c,o));e.set(this.type,n,i,i,p)},g=e.results,_=e.options.store===2;if((g.min.renderDistance==null||i<g.min.renderDistance)&&m(g.min),(g.max.renderDistance==null||i>g.max.renderDistance)&&m(g.max),_){let t=new y(e.ray);m(t),e.results.all.push(t)}}}_createVoxelGraphic(e,t,n){return new m({layer:e,sourceLayer:e,origin:e.graphicOrigin,attributes:t,gpuResult:n})}_toWasmQuality(e){switch(e){case`low`:return 0;case`medium`:return 1;case`high`:return 2}}_setUpscalingLimits(e,t,n){this._vxl&&this._vxl.set_upscaling_limits(e,t,n)}};e([s()],b.prototype,`consumes`,void 0),e([s()],b.prototype,`produces`,void 0),b=e([c(`esri.layers.VoxelWasmPerSceneView`)],b);const x=b;export{x as default};
|
package/layers/WFSLayer.d.ts
CHANGED
|
@@ -436,10 +436,14 @@ export default class WFSLayer extends WFSLayerSuperclass {
|
|
|
436
436
|
*/
|
|
437
437
|
accessor maxPageCount: number;
|
|
438
438
|
/**
|
|
439
|
-
* The maximum number of features
|
|
440
|
-
* When
|
|
441
|
-
*
|
|
442
|
-
*
|
|
439
|
+
* The maximum number of features to request in a single request.
|
|
440
|
+
* When the service advertises a valid
|
|
441
|
+
* [CountDefault](https://developers.arcgis.com/javascript/latest/references/core/layers/ogc/wfsUtils/#WFSOperationsGetFeature-countDefault),
|
|
442
|
+
* the layer uses the smaller of that value and `maxRecordCount` as the request size.
|
|
443
|
+
* The service may return fewer features than requested.
|
|
444
|
+
*
|
|
445
|
+
* When pagination is supported, the layer makes multiple requests, up to
|
|
446
|
+
* [maxPageCount](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/#maxPageCount), to retrieve the features.
|
|
443
447
|
*
|
|
444
448
|
* @default 3000
|
|
445
449
|
* @since 4.29
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import n from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import i from"../../../core/PooledArray.js";import{EsriPromiseMixin as a}from"../../../core/Promise.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as s,sync as c,initial as l}from"../../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{runUntracked as f}from"../../../core/accessorSupport/tracking.js";import{exactEquals as p}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{UpdatingHandles as m}from"../../../core/support/UpdatingHandles.js";import{create as h,fromValues as g}from"../../../geometry/support/aaBoundingRect.js";import{viewingModeFromString as _}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as v}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{I3SDataRequester as y}from"../../../views/3d/layers/i3s/I3SDataRequester.js";import{addCallback as b}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as x}from"../../../views/3d/layers/i3s/I3SIndex.js";import S from"../../../views/3d/layers/i3s/I3SLodHandling.js";import C from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{getVertexCrs as w,getIndexCrs as T,findIntersectingNodes as E}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{projectElevationUpdateExtent as O}from"../../../views/3d/support/elevationUpdateExtentUtils.js";import{toBoundingRect as k}from"../../../views/3d/support/extentUtils.js";import{minQuality as A}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as j}from"../../../views/support/PromiseQueue.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const N=1e4,P=1e-4;let F=class extends a(t){get isMeshPyramid(){return this.layer.profile===`mesh-pyramids`||this.layer.store?.lodType===`MeshPyramid`}get isGraphics3D(){return this.layer.profile===`points`}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(this.layer.priority==null||this.layer.priority===`High`)}get indexRequester(){return new y(this.layer.customParameters,this.layer.apiKey)}get dataRequester(){return new y(this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return w(this.layer)}get crsIndex(){return T(this.layer)}get layer(){return this.layerView.layer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){return f(()=>{if(this._index){let e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0})}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new m,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new i({deallocator:null}),this._modificationsNodeFilteringArray=new i,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=[],this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new j,this._elevationUpdateNodes=new i({deallocator:null}),this._errorCount=0}initialize(){let{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new S(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has(`disable-feature:idb-cache`),`fields`in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([r])=>{if(this.destroyed||!e||e.destroyed||!r)return;let{view:i,clientGeometry:a}=e;if(this._setClippingArea(i.clippingArea),this.addHandles([this._updatingHandles.add(()=>i?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:p}),s(()=>i.quality,()=>this._setCameraDirty(),c),this._updatingHandles.add(()=>i.state.mode===2,t=>{this._updateIdleState(t),t&&(this._index?.resetFailedNodes(),e.contentVisible||this._updateViewData())},l),this._updatingHandles.add(()=>e.contentVisible,e=>{e&&this._index?.invalidateAllElevationRanges(),this.restartNodeLoading()},l),b(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>i.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e),c),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.holeFilling,e=>this._index!=null&&(this._index.holeFilling=e))]),this._viewportQueries=new D(this.crsIndex,i.renderCoordsHelper,i.state.contentCamera,!i.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?i.groundView:i.elevationProvider,_(i.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new v(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:i.renderCoordsHelper.spatialReference},i.resourceController.memoryController,this.worker),this._index=new x(_(i.viewingMode),t,r,this.indexRequester,this._clientNodeLoader,this._viewportQueries,n.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),a!=null){for(let e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on(`change`,e=>{for(let t of e.removed)this._removeMesh(t.oid);for(let t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){let t=this._index,n=this.layerView;t!=null&&n?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{let n=t.getNode(e);n!=null&&this._modificationsNodeFilteringArray.push(n)}),n.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._updatingHandles.destroy(),this._nodeLoader=null,I.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),L!=null&&(L.hide(),L=null),this._index=null,this._lodHandling=r(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set(`worker`,null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(this._attributeStorageInfo==null||!this._fields||!this.layerView.availableFields)return[];let e=this._attributeStorageInfo,t=this._fields,n=this.layer.objectIdField;return this.layerView.availableFields.map(n=>{let r=z(e,n),i=z(t,n);return r>=0&&i>=0?{index:r,name:t[i].name,field:t[i],attributeStorageInfo:e[r]}:null}).filter(e=>e!=null&&e.name!==n)}_requiredFieldsChange(){let e=this._getRequiredAttributes();R(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){let t=h();this._clippingArea=k(e,t,this.layerView.view.renderSpatialReference)?t:null}_pointOfInterestChanged(e){this._viewportQueries!=null&&(this._viewportQueries.setPointOfInterest(e),this._index!=null&&this._index.requestUpdate())}updateClippingArea(e){this._setClippingArea(e),this._viewportQueries!=null&&this._index!=null&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(this._index==null)return;let n=this._clientNodeLoader.createMeshNodeInfo(e,t),r=this._index.addClientNodeToIndex(n.id,n.mbs);this._clientNodeLoader.addMeshNode(r,n),this._evaluateRunning(),this.notifyChange(`rootNodeVisible`)}_removeMesh(e){let t=this._clientNodeLoader.getMeshNodeIndex(e);if(t!=null){if(this._index!=null)this._index.removeClientNodeFromIndex(t,(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&e!=null&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},(e,t,n)=>{this._clientNodeLoader.updateNodeIndex(e,t,n),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,n)}),this.notifyChange(`rootNodeVisible`);else throw Error(`delayed removal of client side i3s node geometry not supported yet.`)}}updateElevationChanged(e,t){let n=this._index,r=this._viewportQueries;if(n?.rootNode==null||t==null||r==null)return null;let i=r.elevationIntersectionSpatialReference;i.equals(t)||(O(e,t,B,i)||g(-1/0,-1/0,1/0,1/0,B),e=B);let a=this._elevationUpdateNodes;return a.clear(),E(e,n.rootNode,n,e=>a.push(e.index),r),a.length&&(a.forAll(e=>n.updateElevationChanged(e)),this._setCameraDirty()),a}removeAllGeometryObbs(){this._index!=null&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return this._viewportQueries==null?null:this._viewportQueries.calculateServiceMbsInRenderSRElevationAdjusted(e)}_elevationInfoChanged(e){this._index!=null&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){let n=this._idleQueue.push(e,t);return this._evaluateRunning(),n}reschedule(e,t){let n=this._idleQueue.unshift(e,t);return this._evaluateRunning(),n}get _isIntegratedMesh(){return this.layer.type===`integrated-mesh`}get unloadedMemoryEstimate(){return this._index==null||!this.layerView.contentVisible?0:this._index.unloadedMemoryEstimate*this._lodDropFactor}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,n){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,n)}get indexDepth(){return this._index==null?0:this._index.maxLevel}set disableMemCache(e){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData||e}runTask(e,t){return this.layerView.contentVisible?!this.layerView.visible||this._index==null?-1/0:(this._processWithErrorLogging(e,t),this._index.maxPriority):(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(e){this._errorCount<50?n.getLogger(this).error(`Error during processing: ${e} at ${e.stack}`):this._errorCount===50&&n.getLogger(this).error(`Too many errors for this layer. Further errors will not be displayed.`),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),this._nodeLoader!=null&&this._index!=null&&(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.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(this._index==null)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(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.pushAll(this._index.updates.missing));let t=this._index.featureEstimate.leavesReached;!this._index.isLoading&&t!==this._get(`leavesReached`)&&this._set(`leavesReached`,t)}return this._index.load()}_prefetchIndex(){return this._index==null||this._loadingNodes.size>0||this._index.updates.add.length>0?!1:this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||this._index==null||this._viewportQueries==null)return;let e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,n=this._index.featureEstimate;if(n.estimate=n.estimate||t/2,this._index.indexMissing>500){if(this._featureLOD<=P)return;this._featureLOD/=1.5,this._stableFeatureLOD=!1}else if(e&&n.estimate<t){if(n.leavesReached||this._featureLOD>=N||this._stableFeatureLOD)return;let e=Math.min(10,Math.max(t/n.estimate,1.001));this._featureLOD*=e;let r=this._lod,i=this._index.checkFeatureTarget(t,r);i!==r&&(this._featureLOD=i/this._baseLOD,this._stableFeatureLOD=!0)}else if(n.estimate>t*1.2||e&&n.estimate>t){if(this._featureLOD<=P)return;this._featureLOD/=1+(n.estimate/t-1)*.25,this._stableFeatureLOD=!1}else return;this._featureLOD=Math.min(N,Math.max(P,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){let t=this._index;if(t==null)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){let n=this._newLoadingNodes.pop();for(let r=t.getParent(n);r!=null&&!this.layerView.isNodeLoaded(r.index);r=t.getParent(r.index)){if(!this._disableMemCache&&!t.useNodeAsHole(r.index)){e.enabled&&e.madeProgress();break}if(this._enableFromGPUCache(r,0)){e.madeProgress();break}}}return e.hasProgressed}_processNodes(e,t){if(this._index==null)return!1;let n=(this._isIdle?100:2)-this._loadingNodes.size,r=this._index.updates;for(r.cancel.forEach(this._cancelNode,this),r.cancel=[];r.remove.length>0&&!e.done;)this.layerView.removeNode(r.remove.pop()),e.madeProgress();for(;r.update.length>0&&!e.done;){let t=this._index.getNode(r.update.pop());t!=null&&(this._updateLoadedNode(t),e.madeProgress())}for(;r.add.length>0&&!e.done&&n>0;){--n;let i=this._index.getNode(r.add.back());if(i==null||i.cacheState!==2&&!this._hasNodeLoadToken(t))break;r.add.pop(),this._loadNode(i),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){let t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=2?!1:this.index==null||!this.dataRequester.isFull(this._index.urlPrefix)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(!this.layerView.contentVisible)e=this._cameraDirty,t=+!e;else{let n=(this._index?.indexMissing??0)+(this._index?.updates.add.length??0)*3+this._loadingNodes.size*2;e=!!(n>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||this._index!=null&&this._index.isPrefetching),n===0&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(n,this._progressMaxNumNodes),t=1-n/this._progressMaxNumNodes}this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||this._index==null||this._viewportQueries==null)return;let e=this.layerView.view,{contentCamera:t,fixedContentCamera:n}=e.state;this._viewportQueries.updateCamera(t,!n||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange(`rootNodeVisible`)}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){let e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){return this.fixedFeatureTarget?1:(Math.min(this.layerView.view.quality,.5)-A)/(.5-A)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e)||this._index==null||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(this._viewportQueries==null)return!1;let t=this._lodDropFactor;return t>=1||!this._lodHandling.hasNoVisibleChildren(e)?!1:Math.abs(this._viewportQueries.calcCameraDistanceToCenterAndUpdateMinmax(e))-this._viewportQueries.minCenterDistance>(this._viewportQueries.maxCenterDistance-this._viewportQueries.minCenterDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;let e=this._index;if(this._updatesDisabled||e==null||this._viewportQueries==null)return;this._updateViewData(),this._requiredAttributesDirty&&=(this._requiredAttributes=this._getRequiredAttributes(),!1);let t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new C(this.layer,this.dataRequester,n.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return this._nodeLoader!=null&&this._index!=null}cancelNodeLoading(){this.isNodeLoading()&&(this.indexRequester.cancelAll(),this.dataRequester.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){let t=this._index;if(t==null||this._viewportQueries==null)return!1;I.clear(),this.layerView.getLoadedNodeIndices(I);let n=this._viewportQueries.maxCenterDistance===0,r=n?()=>!1:e=>this._shouldDropNode(e);return I.filterInPlace(e=>{let n=t.getNode(e);return n==null||!t.isGeometryVisible(e)||r(n)}),I.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(I,e,0),n&&this._lodDropFactor<1?!1:I.length===0||(I.clear(),!1)}markNodeToRemove(e){I.push(e)}removeMarkedNodes(){this._removeNodes(I,M,0)}_removeNodes(e,t,n){if(!(e.length===0||t.done))for(this._index!=null&&this._index.requestUpdate();e.length>0&&!t.done;){let r=e.pop(),i=this._index;n===1&&this.layerView.nodeFadeoutEnabled&&i!=null&&i.isGeometryVisible(r)?this.layerView.fadeNode(r,1,!0):this.layerView.removeNode(r),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;let t=this.layerView.getLoadedAttributes(e.index);return t!=null&&t!==this._requiredAttributes}async _updateLoadedNode(e){let t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{let n=R(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:n},t.signal),t.signal)}catch(n){if(!o(n))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateRunning()}_loadNode(e){if(this._loadingNodes.has(e.index)){n.getLogger(this).error(`already loading node `+e.index);return}let t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(n=>{n&&this._index!=null&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(()=>{}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return e.cacheState===1?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!o(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||this._index==null)return!1;let n=this._loadCachedGPUData(e);return n?(this.layerView.addCachedGPUData(e,n,t),this._nodeAdded(),!0):!1}_loadCachedGPUData(e){let t=this.layerView.loadCachedGPUData(e.index);return t?.attributeInfo!=null&&R(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){this._index!=null&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){this._index?.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;let n=this.layerView;if(this.disableIDBCache||!n.loadCachedNodeData||!n.addCachedNodeData)return!1;let r=e.index>=0?(t,n)=>this._nodeLoader.loadTextures(e,t,n):t=>this._clientNodeLoader.loadTextures(e,t),i=await this.schedule(()=>n.loadCachedNodeData(e,t,r),t);if(i==null)return!1;let a=this._requiredAttributes,o=await this.reschedule(()=>this._loadAttributes(e,a,t),t);return await this.reschedule(()=>n.addCachedNodeData(e,i,{loadedAttributes:a,attributeData:o},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).then(n=>this.schedule(()=>this.layerView.addNode(e,n,t),t)).finally(()=>this._downloadingCount--).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!o(t))throw n.getLogger(this).error(`#loadNodeData()`,this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,this._index?.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),this._index!=null&&this._index.requestUpdate()}geometryFilterChanged(e){this._index?.layerFilterChanged(e),this._setCameraDirty()}};e([u({readOnly:!0})],F.prototype,`isMeshPyramid`,null),e([u({readOnly:!0})],F.prototype,`isGraphics3D`,null),e([u({readOnly:!0})],F.prototype,`useMaximumNumberOfFeatures`,null),e([u({readOnly:!0})],F.prototype,`indexRequester`,null),e([u({readOnly:!0})],F.prototype,`dataRequester`,null),e([u({readOnly:!0})],F.prototype,`crsVertex`,null),e([u({readOnly:!0})],F.prototype,`crsIndex`,null),e([u()],F.prototype,`featureTarget`,void 0),e([u()],F.prototype,`fixedFeatureTarget`,void 0),e([u()],F.prototype,`layerView`,void 0),e([u()],F.prototype,`layer`,null),e([u()],F.prototype,`_updatingHandles`,void 0),e([u()],F.prototype,`updating`,null),e([u()],F.prototype,`running`,void 0),e([u()],F.prototype,`updatingProgress`,void 0),e([u({readOnly:!0})],F.prototype,`leavesReached`,void 0),e([u({constructOnly:!0})],F.prototype,`worker`,void 0),e([u({readOnly:!0})],F.prototype,`rootNodeVisible`,null),F=e([d(`esri.layers.graphics.controllers.I3SOnDemandController`)],F);const I=new i({deallocator:null});let L;function R(e,t){return e!=null&&e.length===t.length&&e.every(e=>z(t,e.name)>=0)}function z(e,t){let n=t.toLowerCase();for(let t=0;t<e.length;t++)if(e[t].name.toLowerCase()===n)return t;return-1}const B=h(),V=F;export{V as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import n from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import i from"../../../core/PooledArray.js";import{EsriPromiseMixin as a}from"../../../core/Promise.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as s,sync as c,initial as l}from"../../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{runUntracked as f}from"../../../core/accessorSupport/tracking.js";import{exactEquals as p}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{UpdatingHandles as m}from"../../../core/support/UpdatingHandles.js";import{create as h,fromValues as g}from"../../../geometry/support/aaBoundingRect.js";import{viewingModeFromString as _}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as v}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{I3SDataRequester as y}from"../../../views/3d/layers/i3s/I3SDataRequester.js";import{addCallback as b}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as x}from"../../../views/3d/layers/i3s/I3SIndex.js";import S from"../../../views/3d/layers/i3s/I3SLodHandling.js";import C from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{getVertexCrs as w,getIndexCrs as T,findIntersectingNodes as E}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{groundNavigationConstants as O}from"../../../views/3d/state/utils/groundNavigationUtils.js";import{projectElevationUpdateExtent as k}from"../../../views/3d/support/elevationUpdateExtentUtils.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{minQuality as j}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as M}from"../../../views/support/PromiseQueue.js";import{noBudget as N}from"../../../views/support/Scheduler.js";const P=1e4,F=1e-4;let I=class extends a(t){get isMeshPyramid(){return this.layer.profile===`mesh-pyramids`||this.layer.store?.lodType===`MeshPyramid`}get isGraphics3D(){return this.layer.profile===`points`}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(this.layer.priority==null||this.layer.priority===`High`)}get indexRequester(){return new y(this.layer.customParameters,this.layer.apiKey)}get dataRequester(){return new y(this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return w(this.layer)}get crsIndex(){return T(this.layer)}get layer(){return this.layerView.layer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){return f(()=>{if(this._index){let e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0})}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new m,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new i({deallocator:null}),this._modificationsNodeFilteringArray=new i,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=[],this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new M,this._elevationUpdateNodes=new i({deallocator:null}),this._errorCount=0}initialize(){let{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new S(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has(`disable-feature:idb-cache`),`fields`in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([r])=>{if(this.destroyed||!e||e.destroyed||!r)return;let{view:i,clientGeometry:a}=e;if(this._setClippingArea(i.clippingArea),this.addHandles([this._updatingHandles.add(()=>i?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:p}),s(()=>i.quality,()=>this._setCameraDirty(),c),this._updatingHandles.add(()=>i.state.mode===2,t=>{this._updateIdleState(t),t&&(this._index?.resetFailedNodes(),e.contentVisible||this._updateViewData())},l),this._updatingHandles.add(()=>e.contentVisible,e=>{e&&this._index?.invalidateAllElevationRanges(),this.restartNodeLoading()},l),b(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>i.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>i.navigation.mode?.type,e=>{this._setCameraDirty(),this._index&&(this._index.isGroundNavigationMode=e===`ground`)}),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e),c),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.holeFilling,e=>this._index!=null&&(this._index.holeFilling=e))]),this._viewportQueries=new D(this.crsIndex,i.renderCoordsHelper,i.state.contentCamera,!i.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?i.groundView:i.elevationProvider,_(i.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new v(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:i.renderCoordsHelper.spatialReference},i.resourceController.memoryController,this.worker),this._index=new x(_(i.viewingMode),t,i.navigation.mode.type===`ground`,O.i3sNodeDownwardCheckDistanceInMeters/i.renderCoordsHelper.unitInMeters,r,this.indexRequester,this._clientNodeLoader,this._viewportQueries,n.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),a!=null){for(let e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on(`change`,e=>{for(let t of e.removed)this._removeMesh(t.oid);for(let t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){let t=this._index,n=this.layerView;t!=null&&n?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{let n=t.getNode(e);n!=null&&this._modificationsNodeFilteringArray.push(n)}),n.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._updatingHandles.destroy(),this._nodeLoader=null,L.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),R!=null&&(R.hide(),R=null),this._index=null,this._lodHandling=r(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set(`worker`,null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(this._attributeStorageInfo==null||!this._fields||!this.layerView.availableFields)return[];let e=this._attributeStorageInfo,t=this._fields,n=this.layer.objectIdField;return this.layerView.availableFields.map(n=>{let r=B(e,n),i=B(t,n);return r>=0&&i>=0?{index:r,name:t[i].name,field:t[i],attributeStorageInfo:e[r]}:null}).filter(e=>e!=null&&e.name!==n)}_requiredFieldsChange(){let e=this._getRequiredAttributes();z(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){let t=h();this._clippingArea=A(e,t,this.layerView.view.renderSpatialReference)?t:null}_pointOfInterestChanged(e){this._viewportQueries!=null&&(this._viewportQueries.setPointOfInterest(e),this._index!=null&&this._index.requestUpdate())}updateClippingArea(e){this._setClippingArea(e),this._viewportQueries!=null&&this._index!=null&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(this._index==null)return;let n=this._clientNodeLoader.createMeshNodeInfo(e,t),r=this._index.addClientNodeToIndex(n.id,n.mbs);this._clientNodeLoader.addMeshNode(r,n),this._evaluateRunning(),this.notifyChange(`rootNodeVisible`)}_removeMesh(e){let t=this._clientNodeLoader.getMeshNodeIndex(e);if(t!=null){if(this._index!=null)this._index.removeClientNodeFromIndex(t,(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&e!=null&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},(e,t,n)=>{this._clientNodeLoader.updateNodeIndex(e,t,n),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,n)}),this.notifyChange(`rootNodeVisible`);else throw Error(`delayed removal of client side i3s node geometry not supported yet.`)}}updateElevationChanged(e,t){let n=this._index,r=this._viewportQueries;if(n?.rootNode==null||t==null||r==null)return null;let i=r.elevationIntersectionSpatialReference;i.equals(t)||(k(e,t,V,i)||g(-1/0,-1/0,1/0,1/0,V),e=V);let a=this._elevationUpdateNodes;return a.clear(),E(e,n.rootNode,n,e=>a.push(e.index),r),a.length&&(a.forAll(e=>n.updateElevationChanged(e)),this._setCameraDirty()),a}removeAllGeometryObbs(){this._index!=null&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return this._viewportQueries==null?null:this._viewportQueries.calculateServiceMbsInRenderSRElevationAdjusted(e)}_elevationInfoChanged(e){this._index!=null&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){let n=this._idleQueue.push(e,t);return this._evaluateRunning(),n}reschedule(e,t){let n=this._idleQueue.unshift(e,t);return this._evaluateRunning(),n}get _isIntegratedMesh(){return this.layer.type===`integrated-mesh`}get unloadedMemoryEstimate(){return this._index==null||!this.layerView.contentVisible?0:this._index.unloadedMemoryEstimate*this._lodDropFactor}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,n){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,n)}get indexDepth(){return this._index==null?0:this._index.maxLevel}set disableMemCache(e){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData||e}runTask(e,t){return this.layerView.contentVisible?!this.layerView.visible||this._index==null?-1/0:(this._processWithErrorLogging(e,t),this._index.maxPriority):(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(e){this._errorCount<50?n.getLogger(this).error(`Error during processing: ${e} at ${e.stack}`):this._errorCount===50&&n.getLogger(this).error(`Too many errors for this layer. Further errors will not be displayed.`),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),this._nodeLoader!=null&&this._index!=null&&(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.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(this._index==null)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(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.pushAll(this._index.updates.missing));let t=this._index.featureEstimate.leavesReached;!this._index.isLoading&&t!==this._get(`leavesReached`)&&this._set(`leavesReached`,t)}return this._index.load()}_prefetchIndex(){return this._index==null||this._loadingNodes.size>0||this._index.updates.add.length>0?!1:this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||this._index==null||this._viewportQueries==null)return;let e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,n=this._index.featureEstimate;if(n.estimate=n.estimate||t/2,this._index.indexMissing>500){if(this._featureLOD<=F)return;this._featureLOD/=1.5,this._stableFeatureLOD=!1}else if(e&&n.estimate<t){if(n.leavesReached||this._featureLOD>=P||this._stableFeatureLOD)return;let e=Math.min(10,Math.max(t/n.estimate,1.001));this._featureLOD*=e;let r=this._lod,i=this._index.checkFeatureTarget(t,r);i!==r&&(this._featureLOD=i/this._baseLOD,this._stableFeatureLOD=!0)}else if(n.estimate>t*1.2||e&&n.estimate>t){if(this._featureLOD<=F)return;this._featureLOD/=1+(n.estimate/t-1)*.25,this._stableFeatureLOD=!1}else return;this._featureLOD=Math.min(P,Math.max(F,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){let t=this._index;if(t==null)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){let n=this._newLoadingNodes.pop();for(let r=t.getParent(n);r!=null&&!this.layerView.isNodeLoaded(r.index);r=t.getParent(r.index)){if(!this._disableMemCache&&!t.useNodeAsHole(r.index)){e.enabled&&e.madeProgress();break}if(this._enableFromGPUCache(r,0)){e.madeProgress();break}}}return e.hasProgressed}_processNodes(e,t){if(this._index==null)return!1;let n=(this._isIdle?100:2)-this._loadingNodes.size,r=this._index.updates;for(r.cancel.forEach(this._cancelNode,this),r.cancel=[];r.remove.length>0&&!e.done;)this.layerView.removeNode(r.remove.pop()),e.madeProgress();for(;r.update.length>0&&!e.done;){let t=this._index.getNode(r.update.pop());t!=null&&(this._updateLoadedNode(t),e.madeProgress())}for(;r.add.length>0&&!e.done&&n>0;){--n;let i=this._index.getNode(r.add.back());if(i==null||i.cacheState!==2&&!this._hasNodeLoadToken(t))break;r.add.pop(),this._loadNode(i),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){let t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=2?!1:this.index==null||!this.dataRequester.isFull(this._index.urlPrefix)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(!this.layerView.contentVisible)e=this._cameraDirty,t=+!e;else{let n=(this._index?.indexMissing??0)+(this._index?.updates.add.length??0)*3+this._loadingNodes.size*2;e=!!(n>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||this._index!=null&&this._index.isPrefetching),n===0&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(n,this._progressMaxNumNodes),t=1-n/this._progressMaxNumNodes}this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||this._index==null||this._viewportQueries==null)return;let e=this.layerView.view,{contentCamera:t,fixedContentCamera:n}=e.state;this._viewportQueries.updateCamera(t,!n||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange(`rootNodeVisible`)}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){let e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){return this.fixedFeatureTarget?1:(Math.min(this.layerView.view.quality,.5)-j)/(.5-j)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e)||this._index==null||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(this._viewportQueries==null)return!1;let t=this._lodDropFactor;return t>=1||!this._lodHandling.hasNoVisibleChildren(e)?!1:Math.abs(this._viewportQueries.calcCameraDistanceToCenterAndUpdateMinmax(e))-this._viewportQueries.minCenterDistance>(this._viewportQueries.maxCenterDistance-this._viewportQueries.minCenterDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;let e=this._index;if(this._updatesDisabled||e==null||this._viewportQueries==null)return;this._updateViewData(),this._requiredAttributesDirty&&=(this._requiredAttributes=this._getRequiredAttributes(),!1);let t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new C(this.layer,this.dataRequester,n.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return this._nodeLoader!=null&&this._index!=null}cancelNodeLoading(){this.isNodeLoading()&&(this.indexRequester.cancelAll(),this.dataRequester.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){let t=this._index;if(t==null||this._viewportQueries==null)return!1;L.clear(),this.layerView.getLoadedNodeIndices(L);let n=this._viewportQueries.maxCenterDistance===0,r=n?()=>!1:e=>this._shouldDropNode(e);return L.filterInPlace(e=>{let n=t.getNode(e);return n==null||!t.isGeometryVisible(e)||r(n)}),L.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(L,e,0),n&&this._lodDropFactor<1?!1:L.length===0||(L.clear(),!1)}markNodeToRemove(e){L.push(e)}removeMarkedNodes(){this._removeNodes(L,N,0)}_removeNodes(e,t,n){if(!(e.length===0||t.done))for(this._index!=null&&this._index.requestUpdate();e.length>0&&!t.done;){let r=e.pop(),i=this._index;n===1&&this.layerView.nodeFadeoutEnabled&&i!=null&&i.isGeometryVisible(r)?this.layerView.fadeNode(r,1,!0):this.layerView.removeNode(r),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;let t=this.layerView.getLoadedAttributes(e.index);return t!=null&&t!==this._requiredAttributes}async _updateLoadedNode(e){let t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{let n=z(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:n},t.signal),t.signal)}catch(n){if(!o(n))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateRunning()}_loadNode(e){if(this._loadingNodes.has(e.index)){n.getLogger(this).error(`already loading node `+e.index);return}let t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(n=>{n&&this._index!=null&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(()=>{}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return e.cacheState===1?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!o(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||this._index==null)return!1;let n=this._loadCachedGPUData(e);return n?(this.layerView.addCachedGPUData(e,n,t),this._nodeAdded(),!0):!1}_loadCachedGPUData(e){let t=this.layerView.loadCachedGPUData(e.index);return t?.attributeInfo!=null&&z(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){this._index!=null&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){this._index?.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;let n=this.layerView;if(this.disableIDBCache||!n.loadCachedNodeData||!n.addCachedNodeData)return!1;let r=e.index>=0?(t,n)=>this._nodeLoader.loadTextures(e,t,n):t=>this._clientNodeLoader.loadTextures(e,t),i=await this.schedule(()=>n.loadCachedNodeData(e,t,r),t);if(i==null)return!1;let a=this._requiredAttributes,o=await this.reschedule(()=>this._loadAttributes(e,a,t),t);return await this.reschedule(()=>n.addCachedNodeData(e,i,{loadedAttributes:a,attributeData:o},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).then(n=>this.schedule(()=>this.layerView.addNode(e,n,t),t)).finally(()=>this._downloadingCount--).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!o(t))throw n.getLogger(this).error(`#loadNodeData()`,this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,this._index?.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),this._index!=null&&this._index.requestUpdate()}geometryFilterChanged(e){this._index?.layerFilterChanged(e),this._setCameraDirty()}};e([u({readOnly:!0})],I.prototype,`isMeshPyramid`,null),e([u({readOnly:!0})],I.prototype,`isGraphics3D`,null),e([u({readOnly:!0})],I.prototype,`useMaximumNumberOfFeatures`,null),e([u({readOnly:!0})],I.prototype,`indexRequester`,null),e([u({readOnly:!0})],I.prototype,`dataRequester`,null),e([u({readOnly:!0})],I.prototype,`crsVertex`,null),e([u({readOnly:!0})],I.prototype,`crsIndex`,null),e([u()],I.prototype,`featureTarget`,void 0),e([u()],I.prototype,`fixedFeatureTarget`,void 0),e([u()],I.prototype,`layerView`,void 0),e([u()],I.prototype,`layer`,null),e([u()],I.prototype,`_updatingHandles`,void 0),e([u()],I.prototype,`updating`,null),e([u()],I.prototype,`running`,void 0),e([u()],I.prototype,`updatingProgress`,void 0),e([u({readOnly:!0})],I.prototype,`leavesReached`,void 0),e([u({constructOnly:!0})],I.prototype,`worker`,void 0),e([u({readOnly:!0})],I.prototype,`rootNodeVisible`,null),I=e([d(`esri.layers.graphics.controllers.I3SOnDemandController`)],I);const L=new i({deallocator:null});let R;function z(e,t){return e!=null&&e.length===t.length&&e.every(e=>B(t,e.name)>=0)}function B(e,t){let n=t.toLowerCase();for(let t=0;t<e.length;t++)if(e[t].name.toLowerCase()===n)return t;return-1}const V=h(),H=I;export{H as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{Loadable as t}from"../../../core/Loadable.js";import{debounce as n}from"../../../core/promiseUtils.js";import{open as r}from"../../../core/workers.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import s from"../../../rest/support/FeatureSet.js";let
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{Loadable as t}from"../../../core/Loadable.js";import{debounce as n}from"../../../core/promiseUtils.js";import{open as r}from"../../../core/workers.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import{applyTimeExtentToQuery as s}from"./support/timeQueryUtils.js";import c from"../../../rest/support/FeatureSet.js";let l=class extends t{constructor(e){super(e),this.type=`csv`,this.refresh=n(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return t&&(this.sourceJSON.extent=t),n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryFeatures`,n.toJSON(),t);return c.fromJSON(r)}async queryFeaturesJSON(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}async queryFeatureCount(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)}async queryObjectIds(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)}async queryExtent(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryExtent`,n.toJSON(),t);return{count:r.count,extent:o.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke(`querySnapping`,e,t)}async queryAttributeBins(e,t={}){await this.load();let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryAttributeBins`,n.toJSON(),t)}async _startWorker(e){this._connection=await r(`CSVSourceWorker`,{strategy:has(`feature-layers-workers`)?`dedicated`:`local`,signal:e,registryTarget:this});let{url:t,delimiter:n,fields:i,latitudeField:a,longitudeField:o,spatialReference:s,timeInfo:c}=this.loadOptions,l=await this._connection.invoke(`load`,{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:n,fields:i?.map(e=>e.toJSON()),latitudeField:a,longitudeField:o,spatialReference:s?.toJSON(),timeInfo:c?.toJSON()}},{signal:e});this.locationInfo=l.locationInfo,this.sourceJSON=l.layerDefinition,this.delimiter=l.delimiter}};e([i()],l.prototype,`type`,void 0),e([i()],l.prototype,`loadOptions`,void 0),e([i()],l.prototype,`customParameters`,void 0),e([i({constructOnly:!0})],l.prototype,`layer`,void 0),e([i()],l.prototype,`locationInfo`,void 0),e([i()],l.prototype,`sourceJSON`,void 0),e([i()],l.prototype,`delimiter`,void 0),l=e([a(`esri.layers.graphics.sources.CSVSource`)],l);export{l as CSVSource};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{Loadable as n}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{debounce as i}from"../../../core/promiseUtils.js";import{open as a}from"../../../core/workers.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import c from"../../../geometry/Extent.js";import l from"../../../geometry/Polygon.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as d}from"./support/clientSideDefaults.js";import f from"../../../rest/support/FeatureSet.js";let
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{Loadable as n}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{debounce as i}from"../../../core/promiseUtils.js";import{open as a}from"../../../core/workers.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import c from"../../../geometry/Extent.js";import l from"../../../geometry/Polygon.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as d}from"./support/clientSideDefaults.js";import{applyTimeExtentToQuery as f}from"./support/timeQueryUtils.js";import p from"../../../rest/support/FeatureSet.js";let m=class extends n{constructor(){super(...arguments),this.type=`geojson`,this.refresh=i(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return this.sourceJSON.extent=t,n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}).then(e=>p.fromJSON(e))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)})}queryFeatureCount(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)})}queryObjectIds(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)})}queryExtent(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryExtent`,n.toJSON(),t)}).then(e=>({count:e.count,extent:c.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke(`querySnapping`,e,t))}async queryAttributeBins(e,t={}){await this.load();let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryAttributeBins`,n.toJSON(),t)}_applyEdits(e){if(!this._connection)throw new t(`geojson-layer-source:edit-failure`,`Memory source not loaded`);let n=this.layer.objectIdField,r=[],i=[],a=[];if(e.addFeatures)for(let t of e.addFeatures)r.push(this._serializeFeature(t));if(e.deleteFeatures)for(let t of e.deleteFeatures)`objectId`in t&&t.objectId!=null?i.push(t.objectId):`attributes`in t&&t.attributes[n]!=null&&i.push(t.attributes[n]);if(e.updateFeatures)for(let t of e.updateFeatures)a.push(this._serializeFeature(t));return this._connection.invoke(`applyEdits`,{adds:r,updates:a,deletes:i}).then(({extent:e,timeExtent:t,featureEditResults:n})=>(this.sourceJSON.extent=e,t&&(this.sourceJSON.timeInfo.timeExtent=[t.start,t.end]),this._createEditsResult(n)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){let n=e.success===!0?null:e.error||{code:void 0,description:``};return{objectId:e.objectId,globalId:e.globalId,error:n?new t(`geojson-layer-source:edit-failure`,n.description,{code:n.code}):null}}_serializeFeature(e){let{attributes:t}=e,n=this._geometryForSerialization(e);return n?{geometry:n.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){let{geometry:t}=e;return t==null?null:t.type===`mesh`||t.type===`extent`?l.fromExtent(t.extent):t}async _startWorker(e){this._connection=await a(`GeoJSONSourceWorker`,{strategy:has(`feature-layers-workers`)?`dedicated`:`local`,signal:e,registryTarget:this});let{fields:t,spatialReference:n,hasZ:i,geometryType:o,objectIdField:s,url:c,timeInfo:l,customParameters:f}=this.layer,p=this.layer.originOf(`spatialReference`)===`defaults`,m={url:c,customParameters:f,fields:t&&t.map(e=>e.toJSON()),geometryType:u.toJSON(o),hasZ:i,objectIdField:s,timeInfo:l?l.toJSON():null,spatialReference:p?null:n&&n.toJSON()},h=await this._connection.invoke(`load`,m,{signal:e});for(let e of h.warnings)r.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});h.featureErrors.length&&r.getLogger(this.layer).warn(`#load()`,`Encountered ${h.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{errors:h.featureErrors}),this.sourceJSON=h.layerDefinition,this.capabilities=d(this.sourceJSON.hasZ,!0,!this.sourceJSON.geometryType)}};e([o()],m.prototype,`capabilities`,void 0),e([o()],m.prototype,`type`,void 0),e([o({constructOnly:!0})],m.prototype,`layer`,void 0),e([o()],m.prototype,`sourceJSON`,void 0),m=e([s(`esri.layers.graphics.sources.GeoJSONSource`)],m);export{m as GeoJSONSource};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Collection.js";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{LoadableMixin as i}from"../../../core/Loadable.js";import a from"../../../core/Logger.js";import{EsriPromiseMixin as o}from"../../../core/Promise.js";import{isAborted as s,createAbortError as c}from"../../../core/promiseUtils.js";import{open as l}from"../../../core/workers.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{ensureType as f}from"../../../core/accessorSupport/ensureType.js";import p from"../../../geometry/Extent.js";import m from"../../../geometry/Polygon.js";import{typeKebabDictionary as h}from"../../../geometry/support/typeUtils.js";import{createFeatureIdFromLayer as g}from"../data/createFeatureId.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Collection.js";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{LoadableMixin as i}from"../../../core/Loadable.js";import a from"../../../core/Logger.js";import{EsriPromiseMixin as o}from"../../../core/Promise.js";import{isAborted as s,createAbortError as c}from"../../../core/promiseUtils.js";import{open as l}from"../../../core/workers.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{ensureType as f}from"../../../core/accessorSupport/ensureType.js";import p from"../../../geometry/Extent.js";import m from"../../../geometry/Polygon.js";import{typeKebabDictionary as h}from"../../../geometry/support/typeUtils.js";import{createFeatureIdFromLayer as g}from"../data/createFeatureId.js";import{applyTimeExtentToQuery as _}from"./support/timeQueryUtils.js";import{unapplyEditsZUnitScaling as v}from"../../../rest/query/operations/editsZScale.js";import y from"../../../rest/support/FeatureSet.js";import{shared as b}from"../../../core/accessorSupport/decorators/shared.js";let x=0,S=class extends i(o(n)){constructor(e){super(e),this._idToClientGeometry=null,this.type=`memory`}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){let e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?`polygon`:e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryFeatures`,n.toJSON(),t),i=y.fromJSON(r);if(!this._requiresClientGraphicMapping()||!this._idToClientGeometry)return i;let a=this.layer.objectIdField;for(let e of i.features){let t=e.attributes[a],n=this._idToClientGeometry.get(t);n!==void 0&&(e.geometry=n)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new r(`query-features-json:unsupported`,`Cannot query in JSON format for client only geometry types (mesh and extent)`);if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return await this._connection.invoke(`queryFeatures`,n.toJSON(),t)}async queryFeatureCount(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)}async queryObjectIds(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)}async queryExtent(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryExtent`,n.toJSON(),t);return{count:r.count,extent:p.fromJSON(r.extent)}}async querySnapping(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();return this._connection.invoke(`querySnapping`,e,t)}async queryAttributeBins(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryAttributeBins`,n.toJSON(),t);return(await import(`../../../rest/support/AttributeBinsFeatureSet.js`)).default.fromJSON(r)}async _applyEdits(e){if(!this._connection)throw new r(`feature-layer-source:edit-failure`,`Memory source not loaded`);let t=this.layer.objectIdField,n=this.layer.uniqueIdFields,i=null,a=[],o=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);let s=e=>n?.length&&`attributes`in e?g(e,this.layer):`objectId`in e&&e.objectId!=null?e.objectId:`attributes`in e&&e.attributes[t]!=null?e.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(let t of e.deleteFeatures){let e=s(t);e!=null&&a.push(e)}let c=e.updateFeatures&&this._idToClientGeometry?new Map:null;if(e.updateFeatures){for(let t of e.updateFeatures)if(o.push(this._serializeFeature(t)),c&&t.geometry!=null){let e=s(t);e!=null&&c.set(e,t)}}v(i?i.features:null,o,this.layer.spatialReference);let{fullExtent:l,featureEditResults:u}=await this._connection.invoke(`applyEdits`,{adds:i?i.features:[],updates:o,deletes:a});return this.fullExtent=l,i&&i.finish(u.uidToObjectId),this._updateIdToClientGeometries(c,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!==`mesh`||e==null)return;let n=[];for(let{geometry:r}of e)r!=null&&r.type===`mesh`&&!r.hasExtent&&!r.loaded&&n.push(r.load({signal:t}));n.length&&await Promise.all(n)}_updateIdToClientGeometries(e,t){if(this._idToClientGeometry){if(e)for(let n of t.updateResults){if(!n.success)continue;let t=e.get(n.objectId);t!=null&&this._addIdToClientGeometry(t)}for(let e of t.deleteResults)e.success&&this._idToClientGeometry.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){let t=e.success===!0?null:e.error||{code:void 0,description:``};return{objectId:e.objectId,globalId:e.globalId,error:t?new r(`feature-layer-source:edit-failure`,t.description,{code:t.code}):null}}_prepareAddFeatures(e){let t=new Map,n=Array(e.length),r=null;for(let i=0;i<e.length;i++){let a=e[i],o=this._serializeFeature(a);!r&&a.geometry!=null&&(r=a.geometry.type),n[i]=o,t.set(`${o.uid}`,a)}let i=this;return{features:n,inferredGeometryType:r,finish(e){let n=i.sourceJSON.objectIdField;for(let r in e){let a=e[r],o=t.get(r);o&&(o.attributes||={},a===-1?delete o.attributes[n]:o.attributes[n]=a,i._addIdToClientGeometry(o))}}}}_addIdToClientGeometry(e){if(!this._idToClientGeometry)return;let t=this.sourceJSON.objectIdField,n=e.attributes?.[t];n!=null&&this._idToClientGeometry.set(n,e.geometry??null)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return e===`mesh`||e===`multipatch`||e===`extent`}_serializeFeature(e){let{attributes:t}=e,n=this._geometryForSerialization(e),r=(x++).toString();return n?{uid:r,geometry:n.toJSON(),attributes:t}:{uid:r,attributes:t}}_geometryForSerialization(e){let{geometry:t}=e;return t==null?null:this._geometryRequiresClientGraphicMapping(t)?t.extent?m.fromExtent(t.extent):null:t}async _startWorker(e){this._connection=await l(`MemorySourceWorker`,{strategy:has(`feature-layers-workers`)?`dedicated`:`local`,signal:e,registryTarget:this});let{fields:t,spatialReference:n,objectIdField:r,hasM:i,hasZ:o,timeInfo:s,dateFieldsTimeZone:c}=this.layer,u=this.layer.originOf(`spatialReference`)===`defaults`;await this._prepareClientMapping(this.items,e);let d=this._prepareAddFeatures(this.items);this.addHandles(this.on(`before-changes`,e=>{a.getLogger(this).error(`Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead`),e.preventDefault()}));let{uniqueIdFields:f}=this.layer,p=f?.length?{type:f.length>1?`composite`:`simple`,fields:f.slice(),OIDFieldContainsHashValue:f?.length!==1||f.at(0)!==this.layer.objectIdField}:void 0,m={features:d.features,fields:t?.map(e=>e.toJSON()),geometryType:h.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!==`mesh`&&i,hasZ:this._layerOrSourceGeometryType===`mesh`||o,objectIdField:r,spatialReference:u?null:n&&n.toJSON(),timeInfo:s?.toJSON()??null,dateFieldsTimeZone:c,uniqueIdInfo:p},g=await this._connection.invoke(`load`,m,{signal:e});for(let e of g.warnings)a.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});g.featureErrors.length&&a.getLogger(this.layer).error(`#load()`,`Failed to load ${g.featureErrors.length} features due to errors. (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}').`,g.featureErrors.map(e=>`
|
|
3
3
|
|
|
4
|
-
- `+e.error.description).join(``));let _=g.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(_.geometryType=h.toJSON(d.inferredGeometryType)),this.sourceJSON=_,this._requiresClientGraphicMapping()&&(this._idToClientGeometry=new Map),d.finish(g.assignedObjectIds)}};e([
|
|
4
|
+
- `+e.error.description).join(``));let _=g.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(_.geometryType=h.toJSON(d.inferredGeometryType)),this.sourceJSON=_,this._requiresClientGraphicMapping()&&(this._idToClientGeometry=new Map),d.finish(g.assignedObjectIds)}};e([b({Type:t,ensureType:f(t)})],S.prototype,`itemType`,void 0),e([u()],S.prototype,`type`,void 0),e([u({constructOnly:!0})],S.prototype,`layer`,void 0),e([u({readOnly:!0})],S.prototype,`_workerGeometryType`,null),e([u()],S.prototype,`sourceJSON`,void 0),S=e([d(`esri.layers.graphics.sources.MemorySource`)],S);export{S as MemorySource};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{Loadable as n}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{debounce as i,eachAlways as a}from"../../../core/promiseUtils.js";import{open as o}from"../../../core/workers.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import l from"../../../geometry/Extent.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as d,createDrawingInfo as f}from"./support/clientSideDefaults.js";import{getCapabilities as p,getWFSLayerInfo as m,prepareWFSLayerFields as h,findFeatureType as g}from"../../ogc/wfsUtils.js";import _ from"../../../rest/support/AttributeBinsFeatureSet.js";import v from"../../../rest/support/FeatureSet.js";import{utc as y}from"../../../time/constants.js";let b=class extends n{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=d(!1,!1),this.type=`wfs`,this.refresh=i(async()=>{await this.load();let e={customParameters:this.layer.customParameters,maxRecordCount:this.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{Loadable as n}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{debounce as i,eachAlways as a}from"../../../core/promiseUtils.js";import{open as o}from"../../../core/workers.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import l from"../../../geometry/Extent.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as d,createDrawingInfo as f}from"./support/clientSideDefaults.js";import{getCapabilities as p,getWFSLayerInfo as m,prepareWFSLayerFields as h,findFeatureType as g}from"../../ogc/wfsUtils.js";import _ from"../../../rest/support/AttributeBinsFeatureSet.js";import v from"../../../rest/support/FeatureSet.js";import{utc as y}from"../../../time/constants.js";let b=class extends n{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=d(!1,!1),this.type=`wfs`,this.refresh=i(async()=>{await this.load();let e=this.layer.maxRecordCount,t={customParameters:this.layer.customParameters,maxRecordCount:Math.min(e,this.wfsCapabilities.operations.GetFeature.countDefault??e),maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:n}=await this._workerHandler.refresh(t);return n&&(this.sourceJSON.extent=n),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){let n=await this.queryFeaturesJSON(e,t);return v.fromJSON(n)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._workerHandler.queryFeatures(e?e.toJSON():void 0,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,t)}async queryObjectIds(e,t={}){return await this.load(t),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,t)}async queryExtent(e,t={}){await this.load(t);let n=await this._workerHandler.queryExtent(e?e.toJSON():void 0,t);return{count:n.count,extent:l.fromJSON(n.extent)}}async querySnapping(e,t={}){return await this.load(t),this._workerHandler.querySnapping(e,t)}async queryAttributeBins(e,t={}){await this.load(t);let n=await this._workerHandler.queryAttributeBins(e?.toJSON(),t);return _.fromJSON(n)}async _createLoadOptions(e){let{url:n,customParameters:r,name:i,namespaceUri:a,fields:o,geometryType:s,maxRecordCount:c,maxPageCount:l,maxTotalRecordCount:d,swapXY:f}=this.layer,_=this.layer.originOf(`spatialReference`)===`defaults`?void 0:this.layer.spatialReference;if(!n)throw new t(`wfs-layer:missing-url`,`WFSLayer must be created with a url`);this.wfsCapabilities||=await p(n,{customParameters:r,...e});let v=[`fields`,`geometryType`,`name`,`namespaceUri`,`swapXY`].some(e=>this.layer[e]==null)?await m(this.wfsCapabilities,i,a,{spatialReference:_,customParameters:r,signal:e?.signal}):{...h(o??[]),geometryType:s,name:i,namespaceUri:a,spatialReference:_,swapXY:f},y=g(this.wfsCapabilities.readFeatureTypes(),v.name,v.namespaceUri),b=u.toJSON(v.geometryType),{operations:x}=this.wfsCapabilities,S=x.GetFeature.url,C=x.GetFeature.outputFormat;return{customParameters:r,featureType:y,fields:v.fields?.map(e=>e.toJSON())??[],geometryField:v.geometryField,geometryType:b,getFeatureUrl:S,getFeatureOutputFormat:C,maxRecordCount:Math.min(c,x.GetFeature.countDefault??c),maxPageCount:l,maxTotalRecordCount:d,objectIdField:v.objectIdField,spatialReference:v.spatialReference?.toJSON(),swapXY:!!v.swapXY}}async _startWorker(e){let[t,n]=await a([this._createLoadOptions(e),o(`WFSSourceWorker`,{...e,strategy:has(`feature-layers-workers`)?`dedicated`:`local`,registryTarget:this})]),i=t.error||n.error||null,s=n.value||null;if(i)throw s&&s.close(),i;let c=t.value;this._connection=n.value,this._workerHandler=this._connection.createInvokeProxy();let l=await this._workerHandler.load(c,e);for(let e of l.warnings)r.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:y},extent:l.extent,fields:c.fields,geometryType:c.geometryType,objectIdField:c.objectIdField,geometryField:c.geometryField,drawingInfo:f(c.geometryType),name:c.featureType.title,wfsInfo:{name:c.featureType.name,featureUrl:c.getFeatureUrl,maxFeatures:this.wfsCapabilities.operations.GetFeature.countDefault??c.maxRecordCount,swapXY:c.swapXY,supportedSpatialReferences:c.featureType.supportedSpatialReferences,version:`2.0.0`,wfsNamespace:c.featureType.namespaceUri}}}};e([s()],b.prototype,`capabilities`,void 0),e([s({constructOnly:!0})],b.prototype,`layer`,void 0),e([s()],b.prototype,`sourceJSON`,void 0),e([s()],b.prototype,`type`,void 0),e([s()],b.prototype,`wfsCapabilities`,void 0),b=e([c(`esri.layers.graphics.sources.WFSSource`)],b);export{b as WFSSource};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{isDateString as e}from"../../../../core/date.js";import t from"../../../../core/Error.js";import{isWGS84 as n}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromMultipoint as r,convertFromPolyline as i}from"../../featureConversionUtils.js";import{OptimizedFeature as a}from"../../OptimizedFeature.js";import o from"../../OptimizedGeometry.js";import{normalizeFieldName as s,isNumericField as c}from"../../../support/fieldUtils.js";const l={LineString:`esriGeometryPolyline`,MultiLineString:`esriGeometryPolyline`,MultiPoint:`esriGeometryMultipoint`,Point:`esriGeometryPoint`,Polygon:`esriGeometryPolygon`,MultiPolygon:`esriGeometryPolygon`};function u(e){return l[e]}function*d(e){switch(e.type){case`Feature`:yield e;break;case`FeatureCollection`:for(let t of e.features)t&&(yield t)}}function*f(e){if(e)switch(e.type){case`Point`:yield e.coordinates;break;case`LineString`:case`MultiPoint`:yield*e.coordinates;break;case`MultiLineString`:case`Polygon`:for(let t of e.coordinates)yield*t;break;case`MultiPolygon`:for(let t of e.coordinates)for(let e of t)yield*e}}function*p(e,t={}){let{geometryType:n,objectIdField:r}=t;for(let i of e){let{geometry:e,properties:o,id:s}=i;if(e&&u(e.type)!==n)continue;let c=o||{},l;r&&(l=c[r],s!=null&&!l&&(c[r]=l=s)),yield new a(e&&y(e,t),c,null,l)}}function m(e){for(let t of e)if(t.length>2)return!0;return!1}function h(e){return!_(e)}function g(e){return _(e)}function _(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];t+=r[0]*i[1]-i[0]*r[1]}return t<=0}function v(e){let t=e[0],n=e[e.length-1];(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2])&&e.push(t)}function y(e,t){let{coordinates:n,type:a}=e,s=t.hasZ??!1;switch(a){case`Point`:return new o([],
|
|
2
|
+
import{isDateString as e}from"../../../../core/date.js";import t from"../../../../core/Error.js";import{isWGS84 as n}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromMultipoint as r,convertFromPolyline as i}from"../../featureConversionUtils.js";import{OptimizedFeature as a}from"../../OptimizedFeature.js";import o from"../../OptimizedGeometry.js";import{normalizeFieldName as s,isNumericField as c}from"../../../support/fieldUtils.js";const l={LineString:`esriGeometryPolyline`,MultiLineString:`esriGeometryPolyline`,MultiPoint:`esriGeometryMultipoint`,Point:`esriGeometryPoint`,Polygon:`esriGeometryPolygon`,MultiPolygon:`esriGeometryPolygon`};function u(e){return l[e]}function*d(e){switch(e.type){case`Feature`:yield e;break;case`FeatureCollection`:for(let t of e.features)t&&(yield t)}}function*f(e){if(e)switch(e.type){case`Point`:yield e.coordinates;break;case`LineString`:case`MultiPoint`:yield*e.coordinates;break;case`MultiLineString`:case`Polygon`:for(let t of e.coordinates)yield*t;break;case`MultiPolygon`:for(let t of e.coordinates)for(let e of t)yield*e}}function*p(e,t={}){let{geometryType:n,objectIdField:r}=t;for(let i of e){let{geometry:e,properties:o,id:s}=i;if(e&&u(e.type)!==n)continue;let c=o||{},l;r&&(l=c[r],s!=null&&!l&&(c[r]=l=s)),yield new a(e&&y(e,t),c,null,l)}}function m(e){for(let t of e)if(t.length>2)return!0;return!1}function h(e){return!_(e)}function g(e){return _(e)}function _(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];t+=r[0]*i[1]-i[0]*r[1]}return t<=0}function v(e){let t=e[0],n=e[e.length-1];(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2])&&e.push(t)}function y(e,t){let{coordinates:n,type:a}=e,s=t.hasZ??!1;switch(a){case`Point`:{let e=!s&&n.length===3?n.slice(0,2):s&&n.length===2?[...n,0]:[...n];return new o([],e,s,!1)}case`LineString`:return i({paths:[n],hasZ:!0},s,!1);case`MultiLineString`:return i({paths:n,hasZ:!0},s,!1);case`MultiPoint`:return r({points:n,hasZ:!0},s,!1);case`Polygon`:case`MultiPolygon`:{let e=new o([],[],s,!1);for(let t of a===`Polygon`?[n]:n){b(e,t[0],s);for(let n=1;n<t.length;n++)x(e,t[n],s)}return e}}}function b(e,t,n){v(t),h(t)?C(e,t,n):S(e,t,n)}function x(e,t,n){v(t),g(t)?C(e,t,n):S(e,t,n)}function S(e,t,n){for(let r of t)w(e,r,n);e.lengths.push(t.length)}function C(e,t,n){for(let r=t.length-1;r>=0;r--)w(e,t[r],n);e.lengths.push(t.length)}function w(e,[t,n,r],i){e.coords.push(t,n),i&&e.coords.push(r||0)}function T(t){switch(typeof t){case`string`:return e(t)?`esriFieldTypeDate`:`esriFieldTypeString`;case`number`:return`esriFieldTypeDouble`;default:return`unknown`}}function E(e,r=4326){if(!e)throw new t(`geojson-layer:empty`,`GeoJSON data is empty`);if(e.type!==`Feature`&&e.type!==`FeatureCollection`)throw new t(`geojson-layer:unsupported-geojson-object`,`missing or not supported GeoJSON object type`,{data:e});let{crs:i}=e;if(!i)return;let a=typeof i==`string`?i:i.type===`name`?i.properties.name:i.type===`EPSG`?i.properties.code:null,o=n({wkid:r})?RegExp(`.*(CRS84H?|4326)$`,`i`):RegExp(`.*(${r})$`,`i`);if(!a||!o.test(a))throw new t(`geojson:unsupported-crs`,`unsupported GeoJSON 'crs' member`,{crs:i})}function D(e,t={}){let n=[],r=new Set,i=new Set,a=!1,o=null,l=!1,p,{geometryType:h=null}=t;for(let t of d(e)){let{geometry:e,properties:c,id:d}=t;if(!(e&&(h||=u(e.type),u(e.type)!==h))&&(a||=m(f(e)),l||(l=d!=null,l&&(p=typeof d,c&&(o=Object.keys(c).filter(e=>c[e]===d)))),c&&o&&l&&d!=null&&(o.length>1?o=o.filter(e=>c[e]===d):o.length===1&&(o=c[o[0]]===d?o:[])),c))for(let e in c){if(r.has(e))continue;let t=c[e],a=T(t);if(a===`unknown`){i.add(e);continue}i.delete(e),r.add(e);let o=s(e);o&&n.push({name:o,alias:e,type:a})}}let g=s(o?.length===1&&o[0]||null)??void 0;if(g){for(let e of n)if(e.name===g&&c(e)){e.type=`esriFieldTypeOID`;break}}return{fields:n,geometryType:h,hasZ:a,objectIdFieldName:g,objectIdFieldType:p,unknownFields:Array.from(i)}}function O(e,t){return Array.from(p(d(e),t))}export{O as createOptimizedFeatures,u as getGeometryType,D as inferLayerProperties,E as validateGeoJSON};
|