@arcgis/core 5.0.0-next.15 → 5.0.0-next.17
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/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/234b52b2a391631ceff6.js +1 -0
- package/assets/esri/core/workers/chunks/{8f3503b2fb6cd38757b9.js → 458e87902abc24b375da.js} +1 -1
- package/assets/esri/core/workers/chunks/{57b410198d83bf0ab708.js → 4a89e120be142ab58a27.js} +1 -1
- package/assets/esri/core/workers/chunks/{a410dcf80d17a2383337.js → 65a4099bdbe31834d0cc.js} +1 -1
- package/assets/esri/core/workers/chunks/71d9e9b0a7f8c0edd32d.js +1 -0
- package/assets/esri/core/workers/chunks/722da7a39a0ad9300752.js +1 -0
- package/assets/esri/core/workers/chunks/{cdb4664fd59860ddeb5a.js → 888f188541f8bd68e33e.js} +1 -1
- package/assets/esri/core/workers/chunks/{319c3f46f2afb8f3e5a9.js → 89c9cf7f799858d14c76.js} +1 -1
- package/assets/esri/core/workers/chunks/{e19cd07df8ce87e18832.js → 8b33732e3c2924c1f60d.js} +1 -1
- package/assets/esri/core/workers/chunks/98739414c107ad78e4d8.js +1 -0
- package/assets/esri/core/workers/chunks/{bc318b6fef192cee2a72.js → a4518f25b9f8fe704286.js} +17 -17
- package/assets/esri/core/workers/chunks/{8b73db0f4d6714396eb0.js → a6fa90eab77ac0e1cdfc.js} +1 -1
- package/assets/esri/core/workers/chunks/ac366221e8636b60aee5.js +1 -0
- package/assets/esri/core/workers/chunks/{23e17b745adf71a5efc7.js → aca72ca7f43f70eb8077.js} +1 -1
- package/assets/esri/core/workers/chunks/ad0c7225941437d18408.js +1 -0
- package/assets/esri/core/workers/chunks/b30897952494a3e5b9fe.js +1 -0
- package/assets/esri/core/workers/chunks/bfd3d81e8e148be99686.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/lyr3DMain.js +1 -1
- package/config.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
- package/graphic/graphicOriginUtils.js +1 -1
- package/interfaces.d.ts +68 -28
- package/kernel.js +1 -1
- package/layers/BingMapsLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/support/attributionUtils.js +5 -0
- package/layers/support/fieldConfigUtils.js +1 -1
- package/layers/support/fieldFormatUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/SDFHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
- package/views/3d/environment/CloudsTechnique.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/FlowWorker.js +1 -1
- package/views/3d/support/flow/FlowWorkerHandle.js +1 -1
- package/views/3d/support/flow/StreamlineResources3D.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/support/flow/constants.js +1 -1
- package/views/3d/support/flow/loadUtils.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/terrain/BlendLayersTechnique.js +1 -1
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +14 -32
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +17 -0
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +10 -0
- package/views/3d/webgl-engine/core/shaderTechnique/{ReloadableShaderModule.js → ReloadableShader.js} +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +5 -0
- package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillCompositionTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillReductionTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillTargetDepthTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastClearTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/types.d.ts +5 -0
- package/views/analysis/ElevationProfile/types.js +5 -0
- package/views/input/gamepad/GamepadInputDevice.js +1 -1
- package/views/input/gamepad/GamepadSource.js +1 -1
- package/views/navigation/gamepad/GamepadSettings.js +1 -1
- package/views/webgl/VertexAttributeLocations.js +1 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/097e5deb51ee7e25e654.js +0 -1
- package/assets/esri/core/workers/chunks/38ee69125da60464d5a1.js +0 -1
- package/assets/esri/core/workers/chunks/4f0016111fd84c612f41.js +0 -1
- package/assets/esri/core/workers/chunks/8208dfa8f7fae7e616b9.js +0 -1
- package/assets/esri/core/workers/chunks/847f4fc39100fac1df01.js +0 -1
- package/assets/esri/core/workers/chunks/ab005fe84952f0676020.js +0 -1
- package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +0 -1
- package/assets/esri/core/workers/chunks/c3dcfe26c2c3c829762d.js +0 -1
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ZEROS as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{terrainDepthTest as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ComputeCovariance as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js";import{FastApproximateTrigonometry as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js";import{GaussianSplatUnpacking as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as u,If as p}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerBindUniform as v}from"../views/3d/webgl-engine/core/shaderModules/IntegerBindUniform.js";import{IntegerPassUniform as
|
|
5
|
+
import{ZEROS as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{terrainDepthTest as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ComputeCovariance as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js";import{FastApproximateTrigonometry as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js";import{GaussianSplatUnpacking as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as u,If as p}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerBindUniform as v}from"../views/3d/webgl-engine/core/shaderModules/IntegerBindUniform.js";import{IntegerPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Matrix4BindUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{getGaussianSplatAlphaCutoffValue as g}from"../views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";import{NoParameters as x}from"../views/webgl/NoParameters.js";import{ShaderBuilder as w}from"../views/webgl/ShaderBuilder.js";class y extends x{constructor(){super(...arguments),this.totalGaussians=-1,this.focalLength=-1,this.minSplatRadius=-1,this.tanFov=e,this.cameraDelta=n,this.cameraPos8k=n}}function b(e){const n=new w;n.varyings.add("vColor","vec4"),n.varyings.add("conicOpacity","vec4"),n.varyings.add("depth","float"),n.varyings.add("gaussianCenterScreenPos","vec2"),n.varyings.add("fragScreenPos","vec2"),n.varyings.add("offsetFromCenter","vec2"),n.outputs.add("fragColor","vec4",0),n.vertex.uniforms.add(new f("splatOrderTexture",e=>e.splatOrder),new f("splatAtlasTexture",e=>e.splatAtlas),new h("numSplats",e=>e.totalGaussians),new d("focalLength",e=>e.focalLength),new d("minSplatRadius",e=>e.minSplatRadius),new s("tanFov",e=>e.tanFov),new l("cameraDelta",e=>e.cameraDelta),new l("cameraPos8k",e=>e.cameraPos8k),new v("fullWidth",({camera:e})=>e.viewport[2]),new v("fullHeight",({camera:e})=>e.viewport[3]),new m("proj",e=>e.camera.projectionMatrix),new m("view",e=>e.camera.viewMatrix),new c("cameraPosition",e=>e.camera.eye)),n.vertex.include(o),n.vertex.include(r),n.vertex.include(i),n.vertex.include(t),n.include(a,e);const x=g(e.alphaCutoff),y=Math.log(x),b=-2*y;n.vertex.code.add(u`float ndcToPixel(float ndcCoord, float screenSize) {
|
|
6
6
|
return ((ndcCoord + 1.0) * screenSize - 1.0) * 0.5;
|
|
7
|
-
}`),n.vertex.main.add(`\n uint instanceID = uint(gl_InstanceID);\n\n // Transform the instanceID into 2D coordinates\n uint orderTextureWidth = uint(textureSize(splatOrderTexture, 0).x);\n uint x = instanceID % orderTextureWidth;\n uint y = instanceID / orderTextureWidth;\n\n // Fetch the index of the remaining frontmost Gaussian\n uint gaussianIndex = texelFetch(splatOrderTexture, ivec2(x, y), 0).r;\n\n uint splatAtlasWidth = uint(textureSize(splatAtlasTexture, 0).x);\n\n // Fetch the packed Gaussian according to the index\n uint gaussianIndexX = gaussianIndex % splatAtlasWidth;\n uint gaussianIndexY = gaussianIndex / splatAtlasWidth;\n uvec4 packedGaussian = texelFetch(splatAtlasTexture, ivec2(gaussianIndexX, gaussianIndexY), 0);\n\n // Fetch the header associated with the packed Gaussian (contains tile origin and number of fractional bits)\n uint pageNum = gaussianIndex / 1024u;\n uint headerIndex = (pageNum + 1u) * 1024u - 1u;\n uint headerIndexX = headerIndex % splatAtlasWidth;\n uint headerIndexY = headerIndex / splatAtlasWidth;\n uvec4 packedHeader = texelFetch(splatAtlasTexture, ivec2(headerIndexX, headerIndexY), 0);\n\n // Unpack the Gaussian\n vColor = unpackColor(packedGaussian);\n
|
|
7
|
+
}`),n.vertex.main.add(`\n uint instanceID = uint(gl_InstanceID);\n\n // Transform the instanceID into 2D coordinates\n uint orderTextureWidth = uint(textureSize(splatOrderTexture, 0).x);\n uint x = instanceID % orderTextureWidth;\n uint y = instanceID / orderTextureWidth;\n\n // Fetch the index of the remaining frontmost Gaussian\n uint gaussianIndex = texelFetch(splatOrderTexture, ivec2(x, y), 0).r;\n\n uint splatAtlasWidth = uint(textureSize(splatAtlasTexture, 0).x);\n\n // Fetch the packed Gaussian according to the index\n uint gaussianIndexX = gaussianIndex % splatAtlasWidth;\n uint gaussianIndexY = gaussianIndex / splatAtlasWidth;\n uvec4 packedGaussian = texelFetch(splatAtlasTexture, ivec2(gaussianIndexX, gaussianIndexY), 0);\n\n // Fetch the header associated with the packed Gaussian (contains tile origin and number of fractional bits)\n uint pageNum = gaussianIndex / 1024u;\n uint headerIndex = (pageNum + 1u) * 1024u - 1u;\n uint headerIndexX = headerIndex % splatAtlasWidth;\n uint headerIndexY = headerIndex / splatAtlasWidth;\n uvec4 packedHeader = texelFetch(splatAtlasTexture, ivec2(headerIndexX, headerIndexY), 0);\n\n // Unpack the Gaussian\n vColor = unpackColor(packedGaussian);\n\n if(vColor.a < ${x}) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n vec3 scale = unpackScale(packedGaussian); \n vec4 quaternion = unpackQuaternion(packedGaussian);\n mat3 rotation = quaternionToRotationMatrix(quaternion);\n vec3 tileOriginRelativePosition = unpackTileOriginRelativePosition(packedGaussian);\n\n vec3 cameraRelativePosition = unpackCameraRelativeGaussianPosition(packedHeader, tileOriginRelativePosition, cameraPosition, cameraPos8k, cameraDelta);\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > 1.0) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n forwardViewPosDepth(viewPos.xyz);\n\n vec3 covarianceA;\n vec3 covarianceB;\n computeCovariance3D(rotation, scale.xyz, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n \n // Invert covariance (EWA algorithm)\n float determinant = (covariance2D.x * covariance2D.z - covariance2D.y * covariance2D.y);\n if (determinant == 0.) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n float invDeterminant = 1. / determinant;\n \n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n\n // Compute extent in screen space (by finding the eigenvalues of the 2D covariance matrix). \n // Use the extent to compute the bounding rectangle of the Gaussian in screen space.\n float mid = 0.5 * (covariance2D.x + covariance2D.z);\n float delta = sqrt(max(0.1, mid * mid - determinant));\n float lambda1 = mid + delta;\n float lambda2 = mid - delta;\n // Compute principal radii (a and b)\n float a = sqrt(${b} * lambda1); // Semi-major axis\n float b = sqrt(${b} * lambda2); // Semi-minor axis\n \n // Compute rotation angle phi from covariance\n float delta_angle = covariance2D.x - covariance2D.z;\n float phi = 0.5 * fastAtan2(2.0 * covariance2D.y, delta_angle);\n \n // Compute projected axis-aligned extents\n float cos_phi = fastCos(phi);\n float sin_phi = fastSin(phi);\n float radius_x = ceil(sqrt(a * a * cos_phi * cos_phi + b * b * sin_phi * sin_phi));\n float radius_y = ceil(sqrt(a * a * sin_phi * sin_phi + b * b * cos_phi * cos_phi));\n gaussianCenterScreenPos = vec2(ndcToPixel(ndcPos.x, float(fullWidth)), ndcToPixel(ndcPos.y, float(fullHeight)));\n\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(minSplatRadius > 0.0) {\n float effectiveSize = max(radius_x, radius_y) * vColor.a;\n if(effectiveSize < minSplatRadius) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n }\n\n // This maps vertex IDs 0, 1, 2, 3 to (-1,-1), (1,-1), (-1,1), (1,1)\n vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.0;\n\n // Vertex (corner) position in screen space\n fragScreenPos = gaussianCenterScreenPos + vec2(radius_x * corner.x, radius_y * corner.y);\n\n // We use a conic function to derive the opacity\n vec3 conic = vec3(covariance2D.z, -covariance2D.y, covariance2D.x) * invDeterminant;\n conicOpacity = vec4(conic, vColor.a);\n\n depth = ndcPos.z;\n \n // Convert from screen-space to clip-space\n vec2 clipPos = fragScreenPos / vec2(fullWidth, fullHeight) * 2. - 1.;\n\n offsetFromCenter = gaussianCenterScreenPos - fragScreenPos;\n\n gl_Position = vec4(clipPos, depth, 1.0);\n\n `);const P=e.depthPass;return n.fragment.main.add(`\n discardByTerrainDepth();\n\n // Evaluate the 2D elliptical Gaussian exponent using the general conic form: Ax^2+2Bxy+Cy^2\n float x = offsetFromCenter.x;\n float y = offsetFromCenter.y;\n float conic = dot(conicOpacity.xyz, vec3(x * x, 2.0 * x * y, y * y)); \n float gaussianExponent = -0.5 * conic;\n\n // A positive exponent indicates alpha > 1, this should not happen\n // We also early check the alphaCutoff (i.e., ln(alphaCutoff)), to avoid unnecessary exp()\n if (gaussianExponent > 0.0 || gaussianExponent < ${y}) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n \n // cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n // We cannot write color and depth in the same pass, as they require different blend modes.\n // Regular depth writing based on first hit is not precise enough due to the inherently \n // transparent nature of Gaussian Splats (especially at the borders of the Splat).\n // We thus use a blended depth that computes a non-linear average using \n // the splat order and opacity with geometric decay.\n // This means the depth is averaged based on the order and opacity of the Gaussians,\n // with the frontmost Gaussians contributing the most.\n ${p(P,"fragColor = vec4(depth, 0, 0, alpha);","fragColor = vec4(vColor.rgb * alpha, alpha);")}\n `),n}const P=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:y,build:b},Symbol.toStringTag,{value:"Module"}));export{y as G,P as a,b};
|
package/chunks/lyr3DMain.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{g as r}from"./_commonjsHelpers.js";var e,t={exports:{}};function n(){return e||(e=1,r=t,n="undefined"!=typeof document?document.currentScript?.src:void 0,a=async function(r={}){var e,t=r,a="./this.program",o="";function i(r){return t.locateFile?t.locateFile(r,o):o+r}try{o=new URL(".",n).href}catch{}e=async r=>{var e=await fetch(r,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)},console.log.bind(console);var u,s,f,l,c,p,v,d,h,g,m,y,w,T,A=console.error.bind(console),b=!1,P=!1;function C(){var r=l.buffer;c=new Int8Array(r),v=new Int16Array(r),t.HEAPU8=p=new Uint8Array(r),d=new Uint16Array(r),h=new Int32Array(r),t.HEAPU32=g=new Uint32Array(r),m=new Float32Array(r),t.HEAPF64=y=new Float64Array(r),w=new BigInt64Array(r),T=new BigUint64Array(r)}function W(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)z(t.preRun.shift());H(L)}function E(){P=!0,Ne.E()}function F(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)N(t.postRun.shift());H(j)}var _,x=0,R=null;function $(r){x++,t.monitorRunDependencies?.(x)}function S(r){if(x--,t.monitorRunDependencies?.(x),0==x&&R){var e=R;R=null,e()}}function k(r){t.onAbort?.(r),A(r="Aborted("+r+")"),b=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw f?.(e),e}function I(){return i("lyr3DMain.wasm")}function U(r){if(r==_&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}async function O(r){if(!u)try{var t=await e(r);return new Uint8Array(t)}catch{}return U(r)}async function D(r,e){try{var t=await O(r);return await WebAssembly.instantiate(t,e)}catch(n){A(`failed to asynchronously prepare wasm: ${n}`),k(n)}}async function V(r,e,t){if(!r&&"function"==typeof WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(a){A(`wasm streaming compile failed: ${a}`),A("falling back to ArrayBuffer instantiation")}return D(e,t)}function B(){return{a:je}}async function M(){function r(r,e){return Ne=r.exports,l=Ne.D,C(),Fr=Ne.G,He(Ne),S(),Ne}function e(e){return r(e.instance)}$();var n=B();return t.instantiateWasm?new Promise((e,a)=>{t.instantiateWasm(n,(t,n)=>{e(r(t))})}):(_??=I(),e(await V(u,_,n)))}var H=r=>{for(;r.length>0;)r.shift()(t)},j=[],N=r=>j.push(r),L=[],z=r=>L.push(r);class G{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){g[this.ptr+4>>2]=r}get_type(){return g[this.ptr+4>>2]}set_destructor(r){g[this.ptr+8>>2]=r}get_destructor(){return g[this.ptr+8>>2]}set_caught(r){r=r?1:0,c[this.ptr+12]=r}get_caught(){return 0!=c[this.ptr+12]}set_rethrown(r){r=r?1:0,c[this.ptr+13]=r}get_rethrown(){return 0!=c[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){g[this.ptr+16>>2]=r}get_adjusted_ptr(){return g[this.ptr+16>>2]}}var Y=(r,e,t)=>{throw new G(r).init(e,t),r},q=()=>k(""),J={},K=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function Q(r){return this.fromWireType(g[r>>2])}var X={},Z={},rr={},er=class extends Error{constructor(r){super(r),this.name="InternalError"}},tr=r=>{throw new er(r)},nr=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&tr("Mismatched type converter count");for(var a=0;a<r.length;++a)cr(r[a],n[a])}r.forEach(r=>rr[r]=e);var a=new Array(e.length),o=[],i=0;e.forEach((r,e)=>{Z.hasOwnProperty(r)?a[e]=Z[r]:(o.push(r),X.hasOwnProperty(r)||(X[r]=[]),X[r].push(()=>{a[e]=Z[r],++i===o.length&&n(a)}))}),0===o.length&&n(a)},ar=r=>{var e=J[r];delete J[r];var t=e.elements,n=t.length,a=t.map(r=>r.getterReturnType).concat(t.map(r=>r.setterArgumentType)),o=e.rawConstructor,i=e.rawDestructor;nr([r],a,r=>(t.forEach((e,t)=>{var a=r[t],o=e.getter,i=e.getterContext,u=r[t+n],s=e.setter,f=e.setterContext;e.read=r=>a.fromWireType(o(i,r)),e.write=(r,e)=>{var t=[];s(f,r,u.toWireType(t,e)),K(t)}}),[{name:e.name,fromWireType:r=>{for(var e=new Array(n),a=0;a<n;++a)e[a]=t[a].read(r);return i(r),e},toWireType:(r,a)=>{if(n!==a.length)throw new TypeError(`Incorrect number of tuple elements for ${e.name}: expected=${n}, actual=${a.length}`);for(var u=o(),s=0;s<n;++s)t[s].write(u,a[s]);return null!==r&&r.push(i,u),u},argPackAdvance:dr,readValueFromPointer:Q,destructorFunction:i}]))},or={},ir=r=>{var e=or[r];delete or[r];var t=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(r=>r.getterReturnType).concat(a.map(r=>r.setterArgumentType));nr([r],o,r=>{var o={};return a.forEach((e,t)=>{var n=e.fieldName,i=r[t],u=r[t].optional,s=e.getter,f=e.getterContext,l=r[t+a.length],c=e.setter,p=e.setterContext;o[n]={read:r=>i.fromWireType(s(f,r)),write:(r,e)=>{var t=[];c(p,r,l.toWireType(t,e)),K(t)},optional:u}}),[{name:e.name,fromWireType:r=>{var e={};for(var t in o)e[t]=o[t].read(r);return n(r),e},toWireType:(r,e)=>{for(var a in o)if(!(a in e)&&!o[a].optional)throw new TypeError(`Missing field: "${a}"`);var i=t();for(a in o)o[a].write(i,e[a]);return null!==r&&r.push(n,i),i},argPackAdvance:dr,readValueFromPointer:Q,destructorFunction:n}]})},ur=r=>{for(var e="";;){var t=p[r++];if(!t)return e;e+=String.fromCharCode(t)}},sr=class extends Error{constructor(r){super(r),this.name="BindingError"}},fr=r=>{throw new sr(r)};function lr(r,e,t={}){var n=e.name;if(r||fr(`type "${n}" must have a positive integer typeid pointer`),Z.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;fr(`Cannot register type '${n}' twice`)}if(Z[r]=e,delete rr[r],X.hasOwnProperty(r)){var a=X[r];delete X[r],a.forEach(r=>r())}}function cr(r,e,t={}){return lr(r,e,t)}var pr=(r,e,t)=>{switch(e){case 1:return t?r=>c[r]:r=>p[r];case 2:return t?r=>v[r>>1]:r=>d[r>>1];case 4:return t?r=>h[r>>2]:r=>g[r>>2];case 8:return t?r=>w[r>>3]:r=>T[r>>3];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},vr=(r,e,t,n,a)=>{e=ur(e);const o=0n===n;let i=r=>r;if(o){const r=8*t;i=e=>BigInt.asUintN(r,e),a=i(a)}cr(r,{name:e,fromWireType:i,toWireType:(r,e)=>("number"==typeof e&&(e=BigInt(e)),e),argPackAdvance:dr,readValueFromPointer:pr(e,t,!o),destructorFunction:null})},dr=8,hr=(r,e,t,n)=>{cr(r,{name:e=ur(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:dr,readValueFromPointer:function(r){return this.fromWireType(p[r])},destructorFunction:null})},gr=[],mr=[0,1,,1,null,1,!0,1,!1,1],yr=r=>{r>9&&0===--mr[r+1]&&(mr[r]=void 0,gr.push(r))},wr={toValue:r=>(r||fr(`Cannot use deleted val. handle = ${r}`),mr[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=gr.pop()||mr.length;return mr[e]=r,mr[e+1]=1,e}}}},Tr={name:"emscripten::val",fromWireType:r=>{var e=wr.toValue(r);return yr(r),e},toWireType:(r,e)=>wr.toHandle(e),argPackAdvance:dr,readValueFromPointer:Q,destructorFunction:null},Ar=r=>cr(r,Tr),br=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(m[r>>2])};case 8:return function(r){return this.fromWireType(y[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Pr=(r,e,t)=>{cr(r,{name:e=ur(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:dr,readValueFromPointer:br(e,t),destructorFunction:null})},Cr=(r,e)=>Object.defineProperty(e,"name",{value:r});function Wr(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}function Er(r,e,t,n,a,o){var i=e.length;i<2&&fr("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var u=Wr(e),s="void"!==e[0].name,f=i-2,l=new Array(f),c=[],p=[];return Cr(r,function(...r){var t;p.length=0,c.length=1,c[0]=a;for(var o=0;o<f;++o)l[o]=e[o+2].toWireType(p,r[o]),c.push(l[o]);function i(r){if(u)K(p);else for(var n=2;n<e.length;n++){var a=1===n?t:l[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(a)}if(s)return e[0].fromWireType(r)}return i(n(...c))})}var Fr,_r=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||fr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},xr=(r,e,n)=>{t.hasOwnProperty(r)?((void 0===n||void 0!==t[r].overloadTable&&void 0!==t[r].overloadTable[n])&&fr(`Cannot register public name '${r}' twice`),_r(t,r,r),t[r].overloadTable.hasOwnProperty(n)&&fr(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),t[r].overloadTable[n]=e):(t[r]=e,t[r].argCount=n)},Rr=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(g[e+4*n>>2]);return t},$r=(r,e,n)=>{t.hasOwnProperty(r)||tr("Replacing nonexistent public symbol"),void 0!==t[r].overloadTable&&void 0!==n?t[r].overloadTable[n]=e:(t[r]=e,t[r].argCount=n)},Sr=[],kr=r=>{var e=Sr[r];return e||(Sr[r]=e=Fr.get(r)),e},Ir=(r,e,t=!1)=>{function n(){return kr(e)}r=ur(r);var a=n();return"function"!=typeof a&&fr(`unknown function pointer with signature ${r}: ${e}`),a};class Ur extends Error{}var Or,Dr,Vr,Br,Mr=r=>{var e=Dr(r),t=ur(e);return Br(e),t},Hr=(r,e)=>{var t=[],n={};function a(r){n[r]||Z[r]||(rr[r]?rr[r].forEach(a):(t.push(r),n[r]=!0))}throw e.forEach(a),new Ur(`${r}: `+t.map(Mr).join([", "]))},jr=r=>{const e=(r=r.trim()).indexOf("(");return-1===e?r:r.slice(0,e)},Nr=(r,e,t,n,a,o,i,u)=>{var s=Rr(e,t);r=ur(r),r=jr(r),a=Ir(n,a,i),xr(r,function(){Hr(`Cannot call ${r} due to unbound types`,s)},e-1),nr([],s,t=>{var n=[t[0],null].concat(t.slice(1));return $r(r,Er(r,n,null,a,o),e-1),[]})},Lr=(r,e,t,n,a)=>{e=ur(e);let o=r=>r;if(0===n){var i=32-8*t;o=r=>r<<i>>>i,a=o(a)}cr(r,{name:e,fromWireType:o,toWireType:(r,e)=>e,argPackAdvance:dr,readValueFromPointer:pr(e,t,0!==n),destructorFunction:null})},zr=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];function a(r){var e=g[r>>2],t=g[r+4>>2];return new n(c.buffer,t,e)}cr(r,{name:t=ur(t),fromWireType:a,argPackAdvance:dr,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Gr=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,o=t+n-1,i=0;i<r.length;++i){var u=r.codePointAt(i);if(u<=127){if(t>=o)break;e[t++]=u}else if(u<=2047){if(t+1>=o)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=o)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=o)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u,i++}}return e[t]=0,t-a},Yr=(r,e,t)=>Gr(r,p,e,t),qr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},Jr="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Kr=(r,e=0,t=NaN)=>{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&Jr)return Jr.decode(r.subarray(e,a));for(var o="";e<a;){var i=r[e++];if(128&i){var u=63&r[e++];if(192!=(224&i)){var s=63&r[e++];if((i=224==(240&i)?(15&i)<<12|u<<6|s:(7&i)<<18|u<<12|s<<6|63&r[e++])<65536)o+=String.fromCharCode(i);else{var f=i-65536;o+=String.fromCharCode(55296|f>>10,56320|1023&f)}}else o+=String.fromCharCode((31&i)<<6|u)}else o+=String.fromCharCode(i)}return o},Qr=(r,e)=>r?Kr(p,r,e):"",Xr=(r,e)=>{cr(r,{name:e=ur(e),fromWireType(r){for(var e,t=g[r>>2],n=r+4,a=n,o=0;o<=t;++o){var i=n+o;if(o==t||0==p[i]){var u=Qr(a,i-a);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),a=i+1}}return Br(r),e},toWireType(r,e){var t;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n="string"==typeof e;n||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT||fr("Cannot pass non-string to std::string"),t=n?qr(e):e.length;var a=Vr(4+t+1),o=a+4;return g[a>>2]=t,n?Yr(e,o,t+1):p.set(e,o),null!==r&&r.push(Br,a),a},argPackAdvance:dr,readValueFromPointer:Q,destructorFunction(r){Br(r)}})},Zr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,re=(r,e)=>{for(var t=r>>1,n=t+e/2,a=t;!(a>=n)&&d[a];)++a;if(a-t>16&&Zr)return Zr.decode(d.subarray(t,a));for(var o="",i=t;!(i>=n);++i){var u=d[i];if(0==u)break;o+=String.fromCharCode(u)}return o},ee=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,a=(t-=2)<2*r.length?t/2:r.length,o=0;o<a;++o){var i=r.charCodeAt(o);v[e>>1]=i,e+=2}return v[e>>1]=0,e-n},te=r=>2*r.length,ne=(r,e)=>{for(var t="",n=0;!(n>=e/4);n++){var a=h[r+4*n>>2];if(!a)break;t+=String.fromCodePoint(a)}return t},ae=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,a=n+t-4,o=0;o<r.length;++o){var i=r.codePointAt(o);if(i>65535&&o++,h[e>>2]=i,(e+=4)+4>a)break}return h[e>>2]=0,e-n},oe=r=>{for(var e=0,t=0;t<r.length;++t)r.codePointAt(t)>65535&&t++,e+=4;return e},ie=(r,e,t)=>{var n,a,o,i;t=ur(t),2===e?(n=re,a=ee,i=te,o=r=>d[r>>1]):4===e&&(n=ne,a=ae,i=oe,o=r=>g[r>>2]),cr(r,{name:t,fromWireType:r=>{for(var t,a=g[r>>2],i=r+4,u=0;u<=a;++u){var s=r+4+u*e;if(u==a||0==o(s)){var f=n(i,s-i);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),i=s+e}}return Br(r),t},toWireType:(r,n)=>{"string"!=typeof n&&fr(`Cannot pass non-string to C++ string type ${t}`);var o=i(n),u=Vr(4+o+e);return g[u>>2]=o/e,a(n,u+4,o+e),null!==r&&r.push(Br,u),u},argPackAdvance:dr,readValueFromPointer:Q,destructorFunction(r){Br(r)}})},ue=(r,e,t,n,a,o)=>{J[r]={name:ur(e),rawConstructor:Ir(t,n),rawDestructor:Ir(a,o),elements:[]}},se=(r,e,t,n,a,o,i,u,s)=>{J[r].elements.push({getterReturnType:e,getter:Ir(t,n),getterContext:a,setterArgumentType:o,setter:Ir(i,u),setterContext:s})},fe=(r,e,t,n,a,o)=>{or[r]={name:ur(e),rawConstructor:Ir(t,n),rawDestructor:Ir(a,o),fields:[]}},le=(r,e,t,n,a,o,i,u,s,f)=>{or[r].fields.push({fieldName:ur(e),getterReturnType:t,getter:Ir(n,a),getterContext:o,setterArgumentType:i,setter:Ir(u,s),setterContext:f})},ce=(r,e)=>{cr(r,{isVoid:!0,name:e=ur(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},pe=r=>{r>9&&(mr[r+1]+=1)},ve=()=>wr.toHandle([]),de={},he=r=>{var e=de[r];return void 0===e?ur(r):e},ge=r=>wr.toHandle(he(r)),me=()=>wr.toHandle({}),ye=(r,e,t)=>{r=wr.toValue(r),e=wr.toValue(e),t=wr.toValue(t),r[e]=t},we=(r,e)=>{var t=Z[r];return void 0===t&&fr(`${e} has unknown type ${Mr(r)}`),t},Te=(r,e)=>{var t=(r=we(r,"_emval_take_value")).readValueFromPointer(e);return wr.toHandle(t)},Ae=(r,e,t,n)=>{var a=(new Date).getFullYear(),o=new Date(a,0,1),i=new Date(a,6,1),u=o.getTimezoneOffset(),s=i.getTimezoneOffset(),f=Math.max(u,s);g[r>>2]=60*f,h[e>>2]=Number(u!=s);var l=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=l(u),p=l(s);s<u?(Yr(c,t,17),Yr(p,n,17)):(Yr(c,n,17),Yr(p,t,17))},be=()=>2147483648,Pe=(r,e)=>Math.ceil(r/e)*e,Ce=r=>{var e=(r-l.buffer.byteLength+65535)/65536|0;try{return l.grow(e),C(),1}catch(t){}},We=r=>{var e=p.length;r>>>=0;var t=be();if(r>t)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,r+100663296);var o=Math.min(t,Pe(Math.max(r,a),65536));if(Ce(o))return!0}return!1},Ee={},Fe=()=>a||"./this.program",_e=()=>{if(!_e.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.language||"C").replace("-","_")+".UTF-8",_:Fe()};for(var e in Ee)void 0===Ee[e]?delete r[e]:r[e]=Ee[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);_e.strings=t}return _e.strings},xe=(r,e)=>{var t=0,n=0;for(var a of _e()){var o=e+t;g[r+n>>2]=o,t+=Yr(a,o,1/0)+1,n+=4}return 0},Re=(r,e)=>{var t=_e();g[r>>2]=t.length;var n=0;for(var a of t)n+=qr(a)+1;return g[e>>2]=n,0},$e=(r,e)=>{r<128?e.push(r):e.push(r%128|128,r>>7)},Se=r=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==r[0]?[]:[e[r[0]]]},n=1;n<r.length;++n)t.parameters.push(e[r[n]]);return t},ke=(r,e)=>{var t=r.slice(0,1),n=r.slice(1),a={i:127,p:127,j:126,f:125,d:124,e:111};for(var o of(e.push(96),$e(n.length,e),n))e.push(a[o]);"v"==t?e.push(0):e.push(1,a[t])},Ie=(r,e)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function(Se(e),r);var t=[1];ke(e,t);var n=[0,97,115,109,1,0,0,0,1];$e(t.length,n),n.push(...t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var a=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(a,{e:{f:r}}).exports.f},Ue=(r,e)=>{if(Or)for(var t=r;t<r+e;t++){var n=kr(t);n&&Or.set(n,t)}},Oe=r=>(Or||(Or=new WeakMap,Ue(0,Fr.length)),Or.get(r)||0),De=[],Ve=()=>{if(De.length)return De.pop();try{Fr.grow(1)}catch(A){if(!(A instanceof RangeError))throw A;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return Fr.length-1},Be=(r,e)=>{Fr.set(r,e),Sr[r]=Fr.get(r)},Me=(r,e)=>{var t=Oe(r);if(t)return t;var n=Ve();try{Be(n,r)}catch(A){if(!(A instanceof TypeError))throw A;var a=Ie(r,e);Be(n,a)}return Or.set(r,n),n};function He(r){Dr=r.F,t._malloc=Vr=r.H,t._free=Br=r.I}t.noExitRuntime&&t.noExitRuntime,t.print&&t.print,t.printErr&&(A=t.printErr),t.wasmBinary&&(u=t.wasmBinary),t.arguments&&t.arguments,t.thisProgram&&(a=t.thisProgram),t.addFunction=Me,t.UTF8ToString=Qr;var je={b:Y,x:q,l:ar,o:ir,s:vr,C:hr,A:Ar,r:Pr,d:Nr,j:Lr,c:zr,B:Xr,n:ie,m:ue,f:se,p:fe,e:le,t:ce,a:yr,q:pe,z:ve,i:ge,k:me,g:ye,h:Te,u:Ae,y:We,v:xe,w:Re},Ne=await M();function Le(){function r(){t.calledRun=!0,b||(E(),s?.(t),t.onRuntimeInitialized?.(),F())}x>0?R=Le:(W(),x>0?R=Le:t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),r()},1)):r())}function ze(){if(t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()()}return ze(),Le(),P?t:new Promise((r,e)=>{s=r,f=e})},r.exports=a,r.exports.default=a),t.exports;var r,n,a}const a=r(n()),o=Object.freeze(Object.defineProperty({__proto__:null,default:a},Symbol.toStringTag,{value:"Module"}));export{o as l};
|
|
5
|
+
import{g as r}from"./_commonjsHelpers.js";var e,t={exports:{}};function n(){return e||(e=1,r=t,n="undefined"!=typeof document?document.currentScript?.src:void 0,a=async function(r={}){var e,t=r,a="./this.program",o="";function i(r){return t.locateFile?t.locateFile(r,o):o+r}try{o=new URL(".",n).href}catch{}e=async r=>{var e=await fetch(r,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)};var u,s,f,l,c,p,v,h,d,g,m,y,w,T,A=console.log.bind(console),b=console.error.bind(console),P=!1,C=!1;function W(){var r=l.buffer;c=new Int8Array(r),v=new Int16Array(r),t.HEAPU8=p=new Uint8Array(r),h=new Uint16Array(r),d=new Int32Array(r),t.HEAPU32=g=new Uint32Array(r),m=new Float32Array(r),t.HEAPF64=y=new Float64Array(r),w=new BigInt64Array(r),T=new BigUint64Array(r)}function E(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)G(t.preRun.shift());j(z)}function F(){C=!0,Ye.F()}function _(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)L(t.postRun.shift());j(N)}var x,R=0,$=null;function S(r){R++,t.monitorRunDependencies?.(R)}function k(r){if(R--,t.monitorRunDependencies?.(R),0==R&&$){var e=$;$=null,e()}}function I(r){t.onAbort?.(r),b(r="Aborted("+r+")"),P=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw f?.(e),e}function U(){return i("lyr3DMain.wasm")}function O(r){if(r==x&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}async function D(r){if(!u)try{var t=await e(r);return new Uint8Array(t)}catch{}return O(r)}async function V(r,e){try{var t=await D(r);return await WebAssembly.instantiate(t,e)}catch(n){b(`failed to asynchronously prepare wasm: ${n}`),I(n)}}async function B(r,e,t){if(!r&&"function"==typeof WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(a){b(`wasm streaming compile failed: ${a}`),b("falling back to ArrayBuffer instantiation")}return V(e,t)}function M(){return{a:Ge}}async function H(){function r(r,e){return Ye=r.exports,l=Ye.E,W(),_r=Ye.H,ze(Ye),k(),Ye}function e(e){return r(e.instance)}S();var n=M();return t.instantiateWasm?new Promise((e,a)=>{t.instantiateWasm(n,(t,n)=>{e(r(t))})}):(x??=U(),e(await B(u,x,n)))}var j=r=>{for(;r.length>0;)r.shift()(t)},N=[],L=r=>N.push(r),z=[],G=r=>z.push(r);class Y{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){g[this.ptr+4>>2]=r}get_type(){return g[this.ptr+4>>2]}set_destructor(r){g[this.ptr+8>>2]=r}get_destructor(){return g[this.ptr+8>>2]}set_caught(r){r=r?1:0,c[this.ptr+12]=r}get_caught(){return 0!=c[this.ptr+12]}set_rethrown(r){r=r?1:0,c[this.ptr+13]=r}get_rethrown(){return 0!=c[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){g[this.ptr+16>>2]=r}get_adjusted_ptr(){return g[this.ptr+16>>2]}}var q=(r,e,t)=>{throw new Y(r).init(e,t),r},J=()=>I(""),K={},Q=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function X(r){return this.fromWireType(g[r>>2])}var Z={},rr={},er={},tr=class extends Error{constructor(r){super(r),this.name="InternalError"}},nr=r=>{throw new tr(r)},ar=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&nr("Mismatched type converter count");for(var a=0;a<r.length;++a)pr(r[a],n[a])}r.forEach(r=>er[r]=e);var a=new Array(e.length),o=[],i=0;e.forEach((r,e)=>{rr.hasOwnProperty(r)?a[e]=rr[r]:(o.push(r),Z.hasOwnProperty(r)||(Z[r]=[]),Z[r].push(()=>{a[e]=rr[r],++i===o.length&&n(a)}))}),0===o.length&&n(a)},or=r=>{var e=K[r];delete K[r];var t=e.elements,n=t.length,a=t.map(r=>r.getterReturnType).concat(t.map(r=>r.setterArgumentType)),o=e.rawConstructor,i=e.rawDestructor;ar([r],a,r=>(t.forEach((e,t)=>{var a=r[t],o=e.getter,i=e.getterContext,u=r[t+n],s=e.setter,f=e.setterContext;e.read=r=>a.fromWireType(o(i,r)),e.write=(r,e)=>{var t=[];s(f,r,u.toWireType(t,e)),Q(t)}}),[{name:e.name,fromWireType:r=>{for(var e=new Array(n),a=0;a<n;++a)e[a]=t[a].read(r);return i(r),e},toWireType:(r,a)=>{if(n!==a.length)throw new TypeError(`Incorrect number of tuple elements for ${e.name}: expected=${n}, actual=${a.length}`);for(var u=o(),s=0;s<n;++s)t[s].write(u,a[s]);return null!==r&&r.push(i,u),u},argPackAdvance:dr,readValueFromPointer:X,destructorFunction:i}]))},ir={},ur=r=>{var e=ir[r];delete ir[r];var t=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(r=>r.getterReturnType).concat(a.map(r=>r.setterArgumentType));ar([r],o,r=>{var o={};return a.forEach((e,t)=>{var n=e.fieldName,i=r[t],u=r[t].optional,s=e.getter,f=e.getterContext,l=r[t+a.length],c=e.setter,p=e.setterContext;o[n]={read:r=>i.fromWireType(s(f,r)),write:(r,e)=>{var t=[];c(p,r,l.toWireType(t,e)),Q(t)},optional:u}}),[{name:e.name,fromWireType:r=>{var e={};for(var t in o)e[t]=o[t].read(r);return n(r),e},toWireType:(r,e)=>{for(var a in o)if(!(a in e)&&!o[a].optional)throw new TypeError(`Missing field: "${a}"`);var i=t();for(a in o)o[a].write(i,e[a]);return null!==r&&r.push(n,i),i},argPackAdvance:dr,readValueFromPointer:X,destructorFunction:n}]})},sr=r=>{for(var e="";;){var t=p[r++];if(!t)return e;e+=String.fromCharCode(t)}},fr=class extends Error{constructor(r){super(r),this.name="BindingError"}},lr=r=>{throw new fr(r)};function cr(r,e,t={}){var n=e.name;if(r||lr(`type "${n}" must have a positive integer typeid pointer`),rr.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;lr(`Cannot register type '${n}' twice`)}if(rr[r]=e,delete er[r],Z.hasOwnProperty(r)){var a=Z[r];delete Z[r],a.forEach(r=>r())}}function pr(r,e,t={}){return cr(r,e,t)}var vr=(r,e,t)=>{switch(e){case 1:return t?r=>c[r]:r=>p[r];case 2:return t?r=>v[r>>1]:r=>h[r>>1];case 4:return t?r=>d[r>>2]:r=>g[r>>2];case 8:return t?r=>w[r>>3]:r=>T[r>>3];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},hr=(r,e,t,n,a)=>{e=sr(e);const o=0n===n;let i=r=>r;if(o){const r=8*t;i=e=>BigInt.asUintN(r,e),a=i(a)}pr(r,{name:e,fromWireType:i,toWireType:(r,e)=>("number"==typeof e&&(e=BigInt(e)),e),argPackAdvance:dr,readValueFromPointer:vr(e,t,!o),destructorFunction:null})},dr=8,gr=(r,e,t,n)=>{pr(r,{name:e=sr(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:dr,readValueFromPointer:function(r){return this.fromWireType(p[r])},destructorFunction:null})},mr=[],yr=[0,1,,1,null,1,!0,1,!1,1],wr=r=>{r>9&&0===--yr[r+1]&&(yr[r]=void 0,mr.push(r))},Tr={toValue:r=>(r||lr(`Cannot use deleted val. handle = ${r}`),yr[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=mr.pop()||yr.length;return yr[e]=r,yr[e+1]=1,e}}}},Ar={name:"emscripten::val",fromWireType:r=>{var e=Tr.toValue(r);return wr(r),e},toWireType:(r,e)=>Tr.toHandle(e),argPackAdvance:dr,readValueFromPointer:X,destructorFunction:null},br=r=>pr(r,Ar),Pr=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(m[r>>2])};case 8:return function(r){return this.fromWireType(y[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Cr=(r,e,t)=>{pr(r,{name:e=sr(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:dr,readValueFromPointer:Pr(e,t),destructorFunction:null})},Wr=(r,e)=>Object.defineProperty(e,"name",{value:r});function Er(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}function Fr(r,e,t,n,a,o){var i=e.length;i<2&&lr("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var u=Er(e),s="void"!==e[0].name,f=i-2,l=new Array(f),c=[],p=[];return Wr(r,function(...r){var t;p.length=0,c.length=1,c[0]=a;for(var o=0;o<f;++o)l[o]=e[o+2].toWireType(p,r[o]),c.push(l[o]);function i(r){if(u)Q(p);else for(var n=2;n<e.length;n++){var a=1===n?t:l[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(a)}if(s)return e[0].fromWireType(r)}return i(n(...c))})}var _r,xr=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||lr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},Rr=(r,e,n)=>{t.hasOwnProperty(r)?((void 0===n||void 0!==t[r].overloadTable&&void 0!==t[r].overloadTable[n])&&lr(`Cannot register public name '${r}' twice`),xr(t,r,r),t[r].overloadTable.hasOwnProperty(n)&&lr(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),t[r].overloadTable[n]=e):(t[r]=e,t[r].argCount=n)},$r=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(g[e+4*n>>2]);return t},Sr=(r,e,n)=>{t.hasOwnProperty(r)||nr("Replacing nonexistent public symbol"),void 0!==t[r].overloadTable&&void 0!==n?t[r].overloadTable[n]=e:(t[r]=e,t[r].argCount=n)},kr=[],Ir=r=>{var e=kr[r];return e||(kr[r]=e=_r.get(r)),e},Ur=(r,e,t=!1)=>{function n(){return Ir(e)}r=sr(r);var a=n();return"function"!=typeof a&&lr(`unknown function pointer with signature ${r}: ${e}`),a};class Or extends Error{}var Dr,Vr,Br,Mr,Hr=r=>{var e=Vr(r),t=sr(e);return Mr(e),t},jr=(r,e)=>{var t=[],n={};function a(r){n[r]||rr[r]||(er[r]?er[r].forEach(a):(t.push(r),n[r]=!0))}throw e.forEach(a),new Or(`${r}: `+t.map(Hr).join([", "]))},Nr=r=>{const e=(r=r.trim()).indexOf("(");return-1===e?r:r.slice(0,e)},Lr=(r,e,t,n,a,o,i,u)=>{var s=$r(e,t);r=sr(r),r=Nr(r),a=Ur(n,a,i),Rr(r,function(){jr(`Cannot call ${r} due to unbound types`,s)},e-1),ar([],s,t=>{var n=[t[0],null].concat(t.slice(1));return Sr(r,Fr(r,n,null,a,o),e-1),[]})},zr=(r,e,t,n,a)=>{e=sr(e);let o=r=>r;if(0===n){var i=32-8*t;o=r=>r<<i>>>i,a=o(a)}pr(r,{name:e,fromWireType:o,toWireType:(r,e)=>e,argPackAdvance:dr,readValueFromPointer:vr(e,t,0!==n),destructorFunction:null})},Gr=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];function a(r){var e=g[r>>2],t=g[r+4>>2];return new n(c.buffer,t,e)}pr(r,{name:t=sr(t),fromWireType:a,argPackAdvance:dr,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Yr=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,o=t+n-1,i=0;i<r.length;++i){var u=r.codePointAt(i);if(u<=127){if(t>=o)break;e[t++]=u}else if(u<=2047){if(t+1>=o)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=o)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=o)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u,i++}}return e[t]=0,t-a},qr=(r,e,t)=>Yr(r,p,e,t),Jr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},Kr="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Qr=(r,e=0,t=NaN)=>{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&Kr)return Kr.decode(r.subarray(e,a));for(var o="";e<a;){var i=r[e++];if(128&i){var u=63&r[e++];if(192!=(224&i)){var s=63&r[e++];if((i=224==(240&i)?(15&i)<<12|u<<6|s:(7&i)<<18|u<<12|s<<6|63&r[e++])<65536)o+=String.fromCharCode(i);else{var f=i-65536;o+=String.fromCharCode(55296|f>>10,56320|1023&f)}}else o+=String.fromCharCode((31&i)<<6|u)}else o+=String.fromCharCode(i)}return o},Xr=(r,e)=>r?Qr(p,r,e):"",Zr=(r,e)=>{pr(r,{name:e=sr(e),fromWireType(r){for(var e,t=g[r>>2],n=r+4,a=n,o=0;o<=t;++o){var i=n+o;if(o==t||0==p[i]){var u=Xr(a,i-a);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),a=i+1}}return Mr(r),e},toWireType(r,e){var t;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n="string"==typeof e;n||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT||lr("Cannot pass non-string to std::string"),t=n?Jr(e):e.length;var a=Br(4+t+1),o=a+4;return g[a>>2]=t,n?qr(e,o,t+1):p.set(e,o),null!==r&&r.push(Mr,a),a},argPackAdvance:dr,readValueFromPointer:X,destructorFunction(r){Mr(r)}})},re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,ee=(r,e)=>{for(var t=r>>1,n=t+e/2,a=t;!(a>=n)&&h[a];)++a;if(a-t>16&&re)return re.decode(h.subarray(t,a));for(var o="",i=t;!(i>=n);++i){var u=h[i];if(0==u)break;o+=String.fromCharCode(u)}return o},te=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,a=(t-=2)<2*r.length?t/2:r.length,o=0;o<a;++o){var i=r.charCodeAt(o);v[e>>1]=i,e+=2}return v[e>>1]=0,e-n},ne=r=>2*r.length,ae=(r,e)=>{for(var t="",n=0;!(n>=e/4);n++){var a=d[r+4*n>>2];if(!a)break;t+=String.fromCodePoint(a)}return t},oe=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,a=n+t-4,o=0;o<r.length;++o){var i=r.codePointAt(o);if(i>65535&&o++,d[e>>2]=i,(e+=4)+4>a)break}return d[e>>2]=0,e-n},ie=r=>{for(var e=0,t=0;t<r.length;++t)r.codePointAt(t)>65535&&t++,e+=4;return e},ue=(r,e,t)=>{var n,a,o,i;t=sr(t),2===e?(n=ee,a=te,i=ne,o=r=>h[r>>1]):4===e&&(n=ae,a=oe,i=ie,o=r=>g[r>>2]),pr(r,{name:t,fromWireType:r=>{for(var t,a=g[r>>2],i=r+4,u=0;u<=a;++u){var s=r+4+u*e;if(u==a||0==o(s)){var f=n(i,s-i);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),i=s+e}}return Mr(r),t},toWireType:(r,n)=>{"string"!=typeof n&&lr(`Cannot pass non-string to C++ string type ${t}`);var o=i(n),u=Br(4+o+e);return g[u>>2]=o/e,a(n,u+4,o+e),null!==r&&r.push(Mr,u),u},argPackAdvance:dr,readValueFromPointer:X,destructorFunction(r){Mr(r)}})},se=(r,e,t,n,a,o)=>{K[r]={name:sr(e),rawConstructor:Ur(t,n),rawDestructor:Ur(a,o),elements:[]}},fe=(r,e,t,n,a,o,i,u,s)=>{K[r].elements.push({getterReturnType:e,getter:Ur(t,n),getterContext:a,setterArgumentType:o,setter:Ur(i,u),setterContext:s})},le=(r,e,t,n,a,o)=>{ir[r]={name:sr(e),rawConstructor:Ur(t,n),rawDestructor:Ur(a,o),fields:[]}},ce=(r,e,t,n,a,o,i,u,s,f)=>{ir[r].fields.push({fieldName:sr(e),getterReturnType:t,getter:Ur(n,a),getterContext:o,setterArgumentType:i,setter:Ur(u,s),setterContext:f})},pe=(r,e)=>{pr(r,{isVoid:!0,name:e=sr(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},ve=r=>{r>9&&(yr[r+1]+=1)},he=()=>Tr.toHandle([]),de={},ge=r=>{var e=de[r];return void 0===e?sr(r):e},me=r=>Tr.toHandle(ge(r)),ye=()=>Tr.toHandle({}),we=(r,e,t)=>{r=Tr.toValue(r),e=Tr.toValue(e),t=Tr.toValue(t),r[e]=t},Te=(r,e)=>{var t=rr[r];return void 0===t&&lr(`${e} has unknown type ${Hr(r)}`),t},Ae=(r,e)=>{var t=(r=Te(r,"_emval_take_value")).readValueFromPointer(e);return Tr.toHandle(t)},be=(r,e,t,n)=>{var a=(new Date).getFullYear(),o=new Date(a,0,1),i=new Date(a,6,1),u=o.getTimezoneOffset(),s=i.getTimezoneOffset(),f=Math.max(u,s);g[r>>2]=60*f,d[e>>2]=Number(u!=s);var l=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=l(u),p=l(s);s<u?(qr(c,t,17),qr(p,n,17)):(qr(c,n,17),qr(p,t,17))},Pe=()=>2147483648,Ce=(r,e)=>Math.ceil(r/e)*e,We=r=>{var e=(r-l.buffer.byteLength+65535)/65536|0;try{return l.grow(e),W(),1}catch(t){}},Ee=r=>{var e=p.length;r>>>=0;var t=Pe();if(r>t)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,r+100663296);var o=Math.min(t,Ce(Math.max(r,a),65536));if(We(o))return!0}return!1},Fe={},_e=()=>a||"./this.program",xe=()=>{if(!xe.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.language||"C").replace("-","_")+".UTF-8",_:_e()};for(var e in Fe)void 0===Fe[e]?delete r[e]:r[e]=Fe[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);xe.strings=t}return xe.strings},Re=(r,e)=>{var t=0,n=0;for(var a of xe()){var o=e+t;g[r+n>>2]=o,t+=qr(a,o,1/0)+1,n+=4}return 0},$e=(r,e)=>{var t=xe();g[r>>2]=t.length;var n=0;for(var a of t)n+=Jr(a)+1;return g[e>>2]=n,0},Se=[null,[],[]],ke=(r,e)=>{var t=Se[r];0===e||10===e?((1===r?A:b)(Qr(t)),t.length=0):t.push(e)},Ie=(r,e,t,n)=>{for(var a=0,o=0;o<t;o++){var i=g[e>>2],u=g[e+4>>2];e+=8;for(var s=0;s<u;s++)ke(r,p[i+s]);a+=u}return g[n>>2]=a,0},Ue=(r,e)=>{r<128?e.push(r):e.push(r%128|128,r>>7)},Oe=r=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==r[0]?[]:[e[r[0]]]},n=1;n<r.length;++n)t.parameters.push(e[r[n]]);return t},De=(r,e)=>{var t=r.slice(0,1),n=r.slice(1),a={i:127,p:127,j:126,f:125,d:124,e:111};for(var o of(e.push(96),Ue(n.length,e),n))e.push(a[o]);"v"==t?e.push(0):e.push(1,a[t])},Ve=(r,e)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function(Oe(e),r);var t=[1];De(e,t);var n=[0,97,115,109,1,0,0,0,1];Ue(t.length,n),n.push(...t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var a=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(a,{e:{f:r}}).exports.f},Be=(r,e)=>{if(Dr)for(var t=r;t<r+e;t++){var n=Ir(t);n&&Dr.set(n,t)}},Me=r=>(Dr||(Dr=new WeakMap,Be(0,_r.length)),Dr.get(r)||0),He=[],je=()=>{if(He.length)return He.pop();try{_r.grow(1)}catch(b){if(!(b instanceof RangeError))throw b;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return _r.length-1},Ne=(r,e)=>{_r.set(r,e),kr[r]=_r.get(r)},Le=(r,e)=>{var t=Me(r);if(t)return t;var n=je();try{Ne(n,r)}catch(b){if(!(b instanceof TypeError))throw b;var a=Ve(r,e);Ne(n,a)}return Dr.set(r,n),n};function ze(r){Vr=r.G,t._malloc=Br=r.I,t._free=Mr=r.J}t.noExitRuntime&&t.noExitRuntime,t.print&&(A=t.print),t.printErr&&(b=t.printErr),t.wasmBinary&&(u=t.wasmBinary),t.arguments&&t.arguments,t.thisProgram&&(a=t.thisProgram),t.addFunction=Le,t.UTF8ToString=Xr;var Ge={b:q,y:J,l:or,o:ur,t:hr,D:gr,B:br,s:Cr,c:Lr,j:zr,d:Gr,C:Zr,n:ue,m:se,f:fe,p:le,e:ce,u:pe,a:wr,r:ve,A:he,i:me,k:ye,g:we,h:Ae,v:be,z:Ee,w:Re,x:$e,q:Ie},Ye=await H();function qe(){function r(){t.calledRun=!0,P||(F(),s?.(t),t.onRuntimeInitialized?.(),_())}R>0?$=qe:(E(),R>0?$=qe:t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),r()},1)):r())}function Je(){if(t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()()}return Je(),qe(),C?t:new Promise((r,e)=>{s=r,f=e})},r.exports=a,r.exports.default=a),t.exports;var r,n,a}const a=r(n()),o=Object.freeze(Object.defineProperty({__proto__:null,default:a},Symbol.toStringTag,{value:"Module"}));export{o as l};
|
package/config.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.
|
|
5
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.17";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../has.js";import e from"../Logger.js";import{getOrCreateMapValue as n}from"../MapUtils.js";const r=()=>e.getLogger("esri.core.accessorSupport.ensureTypes");function t(e){if(null==e)return e;const n=new Date(e);return isNaN(n.getTime())?(r().error("Accessor#set",`Invalid date value: '${e}', falling back to current date`),new Date):n}function o(e){return null==e?e:!!e}function u(e){return null==e?e:e.toString()}function a(e,n=0){return null==e?e:(e=parseFloat(e),isNaN(e)?n:e)}function s(e){return null==e?e:Math.round(parseFloat(e))}function l(e){return null}function i(e,n){return r=>{let t=e(r);return null!=n.step&&(t=Math.round(t/n.step)*n.step),null!=n.min&&(t=Math.max(n.min,t)),null!=n.max&&(t=Math.min(n.max,t)),t}}function c(e){return e?.constructor&&void 0!==e.constructor.__accessorMetadata__}function f(e,n){return null!=n&&e&&!(n instanceof e)}function p(e){return e&&"isCollection"in e}function y(e){return e?.Type?"function"==typeof e.Type?e.Type:e.Type.base:null}function v(e,n){if(!n?.constructor||!p(n.constructor))return g(e,n)?n:new e(n);const r=y(e.prototype.itemType),t=y(n.constructor.prototype.itemType);return r?t?r===t?n:r.prototype.isPrototypeOf(t.prototype)?new e(n):(g(e,n),n):new e(n):n}function g(e,n){return!!c(n)&&(r().error("Accessor#set","Assigning an instance of '"+(n.declaredClass||"unknown")+"' which is not a subclass of '"+h(e)+"'"),!0)}function m(e,n){return null==n?n:p(e)?v(e,n):f(e,n)?g(e,n)?n:new e(n):n}function h(e){return e?.prototype?.declaredClass||"unknown"}const d=new WeakMap;function b(e){switch(e){case Number:return e=>a(e);case x:return s;case Boolean:return o;case String:return u;case Date:return t;case D:return l;default:return n(d,e,()=>m.bind(null,e))}}function w(e,n){const r=b(e);return 1===arguments.length?r:r(n)}function A(e,n,r){return 1===arguments.length?A.bind(null,e):n?Array.isArray(n)?n.map(n=>e(n,r)):[e(n,r)]:n}function $(e,n){return 1===arguments.length?A(n=>w(e,n)):A(n=>w(e,n),n)}function j(e,n,r){return 0!==n&&Array.isArray(r)?r.map(r=>j(e,n-1,r)):e(r)}function k(e,n,r){if(2===arguments.length)return r=>k(e,n,r);if(!r)return r;r=j(e,n,r);let t=n,o=r;for(;t>0&&Array.isArray(o);)t--,o=o[0];if(void 0!==o)for(let u=0;u<t;u++)r=[r];return r}function M(e,n,r){return 2===arguments.length?k(n=>w(e,n),n):k(n=>w(e,n),n,r)}function N(e){return!!Array.isArray(e)&&!e.some(n=>{const r=typeof n;return!("string"===r||"number"===r||"function"===r&&e.length>1)})}function T(e,n){if(2===arguments.length)return T(e).call(null,n);const t=new Set,o=e.filter(e=>"function"!=typeof e),u=e.filter(e=>"function"==typeof e);for(const r of e)"string"!=typeof r&&"number"!=typeof r||t.add(r);let a=null,s=null;return(e,n)=>{if(null==e)return e;const l=typeof e,i="string"===l||"number"===l;return i&&(t.has(e)||u.some(e=>"string"===l&&e===String||"number"===l&&e===Number))||"object"===l&&u.some(n=>!f(n,e))?e:(i&&o.length?(a||(a=o.map(e=>"string"==typeof e?`'${e}'`:`${e}`).join(", ")),r().error("Accessor#set",`'${e}' is not a valid value for this property, only the following values are valid: ${a}`)):"object"==typeof e&&u.length?(s||(s=u.map(e=>h(e)).join(", ")),r().error("Accessor#set",`'${e}' is not a valid value for this property, value must be one of ${s}`)):r().error("Accessor#set",`'${e}' is not a valid value for this property`),n&&(n.valid=!1),null)}}function S(e,n){if(2===arguments.length)return S(e).call(null,n);const t={},o=[],u=[];for(const r in e.typeMap){const n=e.typeMap[r];t[r]=w(n),o.push(h(n)),u.push(r)}const a=()=>`'${o.join("', '")}'`,s=()=>`'${u.join("', '")}'`,l="string"==typeof e.key?n=>n[e.key]:e.key;return n=>{if(e.base&&!f(e.base,n))return n;if(null==n)return n;const o=l(n)||e.defaultKeyValue,u=t[o];if(!u)return r().error("Accessor#set",`Invalid property value, value needs to be one of ${a()}, or a plain object that can autocast (having .type = ${s()})`),null;if(!f(e.typeMap[o],n))return n;if("string"==typeof e.key&&!c(n)){const r={};for(const t in n)t!==e.key&&(r[t]=n[t]);return u(r)}return u(n)}}class x{}class D{}const _={native:e=>({type:"native",value:e}),array:e=>({type:"array",value:e}),oneOf:e=>({type:"one-of",values:e})};function B(e){if(!e||!("type"in e))return!1;switch(e.type){case"native":case"array":case"one-of":return!0}return!1}function C(e){switch(e.type){case"native":return w(e.value);case"array":return A(C(e.value));case"one-of":return I(e);default:return null}}function I(e){let n=null;return(t,o)=>L(t,e)?t:(null==n&&(n=F(e)),r().error("Accessor#set",`Invalid property value, value needs to be of type ${n}`),o&&(o.valid=!1),null)}function F(e){switch(e.type){case"native":switch(e.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case x:return"integer";case Date:return"date";case D:return"null";default:return h(e.value)}case"array":return`array of ${F(e.value)}`;case"one-of":{const n=e.values.map(e=>F(e));return`one of ${n.slice(0,-1)} or ${n[n.length-1]}`}}return"unknown"}function L(e,n){if(null==e)return!0;switch(n.type){case"native":switch(n.value){case Number:case x:return"number"==typeof e;case Boolean:return"boolean"==typeof e;case String:return"string"==typeof e;case D:return null===e}return e instanceof n.value;case"array":return!!Array.isArray(e)&&!e.some(e=>!L(e,n.value));case"one-of":return n.values.some(n=>L(e,n))}}export{x as Integer,D as Null,$ as ensureArray,A as ensureArrayTyped,o as ensureBoolean,m as ensureClass,t as ensureDate,s as ensureInteger,C as ensureLongFormType,M as ensureNArray,k as ensureNArrayTyped,l as ensureNull,a as ensureNumber,T as ensureOneOf,S as ensureOneOfType,i as ensureRange,u as ensureString,w as ensureType,c as isClassedType,B as isLongFormType,N as isOneOf,f as requiresType,_ as types};
|
|
5
|
+
import"../has.js";import e from"../Logger.js";import{getOrCreateMapValue as n}from"../MapUtils.js";const r=()=>e.getLogger("esri.core.accessorSupport.ensureTypes");function t(e){if(null==e)return e;const n=new Date(e);return isNaN(n.getTime())?(r().error("Accessor#set",`Invalid date value: '${e}', falling back to current date`),new Date):n}function o(e){return null==e?e:!!e}function u(e){return null==e?e:e.toString()}function a(e,n=0){return null==e?e:(e=parseFloat(e),isNaN(e)?n:e)}function s(e){return null==e?e:Math.round(parseFloat(e))}function l(e){return null}function i(e,n){return r=>{let t=e(r);return null!=n.step&&(t=Math.round(t/n.step)*n.step),null!=n.min&&(t=Math.max(n.min,t)),null!=n.max&&(t=Math.min(n.max,t)),t}}function c(e){return e?.constructor&&void 0!==e.constructor.__accessorMetadata__}function f(e,n){return null!=n&&e&&!(n instanceof e)}function p(e){return e&&"isCollection"in e}function y(e){return e?.Type?"function"==typeof e.Type?e.Type:e.Type.base:null}function v(e,n){if(!n?.constructor||!p(n.constructor))return g(e,n)?n:new e(n);const r=y(e.prototype.itemType),t=y(n.constructor.prototype.itemType);return r?t?r===t?n:r.prototype.isPrototypeOf(t.prototype)?new e(n):(g(e,n),n):new e(n):n}function g(e,n){return!!c(n)&&(r().error("Accessor#set","Assigning an instance of '"+(n.declaredClass||"unknown")+"' which is not a subclass of '"+h(e)+"'"),!0)}function m(e,n){return null==n?n:p(e)?v(e,n):f(e,n)?g(e,n)?n:new e(n):n}function h(e){return e?.prototype?.declaredClass||"unknown"}const d=new WeakMap;function b(e){switch(e){case Number:return e=>a(e);case x:return s;case Boolean:return o;case String:return u;case Date:return t;case D:return l;default:return n(d,e,()=>m.bind(null,e))}}function w(e,n){const r=b(e);return 1===arguments.length?r:r(n)}function A(e,n,r){return 1===arguments.length?A.bind(null,e):n?Array.isArray(n)?n.map(n=>e(n,r)):[e(n,r)]:n}function $(e,n){return 1===arguments.length?A(n=>w(e,n)):A(n=>w(e,n),n)}function j(e,n,r){return 0!==n&&Array.isArray(r)?r.map(r=>j(e,n-1,r)):e(r)}function k(e,n,r){if(2===arguments.length)return r=>k(e,n,r);if(!r)return r;r=j(e,n,r);let t=n,o=r;for(;t>0&&Array.isArray(o);)t--,o=o[0];if(void 0!==o)for(let u=0;u<t;u++)r=[r];return r}function M(e,n,r){return 2===arguments.length?k(n=>w(e,n),n):k(n=>w(e,n),n,r)}function N(e){return!!Array.isArray(e)&&!e.some(n=>{const r=typeof n;return!("string"===r||"number"===r||"function"===r&&e.length>1)})}function T(e,n){if(2===arguments.length)return T(e).call(null,n);const t=new Set,o=e.filter(e=>"function"!=typeof e),u=e.filter(e=>"function"==typeof e);for(const r of e)"string"!=typeof r&&"number"!=typeof r||t.add(r);let a=null,s=null;return(e,n)=>{if(null==e)return e;const l=typeof e,i="string"===l||"number"===l;return i&&(t.has(e)||u.some(e=>"string"===l&&e===String||"number"===l&&e===Number))||"object"===l&&u.some(n=>!f(n,e))?e:(i&&o.length?(a||(a=o.map(e=>"string"==typeof e?`'${e}'`:`${e}`).join(", ")),r().error("Accessor#set",`'${e}' is not a valid value for this property, only the following values are valid: ${a}`)):"object"==typeof e&&u.length?(s||(s=u.map(e=>h(e)).join(", ")),r().error("Accessor#set",`'${e}' is not a valid value for this property, value must be one of ${s}`)):r().error("Accessor#set",`'${e}' is not a valid value for this property`),n&&(n.valid=!1),null)}}function S(e,n){if(2===arguments.length)return S(e).call(null,n);const t={},o=[],u=[];for(const r in e.typeMap){const n=e.typeMap[r];t[r]=w(n),o.push(h(n)),u.push(r)}const a=()=>`'${o.join("', '")}'`,s=()=>`'${u.join("', '")}'`,l="string"==typeof e.key?n=>n[e.key]:e.key;return n=>{if(e.base&&!f(e.base,n))return n;if(null==n)return n;const o=l(n)||e.defaultKeyValue,u=t[o];if(!u)return r().error("Accessor#set",`Invalid property value, value needs to be one of ${a()}, or a plain object that can autocast (having .type = ${s()})`),null;if(!f(e.typeMap[o],n))return n;if("string"==typeof e.key&&!c(n)){const r={};for(const t in n)t!==e.key&&(r[t]=n[t]);return u(r)}return u(n)}}class x{}class D{}const _={native:e=>({type:"native",value:e}),array:e=>({type:"array",value:e}),oneOf:e=>({type:"one-of",values:e})};function B(e){if(!e||"object"!=typeof e&&"function"!=typeof e||!("type"in e))return!1;switch(e.type){case"native":case"array":case"one-of":return!0}return!1}function C(e){switch(e.type){case"native":return w(e.value);case"array":return A(C(e.value));case"one-of":return I(e);default:return null}}function I(e){let n=null;return(t,o)=>L(t,e)?t:(null==n&&(n=F(e)),r().error("Accessor#set",`Invalid property value, value needs to be of type ${n}`),o&&(o.valid=!1),null)}function F(e){switch(e.type){case"native":switch(e.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case x:return"integer";case Date:return"date";case D:return"null";default:return h(e.value)}case"array":return`array of ${F(e.value)}`;case"one-of":{const n=e.values.map(e=>F(e));return`one of ${n.slice(0,-1)} or ${n[n.length-1]}`}}return"unknown"}function L(e,n){if(null==e)return!0;switch(n.type){case"native":switch(n.value){case Number:case x:return"number"==typeof e;case Boolean:return"boolean"==typeof e;case String:return"string"==typeof e;case D:return null===e}return e instanceof n.value;case"array":return!!Array.isArray(e)&&!e.some(e=>!L(e,n.value));case"one-of":return n.values.some(n=>L(e,n))}}export{x as Integer,D as Null,$ as ensureArray,A as ensureArrayTyped,o as ensureBoolean,m as ensureClass,t as ensureDate,s as ensureInteger,C as ensureLongFormType,M as ensureNArray,k as ensureNArrayTyped,l as ensureNull,a as ensureNumber,T as ensureOneOf,S as ensureOneOfType,i as ensureRange,u as ensureString,w as ensureType,c as isClassedType,B as isLongFormType,N as isOneOf,f as requiresType,_ as types};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../Logger.js";import{setDeepValue as e}from"../../../object.js";import r from"../../../Warning.js";import{getPropertiesMetadata as n}from"../../metadata.js";import{isCollection as o}from"./type.js";import{originSpecificReadPropertyDefinition as i}from"./utils.js";const p=()=>t.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function u(t,r,n){t&&(!n&&!r.read||r.read?.reader||!1===r.read?.enabled||m(t)&&e("read.reader",s(t),r))}function s(t){const e=t.ndimArray??0;if(e>1)return a(t);if(1===e)return d(t);if("type"in t&&l(t.type)){const e=t.type.prototype?.itemType?.Type,r=d("function"==typeof e?{type:e}:{types:e});return(e,n,o)=>{const i=r(e,n,o);return i?new t.type(i):i}}return y(t)}function y(t){return"type"in t?f(t.type):v(t.types)}function f(t){return t.prototype.read?(e,r,n)=>{if(null==e)return e;const o=typeof e;if("object"!==o)return void p().error(`Expected JSON value of type 'object' to deserialize type '${t.prototype.declaredClass}', but got '${o}'`);const i=new t;return i.read(e,n),i}:t.fromJSON}function c(t,e,r,n){return 0!==n&&Array.isArray(e)?e.map(e=>c(t,e,r,n-1)):t(e,void 0,r)}function a(t){const e=y(t),r=c.bind(null,e),n=t.ndimArray??0;return(t,e,o)=>{if(null==t)return t;t=r(t,o,n);let i=n,p=t;for(;i>0&&Array.isArray(p);)i--,p=p[0];if(void 0!==p)for(let r=0;r<i;r++)t=[t];return t}}function d(t){const e=y(t);return(t,r,n)=>{if(null==t)return t;if(Array.isArray(t)){const r=[];for(const o of t){const t=e(o,void 0,n);void 0!==t&&r.push(t)}return r}const o=e(t,void 0,n);return void 0!==o?[o]:void 0}}function l(t){if(!o(t))return!1;const e=t.prototype.itemType;return!(!e||!e.Type)&&("function"==typeof e.Type?j(e.Type):g(e.Type))}function m(t){return"types"in t?g(t.types):j(t.type)}function j(t){return!Array.isArray(t)&&(!!t&&t.prototype&&("read"in t.prototype||"fromJSON"in t||l(t)))}function g(t){for(const e in t.typeMap){if(!j(t.typeMap[e]))return!1}return!0}function v(t){let e=null;const n=t.errorContext??"type",o=t.validate;return(i,u,s)=>{if(null==i)return i;const y=typeof i;if("object"!==y)return void p().error(`Expected JSON value of type 'object' to deserialize, but got '${y}'`);e||(e=
|
|
5
|
+
import t from"../../../Logger.js";import{setDeepValue as e}from"../../../object.js";import r from"../../../Warning.js";import{getPropertiesMetadata as n}from"../../metadata.js";import{isCollection as o}from"./type.js";import{originSpecificReadPropertyDefinition as i}from"./utils.js";const p=()=>t.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function u(t,r,n){t&&(!n&&!r.read||r.read?.reader||!1===r.read?.enabled||m(t)&&e("read.reader",s(t),r))}function s(t){const e=t.ndimArray??0;if(e>1)return a(t);if(1===e)return d(t);if("type"in t&&l(t.type)){const e=t.type.prototype?.itemType?.Type,r=d("function"==typeof e?{type:e}:{types:e});return(e,n,o)=>{const i=r(e,n,o);return i?new t.type(i):i}}return y(t)}function y(t){return"type"in t?f(t.type):v(t.types)}function f(t){return t.prototype.read?(e,r,n)=>{if(null==e)return e;const o=typeof e;if("object"!==o)return void p().error(`Expected JSON value of type 'object' to deserialize type '${t.prototype.declaredClass}', but got '${o}'`);const i=new t;return i.read(e,n),i}:t.fromJSON}function c(t,e,r,n){return 0!==n&&Array.isArray(e)?e.map(e=>c(t,e,r,n-1)):t(e,void 0,r)}function a(t){const e=y(t),r=c.bind(null,e),n=t.ndimArray??0;return(t,e,o)=>{if(null==t)return t;t=r(t,o,n);let i=n,p=t;for(;i>0&&Array.isArray(p);)i--,p=p[0];if(void 0!==p)for(let r=0;r<i;r++)t=[t];return t}}function d(t){const e=y(t);return(t,r,n)=>{if(null==t)return t;if(Array.isArray(t)){const r=[];for(const o of t){const t=e(o,void 0,n);void 0!==t&&r.push(t)}return r}const o=e(t,void 0,n);return void 0!==o?[o]:void 0}}function l(t){if(!o(t))return!1;const e=t.prototype.itemType;return!(!e||!e.Type)&&("function"==typeof e.Type?j(e.Type):g(e.Type))}function m(t){return"types"in t?g(t.types):j(t.type)}function j(t){return!Array.isArray(t)&&(!!t&&("object"==typeof t||"function"==typeof t)&&t.prototype&&("read"in t.prototype||"fromJSON"in t||l(t)))}function g(t){for(const e in t.typeMap){if(!j(t.typeMap[e]))return!1}return!0}function v(t){let e=null;const n=t.errorContext??"type",o=t.validate;return(i,u,s)=>{if(null==i)return i;const y=typeof i;if("object"!==y)return void p().error(`Expected JSON value of type 'object' to deserialize, but got '${y}'`);e||(e=A(t));const f=t.key;if("string"!=typeof f)return;const c=i[b(f,e,s)],a=c?e[c]:t.defaultKeyValue?t.typeMap[t.defaultKeyValue]:void 0;if(!a){const t=`Type '${c||"unknown"}' is not supported`;return s?.messages&&i&&s.messages.push(new r(`${n}:unsupported`,t,{definition:i,context:s})),void p().error(t)}const d=new a;return d.read(i,s),o?o(d):d}}function b(t,e,r){const o=Object.values(e)[0],p=n(o.prototype)[t],u=i(p,r),s=u?.read?.source;return s&&"string"==typeof s?s:t}function A(t){const e={};for(const r in t.typeMap){const o=t.typeMap[r],i=n(o.prototype);if("function"==typeof t.key)continue;const p=i[t.key];if(!p)continue;if(p.json?.type&&Array.isArray(p.json.type)&&1===p.json.type.length&&"string"==typeof p.json.type[0]){e[p.json.type[0]]=o;continue}const u=p.json?.write;if(!u?.writer){e[r]=o;continue}const s=u.target,y="string"==typeof s?s:t.key,f={};u.writer(r,f,y),f[y]&&(e[f[y]]=o)}return e}export{u as create,s as createTypeReader};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function
|
|
5
|
+
import{isSubtypeGroupLayer as r}from"../layers/support/layerUtils.js";function e(r){return r&&"layer"in r?r.layer:void 0}function o(o){let t=e(o.origin);return r(t)&&(t=t.findSublayerForFeature(o)),t??o.sourceLayer??o.layer}export{o as getGraphicLayer,e as getGraphicOriginLayer};
|
package/interfaces.d.ts
CHANGED
|
@@ -1163,11 +1163,6 @@ declare namespace __esri {
|
|
|
1163
1163
|
viewOptions?: ElevationProfileViewOptionsProperties;
|
|
1164
1164
|
}
|
|
1165
1165
|
|
|
1166
|
-
export interface ElevationProfileEffectiveDisplayUnits {
|
|
1167
|
-
distance: LengthUnit;
|
|
1168
|
-
elevation: LengthUnit;
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
1166
|
export interface LengthDimension extends Accessor, Clonable {
|
|
1172
1167
|
}
|
|
1173
1168
|
|
|
@@ -34001,7 +33996,7 @@ declare namespace __esri {
|
|
|
34001
33996
|
* Converts the given {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html mapPoint} to a
|
|
34002
33997
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ControlPointsGeoreference.html#SourcePoint sourcePoint}.
|
|
34003
33998
|
*
|
|
34004
|
-
* @param point A point geometry. In the case where the point is not in the same spatial reference as the one in the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html mapPoint} of the first control point, it will be reprojected. {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-projectOperator.html projectOperator} would need to be loaded to perform the reprojection, otherwise `null` is returned.
|
|
33999
|
+
* @param point A point geometry. In the case where the point is not in the same spatial reference as the one in the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html mapPoint} of the first control point, it will be reprojected. The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-projectOperator.html projectOperator} would need to be loaded to perform the reprojection, otherwise `null` is returned.
|
|
34005
34000
|
*
|
|
34006
34001
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ControlPointsGeoreference.html#toSource Read more...}
|
|
34007
34002
|
*/
|
|
@@ -37776,13 +37771,13 @@ declare namespace __esri {
|
|
|
37776
37771
|
|
|
37777
37772
|
export class ParquetEncodingLocation {
|
|
37778
37773
|
/**
|
|
37779
|
-
* The name of the field in the Parquet file that contains the
|
|
37774
|
+
* The name of the field in the Parquet file that contains the y values.
|
|
37780
37775
|
*
|
|
37781
37776
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#latitudeFieldName Read more...}
|
|
37782
37777
|
*/
|
|
37783
37778
|
latitudeFieldName: string;
|
|
37784
37779
|
/**
|
|
37785
|
-
* The name of the field in the Parquet file that contains the
|
|
37780
|
+
* The name of the field in the Parquet file that contains the x values.
|
|
37786
37781
|
*
|
|
37787
37782
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#longitudeFieldName Read more...}
|
|
37788
37783
|
*/
|
|
@@ -37794,7 +37789,7 @@ declare namespace __esri {
|
|
|
37794
37789
|
*/
|
|
37795
37790
|
readonly type: "location";
|
|
37796
37791
|
/**
|
|
37797
|
-
* The location format used to store geometries in
|
|
37792
|
+
* The location format used to store geometries in Parquet files.
|
|
37798
37793
|
*
|
|
37799
37794
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html Read more...}
|
|
37800
37795
|
*/
|
|
@@ -37819,13 +37814,13 @@ declare namespace __esri {
|
|
|
37819
37814
|
|
|
37820
37815
|
interface ParquetEncodingLocationProperties {
|
|
37821
37816
|
/**
|
|
37822
|
-
* The name of the field in the Parquet file that contains the
|
|
37817
|
+
* The name of the field in the Parquet file that contains the y values.
|
|
37823
37818
|
*
|
|
37824
37819
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#latitudeFieldName Read more...}
|
|
37825
37820
|
*/
|
|
37826
37821
|
latitudeFieldName?: string;
|
|
37827
37822
|
/**
|
|
37828
|
-
* The name of the field in the Parquet file that contains the
|
|
37823
|
+
* The name of the field in the Parquet file that contains the x values.
|
|
37829
37824
|
*
|
|
37830
37825
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#longitudeFieldName Read more...}
|
|
37831
37826
|
*/
|
|
@@ -56089,7 +56084,7 @@ declare namespace __esri {
|
|
|
56089
56084
|
*/
|
|
56090
56085
|
featuredItemsGroupQuery: string | nullish;
|
|
56091
56086
|
/**
|
|
56092
|
-
* Indicates
|
|
56087
|
+
* Indicates whether Google 3D Tiles basemaps are enabled on this portal.
|
|
56093
56088
|
*
|
|
56094
56089
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#g3dTilesEnabled Read more...}
|
|
56095
56090
|
*/
|
|
@@ -56739,7 +56734,7 @@ declare namespace __esri {
|
|
|
56739
56734
|
*/
|
|
56740
56735
|
featuredItemsGroupQuery?: string | nullish;
|
|
56741
56736
|
/**
|
|
56742
|
-
* Indicates
|
|
56737
|
+
* Indicates whether Google 3D Tiles basemaps are enabled on this portal.
|
|
56743
56738
|
*
|
|
56744
56739
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#g3dTilesEnabled Read more...}
|
|
56745
56740
|
*/
|
|
@@ -96941,13 +96936,6 @@ declare namespace __esri {
|
|
|
96941
96936
|
signal?: AbortSignal | nullish;
|
|
96942
96937
|
}
|
|
96943
96938
|
|
|
96944
|
-
export interface ElevationProfilePickResult {
|
|
96945
|
-
feature: Graphic;
|
|
96946
|
-
}
|
|
96947
|
-
|
|
96948
|
-
export interface ElevationProfilePlacementResult {
|
|
96949
|
-
}
|
|
96950
|
-
|
|
96951
96939
|
export class BaseLayerView2D extends LayerView {
|
|
96952
96940
|
/**
|
|
96953
96941
|
* The array of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile Tile} objects computed to cover the MapView's visible area.
|
|
@@ -98873,6 +98861,58 @@ declare namespace __esri {
|
|
|
98873
98861
|
avgNegativeSlope: number | nullish;
|
|
98874
98862
|
}
|
|
98875
98863
|
|
|
98864
|
+
/**
|
|
98865
|
+
* Types common to the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html ElevationProfileAnalysisView2D} and
|
|
98866
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-ElevationProfileAnalysisView3D.html ElevationProfileAnalysisView3D}.
|
|
98867
|
+
*
|
|
98868
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html Read more...}
|
|
98869
|
+
*/
|
|
98870
|
+
namespace ElevationProfileTypes {
|
|
98871
|
+
/**
|
|
98872
|
+
* Result of interactively placing an elevation profile line on the view.
|
|
98873
|
+
*
|
|
98874
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html#ElevationProfilePlacementResult Read more...}
|
|
98875
|
+
*/
|
|
98876
|
+
export interface ElevationProfilePlacementResult {
|
|
98877
|
+
}
|
|
98878
|
+
|
|
98879
|
+
/**
|
|
98880
|
+
* Result of picking a feature from the view to perform an elevation profile analysis.
|
|
98881
|
+
*
|
|
98882
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html#ElevationProfilePickResult Read more...}
|
|
98883
|
+
*/
|
|
98884
|
+
export interface ElevationProfilePickResult {
|
|
98885
|
+
feature: Graphic;
|
|
98886
|
+
}
|
|
98887
|
+
|
|
98888
|
+
export interface ElevationProfileEffectiveDisplayUnits {
|
|
98889
|
+
distance: LengthUnit;
|
|
98890
|
+
elevation: LengthUnit;
|
|
98891
|
+
}
|
|
98892
|
+
}
|
|
98893
|
+
|
|
98894
|
+
export interface ElevationProfileEffectiveDisplayUnits {
|
|
98895
|
+
distance: LengthUnit;
|
|
98896
|
+
elevation: LengthUnit;
|
|
98897
|
+
}
|
|
98898
|
+
|
|
98899
|
+
/**
|
|
98900
|
+
* Result of picking a feature from the view to perform an elevation profile analysis.
|
|
98901
|
+
*
|
|
98902
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html#ElevationProfilePickResult Read more...}
|
|
98903
|
+
*/
|
|
98904
|
+
export interface ElevationProfilePickResult {
|
|
98905
|
+
feature: Graphic;
|
|
98906
|
+
}
|
|
98907
|
+
|
|
98908
|
+
/**
|
|
98909
|
+
* Result of interactively placing an elevation profile line on the view.
|
|
98910
|
+
*
|
|
98911
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html#ElevationProfilePlacementResult Read more...}
|
|
98912
|
+
*/
|
|
98913
|
+
export interface ElevationProfilePlacementResult {
|
|
98914
|
+
}
|
|
98915
|
+
|
|
98876
98916
|
/**
|
|
98877
98917
|
* Represents the result of a LengthDimension.
|
|
98878
98918
|
*
|
|
@@ -100470,7 +100510,7 @@ declare namespace __esri {
|
|
|
100470
100510
|
*/
|
|
100471
100511
|
queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
|
|
100472
100512
|
/**
|
|
100473
|
-
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the
|
|
100513
|
+
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
|
|
100474
100514
|
* and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
|
|
100475
100515
|
*
|
|
100476
100516
|
* @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CatalogFootprintLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CatalogFootprintLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CatalogFootprintLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
|
|
@@ -100707,7 +100747,7 @@ declare namespace __esri {
|
|
|
100707
100747
|
*/
|
|
100708
100748
|
queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
|
|
100709
100749
|
/**
|
|
100710
|
-
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the
|
|
100750
|
+
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
|
|
100711
100751
|
* and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
|
|
100712
100752
|
*
|
|
100713
100753
|
* @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
|
|
@@ -100995,7 +101035,7 @@ declare namespace __esri {
|
|
|
100995
101035
|
*/
|
|
100996
101036
|
queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
|
|
100997
101037
|
/**
|
|
100998
|
-
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the
|
|
101038
|
+
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
|
|
100999
101039
|
* and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
|
|
101000
101040
|
*
|
|
101001
101041
|
* @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
|
|
@@ -101120,7 +101160,7 @@ declare namespace __esri {
|
|
|
101120
101160
|
*/
|
|
101121
101161
|
queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
|
|
101122
101162
|
/**
|
|
101123
|
-
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the
|
|
101163
|
+
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
|
|
101124
101164
|
* and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
|
|
101125
101165
|
*
|
|
101126
101166
|
* @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerViewMixin.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerViewMixin.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerViewMixin.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
|
|
@@ -101318,7 +101358,7 @@ declare namespace __esri {
|
|
|
101318
101358
|
*/
|
|
101319
101359
|
queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
|
|
101320
101360
|
/**
|
|
101321
|
-
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the
|
|
101361
|
+
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
|
|
101322
101362
|
* and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
|
|
101323
101363
|
*
|
|
101324
101364
|
* @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
|
|
@@ -102023,7 +102063,7 @@ declare namespace __esri {
|
|
|
102023
102063
|
*/
|
|
102024
102064
|
queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
|
|
102025
102065
|
/**
|
|
102026
|
-
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the
|
|
102066
|
+
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
|
|
102027
102067
|
* and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
|
|
102028
102068
|
*
|
|
102029
102069
|
* @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-OGCFeatureLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-OGCFeatureLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-OGCFeatureLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
|
|
@@ -102227,7 +102267,7 @@ declare namespace __esri {
|
|
|
102227
102267
|
*/
|
|
102228
102268
|
queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
|
|
102229
102269
|
/**
|
|
102230
|
-
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the
|
|
102270
|
+
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
|
|
102231
102271
|
* and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
|
|
102232
102272
|
*
|
|
102233
102273
|
* @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ParquetLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ParquetLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ParquetLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
|
|
@@ -102972,7 +103012,7 @@ declare namespace __esri {
|
|
|
102972
103012
|
*/
|
|
102973
103013
|
queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
|
|
102974
103014
|
/**
|
|
102975
|
-
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the
|
|
103015
|
+
* Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
|
|
102976
103016
|
* and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
|
|
102977
103017
|
*
|
|
102978
103018
|
* @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-WFSLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-WFSLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-WFSLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
|
package/kernel.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.17",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
package/layers/BingMapsLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import{deprecatedModule as r}from"../core/deprecate.js";import o from"../core/Error.js";import{JSONMap as a}from"../core/jsonMap.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import{deprecatedModule as r}from"../core/deprecate.js";import o from"../core/Error.js";import{JSONMap as a}from"../core/jsonMap.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/Point.js";import g from"../geometry/SpatialReference.js";import u from"./BaseTileLayer.js";import{BlendLayer as d}from"./mixins/BlendLayer.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import c from"./support/LOD.js";import m from"./support/TileInfo.js";const h=new a({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),b="https://dev.virtualearth.net";r(i.getLogger("esri.layers.BingMapsLayer"),"esri.layers.BingMapsLayer",{version:"4.33",warnOnce:!0});let w=class extends(d(y(s(u)))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new p({x:-20037508.342787,y:20037508.342787,spatialReference:g.WebMercator}),spatialReference:g.WebMercator,lods:[new c({level:1,resolution:78271.5169639999,scale:295828763.795777}),new c({level:2,resolution:39135.7584820001,scale:147914381.897889}),new c({level:3,resolution:19567.8792409999,scale:73957190.948944}),new c({level:4,resolution:9783.93962049996,scale:36978595.474472}),new c({level:5,resolution:4891.96981024998,scale:18489297.737236}),new c({level:6,resolution:2445.98490512499,scale:9244648.868618}),new c({level:7,resolution:1222.99245256249,scale:4622324.434309}),new c({level:8,resolution:611.49622628138,scale:2311162.217155}),new c({level:9,resolution:305.748113140558,scale:1155581.108577}),new c({level:10,resolution:152.874056570411,scale:577790.554289}),new c({level:11,resolution:76.4370282850732,scale:288895.277144}),new c({level:12,resolution:38.2185141425366,scale:144447.638572}),new c({level:13,resolution:19.1092570712683,scale:72223.819286}),new c({level:14,resolution:9.55462853563415,scale:36111.909643}),new c({level:15,resolution:4.77731426794937,scale:18055.954822}),new c({level:16,resolution:2.38865713397468,scale:9027.977411}),new c({level:17,resolution:1.19432856685505,scale:4513.988705}),new c({level:18,resolution:.597164283559817,scale:2256.994353}),new c({level:19,resolution:.298582141647617,scale:1128.497176}),new c({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return null!=this.bingMetadata?this.bingMetadata.copyright:null}get operationalLayerType(){return h.toJSON(this.style)}get bingLogo(){return null!=this.bingMetadata?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new o("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,r){if(!this.loaded||null==this.bingMetadata)return null;const o=this.bingMetadata.resourceSets[0].resources[0],a=o.imageUrlSubdomains[t%o.imageUrlSubdomains.length],i=this._getQuadKey(e,t,r);return o.imageUrl.replace("{subdomain}",a).replace("{quadkey}",i)}async fetchAttributionData(){return this.load().then(()=>{if(null==this.bingMetadata)return null;return{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(e=>({zoomMin:e.zoomMin-(e.zoomMin?1:0),zoomMax:e.zoomMax-(e.zoomMin?1:0),score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]}))}))}})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return t(`${b}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(e=>{const t=e.data;if(200!==t.statusCode)throw new o("bingmapslayer:getmetadata",t.statusDescription);if(this.bingMetadata=t,0===this.bingMetadata.resourceSets.length)throw new o("bingmapslayer:getmetadata","no bing resourcesets");if(0===this.bingMetadata.resourceSets[0].resources.length)throw new o("bingmapslayer:getmetadata","no bing resources")}).catch(e=>{throw new o("bingmapslayer:getmetadata",e.message)})}_getPortalBingKey(){return t(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new o("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new o("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,r){let o="";for(let a=e;a>0;a--){let e=0;const i=1<<a-1;0!==(r&i)&&(e+=1),0!==(t&i)&&(e+=2),o+=e.toString()}return o}};e([n({json:{read:!1,write:!1},value:null})],w.prototype,"bingMetadata",null),e([n({json:{read:!1,write:!1},value:"bing-maps",readOnly:!0})],w.prototype,"type",void 0),e([n({type:m})],w.prototype,"tileInfo",void 0),e([n({type:String,readOnly:!0,json:{read:!1,write:!1}})],w.prototype,"copyright",null),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"key",void 0),e([n({type:h.apiValues,nonNullable:!0,json:{read:{source:"layerType",reader:h.read}}})],w.prototype,"style",void 0),e([n({type:["BingMapsAerial","BingMapsHybrid","BingMapsRoad"]})],w.prototype,"operationalLayerType",null),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"culture",void 0),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"region",void 0),e([n({type:String,json:{write:!0,read:!0}})],w.prototype,"portalUrl",void 0),e([n({type:Boolean,json:{write:!1,read:!1}})],w.prototype,"hasAttributionData",void 0),e([n({type:String,readOnly:!0})],w.prototype,"bingLogo",null),w=e([l("esri.layers.BingMapsLayer")],w);const v=w;export{v as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Accessor.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{isGeographic as d}from"../geometry/support/spatialReferenceUtils.js";import h from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as _,invalidLayerView as u}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as y}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as c}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as g}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as m}from"../views/3d/layers/support/makeScheduleFunction.js";const w=3857,b=32662,p=4326,f=5773,M=115700;let L=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,r=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=r?`[js] ${i}`:`${i}`;0===t||1===t?s.getLogger(this).error(e):2===t&&s.getLogger(this).warn(e),s.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(s.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:_})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const s=this._layers.get(e.wasmLayerId);if(s){const r=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,r,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,r,t.length,i),this._lyr3DMain._free(r),s.needFrame=!0,s.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=c().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const l="global"===this.view.viewingMode?5:3;if(5===l)this._viewSR.wkid=this._viewSR.latestWkid=p,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=f;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=w,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=f;else if(this.view.renderSpatialReference?.wkid===b)this._viewSR.wkid=this._viewSR.latestWkid=p,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=f;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=this.view.heightModelInfo?.heightModel,t=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=t?f:M}return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,e,t,l,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new y(m(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach(i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory}),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,s=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,s,i.maxMemory),this._layers.forEach(e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())})}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,s=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,s,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,s,e),this._lyr3DMain._free(s)}this._decrementJobCount(e)}_getRequestPromises(e,i,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.append("session",r.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,s,a,n,o){const l=this._getRequestPromises(e.urls,t,i,s);return Promise.all(l).then(e=>(a.inputs=e,this._workerHandle.invoke(a,n))).then(e=>e).catch(t=>{let i=1;return r(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):o&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,s=t.layerView.layer,a="integrated-mesh-3dtiles"===s.type?s.key:null,n="integrated-mesh-3dtiles"===s.type?s.session:null,o={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:a}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=a=>{if(1===a.status)this._onJobFailed(t,a,e);else if(0===a.status)this._onJobSucceeded(t,a,e);else if(2===a.status){const n=this._getRequestPromises(a.missingInputUrls,o,d,s);Promise.all(n).then(e=>{l.jobDescJson=a.jobDescJson,a.originalInputs?l.inputs=a.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const t of e)l.inputs.push(t);return this._workerHandle.invoke(l,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t),r(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const t=await this._getInitialPromise(e,o,d,s,l,i,n);if(3===t.status&&"integrated-mesh-3dtiles"===s.type){n===s.session&&null!==s.session&&await s.requestRootAndSession(i);h(await this._getInitialPromise(e,o,d,s,l,i,s.session))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc),this._decrementJobCount(t)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)}).catch(t=>{r(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,s)}_onWasmError(e,t,i,s){this._lyr3DMain&&this._debugLog(i,s,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_addLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:u};const i="integrated-mesh-3dtiles"===t.type?0:2,r=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==r.errorCode)return{wasmLayerId:u,check:r};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const o=g(t.elevationInfo),l=e=>s.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let _=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(t)){let i=t.spatialReference;if(e.useEsriCrs&&t.esriCrsSpatialReference){i=t.esriCrsSpatialReference;const s=d(i);let r=1,a=1;!s&&i.wkid&&-1!==i.wkid&&(r=h.values[h[i.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(i)),s,r,a).catch(l)}_=this._lyr3DMain.add_gaussian_splat_layer(t.url,a,o)}else _=this._lyr3DMain.add_3dtiles_layer(t.url,a,o);return _?(this._updateWasmCamera(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:u})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:s,near:r,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:s,near:r,far:a,fov:n,aspectRatio:l,viewport:o})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([o({constructOnly:!0})],L.prototype,"view",void 0),L=e([l("esri.layers.Lyr3DWasmPerSceneView")],L);const v=L;export{v as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import i from"../request.js";import t from"../core/Accessor.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{isGeographic as d}from"../geometry/support/spatialReferenceUtils.js";import h from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as _,invalidLayerView as y}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as u}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as c}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as m}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/support/makeScheduleFunction.js";const w=3857,p=32662,f=4326,b=5773,D=115700;let M=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._lyr3DBusyCount=0,this._debugFlags=new Set,this._debugLevel=2,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,r=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=r?`[js] ${t}`:`${t}`;0===i||1===i?s.getLogger(this).error(e):2===i&&s.getLogger(this).warn(e),s.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(s.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:_})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=t.needFrame||this._lyr3DBusyCount>0;t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const s=this._layers.get(e.wasmLayerId);if(s){const r=this._lyr3DMain._malloc(8*i.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,r,i.length);for(let e=0;e<i.length;++e)a[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,r,i.length,t),this._lyr3DMain._free(r);const n=s.needFrame||this._lyr3DBusyCount>0;s.needFrame=!0,n||s.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=c().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const l="global"===this.view.viewingMode?5:3;if(5===l)this._viewSR.wkid=this._viewSR.latestWkid=f,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=b;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=w,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=b;else if(this.view.renderSpatialReference?.wkid===p)this._viewSR.wkid=this._viewSR.latestWkid=f,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=b;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=this.view.heightModelInfo?.heightModel,i=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=i?b:D}return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,e,i,l,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new u(g(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0)}_pulseTask(){if(this._lyr3DMain){let e=0,i=0;this._layers.forEach(t=>{e+=t.layerView.usedMemory,i+=t.layerView.cachedMemory}),e/=1048576,i/=1048576;const t=this.view.resourceController.memoryController,s=t.usedMemory*t.maxMemory-e,r=this._lyr3DBusyCount>0;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(t.memoryFactor,e,i,s,t.maxMemory);const a=this._lyr3DBusyCount>0;this._layers.forEach(e=>{const i=(r||e.needFrame)!==a;e.needFrame=!1,i&&e.layerView.updatingFlagChanged()})}}_onJobFailed(e,i){e.error.length&&this._debugLog(1,1,e.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc)}_onJobSucceeded(e,i){if(this._lyr3DMain){const t=e.data.byteLength,s=this._lyr3DMain._malloc(t);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,s,t).set(e.data),this._lyr3DMain.on_job_completed(i.jobId,e.jobDescJson,s,t),this._lyr3DMain._free(s)}}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.append("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,a,n,o){const l=this._getRequestPromises(e.urls,i,t,s);return Promise.all(l).then(e=>(a.inputs=e,this._workerHandle.invoke(a,n))).then(e=>e).catch(i=>{let t=1;return r(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):o&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;const t=i.abortController.signal,s=i.layerView.layer,a="integrated-mesh-3dtiles"===s.type?s.key:null,n="integrated-mesh-3dtiles"===s.type?s.session:null,o={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:a}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=i=>{if(1===i.status)this._onJobFailed(i,e);else if(0===i.status)this._onJobSucceeded(i,e);else if(2===i.status){const a=this._getRequestPromises(i.missingInputUrls,o,d,s);Promise.all(a).then(e=>{l.jobDescJson=i.jobDescJson,i.originalInputs?l.inputs=i.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const i of e)l.inputs.push(i);return this._workerHandle.invoke(l,t)}).then(i=>{1===i.status?this._onJobFailed(i,e):0===i.status&&this._onJobSucceeded(i,e)}).catch(i=>{r(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const i=await this._getInitialPromise(e,o,d,s,l,t,n);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){n===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,o,d,s,l,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),i=e.meshData;if(i.data&&i.data.byteLength>0){const e=i.data.slice();i.data=e}const t=this._layers.get(e.layerId);t&&t.layerView.createRenderable(e).then(i=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,i.memUsageBytes)}).catch(i=>{r(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0)})}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:y};const t="integrated-mesh-3dtiles"===i.type?0:2,r=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==r.errorCode)return{wasmLayerId:y,check:r};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!1});const o=m(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),_=e=>s.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let u=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=d(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=h.values[h[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(_)}u=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else u=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o);return u?(this._updateWasmCamera(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:y})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:i,center:t,up:s,near:r,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:i,center:t,up:s,near:r,far:a,fov:n,aspectRatio:l,viewport:o})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([o({constructOnly:!0})],M.prototype,"view",void 0),M=e([l("esri.layers.Lyr3DWasmPerSceneView")],M);const L=M;export{L as default};
|