@arcgis/core 5.1.0-next.25 → 5.1.0-next.27
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/PopupTemplate.d.ts +12 -8
- package/README.md +4 -5
- package/applications/Components/testUtils.js +1 -1
- package/applications/Components/viewUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{7a2e9626d0853a6d1547.js → 01e4cc34be6265843258.js} +1 -1
- package/assets/esri/core/workers/chunks/0389ebb63510dd7024de.js +2 -0
- package/assets/esri/core/workers/chunks/03e20ac54d6f141b5001.js +1 -0
- package/assets/esri/core/workers/chunks/049ec6dcb5d9519029fe.js +1 -0
- package/assets/esri/core/workers/chunks/{54794b18edc584fd7515.js → 07528211e59740c47aaa.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e32e7b2ea2ea1a1fc04.js → 1069b92c2c5fe5f0398b.js} +1 -1
- package/assets/esri/core/workers/chunks/17078f4ab1b3e33c80b4.js +1 -0
- package/assets/esri/core/workers/chunks/23079a2e584fca0bdb66.js +1 -0
- package/assets/esri/core/workers/chunks/{6fde745f3a62e7f5a97d.js → 36fd18a05ba503e6f3b5.js} +1 -1
- package/assets/esri/core/workers/chunks/{a78ac951c00f090d9024.js → 3a018c78859b5edec4fd.js} +1 -1
- package/assets/esri/core/workers/chunks/{abc2471cfa9430ca5645.js → 3a8f2f6ac3c3e7e71c00.js} +1 -1
- package/assets/esri/core/workers/chunks/{7189e03cc24f5c10865a.js → 4490f8eeeb2ee04daa9d.js} +2 -2
- package/assets/esri/core/workers/chunks/{593e9c8ac3b3b02deeb9.js → 4b4cf6efde26dd80f4ad.js} +1 -1
- package/assets/esri/core/workers/chunks/4e9b3b4b3dcce94c99a5.js +1 -0
- package/assets/esri/core/workers/chunks/{14792047c5519dd89828.js → 541619f434b643f0526d.js} +1 -1
- package/assets/esri/core/workers/chunks/{4fc6dd1423075e145b29.js → 5fff383615ba93adbf36.js} +1 -1
- package/assets/esri/core/workers/chunks/{25bc7c7bc2793d209640.js → 776c0c38b9179dda00b3.js} +1 -1
- package/assets/esri/core/workers/chunks/{e6f51f66b71e0d6525ec.js → 8dcc8df5925f66e45b8c.js} +1 -1
- package/assets/esri/core/workers/chunks/8eae33c4d8932b7a6bc1.js +1 -0
- package/assets/esri/core/workers/chunks/{f5c5a9e771074f780fc8.js → 94563b007647a9c4ad76.js} +1 -1
- package/assets/esri/core/workers/chunks/{0140dc583e20b031eac9.js → 952ff668d202e80b43b0.js} +1 -1
- package/assets/esri/core/workers/chunks/a061a17b62686f945e81.js +1 -0
- package/assets/esri/core/workers/chunks/{835d6dd8c5a00682d879.js → a1eb8c6fd9a885cbaec9.js} +1 -1
- package/assets/esri/core/workers/chunks/{9e7eea56e96f012f9ff4.js → a7d06c1553dfb6e83fe6.js} +1 -1
- package/assets/esri/core/workers/chunks/b1ddc837a6805a09d0da.js +1 -0
- package/assets/esri/core/workers/chunks/b9d68a5dcb50999d3a90.js +1 -0
- package/assets/esri/core/workers/chunks/{f12f96770a45ce6d1ed7.js → c3a0b38abf0a12a466fa.js} +1 -1
- package/assets/esri/core/workers/chunks/{e2661d39c48376163adf.js → c55c70dde682084867a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{2de299ff3a902d380be6.js → c814abf3e67d9eadbc6b.js} +1 -1
- package/assets/esri/core/workers/chunks/c9bfe3d8416856c4a657.js +1 -0
- package/assets/esri/core/workers/chunks/e4faccd48060349b8da1.js +1 -0
- package/assets/esri/core/workers/chunks/{f1c1f7583fa13dff9b5c.js → e611f37bc22f75ce8a06.js} +44 -38
- package/assets/esri/core/workers/chunks/{deee88e3f1641c6ef5db.js → ee6f7c5d3c2f187645ff.js} +1 -1
- package/assets/esri/core/workers/chunks/ef29e9e575091ef3adbb.js +1 -0
- package/assets/esri/core/workers/chunks/{ef267b938327c41727c1.js → f89b7b0ccfbd1e5f9a0f.js} +1 -1
- package/assets/esri/core/workers/chunks/{c794f7be868e53ca4a8c.js → fb05f27710fb50691d7a.js} +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +4 -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/ImageMaterial.glsl.js +7 -7
- package/chunks/MeasurementArrow.glsl.js +5 -8
- package/chunks/ShadowCastAccumulate.glsl.js +5 -10
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vec4.js +1 -1
- package/config.d.ts +2 -2
- package/config.js +1 -1
- package/editing/templateUtils.js +1 -1
- package/geometry/support/buffer/math/common.js +1 -1
- package/geometry/support/buffer/math/vec3.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/support/FeatureReductionBinning.d.ts +3 -4
- package/layers/support/FeatureReductionBinning.js +1 -1
- package/layers/support/FeatureReductionCluster.d.ts +3 -4
- package/layers/support/FeatureReductionCluster.js +1 -1
- package/layers/support/featureReductionProperties.js +1 -1
- package/package.json +3 -3
- package/renderers/FlowRenderer.d.ts +6 -2
- package/support/actions/ActionBase.d.ts +5 -3
- package/support/actions/ActionBase.js +1 -1
- package/support/basemapDefinitions.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/Font.d.ts +1 -1
- package/symbols/TextSymbol.d.ts +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/support/densifyForPreview.js +2 -0
- package/symbols/support/previewSymbol2D.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/LocalAtmosphere.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +12 -6
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.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/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.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/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.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/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/layers/MediaLayerView.d.ts +90 -4
- package/views/layers/MediaLayerView.js +1 -1
- package/views/support/waitForResources.js +1 -1
- package/widgets/Features/FeaturesViewModel.d.ts +14 -19
- package/widgets/Features.d.ts +1 -1
- package/widgets/Measurement.d.ts +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/Arrow.js +1 -1
- package/widgets/Popup.d.ts +1 -1
- package/widgets/ValuePicker.d.ts +1 -1
- package/widgets/support/legacyIcon.js +1 -1
- package/assets/esri/core/workers/chunks/1be4e308280149eae4fb.js +0 -1
- package/assets/esri/core/workers/chunks/1dcd057695f8db79eca2.js +0 -1
- package/assets/esri/core/workers/chunks/1df8330823841b5bb6a5.js +0 -1
- package/assets/esri/core/workers/chunks/2063b49607a03f7718ee.js +0 -1
- package/assets/esri/core/workers/chunks/2b76a8897ad7ba284d33.js +0 -1
- package/assets/esri/core/workers/chunks/36da644678e6acf3bdb5.js +0 -1
- package/assets/esri/core/workers/chunks/4754610760f3f634adf9.js +0 -2
- package/assets/esri/core/workers/chunks/551fee27bf3abf0c41fd.js +0 -1
- package/assets/esri/core/workers/chunks/57b620d7e029747adca3.js +0 -1
- package/assets/esri/core/workers/chunks/74e3c224e879edb37812.js +0 -1
- package/assets/esri/core/workers/chunks/868c8a152cb1452b9a94.js +0 -1
- package/assets/esri/core/workers/chunks/e839c5f3a0213091a399.js +0 -1
- package/assets/esri/core/workers/chunks/feececf6809231f72c5a.js +0 -1
- package/views/layers/MediaLayerViewMixin.d.ts +0 -109
- package/views/layers/MediaLayerViewMixin.js +0 -2
- /package/assets/esri/core/workers/chunks/{4754610760f3f634adf9.js.LICENSE.txt → 0389ebb63510dd7024de.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7189e03cc24f5c10865a.js.LICENSE.txt → 4490f8eeeb2ee04daa9d.js.LICENSE.txt} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{SliceDraw as e}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as r}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{
|
|
2
|
+
import{SliceDraw as e}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as r}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{terrainDepthTest as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{FloatPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{If as a,glsl as l}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{outputColorHighlightOLID as n}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{NoParameters as g}from"../views/webgl/NoParameters.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";class v extends g{}function c(g){const v=new p,{vertex:c,fragment:m,varyings:u}=v,{output:w,perspectiveInterpolation:f}=g;return s(c,g),v.include(r),v.include(o,g),v.fragment.include(e,g),v.fragment.code.add(l`void outputObjectAndLayerIdColor() {
|
|
3
|
+
${a(9===w,"fragColor = vec4(0, 0, 0, 1);")}
|
|
4
|
+
}`),v.include(n,g),v.attributes.add("position","vec3"),v.attributes.add("uv0","vec2"),f&&v.attributes.add("perspectiveDivide","float"),c.main.add(l`
|
|
3
5
|
vpos = position;
|
|
4
6
|
forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
|
|
5
7
|
vTexCoord = uv0;
|
|
6
8
|
gl_Position = transformPosition(proj, view, vpos);
|
|
7
|
-
${
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
vec4 finalColor = texture(tex, vTexCoord) * opacity;
|
|
12
|
-
outputColorHighlightOLID(applySlice(finalColor, vpos), finalColor.rgb);`),c}const u=Object.freeze(Object.defineProperty({__proto__:null,ImageMaterialPassParameters:c,build:m},Symbol.toStringTag,{value:"Module"}));export{u as I,c as a,m as b};
|
|
9
|
+
${a(f,"gl_Position *= perspectiveDivide;")}`),u.add("vpos","vec3",{invariant:!0}),u.add("vTexCoord","vec2"),m.include(i),m.uniforms.add(new t("opacity",e=>e.opacity),new d("tex",e=>e.texture)).main.add(l`discardBySlice(vpos);
|
|
10
|
+
discardByTerrainDepth();
|
|
11
|
+
vec4 finalColor = texture(tex, vTexCoord) * opacity;
|
|
12
|
+
outputColorHighlightOLID(applySlice(finalColor, vpos), finalColor.rgb);`),v}const m=Object.freeze(Object.defineProperty({__proto__:null,ImageMaterialPassParameters:v,build:c},Symbol.toStringTag,{value:"Module"}));export{m as I,v as a,c as b};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{addProjViewLocalOrigin as e}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as r}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{
|
|
2
|
+
import{addProjViewLocalOrigin as e}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as r}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{outputColorHighlightOLID as i}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as n}from"../views/webgl/ShaderBuilder.js";function l(l){const s=new n,{vertex:d,fragment:a}=s;s.include(i,l),e(d,l),d.uniforms.add(new o("width",e=>e.width)),s.attributes.add("position","vec3"),s.attributes.add("normal","vec3"),s.attributes.add("uv0","vec2"),s.attributes.add("length","float"),s.varyings.add("vtc","vec2"),s.varyings.add("vlength","float"),s.varyings.add("vradius","float"),d.main.add(r`vec3 bitangent = normal;
|
|
3
3
|
vtc = uv0;
|
|
4
4
|
vlength = length;
|
|
5
5
|
vradius = 0.5 * width;
|
|
6
6
|
vec4 pos = view * vec4(position + vradius * bitangent * uv0.y, 1.0);
|
|
7
|
-
gl_Position = proj * pos;`),
|
|
8
|
-
const float INV_SQRT2 = ${r.float(
|
|
7
|
+
gl_Position = proj * pos;`),a.uniforms.add(new o("outlineSize",e=>e.outlineSize),new t("outlineColor",e=>e.outlineColor),new o("stripeLength",e=>e.stripeLength),new t("stripeEvenColor",e=>e.stripeEvenColor),new t("stripeOddColor",e=>e.stripeOddColor));const v=1/Math.sqrt(2);return a.code.add(r`
|
|
8
|
+
const float INV_SQRT2 = ${r.float(v)};
|
|
9
9
|
|
|
10
10
|
vec4 arrowColor(vec2 tc, float len) {
|
|
11
11
|
float d = INV_SQRT2 * (tc.x - abs(tc.y));
|
|
@@ -19,9 +19,6 @@ gl_Position = proj * pos;`),l.uniforms.add(new o("outlineSize",e=>e.outlineSize)
|
|
|
19
19
|
return outlineColor;
|
|
20
20
|
}
|
|
21
21
|
return fract(0.5 / stripeLength * tc.x * vradius) >= 0.5 ? stripeOddColor : stripeEvenColor;
|
|
22
|
-
}`),
|
|
22
|
+
}`),a.main.add(r`vec2 ntc = vec2(vtc.x / vradius, vtc.y);
|
|
23
23
|
vec4 color = arrowColor(ntc, vlength / vradius);
|
|
24
|
-
|
|
25
|
-
discard;
|
|
26
|
-
}
|
|
27
|
-
fragColor = color;`),d}const d=Object.freeze(Object.defineProperty({__proto__:null,build:a},Symbol.toStringTag,{value:"Module"}));export{d as M,a as b};
|
|
24
|
+
outputColorHighlightOLID(color, color.rgb);`),s}const s=Object.freeze(Object.defineProperty({__proto__:null,build:l},Symbol.toStringTag,{value:"Module"}));export{s as M,l as b};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{calculateUVZShadowFromDepthPass as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import{
|
|
3
|
-
sampleCount = ${
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{calculateUVZShadowFromDepthPass as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import{readShadowMaps as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ShadowmapFiltering as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import{glsl as d}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{ShaderBuilder as t}from"../views/webgl/ShaderBuilder.js";const n=255,l=1/n;function i(n){const i=new t,{fragment:m}=i;i.include(e),i.include(a),i.include(s),i.include(o),m.constants.add("sampleValue","float",l);const p=1===n.index?"vec2":"float";return i.outputs.add("sampleCount",p),m.uniforms.add(new r("depthMap",e=>e.depth?.attachment)).main.add(d`
|
|
3
|
+
sampleCount = ${p}(0.0);
|
|
4
4
|
|
|
5
5
|
vec3 uvzShadow = calculateUVZShadowFromDepth(uv, textureSize(shadowMap,0), depthMap);
|
|
6
|
-
if (uvzShadow.z < 0.0) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
6
|
// The shadow map sampler returns a value between 0 and 1, we take the midpoint as we count discrete samples
|
|
11
|
-
bool shadow =
|
|
12
|
-
|
|
7
|
+
bool shadow = readShadowMaps(uvzShadow) > 0.5;
|
|
13
8
|
if (shadow) {
|
|
14
|
-
sampleCount = ${
|
|
9
|
+
sampleCount = ${p}(sampleValue); // Add 1 to the sample count
|
|
15
10
|
}
|
|
16
|
-
`),
|
|
11
|
+
`),i}const m=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastMaxSamples:n,build:i},Symbol.toStringTag,{value:"Module"}));export{n as S,m as a,i as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{normalize as e,transformMat4 as i}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{NormalFromDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js";import{ScreenSpacePass as t}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{calculateUVZShadowFromDepthPass as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import{ShadowmapFiltering as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import{Float3BindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float4PassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as n}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DShadowBindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js";import{Texture2DUintPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{ShaderBuilder as w}from"../views/webgl/ShaderBuilder.js";const m=.025;function p(){const o=new w;o.include(a),o.include(l),o.include(t),o.include(r);const p=o.fragment;return p.uniforms.add(new c("shadowMapExcludingHighlight",e=>e.
|
|
2
|
+
import{normalize as e,transformMat4 as i}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{NormalFromDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js";import{ScreenSpacePass as t}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{calculateUVZShadowFromDepthPass as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import{ShadowmapFiltering as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import{Float3BindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float4PassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as n}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DShadowBindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js";import{Texture2DUintPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{ShaderBuilder as w}from"../views/webgl/ShaderBuilder.js";const m=.025;function p(){const o=new w;o.include(a),o.include(l),o.include(t),o.include(r);const p=o.fragment;return p.uniforms.add(new c("shadowMapExcludingHighlight",({shadowMap:e})=>e.getOutput(5)),new c("shadowMapHighlight",({shadowMap:e})=>e.getOutput(4)),new s("depthMap",e=>e.depth?.attachment),new u("highlightTexture",e=>e.highlightTexture),new d("uColor",e=>e.shadowColor),new g("opacity",e=>e.shadowOpacity),new g("occludedOpacity",e=>e.occludedShadowOpacity),new g("terminationFactor",e=>e.opacityElevation*e.dayNightTerminator),new h("lightingMainDirectionView",({lighting:o,camera:r})=>e(f,i(f,o.mainLight.direction,r.viewInverseTransposeMatrix)))),p.main.add(n`
|
|
3
3
|
ivec2 highlightTextureSize = textureSize(highlightTexture, 0);
|
|
4
4
|
ivec2 highlightIUV = ivec2(uv * vec2(highlightTextureSize));
|
|
5
5
|
uvec2 highlightInfo = texelFetch(highlightTexture, highlightIUV, 0).rg;
|
package/chunks/vec3.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{colorGamma as t}from"../colorUtils.js";import"../core/has.js";import"../
|
|
2
|
+
import{colorGamma as t}from"../colorUtils.js";import"../core/has.js";import{getCount as e}from"../geometry/support/buffer/math/common.js";function f(t,e,f){r(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function r(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u),s=r[0],l=r[1],d=r[2],c=r[4],p=r[5],y=r[6],B=r[8],h=r[9],m=r[10],g=r[12],S=r[13],M=r[14];let b=0,j=0;for(let e=0;e<a;e++){const e=f[b],r=f[b+1],i=f[b+2];t[j]=s*e+c*r+B*i+g,t[j+1]=l*e+p*r+h*i+S,t[j+2]=d*e+y*r+m*i+M,b+=o,j+=n}return t}function n(t,e,f){o(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function o(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u),s=r[0],l=r[1],d=r[2],c=r[3],p=r[4],y=r[5],B=r[6],h=r[7],m=r[8];let g=0,S=0;for(let e=0;e<a;e++){const e=f[g],r=f[g+1],i=f[g+2];t[S]=s*e+c*r+B*i,t[S+1]=l*e+p*r+h*i,t[S+2]=d*e+y*r+m*i,g+=o,S+=n}}function i(t,e,f){u(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function u(t,e,f,r=3,n=r){const o=Math.min(t.length/r,e.length/n);let i=0,u=0;for(let a=0;a<o;a++)t[u]=f*e[i],t[u+1]=f*e[i+1],t[u+2]=f*e[i+2],i+=n,u+=r;return t}function a(t,e,f,r){s(t.typedBuffer,e.typedBuffer,f,r,t.typedBufferStride,e.typedBufferStride)}function s(e,f,r,n,o=3,i=o){const u=Math.min(e.length/o,f.length/i);let a=0,s=0;const l=1/t;for(let t=0;t<u;t++)e[s]=n*(r*f[a])**l,e[s+1]=n*(r*f[a+1])**l,e[s+2]=n*(r*f[a+2])**l,a+=i,s+=o}function l(t,f,r,n=3,o=n){const i=e(t.length,n,3),u=e(f.length,o,3),a=Math.min(i,u);let s=0,l=0;for(let e=0;e<a;e++)t[l]=f[s]+r[0],t[l+1]=f[s+1]+r[1],t[l+2]=f[s+2]+r[2],s+=o,l+=n;return t}function d(t,e){c(t.typedBuffer,e.typedBuffer,t.typedBufferStride,e.typedBufferStride)}function c(t,e,f=3,r=f){const n=Math.min(t.length/f,e.length/r);let o=0,i=0;for(let u=0;u<n;u++){const n=e[o],u=e[o+1],a=e[o+2],s=n*n+u*u+a*a;if(s>0){const e=1/Math.sqrt(s);t[i]=e*n,t[i+1]=e*u,t[i+2]=e*a}o+=r,i+=f}}function p(t,e,f){const r=Math.min(t.count,e.count),n=t.typedBuffer,o=t.typedBufferStride,i=e.typedBuffer,u=e.typedBufferStride;let a=0,s=0;for(let l=0;l<r;l++)n[s]=i[a]>>f,n[s+1]=i[a+1]>>f,n[s+2]=i[a+2]>>f,a+=u,s+=o}const y=Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:s,linearToSRGBView:a,normalize:c,normalizeView:d,scale:u,scaleView:i,shiftRight:p,transformMat3:o,transformMat3View:n,transformMat4:r,transformMat4View:f,translate:l},Symbol.toStringTag,{value:"Module"}));export{l as a,o as b,n as c,f as d,d as e,s as f,i as g,p as h,a as l,c as n,u as s,r as t,y as v};
|
package/chunks/vec4.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{colorGamma as t}from"../colorUtils.js";import"../core/has.js";import{
|
|
2
|
+
import{colorGamma as t}from"../colorUtils.js";import"../core/has.js";import{getCount as e}from"../geometry/support/buffer/math/common.js";function f(t,f,r){const n=t.typedBuffer,o=t.typedBufferStride,i=f.typedBuffer,u=f.typedBufferStride,s=e(n.length,o,4),a=e(i.length,u,4),c=Math.min(s,a),d=r[0],l=r[1],p=r[2],y=r[3],B=r[4],m=r[5],h=r[6],S=r[7],M=r[8],g=r[9],b=r[10],j=r[11],w=r[12],V=r[13],_=r[14],T=r[15];for(let e=0;e<c;e++){const t=e*o,f=e*u,r=i[f],s=i[f+1],a=i[f+2],c=i[f+3];n[t]=d*r+B*s+M*a+w*c,n[t+1]=l*r+m*s+g*a+V*c,n[t+2]=p*r+h*s+b*a+_*c,n[t+3]=y*r+S*s+j*a+T*c}}function r(t,f,r,n=4,o=n){const i=e(t.length,n,4),u=e(f.length,o,4),s=Math.min(i,u),a=r[0],c=r[1],d=r[2],l=r[3],p=r[4],y=r[5],B=r[6],m=r[7],h=r[8],S=r[9],M=r[10],g=r[11],b=r[12],j=r[13],w=r[14],V=r[15];let _=0,T=0;for(let e=0;e<s;e++){const e=f[_],r=f[_+1],i=f[_+2],u=f[_+3];t[T]=a*e+p*r+h*i+b*u,t[T+1]=c*e+y*r+S*i+j*u,t[T+2]=d*e+B*r+M*i+w*u,t[T+3]=l*e+m*r+g*i+V*u,_+=o,T+=n}}function n(t,e,f){o(t.typedBuffer,e.typedBuffer,f,t.typedBufferStride,e.typedBufferStride)}function o(t,f,r,n=4,o=n){const i=e(t.length,n,4),u=e(f.length,o,4),s=Math.min(i,u),a=r[0],c=r[1],d=r[2],l=r[3],p=r[4],y=r[5],B=r[6],m=r[7],h=r[8];let S=0,M=0;for(let e=0;e<s;e++){const e=f[S],r=f[S+1],i=f[S+2],u=f[S+3];t[M]=a*e+l*r+B*i,t[M+1]=c*e+p*r+m*i,t[M+2]=d*e+y*r+h*i,t[M+3]=u,S+=o,M+=n}}function i(t,e){const f=Math.min(t.count,e.count),r=t.typedBuffer,n=t.typedBufferStride,o=e.typedBuffer,i=e.typedBufferStride;for(let u=0;u<f;u++){const t=u*n,e=u*i,f=o[e],s=o[e+1],a=o[e+2],c=f*f+s*s+a*a;if(c>0){const e=1/Math.sqrt(c);r[t]=e*f,r[t+1]=e*s,r[t+2]=e*a}}}function u(t,e,f){s(t.typedBuffer,e,f,t.typedBufferStride)}function s(t,e,f,r=4){const n=Math.min(t.length/r,e.count),o=e.typedBuffer,i=e.typedBufferStride;let u=0,s=0;for(let a=0;a<n;a++)t[s]=f*o[u],t[s+1]=f*o[u+1],t[s+2]=f*o[u+2],t[s+3]=f*o[u+3],u+=i,s+=r}function a(t,e,f,r){c(t.typedBuffer,e,f,r,t.typedBufferStride)}function c(e,f,r,n,o=4){const i=Math.min(e.length/o,f.count),u=f.typedBuffer,s=f.typedBufferStride;let a=0,c=0;const d=1/t;for(let t=0;t<i;t++)e[c]=n*(r*u[a])**d,e[c+1]=n*(r*u[a+1])**d,e[c+2]=n*(r*u[a+2])**d,e[c+3]=n*r*u[a+3],a+=s,c+=o}const d=Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:a,normalize:i,scale:s,scaleView:u,transformMat3:o,transformMat3View:n,transformMat4:r,transformMat4View:f},Symbol.toStringTag,{value:"Module"}));export{n as a,c as b,u as c,r as d,f as e,a as l,i as n,s,o as t,d as v};
|
package/config.d.ts
CHANGED
|
@@ -287,11 +287,11 @@ export interface ApiKeysScopeConfig {
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
export interface WorkersConfig {
|
|
290
|
-
/** The absolute url to the AMD or SystemJS loader used in the worker. The AMD CDN build has a default value for when this property isn't set. This is required when using custom workers. */
|
|
290
|
+
/** The absolute url to the AMD or SystemJS loader used in the worker. The AMD CDN build has a default value for when this property isn't set. This is required when using custom workers. See this [ESM sample](https://github.com/Esri/jsapi-resources/tree/main/templates/geometry-operator-worker). */
|
|
291
291
|
loaderUrl?: string;
|
|
292
292
|
/**
|
|
293
293
|
* This is used by the `@arcgis/core` npm package to control where to load a custom build of the `RemoteClient` from.
|
|
294
|
-
* By default, `RemoteClient` is loaded from the API's [assets](https://developers.arcgis.com/javascript/latest/working-with-assets/).
|
|
294
|
+
* By default, `RemoteClient` is loaded from the API's [assets](https://developers.arcgis.com/javascript/latest/working-with-assets/). See this [ESM sample](https://github.com/Esri/jsapi-resources/tree/main/templates/geometry-operator-worker).
|
|
295
295
|
*/
|
|
296
296
|
workerPath?: string;
|
|
297
297
|
/** The AMD configuration object that is set in each worker. */
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
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.1.0-next.
|
|
2
|
+
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.1.0-next.27";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
package/editing/templateUtils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../core/Logger.js";import{getOrCreateMapValue as t}from"../core/MapUtils.js";import{throwIfAborted as r}from"../core/promiseUtils.js";import{addMaybe as n}from"../core/SetUtils.js";import{isGroupTemplateDefinition as
|
|
2
|
+
import e from"../core/Logger.js";import{getOrCreateMapValue as t}from"../core/MapUtils.js";import{throwIfAborted as r}from"../core/promiseUtils.js";import{addMaybe as n}from"../core/SetUtils.js";import{isGroupTemplateDefinition as o,isPresetTemplateDefinition as i,isFeatureTemplateDefinition as s}from"./sharedTemplates/templateDefinitions/templateDefinitionUtils.js";import{isSubtypeGroupLayer as a,isSubtypeSublayer as l,isFeatureLayer as f}from"../layers/support/layerUtils.js";import{querySharedTemplates as u}from"../rest/sharedTemplates/querySharedTemplates.js";import{getServices as p}from"../undoredo/support/Services.js";const c=()=>e.getLogger("esri.editing.templateUtils");function y(e){return null!=e&&"prototype"in e}function m(e){return g(e)&&!("definition"in e)}function d(e){return g(e)&&"definition"in e}function g(e){return null!=e&&"templateId"in e}function w(e){return d(e)&&"feature"===e?.type&&(null==e.definition||s(e.definition))}function h(e){return d(e)&&"group"===e?.type&&(null==e.definition||o(e.definition))}function A(e){return d(e)&&"preset"===e?.type&&(null==e.definition||i(e.definition))}function b(e){return d(e)&&null!=e?.definition}const j=e=>{if(null==e||"object"!=typeof e)return[];return[..."templates"in e&&Array.isArray(e.templates)?e.templates:[],..."types"in e&&Array.isArray(e.types)?e.types.flatMap(e=>e.templates):[]]};async function v({layers:e,view:t,signal:n,queryOptions:o}){if(null==t)return e.map(e=>({layer:e,templates:j(e)}));const i=await M(e,t);r(n);const s=new Map,a=Array.from(i).map(async e=>(await e.load(),await S({serviceInfo:e,out:s,signal:n,queryOptions:o}))),l=await Promise.allSettled(a);for(const r of l.filter(e=>"rejected"===e.status))c().warn("Failed to fetch shared templates for service. Will use standard templates if available.",r.reason);return e.map(e=>({layer:e,templates:s.get(e)??j(e)}))}async function S({serviceInfo:e,out:t,signal:n,queryOptions:o}){const{featureService:i,layersAndTables:s}=e,l=await q({featureService:i,layers:s.toArray(),signal:n,queryOptions:o});r(n);for(const[r,f]of l.entries())if(0!==f.length)if(a(r)){const e=O(f),n=[],o=e.get(1/0)??n;for(const i of r.sublayers){const r=e.get(i.subtypeCode)??n;t.set(i,[...r,...o])}}else t.set(r,f)}async function q({featureService:e,layers:r,signal:n,queryOptions:o}){if(!e.capabilities?.editing.supportsSharedTemplates)return new Map;const i=new Map;for(const l of r)t(i,l.layerId,()=>[]).push(l);const s=await u({featureService:e,query:{layers:Array.from(i.keys()),...o},requestOptions:{signal:n}}),a=new Map;for(const l of s)for(const e of l.layerIds)if(i.has(e))for(const r of i.get(e))t(a,r,()=>[]).push(l);return a}async function M(e,t){const r=p(t),o=new Set;for(const i of e)n(o,L(r,i));return await Promise.all(Array.from(o).map(e=>e.load())),o}function L(e,t){return l(t)&&t.parent?e.tablesAndLayersLookup.get(t.parent):f(t)?e.tablesAndLayersLookup.get(t):null}function O(e){const r=new Map;for(const n of e)t(r,n.subtypeCode??1/0,()=>[]).push(n);return r}function U(e,t={}){return h(e)||A(e)?{}:y(e)?{...e.prototype.attributes,...t}:w(e)?{...e.definition?.defaultValues,...t}:{...t}}export{j as getAllStandardFeatureTemplatesForLayer,U as getCreationAttributes,L as getServiceInfoForLayer,v as getTemplatesForLayers,b as isLoadedSharedTemplate,w as isSharedFeatureTemplate,h as isSharedGroupTemplate,A as isSharedPresetTemplate,d as isSharedTemplate,m as isSharedTemplateMetadata,g as isSharedTemplateOrMetadata,y as isStandardFeatureTemplate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import r from"../../../../core/Logger.js";const
|
|
2
|
+
import r from"../../../../core/Logger.js";const o=()=>r.getLogger("esri.views.3d.support.buffer.math");function t(r,o,t){if(o<=0)return 0;const e=r-t;return e<0?0:Math.floor(e/o)+1}export{t as getCount,o as getMathLogger};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../colorUtils.js";import"../../../../core/has.js";import"
|
|
2
|
+
import"../../../../colorUtils.js";import"../../../../core/has.js";import"./common.js";export{f as linearToSRGB,l as linearToSRGBView,n as normalize,e as normalizeView,s as scale,g as scaleView,h as shiftRight,b as transformMat3,c as transformMat3View,t as transformMat4,d as transformMat4View,a as translate}from"../../../../chunks/vec3.js";
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
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.1";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.1.0-next.
|
|
2
|
+
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.1";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.1.0-next.27",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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import i from"../request.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{createAbortError as a,isAborted as n,isAbortError as o}from"../core/promiseUtils.js";import{watch as l}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as c}from"../geometry/support/spatialReferenceUtils.js";import u from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as m,elevQueriesFull as g,elevQueriesGenericFail as w,invalidLayerView as p}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as b}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as f}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as M}from"../views/3d/layers/support/makeScheduleFunction.js";const L=3857,k=32662,R=4326,S=5773,C=115700;let W=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([l(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),l(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=d({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(a())}),this._elevationQueries.clear(),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:m})}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=this._isUpdating(t);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){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||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=v().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"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const d="global"===this.view.viewingMode?5:3;if(5===d)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=L,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(this.view.renderSpatialReference?.wkid===k)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=f(this.view.heightModelInfo);if(e)this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=e;else{const e=this.view.heightModelInfo?.heightModel,i=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=i?S:C}}return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new b(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()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0)}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0)})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===L?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===g)return Promise.reject("max mesh elevation query limit exceeded");if(d===w)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{n(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(a()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(){if(this._lyr3DMain){if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;this._lyr3DMain.set_camera_elevation(e)}this._checkForAbortedElevationQueries();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-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(t.memoryFactor,e,i,s,t.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(t.jobId,t.desc),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._lyr3DMain.on_job_failed(t.jobId,t.desc);const s=i.data.byteLength,r=this._lyr3DMain._malloc(s);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,s).set(i.data),this._lyr3DMain.on_job_completed(t.jobId,i.jobDescJson,r,s),this._lyr3DMain._free(r)}this._decrementJobCount(e,t)}_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,r,a,n){const l=this._getRequestPromises(e.urls,i,t,s);return Promise.all(l).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return o(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&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;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{l.jobDescJson=r.jobDescJson,r.originalInputs?l.inputs=r.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const i of e)l.inputs.push(i);return this._workerHandle.invoke(l,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),o(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const i=await this._getInitialPromise(e,n,d,s,l,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,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),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{const s=i.numGaussians??0;this._lyr3DMain?.on_renderable_created(!0,e.layerId,e.handle,i.memUsageBytes,s),this._decrementRenderableCount(t)}).catch(i=>{o(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain?.on_renderable_created(!1,e.layerId,e.handle,0,0),this._decrementRenderableCount(t)}))}_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)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_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:p};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:p,check:s};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:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=c(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=u.values[u[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),t.vcsWkid&&this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d)}h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:p})}_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}),this._markAllLayerViewsUpdating()}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_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([h({constructOnly:!0})],W.prototype,"view",void 0),e([h({readOnly:!0})],W.prototype,"isTerrainReady",null),W=e([_("esri.layers.Lyr3DWasmPerSceneView")],W);const V=W;export{V as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import i from"../request.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{createAbortError as a,isAborted as n,isAbortError as o}from"../core/promiseUtils.js";import{watch as l}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as c}from"../geometry/support/spatialReferenceUtils.js";import u from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as m,elevQueriesFull as g,elevQueriesGenericFail as w,invalidLayerView as p}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as b}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as f}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as M}from"../views/3d/layers/support/makeScheduleFunction.js";const L=3857,k=32662,R=4326,S=5773,C=115700;let W=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([l(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),l(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=d({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(a())}),this._elevationQueries.clear(),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:m})}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=this._isUpdating(t);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){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||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=v().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"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const d="global"===this.view.viewingMode?5:3;if(5===d)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=L,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(this.view.renderSpatialReference?.wkid===k)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=f(this.view.heightModelInfo);if(e)this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=e;else{const e=this.view.heightModelInfo?.heightModel,i=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=i?S:C}}return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new b(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()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0)}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0)})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===L?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===g)return Promise.reject("max mesh elevation query limit exceeded");if(d===w)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{n(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(a()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(){if(this._lyr3DMain){if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;this._lyr3DMain.set_camera_elevation(e)}this._checkForAbortedElevationQueries();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-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(t.memoryFactor,e,i,s,t.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(t.jobId,t.desc),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._lyr3DMain.on_job_failed(t.jobId,t.desc);const s=i.data.byteLength,r=this._lyr3DMain._malloc(s);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,s).set(i.data),this._lyr3DMain.on_job_completed(t.jobId,i.jobDescJson,r,s),this._lyr3DMain._free(r)}this._decrementJobCount(e,t)}_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.set("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,r,a,n){const l=this._getRequestPromises(e.urls,i,t,s);return Promise.all(l).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return o(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&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;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{l.jobDescJson=r.jobDescJson,r.originalInputs?l.inputs=r.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const i of e)l.inputs.push(i);return this._workerHandle.invoke(l,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),o(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const i=await this._getInitialPromise(e,n,d,s,l,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,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),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{const s=i.numGaussians??0;this._lyr3DMain?.on_renderable_created(!0,e.layerId,e.handle,i.memUsageBytes,s),this._decrementRenderableCount(t)}).catch(i=>{o(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain?.on_renderable_created(!1,e.layerId,e.handle,0,0),this._decrementRenderableCount(t)}))}_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)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_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:p};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:p,check:s};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:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=c(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=u.values[u[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),t.vcsWkid&&this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d)}h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:p})}_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}),this._markAllLayerViewsUpdating()}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_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([h({constructOnly:!0})],W.prototype,"view",void 0),e([h({readOnly:!0})],W.prototype,"isTerrainReady",null),W=e([_("esri.layers.Lyr3DWasmPerSceneView")],W);const V=W;export{V as default};
|
|
@@ -2,9 +2,8 @@ import type PopupTemplate from "../../PopupTemplate.js";
|
|
|
2
2
|
import type AggregateField from "./AggregateField.js";
|
|
3
3
|
import type FieldConfiguration from "./FieldConfiguration.js";
|
|
4
4
|
import type LabelClass from "./LabelClass.js";
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type { MultiOriginJSONSupportMixin } from "../../core/MultiOriginJSONSupport.js";
|
|
5
|
+
import type { Clonable } from "../../core/Clonable.js";
|
|
6
|
+
import type { JSONSupportMixin } from "../../core/JSONSupport.js";
|
|
8
7
|
import type { RendererUnion } from "../../renderers/types.js";
|
|
9
8
|
import type { LabelClassProperties } from "./LabelClass.js";
|
|
10
9
|
import type { PopupTemplateProperties } from "../../PopupTemplate.js";
|
|
@@ -668,4 +667,4 @@ export default class FeatureReductionBinning extends FeatureReductionBinningSupe
|
|
|
668
667
|
*/
|
|
669
668
|
getFieldConfiguration(fieldName: string): FieldConfiguration | null | undefined;
|
|
670
669
|
}
|
|
671
|
-
declare const FeatureReductionBinningSuperclass: typeof
|
|
670
|
+
declare const FeatureReductionBinningSuperclass: typeof Clonable & typeof JSONSupportMixin
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{Clonable as o}from"../../core/Clonable.js";import{JSONSupportMixin as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{toPt as t}from"../../core/screenUtils.js";import{property as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureNumber as p}from"../../core/accessorSupport/ensureType.js";import{createDefaultRenderer as a}from"./featureLayerUtils.js";import{labelingInfoProperty as d,labelsVisibleProperty as l,layerProperty as u,maxScaleProperty as f,popupEnabledProperty as c,popupTemplateProperty as m,fieldConfigurationsProperty as g,fieldsProperty as y,fieldsIndexProperty as h,rendererProperty as v}from"./featureReductionProperties.js";import{read as b}from"../../renderers/support/jsonUtils.js";import{enumeration as j}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as C}from"../../core/accessorSupport/decorators/reader.js";let x=class extends(r(o)){constructor(e){super(e),this.type="binning",this.binType="geohash",this.fixedBinLevel=null,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.size=t("12px"),this.fields=[],this.renderer=null}readRenderer(e,o,r){const i=o.drawingInfo?.renderer;return i?b(i,o,r)??void 0:a(o,r)}clone(){const e=super.clone();return this._isOverridden("fieldConfigurations")&&(e.fieldConfigurations=i(this.fieldConfigurations)),e}getField(e){return this.fieldsIndex.get(e)}getFieldAlias(e){const o=this.getField(e);if(o)return this.getFieldConfiguration(o.name)?.alias||o.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(o=>o.name.toLowerCase()===e)}};e([s({type:["binning"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],x.prototype,"type",void 0),e([j({geohash:"geohash",square:"square"}),s({type:["geohash","square"],json:{write:{ignoreOrigin:!0}}})],x.prototype,"binType",void 0),e([s({type:Number,json:{write:{ignoreOrigin:!0}}})],x.prototype,"fixedBinLevel",void 0),e([s(d())],x.prototype,"labelingInfo",void 0),e([s(l())],x.prototype,"labelsVisible",void 0),e([s(u())],x.prototype,"layer",void 0),e([s(f())],x.prototype,"maxScale",void 0),e([s(c())],x.prototype,"popupEnabled",void 0),e([s(m())],x.prototype,"popupTemplate",void 0),e([s({cast:e=>"auto"===e?e:p(t(e))})],x.prototype,"size",void 0),e([s(g())],x.prototype,"fieldConfigurations",void 0),e([s(y())],x.prototype,"fields",void 0),e([s(h())],x.prototype,"fieldsIndex",void 0),e([s(v())],x.prototype,"renderer",void 0),e([C("renderer",["drawingInfo.renderer"])],x.prototype,"readRenderer",null),x=e([n("esri.layers.support.FeatureReductionBinning")],x);export{x as default};
|
|
@@ -7,9 +7,8 @@ import type PictureMarkerSymbol from "../../symbols/PictureMarkerSymbol.js";
|
|
|
7
7
|
import type SimpleMarkerSymbol from "../../symbols/SimpleMarkerSymbol.js";
|
|
8
8
|
import type TextSymbol from "../../symbols/TextSymbol.js";
|
|
9
9
|
import type WebStyleSymbol from "../../symbols/WebStyleSymbol.js";
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type { MultiOriginJSONSupportMixin } from "../../core/MultiOriginJSONSupport.js";
|
|
10
|
+
import type { Clonable } from "../../core/Clonable.js";
|
|
11
|
+
import type { JSONSupportMixin } from "../../core/JSONSupport.js";
|
|
13
12
|
import type { RendererUnion } from "../../renderers/types.js";
|
|
14
13
|
import type { PopupTemplateProperties } from "../../PopupTemplate.js";
|
|
15
14
|
import type { HeatmapRendererProperties } from "../../renderers/HeatmapRenderer.js";
|
|
@@ -1238,4 +1237,4 @@ export default class FeatureReductionCluster extends FeatureReductionClusterSupe
|
|
|
1238
1237
|
*/
|
|
1239
1238
|
getFieldConfiguration(fieldName: string): FieldConfiguration | null | undefined;
|
|
1240
1239
|
}
|
|
1241
|
-
declare const FeatureReductionClusterSuperclass: typeof
|
|
1240
|
+
declare const FeatureReductionClusterSuperclass: typeof Clonable & typeof JSONSupportMixin
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{Clonable as r}from"../../core/Clonable.js";import{JSONSupportMixin as t}from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{toPt as i}from"../../core/screenUtils.js";import{property as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureNumber as l}from"../../core/accessorSupport/ensureType.js";import p from"./AggregateField.js";import{createDefaultRenderer as u}from"./featureLayerUtils.js";import{maxScaleProperty as a,popupEnabledProperty as d,popupTemplateProperty as c,rendererProperty as f,labelingInfoProperty as m,labelsVisibleProperty as g,layerProperty as y,fieldConfigurationsProperty as h,fieldsProperty as b,fieldsIndexProperty as S}from"./featureReductionProperties.js";import j from"../../renderers/SimpleRenderer.js";import{read as w}from"../../renderers/support/jsonUtils.js";import{symbolTypesCluster as v}from"../../symbols/support/typeUtils.js";import{reader as x}from"../../core/accessorSupport/decorators/reader.js";import{writer as I}from"../../core/accessorSupport/decorators/writer.js";function C(e){return"simple"===e.type&&!e.visualVariables?.length}let z=class extends(t(r)){constructor(e){super(e),this.type="cluster",this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}get clusterRadius(){return this._get("clusterRadius")??i("80px")}set clusterRadius(e){this._set("clusterRadius",e)}get clusterMinSize(){return this._get("clusterMinSize")??i("12px")}set clusterMinSize(e){this._set("clusterMinSize",e)}get clusterMaxSize(){return this._get("clusterMaxSize")??i("50px")}set clusterMaxSize(e){this._set("clusterMaxSize",e)}readRenderer(e,r,t){const o=r.drawingInfo?.renderer;return o?.authoringInfo?.isAutoGenerated?null:o?C(o)?null:w(o,r,t)??void 0:u(r,t)}readSymbol(e,r,t){const o=r.drawingInfo?.renderer;if(o?.authoringInfo?.isAutoGenerated)return null;if(o&&C(o)){const e=w(o,r,t);return e?.symbol}return null}writeSymbol(e,r,t,o){const i=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||i){const t=new j({symbol:e});r.drawingInfo={renderer:t.write({},o)}}}readFields(e,r,t){return e.filter(e=>!e.isAutoGenerated).map(e=>p.fromJSON(e))}clone(){const e=super.clone();return this._isOverridden("fieldConfigurations")&&(e.fieldConfigurations=o(this.fieldConfigurations)),e}getField(e){return this.fieldsIndex.get(e)}getFieldAlias(e){const r=this.getField(e);if(r)return this.getFieldConfiguration(r.name)?.alias||r.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(r=>r.name.toLowerCase()===e)}};e([s({type:["cluster"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],z.prototype,"type",void 0),e([s({cast:e=>"auto"===e?e:l(i(e)),json:{write:{ignoreOrigin:!0}}})],z.prototype,"clusterRadius",null),e([s({type:Number,cast:i,json:{write:{ignoreOrigin:!0}}})],z.prototype,"clusterMinSize",null),e([s({type:Number,cast:i,json:{write:{ignoreOrigin:!0}}})],z.prototype,"clusterMaxSize",null),e([s(a())],z.prototype,"maxScale",void 0),e([s(d())],z.prototype,"popupEnabled",void 0),e([s(c())],z.prototype,"popupTemplate",void 0),e([s(f())],z.prototype,"renderer",void 0),e([x("renderer",["drawingInfo.renderer"])],z.prototype,"readRenderer",null),e([s({types:v,json:{write:{ignoreOrigin:!0}}})],z.prototype,"symbol",void 0),e([x("symbol",["drawingInfo.renderer"])],z.prototype,"readSymbol",null),e([I("symbol")],z.prototype,"writeSymbol",null),e([s(m())],z.prototype,"labelingInfo",void 0),e([s(g())],z.prototype,"labelsVisible",void 0),e([s(y())],z.prototype,"layer",void 0),e([s(h())],z.prototype,"fieldConfigurations",void 0),e([s(b())],z.prototype,"fields",void 0),e([x("fields")],z.prototype,"readFields",null),e([s(S())],z.prototype,"fieldsIndex",void 0),z=e([n("esri.layers.support.FeatureReductionCluster")],z);export{z as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import{setDeepValue as i}from"../../core/object.js";import t from"./AggregateField.js";import n from"./AggregateFieldsIndex.js";import{labelsVisible as o,popupEnabled as s}from"./commonProperties.js";import
|
|
2
|
+
import e from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import{setDeepValue as i}from"../../core/object.js";import t from"./AggregateField.js";import n from"./AggregateFieldsIndex.js";import{labelsVisible as o,popupEnabled as s}from"./commonProperties.js";import l from"./FieldConfiguration.js";import{fieldConfigurationsFromPopupTemplate as f,popupTemplateWithFieldConfigurations as u}from"./fieldConfigUtils.js";import a from"./LabelClass.js";import{supportsFieldConfiguration as g}from"./layerUtils.js";import{rendererTypes as p}from"../../renderers/support/typeUtils.js";function m(){return{type:[l],clonable:!1,json:{name:"fieldConfigurations",write:{overridePolicy(e){return{enabled:g(this.layer),ignoreOrigin:!0}}}},set:function(e){if(this._override("fieldConfigurations",e),!this.layer?.loaded)return;const r=u(this,e);r&&this._set("popupTemplate",r)},get:function(){return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):this.layer?.loaded?f(this)||null:void 0}}}function d(){return{type:[t],value:[],json:{write:{ignoreOrigin:!0,writer(e,r,t){const n=e.filter(e=>"avg_angle"!==e.statisticType).map(e=>e.toJSON());i(t,n,r)}}},set:function(e){_(this._get("fields"),null),_(e,this.layer),this._set("fields",e)}}}function c(){return{readOnly:!0,get:function(){return new n(this.fields)}}}function j(){return{type:[a],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo",ignoreOrigin:!0}}}}function y(){return v(r(o))}function h(){return{clonable:!1,set:function(e){_(this.fields,e),this._set("layer",e)}}}function w(){return{type:Number,json:{default:0,name:"visibilityInfo.maxScale",write:{ignoreOrigin:!0}}}}function O(){return v(r(s))}function b(){return{type:e,json:{name:"popupInfo",write:{ignoreOrigin:!0,writer(e,r,i,t){e&&(r[i]=e.toJSON({...t,writeFieldFormat:g(this.layer)}))}}}}}function I(){return{types:p,json:{write:{target:"drawingInfo.renderer",ignoreOrigin:!0}}}}function _(e,r){e?.forEach(e=>{e.layer=r})}function v(e){let r=e.json;r||(r=e.json={});let i=r.write;return null!=i&&"object"==typeof i||(i=r.write={}),i.ignoreOrigin=!0,e}export{m as fieldConfigurationsProperty,c as fieldsIndexProperty,d as fieldsProperty,j as labelingInfoProperty,y as labelsVisibleProperty,h as layerProperty,w as maxScaleProperty,O as popupEnabledProperty,b as popupTemplateProperty,I as rendererProperty};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.27",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@amcharts/amcharts5": "~5.15.5",
|
|
22
|
-
"@arcgis/toolkit": "^5.0.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.25",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.0.2",
|
|
25
25
|
"@vaadin/grid": "~25.0.3",
|
|
26
|
-
"@zip.js/zip.js": "~2.8.
|
|
26
|
+
"@zip.js/zip.js": "~2.8.21",
|
|
27
27
|
"luxon": "~3.7.2",
|
|
28
28
|
"marked": "~17.0.3",
|
|
29
29
|
"tslib": "^2.8.1"
|
|
@@ -89,7 +89,9 @@ export interface FlowRendererProperties extends VisualVariablesMixinProperties,
|
|
|
89
89
|
* first band. If the data represents u (zonal) and v (meridional) speed components, values are automatically converted
|
|
90
90
|
* to `Magnitude` and `Direction`.
|
|
91
91
|
*
|
|
92
|
-
*
|
|
92
|
+
* > [!WARNING]
|
|
93
|
+
* > The RotationVariable is not supported on the FlowRenderer since the direction of the flow is already encoded in the underlying data.
|
|
94
|
+
*
|
|
93
95
|
* @example
|
|
94
96
|
* const renderer = new FlowRenderer({
|
|
95
97
|
* visualVariables: [{
|
|
@@ -319,7 +321,9 @@ export default class FlowRenderer extends FlowRendererSuperclass {
|
|
|
319
321
|
* first band. If the data represents u (zonal) and v (meridional) speed components, values are automatically converted
|
|
320
322
|
* to `Magnitude` and `Direction`.
|
|
321
323
|
*
|
|
322
|
-
*
|
|
324
|
+
* > [!WARNING]
|
|
325
|
+
* > The RotationVariable is not supported on the FlowRenderer since the direction of the flow is already encoded in the underlying data.
|
|
326
|
+
*
|
|
323
327
|
* @example
|
|
324
328
|
* const renderer = new FlowRenderer({
|
|
325
329
|
* visualVariables: [{
|
|
@@ -34,6 +34,8 @@ export default abstract class ActionBase extends ActionBaseSuperclass {
|
|
|
34
34
|
* use in styling custom actions. To use one of these provided icon fonts, you must
|
|
35
35
|
* prefix the class name with `esri-`. For example, the default `zoom-to` action in
|
|
36
36
|
* [Popup](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/) uses the font `esri-icon-zoom-in-magnifying-glass`.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated since version 5.1. Use the `icon` property to set a Calcite icon instead.
|
|
37
39
|
*/
|
|
38
40
|
accessor className: string | null | undefined;
|
|
39
41
|
/**
|
|
@@ -52,9 +54,9 @@ export default abstract class ActionBase extends ActionBaseSuperclass {
|
|
|
52
54
|
* // Create an action button to delete features
|
|
53
55
|
* // using the 'trash' Calcite Icon.
|
|
54
56
|
* const deleteAction = new ActionButton({
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
57
|
+
* id: "delete-feature",
|
|
58
|
+
* title: "Delete Feature",
|
|
59
|
+
* icon: "trash"
|
|
58
60
|
* });
|
|
59
61
|
*/
|
|
60
62
|
accessor icon: Icon["icon"] | null | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{deprecatedProperty as o}from"../../core/deprecate.js";import{IdentifiableMixin as s}from"../../core/Identifiable.js";import i from"../../core/Logger.js";import{property as r,subclass as c}from"../../core/accessorSupport/decorators.js";let p=class extends(s(e)){constructor(t){super(t),this.active=!1,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}get className(){return o(i.getLogger(this),"className",{replacement:"icon",version:"5.1",warnOnce:!0}),this._get("className")??null}set className(t){o(i.getLogger(this),"className",{replacement:"icon",version:"5.1",warnOnce:!0}),this._set("className",t)}};t([r()],p.prototype,"active",void 0),t([r()],p.prototype,"className",null),t([r()],p.prototype,"disabled",void 0),t([r()],p.prototype,"icon",void 0),t([r()],p.prototype,"id",void 0),t([r()],p.prototype,"indicator",void 0),t([r()],p.prototype,"title",void 0),t([r()],p.prototype,"type",void 0),t([r()],p.prototype,"visible",void 0),p=t([c("esri.support.actions.ActionBase")],p);const a=p;export{a as default};
|