@arcgis/core 5.2.0-next.111 → 5.2.0-next.112
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/assets/components/assets/icon/alignBottom16.json +1 -0
- package/assets/components/assets/icon/alignBottom24.json +1 -0
- package/assets/components/assets/icon/alignBottom32.json +1 -0
- package/assets/components/assets/icon/alignCenterHorizontal16.json +1 -0
- package/assets/components/assets/icon/alignCenterHorizontal24.json +1 -0
- package/assets/components/assets/icon/alignCenterHorizontal32.json +1 -0
- package/assets/components/assets/icon/alignCenterVertical16.json +1 -0
- package/assets/components/assets/icon/alignCenterVertical24.json +1 -0
- package/assets/components/assets/icon/alignCenterVertical32.json +1 -0
- package/assets/components/assets/icon/alignLeft16.json +1 -0
- package/assets/components/assets/icon/alignLeft24.json +1 -0
- package/assets/components/assets/icon/alignLeft32.json +1 -0
- package/assets/components/assets/icon/alignRight16.json +1 -0
- package/assets/components/assets/icon/alignRight24.json +1 -0
- package/assets/components/assets/icon/alignRight32.json +1 -0
- package/assets/components/assets/icon/alignTop16.json +1 -0
- package/assets/components/assets/icon/alignTop24.json +1 -0
- package/assets/components/assets/icon/alignTop32.json +1 -0
- package/assets/components/assets/icon/columnGroup16.json +1 -0
- package/assets/components/assets/icon/columnGroup24.json +1 -0
- package/assets/components/assets/icon/columnGroup32.json +1 -0
- package/assets/components/assets/icon/columnRemove16.json +1 -0
- package/assets/components/assets/icon/columnRemove24.json +1 -0
- package/assets/components/assets/icon/columnRemove32.json +1 -0
- package/assets/components/assets/icon/columnUngroup16.json +1 -0
- package/assets/components/assets/icon/columnUngroup24.json +1 -0
- package/assets/components/assets/icon/columnUngroup32.json +1 -0
- package/assets/components/assets/icon/envelopeOpen16.json +1 -0
- package/assets/components/assets/icon/envelopeOpen24.json +1 -0
- package/assets/components/assets/icon/envelopeOpen32.json +1 -0
- package/assets/components/assets/icon/handDraw16.json +1 -0
- package/assets/components/assets/icon/handDraw24.json +1 -0
- package/assets/components/assets/icon/handDraw32.json +1 -0
- package/assets/components/assets/icon/monitorShare16.json +1 -0
- package/assets/components/assets/icon/monitorShare24.json +1 -0
- package/assets/components/assets/icon/monitorShare32.json +1 -0
- package/assets/components/assets/icon/pi16.json +1 -0
- package/assets/components/assets/icon/pi24.json +1 -0
- package/assets/components/assets/icon/pi32.json +1 -0
- package/assets/components/assets/icon/rowGroup16.json +1 -0
- package/assets/components/assets/icon/rowGroup24.json +1 -0
- package/assets/components/assets/icon/rowGroup32.json +1 -0
- package/assets/components/assets/icon/rowRemove16.json +1 -0
- package/assets/components/assets/icon/rowRemove24.json +1 -0
- package/assets/components/assets/icon/rowRemove32.json +1 -0
- package/assets/components/assets/icon/rowUngroup16.json +1 -0
- package/assets/components/assets/icon/rowUngroup24.json +1 -0
- package/assets/components/assets/icon/rowUngroup32.json +1 -0
- package/assets/components/assets/icon/sdCard16.json +1 -0
- package/assets/components/assets/icon/sdCard24.json +1 -0
- package/assets/components/assets/icon/sdCard32.json +1 -0
- package/assets/components/assets/icon/spaceAroundHorizontal16.json +1 -0
- package/assets/components/assets/icon/spaceAroundHorizontal24.json +1 -0
- package/assets/components/assets/icon/spaceAroundHorizontal32.json +1 -0
- package/assets/components/assets/icon/spaceAroundVertical16.json +1 -0
- package/assets/components/assets/icon/spaceAroundVertical24.json +1 -0
- package/assets/components/assets/icon/spaceAroundVertical32.json +1 -0
- package/assets/components/assets/icon/spaceBetweenHorizontal16.json +1 -0
- package/assets/components/assets/icon/spaceBetweenHorizontal24.json +1 -0
- package/assets/components/assets/icon/spaceBetweenHorizontal32.json +1 -0
- package/assets/components/assets/icon/spaceBetweenVertical16.json +1 -0
- package/assets/components/assets/icon/spaceBetweenVertical24.json +1 -0
- package/assets/components/assets/icon/spaceBetweenVertical32.json +1 -0
- package/assets/components/assets/icon/spacedEvenlyHorizontal16.json +1 -0
- package/assets/components/assets/icon/spacedEvenlyHorizontal24.json +1 -0
- package/assets/components/assets/icon/spacedEvenlyHorizontal32.json +1 -0
- package/assets/components/assets/icon/spacedEvenlyVertical16.json +1 -0
- package/assets/components/assets/icon/spacedEvenlyVertical24.json +1 -0
- package/assets/components/assets/icon/spacedEvenlyVertical32.json +1 -0
- package/assets/components/assets/icon/stretchHorizontal16.json +1 -0
- package/assets/components/assets/icon/stretchHorizontal24.json +1 -0
- package/assets/components/assets/icon/stretchHorizontal32.json +1 -0
- package/assets/components/assets/icon/stretchVertical16.json +1 -0
- package/assets/components/assets/icon/stretchVertical24.json +1 -0
- package/assets/components/assets/icon/stretchVertical32.json +1 -0
- package/assets/components/assets/icon/swatchPalette16.json +1 -0
- package/assets/components/assets/icon/swatchPalette24.json +1 -0
- package/assets/components/assets/icon/swatchPalette32.json +1 -0
- package/assets/components/assets/icon/thermometer16.json +1 -0
- package/assets/components/assets/icon/thermometer24.json +1 -0
- package/assets/components/assets/icon/thermometer32.json +1 -0
- package/assets/components/assets/icon/webCamera16.json +1 -0
- package/assets/components/assets/icon/webCamera24.json +1 -0
- package/assets/components/assets/icon/webCamera32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/078ed48eb055dd213ee6.js +1 -0
- package/assets/esri/core/workers/chunks/186350d720352bd5ff33.js +1 -0
- package/assets/esri/core/workers/chunks/21c0743b2f612e7e7de3.js +1 -0
- package/assets/esri/core/workers/chunks/25cc6d7178a52f2f46b7.js +1 -0
- package/assets/esri/core/workers/chunks/{6010799e05d239073de0.js → 25ecf94d776c3b6db0f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{10d33b4f248864225f85.js → 2728eda8178e02fbca47.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c9df8ae9238454969b8.js → 2c21f4744e19b925a6ae.js} +1 -1
- package/assets/esri/core/workers/chunks/32fc7d1db4b311f6b880.js +1 -0
- package/assets/esri/core/workers/chunks/3acc1299c1382c3b034d.js +1 -0
- package/assets/esri/core/workers/chunks/{c2684fcde2923c9830e0.js → 42c4d0c1c08bf111e5a4.js} +1 -1
- package/assets/esri/core/workers/chunks/430802108b63194b7ddd.js +2 -0
- package/assets/esri/core/workers/chunks/{f5e8ccbd6b4c0a386903.js → 448f068a14f24f2f8a43.js} +1 -1
- package/assets/esri/core/workers/chunks/49c6dc487714f9cd55c7.js +1 -0
- package/assets/esri/core/workers/chunks/{70e0ead69a722fd964b8.js → 49e8ff5ed079a9e3be4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{69921d068add041b5dcb.js → 5134241be1f1bf25231a.js} +1 -1
- package/assets/esri/core/workers/chunks/{54bb3678570ca032f051.js → 5762746cfb02a4119d82.js} +1 -1
- package/assets/esri/core/workers/chunks/{434c5b54e89ace974cbd.js → 5965a947f68b707eaa6b.js} +2 -2
- package/assets/esri/core/workers/chunks/6c25c929bcde7e3a2af1.js +1 -0
- package/assets/esri/core/workers/chunks/7610dd0b46948b7bd840.js +1 -0
- package/assets/esri/core/workers/chunks/7be56ac60e580c806a5d.js +1 -0
- package/assets/esri/core/workers/chunks/7f2ac03efaa4a4898ba2.js +2 -0
- package/assets/esri/core/workers/chunks/{847781aefed049493444.js → 9f760dc4492a03e0504c.js} +1 -1
- package/assets/esri/core/workers/chunks/{013c9cc198736a72f7f2.js → 9fb46ccd4be4c3b61c31.js} +1 -1
- package/assets/esri/core/workers/chunks/bdcca906fdfb8e179abb.js +2 -0
- package/assets/esri/core/workers/chunks/c5ceceb0683671f92efa.js +1 -0
- package/assets/esri/core/workers/chunks/c5e288d57bacb8451e2d.js +2 -0
- package/assets/esri/core/workers/chunks/{b92b7d6c1e693c97a3eb.js → d1f54b0079fb71a15612.js} +1 -1
- package/assets/esri/core/workers/chunks/{72be81c1394285b51ed3.js → d45483dd0dc2853b18b7.js} +212 -216
- package/assets/esri/core/workers/chunks/d5e3f8e5b8d2576d3cb3.js +2 -0
- package/assets/esri/core/workers/chunks/{21d4219844ae5654618b.js → d926bffc3ff9f87e9081.js} +1 -1
- package/assets/esri/core/workers/chunks/{abcda435bc83ef4240f9.js → e6dae16208f6978b59e0.js} +1 -1
- package/assets/esri/core/workers/chunks/e755075ac2e02e881fad.js +1 -0
- package/assets/esri/core/workers/chunks/{058d4c927486a361e633.js → ea9e770efc85594e4dd2.js} +1 -1
- package/assets/esri/core/workers/chunks/eff99e45d818e58fd443.js +1 -0
- package/assets/esri/core/workers/chunks/{a49147203e55609630cc.js → f453dc4a075d2f900c7d.js} +1 -1
- package/assets/esri/core/workers/chunks/f465fb26541372fdc908.js +2 -0
- package/assets/esri/core/workers/chunks/{b7809ef3e1dabd921339.js → f72f4413fc7461e11a2a.js} +1 -1
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +1 -0
- package/assets/esri/themes/base/widgets/_Bookmarks.scss +1 -0
- 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/ChapmanAtmosphere.glsl.js +1 -1
- package/chunks/Component.glsl.js +57 -56
- package/chunks/DefaultMaterial.glsl.js +19 -23
- package/chunks/GaussianSplat.glsl.js +13 -11
- package/chunks/GlobalIllumination.glsl.js +1 -1
- package/chunks/Haze.glsl.js +1 -1
- package/chunks/Path.glsl.js +21 -24
- package/chunks/RealisticTree.glsl.js +42 -41
- package/chunks/RibbonLine.glsl.js +65 -56
- package/chunks/SimpleAtmosphere.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +25 -25
- package/chunks/Water.glsl.js +4 -4
- package/config.js +1 -1
- package/core/units.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/mixins/TiledImagery.d.ts +6 -0
- package/layers/mixins/TiledImagery.js +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/RasterFactory.js +1 -1
- package/layers/support/domainUtils.d.ts +2 -0
- package/layers/support/domainUtils.js +1 -1
- package/layers/support/fieldUtils.d.ts +10 -0
- package/layers/support/fieldUtils.js +1 -1
- package/package.json +6 -6
- package/support/revision.js +1 -1
- package/symbols/LineStyleMarker3D.d.ts +3 -4
- package/symbols/LineSymbol3D.d.ts +19 -2
- package/symbols/LineSymbol3D.js +1 -1
- package/symbols/LineSymbol3DLayer.d.ts +13 -6
- package/symbols/Symbol3DLayer.d.ts +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/clipping.js +2 -0
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/input/handlers/KeyPan.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +57 -58
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +5 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +7 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +5 -10
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +10 -48
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +16 -22
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +5 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/pbrGlobals.glsl.js +19 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/pbrShadingInfo.glsl.js +24 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js +4 -4
- package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/VisualVariablePassParameters.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +19 -22
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechniqueConfiguration.js +1 -1
- package/views/MapView.d.ts +1 -0
- package/views/SceneView.d.ts +1 -0
- package/views/View.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/MultipleChoiceController.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Search/LocatorSearchSource.d.ts +4 -3
- package/widgets/support/forms/formUtils.d.ts +5 -0
- package/widgets/support/forms/formUtils.js +1 -1
- package/widgets/support/forms/types.d.ts +7 -1
- package/assets/esri/core/workers/chunks/075eb62465edb9cbf907.js +0 -1
- package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +0 -1
- package/assets/esri/core/workers/chunks/1082bb0858585bd4fa21.js +0 -2
- package/assets/esri/core/workers/chunks/19ac6f4664f97fb3821c.js +0 -1
- package/assets/esri/core/workers/chunks/1ec01fd6330d011c76d6.js +0 -1
- package/assets/esri/core/workers/chunks/2e2349387a2b9903f13c.js +0 -2
- package/assets/esri/core/workers/chunks/349e9f3d3e3267d02988.js +0 -1
- package/assets/esri/core/workers/chunks/3ffc852db1a820ed143b.js +0 -1
- package/assets/esri/core/workers/chunks/411bbdecba340df11d95.js +0 -2
- package/assets/esri/core/workers/chunks/4490dd8bae0dd2769d99.js +0 -1
- package/assets/esri/core/workers/chunks/476535cfb06ced74d611.js +0 -2
- package/assets/esri/core/workers/chunks/5e56a004b4407b8066eb.js +0 -1
- package/assets/esri/core/workers/chunks/6df29716f75696434807.js +0 -1
- package/assets/esri/core/workers/chunks/a322afbb48898ce35851.js +0 -1
- package/assets/esri/core/workers/chunks/b82b523b6837ed1f28d3.js +0 -2
- package/assets/esri/core/workers/chunks/c7b762bae945f383c723.js +0 -1
- package/assets/esri/core/workers/chunks/ef24fd6c0322e5de9fdf.js +0 -2
- package/assets/esri/core/workers/chunks/f9e5740b05de24ba81be.js +0 -1
- package/assets/esri/core/workers/chunks/fc622f9e33e3b48113c8.js +0 -1
- /package/assets/esri/core/workers/chunks/{476535cfb06ced74d611.js.LICENSE.txt → 430802108b63194b7ddd.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b82b523b6837ed1f28d3.js.LICENSE.txt → 7f2ac03efaa4a4898ba2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{ef24fd6c0322e5de9fdf.js.LICENSE.txt → bdcca906fdfb8e179abb.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{1082bb0858585bd4fa21.js.LICENSE.txt → c5e288d57bacb8451e2d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2e2349387a2b9903f13c.js.LICENSE.txt → d5e3f8e5b8d2576d3cb3.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{411bbdecba340df11d95.js.LICENSE.txt → f465fb26541372fdc908.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{getDomainRange as l}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as o}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as s,isString as a}from"../../support/guards.js";import{loadArcade as u}from"../../support/loadArcade.js";const f=/^([0-9_])/,c=/[^a-z0-9_\u0080-\uffff]+/gi;function d(e){if(null==e)return null;return e.trim().replaceAll(c,"_").replace(f,"F$1")||null}const p=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],m=["field","normalizationField"];function y(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(g(p,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)g(m,e,n)}function g(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&"function"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function F(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const b=new Set;function I(e,n){return e&&n?(b.clear(),w(b,e,n),Array.from(b).sort()):[]}function w(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)x(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function x(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function T(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map(e=>e.name):n}function h(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=I(e,n);return t.length/e.fields.length>=i?["*"]:t}async function v(e,n,i,t){if(!t)return;const r=o(t);if(r)x(e,n,r);else{const{arcadeUtils:r}=await u(),l=r.extractFieldNames(t,i?.partitions??n?.fields?.map(e=>e.name));for(const t of l)x(e,i?.index??n,t)}}async function S(n,i,t){if(t&&"1=1"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});w(n,i,l.fieldNames)}}function E({displayField:e,fields:n}){return e||(n?.length?A(n):null)}function A(e){return _(e,"name-or-title")||_(e,"unique-identifier")||_(e,"type-or-category")||$(e)}function $(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function _(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function N(e){if(!e)return[];const n=new Set;return await L(n,e),Array.from(n).sort()}async function L(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function M(e,n,i){i.onStatisticExpression?v(e,n,null,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function j(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(O(e,n,r)),i.fields&&t.push(...i.fields.map(async i=>M(e,n.fieldsIndex,i))),await Promise.all(t)}async function D(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(O(e,n,t.popupTemplate));for(const l of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(l)for(const n of l)r.push(ee(e,i,n));await Promise.all(r)}async function O(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map(i=>v(e,n.fieldsIndex,null,i.expression)));const r=i?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&t.push(v(e,n.fieldsIndex,null,l.expressionInfo.expression));await Promise.all(t)}async function C(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&w(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&w(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await S(e,n.fieldsIndex,i.where))}async function R(e,n,i){n&&i&&await Promise.all(i.map(i=>V(e,n,i)))}async function V(e,n,i){n&&i&&(i.valueExpression?await v(e,n.fieldsIndex,null,i.valueExpression):i.field&&x(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?I(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function U(e){return e?I(e.fieldsIndex,J(e)):[]}function q(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?I(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function z(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map(n=>S(e,t,n.where)))}const X=new Set(["oid","global-id","guid"]),P=new Set(["oid","global-id"]),B=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/objectid/i,/^perimeter_/i,/_perimeter$/i,/_i$/i];function G(e){const n=new Set;W(e).forEach(e=>n.add(e)),q(e).forEach(e=>n.add(e.toLowerCase()));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach(e=>n.add(e.toLowerCase())),Object.values(i.transformFieldRoles).forEach(e=>n.add(e.toLowerCase()))),Array.from(n)}function J(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function W(e){return J(e).map(e=>e.toLowerCase())}function H(e){return!!e.type}function K(e,n){return!!e.editable&&H(e)&&!X.has(e.type)&&!W(n).includes(e.name?.toLowerCase()??"")}function Q(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||G(n).includes(i)||P.has(e.type)||B.some(e=>e.test(i)))}async function Y(e){if(!e)return[];const n=new Set;return await Z(n,e),Array.from(n).sort()}async function Z(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map(n=>ee(e,t,n)))}async function ee(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await v(e,n,null,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach(i=>{x(e,n,i.slice(1,-1))})}await S(e,n,r)}function ne(e){const n=e.defaultValue;return void 0!==n&&se(e,n)?n:e.nullable?null:void 0}function ie(e){const n="string"==typeof e?{type:e}:e;return be(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function te(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function re(e){return null===e||te(e)}function le(e){return null===e||Number.isInteger(e)}function oe(){return!0}function se(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?le:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?re:te;break;case"string":case"esriFieldTypeString":i=e.nullable?s:a;break;default:i=oe}return 1===arguments.length?i:i(n)}const ae=["integer","small-integer","big-integer","long"],ue=["single","double"],fe=[...ae,...ue],ce=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeLong","esriFieldTypeBigInteger"],de=["esriFieldTypeSingle","esriFieldTypeDouble"],pe=new Set([...ae,...ce]),me=new Set([...ue,...de]),ye=t(pe,me);function ge(e){return null!=e&&pe.has(e.type)}function Fe(e){return null!=e&&ye.has(e.type)}function be(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Ie(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function we(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function xe(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function Te(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function he(e){return null!=e&&("date"===e.type||"date-only"===e.type||"time-only"===e.type||"timestamp-offset"===e.type)}function ve(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function Se(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function Ee(e,n){return null===_e(e,n)}function Ae(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function $e(e){return parseFloat(e.replaceAll("_",""))}function _e(e,n){return null==e||e.nullable&&null===n?null:se(e,n)?Fe(e)&&!Ne(e.type,Number(n))?"numeric-range-validation-error::out-of-range":null:"type-validation-error::invalid-type"}function Ne(e,n){const i="string"==typeof e?Me(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function Le(e,n){const i=l(e,n);return i||(Fe(e)?Me(e.type):void 0)}function Me(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return De;case"esriFieldTypeInteger":case"esriFieldTypeLong":case"integer":case"long":return Re;case"esriFieldTypeBigInteger":case"big-integer":return Ve;case"esriFieldTypeSingle":case"single":return Ue;case"esriFieldTypeDouble":case"double":return qe}}function je(e){if(!te(e))return null;if(Number.isInteger(e)){if(e>=De.min&&e<=De.max)return"esriFieldTypeSmallInteger";if(e>=Re.min&&e<=Re.max)return"esriFieldTypeInteger";if(e>=Ve.min&&e<=Ve.max)return"esriFieldTypeBigInteger"}return e>=Ue.min&&e<=Ue.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}const De={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Oe=-2147483648,Ce=2**31-1,Re={min:Oe,max:Ce,isInteger:!0,rawMin:Oe,rawMax:Ce},Ve={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},ke=(2-2**-23)*2**127,Ue={min:-ke,max:ke,isInteger:!1,rawMin:-ke,rawMax:ke},qe={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function ze(e,n,i){switch(e){case"domain-validation-error::invalid-coded-value":return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"domain-validation-error::value-out-of-range":return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"type-validation-error::invalid-type":return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case"numeric-range-validation-error::out-of-range":{const{min:e,max:t}=Me(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function Xe(e,n){return!Pe(e,n,null)}function Pe(e,n,i){if(!e?.attributes||!n){if(null!=i)for(const e of n??[])i.add(e);return!0}const t=new Set(Object.keys(e.attributes));let r=!1;for(const l of n)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function Be(e,n){const i=new Set;for(const t of n)await v(i,e.fieldsIndex,null,t);return Array.from(i).sort()}function Ge(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some(n=>e.toLowerCase().startsWith(n))}async function Je(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function We(e){const n=e?.match(/{[^}]+}/g);return n?n.map(e=>e.slice(1,-1).split(":")[0].trim()):[]}function He(e,n){const{statisticType:i,onStatisticField:t,onStatisticExpression:r}=e,l=n.get(t),o=Fe(l),s=r?.returnType;switch(i){case"avg":case"avg_angle":return l?o||Ie(l)?"double":null:s&&"number"===s?"double":null;case"count":return"integer";case"min":case"max":return l?o||he(l)?l?.type??null:null:s&&"number"===s?"double":null;case"sum":return l?o?l?.type??null:null:s&&"number"===s?"double":null;case"mode":return l?l?.type??null:s?"number"===s?"double":"string":null;default:return null}}function Ke(e){const{fieldName:n,fieldsMap:i,normalizedFieldsMap:t}=e;if(!n)return;let r=i.get(n);return r||(r=i.get(Qe(n))??t.get(Ye(n)),r&&i.set(n,r),r)}function Qe(e){return e.trim().toLowerCase()}function Ye(e){return d(e)?.toLowerCase()??""}export{Qe as applyLowerCaseFieldName,Ve as bigIntegerRange,v as collectArcadeFieldNames,z as collectDisplayFilterFields,L as collectElevationFields,j as collectFeatureReductionFields,x as collectField,w as collectFields,C as collectFilterFields,Z as collectLabelingFields,R as collectOrderByInfos,O as collectPopupTemplateFields,S as collectSQLFieldNames,D as collectTrackInfoFields,qe as doubleRange,We as extractSubstitutionTemplatesFromString,Xe as featureHasFields,I as fixFields,y as fixRendererFields,F as fixTimeInfoFields,de as floatJSONTypes,ue as floatTypes,He as getAggregateFieldType,E as getDisplayFieldName,A as getDisplayFieldNameFromFields,J as getEditTrackingFields,N as getElevationFields,Be as getExpressionFields,U as getFeatureEditFields,q as getFeatureGeometryFields,ie as getFieldDefaultLength,ne as getFieldDefaultValue,Ke as getFieldFromIndex,Le as getFieldRange,Y as getLabelingFields,G as getLowerCaseDefaultHiddenFields,W as getLowerCaseEditTrackingFields,je as getNumericTypeForValue,Je as getRendererFields,k as getTimeFields,ce as integerJSONTypes,Re as integerRange,ae as integerTypes,Ie as isDateField,we as isDateOnlyField,K as isFieldEditable,Q as isFieldVisibleByDefault,H as isFieldWithType,Se as isGlobalIDField,ge as isIntegerField,Ne as isNumberInRange,Fe as isNumericField,ve as isObjectIDField,Ge as isRasterPixelValueField,be as isStringField,Te as isTimeOnlyField,xe as isTimestampOffsetField,Ee as isValidFieldValue,se as isValueMatchingFieldType,Ye as lowerCaseNormalizedFieldName,d as normalizeFieldName,fe as numericTypes,h as packFields,Pe as populateMissingFields,p as rendererFields,Ae as sanitizeNullFieldValue,$e as sanitizedParseFloat,Ue as singleRange,De as smallIntegerRange,T as unpackFieldNames,_e as validateFieldValue,ze as validationErrorToString,m as visualVariableFields};
|
|
2
|
+
import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as t}from"../../core/object.js";import{union as i}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{DomainValidationError as l,getDomainRange as o}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as s}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as a,isString as u}from"../../support/guards.js";import{loadArcade as f}from"../../support/loadArcade.js";const c=/^([0-9_])/,d=/[^a-z0-9_\u0080-\uffff]+/gi;function p(e){if(null==e)return null;return e.trim().replaceAll(d,"_").replace(c,"F$1")||null}const m=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],y=["field","normalizationField"];function g(e,n){if(null!=e&&null!=n)for(const t of Array.isArray(e)?e:[e])if(F(m,t,n),"visualVariables"in t&&t.visualVariables)for(const e of t.visualVariables)F(y,e,n)}function F(e,i,r){if(e)for(const l of e){const e=n(l,i),o=e&&"function"!=typeof e&&r.get(e);o&&t(l,o.name,i)}}function I(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const t=n.get(e.startField),i=n.get(e.endField);e.startField=t?.name??null,e.endField=i?.name??null}else{const t=n.get(e.startTimeField),i=n.get(e.endTimeField);e.startTimeField=t?.name??null,e.endTimeField=i?.name??null}}const b=new Set;function w(e,n){return e&&n?(b.clear(),x(b,e,n),Array.from(b).sort()):[]}function x(e,n,t){if(t)if(n?.fields?.length)if(t.includes("*"))for(const{name:i}of n.fields)e.add(i);else for(const i of t)T(e,n,i);else{if(t.includes("*"))return e.clear(),void e.add("*");for(const n of t)null!=n&&e.add(n)}}function T(e,n,t){if("string"==typeof t)if(n){const i=n.get(t);i&&e.add(i.name)}else e.add(t)}function h(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map(e=>e.name):n}function _(e,n,t=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const i=w(e,n);return i.length/e.fields.length>=t?["*"]:i}async function E(e,n,t,i){if(!i)return;const r=s(i);if(r)T(e,n,r);else{const{arcadeUtils:r}=await f(),l=r.extractFieldNames(i,t?.partitions??n?.fields?.map(e=>e.name));for(const i of l)T(e,t?.index??n,i)}}async function A(n,t,i){if(i&&"1=1"!==i){const l=await r(i,t);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:i});x(n,t,l.fieldNames)}}function v({displayField:e,fields:n}){return e||(n?.length?S(n):null)}function S(e){return L(e,"name-or-title")||L(e,"unique-identifier")||L(e,"type-or-category")||N(e)}function N(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function L(e,n){for(const t of e)if(t?.valueType&&t.valueType===n)return t.name;return null}async function $(e){if(!e)return[];const n=new Set;return await O(n,e),Array.from(n).sort()}async function O(e,n){if(!n)return;const t=n.elevationInfo?.featureExpressionInfo;return t?t.collectRequiredFields(e,n.fieldsIndex):void 0}function M(e,n,t){t.onStatisticExpression?E(e,n,null,t.onStatisticExpression.expression):e.add(t.onStatisticField)}async function D(e,n,t){if(!n||!t||!("fields"in t))return;const i=[],r=t.popupTemplate;i.push(R(e,n,r)),t.fields&&i.push(...t.fields.map(async t=>M(e,n.fieldsIndex,t))),await Promise.all(i)}async function V(e,n){const{fieldsIndex:t,trackInfo:i}=n;if(!n||!i||!t)return;const r=[i.latestObservations.renderer?.collectRequiredFields(e,t),i.previousObservations.renderer?.collectRequiredFields(e,t),i.trackLines.renderer?.collectRequiredFields(e,t)];i.popupTemplate&&r.push(R(e,n,i.popupTemplate));for(const l of[i.latestObservations.labelingInfo,i.previousObservations.labelingInfo,i.trackLines.labelingInfo])if(l)for(const n of l)r.push(ne(e,t,n));await Promise.all(r)}async function R(e,n,t){const i=[];t?.expressionInfos&&i.push(...t.expressionInfos.map(t=>E(e,n.fieldsIndex,null,t.expression)));const r=t?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&i.push(E(e,n.fieldsIndex,null,l.expressionInfo.expression));await Promise.all(i)}async function j(e,n,t){n&&(n.timeInfo&&t?.timeExtent&&x(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&x(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=t?.where&&await A(e,n.fieldsIndex,t.where))}async function U(e,n,t){n&&t&&await Promise.all(t.map(t=>C(e,n,t)))}async function C(e,n,t){n&&t&&(t.valueExpression?await E(e,n.fieldsIndex,null,t.valueExpression):t.field&&T(e,n.fieldsIndex,t.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?w(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function G(e){return e?w(e.fieldsIndex,J(e)):[]}function P(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?w(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function q(e,n,t){if(!n||!t)return;const i=n.fieldsIndex;await Promise.all(t.filters.map(n=>A(e,i,n.where)))}const z=new Set(["oid","global-id","guid"]),X=new Set(["oid","global-id"]),B=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/objectid/i,/^perimeter_/i,/_perimeter$/i,/_i$/i];function Y(e){const n=new Set;W(e).forEach(e=>n.add(e)),P(e).forEach(e=>n.add(e.toLowerCase()));const t=e&&"infoFor3D"in e?e.infoFor3D:void 0;return t&&(Object.values(t.assetMapFieldRoles).forEach(e=>n.add(e.toLowerCase())),Object.values(t.transformFieldRoles).forEach(e=>n.add(e.toLowerCase()))),Array.from(n)}function J(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:t,creatorField:i,editDateField:r,editorField:l}=n;return[t,i,r,l].filter(Boolean)}function W(e){return J(e).map(e=>e.toLowerCase())}function H(e){return!!e.type}function K(e,n){return!!e.editable&&H(e)&&!z.has(e.type)&&!W(n).includes(e.name?.toLowerCase()??"")}function Q(e,n){const t=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&t===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&t===n.globalIdField.toLowerCase()||Y(n).includes(t)||X.has(e.type)||B.some(e=>e.test(t)))}async function Z(e){if(!e)return[];const n=new Set;return await ee(n,e),Array.from(n).sort()}async function ee(e,n){const{labelingInfo:t,fieldsIndex:i}=n;t?.length&&await Promise.all(t.map(n=>ne(e,i,n)))}async function ne(e,n,t){if(!t)return;const i=t.getLabelExpression(),r=t.where;if("arcade"===i.type)await E(e,n,null,i.expression);else{const t=i.expression.match(/{[^}]*}/g);t&&t.forEach(t=>{T(e,n,t.slice(1,-1))})}await A(e,n,r)}function te(e){const n=e.defaultValue;return void 0!==n&&ae(e,n)?n:e.nullable?null:void 0}function ie(e){const n="string"==typeof e?{type:e}:e;return be(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function re(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function le(e){return null===e||re(e)}function oe(e){return null===e||Number.isInteger(e)}function se(){return!0}function ae(e,n){let t;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":t=e.nullable?oe:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":t=e.nullable?le:re;break;case"string":case"esriFieldTypeString":t=e.nullable?a:u;break;default:t=se}return 1===arguments.length?t:t(n)}const ue=["integer","small-integer","big-integer","long"],fe=["single","double"],ce=[...ue,...fe],de=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeLong","esriFieldTypeBigInteger"],pe=["esriFieldTypeSingle","esriFieldTypeDouble"],me=new Set([...ue,...de]),ye=new Set([...fe,...pe]),ge=i(me,ye);function Fe(e){return null!=e&&me.has(e.type)}function Ie(e){return null!=e&&ge.has(e.type)}function be(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function we(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function xe(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function Te(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function he(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function _e(e){return null!=e&&("date"===e.type||"date-only"===e.type||"time-only"===e.type||"timestamp-offset"===e.type)}function Ee(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function Ae(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function ve(e,n){return null===Oe(e,n)}const Se={OUT_OF_RANGE:"numeric-range-validation-error::out-of-range"},Ne={INVALID_TYPE:"type-validation-error::invalid-type"};function Le(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function $e(e){return parseFloat(e.replaceAll("_",""))}function Oe(e,n){return null==e||e.nullable&&null===n?null:ae(e,n)?Ie(e)&&!Me(e.type,Number(n))?Se.OUT_OF_RANGE:null:Ne.INVALID_TYPE}function Me(e,n){const t="string"==typeof e?Ve(e):e;if(!t)return!1;const i=t.min,r=t.max;return t.isInteger?Number.isInteger(n)&&n>=i&&n<=r:n>=i&&n<=r}function De(e,n){const t=o(e,n);return t||(Ie(e)?Ve(e.type):void 0)}function Ve(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return je;case"esriFieldTypeInteger":case"esriFieldTypeLong":case"integer":case"long":return ke;case"esriFieldTypeBigInteger":case"big-integer":return Ge;case"esriFieldTypeSingle":case"single":return qe;case"esriFieldTypeDouble":case"double":return ze}}function Re(e){if(!re(e))return null;if(Number.isInteger(e)){if(e>=je.min&&e<=je.max)return"esriFieldTypeSmallInteger";if(e>=ke.min&&e<=ke.max)return"esriFieldTypeInteger";if(e>=Ge.min&&e<=Ge.max)return"esriFieldTypeBigInteger"}return e>=qe.min&&e<=qe.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}const je={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Ue=-2147483648,Ce=2**31-1,ke={min:Ue,max:Ce,isInteger:!0,rawMin:Ue,rawMax:Ce},Ge={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},Pe=(2-2**-23)*2**127,qe={min:-Pe,max:Pe,isInteger:!1,rawMin:-Pe,rawMax:Pe},ze={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Xe(e,n,t){switch(e){case l.INVALID_CODED_VALUE:return`Value ${t} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case l.VALUE_OUT_OF_RANGE:return`Value ${t} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case Ne.INVALID_TYPE:return`Value ${t} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case Se.OUT_OF_RANGE:{const{min:e,max:i}=Ve(n.type);return`Value ${t} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${i}`}}}function Be(e,n){return!Ye(e,n,null)}function Ye(e,n,t){if(!e?.attributes||!n){if(null!=t)for(const e of n??[])t.add(e);return!0}const i=new Set(Object.keys(e.attributes));let r=!1;for(const l of n)if(!i.has(l)){if(r=!0,null==t)break;t.add(l)}return r}async function Je(e,n){const t=new Set;for(const i of n)await E(t,e.fieldsIndex,null,i);return Array.from(t).sort()}function We(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some(n=>e.toLowerCase().startsWith(n))}async function He(e,n){const t=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(t,n),Array.from(t).sort()}function Ke(e){const n=e?.match(/{[^}]+}/g);return n?n.map(e=>e.slice(1,-1).split(":")[0].trim()):[]}function Qe(e,n){const{statisticType:t,onStatisticField:i,onStatisticExpression:r}=e,l=n.get(i),o=Ie(l),s=r?.returnType;switch(t){case"avg":case"avg_angle":return l?o||we(l)?"double":null:s&&"number"===s?"double":null;case"count":return"integer";case"min":case"max":return l?o||_e(l)?l?.type??null:null:s&&"number"===s?"double":null;case"sum":return l?o?l?.type??null:null:s&&"number"===s?"double":null;case"mode":return l?l?.type??null:s?"number"===s?"double":"string":null;default:return null}}function Ze(e){const{fieldName:n,fieldsMap:t,normalizedFieldsMap:i}=e;if(!n)return;let r=t.get(n);return r||(r=t.get(en(n))??i.get(nn(n)),r&&t.set(n,r),r)}function en(e){return e.trim().toLowerCase()}function nn(e){return p(e)?.toLowerCase()??""}export{Se as NumericRangeValidationError,Ne as TypeValidationError,en as applyLowerCaseFieldName,Ge as bigIntegerRange,E as collectArcadeFieldNames,q as collectDisplayFilterFields,O as collectElevationFields,D as collectFeatureReductionFields,T as collectField,x as collectFields,j as collectFilterFields,ee as collectLabelingFields,U as collectOrderByInfos,R as collectPopupTemplateFields,A as collectSQLFieldNames,V as collectTrackInfoFields,ze as doubleRange,Ke as extractSubstitutionTemplatesFromString,Be as featureHasFields,w as fixFields,g as fixRendererFields,I as fixTimeInfoFields,pe as floatJSONTypes,fe as floatTypes,Qe as getAggregateFieldType,v as getDisplayFieldName,S as getDisplayFieldNameFromFields,J as getEditTrackingFields,$ as getElevationFields,Je as getExpressionFields,G as getFeatureEditFields,P as getFeatureGeometryFields,ie as getFieldDefaultLength,te as getFieldDefaultValue,Ze as getFieldFromIndex,De as getFieldRange,Z as getLabelingFields,Y as getLowerCaseDefaultHiddenFields,W as getLowerCaseEditTrackingFields,Re as getNumericTypeForValue,He as getRendererFields,k as getTimeFields,de as integerJSONTypes,ke as integerRange,ue as integerTypes,we as isDateField,xe as isDateOnlyField,K as isFieldEditable,Q as isFieldVisibleByDefault,H as isFieldWithType,Ae as isGlobalIDField,Fe as isIntegerField,Me as isNumberInRange,Ie as isNumericField,Ee as isObjectIDField,We as isRasterPixelValueField,be as isStringField,he as isTimeOnlyField,Te as isTimestampOffsetField,ve as isValidFieldValue,ae as isValueMatchingFieldType,nn as lowerCaseNormalizedFieldName,p as normalizeFieldName,ce as numericTypes,_ as packFields,Ye as populateMissingFields,m as rendererFields,Le as sanitizeNullFieldValue,$e as sanitizedParseFloat,qe as singleRange,je as smallIntegerRange,h as unpackFieldNames,Oe as validateFieldValue,Xe as validationErrorToString,y as visualVariableFields};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.112",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.5",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.112",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
25
|
-
"@esri/calcite-components": "^5.2.0-next.
|
|
26
|
-
"@vaadin/grid": "~25.2.
|
|
27
|
-
"@zip.js/zip.js": "~2.
|
|
25
|
+
"@esri/calcite-components": "^5.2.0-next.73",
|
|
26
|
+
"@vaadin/grid": "~25.2.11",
|
|
27
|
+
"@zip.js/zip.js": "~2.15.0",
|
|
28
28
|
"luxon": "~3.7.2",
|
|
29
|
-
"marked": "~18.0.
|
|
29
|
+
"marked": "~18.0.13",
|
|
30
30
|
"tslib": "^2.8.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const c="20260915",a="7a09763fc97c7e9f0c62643e91a616dd6cda31c1";export{c as buildDate,a as revision};
|
|
@@ -10,11 +10,10 @@ export interface LineStyleMarker3DProperties extends Partial<Pick<LineStyleMarke
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* LineStyleMarker3D is used for rendering a simple marker graphic on
|
|
14
|
-
* a [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/).
|
|
13
|
+
* LineStyleMarker3D is used for rendering a simple marker graphic on a [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/).
|
|
15
14
|
*
|
|
16
|
-
* Markers can enhance the cartographic information of a line by
|
|
17
|
-
*
|
|
15
|
+
* Markers can enhance the cartographic information of a line by providing additional visual cues about the associated
|
|
16
|
+
* feature.
|
|
18
17
|
*
|
|
19
18
|
* 
|
|
20
19
|
*
|
|
@@ -7,7 +7,7 @@ import type { PathSymbol3DLayerProperties } from "./PathSymbol3DLayer.js";
|
|
|
7
7
|
import type { LineSymbol3DLayerProperties } from "./LineSymbol3DLayer.js";
|
|
8
8
|
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
9
9
|
|
|
10
|
-
export interface LineSymbol3DProperties extends Symbol3DProperties {
|
|
10
|
+
export interface LineSymbol3DProperties extends Symbol3DProperties, Partial<Pick<LineSymbol3D, "worldSized">> {
|
|
11
11
|
/**
|
|
12
12
|
* A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/) objects
|
|
13
13
|
* used to visualize the graphic or feature. Individual symbol layers
|
|
@@ -29,7 +29,7 @@ export type LineSymbol3DSupportedSymbolLayerTypes = LineSymbol3DLayer | PathSymb
|
|
|
29
29
|
*
|
|
30
30
|
* [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/) Type | Flat/Volumetric | Size Units | Example
|
|
31
31
|
* ------------|-----------|------------|-----------
|
|
32
|
-
* [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/)| flat | points | 
|
|
32
|
+
* [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/)| flat | points or meters | 
|
|
33
33
|
* [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/) | volumetric | meters | 
|
|
34
34
|
*
|
|
35
35
|
* See [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/) and [Symbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3D/) to read
|
|
@@ -64,6 +64,23 @@ export default class LineSymbol3D extends Symbol3D {
|
|
|
64
64
|
set symbolLayers(value: ReadonlyArrayOrCollection<((LineSymbol3DLayerProperties & { type: "line" }) | (PathSymbol3DLayerProperties & { type: "path" }))>);
|
|
65
65
|
/** The symbol type. */
|
|
66
66
|
get type(): "line-3d";
|
|
67
|
+
/**
|
|
68
|
+
* Indicates whether metrics that support both screen and world sizing are interpreted in meters instead of screen points.
|
|
69
|
+
*
|
|
70
|
+
* Currently, the only affected metric is the [LineSymbol3DLayer.size](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/#size) property. This property does not
|
|
71
|
+
* affect [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/) symbol layers, whose dimensions are always interpreted in meters.
|
|
72
|
+
*
|
|
73
|
+
* > [!WARNING]
|
|
74
|
+
* >
|
|
75
|
+
* > **Known limitation**
|
|
76
|
+
* >
|
|
77
|
+
* > When this property is `true`, [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/) symbol layers are displayed only for
|
|
78
|
+
* > [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/) geometries in layers with `on-the-ground` elevation mode in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
79
|
+
*
|
|
80
|
+
* @default false
|
|
81
|
+
* @since 5.2
|
|
82
|
+
*/
|
|
83
|
+
accessor worldSized: boolean;
|
|
67
84
|
/**
|
|
68
85
|
* Creates a deep clone of the symbol.
|
|
69
86
|
*
|
package/symbols/LineSymbol3D.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 o from"../core/Collection.js";import{clone as r}from"../core/lang.js";import{property as t,subclass as s}from"../core/accessorSupport/decorators.js";import i from"./LineSymbol3DLayer.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import o from"../core/Collection.js";import{clone as r}from"../core/lang.js";import{property as t,subclass as s}from"../core/accessorSupport/decorators.js";import i from"./LineSymbol3DLayer.js";import l from"./PathSymbol3DLayer.js";import y from"./Symbol3D.js";import{enumeration as m}from"../core/accessorSupport/decorators/enumeration.js";var p;const n=o.ofType({base:null,key:"type",typeMap:{line:i,path:l}}),a=o.ofType({base:null,key:"type",typeMap:{line:i,path:l}});let b=p=class extends y{constructor(e){super(e),this.symbolLayers=new n,this.worldSized=!1,this.type="line-3d"}clone(){return new p({styleOrigin:r(this.styleOrigin),symbolLayers:r(this.symbolLayers),thumbnail:r(this.thumbnail),worldSized:this.worldSized})}static fromSimpleLineSymbol(e){return new p({symbolLayers:new o([i.fromSimpleLineSymbol(e)])})}};e([t({type:n,json:{type:a}})],b.prototype,"symbolLayers",void 0),e([t()],b.prototype,"worldSized",void 0),e([m({LineSymbol3D:"line-3d"},{readOnly:!0})],b.prototype,"type",void 0),b=p=e([s("esri.symbols.LineSymbol3D")],b);export{b as default};
|
|
@@ -83,8 +83,11 @@ export interface LineSymbol3DLayerProperties extends Symbol3DLayerProperties, Pa
|
|
|
83
83
|
*/
|
|
84
84
|
pattern?: (LineStylePattern3DProperties & { type: "style" }) | null;
|
|
85
85
|
/**
|
|
86
|
-
* The width of the line
|
|
87
|
-
*
|
|
86
|
+
* The width of the line.
|
|
87
|
+
*
|
|
88
|
+
* By default, this value is interpreted in points and may be autocast from a string expressing size in
|
|
89
|
+
* points or pixels (for example, `12px`). When [LineSymbol3D.worldSized](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3D/#worldSized) is `true`,
|
|
90
|
+
* the numeric value is interpreted in meters. Pixel values are converted to points first.
|
|
88
91
|
*
|
|
89
92
|
* @default "1px"
|
|
90
93
|
* @example
|
|
@@ -106,8 +109,9 @@ export interface LineSymbol3DLayerProperties extends Symbol3DLayerProperties, Pa
|
|
|
106
109
|
* in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) does not support
|
|
107
110
|
* 3D symbols.
|
|
108
111
|
*
|
|
109
|
-
* The color of the line is set in the [material](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/#material) property. The width of the line
|
|
110
|
-
*
|
|
112
|
+
* The color of the line is set in the [material](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/#material) property. The width of the line is set
|
|
113
|
+
* with the [size](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/#size) property. Whether the width is interpreted in points or meters is
|
|
114
|
+
* determined by the [LineSymbol3D.worldSized](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3D/#worldSized) property. Line width and color
|
|
111
115
|
* can also be data-driven by
|
|
112
116
|
* adding [size](https://developers.arcgis.com/javascript/latest/references/core/renderers/SimpleRenderer/#visualVariables) and/or
|
|
113
117
|
* [color visual variables](https://developers.arcgis.com/javascript/latest/references/core/renderers/SimpleRenderer/#visualVariables)
|
|
@@ -259,8 +263,11 @@ export default class LineSymbol3DLayer extends Symbol3DLayer {
|
|
|
259
263
|
get pattern(): LineStylePattern3D | null | undefined;
|
|
260
264
|
set pattern(value: (LineStylePattern3DProperties & { type: "style" }) | null | undefined);
|
|
261
265
|
/**
|
|
262
|
-
* The width of the line
|
|
263
|
-
*
|
|
266
|
+
* The width of the line.
|
|
267
|
+
*
|
|
268
|
+
* By default, this value is interpreted in points and may be autocast from a string expressing size in
|
|
269
|
+
* points or pixels (for example, `12px`). When [LineSymbol3D.worldSized](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3D/#worldSized) is `true`,
|
|
270
|
+
* the numeric value is interpreted in meters. Pixel values are converted to points first.
|
|
264
271
|
*
|
|
265
272
|
* @default "1px"
|
|
266
273
|
* @example
|
|
@@ -23,7 +23,7 @@ export interface Symbol3DLayerProperties {}
|
|
|
23
23
|
* ------------|-----------|------------|-------------|-----------
|
|
24
24
|
* [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/IconSymbol3DLayer/) | [PointSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/PointSymbol3D/), [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/PolygonSymbol3D/) | flat | points | 
|
|
25
25
|
* [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/ObjectSymbol3DLayer/) | [PointSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/PointSymbol3D/), [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/PolygonSymbol3D/) | volumetric | meters | 
|
|
26
|
-
* [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/) | [LineSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3D/) | flat | points | 
|
|
26
|
+
* [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/) | [LineSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3D/) | flat | points or meters | 
|
|
27
27
|
* [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/) | [LineSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3D/) | volumetric | meters | 
|
|
28
28
|
* [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/) | [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/PolygonSymbol3D/), [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/MeshSymbol3D/) | flat | - | 
|
|
29
29
|
* [WaterSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/WaterSymbol3DLayer/) | [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/PolygonSymbol3D/) | flat | - | 
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{
|
|
2
|
+
import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{maxTileCoordValue as i}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as s,tileSize as n}from"../../../definitions.js";import{AAnimatedMeshWriter as o}from"./AnimatedMeshWriter.js";import{angle as a,sizing as l,animationPointerAndBaseSizeAndReferenceSize as c,uv as m,offset as d,pos as u,bitset as p,id as h,lineLength as f,value1Position2Value2 as x,zoomRange as y}from"./attributes.js";import{clipWithVertexInterpolation as g}from"./clipping.js";import{createComputedAnimatedMeshParams as P}from"./ComputedAnimatedParams.js";const M=64,b=64,v=2;function w(e,t){const i=[];let r=0,s=0;for(;e.nextPath();){s=t?0:r,e.nextPoint();let{x:n,y:o}=e;const a=[{x:n,y:o,attributes:[s]}];for(;e.nextPoint();){const{x:t,y:i}=e,r=t-n,l=i-o;s+=Math.sqrt(r*r+l*l),a.push({x:t,y:i,attributes:[s]}),n=t,o=i}a.length>1&&i.push(a),r=s}return{lineData:i,totalDistance:r}}class _ extends o{get vertexSpec(){return{createComputedParams:P,optionalAttributes:{zoomRange:y,value1Position2Value2:x,lineLength:f},attributes:{id:h,bitset:p,pos:u,offset:d.marker,uv:m.marker,animationPointerAndBaseSizeAndReferenceSize:c,sizing:l,angle:a}}}_write(e,{target:i,effectGeometry:r}){const s=this.evaluatedMeshParams.sprite,{textureBinding:n}=s;e.recordStart(this.instanceId,this.attributeLayout,n);const o=i.getDisplayId();if(this.shift&&"esriGeometryPolyline"===i.geometryType){if(!r){const r=t.fromFeatureSetReaderCIM(i);r&&this._writeParticles(e,i,r)}}else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,i);else if("esriGeometryPolygon"===i.geometryType){const t=i.readCentroidForDisplay();if(!t)return;const[r,s]=t.coords;this._writeQuad(e,o,r,s)}else if("esriGeometryPoint"===i.geometryType){const t=i.readXForDisplay(),r=i.readYForDisplay();this._writeQuad(e,o,t,r)}else{const t=i.readGeometryForDisplay();t&&t.forEachVertex((t,i)=>{this._writeQuad(e,o,t,i)})}e.recordEnd()}_writePlacedMarkers(s,n){const o=t.fromFeatureSetReaderCIM(n)?.clone();if(!o)return;const a=-1,l=r.getPlacement(o,a,this.evaluatedMeshParams.placement,e(1),s.id);if(!l)return;const c=n.getDisplayId();let m=l.next(),d=null;for(;null!=m;){const e=m.tx,t=-m.ty;if(Math.abs(e)>i||Math.abs(t)>i){m=l.next();continue}const r=-m.getAngle();s.recordBounds(e,t,M,b),this.shift?d&&this._writeQuad(s,c,d[0],d[1],void 0,r):this._writeQuad(s,c,e,t,void 0,r),d=[e,t],m=l.next()}}_writeParticles(e,t,i){const r=t.getDisplayId(),{placement:s}=this.evaluatedMeshParams,o=s?.placePerPart??!1,{lineData:a,totalDistance:l}=w(i,o);if(0===a.length)return;const c=this.evaluatedMeshParams.baseSize,m={x:-c,y:-c,width:n+2*c,height:n+2*c},d=a.flatMap(e=>{const t=o?e[e.length-1].attributes[0]:l;return C(g(e,m),t)});for(const{particles:n,lineLength:u}of d){const t=t=>{for(const i of n){const{a:s,b:n}=i;this._writeQuad(e,r,s.position[0],s.position[1],[s.distance-t,n.position[0],n.position[1],n.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(s.direction[1],s.direction[0]):0,u,!0)}};if(!s||"placementTemplate"in s||"CIMMarkerPlacementOnVertices"===s.type){let e;if(s&&"CIMMarkerPlacementOnVertices"!==s.type)e=s.placementTemplate;else{e=[0];for(const t of n){const{a:i,b:r}=t,s=i.position[0]-r.position[0],n=i.position[1]-r.position[1],o=Math.sqrt(s*s+n*n);e.push(o)}}let i=-1*u;for(;i<(1+v/2)*u;)for(const r of e)i+=r,t(i)}else"CIMMarkerPlacementAtExtremities"===s.type?"JustBegin"===s.extremityPlacement?t(1):"JustEnd"===s.extremityPlacement?(t(u-1),t(-1)):"Both"===s.extremityPlacement&&(t(1),t(u-1)):"CIMMarkerPlacementOnLine"===s.type&&("LineBeginning"===s.relativeTo?t(1):"LineEnd"===s.relativeTo?(t(u-1),t(-1)):"LineMiddle"===s.relativeTo&&t(u/2))}}_writeQuad(e,t,i,r,n,o=0,a=0,l=!1){const c=this.evaluatedMeshParams.sprite,{rect:m}=c,d=m.x+s,u=m.y+s,p=m.x+m.width-s,h=m.y+m.height-s,f=e.vertexCount();l||e.recordBounds(i,r,M,M);const x={texXmin:d,texYmin:u,texXmax:p,texYmax:h,value1Position2Value2:n,angle:o,lineLength:a};for(let s=0;s<4;s++)this._writeVertex(e,t,i,r,x);e.indexEnsureSize(6),e.indexWrite(f),e.indexWrite(f+1),e.indexWrite(f+2),e.indexWrite(f+1),e.indexWrite(f+3),e.indexWrite(f+2)}}function C(e,t){const i=[];for(const r of e){const e=[];let{x:s,y:n}=r[0],o=r[0].attributes[0];for(let t=1;t<r.length;t++){const{x:i,y:a}=r[t],l=r[t].attributes[0];let c=i-s,m=a-n;const d=Math.sqrt(c*c+m*m);d>0&&(c/=d,m/=d,e.push({a:{position:[s,n],distance:o,direction:[c,m]},b:{position:[i,a],distance:l,direction:[c,m]}}),s=i,n=a,o=l)}i.push({particles:e,lineLength:t})}return i}class D extends _{constructor(){super(...arguments),this.shift=!1}}class I extends _{constructor(){super(...arguments),this.shift=!0}}export{D as AnimatedMarkerMeshWriter,I as AnimatedMarkerShiftMeshWriter,w as convertToLineData};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
function t(t,e,n){const l=new Array(t.attributes.length);for(let i=0;i<l.length;i++)l[i]=t.attributes[i]+(e.attributes[i]-t.attributes[i])*n;return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,attributes:l}}function e(t,e){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height}function n(n,l){const i=n.next;if(null==n.prev)return e(i,l)&&n.clipped.push([i]),n.prev=i,void(n.next=null);const p=n.prev,r=e(p,l),u=e(i,l);if(r&&u)return n.clipped[n.clipped.length-1].push(i),n.prev=i,void(n.next=null);const x=i.x-p.x,c=i.y-p.y;let h=0,o=1;for(const[t,e,s,d]of[[p.x,x,l.x,l.x+l.width],[p.y,c,l.y,l.y+l.height]]){if(0===e){if(t<s||t>d)return n.prev=i,void(n.next=null);continue}const l=(s-t)/e,p=(d-t)/e;h=Math.max(h,Math.min(l,p)),o=Math.min(o,Math.max(l,p))}h<o&&h>=0&&o<=1&&(!r&&u?n.clipped.push([t(p,i,h),i]):r&&!u?o>0&&n.clipped[n.clipped.length-1].push(t(p,i,o)):r||u||n.clipped.push([t(p,i,h),t(p,i,o)])),n.prev=i,n.next=null}function l(t,e){const l={clipped:[],prev:null,next:null};let i=0;for(;null!=l.next||i<t.length;)null==l.next?l.next=t[i++]:n(l,e);return l.clipped}export{l as clipWithVertexInterpolation};
|
|
@@ -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"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{when as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{when as i,watch as o,initial as r,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as l}from"./handlers/DoubleTapDragZoom.js";import{DragPan as m}from"./handlers/DragPan.js";import{DragRotate as h}from"./handlers/DragRotate.js";import{DragZoomBox as u}from"./handlers/DragZoomBox.js";import{GamepadNavigation as w}from"./handlers/GamepadNavigation.js";import{KeyPan as d}from"./handlers/KeyPan.js";import{KeyRotate as v}from"./handlers/KeyRotate.js";import{KeyZoom as g}from"./handlers/KeyZoom.js";import{MouseWheelZoom as f}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as j}from"./handlers/PinchAction.js";import{BrowserEventSource as A}from"../../input/BrowserEventSource.js";import{InputManager as P,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as D}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as M}from"../../input/handlers/support.js";import{DoubleTapDrag as I}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as z}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as T}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as E}from"../../input/recognizers/SingleAndDoubleClick.js";const N={counter:"Control",precisionPan:"Alt",coarsePan:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}},C=Symbol("handles");let H=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([i(()=>!e(),()=>this._disconnect()),i(e,()=>this._connect())])}destroy(){this._disconnect()}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this.removeHandles(C),this._inputManager=n(this._inputManager)}_connect(){const e=this.view.surface,t=new A(e,this.view.input),n=[new z,new T,new E,new b(this.view.navigation),new I],i=new P({eventSource:t,recognizers:n}),a=new m(this.view,["primary"]),p=new h(this.view,["secondary"]);i.installHandlers("prevent-context-menu",[new _],y.INTERNAL),i.installHandlers("prevent-touch-text-selection-gesture",[new D(this.view)],y.INTERNAL),i.installHandlers("navigation",[new j(this.view),new w(this.view),new f(this.view),new c(this.view),new c(this.view,[N.counter]),new u(this.view),a,new d(this.view,N.pan),new d(this.view,N.pan,[N.coarsePan],4),new d(this.view,N.pan,[N.precisionPan,N.coarsePan],.25),new d(this.view,N.pan,[N.precisionPan],.25),new g(this.view,N.zoom),new v(this.view,N.rotate),p,new l(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(i),this._source=t,this._inputManager=i,this.addHandles([o(()=>this.view?.navigation?.browserTouchPanEnabled,e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)},r),o(()=>{const{actionMap:e}=this.view.navigation;return{panActions:M("pan",e),rotateActions:M("rotate",e)}},({panActions:e,rotateActions:t})=>{a.pointerActions=e,p.pointerActions=t},s)],C)}get test(){}};e([a()],H.prototype,"view",void 0),e([a({readOnly:!0})],H.prototype,"updating",null),e([a()],H.prototype,"latestPointerInfo",null),e([a()],H.prototype,"latestPenInfo",null),e([a()],H.prototype,"multiTouchActive",null),H=e([p("esri.views.2d.input.MapViewInputManager")],H);const S=H;export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as t}from"../../../input/VisibilityChange.js";class e extends i{constructor(i,e,s,o=1){super(!0),this.view=i,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=i=>{const t=this._keyMap[i.data.key];if(1!==this._panFactor){if("key-up"===i.type&&this._modifiers.some(t=>t.toLowerCase()===i.data.key.toLowerCase()))return void this._stopMovement();if(!this._modifiers.every(t=>i.modifiers.has(t)||i.modifiers.has(t.toLowerCase())||i.modifiers.has(t.toUpperCase())))return}if(i.modifiers.has("Meta")||i.modifiers.has("Control"))return void this._stopMovement();if(null==t)return;i.stopPropagation(),i.preventDefault();const e="key-down"===i.type;if(this._pressedKeys[e?"add":"delete"](t),e){if(
|
|
2
|
+
import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as t}from"../../../input/VisibilityChange.js";class e extends i{constructor(i,e,s,o=1){super(!0),this.view=i,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=i=>{const t=this._keyMap[i.data.key];if(1!==this._panFactor){if("key-up"===i.type&&this._modifiers.some(t=>t.toLowerCase()===i.data.key.toLowerCase()))return void this._stopMovement();if(!this._modifiers.every(t=>i.modifiers.has(t)||i.modifiers.has(t.toLowerCase())||i.modifiers.has(t.toUpperCase())))return}if(i.modifiers.has("Meta")||i.modifiers.has("Control"))return void this._stopMovement();if(null==t)return;i.stopPropagation(),i.preventDefault();const e="key-down"===i.type,s=this._pressedKeys.has(t);if(this._pressedKeys[e?"add":"delete"](t),e){if(s)return;this._updateDirection(),this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const i=void 0===this._timeout,t=this._pressedKeys.size>0;i||t?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._updateDirection(),0===this._pressedKeys.size&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._panFactor=o,this._modifiers=s??[],this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",s,this._handleKey),this.registerIncoming("key-up",1!==o?null:s,this._handleKey),this.registerIncoming("blur",1!==o?null:s,this._stopMovement),this._visibilityHandle=t(i=>i?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(i){const t=null!=this._currentDirection;null!=i?(t||this.view.mapViewNavigation.begin(),this._currentDirection?.x===i.x&&this._currentDirection.y===i.y||this.view.mapViewNavigation.continuousPanVector(i)):t&&this.view.mapViewNavigation.stop(),this._currentDirection=i}_updateDirection(){const i=Number(this._pressedKeys.has("right"))-Number(this._pressedKeys.has("left")),t=Number(this._pressedKeys.has("up"))-Number(this._pressedKeys.has("down")),e=Math.hypot(i,t);this._direction=0===e?void 0:{x:i/e*this._panFactor,y:t/e*this._panFactor}}_setTimeout(i){clearTimeout(this._timeout),this._timeout=void 0===i?void 0:setTimeout(()=>{this._timeout=void 0,i()},this._stickyKeyDuration)}}export{e as KeyPan};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import i from"../../../../../core/Error.js";import n from"../../../../../core/Logger.js";import{dist as e,set as t,subtract as s,len as o,scale as r,equals as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isPolygon as _}from"../../../../../geometry/support/jsonTypeUtils.js";import d from"../../../../../layers/support/FieldsIndex.js";import{createRendererExpression as a}from"../../../../../support/ArcadeExpression.js";import{fromCIMHorizontalAlignment as u,fromCIMVerticalAlignment as g,fromCIMFontDecoration as c}from"../../../../../symbols/cim/utils.js";import x from"../../../arcade/callExpressionWithFeature.js";import{magicLabelLineHeight as P}from"../../../engine/webgl/definitions.js";import p from"../../../engine/webgl/Rect.js";import{shapeTextResource as b}from"../../../engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as y,getLineWidth as D}from"../../graphics/graphicsUtils.js";import{initializeDimensionStyleDefaults as f}from"./dimensionStyleDefaults.js";import{normalizeExtensionAngle as L,DimensionRealFieldName as R,rectsOverlap as S,queryPointOnLine as T,angleFromXAxis as M,capDimensionExtensionAngle as w,intersectLinesByPointsAndAngles as E,projectLinearDimensionPoints as k,measureMarkerSymbolSize as v,translateRect as A,scaleRect as F,rotatePoint as N,rectsOverlapOnAxis as B}from"./dimensionUtils.js";import{getAttributeValue as j}from"./utils.js";class I{static async create(i,n,e){const t=new I(i);return await t.initialize(n,e),t}constructor(i){if(this._dimensionStyle=i,this._textString=null,this._displayExtLines=!0,this._systemLength=0,this._dimensionAngleRad=0,this._dimensionLength=0,this._dimensionDirection=null,this._textSize=null,this._extAngleRad=Math.PI/2,this._dimensionType=0,this._compiledExpression=null,this._fieldsIndex=null,this._textResource=null,this._beginBaselinePoint=null,this._endBaselinePoint=null,this._dimensionLinePoint=null,this._beginDimensionPoint=null,this._endDimensionPoint=null,this._beginMarkerRect=null,this._endMarkerRect=null,this._textRect=null,this._textPoint=null,this._dimensionPolyline=null,this._dimensionExtensionLines=null,this._hasTextPoint=!1,this._doMarkersFit=!0,this._dimensionIsEvaluated=!1,null==i)throw new Error("dimension syle must be defined!");f(i)}async initialize(e,t){if(!this._dimensionStyle)return;const{attributes:s}=e;if("Expression"===(this._dimensionStyle.textOption??"None")){const{expression:s,expressionParserName:o}=this._dimensionStyle;s&&o&&"arcade"===o.toLowerCase()?(this._compiledExpression=await a(s,t),this._fieldsIndex=O(e)):n.getLogger("esri.layers.DimensionFeatureLayer").warn(new i("dimension-layer:unsupported-expression","Only Arcade expressions are supported",{expressionType:o,expression:s}))}this._extAngleRad=L(j(R.extAngle,s)),this._dimensionType=1===Number(j(R.dimType,s))?1:0,this._systemLength=Number(j("__SYSTEM_LENGTH__",s));const{geometry:o}=e;if(o&&!_(o))throw new i("dimension-layer","processed geometry must be a valid 'polygon'.");const r=o?.rings[0];if(!r||r.length<3)throw new i("dimension-layer","processed geometry must have at least 3 points.");this._hasTextPoint=null!=r[3]&&0!==r[3][0]&&0!==r[3][1]&&void 0!==r[3][0]&&void 0!==r[3][1],this._hasTextPoint&&(this._textPoint=r[3]);const h=this._dimensionStyle.textSymbol;s.__DIMENSION_ANGLE__+=h?.angle??0}getTextString(i){return null==this._textString&&(this._textString=this._getDimensionText(i)),this._textString}get textSymbol(){return this._dimensionStyle.textSymbol??null}setTextResource(i){this._textResource=i??null}get beginBaselinePoint(){return this._beginBaselinePoint}get endBaselinePoint(){return this._endBaselinePoint}get beginDimensionPoint(){return this._beginDimensionPoint}get endDimensionPoint(){return this._endDimensionPoint}get textPoint(){return this._textPoint}get dimensionLine(){return this._dimensionPolyline}get extensionLines(){return this._displayExtLines?this._dimensionExtensionLines:null}evaluateWithGeometry(i,n){this._dimensionIsEvaluated||(this._computeDimensionLineInfo(i,n),this._evaluateDefaultPlacement(n),this._updateExtensionLines(n),this._updateTextPoint(n),this._offsetTextPoint(n),this._dimensionIsEvaluated=!0)}_updateTextPoint(i){if(this._hasTextPoint)return;const{textFit:n}=this._dimensionStyle;let e=!0;if(!this._doMarkersFit){if(this._hasTextPoint)return;if("None"===n||!this._beginMarkerRect||!this._endMarkerRect||!this._textRect)return void(e=!0);if((S(this._beginMarkerRect,this._textRect)||S(this._endMarkerRect,this._textRect))&&(e=!1),!e){const i=this._textRect.width/2,e=this._beginMarkerRect.width/2,t=this._endMarkerRect.width/2;"MoveBegin"===n?(this._textPoint=T(this._beginDimensionPoint,this._endDimensionPoint,-(i+e)),this._extendDimensionLineForMovedText("begin",e+this._textRect.width)):"MoveEnd"===n&&(this._textPoint=T(this._endDimensionPoint,this._beginDimensionPoint,-(i+t)),this._extendDimensionLineForMovedText("end",t+this._textRect.width))}}}_extendDimensionLineForMovedText(i,n){if(this._dimensionPolyline?.length)if("begin"===i){const i=T(this._beginDimensionPoint,this._endDimensionPoint,-n);this._dimensionPolyline[0]=[i,this._beginDimensionPoint]}else{const i=T(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+n);this._dimensionPolyline[1]=[i,this._endDimensionPoint]}}_offsetTextPoint(i){if(this._hasTextPoint)return;const n=this._textPoint;if(!n)return;const e=.5*this._textSize*i,t=-e*this._dimensionDirection[1],s=e*this._dimensionDirection[0];n[0]+=t,n[1]+=s}_updateExtensionLines(i){if(!(this._displayExtLines&&this._beginDimensionPoint&&this._dimensionLinePoint&&this._endDimensionPoint))return;const{extensionLineOvershot:n,extensionLineOffset:t}=this._dimensionStyle;let s=this._dimensionLinePoint,o=this._endDimensionPoint;null==n||isNaN(n)||0===n||(s=T(this._dimensionLinePoint,this._beginBaselinePoint,-n*i),o=T(this._endDimensionPoint,this._endBaselinePoint,-n*i));let r=this._beginBaselinePoint,h=this._endBaselinePoint;if(null!=t&&!isNaN(t)&&0!==t){const i=e(s,this._beginBaselinePoint),n=e(o,this._endBaselinePoint);r=T(s,this._beginBaselinePoint,i-t),h=T(o,this._endBaselinePoint,n-t)}this._dimensionExtensionLines=[[s,r],[o,h]]}_computeDimensionLineInfo(n,e){if(!n||!_(n)||n.rings[0].length<3)throw new i("DimensionLayerView: bad geometry","Dimension cann't be applied to an empty geometry!");const h=n.rings[0],d=l(h[0][0],h[0][1]),a=l(h[1][0],h[1][1]),u=l(h[2][0],h[2][1]);this._beginBaselinePoint=t(m(),d[0],d[1]),this._endBaselinePoint=t(m(),a[0],a[1]),this._dimensionLinePoint=u,1===this._dimensionType?this._computeLinearDimensionPoints(d,a,u):this._computeAlignedDimensionPoints(d,a,u);const g=this._beginDimensionPoint,c=this._endDimensionPoint;if(!g||!c)throw new i("DimensionLayerView: bad geometry","Failed to construct the dimension line!");this._dimensionDirection=s(m(),c,g),this._dimensionAngleRad=M(this._dimensionDirection),this._dimensionLength=o(this._dimensionDirection),this._dimensionDirection=r(this._dimensionDirection,this._dimensionDirection,1/this._dimensionLength),this._hasTextPoint||(this._textPoint=T(g,c,this._dimensionLength/2))}_computeAlignedDimensionPoints(n,e,s){const o=w(this._extAngleRad);if(h(n,s))return this._beginDimensionPoint=t(m(),n[0],n[1]),this._endDimensionPoint=t(m(),e[0],e[1]),void(this._displayExtLines=!1);const r=M([e[0]-n[0],e[1]-n[1]]),l=E(s,r,e,r+o);if(!l)throw new i("DimensionLayerView: bad geometry","Failed to construct dimension extension lines!");this._beginDimensionPoint=t(m(),s[0],s[1]),this._endDimensionPoint=t(m(),l[0],l[1])}_computeLinearDimensionPoints(i,n,e){const s=k(i,n,e,this._extAngleRad);if(!s)return this._beginDimensionPoint=t(m(),i[0],i[1]),this._endDimensionPoint=t(m(),n[0],n[1]),void(this._displayExtLines=!1);this._beginDimensionPoint=s.beginDimensionPoint,this._endDimensionPoint=s.endDimensionPoint}_evaluateDefaultPlacement(i){const{beginMarkerSymbol:n,endMarkerSymbol:e}=this._dimensionStyle,t=v(n,this._dimensionAngleRad),s=v(e,this._dimensionAngleRad+Math.PI),o=this._measureDimensionText(this._textString||"",this._textPoint,i);this._textRect=o;const r=i*((t?.width??0)/2),h=i*((s?.width??0)/2),l=t&&this._beginDimensionPoint?A(F(t,i),this._beginDimensionPoint[0],this._beginDimensionPoint[1]):null,m=s&&this._endDimensionPoint?A(F(s,i),this._endDimensionPoint[0],this._endDimensionPoint[1]):null;if(this._beginMarkerRect=l,this._endMarkerRect=m,this._doMarkersFit=this._checkMarkerFit(l,m,o,i),this._doMarkersFit){const i=T(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2);this._dimensionPolyline=[[i,this._beginDimensionPoint],[i,this._endDimensionPoint]]}else{const i=T(this._beginDimensionPoint,this._endDimensionPoint,-4*r),n=T(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+4*h);this._dimensionPolyline=[[i,this._beginDimensionPoint],[n,this._endDimensionPoint]]}}_checkMarkerFit(i,n,e,t){if(!i||!n)return!1;const{markerFit:s,markerOption:o,markerFitTolerance:r}=this._dimensionStyle;if("None"===s)return!0;let h=!0;const l=(i,n)=>S(i,n)||B(i,n,this._dimensionDirection);if("Tolerance"===s)r*t>=this._dimensionLength&&(h=!1);else{if(this._hasTextPoint&&"Both"!==o)return!0;this._hasTextPoint&&"Both"===o?l(i,n)&&(h=!1):(l(i,n)&&(h=!1),h&&e&&(l(e,i)||l(e,n))&&(h=!1))}return h}_measureDimensionText(i,n,e){if(null==this._textString||null==n||null==this._textResource)return null;const t=this._dimensionStyle.textSymbol;if(!t)return null;const s=u(t.horizontalAlignment),o=g(t.verticalAlignment),r=c(t),h=y(t.height||10);this._textSize="glyphs"===this._textResource.type?h:Math.max(h,...this._textResource.runs.map(i=>y(i.fontSize||0)));const l=!0,m=t.angle||0,_="glyphs"===this._textResource.type?this._textResource.sdfSize:this._textResource.runs[0]?.glyphs.sdfSize;if(!_)return null;const d=h/_,a=D(t.lineWidth),x=Math.max(.25,Math.min(h||1,4)),f=P*x,L=b(this._textResource,{scale:d,angle:m,xOffset:0,yOffset:0,horizontalAlignment:s,verticalAlignment:o,decoration:r,lineHeight:f,lineHeightRatio:x,useCIMAngleBehavior:l,maxLineWidth:a,hasBackground:!1}),R=n;if(!R)return null;const S=e,T=[L.bounds.blX,L.bounds.trY],M=[L.bounds.trX,L.bounds.trY],w=[L.bounds.blX,L.bounds.blY],E=[L.bounds.trX,L.bounds.blY];T[0]-=L.bounds.x,T[1]-=L.bounds.y,M[0]-=L.bounds.x,M[1]-=L.bounds.y,w[0]-=L.bounds.x,w[1]-=L.bounds.y,E[0]-=L.bounds.x,E[1]-=L.bounds.y,T[0]*=S,T[1]*=S,M[0]*=S,M[1]*=S,w[0]*=S,w[1]*=S,E[0]*=S,E[1]*=S,this._dimensionAngleRad&&(N(T,this._dimensionAngleRad),N(M,this._dimensionAngleRad),N(w,this._dimensionAngleRad),N(E,this._dimensionAngleRad)),T[0]+=R[0],T[1]+=R[1],M[0]+=R[0],M[1]+=R[1],w[0]+=R[0],w[1]+=R[1],E[0]+=R[0],E[1]+=R[1];const k=Math.min(T[0],M[0],w[0],E[0]),v=Math.min(T[1],M[1],w[1],E[1]),A=Math.max(T[0],M[0],w[0],E[0]),F=Math.max(T[1],M[1],w[1],E[1]);return new p(k,v,1.1*(A-k),1.1*(F-v))}_getDimensionText(i){const{attributes:n}=i;let e=null;const t=1===Number(j(R.useCustomLength,n));e=Number(j(t?R.customLength:R.dimLength,n)),(0===e||isNaN(e)||null==e)&&(e=this._systemLength);let s=this._getDimensionString(e,i);return"number"==typeof s&&(s=s.toString()),n.__COMPUTED_TEXT_STRING__=s,s||""}_getDimensionString(i,n){const{convertUnits:e,displayUnits:t,displayPrecision:s,prefix:o,suffix:r,textOption:h}=this._dimensionStyle;if("None"===h)return null;if("Expression"===h&&this._compiledExpression&&n)return x(this._compiledExpression,n,{},"esriGeometryPolyline",this._fieldsIndex);let l=(i=null==s||isNaN(s)?parseFloat(i.toString()):parseFloat(i.toFixed(s))).toString();return"Suffix"===h&&(o&&(l=`${o} ${l}`),r&&(l=`${l} ${r}`)),l}}function O(i){const{attributes:n}=i,e=Object.keys(R).map(i=>({name:i,alias:i,type:"string"==typeof n[i]?"esriFieldTypeString":"esriFieldTypeDouble"}));return new d(e)}export{I as default};
|
|
2
|
+
import i from"../../../../../core/Error.js";import n from"../../../../../core/Logger.js";import{convertUnit as e,unitFromUnitWkid as t,getUnitString as s}from"../../../../../core/units.js";import{dist as o,set as h,subtract as r,len as l,scale as m,equals as _}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as d,create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isPolygon as g}from"../../../../../geometry/support/jsonTypeUtils.js";import u from"../../../../../layers/support/FieldsIndex.js";import{createRendererExpression as x}from"../../../../../support/ArcadeExpression.js";import{fromCIMHorizontalAlignment as c,fromCIMVerticalAlignment as P,fromCIMFontDecoration as p}from"../../../../../symbols/cim/utils.js";import b from"../../../arcade/callExpressionWithFeature.js";import{magicLabelLineHeight as f}from"../../../engine/webgl/definitions.js";import y from"../../../engine/webgl/Rect.js";import{shapeTextResource as D}from"../../../engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as L,getLineWidth as S}from"../../graphics/graphicsUtils.js";import{initializeDimensionStyleDefaults as M}from"./dimensionStyleDefaults.js";import{normalizeExtensionAngle as T,DimensionRealFieldName as w,queryPointOnLine as k,angleFromXAxis as E,capDimensionExtensionAngle as R,intersectLinesByPointsAndAngles as A,projectLinearDimensionPoints as v,measureMarkerSymbolSize as F,translateRect as N,scaleRect as B,rotatePoint as j,rectsOverlap as I,rectsOverlapOnAxis as O}from"./dimensionUtils.js";import{getAttributeValue as z}from"./utils.js";class U{static async create(i,n,e){const t=new U(i,e);return await t.initialize(n,e),t}constructor(i,n){if(this._dimensionStyle=i,this._spatialReference=n,this._textString=null,this._displayExtLines=!0,this._systemLength=0,this._dimensionAngleRad=0,this._dimensionLength=0,this._dimensionDirection=null,this._textSize=null,this._textLength=null,this._extAngleRad=Math.PI/2,this._dimensionType=0,this._compiledExpression=null,this._fieldsIndex=null,this._textResource=null,this._beginBaselinePoint=null,this._endBaselinePoint=null,this._dimensionLinePoint=null,this._beginDimensionPoint=null,this._endDimensionPoint=null,this._beginMarkerLength=0,this._endMarkerLength=0,this._textPoint=null,this._dimensionPolyline=null,this._dimensionExtensionLines=null,this._hasTextPoint=!1,this._doMarkersFit=!0,this._dimensionIsEvaluated=!1,null==i)throw new Error("dimension syle must be defined!");M(i)}async initialize(e,t){if(!this._dimensionStyle)return;const{attributes:s}=e;if("Expression"===(this._dimensionStyle.textOption??"None")){const{expression:s,expressionParserName:o}=this._dimensionStyle;s&&o&&"arcade"===o.toLowerCase()?(this._compiledExpression=await x(s,t),this._fieldsIndex=X(e)):n.getLogger("esri.layers.DimensionFeatureLayer").warn(new i("dimension-layer:unsupported-expression","Only Arcade expressions are supported",{expressionType:o,expression:s}))}this._extAngleRad=T(z(w.extAngle,s)),this._dimensionType=1===Number(z(w.dimType,s))?1:0,this._systemLength=Number(z("__SYSTEM_LENGTH__",s));const{geometry:o}=e;if(o&&!g(o))throw new i("dimension-layer","processed geometry must be a valid 'polygon'.");const h=o?.rings[0];if(!h||h.length<3)throw new i("dimension-layer","processed geometry must have at least 3 points.");this._hasTextPoint=null!=h[3]&&0!==h[3][0]&&0!==h[3][1]&&void 0!==h[3][0]&&void 0!==h[3][1],this._hasTextPoint&&(this._textPoint=h[3]);const r=this._dimensionStyle.textSymbol;s.__DIMENSION_ANGLE__+=r?.angle??0}getTextString(i){return null==this._textString&&(this._textString=this._getDimensionText(i)),this._textString}get textSymbol(){return this._dimensionStyle.textSymbol??null}setTextResource(i){this._textResource=i??null}get beginBaselinePoint(){return this._beginBaselinePoint}get endBaselinePoint(){return this._endBaselinePoint}get beginDimensionPoint(){return this._beginDimensionPoint}get endDimensionPoint(){return this._endDimensionPoint}get textPoint(){return this._textPoint}get dimensionLine(){return this._dimensionPolyline}get extensionLines(){return this._displayExtLines?this._dimensionExtensionLines:null}evaluateWithGeometry(i,n){this._dimensionIsEvaluated||(this._computeDimensionLineInfo(i,n),this._evaluateDefaultPlacement(n),this._updateExtensionLines(n),this._updateTextPoint(n),this._offsetTextPoint(n),this._dimensionIsEvaluated=!0)}_updateTextPoint(i){if(this._hasTextPoint)return;const{textFit:n}=this._dimensionStyle;if(!this._doMarkersFit){if("None"===n||null==this._textLength)return;if(this._textLength>this._dimensionLength){const i=this._textLength/2;"MoveBegin"===n?(this._textPoint=k(this._beginDimensionPoint,this._endDimensionPoint,-(i+this._beginMarkerLength/2)),this._extendDimensionLineForMovedText("begin",this._beginMarkerLength/2+this._textLength)):"MoveEnd"===n&&(this._textPoint=k(this._endDimensionPoint,this._beginDimensionPoint,-(i+this._endMarkerLength/2)),this._extendDimensionLineForMovedText("end",this._endMarkerLength/2+this._textLength))}}}_extendDimensionLineForMovedText(i,n){if(this._dimensionPolyline?.length)if("begin"===i){const i=k(this._beginDimensionPoint,this._endDimensionPoint,-n);this._dimensionPolyline[0]=[i,this._beginDimensionPoint]}else{const i=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+n);this._dimensionPolyline[1]=[i,this._endDimensionPoint]}}_offsetTextPoint(i){if(this._hasTextPoint)return;const n=this._textPoint;if(!n)return;const e=.5*this._textSize*i,t=-e*this._dimensionDirection[1],s=e*this._dimensionDirection[0];n[0]+=t,n[1]+=s}_updateExtensionLines(i){if(!(this._displayExtLines&&this._beginDimensionPoint&&this._dimensionLinePoint&&this._endDimensionPoint))return;const{extensionLineOvershot:n,extensionLineOffset:e}=this._dimensionStyle;let t=this._dimensionLinePoint,s=this._endDimensionPoint;null==n||isNaN(n)||0===n||(t=k(this._dimensionLinePoint,this._beginBaselinePoint,-n*i),s=k(this._endDimensionPoint,this._endBaselinePoint,-n*i));let h=this._beginBaselinePoint,r=this._endBaselinePoint;if(null!=e&&!isNaN(e)&&0!==e){const i=o(t,this._beginBaselinePoint),n=o(s,this._endBaselinePoint);h=k(t,this._beginBaselinePoint,i-e),r=k(s,this._endBaselinePoint,n-e)}this._dimensionExtensionLines=[[t,h],[s,r]]}_computeDimensionLineInfo(n,e){if(!n||!g(n)||n.rings[0].length<3)throw new i("DimensionLayerView: bad geometry","Dimension cann't be applied to an empty geometry!");const t=n.rings[0],s=d(t[0][0],t[0][1]),o=d(t[1][0],t[1][1]),_=d(t[2][0],t[2][1]);this._beginBaselinePoint=h(a(),s[0],s[1]),this._endBaselinePoint=h(a(),o[0],o[1]),this._dimensionLinePoint=_,1===this._dimensionType?this._computeLinearDimensionPoints(s,o,_):this._computeAlignedDimensionPoints(s,o,_);const u=this._beginDimensionPoint,x=this._endDimensionPoint;if(!u||!x)throw new i("DimensionLayerView: bad geometry","Failed to construct the dimension line!");this._dimensionDirection=r(a(),x,u),this._dimensionAngleRad=E(this._dimensionDirection),this._dimensionLength=l(this._dimensionDirection),this._dimensionDirection=m(this._dimensionDirection,this._dimensionDirection,1/this._dimensionLength),this._hasTextPoint||(this._textPoint=k(u,x,this._dimensionLength/2))}_computeAlignedDimensionPoints(n,e,t){const s=R(this._extAngleRad);if(_(n,t))return this._beginDimensionPoint=h(a(),n[0],n[1]),this._endDimensionPoint=h(a(),e[0],e[1]),void(this._displayExtLines=!1);const o=E([e[0]-n[0],e[1]-n[1]]),r=A(t,o,e,o+s);if(!r)throw new i("DimensionLayerView: bad geometry","Failed to construct dimension extension lines!");this._beginDimensionPoint=h(a(),t[0],t[1]),this._endDimensionPoint=h(a(),r[0],r[1])}_computeLinearDimensionPoints(i,n,e){const t=v(i,n,e,this._extAngleRad);if(!t)return this._beginDimensionPoint=h(a(),i[0],i[1]),this._endDimensionPoint=h(a(),n[0],n[1]),void(this._displayExtLines=!1);this._beginDimensionPoint=t.beginDimensionPoint,this._endDimensionPoint=t.endDimensionPoint}_evaluateDefaultPlacement(i){const{beginMarkerSymbol:n,endMarkerSymbol:e}=this._dimensionStyle,t=F(n,this._dimensionAngleRad),s=F(e,this._dimensionAngleRad+Math.PI),o=F(n,0),h=F(e,Math.PI);this._measureDimensionText(this._textString||"",this._textPoint,i),this._beginMarkerLength=i*(o?.width??0),this._endMarkerLength=i*(h?.width??0);const r=t&&this._beginDimensionPoint?N(B(t,i),this._beginDimensionPoint[0],this._beginDimensionPoint[1]):null,l=s&&this._endDimensionPoint?N(B(s,i),this._endDimensionPoint[0],this._endDimensionPoint[1]):null;if(this._doMarkersFit=this._checkMarkerFit(r,l,i),this._doMarkersFit){const i=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2);this._dimensionPolyline=[[i,this._beginDimensionPoint],[i,this._endDimensionPoint]]}else{const i=k(this._beginDimensionPoint,this._endDimensionPoint,-2*this._beginMarkerLength),n=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+2*this._endMarkerLength);this._dimensionPolyline=[[i,this._beginDimensionPoint],[n,this._endDimensionPoint]]}}_checkMarkerFit(i,n,e){if(!i||!n)return!1;const{markerFit:t,markerOption:s,markerFitTolerance:o}=this._dimensionStyle;if("None"===t)return!0;let h=!0;const r=(i,n)=>I(i,n)||O(i,n,this._dimensionDirection);if("Tolerance"===t)o*e>=this._dimensionLength&&(h=!1);else{if(this._hasTextPoint&&"Both"!==s)return!0;if(this._hasTextPoint&&"Both"===s)r(i,n)&&(h=!1);else{h=this._beginMarkerLength+this._endMarkerLength+(this._textLength??0)<=this._dimensionLength}}return h}_measureDimensionText(i,n,e){if(null==this._textString||null==n||null==this._textResource)return null;const t=this._dimensionStyle.textSymbol;if(!t)return null;const s=c(t.horizontalAlignment),o=P(t.verticalAlignment),h=p(t),r=L(t.height||10);this._textSize="glyphs"===this._textResource.type?r:Math.max(r,...this._textResource.runs.map(i=>L(i.fontSize||0)));const l=!0,m=t.angle||0,_="glyphs"===this._textResource.type?this._textResource.sdfSize:this._textResource.runs[0]?.glyphs.sdfSize;if(!_)return null;const d=r/_,a=S(t.lineWidth),g=Math.max(.25,Math.min(r||1,4)),u=f*g,x=D(this._textResource,{scale:d,angle:m,xOffset:0,yOffset:0,horizontalAlignment:s,verticalAlignment:o,decoration:h,lineHeight:u,lineHeightRatio:g,useCIMAngleBehavior:l,maxLineWidth:a,hasBackground:!1}),b=n;if(!b)return null;const M=e,T=[x.bounds.blX,x.bounds.trY],w=[x.bounds.trX,x.bounds.trY],k=[x.bounds.blX,x.bounds.blY],E=[x.bounds.trX,x.bounds.blY];T[0]-=x.bounds.x,T[1]-=x.bounds.y,w[0]-=x.bounds.x,w[1]-=x.bounds.y,k[0]-=x.bounds.x,k[1]-=x.bounds.y,E[0]-=x.bounds.x,E[1]-=x.bounds.y,T[0]*=M,T[1]*=M,w[0]*=M,w[1]*=M,k[0]*=M,k[1]*=M,E[0]*=M,E[1]*=M,this._textLength=1.1*(Math.max(T[0],w[0],k[0],E[0])-Math.min(T[0],w[0],k[0],E[0])),this._dimensionAngleRad&&(j(T,this._dimensionAngleRad),j(w,this._dimensionAngleRad),j(k,this._dimensionAngleRad),j(E,this._dimensionAngleRad)),T[0]+=b[0],T[1]+=b[1],w[0]+=b[0],w[1]+=b[1],k[0]+=b[0],k[1]+=b[1],E[0]+=b[0],E[1]+=b[1];const R=Math.min(T[0],w[0],k[0],E[0]),A=Math.min(T[1],w[1],k[1],E[1]),v=Math.max(T[0],w[0],k[0],E[0]),F=Math.max(T[1],w[1],k[1],E[1]);return new y(R,A,1.1*(v-R),1.1*(F-A))}_getDimensionText(i){const{attributes:n}=i;let e=null;const t=1===Number(z(w.useCustomLength,n));e=Number(z(t?w.customLength:w.dimLength,n)),(0===e||isNaN(e)||null==e)&&(e=this._systemLength);let s=this._getDimensionString(e,i);return"number"==typeof s&&(s=s.toString()),n.__COMPUTED_TEXT_STRING__=s,s||""}_getDimensionString(i,n){const{displayUnits:t,displayPrecision:s,prefix:o,suffix:h,textOption:r}=this._dimensionStyle;if("None"===r)return null;if("Expression"===r&&this._compiledExpression&&n)return b(this._compiledExpression,n,{},"esriGeometryPolyline",this._fieldsIndex);if(t){const n=G(this._spatialReference),s=G(t);n&&s&&(i=e(i,n,s))}let l=(i=null==s||isNaN(s)?parseFloat(i.toString()):parseFloat(i.toFixed(s))).toString();return"Suffix"===r&&(o&&(l=`${o} ${l}`),h&&(l=`${l} ${h}`)),l}}function G(i){return"object"!=typeof i||null==i?null:"uwkid"in i&&"number"==typeof i.uwkid?t(i.uwkid):s(i)}function X(i){const{attributes:n}=i,e=Object.keys(w).map(i=>({name:i,alias:i,type:"string"==typeof n[i]?"esriFieldTypeString":"esriFieldTypeDouble"}));return new u(e)}export{U as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getFontFamily as t}from"../../../../../core/fontUtils.js";import{deg2rad as n,rad2deg as o}from"../../../../../core/mathUtils.js";import{set as i,len as e,scaleAndAdd as r,dot as c}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as a}from"../../../../../geometry/support/boundsUtils.js";import{fromCIMFontDecoration as f,fromCIMFontStyle as h}from"../../../../../symbols/cim/utils.js";import m from"../../../engine/webgl/Rect.js";function l(n){const o=f(n),{style:i,weight:e}=h(n.fontStyleName);return{family:t(n.fontFamilyName),decoration:o,style:i,weight:e}}function y(t){const n=(t.symbolLayers||[]).map(t=>"CIMVectorMarker"!==t.type||t.anchorPoint||!t.frame?t:{...t,anchorPointUnits:"Absolute",anchorPoint:{x:-t.frame.xmin,y:0}});return{...t,symbolLayers:n}}function x(t,n,o){if(!t?.symbolLayers?.length)return null;const i=y(t);let e=null;for(const
|
|
2
|
+
import{getFontFamily as t}from"../../../../../core/fontUtils.js";import{deg2rad as n,rad2deg as o}from"../../../../../core/mathUtils.js";import{set as i,len as e,scaleAndAdd as r,dot as c}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as a}from"../../../../../geometry/support/boundsUtils.js";import{fromCIMFontDecoration as f,fromCIMFontStyle as h}from"../../../../../symbols/cim/utils.js";import m from"../../../engine/webgl/Rect.js";function l(n){const o=f(n),{style:i,weight:e}=h(n.fontStyleName);return{family:t(n.fontFamilyName),decoration:o,style:i,weight:e}}function y(t){const n=(t.symbolLayers||[]).map(t=>"CIMVectorMarker"!==t.type||t.anchorPoint||!t.frame?t:{...t,anchorPointUnits:"Absolute",anchorPoint:{x:-t.frame.xmin,y:0}});return{...t,symbolLayers:n}}function x(t,n,o){if(!t?.symbolLayers?.length)return null;const i=y(t);let e=null;for(const r of i.symbolLayers||[]){const t=M(r,n);t&&(e=e?N(e,t):t)}return e??new m(-16,-16,32,32)}function M(t,n){switch(t.type){case"CIMVectorMarker":return g(t,n);case"CIMPictureMarker":return P(t,n);default:return p(t,n)}}function g(t,n){const o=d(t.markerGraphics),i=t.frame,e=i?new m(i.xmin,i.ymin,i.xmax-i.xmin,i.ymax-i.ymin):null,r=o??e??w(t.size);if(!r)return null;const c=b(r),s=null!=i?.xmax&&null!=i?.xmin?i.xmax-i.xmin:r.width,u=null!=i?.ymax&&null!=i?.ymin?i.ymax-i.ymin:r.height,a=t.size&&u?t.size/u:1;if(e&&D(c,.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin)),t.anchorPoint){let n=t.anchorPoint.x,o=t.anchorPoint.y;"Absolute"!==t.anchorPointUnits?(n*=s,o*=u):0!==a&&(n/=a,o/=a),D(c,-n,-o)}return 1!==a&&T(c,a,a),I(c,t,n),E(c)}function P(t,n){const o=t.size;if(!o)return null;const i=o*(t.scaleX??1),e=b(new m(-i/2,-o/2,i,o));if(t.anchorPoint){let n=t.anchorPoint.x,r=t.anchorPoint.y;"Absolute"!==t.anchorPointUnits&&(n*=i,r*=o),D(e,-n,-r)}return I(e,t,n),E(e)}function p(t,n){const o=w(t.size);if(!o)return null;const i=b(o);if(t.anchorPoint){let n=t.anchorPoint.x,e=t.anchorPoint.y;"Absolute"!==t.anchorPointUnits&&(n*=o.width,e*=o.height),D(i,-n,-e)}return I(i,t,n),E(i)}function d(t){let n=null;for(const o of t||[]){if(!o.geometry)continue;const t=a(u(),o.geometry),i=new m(t[0],t[1],t[2]-t[0],t[3]-t[1]);n=n?N(n,i):i}return n}function w(t){return t?new m(-t/2,-t/2,t,t):null}function I(t,n,o){const i=n.rotation??0,e=(n.rotateClockwise?-i:i)*(Math.PI/180);e&&L(t,e),(n.offsetX||n.offsetY)&&D(t,n.offsetX??0,n.offsetY??0),o&&L(t,o)}function b(t){return[[t.x,t.y],[t.x+t.width,t.y],[t.x+t.width,t.y+t.height],[t.x,t.y+t.height]]}function E(t){let n=1/0,o=1/0,i=-1/0,e=-1/0;for(const[r,c]of t)n=Math.min(n,r),o=Math.min(o,c),i=Math.max(i,r),e=Math.max(e,c);return new m(n,o,i-n,e-o)}function D(t,n,o){for(const i of t)i[0]+=n,i[1]+=o}function T(t,n,o){for(const i of t)i[0]*=n,i[1]*=o}function L(t,n){for(const o of t)H(o,n)}function N(t,n){const o=Math.min(t.x,n.x),i=Math.min(t.y,n.y),e=Math.max(t.x+t.width,n.x+n.width),r=Math.max(t.y+t.height,n.y+n.height);return new m(o,i,e-o,r-i)}var X;function Y(t){const n=null==t?NaN:Number(t);return isNaN(n)?Math.PI/2:n}function A(t,n,o,r){const c=i(s(),o[0]-t[0],o[1]-t[1]);if(0===e(c))return null;const u=F(c),a=O(o,u-U(r),n,u);return a?{beginDimensionPoint:i(s(),o[0],o[1]),endDimensionPoint:a}:null}function U(t){const i=o(t);return i>=-1&&i<=1?t+n(1):i>=179&&i<=181?t-n(1):t}function j(t,n,o){const c=i(s(),n[0]-t[0],n[1]-t[1]),u=e(c);return 0===u?[t[0],t[1]]:r(s(),t,c,o/u)}function S(t){return{left:t.x,right:t.x+t.width,top:t.y+t.height,bottom:t.y}}function C(t,n){const o=S(t),i=S(n),e=o.left<=i.right&&i.left<=o.right,r=o.bottom<=i.top&&i.bottom<=o.top;return e&&r}function G(t,n,o){const i=k(t,o),e=k(n,o);return i[0]<=e[1]&&e[0]<=i[1]}function k(t,n){const o=[[t.x,t.y],[t.x+t.width,t.y],[t.x+t.width,t.y+t.height],[t.x,t.y+t.height]];let i=1/0,e=-1/0;for(const[r,s]of o){const t=c([r,s],n);i=Math.min(i,t),e=Math.max(e,t)}return[i,e]}function z(t,n){return new m(t.x*n,t.y*n,t.width*n,t.height*n)}function B(t,n,o){return new m(t.x+n,t.y+o,t.width,t.height)}function H(t,n){const o=t[0],i=t[1];t[0]=o*Math.cos(n)-i*Math.sin(n),t[1]=o*Math.sin(n)+i*Math.cos(n)}!function(t){t.objectId="OBJECTID",t.shape="SHAPE",t.dimLength="DIMLENGTH",t.beginX="BEGINX",t.beginY="BEGINY",t.endX="ENDX",t.endY="ENDY",t.textX="TEXTX",t.textY="TEXTY",t.styleId="STYLEID",t.dimX="DIMX",t.dimY="DIMY",t.customLength="CUSTOMLENGTH",t.useCustomLength="USECUSTOMLENGTH",t.dimDisplay="DIMDISPLAY",t.extDisplay="EXTDISPLAY",t.markerDisplay="MARKERDISPLAY",t.extAngle="EXTANGLE",t.dimType="DIMTYPE",t.textAngle="TEXTANGLE"}(X||(X={}));const R=1e-9;function v(t,n){return t[0]*n[1]-t[1]*n[0]}function O(t,n,o,i){return V(t,n,o,i)?.point??null}function V(t,n,o,e){const c=i(s(),Math.cos(n),Math.sin(n)),u=i(s(),Math.cos(e),Math.sin(e)),a=i(s(),o[0]-t[0],o[1]-t[1]),f=v(c,u);if(Math.abs(f)<=R)return null;const h=v(a,u)/f,m=v(a,c)/f;return{point:r(s(),t,c,h),t1:h,t2:m}}function F(t){const n=t[0],o=t[1];if(0===n&&0===o)return 0;if(0===n&&o>0)return Math.PI/2;if(0===n&&o<0)return 3*Math.PI/2;if(n<0&&0===o)return Math.PI;if(n>0&&0===o)return 0;let i=Math.atan2(o,n);return i<0&&(i+=2*Math.PI),i}export{X as DimensionRealFieldName,F as angleFromXAxis,U as capDimensionExtensionAngle,l as getFontForCIMTextSymbol,O as intersectLinesByPointsAndAngles,x as measureMarkerSymbolSize,Y as normalizeExtensionAngle,A as projectLinearDimensionPoints,k as projectRectToAxis,j as queryPointOnLine,C as rectsOverlap,G as rectsOverlapOnAxis,y as repositionMarkerSymbol,H as rotatePoint,z as scaleRect,S as toBounds,B as translateRect};
|
|
@@ -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"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{watch as o,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{DragZoomBox as g}from"./handlers/DragZoomBox.js";import{GamepadNavigation as h}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as l}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as c}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as w}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as f}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundNavigation as y}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as _}from"../../input/BrowserEventSource.js";import{InputManager as D,ViewEventPriorities as j}from"../../input/InputManager.js";import{PreventContextMenu as P}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as A}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as M}from"../../input/handlers/support.js";import{Drag as T}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as b}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as N}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{watch as o,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{DragZoomBox as g}from"./handlers/DragZoomBox.js";import{GamepadNavigation as h}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as l}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as c}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as w}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as f}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundNavigation as y}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as _}from"../../input/BrowserEventSource.js";import{InputManager as D,ViewEventPriorities as j}from"../../input/InputManager.js";import{PreventContextMenu as P}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as A}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as M}from"../../input/handlers/support.js";import{Drag as T}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as b}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as N}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as S}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as I}from"../../input/recognizers/VerticalTwoFingerDrag.js";let k=class extends t{constructor(){super(...arguments),this.mode="default",this._keys={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"]},modifier:["b","B"],zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]},precisionPanModifier:"Alt",coarsePanModifier:"Shift"},this._updateMode=({mode:e,dragPrimary:t,dragSecondary:r,dragTertiary:o})=>{"pro"===e&&(r="zoom",o="pan"===t?"rotate":"pan");const i={dragPrimary:t,dragSecondary:r,dragTertiary:o};this._modeDragPan&&(this._modeDragPan.pointerActions=M("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=M("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=M("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(e){const{actionMap:t}=this.view.navigation;t.dragPrimary=e,t.dragSecondary="pan"===e?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=r(this._inputManager),this._source=r(this._source)}connect(){const e=this.view;this._source=new _(this.view.surface,e.input);const t=[new b,new N,new S,new T(this.view.navigation),new I],r=new D({eventSource:this._source,recognizers:t});this._inputManager=r,r.installHandlers("prevent-context-menu",[new P],j.INTERNAL),r.installHandlers("prevent-touch-text-selection-gesture",[new A(this.view)],j.INTERNAL),this._modeDragPan=new w(e,["primary"]),this._modeDragRotate=new m(e,["secondary"],0),this._modeDragZoom=new p(e,["tertiary"],this._keys.fov),this._modeKeyboardNavigation=new l(e,this._keys),r.installHandlers("navigation",[new f(e),new d(e),new h(e),new c(e,this._keys.fov),new u(e),new g(e),new m(e,["primary"],1,this._keys.modifier),new y(e,["secondary"],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new v(e)],j.INTERNAL),this.view.viewEvents.connect(r),this.addHandles([o(()=>this.view.navigation?.browserTouchPanEnabled,e=>{this._source.browserTouchPanningEnabled=!e},i),o(()=>{const{actionMap:e}=this.view.navigation,{dragPrimary:t,dragSecondary:r,dragTertiary:o}=e;return{mode:this.mode,dragPrimary:t,dragSecondary:r,dragTertiary:o}},this._updateMode,n)])}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}get test(){}};e([a()],k.prototype,"view",void 0),e([a({type:["default","pro"]})],k.prototype,"mode",void 0),e([a({readOnly:!0})],k.prototype,"updating",null),e([a()],k.prototype,"latestPointerInfo",null),e([a()],k.prototype,"latestPenInfo",null),e([a()],k.prototype,"multiTouchActive",null),e([a()],k.prototype,"_inputManager",void 0),k=e([s("esri.views.3d.input.SceneInputManager")],k);const z=k;export{z as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{GamepadKeyboardController as
|
|
2
|
+
import{GamepadKeyboardController as e}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as t}from"../../../input/VisibilityChange.js";class a extends i{constructor(e,i){super(!0),this._view=e,this._keyToDirection=new Map,this._keyToAction=new Map,this._precisionPanModifierKeys=new Set,this._coarsePanModifierKeys=new Set,this._stickyKeyTimeoutHandle=void 0,this._stickyKeyDuration=200,this._addKeysMapping(i),this.registerIncoming("key-down",null,e=>this._handleKeyDown(e)),this.registerIncoming("key-up",null,e=>this._handleKeyUp(e)),this.registerIncoming("blur",null,()=>this._handleStop()),this._visibilityHandle=t(e=>e?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}setStickyKeyDuration(e){this._stickyKeyDuration=e}_addKeysMapping(e){this._addKeyMapping(e.pan.left,0),this._addKeyMapping(e.pan.right,1),this._addKeyMapping(e.pan.forward,2),this._addKeyMapping(e.pan.backward,3),this._addKeyMapping(e.pan.up,4),this._addKeyMapping(e.pan.down,5),this._addKeyMapping(e.lookAround.headingLeft,6),this._addKeyMapping(e.lookAround.headingRight,7),this._addKeyMapping(e.lookAround.tiltUp,8),this._addKeyMapping(e.lookAround.tiltDown,9),this._addKeyMapping(e.zoom.zoomIn,10),this._addKeyMapping(e.zoom.zoomOut,11),this._addKeyAction(e.reset.heading,()=>this._resetHeading()),this._addKeyAction(e.reset.tilt,()=>this._resetTilt());for(const i of this._eachKey(e.precisionPanModifier))this._precisionPanModifierKeys.add(i);for(const i of this._eachKey(e.coarsePanModifier))this._coarsePanModifierKeys.add(i)}_addKeyMapping(e,i){for(const t of this._eachKey(e))this._keyToDirection.set(t,i)}*_eachKey(e){"string"==typeof e?yield e:yield*e}_addKeyAction(e,i){for(const t of this._eachKey(e))this._keyToAction.set(t,i)}_handleKeyDown(i){if(i.data.native.ctrlKey||i.data.native.metaKey)return;if(this._precisionPanModifierKeys.has(i.data.key))return void this._updatePrecisionPanState(!0);if(this._coarsePanModifierKeys.has(i.data.key))return void this._updateCoarsePanState(!0);const t=this._keyToAction.get(i.data.key);if(null!=t)return i.stopPropagation(),void t();const a=this._keyToDirection.get(i.data.key);if(null!=a&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.running||(this._cameraControllerKeyboard=new e({view:this._view}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.running)){if(i.stopPropagation(),this._cameraControllerKeyboard.setPrecisionPanEnabled(this._isPrecisionPanModifierActive(i.modifiers)),this._cameraControllerKeyboard.setCoarsePanEnabled(this._isCoarsePanModifierActive(i.modifiers)),this._cameraControllerKeyboard.directionActive(a))return;if(this._cameraControllerKeyboard.activateDirection(a),this._cameraControllerKeyboard.countActiveDirections()>1||!this._isPanning(a))return;this._stickyKeyDuration>0&&(this._stickyKeyTimeoutHandle=setTimeout(()=>{this._stickyKeyTimeoutHandle=void 0,null!=this._stickyDirection&&void 0!==this._stickyDirection&&(this._cameraControllerKeyboard?.deactivateDirection(this._stickyDirection),this._stickyDirection=void 0)},this._stickyKeyDuration))}}_handleStop(){this._cameraControllerKeyboard?.running&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(e){if(e.data.native.ctrlKey||e.data.native.metaKey||!this._cameraControllerKeyboard?.running)return;if(this._precisionPanModifierKeys.has(e.data.key))return void this._updatePrecisionPanState(!1);if(this._coarsePanModifierKeys.has(e.data.key))return void this._updateCoarsePanState(!1);const i=this._keyToDirection.get(e.data.key);if(null==i)return;this._cameraControllerKeyboard.setPrecisionPanEnabled(this._isPrecisionPanModifierActive(e.modifiers)),this._cameraControllerKeyboard.setCoarsePanEnabled(this._isCoarsePanModifierActive(e.modifiers)),e.stopPropagation();const t=void 0===this._stickyKeyTimeoutHandle;void 0===this._stickyKeyTimeoutHandle||1!==this._cameraControllerKeyboard?.countActiveDirections()?(this._cameraControllerKeyboard?.deactivateDirection(i),t&&(this._stickyDirection=void 0)):this._stickyDirection=i}_isPanning(e){return e<=3}_isPrecisionPanModifierActive(e){return this._precisionPanModifierKeys.values().some(i=>e.has(i))}_isCoarsePanModifierActive(e){return this._coarsePanModifierKeys.values().some(i=>e.has(i))}_hasActivePanDirection(){return!!this._cameraControllerKeyboard&&(this._cameraControllerKeyboard.directionActive(0)||this._cameraControllerKeyboard.directionActive(1)||this._cameraControllerKeyboard.directionActive(2)||this._cameraControllerKeyboard.directionActive(3))}_updatePrecisionPanState(e){this._cameraControllerKeyboard?.running&&(e?this._cameraControllerKeyboard.setPrecisionPanEnabled(this._hasActivePanDirection()):this._cameraControllerKeyboard.setPrecisionPanEnabled(!1))}_updateCoarsePanState(e){this._cameraControllerKeyboard?.running&&(e?this._cameraControllerKeyboard.setCoarsePanEnabled(this._hasActivePanDirection()):this._cameraControllerKeyboard.setCoarsePanEnabled(!1))}_resetHeading(){this._view.goTo({heading:0}).catch(()=>{})}_resetTilt(){this._view.goTo({tilt:0}).catch(()=>{})}}export{a as KeyboardNavigation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{px2pt as t,pt2px as r}from"../../../../core/screenUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as s,clone as o,ones as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as n,fromBuffer as c,intersectsClippingArea as p,empty as h,expandWithAABB as m,expandWithBuffer as u}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as d}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as _}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as y,needsElevationUpdates2D as f}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as g}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as v,nanFallbackColor as C}from"./Graphics3DSymbolLayer.js";import{parseCapType as P,computeSymbolLayerIndex as k,parseLineMarkerStyle as M}from"./lineUtils.js";import{initFastSymbolUpdatesState as S,updateFastSymbolUpdatesState as w,getAttributeValue as L,getSizeAttributeValue as z,ConvertOptions as x}from"../support/FastSymbolUpdates.js";import{debugFlags as U}from"../../support/debugFlags.js";import{createGeometry as O}from"../../support/engineContent/line.js";import{geometryToRenderInfo as V,geometryToRenderInfoDraped as j}from"../../support/renderInfoUtils/line.js";import{Object3D as A}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as E}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as D}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as F}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as G}from"../../webgl-engine/materials/RibbonLineMaterial.js";const I=["polyline"];class R extends v{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,B(t))}async doLoad(){this._fastUpdates=S(this._context.renderer,this._fastVisualVariableConvertOptions());const r=!0;if(this._fastMarkerUpdates=S(this._context.renderer,this._fastVisualVariableConvertOptions(r)),!this._drivenProperties.size){if((null!=this.symbolLayer.size?this.symbolLayer.size:t(1))<0)throw new e("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values")}}_getMaterialParameters(e,t){const r=this._screenSizePerspective,i=!!has("enable-feature:emissive-on-non-volumetric")&&!this.draped,{symbolLayer:a}=this,s={...this._getMaterialColorParameters(t),shadingEnabled:i,width:this._computeMaterialWidth(a?.size),polygonOffset:3,polygonOffsetIndex:k(this._renderPriority,this._renderPriorityStep),join:a.join||"miter",cap:P(a.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:F(a.pattern??a.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:r};return 4===t&&this._fastMarkerUpdates?.visualVariables?{...s,...this._fastMarkerUpdates.materialParameters}:this._fastUpdates?.visualVariables?{...s,...this._fastUpdates.materialParameters}:s}_getMaterialColorParameters(e){const t=4===e,r=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(r[3]=0),{color:r}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){const e=this.symbolLayer.material?.emissive;return("color"===e?.source?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return null==this._materials[0]&&(this._materials[0]=new G(this._getMaterialParameters(!1,0),this.view.state.isGlobal)),this._materials[0]}get _wireframeLineMaterial(){return null==this._materials[2]&&(this._materials[2]=new G({...this._getMaterialParameters(!1,2),wireframe:!0},this.view.state.isGlobal)),this._materials[2]}get _markerMaterial(){return null==this._materials[4]&&null!=this.symbolLayer.marker&&(this._materials[4]=new D({...this._getMaterialParameters(!1,4),placement:this.symbolLayer.marker.placement,markerPrimitive:M(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[4]}_getDrivenSize(e){if(this._drivenProperties.size){const t=e.size;return null!=t?r(d(t.output)):this._getFallbackSize()}return 1}_getDrivenColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(a(r,e?.output??this._getFallbackOpacityAndColor(s)),null==t)||this._drivenProperties.opacity&&(e||this._materialColor)&&(r[3]=t?.output??this._getFallbackOpacity()),r}_getDrivenMarkerColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(a(r,e?.output??this._getFallbackMarkerOpacityAndColor(s)),null==t)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(r[3]=t?.output??this._getFallbackMarkerOpacity()),r}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validatePolylineContext(e))return null;const r=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,r,t.uid)}_validatePolylineContext(e){const t=e.graphic.geometry;return this._validateGeometry(t,I,this.symbolLayer.type)&&"polyline"===t.type}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;{const e=this._fastUpdates;if(!w(e,t,this._fastVisualVariableConvertOptions()))return 0;for(const t of this._materials)t instanceof G&&t.setParameters(e.materialParameters);const r=this._fastMarkerUpdates,i=!0;if(!w(r,t,this._fastVisualVariableConvertOptions(i)))return 0;for(const t of this._materials)t instanceof D&&t.setParameters(r.materialParameters)}}return 2}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff,r={};"complete"===t.size?.type&&(r.width=this._computeMaterialWidth(t.size.newValue),delete t.size),"complete"===t.cap?.type&&(r.cap=P(t.cap.newValue??"butt"),delete t.cap);const i=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,i),e.symbolLayerStatePatches.push(()=>{for(const e of this._materials)e?.setParameters(r)})}layerOpacityChanged(){for(let e=0;e<5;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){const e=this._screenSizePerspective;for(const t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,a=y(R.elevationModeChangeTypes,r,i);if(1!==a)return a;const s=f(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>s)}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};for(const t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const i=W(e.graphic.geometry);if(null==i)return null;const a=new Array,s=n(),o=V(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(o,i.paths,"paths","LineSymbol3DLayer");for(let n=0;n<o.lines.length;n++){const t=o.lines[n],l=t.position,h=t.mapPositions;if(null!=this._context.clippingExtent&&(c(h,s),!p(s,this._context.clippingExtent)))continue;const m=this._createGeometry(this._lineMaterial,e,l,h,i.type,1,r);if(a.push(m),U.LINE_WIREFRAMES&&a.push(m.instantiate({material:this._wireframeLineMaterial})),null!=this._markerMaterial){const t=m.instantiate({material:this._markerMaterial});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(0===a.length)return null;const l=this._context.layerViewUid,h=new A({geometries:a,castShadow:!1,layerViewUid:l,graphicUid:r}),m=new b(this,h,null,_,t);return m.alignedSampledElevation=o.sampledElevation,m.needsElevationUpdates=f(t.mode),m}_createGeometry(e,t,r,i,a,s,o){const l=0===s?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,n="polygon"===a,c=this._fastUpdates?.visualVariables.color,p=this._fastUpdates?.visualVariables.size,h=this._fastUpdates?.visualVariables.opacity,m=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:m}),{renderingInfo:d}=t,_={position:r,size:p?null:this._getDrivenSize(d),color:c?null:this._getDrivenColor(d),sizeFeature:p?z(p,d.size):null,colorFeature:c?L(c,d.color):null,opacityFeature:h?L(h,d.opacity):null};return O(e,{overlayInfo:l,removeDuplicateStartEnd:n,mapPositions:i,attributeData:_},u)}_createAsOverlay(e){const t=e.graphic,{geometry:r}=t;this._lineMaterial.renderPriority=this._renderPriority;const i=U.LINE_WIREFRAMES?this._wireframeLineMaterial:null,a=this._markerMaterial;null!=i&&(i.renderPriority=this._renderPriority-.001),null!=a&&(a.renderPriority=this._renderPriority-.002);const s=new Array,o=n(),l=h(),d=j(r,this._context.overlaySR);this._logGeometryCreationWarnings(d,r.paths,"paths","LineSymbol3DLayer");for(const n of d.lines){if(c(n.position,o),!p(o,this._context.clippingExtent))continue;m(l,o);const h=this._createGeometry(this._lineMaterial,e,n.position,void 0,r.type,0,t.uid),d=e=>{const r=this._context.layerViewUid,i=new E(e,{layerViewUid:r,graphicUid:t.uid});s.push(i)};if(null!=a){const t=h.instantiate({material:a});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),d(t);const r=this.symbolLayer.marker.placement;"begin"!==r&&"begin-end"!==r||u(o,n.position,0,1),"end"!==r&&"begin-end"!==r||u(o,n.position,n.position.length-3,1)}d(h),U.LINE_WIREFRAMES&&d(h.instantiate({material:i}))}return new g(this,s,l,this._context.drapeSourceRenderer)}get _patternHidesLine(){const e=this.symbolLayer.pattern;return null!=e&&"style"===e.type&&"none"===e.style}_computeMaterialWidth(e){return e=e??t(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r(1):1:r(e)}_prepareMaterialPatch(e,t,r){const i=t.material;if(null==i)return void(r.changed&&r.useMaterialColor&&H(this._getCombinedOpacityAndColor(this._materialColor),this._materials[4],e));if("collection"===i.type)return;const a="complete"===i.type?i.newValue?.color:"complete"===i.diff.color?.type?i.diff.color.newValue:null,s=this._getCombinedOpacityAndColor(a);r.useMaterialColor&&H(o(s),this._materials[4],e),this._patternHidesLine&&(s[3]=0),H(s,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){const r=t.marker,i=this._markerMaterial;if(null==r||"partial"!==r.type||null==r.diff||null!=r.diff.placement||null!=r.diff.style&&"complete"!==r.diff.style.type||null!=r.diff.color&&"complete"!==r.diff.color.type||null==i)return{changed:!1,useMaterialColor:null==this._markerColor};const a=r.diff.color,s=null!=a,o=s?a.newValue:null,l=null==o&&null==this._markerColor;o&&H(this._getCombinedOpacityAndColor(o),i,e);const n=r.diff.style?.newValue;return n&&e.symbolLayerStatePatches.push(()=>i.setParameters({markerPrimitive:M(n)})),delete t.marker,{changed:s,useMaterialColor:l}}_fastVisualVariableConvertOptions(e=!1){const t=this._getFallbackSize();return new x({supports:{size:!0,color:!0,rotation:!1,opacity:!0},fallbackColor:e?this._getFallbackMarkerOpacityAndColor(C):this._getFallbackOpacityAndColor(C),fallbackSize:i(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer?.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer?.marker?.color?.a??this._getFallbackOpacity()}_getFallbackSize(){const e=this.symbolLayer?.size;return null!=e?r(e):1}}function W(e){return"polyline"===e.type?e:null}function H(e,t,r){null!=t&&r.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function B(e){return 1===(e.material?.color?.a??1)&&1===(e.marker?.color?.a??1)}export{R as Graphics3DLineSymbolLayer};
|
|
2
|
+
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{px2pt as t,pt2px as r}from"../../../../core/screenUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as s,clone as o,ones as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as n,fromBuffer as c,intersectsClippingArea as h,empty as p,expandWithAABB as m,expandWithBuffer as d}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as u}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as _}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as y,needsElevationUpdates2D as f}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as g}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as v,nanFallbackColor as C}from"./Graphics3DSymbolLayer.js";import{parseCapType as P,computeSymbolLayerIndex as S,parseLineMarkerStyle as k}from"./lineUtils.js";import{initFastSymbolUpdatesState as w,updateFastSymbolUpdatesState as M,getAttributeValue as z,getSizeAttributeValue as L,ConvertOptions as O}from"../support/FastSymbolUpdates.js";import{debugFlags as x}from"../../support/debugFlags.js";import{createGeometry as U}from"../../support/engineContent/line.js";import{geometryToRenderInfo as E,geometryToRenderInfoDraped as V}from"../../support/renderInfoUtils/line.js";import{Object3D as j}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as A}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as D}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as F}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as G}from"../../webgl-engine/materials/RibbonLineMaterial.js";const I=["polyline"];class R extends v{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,B(t))}async doLoad(){this._fastUpdates=w(this._context.renderer,this._fastVisualVariableConvertOptions());const r=!0;if(this._fastMarkerUpdates=w(this._context.renderer,this._fastVisualVariableConvertOptions(r)),!this._drivenProperties.size){if((null!=this.symbolLayer.size?this.symbolLayer.size:t(1))<0)throw new e("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values")}}_getMaterialParameters(e,t){const r=this._screenSizePerspective,i=!!has("enable-feature:emissive-on-non-volumetric")&&!this.draped,{symbolLayer:a}=this,s=this._worldSizedEnabled,o={...this._getMaterialColorParameters(t),shadingEnabled:i,width:this._computeMaterialWidth(a?.size,s),worldSized:s,polygonOffset:3,polygonOffsetIndex:S(this._renderPriority,this._renderPriorityStep),join:a.join||"miter",cap:P(a.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:F(a.pattern??a.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:r};return 4===t&&this._fastMarkerUpdates?.visualVariables?{...o,...this._fastMarkerUpdates.materialParameters}:this._fastUpdates?.visualVariables?{...o,...this._fastUpdates.materialParameters}:o}_getMaterialColorParameters(e){const t=4===e,r=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(r[3]=0),{color:r}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){const e=this.symbolLayer.material?.emissive;return("color"===e?.source?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return null==this._materials[0]&&(this._materials[0]=new G(this._getMaterialParameters(!1,0),this.view.state.isGlobal)),this._materials[0]}get _wireframeLineMaterial(){return null==this._materials[2]&&(this._materials[2]=new G({...this._getMaterialParameters(!1,2),wireframe:!0},this.view.state.isGlobal)),this._materials[2]}get _markerMaterial(){return null==this._materials[4]&&null!=this.symbolLayer.marker&&(this._materials[4]=new D({...this._getMaterialParameters(!1,4),placement:this.symbolLayer.marker.placement,markerPrimitive:k(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[4]}_getDrivenSize(e){if(this._drivenProperties.size){const t=e.size;if(null==t)return this._getFallbackSize();const r=u(t.output);return this._getWorldOrScreenSize(r)}return 1}_getDrivenColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(a(r,e?.output??this._getFallbackOpacityAndColor(s)),null==t)||this._drivenProperties.opacity&&(e||this._materialColor)&&(r[3]=t?.output??this._getFallbackOpacity()),r}_getDrivenMarkerColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(a(r,e?.output??this._getFallbackMarkerOpacityAndColor(s)),null==t)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(r[3]=t?.output??this._getFallbackMarkerOpacity()),r}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validatePolylineContext(e))return null;const r=this.createElevationContextForGraphic(t),i="on-the-ground"===r.mode;return"line-3d"===this.symbol.type&&this.symbol.worldSized&&!i?(this.logger.warnOnce("World-sized LineSymbol3DLayer can only be displayed in layers with 'on-the-ground' elevation mode; graphic skipped"),null):(this.ensureDrapedStatus(i),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,r,t.uid))}_validatePolylineContext(e){const t=e.graphic.geometry;return this._validateGeometry(t,I,this.symbolLayer.type)&&"polyline"===t.type}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;{const e=this._fastUpdates;if(!M(e,t,this._fastVisualVariableConvertOptions()))return 0;for(const t of this._materials)t instanceof G&&t.setParameters(e.materialParameters);const r=this._fastMarkerUpdates,i=!0;if(!M(r,t,this._fastVisualVariableConvertOptions(i)))return 0;for(const t of this._materials)t instanceof D&&t.setParameters(r.materialParameters)}}return 2}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff,r={};"complete"===t.size?.type&&(r.width=this._computeMaterialWidth(t.size.newValue,this._worldSizedEnabled),delete t.size),"complete"===t.cap?.type&&(r.cap=P(t.cap.newValue??"butt"),delete t.cap);const i=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,i),e.symbolLayerStatePatches.push(()=>{for(const e of this._materials)e?.setParameters(r)})}layerOpacityChanged(){for(let e=0;e<5;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){const e=this._screenSizePerspective;for(const t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,a=y(R.elevationModeChangeTypes,r,i);if(1!==a)return a;const s=f(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>s)}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};for(const t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const i=W(e.graphic.geometry);if(null==i)return null;const a=new Array,s=n(),o=E(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(o,i.paths,"paths","LineSymbol3DLayer");for(let n=0;n<o.lines.length;n++){const t=o.lines[n],l=t.position,p=t.mapPositions;if(null!=this._context.clippingExtent&&(c(p,s),!h(s,this._context.clippingExtent)))continue;const m=this._createGeometry(this._lineMaterial,e,l,p,i.type,1,r);if(a.push(m),x.LINE_WIREFRAMES&&a.push(m.instantiate({material:this._wireframeLineMaterial})),null!=this._markerMaterial){const t=m.instantiate({material:this._markerMaterial});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(0===a.length)return null;const l=this._context.layerViewUid,p=new j({geometries:a,castShadow:!1,layerViewUid:l,graphicUid:r}),m=new b(this,p,null,_,t);return m.alignedSampledElevation=o.sampledElevation,m.needsElevationUpdates=f(t.mode),m}_createGeometry(e,t,r,i,a,s,o){const l=0===s?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,n="polygon"===a,c=this._fastUpdates?.visualVariables.color,h=this._fastUpdates?.visualVariables.size,p=this._fastUpdates?.visualVariables.opacity,m=this._context.layerViewUid,d=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:m}),{renderingInfo:u}=t,_={position:r,size:h?null:this._getDrivenSize(u),color:c?null:this._getDrivenColor(u),sizeFeature:h?L(h,u.size):null,colorFeature:c?z(c,u.color):null,opacityFeature:p?z(p,u.opacity):null};return U(e,{overlayInfo:l,removeDuplicateStartEnd:n,mapPositions:i,attributeData:_},d)}_createAsOverlay(e){const t=e.graphic,{geometry:r}=t;this._lineMaterial.renderPriority=this._renderPriority;const i=x.LINE_WIREFRAMES?this._wireframeLineMaterial:null,a=this._markerMaterial;null!=i&&(i.renderPriority=this._renderPriority-.001),null!=a&&(a.renderPriority=this._renderPriority-.002);const s=new Array,o=n(),l=p(),u=V(r,this._context.overlaySR);this._logGeometryCreationWarnings(u,r.paths,"paths","LineSymbol3DLayer");for(const n of u.lines){if(c(n.position,o),!h(o,this._context.clippingExtent))continue;m(l,o);const p=this._createGeometry(this._lineMaterial,e,n.position,void 0,r.type,0,t.uid),u=e=>{const r=this._context.layerViewUid,i=new A(e,{layerViewUid:r,graphicUid:t.uid});s.push(i)};if(null!=a){const t=p.instantiate({material:a});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),u(t);const r=this.symbolLayer.marker.placement;"begin"!==r&&"begin-end"!==r||d(o,n.position,0,1),"end"!==r&&"begin-end"!==r||d(o,n.position,n.position.length-3,1)}u(p),x.LINE_WIREFRAMES&&u(p.instantiate({material:i}))}return new g(this,s,l,this._context.drapeSourceRenderer)}get _patternHidesLine(){const e=this.symbolLayer.pattern;return null!=e&&"style"===e.type&&"none"===e.style}_computeMaterialWidth(e,i){return i?e??1:(e=e??t(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r(1):1:r(e))}_prepareMaterialPatch(e,t,r){const i=t.material;if(null==i)return void(r.changed&&r.useMaterialColor&&H(this._getCombinedOpacityAndColor(this._materialColor),this._materials[4],e));if("collection"===i.type)return;const a="complete"===i.type?i.newValue?.color:"complete"===i.diff.color?.type?i.diff.color.newValue:null,s=this._getCombinedOpacityAndColor(a);r.useMaterialColor&&H(o(s),this._materials[4],e),this._patternHidesLine&&(s[3]=0),H(s,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){const r=t.marker,i=this._markerMaterial;if(null==r||"partial"!==r.type||null==r.diff||null!=r.diff.placement||null!=r.diff.style&&"complete"!==r.diff.style.type||null!=r.diff.color&&"complete"!==r.diff.color.type||null==i)return{changed:!1,useMaterialColor:null==this._markerColor};const a=r.diff.color,s=null!=a,o=s?a.newValue:null,l=null==o&&null==this._markerColor;o&&H(this._getCombinedOpacityAndColor(o),i,e);const n=r.diff.style?.newValue;return n&&e.symbolLayerStatePatches.push(()=>i.setParameters({markerPrimitive:k(n)})),delete t.marker,{changed:s,useMaterialColor:l}}_fastVisualVariableConvertOptions(e=!1){const t=this._getFallbackSize();return new O({supports:{size:!0,color:!0,rotation:!1,opacity:!0},fallbackColor:e?this._getFallbackMarkerOpacityAndColor(C):this._getFallbackOpacityAndColor(C),fallbackSize:i(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer?.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer?.marker?.color?.a??this._getFallbackOpacity()}get _worldSizedEnabled(){return"line-3d"===this.symbol.type&&this.symbol.worldSized&&this.draped}_getWorldOrScreenSize(e){return this._worldSizedEnabled?e:r(e)}_getFallbackSize(){const e=this.symbolLayer?.size;return null==e?1:this._getWorldOrScreenSize(e)}}function W(e){return"polyline"===e.type?e:null}function H(e,t,r){null!=t&&r.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function B(e){return 1===(e.material?.color?.a??1)&&1===(e.marker?.color?.a??1)}export{R as Graphics3DLineSymbolLayer};
|