@arcgis/core 5.1.0-next.116 → 5.1.0-next.118
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/Graphic.d.ts +2 -1
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -9
- package/analysis/ShadowCastAnalysis.d.ts +6 -5
- package/arcgisGlobal.d.ts +2 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{641b8622fbb93c84671d.js → 06ab868cced9c607840c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f231548c8ac7ecb59927.js → 0fbf9bf52ecb4cd8293b.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb16976b4eb7f1300f4a.js → 107550695896806c2306.js} +1 -1
- package/assets/esri/core/workers/chunks/{701125f6cdd91ff3655f.js → 1252da05832e576d4def.js} +2 -2
- package/assets/esri/core/workers/chunks/1a527c0740d9f4fa0791.js +1 -0
- package/assets/esri/core/workers/chunks/{a814069325125466506b.js → 1a95370ddc22729ab3c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c88fd4f69cb2b53b48ec.js → 1b0765403b06294b3e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{18c4207b1cb0777560ba.js → 1dd1af5978e40295fb62.js} +1 -1
- package/assets/esri/core/workers/chunks/{425c04b26a6ec6d04b08.js → 201007cf1a91e2b126fc.js} +1 -1
- package/assets/esri/core/workers/chunks/20e2d11f6de438ee883e.js +1 -0
- package/assets/esri/core/workers/chunks/{db012650fb34c10cecd0.js → 24acf3dd541347c2b297.js} +1 -1
- package/assets/esri/core/workers/chunks/{94a5a834e32fc6cc6ed4.js → 2e11b4e9d66474a60064.js} +1 -1
- package/assets/esri/core/workers/chunks/{fbcf09526dc1bbe94b91.js → 2e8db0f05df2e38a14e1.js} +2 -2
- package/assets/esri/core/workers/chunks/{8e7ce4835b3106349684.js → 2ee9514396d22638870c.js} +1 -1
- package/assets/esri/core/workers/chunks/{62b5972d0ef9bf173308.js → 2f2cb40378399d7f5575.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a11ff75009fef45b8c1.js → 325bfac7cfa28a6d568f.js} +1 -1
- package/assets/esri/core/workers/chunks/{102ff3710db4ba5f083d.js → 3bf6d55511cd7722eb93.js} +1 -1
- package/assets/esri/core/workers/chunks/40df6ffeb61fea80aae3.js +1 -0
- package/assets/esri/core/workers/chunks/{7df05c3c82cd27b77300.js → 423a9882abd4a6dadf86.js} +1 -1
- package/assets/esri/core/workers/chunks/{a01f0ffbe555f690bdca.js → 466c250537415f12eb59.js} +1 -1
- package/assets/esri/core/workers/chunks/{05c47ca3a266a271974b.js → 46ca0d8573450095fcca.js} +1 -1
- package/assets/esri/core/workers/chunks/46d3ddf62fa7a76dd57d.js +1 -0
- package/assets/esri/core/workers/chunks/{51816d79c6be15e4bfcf.js → 46fbd519cc1a37923bfc.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0c242c4f5412e4cce73.js → 47d49777a3b3cd8e18bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{22d4521637806a8b828f.js → 4bfffdfbe6d467f143a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{7c2d7df4ef4d775cd648.js → 4d09ef7c57ab7f9782fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{dce37324a2382d2eef0d.js → 552945a73a95cd2a9f54.js} +1 -1
- package/assets/esri/core/workers/chunks/5784ddd18395f4d76016.js +640 -0
- package/assets/esri/core/workers/chunks/{0a530fbbb4486c670ea2.js → 5c7aff9604b4576a0e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0954e82f739d25001bcb.js → 603177137eb680afe371.js} +1 -1
- package/assets/esri/core/workers/chunks/62206d5d497b95fc4caf.js +1 -0
- package/assets/esri/core/workers/chunks/{4cecc582513b8a83f194.js → 65621650a53f69f7b05a.js} +1 -1
- package/assets/esri/core/workers/chunks/{24b43fb12fc3009fdc30.js → 66eea3f203c3ce98ec67.js} +1 -1
- package/assets/esri/core/workers/chunks/{a70fa35b2d19460637e9.js → 70d8f5bdb452cee41536.js} +2 -2
- package/assets/esri/core/workers/chunks/{ea4057090cf15d602585.js → 74bdf678a4fb6befdac7.js} +1 -1
- package/assets/esri/core/workers/chunks/{92a7735973b2f82a66ce.js → 74fd31d5404a061bfaed.js} +1 -1
- package/assets/esri/core/workers/chunks/7623778e065bc78ccbba.js +1 -0
- package/assets/esri/core/workers/chunks/{f69c44479ee3fd8c831d.js → 7d220f574ebf2740c208.js} +1 -1
- package/assets/esri/core/workers/chunks/7e4571162b86dad86d23.js +2 -0
- package/assets/esri/core/workers/chunks/{e95ce76b5b816256a519.js → 7f54d3835c0ce573a942.js} +1 -1
- package/assets/esri/core/workers/chunks/804ab5f614efa12a131b.js +1 -0
- package/assets/esri/core/workers/chunks/823789261ca3338f0fa8.js +1 -0
- package/assets/esri/core/workers/chunks/{5cdf87e7a59ace38df87.js → 84b0b6e099d949e0fea5.js} +1 -1
- package/assets/esri/core/workers/chunks/{702a3ef9e1b3442cbee7.js → 8b8b63be961eb73250a0.js} +1 -1
- package/assets/esri/core/workers/chunks/8e1865392681d390ab2e.js +1 -0
- package/assets/esri/core/workers/chunks/93826180cfd66a6d2596.js +1 -0
- package/assets/esri/core/workers/chunks/{90b0fe5584fb6fc99766.js → 9d27cc631bab8aa7479e.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b10a962e4ff2f3da5bc.js → 9dd3ecee6c1c9c06edc4.js} +1 -1
- package/assets/esri/core/workers/chunks/9f23a61c60949459c14f.js +30 -0
- package/assets/esri/core/workers/chunks/a730235da6ba2b2d9f47.js +30 -0
- package/assets/esri/core/workers/chunks/{762e23466308f22d7076.js → aea384f4d88121da8f54.js} +1 -1
- package/assets/esri/core/workers/chunks/be0eab592db0e651b023.js +30 -0
- package/assets/esri/core/workers/chunks/be70809bc6c718ade7df.js +1 -0
- package/assets/esri/core/workers/chunks/bfc988edc63ca28e5397.js +2 -0
- package/assets/esri/core/workers/chunks/c44be4aaba829e6d149d.js +1 -0
- package/assets/esri/core/workers/chunks/{3e9709e61015993b1c7d.js → ce77a0e074c17dfd02bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{b44f1d08784f2e50c853.js → d3af51a6d9014ff46170.js} +1 -1
- package/assets/esri/core/workers/chunks/{9eab1e1535494ff2050d.js → d5e6ae5fd004bed33578.js} +43 -21
- package/assets/esri/core/workers/chunks/d6d87bfa9e6d233385a9.js +262 -0
- package/assets/esri/core/workers/chunks/{efae58f746b108163a50.js → e078ff1f79d82d27497e.js} +1 -1
- package/assets/esri/core/workers/chunks/e178cd0e9178d6716410.js +1 -0
- package/assets/esri/core/workers/chunks/{185c670eb99474906836.js → edb55329305becdb204f.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c6742728fa705d2e16e.js → f3f685c937e9d7f5d4db.js} +1 -1
- package/assets/esri/core/workers/chunks/f58ddf37dee066a5c0d8.js +1 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +27 -4
- package/assets/esri/themes/base/widgets/_Grid.scss +3 -3
- 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/GlobalIllumination.glsl.js +45 -23
- package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
- package/chunks/ShadowCastVisualize.glsl.js +20 -23
- package/config.js +1 -1
- package/editing/templates/{TemplateListing.d.ts → TemplateListItem.d.ts} +35 -6
- package/editing/templates/{TemplateListing.js → TemplateListItem.js} +1 -1
- package/interfaces.d.ts +7 -0
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +28 -2
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/mixins/TiledImagery.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/RasterFactory.js +1 -1
- package/layers/support/RasterJobHandler.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/SymbolLayerDrawing.d.ts +10 -0
- package/layers/support/rasterJobHelper.js +2 -0
- package/layers/types.d.ts +2 -3
- package/package.json +2 -2
- package/rest/support/AttributeBinsQuery.d.ts +5 -5
- package/rest/support/OutDistance.d.ts +50 -0
- package/rest/support/OutDistance.js +1 -1
- package/rest/support/Query.d.ts +46 -5
- package/rest/support/TopFeaturesQuery.d.ts +5 -5
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +1 -18
- package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
- package/views/layers/ImageryLayerView.d.ts +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
- package/widgets/BatchAttributeForm.d.ts +26 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/074f5e6aaeafca13bf72.js +0 -1
- package/assets/esri/core/workers/chunks/0e9804ece1fd2d59751b.js +0 -1
- package/assets/esri/core/workers/chunks/1da2c34743897d1b6a24.js +0 -1
- package/assets/esri/core/workers/chunks/32f128a1615d71bbe899.js +0 -2
- package/assets/esri/core/workers/chunks/40df608337d562553ce1.js +0 -2
- package/assets/esri/core/workers/chunks/41074d383af3662673ca.js +0 -1
- package/assets/esri/core/workers/chunks/4325fa92dafca465ae26.js +0 -1
- package/assets/esri/core/workers/chunks/4b01858e05a4b90331a4.js +0 -30
- package/assets/esri/core/workers/chunks/708bd77e6d723e3f0aa8.js +0 -1
- package/assets/esri/core/workers/chunks/75a7de23c05435ec7649.js +0 -1
- package/assets/esri/core/workers/chunks/860465c4f44c373d0a1c.js +0 -1
- package/assets/esri/core/workers/chunks/86229634bf008f53dad4.js +0 -30
- package/assets/esri/core/workers/chunks/87a40e7f79f97ca637a9.js +0 -1
- package/assets/esri/core/workers/chunks/8a68884d40f6f6de1d12.js +0 -1
- package/assets/esri/core/workers/chunks/927c8ca7fd385b28a1b7.js +0 -640
- package/assets/esri/core/workers/chunks/978b7d10054e17161145.js +0 -1
- package/assets/esri/core/workers/chunks/aa03f770178693167aa0.js +0 -1
- package/assets/esri/core/workers/chunks/b78fb24b47d9f31f18c6.js +0 -1
- package/assets/esri/core/workers/chunks/c4872cf3b71d00f450e1.js +0 -1
- package/assets/esri/core/workers/chunks/e2ba57f7119b7182ba02.js +0 -279
- package/assets/esri/core/workers/chunks/ea2bf7c543cc536400b7.js +0 -30
- /package/assets/esri/core/workers/chunks/{701125f6cdd91ff3655f.js.LICENSE.txt → 1252da05832e576d4def.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fbcf09526dc1bbe94b91.js.LICENSE.txt → 2e8db0f05df2e38a14e1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{40df608337d562553ce1.js.LICENSE.txt → 70d8f5bdb452cee41536.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{32f128a1615d71bbe899.js.LICENSE.txt → 7e4571162b86dad86d23.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{a70fa35b2d19460637e9.js.LICENSE.txt → bfc988edc63ca28e5397.js.LICENSE.txt} +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
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{ReadDepthLastFrame as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{Gamma as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{addMainLightDirection as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceRayMarching as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{CameraSpace as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as n,If as
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{Gamma as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{addMainLightDirection as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceRayMarching as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{CameraSpace as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as n,If as c}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ColorAttachment1 as d}from"../views/webgl/enums.js";import{NoParameters as u}from"../views/webgl/NoParameters.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";const f=.01,g=.008,x=.002,v=.5,M=.02,y=.1,b=.008,w=.012,W=.008,D=40,S=.095,R=.008,F=60,j=2,B=.0039,C=.25,I=.15,z=25,P=.15,G=.5,T=1,E=1,$=16;class L extends u{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.rayMarchMinReach=P,this.rayMarchMaxReach=G,this.rayMarchWorldReach=z,this.rayMarchMinReachEmissionWeight=T,this.rayMarchMaxReachEmissionWeight=E,this.rayMarchMaxSteps=$,this.colorBleedWeight=I}}function O(u){const I=new p,z=I.fragment;return I.include(e),I.include(i),r(z),z.include(a),z.include(t),I.include(o,u),z.uniforms.add(new h("normalMap",e=>e.normalTexture),new h("depthMap",e=>e.depthTexture),new h("lastFrameColorTexture",(e,a)=>a.reprojection.lastFrameColor?.getTexture()),new h("lastFrameDepthTexture",(e,a)=>a.reprojection.lastFrameDepth?.attachment),new m("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new m("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(d)),new s("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new s("view",e=>e.camera.viewMatrix),new l("accumulatedFrames",e=>e.accumulatedFrames),new l("temporalSampleFrame",e=>e.temporalSampleFrame),new l("scaleGlobalIllumination",e=>e.scaleGlobalIllumination)),z.uniforms.add(new l("rayMarchMinReach",e=>e.rayMarchMinReach),new l("rayMarchMaxReach",e=>e.rayMarchMaxReach),new l("rayMarchWorldReach",e=>e.rayMarchWorldReach),new l("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new l("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new l("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new l("colorBleedWeight",e=>e.colorBleedWeight)),u.hasEmission&&z.uniforms.add(new h("lastFrameEmissionTexture",(e,a)=>a.reprojection.lastFrameEmission?.attachment)),z.code.add(n`
|
|
3
3
|
float computeIdleColorBlendWeight(float accumulatedFrames) {
|
|
4
4
|
float idleColorBlendProgress = clamp(
|
|
5
|
-
accumulatedFrames / ${n.float(
|
|
5
|
+
accumulatedFrames / ${n.float(D)},
|
|
6
6
|
0.0,
|
|
7
7
|
1.0
|
|
8
8
|
);
|
|
9
9
|
return mix(
|
|
10
|
+
${n.float(w)},
|
|
10
11
|
${n.float(W)},
|
|
11
|
-
${n.float(S)},
|
|
12
12
|
idleColorBlendProgress
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
float computeIdleOcclusionBlendWeight(float accumulatedFrames) {
|
|
17
17
|
float idleOcclusionBlendProgress = clamp(
|
|
18
|
-
accumulatedFrames / ${n.float(
|
|
18
|
+
accumulatedFrames / ${n.float(F)},
|
|
19
19
|
0.0,
|
|
20
20
|
1.0
|
|
21
21
|
);
|
|
22
22
|
return mix(
|
|
23
|
-
${n.float(
|
|
24
|
-
${n.float(
|
|
25
|
-
pow(idleOcclusionBlendProgress, ${n.float(
|
|
23
|
+
${n.float(S)},
|
|
24
|
+
${n.float(R)},
|
|
25
|
+
pow(idleOcclusionBlendProgress, ${n.float(j)})
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -55,7 +55,29 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
55
55
|
|
|
56
56
|
return mat3(tangent, bitangent, n);
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
|
|
59
|
+
float blueNoiseDitherValue(vec2 pixel, float frame, vec2 axis, float phase) {
|
|
60
|
+
float scroll = 5.588238 * mod(frame, 512.0);
|
|
61
|
+
vec2 p = pixel + vec2(scroll);
|
|
62
|
+
vec2 rotated = vec2(
|
|
63
|
+
axis.x * p.x + axis.y * p.y,
|
|
64
|
+
-axis.y * p.x + axis.x * p.y
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
return fract(52.9829189 * fract(0.06711056 * rotated.x + 0.00583715 * rotated.y + phase));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
vec4 blueNoiseDither(vec2 pixel, float frame) {
|
|
71
|
+
vec4 value = vec4(
|
|
72
|
+
blueNoiseDitherValue(pixel, frame, vec2(0.9659258, 0.25881904), 0.0),
|
|
73
|
+
blueNoiseDitherValue(pixel, frame, vec2(0.70710677, 0.70710677), 0.17),
|
|
74
|
+
blueNoiseDitherValue(pixel, frame, vec2(0.25881904, 0.9659258), 0.37),
|
|
75
|
+
blueNoiseDitherValue(pixel, frame, vec2(1.0, 0.0), 0.61)
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
return value * 2.0 - 1.0;
|
|
79
|
+
}
|
|
80
|
+
`),I.outputs.add("fragGlobalIllumination","vec4",0),I.outputs.add("fragWeight","float",1),z.main.add(n`
|
|
59
81
|
float depth = depthFromTexture(depthMap, uv);
|
|
60
82
|
|
|
61
83
|
// Early out if depth is out of range, such as in the sky
|
|
@@ -104,7 +126,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
104
126
|
if (hasReprojectionMismatch) {
|
|
105
127
|
if (isLowQualityEdgePixel) {
|
|
106
128
|
steps = 1;
|
|
107
|
-
occlusionBlendWeight = ${n.float(
|
|
129
|
+
occlusionBlendWeight = ${n.float(g)};
|
|
108
130
|
resetColorHistory = true;
|
|
109
131
|
} else {
|
|
110
132
|
steps = 6;
|
|
@@ -113,15 +135,15 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
113
135
|
}
|
|
114
136
|
} else {
|
|
115
137
|
steps = 1;
|
|
116
|
-
if (historyOcclusionBlendWeight > ${n.float(
|
|
117
|
-
occlusionBlendWeight = ${n.float(
|
|
118
|
-
colorBlendWeight = ${n.float(
|
|
119
|
-
} else if (historyOcclusionBlendWeight > ${n.float(
|
|
138
|
+
if (historyOcclusionBlendWeight > ${n.float(v)}) {
|
|
139
|
+
occlusionBlendWeight = ${n.float(y)};
|
|
140
|
+
colorBlendWeight = ${n.float(b)};
|
|
141
|
+
} else if (historyOcclusionBlendWeight > ${n.float(M)}) {
|
|
120
142
|
occlusionBlendWeight = historyOcclusionBlendWeight - 0.05;
|
|
121
|
-
colorBlendWeight = ${n.float(
|
|
143
|
+
colorBlendWeight = ${n.float(b)};
|
|
122
144
|
} else {
|
|
123
|
-
occlusionBlendWeight = isScaledGlobalIllumination ? ${n.float(
|
|
124
|
-
colorBlendWeight = isScaledGlobalIllumination ? ${n.float(
|
|
145
|
+
occlusionBlendWeight = isScaledGlobalIllumination ? ${n.float(g)} : idleOcclusionBlendWeight;
|
|
146
|
+
colorBlendWeight = isScaledGlobalIllumination ? ${n.float(x)} : idleColorBlendWeight;
|
|
125
147
|
}
|
|
126
148
|
}
|
|
127
149
|
|
|
@@ -134,7 +156,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
134
156
|
float stepSize = 1.0 / float(steps);
|
|
135
157
|
for (int i = 0; i < steps; ++i) {
|
|
136
158
|
float sampleIndex = float(i * temporalSampleStride + int(temporalFrameOffset));
|
|
137
|
-
randomDirectionSample =
|
|
159
|
+
randomDirectionSample = blueNoiseDither(floor(gl_FragCoord.xy), sampleIndex);
|
|
138
160
|
vec2 hemisphereSample = randomDirectionSample.rg * 0.5 + 0.5;
|
|
139
161
|
float offsetSample = randomDirectionSample.a * 0.5 + 0.5;
|
|
140
162
|
vec3 rayDirection = normalBasis * sampleCosineHemisphere(hemisphereSample);
|
|
@@ -151,14 +173,14 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
151
173
|
);
|
|
152
174
|
|
|
153
175
|
if (hit.z > 0.0) {
|
|
154
|
-
${
|
|
176
|
+
${c(u.hasColor,n`
|
|
155
177
|
// Emission and color bleed - Reproject the current receiver and sampled hit to estimate bounced color
|
|
156
178
|
vec3 receiverColor = texture(lastFrameColorTexture, reprojectedCoordinate.xy).rgb;
|
|
157
179
|
|
|
158
180
|
vec2 hitReprojectedCoordinate = reprojectionCoordinate(hit);
|
|
159
181
|
vec3 sourceColor = texture(lastFrameColorTexture, hitReprojectedCoordinate).rgb;
|
|
160
182
|
vec3 sourceColorLinear = linearizeGamma(sourceColor);
|
|
161
|
-
vec3 sourceEmission = ${
|
|
183
|
+
vec3 sourceEmission = ${c(u.hasEmission,"texture(lastFrameEmissionTexture, hitReprojectedCoordinate).xyz","vec3(0.0)")};
|
|
162
184
|
|
|
163
185
|
float emissionWeight = mix(
|
|
164
186
|
rayMarchMinReachEmissionWeight,
|
|
@@ -179,13 +201,13 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
179
201
|
|
|
180
202
|
// Rendering trick add noise to reduce accumulation artifacts
|
|
181
203
|
float accumulationDither = occlusionBlendWeight < 1.0
|
|
182
|
-
? randomDirectionSample.b * ${n.float(
|
|
204
|
+
? randomDirectionSample.b * ${n.float(B)}
|
|
183
205
|
: 0.0;
|
|
184
206
|
|
|
185
|
-
${
|
|
207
|
+
${c(u.hasColor,n`
|
|
186
208
|
// Accumulate color
|
|
187
209
|
vec3 lastFrameColor = lastFrameGlobalIllumination.rgb;
|
|
188
|
-
float colorDitherScale = isScaledGlobalIllumination ? ${n.float(
|
|
210
|
+
float colorDitherScale = isScaledGlobalIllumination ? ${n.float(C)} : 1.0;
|
|
189
211
|
fragGlobalIllumination.rgb = resetColorHistory
|
|
190
212
|
? vec3(0.0)
|
|
191
213
|
: mix(lastFrameColor + accumulationDither * colorDitherScale, fragGlobalIllumination.rgb, colorBlendWeight);
|
|
@@ -197,4 +219,4 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
|
|
|
197
219
|
fragGlobalIllumination.a = mix(lastFrameGlobalIllumination.a + accumulationDither, fragGlobalIllumination.a, occlusionBlendWeight);
|
|
198
220
|
|
|
199
221
|
fragWeight = occlusionBlendWeight;
|
|
200
|
-
`),
|
|
222
|
+
`),I}const V=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:L,build:O,defaultColorBleedWeight:I,defaultRayMarchMaxReach:G,defaultRayMarchMaxReachEmissionWeight:E,defaultRayMarchMaxSteps:$,defaultRayMarchMinReach:P,defaultRayMarchMinReachEmissionWeight:T,defaultRayMarchWorldReach:z},Symbol.toStringTag,{value:"Module"}));export{V as G,L as a,O as b,G as c,I as d,E as e,$ as f,P as g,T as h,z as i};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{GlobalIlluminationWeights as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/GlobalIlluminationWeights.glsl.js";import{CameraSpace as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{BooleanBindUniform as a}from"../views/3d/webgl-engine/core/shaderModules/BooleanBindUniform.js";import{Float2DrawUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as r}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DDrawUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{
|
|
2
|
+
import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{GlobalIlluminationWeights as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/GlobalIlluminationWeights.glsl.js";import{CameraSpace as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{BooleanBindUniform as a}from"../views/3d/webgl-engine/core/shaderModules/BooleanBindUniform.js";import{Float2DrawUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as r}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DDrawUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ditherNoise as c}from"../views/3d/webgl-engine/shaders/ditherNoise.glsl.js";import{NoParameters as p}from"../views/webgl/NoParameters.js";import{ShaderBuilder as h}from"../views/webgl/ShaderBuilder.js";const d=4;class f extends p{constructor(){super(...arguments),this.blurSize=e()}}function g(){const e=new h,p=e.fragment;e.include(l),e.include(t),e.include(i);const f=(d+3)/2,g=1/(2*f*f);p.include(o),p.include(c,{useFloatBlend:!1});const b=5e4;p.uniforms.add(new a("hasEmission",e=>e.hasEmission),new u("depthMap",e=>e.depthTexture),new u("normalMap",e=>e.normalTexture),new m("globalIlluminationTexture",e=>e.texture),new m("globalIlluminationWeightTexture",e=>e.weightTexture),new s("blurSize",e=>e.blurSize),new n("scaleGlobalIllumination",e=>e.scaleGlobalIllumination),new n("projScale",(e,l)=>{const o=l.camera.distance;return o>b?Math.max(0,e.projScale-(o-b)):e.projScale}));const S=.1,v=400,w=.03,W=.08,I=1.5;return p.code.add(r`
|
|
3
3
|
void accumulateBlurSample(
|
|
4
4
|
vec2 sampleUv,
|
|
5
5
|
float sampleOffset,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{clone as o,fromValues as r,create as a}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{ScreenSpacePass as t}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{BlendColorsPremultiplied as s,premultiplyAlpha as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/BlendColorsPremultiplied.glsl.js";import{CameraSpace as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{Float2PassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{Float4sPassUniform as
|
|
2
|
+
import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{clone as o,fromValues as r,create as a}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{ScreenSpacePass as t}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{BlendColorsPremultiplied as s,premultiplyAlpha as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/BlendColorsPremultiplied.glsl.js";import{CameraSpace as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{Float2PassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{Float4sPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js";import{FloatPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{FloatsPassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js";import{glsl as u,If as c}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{maxColorRampSize as w}from"../views/3d/webgl-engine/shaders/colorRampParameters.js";import{a as C}from"./ShadowCastAccumulate.glsl.js";import{NoParameters as f}from"../views/webgl/NoParameters.js";import{ShaderBuilder as b}from"../views/webgl/ShaderBuilder.js";class S extends f{constructor(r){super(),this._data=r,this.sampleScale=e(),this.opacityFromElevation=1,this.gradientColorRamp=y,this.thresholdColor=o($),this.bandedGradientColorRamp=M,this.bandSize=.1,this.threshold=.5}get shadowCastMap(){return this._data.shadowCastTexture}}const R=.7,j=50/255,y=[[0,r(0,0,1,0)],[1,r(0,0,1,R)]],$=r(1,0,0,R),M=[[0,r(j,j,j,0)],[1,r(j,j,j,R)]];function z(e){const o=new b,r=o.fragment;o.include(n),o.include(t);const{rendersSunlight:a,visualization:f}=e;r.constants.add("inverseSampleValue","float",C),r.uniforms.add(new v("shadowCastMap",e=>e.shadowCastMap),new i("sampleScale",e=>e.sampleScale),new h("opacityFromElevation",e=>e.opacityFromElevation));const S=2===f,R=3===f,j=1===f;R&&r.include(s);const y=!S;switch(y&&r.code.add(u`vec4 evaluateColorRamp(float value) {
|
|
3
3
|
if (value <= vvColorValues[0]) {
|
|
4
4
|
return vvColorColors[0];
|
|
5
5
|
}
|
|
@@ -10,50 +10,47 @@ return mix(vvColorColors[i-1], vvColorColors[i], f);
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
return vvColorColors[colorRampSize - 1];
|
|
13
|
-
}`),
|
|
14
|
-
${
|
|
13
|
+
}`),f){case 0:r.uniforms.add(new m("vvColorColors",w,e=>e.gradientColorRamp.flatMap(([e,o])=>l(P,o))),new g("colorRampSize",e=>e.gradientColorRamp.length),new p("vvColorValues",w,e=>e.gradientColorRamp.map(([e,o])=>e)));break;case 1:r.uniforms.add(new m("vvColorColors",w,e=>e.bandedGradientColorRamp.flatMap(([e,o])=>l(P,o))),new g("colorRampSize",e=>e.bandedGradientColorRamp.length),new p("vvColorValues",w,e=>e.bandedGradientColorRamp.map(([e,o])=>e)),new h("bandSize",e=>e.bandSize));break;case 3:r.uniforms.add(new d("uColor",e=>l(P,e.thresholdColor)),new h("threshold",e=>e.threshold),new m("vvColorColors",w,e=>e.gradientColorRamp.flatMap(([e,o])=>l(P,o))),new g("colorRampSize",e=>e.gradientColorRamp.length),new p("vvColorValues",w,e=>e.gradientColorRamp.map(([e,o])=>e)));break;case 2:r.uniforms.add(new d("uColor",e=>l(P,e.thresholdColor)),new h("threshold",e=>e.threshold))}const{type:$,selector:M,thresholdStrengthSelector:z}=R?{type:"vec2",selector:"rg",thresholdStrengthSelector:"strength.x"}:{type:"float",selector:"r",thresholdStrengthSelector:"strength"},V=!a;return r.main.add(u`
|
|
14
|
+
${$} numSamples = texture(shadowCastMap, uv).${M} * inverseSampleValue;
|
|
15
15
|
|
|
16
16
|
fragColor = vec4(0.0);
|
|
17
17
|
|
|
18
18
|
// In shadow space, zero accumulated samples can be skipped when they would render fully transparent.
|
|
19
19
|
// In sunlight space, zero shadow samples may map to full-strength sunlight, so we keep them.
|
|
20
|
-
${
|
|
21
|
-
if (${
|
|
20
|
+
${c(V,u`
|
|
21
|
+
if (${c(y,u`vvColorColors[0].a == 0.0 && `,"")}dot(numSamples, ${$}(1)) < 1.0) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
`)}
|
|
25
25
|
|
|
26
26
|
// sampleScale is the number of total samples taken, so this brings strength to a 0-1 range.
|
|
27
27
|
// note that sampleScale is always a vec2 even if we have only the primary channel.
|
|
28
|
-
${
|
|
28
|
+
${$} strength = numSamples * sampleScale.${M};
|
|
29
29
|
|
|
30
|
-
${
|
|
30
|
+
${c(a,u`strength = 1.0 - strength;`)}
|
|
31
31
|
|
|
32
32
|
// in threshold mode, step the strength to 0 if we are at or below the threshold, 1 otherwise.
|
|
33
|
-
${
|
|
34
|
-
float thresholdStrength = ${
|
|
35
|
-
${
|
|
33
|
+
${c(S||R,u`
|
|
34
|
+
float thresholdStrength = ${z};
|
|
35
|
+
${z} = 1.0 - step(thresholdStrength, threshold);
|
|
36
36
|
`)}
|
|
37
37
|
|
|
38
38
|
// bail out if we are below the threshold
|
|
39
|
-
${
|
|
39
|
+
${c(S,u`if (${z} == 0.0) { return; }`)}
|
|
40
40
|
|
|
41
|
-
${
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`:g`if (strength != 1.0) {
|
|
45
|
-
strength = ceil(strength / bandSize) * bandSize;
|
|
46
|
-
}`)}
|
|
41
|
+
${c(j,u`
|
|
42
|
+
strength = ceil(strength / bandSize) * bandSize;
|
|
43
|
+
`)}
|
|
47
44
|
|
|
48
|
-
${
|
|
45
|
+
${$} attenuation = opacityFromElevation * strength;
|
|
49
46
|
|
|
50
|
-
${
|
|
47
|
+
${c(R,u`
|
|
51
48
|
vec4 thresholdColor = uColor * attenuation.r;
|
|
52
49
|
vec4 gradientColor = evaluateColorRamp(attenuation.g);
|
|
53
|
-
fragColor = blendColorsPremultiplied(${
|
|
54
|
-
`,
|
|
50
|
+
fragColor = blendColorsPremultiplied(${c(a,u`gradientColor, thresholdColor`,u`thresholdColor, gradientColor`)});
|
|
51
|
+
`,c(S,u`
|
|
55
52
|
fragColor = uColor * attenuation;
|
|
56
|
-
`,
|
|
53
|
+
`,u`
|
|
57
54
|
fragColor = evaluateColorRamp(attenuation);
|
|
58
55
|
`))}
|
|
59
|
-
`),o}const P=a(),V=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:S,build:
|
|
56
|
+
`),o}const P=a(),V=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:S,build:z},Symbol.toStringTag,{value:"Module"}));export{V as S,S as a,z as b};
|
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.118";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
|
@@ -3,30 +3,59 @@ import type SharedTemplateMetadata from "../sharedTemplates/SharedTemplateMetada
|
|
|
3
3
|
import type FeatureTemplate from "../../layers/support/FeatureTemplate.js";
|
|
4
4
|
import type { LayerWithFeatureTemplatesUnion } from "../../layers/types.js";
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface TemplateListItemProperties extends Partial<Pick<TemplateListItem, "layer" | "template" | "thumbnail">> {}
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The item displayed within the FeatureTemplates component.
|
|
10
10
|
*
|
|
11
11
|
* @since 5.1
|
|
12
12
|
*/
|
|
13
|
-
export default class
|
|
14
|
-
|
|
13
|
+
export default class TemplateListItem extends Accessor {
|
|
14
|
+
/** @since 5.1 */
|
|
15
|
+
constructor(properties?: TemplateListItemProperties);
|
|
15
16
|
/**
|
|
16
17
|
* The description that is displayed for the template item.
|
|
17
18
|
* This defaults to the [FeatureTemplate.description](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureTemplate/#description) property of the template.
|
|
19
|
+
*
|
|
20
|
+
* @since 5.1
|
|
18
21
|
*/
|
|
19
22
|
get description(): string;
|
|
20
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Unique identifier for the template item.
|
|
25
|
+
*
|
|
26
|
+
* @since 5.1
|
|
27
|
+
*/
|
|
28
|
+
get id(): string;
|
|
29
|
+
/**
|
|
30
|
+
* The label that is displayed for the template item.
|
|
31
|
+
*
|
|
32
|
+
* @since 5.1
|
|
33
|
+
*/
|
|
21
34
|
get label(): string;
|
|
22
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* The layer associated with the template item.
|
|
37
|
+
*
|
|
38
|
+
* @since 5.1
|
|
39
|
+
*/
|
|
23
40
|
accessor layer: LayerWithFeatureTemplatesUnion;
|
|
24
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Indicates whether the template item supports upload.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
* @since 5.1
|
|
46
|
+
*/
|
|
47
|
+
get supportsUpload(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The associated FeatureTemplate for the item.
|
|
50
|
+
*
|
|
51
|
+
* @since 5.1
|
|
52
|
+
*/
|
|
25
53
|
accessor template: FeatureTemplate | SharedTemplateMetadata;
|
|
26
54
|
/**
|
|
27
55
|
* An object used to create a thumbnail image that represents a feature type in the feature template.
|
|
28
56
|
*
|
|
29
57
|
* @see [FeatureTemplate.thumbnail](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureTemplate/#thumbnail)
|
|
58
|
+
* @since 5.1
|
|
30
59
|
*/
|
|
31
60
|
accessor thumbnail: HTMLElement | undefined;
|
|
32
61
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{property as r,subclass as o}from"../../core/accessorSupport/decorators.js";import{isSharedTemplateOrMetadata as p}from"../templateUtils.js";let l=class extends e{constructor(t){super(t),this.layer=null,this.template=null}get description(){return this.template?.description??""}get label(){return this.template?.name??""}get id(){return p(this.template)?`${this.template.templateId}–${this.layer?.id}`:`${this.label??""}–${this.layer?.id}`}get supportsUpload(){return"scene"===this.layer?.type}};t([r()],l.prototype,"description",null),t([r()],l.prototype,"label",null),t([r()],l.prototype,"layer",void 0),t([r()],l.prototype,"template",void 0),t([r()],l.prototype,"thumbnail",void 0),t([r()],l.prototype,"id",null),t([r()],l.prototype,"supportsUpload",null),l=t([o("esri.editing.templates.
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{property as r,subclass as o}from"../../core/accessorSupport/decorators.js";import{isSharedTemplateOrMetadata as p}from"../templateUtils.js";let l=class extends e{constructor(t){super(t),this.layer=null,this.template=null}get description(){return this.template?.description??""}get label(){return this.template?.name??""}get id(){return p(this.template)?`${this.template.templateId}–${this.layer?.id}`:`${this.label??""}–${this.layer?.id}`}get supportsUpload(){return"scene"===this.layer?.type}};t([r()],l.prototype,"description",null),t([r()],l.prototype,"label",null),t([r()],l.prototype,"layer",void 0),t([r()],l.prototype,"template",void 0),t([r()],l.prototype,"thumbnail",void 0),t([r()],l.prototype,"id",null),t([r()],l.prototype,"supportsUpload",null),l=t([o("esri.editing.templates.TemplateListItem")],l);const s=l;export{s as default};
|
package/interfaces.d.ts
CHANGED
|
@@ -8983,6 +8983,13 @@ declare namespace __esri {
|
|
|
8983
8983
|
export type OffsetParameters = import("./rest/support/OffsetParameters.js").default;
|
|
8984
8984
|
export const OffsetParameters: typeof import("./rest/support/OffsetParameters.js").default;
|
|
8985
8985
|
|
|
8986
|
+
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
8987
|
+
export type OutDistanceProperties = import("./rest/support/OutDistance.js").OutDistanceProperties;
|
|
8988
|
+
|
|
8989
|
+
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
8990
|
+
export type OutDistance = import("./rest/support/OutDistance.js").default;
|
|
8991
|
+
export const OutDistance: typeof import("./rest/support/OutDistance.js").default;
|
|
8992
|
+
|
|
8986
8993
|
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
8987
8994
|
export type ParameterValueProperties<T extends import("./rest/types.js").ParameterValue = import("./rest/types.js").ParameterValue> = import("./rest/support/ParameterValue.js").ParameterValueProperties<T>;
|
|
8988
8995
|
|
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.118",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/FeatureLayer.d.ts
CHANGED
|
@@ -437,7 +437,20 @@ export interface FeatureLayerProperties extends LayerProperties, APIKeyMixinProp
|
|
|
437
437
|
* layer.load().then(() => console.log(layer.isTable))
|
|
438
438
|
*/
|
|
439
439
|
source?: ReadonlyArrayOrCollection<Graphic>;
|
|
440
|
-
/**
|
|
440
|
+
/**
|
|
441
|
+
* Defines symbol layer drawing options. Use symbol layer drawing to override the default drawing order of [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/)s on maps.
|
|
442
|
+
* When symbols have more than one symbol layer (such as a cased road symbol), symbol layer drawing can also control how those individual symbol layers are ordered across symbol classes.
|
|
443
|
+
*
|
|
444
|
+
* Default draw order | Symbol layer drawing enabled
|
|
445
|
+
* -------------------|----------------------
|
|
446
|
+
*  | 
|
|
447
|
+
*
|
|
448
|
+
* > [!WARNING]
|
|
449
|
+
* > Symbol layer drawing is not supported in 3D scenes.
|
|
450
|
+
*
|
|
451
|
+
* @since 5.1
|
|
452
|
+
* @see [ArcGIS Pro - Symbol Layer Drawing](https://doc.esri.com/en/arcgis-pro/latest/help/mapping/layer-properties/symbol-layer-drawing.html)
|
|
453
|
+
*/
|
|
441
454
|
symbolLayerDrawing?: SymbolLayerDrawingProperties | null;
|
|
442
455
|
/**
|
|
443
456
|
* An array of feature templates defined in the feature layer.
|
|
@@ -1294,7 +1307,20 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
|
|
|
1294
1307
|
*/
|
|
1295
1308
|
get source(): Collection<Graphic>;
|
|
1296
1309
|
set source(value: ReadonlyArrayOrCollection<Graphic>);
|
|
1297
|
-
/**
|
|
1310
|
+
/**
|
|
1311
|
+
* Defines symbol layer drawing options. Use symbol layer drawing to override the default drawing order of [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/)s on maps.
|
|
1312
|
+
* When symbols have more than one symbol layer (such as a cased road symbol), symbol layer drawing can also control how those individual symbol layers are ordered across symbol classes.
|
|
1313
|
+
*
|
|
1314
|
+
* Default draw order | Symbol layer drawing enabled
|
|
1315
|
+
* -------------------|----------------------
|
|
1316
|
+
*  | 
|
|
1317
|
+
*
|
|
1318
|
+
* > [!WARNING]
|
|
1319
|
+
* > Symbol layer drawing is not supported in 3D scenes.
|
|
1320
|
+
*
|
|
1321
|
+
* @since 5.1
|
|
1322
|
+
* @see [ArcGIS Pro - Symbol Layer Drawing](https://doc.esri.com/en/arcgis-pro/latest/help/mapping/layer-properties/symbol-layer-drawing.html)
|
|
1323
|
+
*/
|
|
1298
1324
|
get symbolLayerDrawing(): SymbolLayerDrawing | null | undefined;
|
|
1299
1325
|
set symbolLayerDrawing(value: SymbolLayerDrawingProperties | null | undefined);
|
|
1300
1326
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as l,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as m}from"../core/accessorSupport/ensureType.js";import u from"../graphic/ImageryTileGraphicOrigin.js";import h from"./Layer.js";import{ArcGISService as d}from"./mixins/ArcGISService.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as w}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as R}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as S}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{TiledImagery as O}from"./mixins/TiledImagery.js";import{isFunctionRaster as F,getPrimaryRasters as _}from"./raster/datasets/datasetUtils.js";import b from"./raster/datasets/FunctionRaster.js";import T from"./raster/datasets/RasterFactory.js";import{getPrimaryRasterUrls as P,create as N}from"./raster/functions/rasterFunctionHelper.js";import{legendEnabled as x,screenSizePerspectiveEnabled as J}from"./support/commonProperties.js";import L from"./support/Field.js";import{getServicePixelValueField as C,getRawServicePixelValueField as E,getRasterAttributeTableFields as M,getMagnitudeField as U,getDirectionField as W,getMultidimensionalFields as z,commonRasterFieldNames as A,setDefaultRasterFieldFormats as B}from"./support/rasterFieldUtils.js";import D from"./support/RasterFunction.js";import k from"./support/TileInfo.js";import{logInvalidElevationInfoWarning as G,elevationModeUnsupportedMessage as V,featureExpressionUnsupportedMessage as H}from"../support/elevationInfoUtils.js";import{createPopupTemplate as $}from"../support/popupUtils.js";import Y from"../symbols/support/ElevationInfo.js";import{addLayerUnsupportedError as q}from"../webdoc/support/unsupportedErrors.js";let K=class extends(y(j(g(v(R(f(O(w(I(d(S(o(r(h)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new u(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=a(async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return s(this,t);case 1:return i(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(n).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[C("Pixel Value"),E("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,r=t?.attributeTable;if(r){const t=M(r);e.push(...t)}const s=t?.dataType,i=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const t=i.variables[0].unit?.trim(),r=U(t),s=W();e.push(r,s)}if(i){const t=z(i);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,r=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==A.rawServicePixelValue)),s=$({fields:t,title:this.title},{...e,visibleFieldNames:r}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&B(s.fieldInfos,i),s}async generateRasterInfo(e,t){const r=m(D,e);if(await this.load(),!r||"none"===r.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:e}=await this._openFunctionRaster(r,t);return e}catch(i){if(i instanceof s)throw i;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsExportMapTiles(){const e=this._primaryRasters[0]??this.raster,t="RasterTileServer"===e?.datasetFormat,r=!!this.sourceJSON?.exportTilesAllowed,s=this.sourceJSON?.datasetFormat?.toLowerCase(),i=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&"Raster"===e?.tileType&&("cache/jpegplus"===s||"cache/jpegpng"===s);return t&&r&&("Map"===e?.tileType||i)}supportsWrite(){const e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){return this.supportsWrite()?super.write(e,t):(q(t,this),null)}async hasDataChanged(){try{const e=this._primaryRasters[0]??this.raster,{dataChanged:t,updates:r}=await e.refresh();return t&&(this.serviceRasterInfo!==e.rasterInfo&&this._set("serviceRasterInfo",e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),r&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0})),t}catch{return!1}}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=F(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:r,source:i}=this;if(!t&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):r?await this._openFromUrlWithRasterFunction(t,r,e):await this._openFromUrl(t,e)}const r=this.raster.rasterInfo;if(!r)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=_(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,r){const i=[e];t&&P(t.toJSON(),i);const o=await Promise.all(i.map(e=>T.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=o.findIndex(e=>null==e);if(a>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const r=await T.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){const r="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",r);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await T.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==o)throw new s("imagery-tile-layer:open",r);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,t){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>r[e.url]=e);const s=N(e.functionDefinition?.toJSON()??e.toJSON(),r),i=new b({rasterFunction:s});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(r){r instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",r.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){G(i.getLogger(this),V("ImageryTile layers","relative-to-scene",e)),G(i.getLogger(this),H("ImageryTile layers",e))}};e([l({clonable:!1})],K.prototype,"_primaryRasters",void 0),e([l({json:{origins:{"web-scene":{write:!1}},write:!0}})],K.prototype,"charts",void 0),e([l({type:Y,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],K.prototype,"elevationInfo",null),e([l({type:k})],K.prototype,"tileInfo",void 0),e([l({readOnly:!0,clonable:!1})],K.prototype,"graphicOrigin",void 0),e([l(x)],K.prototype,"legendEnabled",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],K.prototype,"isReference",void 0),e([l({type:["show","hide"]})],K.prototype,"listMode",void 0),e([l({json:{read:!0,write:!0}})],K.prototype,"blendMode",void 0),e([l({type:D,json:{name:"renderingRule",write:!0}})],K.prototype,"rasterFunction",void 0),e([l()],K.prototype,"sourceJSON",void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],K.prototype,"version",void 0),e([l({readOnly:!0,json:{read:!1}})],K.prototype,"type",void 0),e([l({type:["ArcGISTiledImageServiceLayer"]})],K.prototype,"operationalLayerType",void 0),e([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],K.prototype,"popupEnabled",void 0),e([l({type:t,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],K.prototype,"popupTemplate",void 0),e([l({readOnly:!0})],K.prototype,"defaultPopupTemplate",null),e([l(J)],K.prototype,"screenSizePerspectiveEnabled",void 0),e([l({readOnly:!0,type:[L]})],K.prototype,"fields",void 0),e([l({readOnly:!0,type:[L]})],K.prototype,"rasterFields",null),e([l({constructOnly:!0})],K.prototype,"source",void 0),K=e([c("esri.layers.ImageryTileLayer")],K);const Q=K;export{Q as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{removeMaybe as o}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{debounce as n,throwIfAbortError as p}from"../core/promiseUtils.js";import{watch as l}from"../core/reactiveUtils.js";import{property as c,subclass as m}from"../core/accessorSupport/decorators.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import h from"../graphic/ImageryTileGraphicOrigin.js";import d from"./Layer.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as S}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as _}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{TiledImagery as O}from"./mixins/TiledImagery.js";import{isFunctionRaster as F,getPrimaryRasters as b}from"./raster/datasets/datasetUtils.js";import T from"./raster/datasets/FunctionRaster.js";import P from"./raster/datasets/RasterFactory.js";import{getPrimaryRasterUrls as J,create as N}from"./raster/functions/rasterFunctionHelper.js";import{legendEnabled as x,screenSizePerspectiveEnabled as L}from"./support/commonProperties.js";import C from"./support/Field.js";import{getServicePixelValueField as E,getRawServicePixelValueField as M,getRasterAttributeTableFields as W,getMagnitudeField as U,getDirectionField as H,getMultidimensionalFields as k,commonRasterFieldNames as z,setDefaultRasterFieldFormats as A}from"./support/rasterFieldUtils.js";import B from"./support/RasterFunction.js";import{getRasterJobHandler as D,releaseRasterJobHandler as G}from"./support/rasterJobHelper.js";import V from"./support/TileInfo.js";import{logInvalidElevationInfoWarning as $,elevationModeUnsupportedMessage as Y,featureExpressionUnsupportedMessage as q}from"../support/elevationInfoUtils.js";import{createPopupTemplate as K}from"../support/popupUtils.js";import Q from"../symbols/support/ElevationInfo.js";import{addLayerUnsupportedError as X}from"../webdoc/support/unsupportedErrors.js";let Z=class extends(f(_(v(w(S(g(O(R(I(y(j(a(t(d)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new h(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=n(async(e,r,t)=>{const{save:s,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return s(this,r);case 1:return i(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(p).then(()=>this._openRaster(r))),Promise.resolve(this)}destroy(){super.destroy(),this._releaseWorkerHandle=o(this._releaseWorkerHandle)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[E("Pixel Value"),M("Raw Pixel Value")],r=this.raster?.rasterInfo??this.serviceRasterInfo,t=r?.attributeTable;if(t){const r=W(t);e.push(...r)}const s=r?.dataType,i=r?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const r=i.variables[0].unit?.trim(),t=U(r),s=H();e.push(t,s)}if(i){const r=k(i);e.push(...r)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:r}=this,t=e?.visibleFieldNames??new Set(r.map(({name:e})=>e).filter(e=>e!==z.rawServicePixelValue)),s=K({fields:r,title:this.title},{...e,visibleFieldNames:t}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&A(s.fieldInfos,i),s}async generateRasterInfo(e,r){const t=u(B,e);if(await this.load(),!t||"none"===t.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:e}=await this._openFunctionRaster(t,r);return e}catch(i){if(i instanceof s)throw i;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}supportsExportMapTiles(){const e=this._primaryRasters[0]??this.raster,r="RasterTileServer"===e?.datasetFormat,t=!!this.sourceJSON?.exportTilesAllowed,s=this.sourceJSON?.datasetFormat?.toLowerCase(),i=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&"Raster"===e?.tileType&&("cache/jpegplus"===s||"cache/jpegpng"===s);return r&&t&&("Map"===e?.tileType||i)}supportsWrite(){const e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,r){return this.supportsWrite()?super.write(e,r):(X(r,this),null)}async hasDataChanged(){try{const e=this._primaryRasters[0]??this.raster,{dataChanged:r,updates:t}=await e.refresh();return r&&(this.serviceRasterInfo!==e.rasterInfo&&this._set("serviceRasterInfo",e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0})),r}catch{return!1}}async _openRaster(e){let r=!1;if(this.raster)await this._openFromRaster(this.raster,e),r=F(this.raster),!r&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:r,rasterFunction:t,source:i}=this;if(!r&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):t?await this._openFromUrlWithRasterFunction(r,t,e):await this._openFromUrl(r,e)}const t=this.raster.rasterInfo;if(!t)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",r?t:this._primaryRasters[0].rasterInfo),this._set("spatialReference",t.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(l(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,r){e.rasterInfo||await e.open({signal:r}),this._primaryRasters=b(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,r,t){const i=[e];let o;r&&J(r.toJSON(),i),i.some(e=>re(e))&&(o=await D(),this._releaseWorkerHandle={remove:()=>G()});const a=await Promise.all(i.map(e=>P.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:o,signal:t}))),n=a.findIndex(e=>null==e);if(n>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[n]}`);return this._primaryRasters=a,this._initializeWithFunctionRaster(r)}async _openFromUrl(e,r){let t;re(e)&&(t=await D(),this._releaseWorkerHandle={remove:()=>G()});const i=await P.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:t,signal:r});if(null==i)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,r){const t="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",t);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await P.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r});if(null==o)throw new s("imagery-tile-layer:open",t);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,r){const t={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>t[e.url]=e);const s=N(e.functionDefinition?.toJSON()??e.toJSON(),t),i=new T({rasterFunction:s});return await i.open(r),i}async _initializeWithFunctionRaster(e,r){try{this.raster=await this._openFunctionRaster(e,r)}catch(t){t instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",t.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){$(i.getLogger(this),Y("ImageryTile layers","relative-to-scene",e)),$(i.getLogger(this),q("ImageryTile layers",e))}};e([c({clonable:!1})],Z.prototype,"_primaryRasters",void 0),e([c({clonable:!1})],Z.prototype,"_releaseWorkerHandle",void 0),e([c({json:{origins:{"web-scene":{write:!1}},write:!0}})],Z.prototype,"charts",void 0),e([c({type:Q,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Z.prototype,"elevationInfo",null),e([c({type:V})],Z.prototype,"tileInfo",void 0),e([c({readOnly:!0,clonable:!1})],Z.prototype,"graphicOrigin",void 0),e([c(x)],Z.prototype,"legendEnabled",void 0),e([c({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Z.prototype,"isReference",void 0),e([c({type:["show","hide"]})],Z.prototype,"listMode",void 0),e([c({json:{read:!0,write:!0}})],Z.prototype,"blendMode",void 0),e([c({type:B,json:{name:"renderingRule",write:!0}})],Z.prototype,"rasterFunction",void 0),e([c()],Z.prototype,"sourceJSON",void 0),e([c({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Z.prototype,"version",void 0),e([c({readOnly:!0,json:{read:!1}})],Z.prototype,"type",void 0),e([c({type:["ArcGISTiledImageServiceLayer"]})],Z.prototype,"operationalLayerType",void 0),e([c({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,r,t){r[t]=!e}}}})],Z.prototype,"popupEnabled",void 0),e([c({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Z.prototype,"popupTemplate",void 0),e([c({readOnly:!0})],Z.prototype,"defaultPopupTemplate",null),e([c(L)],Z.prototype,"screenSizePerspectiveEnabled",void 0),e([c({readOnly:!0,type:[C]})],Z.prototype,"fields",void 0),e([c({readOnly:!0,type:[C]})],Z.prototype,"rasterFields",null),e([c({constructOnly:!0})],Z.prototype,"source",void 0),Z=e([m("esri.layers.ImageryTileLayer")],Z);const ee=Z;function re(e){return/\.(jpe?g|png)$/i.test(e)}export{ee as default};
|