@arcgis/core 5.2.0-next.117 → 5.2.0-next.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
- package/analysis/featureReferenceUtils.js +1 -1
- package/arcade.d.ts +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03918a862455191a8910.js +1 -0
- package/assets/esri/core/workers/chunks/{9b9a60f1e0c48aa701f0.js → 066b7f6866d602f963e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{564fdf0d663b773806cc.js → 114bc14c49176f64a2c5.js} +1 -1
- package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +1 -0
- package/assets/esri/core/workers/chunks/{db141122060d8d9b38da.js → 1742dbc6a827cfda471b.js} +1 -1
- package/assets/esri/core/workers/chunks/{045ff98313b06a2188b7.js → 1a39335aa2dce6d564d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{caf38cf4d8542fb11c46.js → 20e4277a4a6c57957202.js} +1 -1
- package/assets/esri/core/workers/chunks/{f42243c62dd0b6993816.js → 24014f3701c31ee74bc2.js} +1 -1
- package/assets/esri/core/workers/chunks/{62b1f94f4fa978d4da48.js → 354912041363502c6a89.js} +1 -1
- package/assets/esri/core/workers/chunks/37cf4ca2083cd3b6002e.js +1 -0
- package/assets/esri/core/workers/chunks/{3b499cfc89c8f87cdb20.js → 3c3e5e952fd6740bb234.js} +1 -1
- package/assets/esri/core/workers/chunks/{44d3fe10cb35d16f0b33.js → 4396ef5ab3eb9e9a7df2.js} +1 -1
- package/assets/esri/core/workers/chunks/{56989b48c0a5d7fe85e6.js → 4c4ba466e23159991322.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9023cc3298ee4fddea7.js → 54f3bc940cea15fce2c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e42be27ead91a4cc0f1.js → 581285e4d7bbe1b7c27a.js} +1 -1
- package/assets/esri/core/workers/chunks/5938d5f6e37f49867d5a.js +1 -0
- package/assets/esri/core/workers/chunks/{05584d8828ae7bca0fc5.js → 64ee22134fda2f09c094.js} +1 -1
- package/assets/esri/core/workers/chunks/6efc5873747b9cd44fb9.js +1 -0
- package/assets/esri/core/workers/chunks/{0463c807b37f01bbc35c.js → 70347d25968975126fa7.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bfd63f3cf9208eb839b.js → 723478607badcde5706b.js} +43 -43
- package/assets/esri/core/workers/chunks/{42c4d0c1c08bf111e5a4.js → 731ec5de16753e10b963.js} +1 -1
- package/assets/esri/core/workers/chunks/{5965a947f68b707eaa6b.js → 82ce034b5ba54de9b970.js} +1 -1
- package/assets/esri/core/workers/chunks/{1eafb214519d8fc63ccb.js → 8465e2c7221125fd3cc4.js} +1 -1
- package/assets/esri/core/workers/chunks/862e1acd80c4e43831dc.js +1 -0
- package/assets/esri/core/workers/chunks/{fd808d38ae2d475ac442.js → 8675ab3c4dec2f13b9c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{925a0b29d3ed7165b8dd.js → 8984d02c0ce828fd223a.js} +1 -1
- package/assets/esri/core/workers/chunks/{57328c206f1e699ac06f.js → 89edaa1ffa566908ebca.js} +1 -1
- package/assets/esri/core/workers/chunks/97fea852f8e93e1286e4.js +1 -0
- package/assets/esri/core/workers/chunks/{bb4cbf6b7c35e8c78cc7.js → a917a1df8270860dc514.js} +1 -1
- package/assets/esri/core/workers/chunks/{996438b3afec92c5c68e.js → b0058619e0363002ad86.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fb46ccd4be4c3b61c31.js → b5a102cf9f4377fb9842.js} +1 -1
- package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +1 -0
- package/assets/esri/core/workers/chunks/{fa869977ac2abb063925.js → b9c834e3c0701e9b14a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{32dd990a3bd93cbad309.js → c0ec87800faf99cbd8bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{20de0ea9fa08a6545978.js → cf1106eda10f3cccb1bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed988360264574cd8f6b.js → cf7c06702babd6fa88b4.js} +1 -1
- package/assets/esri/core/workers/chunks/cfd8317ecd2e63af7c40.js +1 -0
- package/assets/esri/core/workers/chunks/d090baaa974e1e83fa44.js +1 -0
- package/assets/esri/core/workers/chunks/{c5ceceb0683671f92efa.js → da6583e8d88441a1c02a.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1f2b07be33e33117313.js → dd02cc18ebebb90778c6.js} +1 -1
- package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +1 -0
- package/assets/esri/core/workers/chunks/{05b373a663cb5d4d722f.js → deb5b1d772ca407654d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{10fa8fbade8ae084c307.js → e22a013ec38989caf9de.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7e6b5594fed5bb16691.js → e4016ae9cb8f16e3efc3.js} +1 -1
- package/assets/esri/core/workers/chunks/e5f0c47957a4e9663720.js +1 -0
- package/assets/esri/core/workers/chunks/{a3f4818f4190fa92331d.js → edd36e98355f1655e5c8.js} +1 -1
- package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +1 -0
- package/assets/esri/core/workers/chunks/f0709c48daca93e759c8.js +1 -0
- package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +1 -0
- package/assets/esri/core/workers/chunks/{d926bffc3ff9f87e9081.js → f890359d972cce54459e.js} +1 -1
- package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +1 -0
- package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +1 -0
- package/assets/esri/core/workers/chunks/fe1787a8d499832996b3.js +1 -0
- package/chunks/CloudsComposition.glsl.js +2 -2
- package/chunks/ColorMaterial.glsl.js +3 -3
- package/chunks/Compositing.glsl.js +4 -4
- package/chunks/DeepSky.glsl.js +3 -3
- package/chunks/EdgeShader.glsl.js +6 -6
- package/chunks/FocusArea.glsl.js +1 -1
- package/chunks/GlobalIllumination.glsl.js +7 -7
- package/chunks/HUDMaterial.glsl.js +5 -5
- package/chunks/LaserlinePath.glsl.js +5 -5
- package/chunks/LineCallout.glsl.js +2 -2
- package/chunks/LineMarker.glsl.js +30 -30
- package/chunks/NavigationDepth.glsl.js +1 -1
- package/chunks/OccludedGeometryDepth.glsl.js +2 -2
- package/chunks/Path.glsl.js +12 -12
- package/chunks/PointRenderer.glsl.js +5 -5
- package/chunks/Precipitation.glsl.js +7 -7
- package/chunks/RibbonLine.glsl.js +50 -50
- package/chunks/SimpleAtmosphere.glsl.js +9 -9
- package/chunks/Stars.glsl.js +5 -5
- package/chunks/Terrain.glsl.js +18 -16
- package/chunks/Viewshed.glsl.js +3 -3
- package/chunks/VolumeMask.glsl.js +2 -2
- package/chunks/Water.glsl.js +38 -48
- package/config.js +1 -1
- package/core/NestedMap.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -1
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -1
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +2 -30
- package/layers/FeatureLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/mixins/FeatureLayerReload.d.ts +26 -0
- package/layers/mixins/FeatureLayerReload.js +2 -0
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/support/TimeInfo.d.ts +2 -2
- package/layers/support/TimeInfo.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +3 -3
- package/support/revision.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/time/timeZoneUtils.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/InteractiveController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/controllers/momentum/MomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +2 -0
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +9 -9
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +15 -15
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +23 -23
- package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +2 -0
- package/views/3d/webgl-engine/effects/AmbientIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/Precipitation.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/stars/DeepSky.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/AdjustProjectedPosition.glsl.js +4 -4
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ViewingModeConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +26 -26
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +2 -0
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NavigationDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/OccludedGeometryDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/VolumeMask.glsl.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
- package/widgets/Measurement.d.ts +1 -2
- package/widgets/Measurement.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +13 -0
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +8 -1
- package/widgets/Sketch/VisibleElements.js +1 -1
- package/widgets/Sketch/support/PluginManager.d.ts +11 -1
- package/widgets/ValuePicker.d.ts +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +4 -2
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/assets/esri/core/workers/chunks/0630e650abdfea1792e4.js +0 -1
- package/assets/esri/core/workers/chunks/0edebc6c516f0b9dac7b.js +0 -1
- package/assets/esri/core/workers/chunks/25c5e1b14b184b1228a3.js +0 -1
- package/assets/esri/core/workers/chunks/2e0fd0536408053ac6f5.js +0 -1
- package/assets/esri/core/workers/chunks/573e8fa0af8711ffec45.js +0 -1
- package/assets/esri/core/workers/chunks/5b9925f23d4b10a7087e.js +0 -1
- package/assets/esri/core/workers/chunks/66c46c5a7147550ea3ed.js +0 -1
- package/assets/esri/core/workers/chunks/6c7cb7974969e3167f2b.js +0 -1
- package/assets/esri/core/workers/chunks/729d458e9e28641227cd.js +0 -1
- package/assets/esri/core/workers/chunks/7bbc3d22383388d11345.js +0 -1
- package/assets/esri/core/workers/chunks/7edf57e31ff07af9032b.js +0 -1
- package/assets/esri/core/workers/chunks/8bd187b48a4e4296e3d8.js +0 -1
- package/assets/esri/core/workers/chunks/9acaabe950319d031f2e.js +0 -1
- package/assets/esri/core/workers/chunks/ac02df176f9ea94278bb.js +0 -1
- package/assets/esri/core/workers/chunks/b4222152efaf73b37b53.js +0 -1
- package/assets/esri/core/workers/chunks/c0855be20ffcd52c7026.js +0 -1
- package/assets/esri/core/workers/chunks/e606be4ece4eac1e9bbe.js +0 -1
- package/assets/esri/core/workers/chunks/f05622413cadfd14553e.js +0 -1
package/chunks/Water.glsl.js
CHANGED
|
@@ -1,81 +1,71 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../core/Error.js";import{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import e from"../core/Error.js";import{SliceDraw as o}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{ObjectAndLayerIdColor as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{OutputHighlight as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{mainLightDirection as t,mainLightIntensity as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{ReadShadowMapDrawFragment as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{WaterColor as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js";import{WaterDistortion as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js";import{viewNormal as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{ColorConversion as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as g,addCameraPosition as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as f}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{outputColorHighlightOLID as h}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as b}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as j}from"../webscene/support/AlphaCutoff.js";function y(y){const C=new b,{vertex:P,fragment:L,varyings:x}=C,{output:S,draped:_,receiveShadows:O}=y;g(P,y),C.include(r),C.attributes.add("position","vec3"),C.attributes.add("uv0","vec2");const N=new u("waterColor",e=>e.color);switch(x.add("vpos","vec3",{invariant:!0}),P.uniforms.add(N),C.include(l,y),S){case 0:case 1:case 2:if(C.include(m),C.include(d,y),C.include(h,y),_)return P.main.add(f`
|
|
3
|
+
if (waterColor.a < ${f.float(j)}) {
|
|
4
|
+
// Discard this vertex
|
|
5
|
+
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
vuv = uv0;
|
|
18
|
-
vpos = position;
|
|
9
|
+
vpos = position;
|
|
10
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
11
|
+
`),L.uniforms.add(N),L.main.add(f`fragColor = waterColor;`),C;P.include(s,y),x.add("vuv","vec2"),x.add("vnormal","vec3"),x.add("vtbnMatrix","mat3"),P.main.add(f`
|
|
12
|
+
if (waterColor.a < ${f.float(j)}) {
|
|
13
|
+
// Discard this vertex
|
|
14
|
+
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
vuv = uv0;
|
|
19
|
+
vpos = position;
|
|
20
|
+
vnormal = getLocalUp(vpos, localOrigin);
|
|
21
|
+
vtbnMatrix = getTBNMatrix(vnormal);
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
24
|
+
forwardLinearDepthToReadShadowMap();
|
|
25
|
+
`),L.include(o,y),L.include(c),p(L,y),L.uniforms.add(t,n,N,new w("timeElapsed",({timeElapsed:e})=>e),P.uniforms.get("view"),P.uniforms.get("localOrigin")).main.add(f`
|
|
25
26
|
discardBySlice(vpos);
|
|
26
|
-
vec3 localUp = vnormal;
|
|
27
27
|
// the created normal is in tangent space
|
|
28
28
|
vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);
|
|
29
29
|
|
|
30
30
|
// we rotate the normal according to the tangent-bitangent-normal-Matrix
|
|
31
31
|
vec3 n = normalize(vtbnMatrix * tangentNormalFoam.xyz);
|
|
32
32
|
vec3 v = -normalize(vpos - cameraPosition);
|
|
33
|
-
float shadow = ${
|
|
33
|
+
float shadow = ${O?f`1.0 - readShadowMap(vpos, linearDepth)`:"1.0"};
|
|
34
34
|
vec4 vPosView = view * vec4(vpos, 1.0);
|
|
35
|
-
vec4 final = vec4(getWaterColor(n, v, mainLightDirection, waterColor.rgb, mainLightIntensity,
|
|
35
|
+
vec4 final = vec4(getWaterColor(n, v, mainLightDirection, waterColor.rgb, mainLightIntensity, vnormal, shadow, tangentNormalFoam.w, vPosView.xyz, vpos + localOrigin), waterColor.w);
|
|
36
36
|
|
|
37
37
|
fragColor = delinearizeGamma(final);
|
|
38
|
-
outputColorHighlightOLID(applySlice(fragColor, vpos), final.rgb);`);break;case 4:
|
|
39
|
-
if (waterColor.a < ${
|
|
38
|
+
outputColorHighlightOLID(applySlice(fragColor, vpos), final.rgb);`);break;case 4:C.include(m,y),P.include(s,y),P.main.add(f`
|
|
39
|
+
if (waterColor.a < ${f.float(j)}) {
|
|
40
40
|
// Discard this vertex
|
|
41
41
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
vuv = uv0;
|
|
46
45
|
vpos = position;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);
|
|
53
|
-
tangentNormalFoam.xyz = normalize(tangentNormalFoam.xyz);
|
|
54
|
-
|
|
55
|
-
// Draped water is only rendered for overlay, writes foam and is not rendered for ambient illumination.
|
|
56
|
-
// Non-draped water opts out of ambient illumination by writing 0.0.
|
|
57
|
-
fragColor = vec4(
|
|
58
|
-
(tangentNormalFoam.xyz + vec3(1.0)) * 0.5,
|
|
59
|
-
${O?h`tangentNormalFoam.w`:h`0.0`}
|
|
60
|
-
);`);break;case 3:P.main.add(h`
|
|
61
|
-
if (waterColor.a < ${h.float(j)}) {
|
|
46
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
47
|
+
`),L.include(o,y),L.main.add(f`discardBySlice(vpos);`),y.drapedNormals?(x.add("vuv","vec2"),P.main.add("vuv = uv0;"),L.uniforms.add(new w("timeElapsed",({timeElapsed:e})=>e)).main.add(f`vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);
|
|
48
|
+
tangentNormalFoam.xyz = normalize(tangentNormalFoam.xyz);
|
|
49
|
+
fragColor = vec4((tangentNormalFoam.xyz + vec3(1.0)) * 0.5, tangentNormalFoam.a);`)):(x.add("vnormal","vec3"),P.uniforms.add(v).main.add("vnormal = normalize4(viewNormal * vec4(getLocalUp(vpos, localOrigin), 1.0));"),L.main.add("fragColor = vec4(vec3(0.5) + 0.5 * vnormal, 1.0);"));break;case 3:P.main.add(f`
|
|
50
|
+
if (waterColor.a < ${f.float(j)}) {
|
|
62
51
|
// Discard this vertex
|
|
63
52
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
64
53
|
return;
|
|
65
54
|
}
|
|
66
55
|
|
|
67
56
|
vpos = position;
|
|
68
|
-
gl_Position = transformPosition(proj, view, vpos)
|
|
69
|
-
|
|
57
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
58
|
+
`),L.include(o,y),L.main.add("discardBySlice(vpos);");break;case 10:C.include(a,y),P.main.add(f`
|
|
59
|
+
if (waterColor.a < ${f.float(j)}) {
|
|
70
60
|
// Discard this vertex
|
|
71
61
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
72
62
|
return;
|
|
73
63
|
}
|
|
74
64
|
|
|
75
65
|
vpos = position;
|
|
76
|
-
gl_Position = transformPosition(proj, view, vpos);`),
|
|
77
|
-
calculateOcclusionAndOutputHighlight();`);break;case 11:
|
|
78
|
-
if (waterColor.a < ${
|
|
66
|
+
gl_Position = transformPosition(proj, view, vpos);`),L.include(o,y),L.main.add(f`discardBySlice(vpos);
|
|
67
|
+
calculateOcclusionAndOutputHighlight();`);break;case 11:C.include(i,y),P.main.add(f`
|
|
68
|
+
if (waterColor.a < ${f.float(j)}) {
|
|
79
69
|
// Discard this vertex
|
|
80
70
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
81
71
|
return;
|
|
@@ -83,5 +73,5 @@ calculateOcclusionAndOutputHighlight();`);break;case 11:L.include(a,C),P.main.ad
|
|
|
83
73
|
|
|
84
74
|
vpos = position;
|
|
85
75
|
gl_Position = transformPosition(proj, view, vpos);
|
|
86
|
-
forwardObjectAndLayerIdColor();`),
|
|
87
|
-
outputObjectAndLayerIdColor();`);break;default:throw new e("shaderbuilder:missing-output",`Unimplemented shader output ${
|
|
76
|
+
forwardObjectAndLayerIdColor();`),L.include(o,y),L.main.add(f`discardBySlice(vpos);
|
|
77
|
+
outputObjectAndLayerIdColor();`);break;default:throw new e("shaderbuilder:missing-output",`Unimplemented shader output ${S} for WaterTechnique`)}return C}const C=Object.freeze(Object.defineProperty({__proto__:null,build:y},Symbol.toStringTag,{value:"Module"}));export{C as W,y as b};
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/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.2.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.2.0-next.119";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
package/core/NestedMap.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
class t{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let t=0;for(const e of this._outer.values())t+=e.size;return t}get(t,e){return this._outer.get(t)?.get(e)}getInner(t){return this._outer.get(t)}set(t,e,r){const o=this._outer.get(t);o?o.set(e,r):this._outer.set(t,new Map([[e,r]]))}delete(t,e){const r=this._outer.get(t);r&&(r.delete(e),0===r.size&&this._outer.delete(t))}pop(t,e){const r=this.get(t,e);return this.delete(t,e),r}*outerMap(){for(const t of this._outer)yield t}*values(){for(const t of this._outer.values())yield*t.values()}*[Symbol.iterator](){for(const[t,e]of this._outer)for(const[r,o]of e)yield[t,r,o]}forEach(t){this._outer.forEach((e,r)=>t(e,r))}forAll(t){this._outer.forEach((e,r)=>e.forEach((e,o)=>t(e,r,o)))}
|
|
2
|
+
class t{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let t=0;for(const e of this._outer.values())t+=e.size;return t}get(t,e){return this._outer.get(t)?.get(e)}getInner(t){return this._outer.get(t)}set(t,e,r){const o=this._outer.get(t);o?o.set(e,r):this._outer.set(t,new Map([[e,r]]))}delete(t,e){const r=this._outer.get(t);r&&(r.delete(e),0===r.size&&this._outer.delete(t))}pop(t,e){const r=this.get(t,e);return this.delete(t,e),r}*outerMap(){for(const t of this._outer)yield t}*values(){for(const t of this._outer.values())yield*t.values()}*[Symbol.iterator](){for(const[t,e]of this._outer)for(const[r,o]of e)yield[t,r,o]}forEach(t){this._outer.forEach((e,r)=>t(e,r))}forAll(t){this._outer.forEach((e,r)=>e.forEach((e,o)=>t(e,r,o)))}clone(){const e=new t;return this.forAll((t,r,o)=>e.set(r,o,t)),e}}export{t as NestedMap};
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let r,s=e;function i(o){r=o}function t(e){const s=r?.findCredential(e);return s?.token?o(e,"token",s.token):e}s="5.2.0-next.
|
|
2
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let r,s=e;function i(o){r=o}function t(e){const s=r?.findCredential(e);return s?.token?o(e,"token",s.token):e}s="5.2.0-next.119",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,s as fullVersion,r as id,i as setId,e as version};
|
|
@@ -17,6 +17,7 @@ import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
|
|
|
17
17
|
import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
|
|
18
18
|
import type { EditBusLayer, EditBusLayerEvents } from "./mixins/EditBusLayer.js";
|
|
19
19
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
20
|
+
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
20
21
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
21
22
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|
|
22
23
|
import type { RefreshableLayer, RefreshableLayerEvents, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
|
|
@@ -456,4 +457,4 @@ export default class AnnotationFeatureLayer extends AnnotationFeatureLayerSuperc
|
|
|
456
457
|
*/
|
|
457
458
|
saveAs(portalItem: PortalItemProperties, options?: LayerSaveAsOptions): Promise<PortalItem>;
|
|
458
459
|
}
|
|
459
|
-
declare const AnnotationFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof EditBusLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase
|
|
460
|
+
declare const AnnotationFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof EditBusLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase & typeof FeatureLayerReload
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as c,onAbort as h}from"../core/promiseUtils.js";import{watch as m,sync as f}from"../core/reactiveUtils.js";import{property as b,subclass as v}from"../core/accessorSupport/decorators.js";import g from"../geometry/SpatialReference.js";import S from"../graphic/AnnotationFeatureGraphicOrigin.js";import j from"./Layer.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as O}from"./mixins/DataElementMixin.js";import{EditBusLayer as x}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as E}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as P}from"./mixins/PortalLayer.js";import{RefreshableLayer as _}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as A}from"./mixins/TemporalLayer.js";import q from"./support/AnnotationFeatureSublayer.js";import{parse as M,cleanTitle as k,titleFromUrlAndName as D}from"./support/arcgisLayerUrl.js";import{barrierWeight as U,id as G,popupEnabled as R}from"./support/commonProperties.js";import{ensureLayerCredential as N,createQuery as Q,getFieldDomain as H,hasDataChanged as J}from"./support/featureLayerUtils.js";import{defineFieldProperties as $}from"./support/fieldProperties.js";import{fixTimeInfoFields as V}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as B}from"./support/versionUtils.js";import K from"../rest/support/Query.js";import{createPopupTemplate as W}from"../support/popupUtils.js";import{reader as Z}from"../core/accessorSupport/decorators/reader.js";const z="annotation-feature-layer",X=$(),Y=a.ofType(q);function ee(e){return e.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,t)=>e-t)??null}let te=class extends(O(E(L(A(x(C(_(w(T(P(u(I(F(o(j))))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight="high",this.elementField="element",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new S(this,null),this.operationalLayerType="ArcGISAnnotationLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.statusField="status",this.sublayers=new Y,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Annotation Layer"]),this.symbolCollection=null,this.type="annotation-feature",this.unplacedAnnotationsVisible=!1,this._debouncedSaveOperations=d(async(e,t,r)=>{const{save:i,saveAs:s}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,t);case 1:return s(this,r,t)}}),this.addHandles(m(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),f))}destroy(){this.source?.destroy()}load(e){const t=e?.signal,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(y).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url)throw new n(`${z}:missing-url`,"AnnotationFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.symbolCollection)throw new n(`${z}:missing-symbol-collection`,"Invalid service with no symbol collection")}),this.initLayerProperties(await this.createGraphicsSource(t))])}).then(()=>N(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,t){const r=new Y(t.subtypes.map(({code:e})=>new q({subtypeCode:e})).reverse());if(this.visibleLayers){const e=new Set(this.visibleLayers);r.forEach(t=>{t.visible=e.has(t.subtypeCode)})}return r}readTitleFromService(e,t){const{url:r}=this,i=t.name||M(r)?.title;switch(this.sublayerTitleMode){case"item-title":if(r)return D(r,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=k(e),i?`${e} - ${k(i)}`:e;break}}return i?k(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get visibleLayers(){return 0===this.sublayers.length?this._get("visibleLayers")??null:Array.from(new Set(ee(this)))}set visibleLayers(e){this._set("visibleLayers",e)}createPopupTemplate(e){return W(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{const{default:t}=await c(import("./graphics/sources/FeatureLayerSource.js"),r),s=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(h(r,()=>s.cancelLoad())??p()),!1);return await s.load({signal:r}),s}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}createQuery(){const e=Q(this);return e.where=this.definitionExpression||"1=1",e}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return H(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(K.from(e)??r.createQuery(),t);if(i?.features)for(const s of i.features){const e=this.findSublayerForFeature(s);s.origin=e?.graphicOrigin??this.graphicOrigin,s.layer=s.sourceLayer=this}return i}async queryObjectIds(e,t){const r=await this.load();return r.source.queryObjectIds(K.from(e)??r.createQuery(),t)}async queryFeatureCount(e,t){const r=await this.load();return r.source.queryFeatureCount(K.from(e)??r.createQuery(),t)}async queryExtent(e,t){const r=await this.load();return r.source.queryExtent(K.from(e)??r.createQuery(),t)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}serviceSupportsSpatialReference(e){return this.loaded&&B(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),V(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return J(this)}_verifySource(){if(this.version&&this.version<10.8)throw new n(z+":unsupported-version","The feature service must be version 10.8 or above.");const e=["ZOrder","AnnotationClassID","Element","SymbolID","Status"],t=e.filter(e=>!this.fieldsIndex.has(e));if(this.fieldsIndex.has("FeatureID")||this.fieldsIndex.has("FeatureGlobalID")||t.unshift("FeatureID","FeatureGlobalID"),t.length)throw new n(z+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}_fetchFirstValidLayerId(e){return s(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(!t)return;this.applyPreferredHost(t);const r=[...t.layers||[],...t.tables||[]];return r.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on("after-remove",({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],"sublayers-owner"))}};r([b({type:g,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],te.prototype,"attributeSpatialReference",void 0),r([b(U)],te.prototype,"barrierWeight",void 0),r([b({nonNullable:!0,json:{name:"enableEditing",write:!0}})],te.prototype,"editingEnabled",null),r([b({readOnly:!0})],te.prototype,"effectiveEditingEnabled",null),r([b({readOnly:!0})],te.prototype,"elementField",void 0),r([b({...X.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],te.prototype,"fields",void 0),r([b(X.fieldsIndex)],te.prototype,"fieldsIndex",void 0),r([b({readOnly:!0,clonable:!1})],te.prototype,"graphicOrigin",void 0),r([b(G)],te.prototype,"id",void 0),r([b({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],te.prototype,"listMode",void 0),r([b({type:["ArcGISAnnotationLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],te.prototype,"operationalLayerType",void 0),r([b(X.outFields)],te.prototype,"outFields",void 0),r([b(R)],te.prototype,"popupEnabled",void 0),r([b({type:i,json:{name:"popupInfo",write:!0}})],te.prototype,"popupTemplate",void 0),r([b({readOnly:!0})],te.prototype,"defaultPopupTemplate",null),r([b({readOnly:!0})],te.prototype,"referenceScale",void 0),r([b({clonable:!1,readOnly:!0})],te.prototype,"source",void 0),r([b({readOnly:!0})],te.prototype,"statusField",void 0),r([b({type:Y,json:{name:"layers",write:{ignoreOrigin:!0}}})],te.prototype,"sublayers",void 0),r([Z("service","sublayers",["subtypes"])],te.prototype,"readSublayers",null),r([b({type:String})],te.prototype,"sublayerTitleMode",void 0),r([b({readOnly:!0})],te.prototype,"symbolCollection",void 0),r([Z("service","title",["name"])],te.prototype,"readTitleFromService",null),r([Z("portal-item","title")],te.prototype,"readTitleFromPortalItem",null),r([b({json:{read:!1},value:"annotation-feature",readOnly:!0})],te.prototype,"type",void 0),r([b()],te.prototype,"unplacedAnnotationsVisible",void 0),r([b({type:[Number]})],te.prototype,"visibleLayers",null),te=r([v("esri.layers.AnnotationFeatureLayer")],te);const re=te;export{re as default};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as m,onAbort as h}from"../core/promiseUtils.js";import{watch as c,sync as f}from"../core/reactiveUtils.js";import{property as b,subclass as v}from"../core/accessorSupport/decorators.js";import g from"../geometry/SpatialReference.js";import S from"../graphic/AnnotationFeatureGraphicOrigin.js";import j from"./Layer.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as O}from"./mixins/DataElementMixin.js";import{EditBusLayer as T}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as x}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as E}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{RefreshableLayer as C}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as q}from"./mixins/TemporalLayer.js";import D from"./support/AnnotationFeatureSublayer.js";import{parse as M,cleanTitle as k,titleFromUrlAndName as U}from"./support/arcgisLayerUrl.js";import{barrierWeight as R,id as G,popupEnabled as N}from"./support/commonProperties.js";import{ensureLayerCredential as Q,createQuery as H,getFieldDomain as J,hasDataChanged as $}from"./support/featureLayerUtils.js";import{defineFieldProperties as V}from"./support/fieldProperties.js";import{fixTimeInfoFields as B}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as K}from"./support/versionUtils.js";import W from"../rest/support/Query.js";import{createPopupTemplate as Z}from"../support/popupUtils.js";import{reader as z}from"../core/accessorSupport/decorators/reader.js";const X="annotation-feature-layer",Y=V(),ee=a.ofType(D);function te(e){return e.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,t)=>e-t)??null}let re=class extends(E(O(x(L(q(T(A(C(w(P(_(u(I(F(o(j)))))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight="high",this.elementField="element",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new S(this,null),this.operationalLayerType="ArcGISAnnotationLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.statusField="status",this.sublayers=new ee,this.sublayerTitleMode="item-title",this.supportedPortalItemTypes=["Feature Service"],this.supportedSourceTypes=new Set(["Annotation Layer"]),this.symbolCollection=null,this.type="annotation-feature",this.unplacedAnnotationsVisible=!1,this._debouncedSaveOperations=d(async(e,t,r)=>{const{save:i,saveAs:s}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,t);case 1:return s(this,r,t)}}),this.addHandles(c(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),f))}destroy(){this.source?.destroy()}load(e){const t=e?.signal,r=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(y).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url)throw new n(`${X}:missing-url`,"AnnotationFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.symbolCollection)throw new n(`${X}:missing-symbol-collection`,"Invalid service with no symbol collection")}),this.initLayerProperties(await this.createGraphicsSource(t))])}).then(()=>Q(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,t){const r=new ee(t.subtypes.map(({code:e})=>new D({subtypeCode:e})).reverse());if(this.visibleLayers){const e=new Set(this.visibleLayers);r.forEach(t=>{t.visible=e.has(t.subtypeCode)})}return r}readTitleFromService(e,t){const{url:r}=this,i=t.name||M(r)?.title;switch(this.sublayerTitleMode){case"item-title":if(r)return U(r,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=k(e),i?`${e} - ${k(i)}`:e;break}}return i?k(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get visibleLayers(){return 0===this.sublayers.length?this._get("visibleLayers")??null:Array.from(new Set(te(this)))}set visibleLayers(e){this._set("visibleLayers",e)}createPopupTemplate(e){return Z(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{const{default:t}=await m(import("./graphics/sources/FeatureLayerSource.js"),r),s=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(h(r,()=>s.cancelLoad())??p()),!1);return await s.load({signal:r}),s}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}createQuery(){const e=H(this);return e.where=this.definitionExpression||"1=1",e}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return J(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(W.from(e)??r.createQuery(),t);if(i?.features)for(const s of i.features){const e=this.findSublayerForFeature(s);s.origin=e?.graphicOrigin??this.graphicOrigin,s.layer=s.sourceLayer=this}return i}async queryObjectIds(e,t){const r=await this.load();return r.source.queryObjectIds(W.from(e)??r.createQuery(),t)}async queryFeatureCount(e,t){const r=await this.load();return r.source.queryFeatureCount(W.from(e)??r.createQuery(),t)}async queryExtent(e,t){const r=await this.load();return r.source.queryExtent(W.from(e)??r.createQuery(),t)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}serviceSupportsSpatialReference(e){return this.loaded&&K(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),B(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){const t=this.source;await Promise.all([t.reload({signal:e}),this.loadDataElement({signal:e})]),await this.initLayerProperties(t)}async hasDataChanged(){return $(this)}_verifySource(){if(this.version&&this.version<10.8)throw new n(X+":unsupported-version","The feature service must be version 10.8 or above.");const e=["ZOrder","AnnotationClassID","Element","SymbolID","Status"],t=e.filter(e=>!this.fieldsIndex.has(e));if(this.fieldsIndex.has("FeatureID")||this.fieldsIndex.has("FeatureGlobalID")||t.unshift("FeatureID","FeatureGlobalID"),t.length)throw new n(X+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}_fetchFirstValidLayerId(e){return s(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(!t)return;this.applyPreferredHost(t);const r=[...t.layers||[],...t.tables||[]];return r.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on("after-remove",({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],"sublayers-owner"))}};r([b({type:g,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],re.prototype,"attributeSpatialReference",void 0),r([b(R)],re.prototype,"barrierWeight",void 0),r([b({nonNullable:!0,json:{name:"enableEditing",write:!0}})],re.prototype,"editingEnabled",null),r([b({readOnly:!0})],re.prototype,"effectiveEditingEnabled",null),r([b({readOnly:!0})],re.prototype,"elementField",void 0),r([b({...Y.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],re.prototype,"fields",void 0),r([b(Y.fieldsIndex)],re.prototype,"fieldsIndex",void 0),r([b({readOnly:!0,clonable:!1})],re.prototype,"graphicOrigin",void 0),r([b(G)],re.prototype,"id",void 0),r([b({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],re.prototype,"listMode",void 0),r([b({type:["ArcGISAnnotationLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],re.prototype,"operationalLayerType",void 0),r([b(Y.outFields)],re.prototype,"outFields",void 0),r([b(N)],re.prototype,"popupEnabled",void 0),r([b({type:i,json:{name:"popupInfo",write:!0}})],re.prototype,"popupTemplate",void 0),r([b({readOnly:!0})],re.prototype,"defaultPopupTemplate",null),r([b({readOnly:!0})],re.prototype,"referenceScale",void 0),r([b({clonable:!1,readOnly:!0})],re.prototype,"source",void 0),r([b({readOnly:!0})],re.prototype,"statusField",void 0),r([b({type:ee,json:{name:"layers",write:{ignoreOrigin:!0}}})],re.prototype,"sublayers",void 0),r([z("service","sublayers",["subtypes"])],re.prototype,"readSublayers",null),r([b({type:String})],re.prototype,"sublayerTitleMode",void 0),r([b({readOnly:!0})],re.prototype,"symbolCollection",void 0),r([z("service","title",["name"])],re.prototype,"readTitleFromService",null),r([z("portal-item","title")],re.prototype,"readTitleFromPortalItem",null),r([b({json:{read:!1},value:"annotation-feature",readOnly:!0})],re.prototype,"type",void 0),r([b()],re.prototype,"unplacedAnnotationsVisible",void 0),r([b({type:[Number]})],re.prototype,"visibleLayers",null),re=r([v("esri.layers.AnnotationFeatureLayer")],re);const ie=re;export{ie as default};
|
package/layers/CatalogLayer.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { CustomParametersMixin, CustomParametersMixinProperties } from "./m
|
|
|
15
15
|
import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mixins/DisplayFilteredLayer.js";
|
|
16
16
|
import type { EditBusLayer } from "./mixins/EditBusLayer.js";
|
|
17
17
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
18
|
+
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
18
19
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
19
20
|
import type { OrderedLayer, OrderedLayerProperties } from "./mixins/OrderedLayer.js";
|
|
20
21
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|
|
@@ -672,4 +673,4 @@ export default class CatalogLayer extends CatalogLayerSuperclass {
|
|
|
672
673
|
*/
|
|
673
674
|
queryObjectIds(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise<ObjectId[]>;
|
|
674
675
|
}
|
|
675
|
-
declare const CatalogLayerSuperclass: typeof Layer & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof EditBusLayer & typeof FeatureLayerBase & typeof DisplayFilteredLayer
|
|
676
|
+
declare const CatalogLayerSuperclass: typeof Layer & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof EditBusLayer & typeof FeatureLayerBase & typeof DisplayFilteredLayer & typeof FeatureLayerReload
|
package/layers/CatalogLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Collection.js";import i from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{hasSamePortal as n}from"../core/urlUtils.js";import{property as l,subclass as p}from"../core/accessorSupport/decorators.js";import y from"./Layer.js";import d from"./catalog/CatalogDynamicGroupLayer.js";import u from"./catalog/CatalogFootprintLayer.js";import m from"./graphics/sources/FeatureLayerSource.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as F}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as w}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as j}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as L}from"./mixins/OperationalLayer.js";import{OrderedLayer as v}from"./mixins/OrderedLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{legendEnabled as O,id as E}from"./support/commonProperties.js";import{ensureLayerCredential as T,applyEdits as P,getFeatureType as _,hasDataChanged as C,validateBinsQuery as q}from"./support/featureLayerUtils.js";import A from"./support/FeatureType.js";import{defineFieldProperties as G}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as U}from"./support/versionUtils.js";import Q from"../portal/Portal.js";import B from"../portal/PortalItem.js";import{normalizeArcGISOnlineOrgDomain as D}from"../portal/support/urlUtils.js";import N from"../rest/support/Query.js";const M=G();function R(e){return"object"==typeof e&&null!=e&&"itemId"in e&&"portalUrl"in e}function V(e){return"object"==typeof e&&null!=e&&"url"in e}function J(e){if(null==e)return!0;const t=Object.keys(e);return!t.length||1===t.length&&"id"===t[0]}function k(e,t,r,i){const o=e.write({},i);J(o)||(t[r]=o)}let H=class extends(F(j(w(h(v(I(b(x(f(L(S(s(g(c(y))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField="cd_draworder",this.dynamicGroupLayer=new d({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new u({parent:this}),this.itemNameField="cd_itemname",this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new r([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField="cd_maxscale",this.minScaleField="cd_minscale",this.orderBy=null,this.outFields=null,this.supportedSourceTypes=new Set(["Catalog Layer"]),this.source=new m({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type="catalog",this.typeIdField=null,this.types=null}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(a).then(async()=>{const{url:e,source:r,portalItem:o}=this;if(!e)throw new i("catalog-layer:missing-url","Catalog layer must be created with a url");if(null==this.layerId){const r=await this._fetchFirstValidLayerId(t);if(null==r)throw new i("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:e});this.layerId=r}await r.load({signal:t});const{sourceJSON:s}=r;s&&(this.sourceJSON=s,this.read(s,{origin:"service",portalItem:o,portal:o?.portal,url:this.parsedUrl}))}).then(()=>{const e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter(e=>!this.fieldsIndex.has(e));if(t.length)throw new i("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}).then(()=>T(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}async applyEdits(e,t){return P(this,e,t)}async createLayerFromFootprint(e){const t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new N,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return _(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this.getField(e)?.domain}async hasDataChanged(){return C(this)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(N.from(e)??r.createQuery(),t),o=r.footprintLayer.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r.footprintLayer,s.origin=o;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(N.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(N.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(N.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&U(this,e)}read(e,t){if(super.read(e,t),e){const{footprintLayer:r,dynamicGroupLayer:i}=e;r&&this.footprintLayer.read(r,t),i&&this.dynamicGroupLayer.read(i,t)}}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();q(e,i,"CatalogLayer");const o=await(import("../rest/support/AttributeBinsQuery.js")),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const a of s.features)a.layer=a.sourceLayer=this.footprintLayer;return s}async _fetchFirstValidLayerId(e){const{data:r}=await t(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(this.applyPreferredHost(r),Array.isArray(r?.layers))return r.layers.find(({type:e})=>!!e&&this.supportedSourceTypes.has(e))?.id}async _createLayer(e){const t=e.getAttribute(this.itemSourceField);if(!t)throw new i("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const r=JSON.parse(t);if(R(r)){const{itemId:e,portalUrl:t}=r,i=D(t),s=this.portalItem?.portal,a=Q.getDefault();let l,p=!0;s&&n(t,s.url)?l=s:n(t,a.url)?l=a:(l=o(this._portals,i,()=>new Q({url:i})),p=!1);const d=await y.fromPortalItem(new B({id:e,portal:l}));return p||await K(d),d}if(V(r))return y.fromArcGISServerUrl({url:r.url});const{default:s}=await(import("./UnsupportedLayer.js"));return new s}_configureLayer(e,t){const r=t.getAttribute(this.itemNameField);r&&(e.title=r);const i=t.getAttribute(this.maxScaleField);null!=i&&"maxScale"in e&&(e.maxScale=i);const o=t.getAttribute(this.minScaleField);null!=o&&"minScale"in e&&(e.minScale=o)}};async function K(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,"group"===e.type&&await Promise.allSettled([...e.layers.map(e=>K(e)),...e.tables.map(e=>K(e))])}}e([l(O)],H.prototype,"legendEnabled",void 0),e([l({readOnly:!0})],H.prototype,"createQueryVersion",null),e([l({readOnly:!0})],H.prototype,"drawOrderField",void 0),e([l({type:d,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:k}}})],H.prototype,"dynamicGroupLayer",void 0),e([l({readOnly:!0})],H.prototype,"editingEnabled",null),e([l({readOnly:!0})],H.prototype,"effectiveEditingEnabled",null),e([l({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],H.prototype,"elevationInfo",void 0),e([l({...M.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],H.prototype,"fields",void 0),e([l(M.fieldsIndex)],H.prototype,"fieldsIndex",void 0),e([l({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],H.prototype,"floorInfo",void 0),e([l({type:u,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:k}}})],H.prototype,"footprintLayer",void 0),e([l(E)],H.prototype,"id",void 0),e([l({readOnly:!0})],H.prototype,"itemNameField",void 0),e([l({readOnly:!0})],H.prototype,"itemSourceField",void 0),e([l({readOnly:!0})],H.prototype,"itemTypeField",void 0),e([l({readOnly:!0})],H.prototype,"layers",void 0),e([l({type:["show","hide","hide-children"]})],H.prototype,"listMode",void 0),e([l({readOnly:!0})],H.prototype,"maxScaleField",void 0),e([l({readOnly:!0})],H.prototype,"minScaleField",void 0),e([l({value:"CatalogLayer",type:["CatalogLayer"]})],H.prototype,"operationalLayerType",void 0),e([l({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],H.prototype,"orderBy",void 0),e([l(M.outFields)],H.prototype,"outFields",void 0),e([l({readOnly:!0})],H.prototype,"source",void 0),e([l({json:{read:!1}})],H.prototype,"type",void 0),e([l({type:String})],H.prototype,"typeIdField",void 0),e([l({type:[A]})],H.prototype,"types",void 0),H=e([p("esri.layers.CatalogLayer")],H);const W=H;export{W as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Collection.js";import i from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{hasSamePortal as n}from"../core/urlUtils.js";import{property as l,subclass as p}from"../core/accessorSupport/decorators.js";import y from"./Layer.js";import d from"./catalog/CatalogDynamicGroupLayer.js";import u from"./catalog/CatalogFootprintLayer.js";import m from"./graphics/sources/FeatureLayerSource.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as F}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as w}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as j}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as S}from"./mixins/OrderedLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as O}from"./mixins/TemporalLayer.js";import{legendEnabled as _,id as P}from"./support/commonProperties.js";import{ensureLayerCredential as T,applyEdits as E,getFeatureType as C,hasDataChanged as q,validateBinsQuery as A}from"./support/featureLayerUtils.js";import G from"./support/FeatureType.js";import{defineFieldProperties as U}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as Q}from"./support/versionUtils.js";import B from"../portal/Portal.js";import D from"../portal/PortalItem.js";import{normalizeArcGISOnlineOrgDomain as N}from"../portal/support/urlUtils.js";import M from"../rest/support/Query.js";const R=U();function V(e){return"object"==typeof e&&null!=e&&"itemId"in e&&"portalUrl"in e}function J(e){return"object"==typeof e&&null!=e&&"url"in e}function k(e){if(null==e)return!0;const t=Object.keys(e);return!t.length||1===t.length&&"id"===t[0]}function H(e,t,r,i){const o=e.write({},i);k(o)||(t[r]=o)}let K=class extends(j(F(L(w(h(S(O(b(I(f(v(x(s(g(c(y)))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField="cd_draworder",this.dynamicGroupLayer=new d({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new u({parent:this}),this.itemNameField="cd_itemname",this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new r([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField="cd_maxscale",this.minScaleField="cd_minscale",this.orderBy=null,this.outFields=null,this.supportedPortalItemTypes=["Feature Service"],this.supportedSourceTypes=new Set(["Catalog Layer"]),this.source=new m({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type="catalog",this.typeIdField=null,this.types=null}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(a).then(async()=>{const{url:e,source:r}=this;if(!e)throw new i("catalog-layer:missing-url","Catalog layer must be created with a url");if(null==this.layerId){const r=await this._fetchFirstValidLayerId(t);if(null==r)throw new i("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:e});this.layerId=r}await r.load({signal:t}),this._initLayerProperties(),this._verifyFields()}).then(()=>T(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}async applyEdits(e,t){return E(this,e,t)}async createLayerFromFootprint(e){const t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new M,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return C(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this.getField(e)?.domain}async reloadFromService(e){await this.source.reload({signal:e}),this._initLayerProperties(),this._verifyFields()}async hasDataChanged(){return q(this)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(M.from(e)??r.createQuery(),t),o=r.footprintLayer.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r.footprintLayer,s.origin=o;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(M.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(M.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(M.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&Q(this,e)}read(e,t){if(super.read(e,t),e){const{footprintLayer:r,dynamicGroupLayer:i}=e;r&&this.footprintLayer.read(r,t),i&&this.dynamicGroupLayer.read(i,t)}}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();A(e,i,"CatalogLayer");const o=await(import("../rest/support/AttributeBinsQuery.js")),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const a of s.features)a.layer=a.sourceLayer=this.footprintLayer;return s}_initLayerProperties(){const{portalItem:e,source:t}=this,{sourceJSON:r}=t;r&&(this.sourceJSON=r,this.read(r,{origin:"service",portalItem:e,portal:e?.portal,url:this.parsedUrl}))}_verifyFields(){const e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter(e=>!this.fieldsIndex.has(e));if(t.length)throw new i("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}async _fetchFirstValidLayerId(e){const{data:r}=await t(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(this.applyPreferredHost(r),Array.isArray(r?.layers))return r.layers.find(({type:e})=>!!e&&this.supportedSourceTypes.has(e))?.id}async _createLayer(e){const t=e.getAttribute(this.itemSourceField);if(!t)throw new i("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const r=JSON.parse(t);if(V(r)){const{itemId:e,portalUrl:t}=r,i=N(t),s=this.portalItem?.portal,a=B.getDefault();let l,p=!0;s&&n(t,s.url)?l=s:n(t,a.url)?l=a:(l=o(this._portals,i,()=>new B({url:i})),p=!1);const d=await y.fromPortalItem(new D({id:e,portal:l}));return p||await W(d),d}if(J(r))return y.fromArcGISServerUrl({url:r.url});const{default:s}=await(import("./UnsupportedLayer.js"));return new s}_configureLayer(e,t){const r=t.getAttribute(this.itemNameField);r&&(e.title=r);const i=t.getAttribute(this.maxScaleField);null!=i&&"maxScale"in e&&(e.maxScale=i);const o=t.getAttribute(this.minScaleField);null!=o&&"minScale"in e&&(e.minScale=o)}};async function W(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,"group"===e.type&&await Promise.allSettled([...e.layers.map(e=>W(e)),...e.tables.map(e=>W(e))])}}e([l(_)],K.prototype,"legendEnabled",void 0),e([l({readOnly:!0})],K.prototype,"createQueryVersion",null),e([l({readOnly:!0})],K.prototype,"drawOrderField",void 0),e([l({type:d,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:H}}})],K.prototype,"dynamicGroupLayer",void 0),e([l({readOnly:!0})],K.prototype,"editingEnabled",null),e([l({readOnly:!0})],K.prototype,"effectiveEditingEnabled",null),e([l({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],K.prototype,"elevationInfo",void 0),e([l({...R.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],K.prototype,"fields",void 0),e([l(R.fieldsIndex)],K.prototype,"fieldsIndex",void 0),e([l({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],K.prototype,"floorInfo",void 0),e([l({type:u,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:H}}})],K.prototype,"footprintLayer",void 0),e([l(P)],K.prototype,"id",void 0),e([l({readOnly:!0})],K.prototype,"itemNameField",void 0),e([l({readOnly:!0})],K.prototype,"itemSourceField",void 0),e([l({readOnly:!0})],K.prototype,"itemTypeField",void 0),e([l({readOnly:!0})],K.prototype,"layers",void 0),e([l({type:["show","hide","hide-children"]})],K.prototype,"listMode",void 0),e([l({readOnly:!0})],K.prototype,"maxScaleField",void 0),e([l({readOnly:!0})],K.prototype,"minScaleField",void 0),e([l({value:"CatalogLayer",type:["CatalogLayer"]})],K.prototype,"operationalLayerType",void 0),e([l({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],K.prototype,"orderBy",void 0),e([l(R.outFields)],K.prototype,"outFields",void 0),e([l({readOnly:!0})],K.prototype,"source",void 0),e([l({json:{read:!1}})],K.prototype,"type",void 0),e([l({type:String})],K.prototype,"typeIdField",void 0),e([l({type:[G]})],K.prototype,"types",void 0),K=e([p("esri.layers.CatalogLayer")],K);const $=K;export{$ as default};
|
|
@@ -14,6 +14,7 @@ import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
|
|
|
14
14
|
import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
|
|
15
15
|
import type { EditBusLayerEvents } from "./mixins/EditBusLayer.js";
|
|
16
16
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
17
|
+
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
17
18
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
18
19
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|
|
19
20
|
import type { RefreshableLayer, RefreshableLayerEvents, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
|
|
@@ -380,4 +381,4 @@ export default class DimensionFeatureLayer extends DimensionFeatureLayerSupercla
|
|
|
380
381
|
*/
|
|
381
382
|
saveAs(portalItem: PortalItemProperties, options?: LayerSaveAsOptions): Promise<PortalItem>;
|
|
382
383
|
}
|
|
383
|
-
declare const DimensionFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase
|
|
384
|
+
declare const DimensionFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase & typeof FeatureLayerReload
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import i from"../PopupTemplate.js";import
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import i from"../PopupTemplate.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Error.js";import{disposable as n,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{debounce as u,throwIfAbortError as d,whenOrAbort as m,onAbort as c}from"../core/promiseUtils.js";import{property as y,subclass as h}from"../core/accessorSupport/decorators.js";import f from"../geometry/SpatialReference.js";import v from"../graphic/DimensionFeatureGraphicOrigin.js";import E from"./Layer.js";import{APIKeyMixin as T}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{BlendLayer as S}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as j}from"./mixins/DataElementMixin.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as b}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as F}from"./mixins/TemporalLayer.js";import{parse as M,cleanTitle as x,titleFromUrlAndName as N}from"./support/arcgisLayerUrl.js";import{barrierWeight as G,id as A,popupEnabled as X}from"./support/commonProperties.js";import{ensureLayerCredential as Y,createQuery as U,getFieldDomain as R,hasDataChanged as q}from"./support/featureLayerUtils.js";import{defineFieldProperties as C}from"./support/fieldProperties.js";import{fixTimeInfoFields as _}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as H}from"./support/versionUtils.js";import B from"../rest/support/Query.js";import{createPopupTemplate as Q}from"../support/popupUtils.js";import{reader as J}from"../core/accessorSupport/decorators/reader.js";const $="dimension-feature-layer",k=C();let K=class extends(b(j(L(S(F(O(P(g(w(D(p(I(T(o(E))))))))))))))){constructor(e){super(e),this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new v(this),this.operationalLayerType="ArcGISDimensionLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.styleCollection=null,this.sublayerTitleMode="item-title",this.supportedPortalItemTypes=["Feature Service"],this.supportedSourceTypes=new Set(["Dimension Layer"]),this.symbolFields=["STYLEID","BEGINX","BEGINY","ENDX","ENDY","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","DIMX","DIMY","TEXTX","TEXTY","DIMLENGTH","DIMTYPE","EXTANGLE","TEXTANGLE","USECUSTOMLENGTH","CUSTOMLENGTH "],this.type="dimension-feature",this._debouncedSaveOperations=u(async(e,r,t)=>{const{save:i,saveAs:s}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,r);case 1:return s(this,t,r)}})}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new a(`${$}:missing-url`,"DimensionFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.styleCollection)throw new a(`${$}:missing-style-collection`,"Invalid service with no style collection")}),this.initLayerProperties(await this.createGraphicsSource(r))])}).then(()=>Y(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readTitleFromService(e,r){const{url:t}=this,i=r.name||M(t)?.title;switch(this.sublayerTitleMode){case"item-title":if(t)return N(t,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=x(e),i?`${e} - ${x(i)}`:e;break}}return i?x(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}createPopupTemplate(e){return Q(this,e)}async createGraphicsSource(t){const i={stack:[],error:void 0,hasError:!1};try{const{default:r}=await m(import("./graphics/sources/FeatureLayerSource.js"),t),s=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,n(c(t,()=>s.cancelLoad())??l()),!1);return await s.load({signal:t}),s}catch(s){i.error=s,i.hasError=!0}finally{r(i)}}createQuery(){const e=U(this);return e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,r){return R(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),i=await t.source.queryFeatures(B.from(e)??t.createQuery(),r),s=this.graphicOrigin;if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=t,o.origin=s;return i}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(B.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(B.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(B.from(e)??t.createQuery(),r)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return this.loaded&&H(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),_(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){const r=this.source;await Promise.all([r.reload({signal:e}),this.loadDataElement({signal:e})]),await this.initLayerProperties(r)}async hasDataChanged(){return q(this)}_verifySource(){if(this.version&&this.version<10.8)throw new a($+":unsupported-version","The feature service must be version 10.8 or above.");const e=["DIMLENGTH","BEGINX","BEGINY","ENDX","ENDY","DIMX","DIMY","TEXTX","TEXTY","DIMTYPE","EXTANGLE","STYLEID","USECUSTOMLENGTH","CUSTOMLENGTH","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","TEXTANGLE"],r=e.filter(e=>!this.fieldsIndex.has(e));if(r.length)throw new a($+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:r})}_fetchFirstValidLayerId(e){return s(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}};t([y({type:f,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],K.prototype,"attributeSpatialReference",void 0),t([y(G)],K.prototype,"barrierWeight",void 0),t([y({nonNullable:!0,json:{name:"enableEditing",write:!0}})],K.prototype,"editingEnabled",null),t([y({readOnly:!0})],K.prototype,"effectiveEditingEnabled",null),t([y({...k.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],K.prototype,"fields",void 0),t([y(k.fieldsIndex)],K.prototype,"fieldsIndex",void 0),t([y({readOnly:!0,clonable:!1})],K.prototype,"graphicOrigin",void 0),t([y(A)],K.prototype,"id",void 0),t([y({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],K.prototype,"listMode",void 0),t([y({type:["ArcGISDimensionLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],K.prototype,"operationalLayerType",void 0),t([y(k.outFields)],K.prototype,"outFields",void 0),t([y(X)],K.prototype,"popupEnabled",void 0),t([y({type:i,json:{name:"popupInfo",write:!0}})],K.prototype,"popupTemplate",void 0),t([y({readOnly:!0})],K.prototype,"defaultPopupTemplate",null),t([y({readOnly:!0})],K.prototype,"referenceScale",void 0),t([y({clonable:!1,readOnly:!0})],K.prototype,"source",void 0),t([y()],K.prototype,"styleCollection",void 0),t([y({type:String})],K.prototype,"sublayerTitleMode",void 0),t([y({readOnly:!0})],K.prototype,"symbolFields",void 0),t([J("service","title",["name"])],K.prototype,"readTitleFromService",null),t([J("portal-item","title")],K.prototype,"readTitleFromPortalItem",null),t([y({json:{read:!1},value:"dimension-feature",readOnly:!0})],K.prototype,"type",void 0),K=t([h("esri.layers.DimensionFeatureLayer")],K);const V=K;export{V as default};
|
package/layers/FeatureLayer.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mix
|
|
|
32
32
|
import type { EditBusLayer, EditBusLayerEvents } from "./mixins/EditBusLayer.js";
|
|
33
33
|
import type { FeatureEffectLayer, FeatureEffectLayerProperties } from "./mixins/FeatureEffectLayer.js";
|
|
34
34
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
35
|
+
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
35
36
|
import type { FeatureReductionLayer, FeatureReductionLayerProperties } from "./mixins/FeatureReductionLayer.js";
|
|
36
37
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
37
38
|
import type { OrderedLayer, OrderedLayerProperties } from "./mixins/OrderedLayer.js";
|
|
@@ -1196,22 +1197,6 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
|
|
|
1196
1197
|
* layer.refreshInterval = 1;
|
|
1197
1198
|
*/
|
|
1198
1199
|
accessor refreshInterval: number;
|
|
1199
|
-
/**
|
|
1200
|
-
* Indicates if the layer is in the process of reloading its properties and schema, after a call to `reload()`.
|
|
1201
|
-
*
|
|
1202
|
-
* During the reload process, the layer properties are updated in parallel at different times, and may not be in sync for a brief moment.
|
|
1203
|
-
* For example, the layer's [renderer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#renderer) may reference a field not yet available in the [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fields) array.
|
|
1204
|
-
*
|
|
1205
|
-
* @default false
|
|
1206
|
-
* @since 5.1
|
|
1207
|
-
* @see [reload()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#reload)
|
|
1208
|
-
* @example
|
|
1209
|
-
* layer.reload();
|
|
1210
|
-
*
|
|
1211
|
-
* // Wait for a stable state.
|
|
1212
|
-
* await whenOnce(() => !layer.reloading);
|
|
1213
|
-
*/
|
|
1214
|
-
get reloading(): boolean;
|
|
1215
1200
|
/**
|
|
1216
1201
|
* The renderer assigned to the layer. The renderer defines how to
|
|
1217
1202
|
* visualize each feature in the layer. Depending on the renderer type,
|
|
@@ -2142,19 +2127,6 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
|
|
|
2142
2127
|
* @see [refresh event](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/RefreshableLayer/#event-refresh)
|
|
2143
2128
|
*/
|
|
2144
2129
|
refresh(): void;
|
|
2145
|
-
/**
|
|
2146
|
-
* Reloads the layer's schema and properties from its [portalItem](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#portalItem), provided the layer was created from an ArcGIS portal item.
|
|
2147
|
-
*
|
|
2148
|
-
* Returns `true` when the layer is successfully updated with data from the portal item or service.
|
|
2149
|
-
* Returns `false` when the layer is not updated, not loaded, or composed of client-side features.
|
|
2150
|
-
*
|
|
2151
|
-
* This method is debounced to prevent redundant, concurrent network requests.
|
|
2152
|
-
* If called while an update is already in progress, a single subsequent execution is queued,
|
|
2153
|
-
* and any other intermediate calls are discarded.
|
|
2154
|
-
*
|
|
2155
|
-
* @since 5.1
|
|
2156
|
-
*/
|
|
2157
|
-
reload(): Promise<boolean>;
|
|
2158
2130
|
/**
|
|
2159
2131
|
* Saves the layer to its existing portal item in the [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/)
|
|
2160
2132
|
* authenticated within the user's current session. If the layer is not saved to a
|
|
@@ -2207,4 +2179,4 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
|
|
|
2207
2179
|
*/
|
|
2208
2180
|
updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData, options?: AttachmentEditOptions): Promise<FeatureEditResult>;
|
|
2209
2181
|
}
|
|
2210
|
-
declare const FeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TrackableLayer & typeof DataSeriesLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof DisplayFilteredLayer & typeof EditBusLayer & typeof PublishableLayer & typeof FeatureEffectLayer & typeof FeatureReductionLayer & typeof FeatureLayerBase
|
|
2182
|
+
declare const FeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TrackableLayer & typeof DataSeriesLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof DisplayFilteredLayer & typeof EditBusLayer & typeof PublishableLayer & typeof FeatureEffectLayer & typeof FeatureReductionLayer & typeof FeatureLayerBase & typeof FeatureLayerReload
|