@arcgis/core 5.0.0-next.32 → 5.0.0-next.34
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/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{9252854b512237b6a0ef.js → 0446562aee0639c61485.js} +1 -1
- package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 1fa55d4c4b092a98bdd7.js} +1 -1
- package/assets/esri/core/workers/chunks/22f745539ca54d8cd30d.js +1 -0
- package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +1 -0
- package/assets/esri/core/workers/chunks/{e7f4d135ef9665de1468.js → 33431e8131f6017de2f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{1dfca37f95f2b968aa54.js → 39d2b540738431adec98.js} +1 -1
- package/assets/esri/core/workers/chunks/{096e5f94eaa226814569.js → 4356274cfa477eb6d749.js} +1 -1
- package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +1 -0
- package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +1 -0
- package/assets/esri/core/workers/chunks/{25fd0884dd14973c89f5.js → 486e69261aa2caf9ec3c.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c1e50c3505e5e7c946a.js → 4d5591c1b4ef37075921.js} +1 -1
- package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +1 -0
- package/assets/esri/core/workers/chunks/52ecbaa2d32692d6d8df.js +1 -0
- package/assets/esri/core/workers/chunks/{3777b41b4fa2f1418402.js → 55818fe7a7aa1e5c8bbd.js} +1 -1
- package/assets/esri/core/workers/chunks/{d21ae4980741be98f948.js → 59889855d23baec1adf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e6fae3660e7a6a0fa16.js → 5f781ef46ce7c4048c2f.js} +1 -1
- package/assets/esri/core/workers/chunks/5f9e64f00329cb646f0c.js +1 -0
- package/assets/esri/core/workers/chunks/61cb30e2e8edd18ebbf0.js +1 -0
- package/assets/esri/core/workers/chunks/63933cbcb5c12df09715.js +1 -0
- package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +1 -0
- package/assets/esri/core/workers/chunks/{e6df4327ac1d9b65b80d.js → 71dd80231ea656a6380c.js} +1 -1
- package/assets/esri/core/workers/chunks/725819839434c59102f3.js +1 -0
- package/assets/esri/core/workers/chunks/{d786b17cc9062b1450ac.js → 726a797f5df7eeee0b3d.js} +1 -1
- package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +1 -0
- package/assets/esri/core/workers/chunks/{bd58c027408dc858f23c.js → 77b45957cfe42523c1c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2cee5ac0d4df0108425.js → 82cc758bddd9f8397b9f.js} +1 -1
- package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +1 -0
- package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +1 -0
- package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +1 -0
- package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +1 -0
- package/assets/esri/core/workers/chunks/{433d249c35c56bf15806.js → 97650ee3d0eecb69ccbb.js} +3 -3
- package/assets/esri/core/workers/chunks/{add17e95f47e6904bf6d.js → a59dab47a58695c639da.js} +1 -1
- package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → abb05a903440d97a6a74.js} +1 -1
- package/assets/esri/core/workers/chunks/{3bacd904cd93c8013f6a.js → ae793d814cf32db9fbde.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0b70652da4a7f672cfc.js → b21cf62652ca772108c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{5baef729beef0199c3d9.js → b536fdb655ad293d9024.js} +1 -1
- package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → c7c721de93bc8688e13c.js} +1 -1
- package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +1 -0
- package/assets/esri/core/workers/chunks/c8d2cce4a426c72ab173.js +1 -0
- package/assets/esri/core/workers/chunks/c9c2e00fed979c21e2f0.js +1 -0
- package/assets/esri/core/workers/chunks/{94005916d321c879bea1.js → cb500d673ca7ec1ef945.js} +1 -1
- package/assets/esri/core/workers/chunks/{14feb12826e0c8ba7fb8.js → d14bd320f72d8e8a0ad8.js} +1 -1
- package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +1 -0
- package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
- package/assets/esri/core/workers/chunks/d6d03f22c91f528b97e5.js +1 -0
- package/assets/esri/core/workers/chunks/{4ab89c990a82c745c0fd.js → d764b6273974f4bca31b.js} +1 -1
- package/assets/esri/core/workers/chunks/d86e59da76eea888ba86.js +1 -0
- package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +1 -0
- package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → dd34d56caafa38d4b8e4.js} +1 -1
- package/assets/esri/core/workers/chunks/df458ad51be27df3d79d.js +1 -0
- package/assets/esri/core/workers/chunks/{01b8e680befff83e7d3e.js → e093e745708f722bc1b9.js} +1 -1
- package/assets/esri/core/workers/chunks/e3a994587f9b2e88db85.js +1 -0
- package/assets/esri/core/workers/chunks/ea5bf896acfcc3106bf5.js +1 -0
- package/assets/esri/core/workers/chunks/{a74e6d505a55ed27f004.js → f11453f24c0b728669d2.js} +1 -1
- package/assets/esri/core/workers/chunks/f2ebd6471e1259a6eac0.js +1 -0
- package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +1 -0
- package/assets/esri/core/workers/chunks/{2a17991923abc64c84c6.js → f55328aabf84770c8e6a.js} +1 -1
- package/assets/esri/core/workers/chunks/fa01d1813fa78034526e.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/chunks/ComponentShader.glsl.js +19 -21
- package/chunks/Envelope.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/Geometry.js +1 -1
- package/chunks/GlowComposition.glsl.js +5 -5
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/Terrain.glsl.js +9 -11
- package/chunks/UnitFactory.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/core/deprecate.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/operators/integrateOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +522 -5
- package/intl/locale.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/catalog/CatalogDynamicGroupLayer.js +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/layerOriginUtils.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +3 -3
- package/portal/schemas/definitions.js +1 -1
- package/request/config.js +1 -1
- package/request/process.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/support/LocateSetting.d.ts +4 -0
- package/rest/support/LocateSetting.js +5 -0
- package/rest/support/LocateSettingBase.d.ts +4 -0
- package/rest/support/LocateSettingBase.js +5 -0
- package/rest/support/LocateSettingSource.d.ts +4 -0
- package/rest/support/LocateSettingSource.js +5 -0
- package/rest/support/LocateSettings.d.ts +4 -0
- package/rest/support/LocateSettings.js +5 -0
- package/rest/support/LocateSettingsOverrides.d.ts +4 -0
- package/rest/support/LocateSettingsOverrides.js +5 -0
- package/rest/support/RouteParameters.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/CombinedElevationProvider.js +1 -1
- package/views/3d/support/ElevationRange.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/ElevationBounds.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +57 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentDataConstants.js +5 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +5 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/{shader/DecodeSymbolColor.glsl.js → DecodeSymbolColor.glsl.js} +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -13
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +7 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +24 -31
- package/views/Attribution.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/View.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/GroundElevationSampler.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/widgets/Attachments/AttachmentsViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/ShadowCast/DiscreteOptions.js +1 -1
- package/widgets/ShadowCast/DurationOptions.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0a1df5a724fe253b3866.js +0 -1
- package/assets/esri/core/workers/chunks/155d74b9c0ef31dc2316.js +0 -1
- package/assets/esri/core/workers/chunks/2c8c48433b380da59831.js +0 -1
- package/assets/esri/core/workers/chunks/31b5747a254d13acc58e.js +0 -1
- package/assets/esri/core/workers/chunks/3ac84e324d212815e252.js +0 -1
- package/assets/esri/core/workers/chunks/41a00c77e6f7ce61e476.js +0 -1
- package/assets/esri/core/workers/chunks/45729d006db6a569715f.js +0 -1
- package/assets/esri/core/workers/chunks/50cf3cbcad2be1c1e210.js +0 -1
- package/assets/esri/core/workers/chunks/565358ea8d1bdc4d1ebc.js +0 -1
- package/assets/esri/core/workers/chunks/592afe1a41bed3b0cc31.js +0 -1
- package/assets/esri/core/workers/chunks/5aeda8a1f2ccabfdf40f.js +0 -1
- package/assets/esri/core/workers/chunks/657d9e5145da1306ace8.js +0 -1
- package/assets/esri/core/workers/chunks/7f7a81ed8893ab649af7.js +0 -1
- package/assets/esri/core/workers/chunks/7ffef8a19166f6b564d8.js +0 -1
- package/assets/esri/core/workers/chunks/819781a209608dcdd678.js +0 -1
- package/assets/esri/core/workers/chunks/8d57e3a0e5687ce15557.js +0 -1
- package/assets/esri/core/workers/chunks/8e9a5d38da40702def80.js +0 -1
- package/assets/esri/core/workers/chunks/aac313257a8b1ae75b75.js +0 -1
- package/assets/esri/core/workers/chunks/be06c8a58c217a17451b.js +0 -1
- package/assets/esri/core/workers/chunks/d56548a994753b08403c.js +0 -1
- package/assets/esri/core/workers/chunks/dd95e679618b7b21a7b1.js +0 -1
- package/assets/esri/core/workers/chunks/e08a1934d98e7324776d.js +0 -1
- package/assets/esri/core/workers/chunks/e5deb72df8b2505fd325.js +0 -1
- package/assets/esri/core/workers/chunks/e689a4849f5af3f2f641.js +0 -1
- package/assets/esri/core/workers/chunks/f259ad785ce3aa970792.js +0 -1
- package/assets/esri/core/workers/chunks/f3127bdf28a1d9b8db27.js +0 -1
- package/assets/esri/core/workers/chunks/f4919950a9a3703d9da3.js +0 -1
- package/assets/esri/core/workers/chunks/f6ce485c082d0d640b01.js +0 -1
- package/assets/esri/core/workers/chunks/fd9ef4b8c969962cf72b.js +0 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +0 -57
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +0 -5
package/request/config.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const e={corsServers:["https://server.arcgisonline.com","https://services.arcgisonline.com"],beforeFetch:void 0,
|
|
5
|
+
const e={corsServers:["https://server.arcgisonline.com","https://services.arcgisonline.com"],beforeFetch:void 0,afterFetch:void 0,isForeignWorker:!1};export{e as requestConfig};
|
package/request/process.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../config.js";import{id as t}from"../kernel.js";import r from"../core/Error.js";import has from"../core/has.js";import{clone as s}from"../core/lang.js";import{createAbortError as o,isAbortError as a,isAborted as n}from"../core/promiseUtils.js";import{isTrustedServer as i,getOrigin as l,isBlobProtocol as u,isDataProtocol as c,toHTTPS as d,objectToQuery as m,getProxyRule as p,getProxyUrl as f,addQueryParameters as h,hasSameOrigin as y,addProxyRule as g,getAppUrl as w}from"../core/urlUtils.js";import{isSecureProxyService as b}from"../portal/support/urlUtils.js";import{requestConfig as T}from"./config.js";import{registerNoCorsDomains as k,isNoCorsRequestRequired as q,sendNoCorsRequest as S}from"./cors.js";import{getImageType as O,ImageWithType as C}from"./ImageWithType.js";import{loadImage as x}from"./loadImage.js";import{setPreferredHost as j,getPreferredUrl as v}from"./preferredHosts.js";import{getApiKey as L}from"../support/apiKeyUtils.js";const E="FormData"in globalThis,U=new Set([499,498,403,401]),A=new Set(["COM_0056","COM_0057","SB_0008"]),P=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i];async function H(r){let s,o;await I(r);try{do{[s,o]=await D(r)}while(!await _(r,s,o))}catch(u){const e=z("request:server",u,r.parameters,s);throw e.details.ssl=r.useSSL,r.interceptor?.error?.(e),e}const a=r.parameters.url;if(o)if(/\/sharing\/rest\/(accounts|portals)\/self/i.test(a)){if(!r.hasToken&&!r.credentialToken&&o.user?.username&&!i(a)){const t=l(a,!0);t&&e.request.trustedServers.push(t)}Array.isArray(o.authorizedCrossOriginNoCorsDomains)&&k(o.authorizedCrossOriginNoCorsDomains)}else{"json"===(r.parameters.requestOptions.responseType||"json")&&j(a,o)}const n=r.credential;if(n&&t){const e=t.findServerInfo(n.server);let r=e?.owningSystemUrl;if(r){r=r.replace(/\/?$/,"/sharing");const e=t.findCredential(r,n.userId);e&&-1===t._getIdenticalSvcIdx(r,e)&&e.resources.unshift(r)}}return{data:o,getAllHeaders:s?()=>Array.from(s.headers):J,getHeader:s?e=>s.headers.get(e):J,httpStatus:s?.status??200,requestOptions:r.parameters.requestOptions,ssl:r.useSSL,url:r.parameters.url}}async function I(r){const s=r.parameters.url,o=r.parameters.requestOptions,a=r.controller.signal,i=o.body;let l=null,u=null;if(E&&"HTMLFormElement"in globalThis&&(i instanceof FormData?l=i:i instanceof HTMLFormElement&&(l=new FormData(i))),"string"==typeof i&&(u=i),r.fetchOptions={cache:o.cacheBust?"no-cache":"default",credentials:"same-origin",headers:o.headers||{},keepalive:o.keepAlive??!1,method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:o.priority??e.request.priority,redirect:"follow",signal:a},(l||u)&&(r.fetchOptions.body=l||u),(T.isForeignWorker||"anonymous"===o.authMode)&&(r.useIdentity=!1),r.hasToken=!!(/token=/i.test(s)||o.query?.token||l?.get("token")),!r.hasToken){const e=L(s);e&&(o.query??={},o.query.token=e,r.hasToken=!0)}if(r.useIdentity&&!r.hasToken&&!r.credential&&!r.credentialToken&&!B(s)&&!n(a)){let e;"immediate"===o.authMode?(await N(),e=await t.getCredential(s,{signal:a})):"no-prompt"===o.authMode?(await N(),e=await t.getCredential(s,{prompt:!1,signal:a}).catch(()=>{})):t&&(e=t.findCredential(s)),e&&(r.credential=e,r.credentialToken=e.token,r.useSSL=!!e.ssl)}}async function D(r){let s=r.parameters.url,a=v(s);const n=r.parameters.requestOptions,k=r.fetchOptions??{},x=u(s)||c(s),j=n.responseType??"json",L="image"===j&&n.imageWithType,U=x?0:null!=n.timeout?n.timeout:e.request.timeout;let A=!1;if(!x){r.useSSL&&(s=d(s));let o={...n.query};r.credentialToken&&(o.token=r.credentialToken);let l=m(o);has("esri-url-encodes-apostrophe")&&(l=l.replaceAll("'","%27"));const u=a.length+1+l.length;let c;A="delete"===n.method||"post"===n.method||"put"===n.method||!!n.body||u>e.request.maxUrlLength;const g=n.useProxy||!!p(s);if(g){const t=f(s);c=t.path,!A&&c.length+1+u>e.request.maxUrlLength&&(A=!0),t.query&&(o={...t.query,...o})}if("HEAD"===k.method&&(A||g)){if(A){if(u>e.request.maxUrlLength)throw z("request:invalid-parameters",new Error("URL exceeds maximum length"),r.parameters);throw z("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),r.parameters)}if(g)throw z("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),r.parameters)}if(A?(k.method="delete"===n.method?"DELETE":"put"===n.method?"PUT":"POST",n.body?s=h(s,o):(k.body=m(o),k.headers||(k.headers={}),k.headers["Content-Type"]="application/x-www-form-urlencoded")):s=h(s,o),g&&(r.useProxy=!0,s=`${c}?${s}`),o.token&&E&&k.body instanceof FormData&&!b(s)&&k.body.set("token",o.token),n.hasOwnProperty("withCredentials"))r.withCredentials=n.withCredentials;else if(!y(s,w()))if(i(s))r.withCredentials=!0;else if(t){const e=t.findServerInfo(s);e?.webTierAuth&&(r.withCredentials=!0)}r.withCredentials&&(k.credentials="include",q(s)&&await S(A?h(s,o):s)),a=v(s)}let P,H,I=0,N=!1;U>0&&(I=setTimeout(()=>{N=!0,r.controller.abort()},U));try{if("native-request-init"===n.responseType)H=k,H.url=a,n.signal?H.signal=n.signal:delete H.signal;else if("image"!==n.responseType||"default"!==k.cache||k.keepalive||"GET"!==k.method||A||$(n.headers)||!x&&!r.useProxy&&e.request.proxyUrl&&!R(s)){if(await(T.beforeFetch?.(s,k)),P=await
|
|
5
|
+
import e from"../config.js";import{id as t}from"../kernel.js";import r from"../core/Error.js";import has from"../core/has.js";import{clone as s}from"../core/lang.js";import{createAbortError as o,isAbortError as a,isAborted as n}from"../core/promiseUtils.js";import{isTrustedServer as i,getOrigin as l,isBlobProtocol as u,isDataProtocol as c,toHTTPS as d,objectToQuery as m,getProxyRule as p,getProxyUrl as f,addQueryParameters as h,hasSameOrigin as y,addProxyRule as g,getAppUrl as w}from"../core/urlUtils.js";import{isSecureProxyService as b}from"../portal/support/urlUtils.js";import{requestConfig as T}from"./config.js";import{registerNoCorsDomains as k,isNoCorsRequestRequired as q,sendNoCorsRequest as S}from"./cors.js";import{getImageType as O,ImageWithType as C}from"./ImageWithType.js";import{loadImage as x}from"./loadImage.js";import{setPreferredHost as j,getPreferredUrl as v}from"./preferredHosts.js";import{getApiKey as L}from"../support/apiKeyUtils.js";const E="FormData"in globalThis,U=new Set([499,498,403,401]),A=new Set(["COM_0056","COM_0057","SB_0008"]),P=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i];async function H(r){let s,o;await I(r);try{do{[s,o]=await D(r)}while(!await _(r,s,o))}catch(u){const e=z("request:server",u,r.parameters,s);throw e.details.ssl=r.useSSL,r.interceptor?.error?.(e),e}const a=r.parameters.url;if(o)if(/\/sharing\/rest\/(accounts|portals)\/self/i.test(a)){if(!r.hasToken&&!r.credentialToken&&o.user?.username&&!i(a)){const t=l(a,!0);t&&e.request.trustedServers.push(t)}Array.isArray(o.authorizedCrossOriginNoCorsDomains)&&k(o.authorizedCrossOriginNoCorsDomains)}else{"json"===(r.parameters.requestOptions.responseType||"json")&&j(a,o)}const n=r.credential;if(n&&t){const e=t.findServerInfo(n.server);let r=e?.owningSystemUrl;if(r){r=r.replace(/\/?$/,"/sharing");const e=t.findCredential(r,n.userId);e&&-1===t._getIdenticalSvcIdx(r,e)&&e.resources.unshift(r)}}return{data:o,getAllHeaders:s?()=>Array.from(s.headers):J,getHeader:s?e=>s.headers.get(e):J,httpStatus:s?.status??200,requestOptions:r.parameters.requestOptions,ssl:r.useSSL,url:r.parameters.url}}async function I(r){const s=r.parameters.url,o=r.parameters.requestOptions,a=r.controller.signal,i=o.body;let l=null,u=null;if(E&&"HTMLFormElement"in globalThis&&(i instanceof FormData?l=i:i instanceof HTMLFormElement&&(l=new FormData(i))),"string"==typeof i&&(u=i),r.fetchOptions={cache:o.cacheBust?"no-cache":"default",credentials:"same-origin",headers:o.headers||{},keepalive:o.keepAlive??!1,method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:o.priority??e.request.priority,redirect:"follow",signal:a},(l||u)&&(r.fetchOptions.body=l||u),(T.isForeignWorker||"anonymous"===o.authMode)&&(r.useIdentity=!1),r.hasToken=!!(/token=/i.test(s)||o.query?.token||l?.get("token")),!r.hasToken){const e=L(s);e&&(o.query??={},o.query.token=e,r.hasToken=!0)}if(r.useIdentity&&!r.hasToken&&!r.credential&&!r.credentialToken&&!B(s)&&!n(a)){let e;"immediate"===o.authMode?(await N(),e=await t.getCredential(s,{signal:a})):"no-prompt"===o.authMode?(await N(),e=await t.getCredential(s,{prompt:!1,signal:a}).catch(()=>{})):t&&(e=t.findCredential(s)),e&&(r.credential=e,r.credentialToken=e.token,r.useSSL=!!e.ssl)}}async function D(r){let s=r.parameters.url,a=v(s);const n=r.parameters.requestOptions,k=r.fetchOptions??{},x=u(s)||c(s),j=n.responseType??"json",L="image"===j&&n.imageWithType,U=x?0:null!=n.timeout?n.timeout:e.request.timeout;let A=!1;if(!x){r.useSSL&&(s=d(s));let o={...n.query};r.credentialToken&&(o.token=r.credentialToken);let l=m(o);has("esri-url-encodes-apostrophe")&&(l=l.replaceAll("'","%27"));const u=a.length+1+l.length;let c;A="delete"===n.method||"post"===n.method||"put"===n.method||!!n.body||u>e.request.maxUrlLength;const g=n.useProxy||!!p(s);if(g){const t=f(s);c=t.path,!A&&c.length+1+u>e.request.maxUrlLength&&(A=!0),t.query&&(o={...t.query,...o})}if("HEAD"===k.method&&(A||g)){if(A){if(u>e.request.maxUrlLength)throw z("request:invalid-parameters",new Error("URL exceeds maximum length"),r.parameters);throw z("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),r.parameters)}if(g)throw z("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),r.parameters)}if(A?(k.method="delete"===n.method?"DELETE":"put"===n.method?"PUT":"POST",n.body?s=h(s,o):(k.body=m(o),k.headers||(k.headers={}),k.headers["Content-Type"]="application/x-www-form-urlencoded")):s=h(s,o),g&&(r.useProxy=!0,s=`${c}?${s}`),o.token&&E&&k.body instanceof FormData&&!b(s)&&k.body.set("token",o.token),n.hasOwnProperty("withCredentials"))r.withCredentials=n.withCredentials;else if(!y(s,w()))if(i(s))r.withCredentials=!0;else if(t){const e=t.findServerInfo(s);e?.webTierAuth&&(r.withCredentials=!0)}r.withCredentials&&(k.credentials="include",q(s)&&await S(A?h(s,o):s)),a=v(s)}let P,H,I=0,N=!1;U>0&&(I=setTimeout(()=>{N=!0,r.controller.abort()},U));try{if("native-request-init"===n.responseType)H=k,H.url=a,n.signal?H.signal=n.signal:delete H.signal;else if("image"!==n.responseType||"default"!==k.cache||k.keepalive||"GET"!==k.method||A||$(n.headers)||!x&&!r.useProxy&&e.request.proxyUrl&&!R(s)){if(await(T.beforeFetch?.(s,k)),P=await fetch(a,k),await(T.afterFetch?.(P)),r.useProxy||F(s),"native"===n.responseType)H=P;else if("HEAD"!==k.method)if(P.ok){switch(j){case"array-buffer":H=await P.arrayBuffer();break;case"blob":H=await P.blob();break;case"image":H=await(L?P.arrayBuffer():P.blob());break;default:H=await P.text()}if(I&&(clearTimeout(I),I=0),"json"===j||"xml"===j||"document"===j)if(H)switch(j){case"json":H=JSON.parse(H);break;case"xml":H=W(H,"application/xml");break;case"document":H=W(H,"text/html")}else H=null;if(H){if("array-buffer"===j||"blob"===j){const e=P.headers.get("Content-Type");if(e&&/application\/json|text\/plain/i.test(e)&&H["blob"===j?"size":"byteLength"]<=750)try{const e=await new Response(H).json();e.error&&(H=e)}catch{}}if(L&&H instanceof ArrayBuffer){const e=O(H);if("unknown"===e)return n.responseType="image",await D(r);H=await P.blob(),H=await M(URL.createObjectURL(H),r,!0),H=new C(H,e)}"image"===j&&H instanceof Blob&&(H=await M(URL.createObjectURL(H),r,!0))}}else{H=await P.text();try{H=JSON.parse(H)}catch{}}}else H=await M(a,r)}catch(B){if("AbortError"===B.name){if(N)throw X();throw o("Request canceled")}if(!(!P&&B instanceof TypeError&&e.request.proxyUrl)||n.body||"delete"===n.method||"head"===n.method||"post"===n.method||"put"===n.method||r.useProxy||R(s))throw B;r.redoRequest=!0,g({proxyUrl:e.request.proxyUrl,urlPrefix:l(s)??""})}finally{I&&clearTimeout(I)}return[P,H]}function M(t,r,s=!1){const o=r.controller.signal,a=new Image;return r.withCredentials?a.crossOrigin="use-credentials":a.crossOrigin="anonymous",a.alt="",a.fetchPriority=e.request.priority,a.src=t,x(a,t,s,o)}function F(e){const t=l(e);t&&!T.corsServers.includes(t)&&T.corsServers.push(t)}function R(e){const t=l(e);return!t||t.endsWith(".arcgis.com")||T.corsServers.includes(t)||i(t)}async function N(){t||await import("../identity/IdentityManager.js")}function B(e){return P.some(t=>t.test(e))}function $(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}function W(e,t){let r;try{r=(new DOMParser).parseFromString(e,t)}catch{}if(!r||r.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return r}async function _(e,r,s){if(e.redoRequest)return e.redoRequest=!1,!1;const o=e.parameters.requestOptions;if(!r||"native"===o.responseType||"native-request-init"===o.responseType)return!0;let a,n;if(s&&(s.error&&"object"==typeof s.error?a=s.error:"error"===s.status&&Array.isArray(s.messages)&&(a={...s},a[G]=s,a.details=s.messages)),!a&&!r.ok)throw a=new Error(`Unable to load ${r.url} status: ${r.status}`),a[G]=s,a;let i,l=null;a&&(n=Number(a.code),l=a.hasOwnProperty("subcode")?Number(a.subcode):null,i=a.messageCode,i=i?.toUpperCase());const u=o.authMode;if(403===n&&(4===l||a.message?.toLowerCase().includes("ssl")&&!a.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===n)&&void 0!==n&&U.has(n)&&!B(e.parameters.url)&&(403!==n||(!i||!A.has(i))&&(null==l||2===l&&e.credentialToken))){await N();try{const r=await t.getCredential(e.parameters.url,{error:z("request:server",a,e.parameters),credential:e.credential,prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=r,e.credentialToken=r.token,e.useSSL=e.useSSL||r.ssl,!1}catch(c){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;a=c}}if(a)throw a;return!0}function z(e,t,n,i){let l;const u={url:n.url,requestOptions:n.requestOptions,getAllHeaders:J,getHeader:J,ssl:!1};if(t instanceof r)return t.details?(t.details=s(t.details),t.details.url=n.url,t.details.requestOptions=n.requestOptions):t.details=u,t;if(t){const e=i&&(()=>Array.from(i.headers)),r=i&&(e=>i.headers.get(e)),s=i?.status,o=t.message;o&&(l=o),e&&r&&(u.getAllHeaders=e,u.getHeader=r),u.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||s||0,u.subCode=t.subcode,u.messageCode=t.messageCode,"string"==typeof t.details?(u.messages=[t.details],l??=t.details):(u.messages=t.details,l??=u.messages?.[0]),u.raw=G in t?t[G]:t}return l??="Error",a(t)?o():new r(e,l,u)}const G=Symbol(),J=()=>null,K="Timeout exceeded";function X(){return new Error(K)}function Q(e){return"object"==typeof e&&!!e&&"message"in e&&e.message===K}export{z as createRequestError,Q as isTimeoutError,H as processRequest};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../request.js";import{urlToObject as n,join as r}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as e}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as o}from"../../operations/urlUtils.js";import{parsePBFFeatureQuery as
|
|
5
|
+
import t from"../../../request.js";import{urlToObject as n,join as r}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as e}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as o}from"../../operations/urlUtils.js";import{parsePBFFeatureQuery as s}from"./pbfQueryUtils.js";import{queryLikeToQueryStringParameters as u}from"./queryUtils.js";import{applyFeatureSetZUnitScaling as i}from"./queryZScale.js";const c="Layer does not support extent calculation.";function a(t,n,r){return u(t,n,r)}async function y(t,n,r,e,o){const s=n.timeExtent?.isEmpty?{features:[]}:await d(t,n,"json",e,void 0,o);return i(n,r,s),s}async function l(t,n,r,e,o){if(n.timeExtent?.isEmpty)return r.createFeatureResult();const u=await f(t,n,e,o);return s(u,r)}function f(t,n,r,e){return d(t,n,"pbf",r,void 0,e)}function m(t,n,r,e){return n.timeExtent?.isEmpty?Promise.resolve({objectIds:[]}):d(t,n,"json",r,{returnIdsOnly:!0},e)}async function p(t,n,r,e){return n.timeExtent?.isEmpty?0:(await d(t,n,"json",r,{returnIdsOnly:!0,returnCountOnly:!0},e)).count}async function O(t,n,r){if(n.timeExtent?.isEmpty)return{count:0,extent:null};const e=await d(t,n,"json",r,{returnExtentOnly:!0,returnCountOnly:!0});if(e.hasOwnProperty("extent"))return e;const o="string"==typeof t?t:t.path;if(/\/imageserver\/?$/i.test(o)&&e.hasOwnProperty("count")){const o=await d(t,n,"json",r,{returnExtentOnly:!0});return{count:e.count,extent:o.extent}}if(e.features)throw new Error(c);if(e.hasOwnProperty("count"))throw new Error(c);return e}function j(t,n){if(!t.returnIdsOnly||!n.uniqueIdFields)return t;const r={...t,returnUniqueIdsOnly:!0};return delete r.returnIdsOnly,r}async function d(n,r,e,o={},s={},u={}){const i=await w(n,r,e,o,s,u),c="json"===e?"json":"array-buffer";return t(i.url,{responseType:c,...i.options}).then(({data:t})=>t)}async function w(t,s,u,i,c={},y={}){const l="string"==typeof t?n(t):t,f=s.geometry?[s.geometry]:[],m=await e(f,null,{signal:i.signal}),p=m?.[0];if(null!=p){const t=s.clone();t.geometry=p.clone(),s=t}const O=o({...l.query,f:u,...j(c,y),...a(s,c,y)});return i={...i,query:{...O,...i.query}},new E(r(l.path,x(s,c)?"query3d":"query"),i)}class E{constructor(t,n){this.url=t,this.options=n}}function x(t,n){return null!=t.formatOf3DObjects&&!(n.returnCountOnly||n.returnExtentOnly||n.returnIdsOnly)}export{E as RunQueryParameters,y as executeQuery,p as executeQueryForCount,O as executeQueryForExtent,m as executeQueryForIds,l as executeQueryPBF,f as executeQueryPBFBuffer,a as queryToQueryStringParameters,d as runQuery};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as o}from"tslib";import{enumeration as r}from"../../core/accessorSupport/decorators/enumeration.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import s from"./LocateSettingBase.js";import{linearUnitJsonMap as c}from"./networkEnums.js";let p=class extends s{constructor(o){super(o),this.tolerance=null,this.toleranceUnits=null}};o([t({type:Number,json:{write:!0}})],p.prototype,"tolerance",void 0),o([r(c)],p.prototype,"toleranceUnits",void 0),p=o([e("esri.rest.support.LocateSetting")],p);const a=p;export{a as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as o}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import p from"./LocateSettingSource.js";let c=class extends(t(r)){constructor(o){super(o),this.allowAutoRelocate=null,this.sources=null}};o([e({type:Boolean,json:{write:!0}})],c.prototype,"allowAutoRelocate",void 0),o([e({type:[p],json:{write:!0}})],c.prototype,"sources",void 0),c=o([s("esri.rest.support.LocateSettingBase")],c);const l=c;export{l as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as o}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let p=class extends(r(t)){constructor(o){super(o),this.name=null,this.where=null}};o([e({json:{write:!0}})],p.prototype,"name",void 0),o([e({json:{write:!0}})],p.prototype,"where",void 0),p=o([s("esri.rest.support.LocateSettingSource")],p);const c=p;export{c as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as o}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import p from"./LocateSetting.js";import i from"./LocateSettingsOverrides.js";let c=class extends(r(t)){constructor(o){super(o),this.default=null,this.overrides=null}};o([e({type:p,json:{write:!0}})],c.prototype,"default",void 0),o([e({type:i,json:{write:!0}})],c.prototype,"overrides",void 0),c=o([s("esri.rest.support.LocateSettings")],c);const a=c;export{a as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as r}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import p from"./LocateSetting.js";import i from"./LocateSettingBase.js";let n=class extends(o(t)){constructor(r){super(r),this.stops=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null}};r([e({type:p,json:{write:!0}})],n.prototype,"stops",void 0),r([e({type:p,json:{name:"barriers",write:!0}})],n.prototype,"pointBarriers",void 0),r([e({type:i,json:{write:!0}})],n.prototype,"polylineBarriers",void 0),r([e({type:i,json:{write:!0}})],n.prototype,"polygonBarriers",void 0),n=r([s("esri.rest.support.LocateSettingsOverrides")],n);const a=n;export{a as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import r from"../../core/Collection.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as s}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/SpatialReference.js";import{apiKey as u}from"./commonProperties.js";import l from"./DataLayer.js";import a from"./FeatureSet.js";import{impedanceAttributeNameJsonMap as
|
|
5
|
+
import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import r from"../../core/Collection.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as s}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/SpatialReference.js";import{apiKey as u}from"./commonProperties.js";import l from"./DataLayer.js";import a from"./FeatureSet.js";import y from"./LocateSettings.js";import{impedanceAttributeNameJsonMap as m,restrictionAttributeNameJsonMap as c,directionsLengthUnitJsonMap as d,directionsOutputTypeJsonMap as v,directionsStyleNameJsonMap as w,durationImpedanceAttributeNameJsonMap as h,lengthUnitJsonMap as j,outputLineJsonMap as S,restrictUTurnJsonMap as B}from"./networkEnums.js";import f from"./NetworkFeatureSet.js";import g from"./NetworkUrl.js";import T from"./TravelMode.js";import{reader as b}from"../../core/accessorSupport/decorators/reader.js";import{writer as A}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as N}from"../../core/accessorSupport/decorators/enumeration.js";var P;let O=class extends(e(o)){static{P=this}constructor(t){super(t),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.checksum=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.locateSettings=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnEmptyResults=null,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(t){return s(P,t)}readAccumulateAttributes(t){return null==t?null:t.map(t=>m.fromJSON(t))}writeAccumulateAttributes(t,e,r){t?.length&&(e[r]=t.map(t=>m.toJSON(t)))}writePointBarriers(t,e,r){C(t,e,r)}writePolygonBarrier(t,e,r){C(t,e,r)}writePolylineBarrier(t,e,r){C(t,e,r)}readRestrictionAttributes(t){return null==t?null:t.map(t=>c.fromJSON(t))}writeRestrictionAttributes(t,e,r){t?.length&&(e[r]=t.map(t=>c.toJSON(t)))}readStartTime(t,e){const{startTime:r}=e;return null==r?null:"now"===r?"now":new Date(r)}writeStartTime(t,e){null!=t&&(e.startTime="now"===t?"now":t.getTime())}readStops(t,e){return k(e.stops)}writeStops(t,e,r){C(t,e,r)}};function R(t){return t&&"type"in t}function J(t){return t&&"features"in t&&"doNotLocateOnRestrictedElements"in t}function L(t){return t&&"url"in t}function U(t){return t&&"features"in t}function k(t){return R(t)?l.fromJSON(t):L(t)?g.fromJSON(t):J(t)?f.fromJSON(t):U(t)?a.fromJSON(t):null}function C(t,e,o){null!=t&&(e[o]=r.isCollection(t)?{features:t.toArray().map(t=>t.toJSON())}:t.toJSON())}t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],O.prototype,"accumulateAttributes",void 0),t([b("accumulateAttributes")],O.prototype,"readAccumulateAttributes",null),t([A("accumulateAttributes")],O.prototype,"writeAccumulateAttributes",null),t([i(u)],O.prototype,"apiKey",void 0),t([i({json:{write:!0}})],O.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],O.prototype,"checksum",void 0),t([i({type:String,json:{write:!0}})],O.prototype,"directionsLanguage",void 0),t([N(d)],O.prototype,"directionsLengthUnits",void 0),t([N(v)],O.prototype,"directionsOutputType",void 0),t([N(w)],O.prototype,"directionsStyleName",void 0),t([N(h,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],O.prototype,"directionsTimeAttribute",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"findBestSequence",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"geometryPrecisionM",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"geometryPrecisionZ",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"ignoreInvalidLocations",void 0),t([N(m,{name:"impedanceAttributeName",ignoreUnknown:!1})],O.prototype,"impedanceAttribute",void 0),t([i({type:y,json:{write:!0}})],O.prototype,"locateSettings",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"outputGeometryPrecision",void 0),t([N(j)],O.prototype,"outputGeometryPrecisionUnits",void 0),t([N(S)],O.prototype,"outputLines",void 0),t([i({type:p,json:{name:"outSR",write:!0}})],O.prototype,"outSpatialReference",void 0),t([i({json:{write:!0}})],O.prototype,"overrides",void 0),t([i({json:{name:"barriers",write:!0}})],O.prototype,"pointBarriers",void 0),t([A("pointBarriers")],O.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],O.prototype,"polygonBarriers",void 0),t([A("polygonBarriers")],O.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],O.prototype,"polylineBarriers",void 0),t([A("polylineBarriers")],O.prototype,"writePolylineBarrier",null),t([i({type:Boolean,json:{write:!0}})],O.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"preserveObjectID",void 0),t([i({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],O.prototype,"restrictionAttributes",void 0),t([b("restrictionAttributes")],O.prototype,"readRestrictionAttributes",null),t([A("restrictionAttributes")],O.prototype,"writeRestrictionAttributes",null),t([N(B)],O.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnDirections",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnEmptyResults",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnPolygonBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnPolylineBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnRoutes",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnStops",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnTraversedEdges",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnTraversedJunctions",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnTraversedTurns",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnZ",void 0),t([i({json:{write:!0}})],O.prototype,"startTime",void 0),t([b("startTime")],O.prototype,"readStartTime",null),t([A("startTime")],O.prototype,"writeStartTime",null),t([i({type:Boolean,json:{write:!0}})],O.prototype,"startTimeIsUTC",void 0),t([i({json:{write:!0}})],O.prototype,"stops",void 0),t([b("stops")],O.prototype,"readStops",null),t([A("stops")],O.prototype,"writeStops",null),t([i({type:Boolean,json:{write:!0}})],O.prototype,"timeWindowsAreUTC",void 0),t([i({type:T,json:{write:!0}})],O.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"useHierarchy",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"useTimeWindows",void 0),O=P=t([n("esri.rest.support.RouteParameters")],O);export{O as default};
|
package/statistics/utils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../rest/support/ClassBreaksDefinition.js";import{createGenerateRendererClassBreaks as n}from"../rest/support/generateRendererUtils.js";const t="<Null>",l="equal-interval",i=1,a=5,o=10,u=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,r=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),s=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),c=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function m(e){return null==e||"string"==typeof e&&!e?t:e}function d(e){const n=null!=e.normalizationField||null!=e.normalizationType,t=null!=e.minValue||null!=e.maxValue,l=!!e.sqlExpression&&e.supportsSQLExpression;return!n&&!t&&!l}function f(e){const{outStatisticTypes:n}=e,t=e.returnDistinct?[...new Set(e.values)]:e.values,l=t.filter(e=>null!=e).sort(),i=l.length,a={count:i,min:l[0],max:l[i-1]};return e.supportsNullCount&&(a.nullcount=t.length-i),!e.percentileParams||n?.include?.length&&!n.include.includes("median")||n?.exclude?.length&&n.exclude.includes("median")||(a.median=v(t,e.percentileParams)),a}function p(e){const{values:n,useSampleStdDev:t,supportsNullCount:l,outStatisticTypes:i}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,u=null,r=null,s=null,c=null,m=0;const d=null==e.minValue?-1/0:e.minValue,f=null==e.maxValue?1/0:e.maxValue;for(const v of n)Number.isFinite(v)?v>=d&&v<=f&&(u=null===u?v:u+v,a=Math.min(a,v),o=Math.max(o,v),m++):"string"==typeof v&&m++;if(m&&null!=u){r=u/m;let e=0;for(const t of n)Number.isFinite(t)&&t>=d&&t<=f&&(e+=(t-r)**2);c=t?m>1?e/(m-1):0:m>0?e/m:0,s=Math.sqrt(c)}else a=null,o=null;const p={avg:r,count:m,max:o,min:a,stddev:s,sum:u,variance:c};return l&&(p.nullcount=n.length-m),!e.percentileParams||i?.include?.length&&!i.include.includes("median")||i?.exclude?.length&&i.exclude.includes("median")||(p.median=v(n,e.percentileParams)),p}function v(e,n){const{fieldType:t,value:l,orderBy:i,isDiscrete:a}=n,o=g(t,"desc"===i);if(0===(e=[...e].filter(e=>null!=e).sort((e,n)=>o(e,n))).length)return null;if(l<=0)return e[0];if(l>=1)return e[e.length-1];const u=(e.length-1)*l,r=Math.floor(u),s=r+1,c=u%1,m=e[r],d=e[s];return s>=e.length||a||"string"==typeof m||"string"==typeof d?m:m*(1-c)+d*c}function g(e,n){if(e){if(r.has(e))return N(n);if(s.has(e))return D(n,!
|
|
5
|
+
import e from"../rest/support/ClassBreaksDefinition.js";import{createGenerateRendererClassBreaks as n}from"../rest/support/generateRendererUtils.js";const t="<Null>",l="equal-interval",i=1,a=5,o=10,u=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,r=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),s=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),c=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function m(e){return null==e||"string"==typeof e&&!e?t:e}function d(e){const n=null!=e.normalizationField||null!=e.normalizationType,t=null!=e.minValue||null!=e.maxValue,l=!!e.sqlExpression&&e.supportsSQLExpression;return!n&&!t&&!l}function f(e){const{outStatisticTypes:n}=e,t=e.returnDistinct?[...new Set(e.values)]:e.values,l=t.filter(e=>null!=e).sort(),i=l.length,a={count:i,min:l[0],max:l[i-1]};return e.supportsNullCount&&(a.nullcount=t.length-i),!e.percentileParams||n?.include?.length&&!n.include.includes("median")||n?.exclude?.length&&n.exclude.includes("median")||(a.median=v(t,e.percentileParams)),a}function p(e){const{values:n,useSampleStdDev:t,supportsNullCount:l,outStatisticTypes:i}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,u=null,r=null,s=null,c=null,m=0;const d=null==e.minValue?-1/0:e.minValue,f=null==e.maxValue?1/0:e.maxValue;for(const v of n)Number.isFinite(v)?v>=d&&v<=f&&(u=null===u?v:u+v,a=Math.min(a,v),o=Math.max(o,v),m++):"string"==typeof v&&m++;if(m&&null!=u){r=u/m;let e=0;for(const t of n)Number.isFinite(t)&&t>=d&&t<=f&&(e+=(t-r)**2);c=t?m>1?e/(m-1):0:m>0?e/m:0,s=Math.sqrt(c)}else a=null,o=null;const p={avg:r,count:m,max:o,min:a,stddev:s,sum:u,variance:c};return l&&(p.nullcount=n.length-m),!e.percentileParams||i?.include?.length&&!i.include.includes("median")||i?.exclude?.length&&i.exclude.includes("median")||(p.median=v(n,e.percentileParams)),p}function v(e,n){const{fieldType:t,value:l,orderBy:i,isDiscrete:a}=n,o=g(t,"desc"===i,"case-insensitive");if(0===(e=[...e].filter(e=>null!=e).sort((e,n)=>o(e,n))).length)return null;if(l<=0)return e[0];if(l>=1)return e[e.length-1];const u=(e.length-1)*l,r=Math.floor(u),s=r+1,c=u%1,m=e[r],d=e[s];return s>=e.length||a||"string"==typeof m||"string"==typeof d?m:m*(1-c)+d*c}function g(e,n,t="case-sensitive"){if(e){if(r.has(e))return N(n);if(s.has(e))return D(n,!0);if("esriFieldTypeTimestampOffset"===e)return F(n);const l=D(n,"case-sensitive"===t);if("esriFieldTypeString"===e)return l;if("esriFieldTypeGUID"===e||"esriFieldTypeGlobalID"===e)return(e,n)=>l(M(e),M(n))}const l=n?1:-1,i=N(n),a=D(n,"case-sensitive"===t),o=x(n);return(e,n)=>"number"==typeof e&&"number"==typeof n?i(e,n):"string"==typeof e&&"string"==typeof n?a(e,n):o(e,n)??l}const h=(e,n)=>null==e?null==n?0:1:null==n?-1:null,T=(e,n)=>null==e?null==n?0:-1:null==n?1:null;function x(e){return e?h:T}const y=(e,n)=>T(e,n)??(e===n?0:new Date(e).getTime()-new Date(n).getTime()),V=(e,n)=>h(e,n)??(e===n?0:new Date(n).getTime()-new Date(e).getTime());function F(e){return e?V:y}const I=(e,n)=>T(e,n)??(e===n?0:e<n?-1:1),b=(e,n)=>h(e,n)??(e===n?0:e<n?1:-1);function D(e,n){if(n)return e?b:I;const t=x(e);return e?(e,n)=>{const l=t(e,n);return null!=l?l:(e=e.toUpperCase())>(n=n.toUpperCase())?-1:e<n?1:0}:(e,n)=>{const l=t(e,n);return null!=l?l:(e=e.toUpperCase())<(n=n.toUpperCase())?-1:e>n?1:0}}const z=(e,n)=>h(e,n)??n-e,S=(e,n)=>T(e,n)??e-n;function N(e){return e?z:S}function M(e){return e.slice(24,36)+e.slice(19,23)+e.slice(16,18)+e.slice(14,16)+e.slice(11,13)+e.slice(9,11)+e.slice(6,8)+e.slice(4,6)+e.slice(2,4)+e.slice(0,2)}function C(e,n,t){let l;for(l in e)n?.include?.length&&!n.include.includes(l)||n?.exclude?.length&&n.exclude.includes(l)?delete e[l]:c.includes(l)&&(Number.isFinite(e[l])||(e[l]=null));return t?(["avg","stddev","variance"].forEach(n=>{null!=e[n]&&(e[n]=Math.ceil(e[n]??0))}),e):e}function k(e){const n={};for(let t of e)(null==t||"string"==typeof t&&""===t.trim())&&(t=null),null==n[t]?n[t]={count:1,data:t}:n[t].count++;return{count:n}}function w(e){return"coded-value"!==e?.type?[]:e.codedValues.map(e=>e.code)}function $(e,n,t,l){const i=e.count,a=[];if(t&&n){const e=[],t=w(n[0]);for(const i of t)if(n[1]){const t=w(n[1]);for(const a of t)if(n[2]){const t=w(n[2]);for(const n of t)e.push(`${m(i)}${l}${m(a)}${l}${m(n)}`)}else e.push(`${m(i)}${l}${m(a)}`)}else e.push(i);for(const n of e)i.hasOwnProperty(n)||(i[n]={data:n,count:0})}for(const o in i){const e=i[o];a.push({value:e.data,count:e.count,label:e.label})}return{uniqueValueInfos:a}}function B(e,n,t,l){let i=null;switch(n){case"log":0!==e&&(i=Math.log(e)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(l)&&0!==l&&(i=e/l*100);break;case"field":Number.isFinite(t)&&0!==t&&(i=e/t);break;case"natural-log":e>0&&(i=Math.log(e));break;case"square-root":e>0&&(i=e**.5)}return i}function E(e,t,l){const i=q({field:t.field,normalizationType:t.normalizationType,normalizationField:t.normalizationField,classificationMethod:t.classificationMethod,standardDeviationInterval:t.standardDeviationInterval,definedInterval:t.definedInterval,breakCount:t.numClasses||a});return e=O(e,t.minValue,t.maxValue),n({definition:i,values:e,normalizationTotal:t.normalizationTotal},l)}function O(e,n,t){const l=n??-1/0,i=t??1/0;return e.filter(e=>Number.isFinite(e)&&e>=l&&e<=i)}function q(n){const{breakCount:t,field:a,normalizationField:o,normalizationType:u}=n,r=n.classificationMethod||l,s="standard-deviation"===r?n.standardDeviationInterval||i:void 0,c="defined-interval"===r?n.definedInterval:void 0;return new e({breakCount:t,classificationField:a,classificationMethod:r,normalizationField:"field"===u?o:void 0,normalizationType:u,standardDeviationInterval:s,definedInterval:c})}function P(e,n){let t=e.classBreaks;const l=t.length,i=t[0]?.minValue,a=t[l-1]?.maxValue,o="standard-deviation"===n,r=u;return t=t.map(e=>{const n=e.label,t={minValue:e.minValue,maxValue:e.maxValue,label:n};if(o&&n){const e=n.match(r),l=e?.map(e=>+e.trim())??[];2===l.length?(t.minStdDev=l[0],t.maxStdDev=l[1],l[0]<0&&l[1]>0&&(t.hasAvg=!0)):1===l.length&&(n.includes("<")?(t.minStdDev=null,t.maxStdDev=l[0]):n.includes(">")&&(t.minStdDev=l[0],t.maxStdDev=null))}return t}),{minValue:i,maxValue:a,classBreakInfos:t,normalizationTotal:e.normalizationTotal}}function U(e,n){const t=G(e,n);if(null==t.min&&null==t.max)return{bins:[],minValue:t.min,maxValue:t.max,normalizationTotal:n.normalizationTotal};const l=t.intervals,i=t.min??0,a=t.max??0,o=l.map((e,n)=>({minValue:l[n][0],maxValue:l[n][1],count:0}));for(const u of e)if(null!=u&&u>=i&&u<=a){const e=L(l,u);e>-1&&o[e].count++}return{bins:o,minValue:i,maxValue:a,normalizationTotal:n.normalizationTotal}}function G(e,n,t=!1){const{field:l,classificationMethod:i,standardDeviationInterval:a,definedInterval:u,normalizationType:r,normalizationField:s,normalizationTotal:c,minValue:m,maxValue:f}=n,v=n.numBins||o;let g=null,h=null,T=null;if((!i||"equal-interval"===i)&&!r){if(null!=m&&null!=f)g=m,h=f;else{const n=p({values:e,minValue:m,maxValue:f,useSampleStdDev:!r,supportsNullCount:d({normalizationType:r,normalizationField:s,minValue:m,maxValue:f})});g=n.min??null,h=n.max??null}T=j(g??0,h??0,v)}else{const{classBreaks:n}=E(e,{field:l,normalizationType:r,normalizationField:s,normalizationTotal:c,classificationMethod:i,standardDeviationInterval:a,definedInterval:u,minValue:m,maxValue:f,numClasses:v},null!=m&&null!=f?[m,f]:void 0);g=n[0]?.minValue,h=n[n.length-1]?.maxValue,T=n.map(e=>[e.minValue,e.maxValue])}if(t&&T.length){const e=T.at(-1)[1];T.push([e,e])}return{min:g,max:h,intervals:T}}function L(e,n){let t=-1;for(let l=e.length-1;l>=0;l--){if(n>=e[l][0]){t=l;break}}return t}function j(e,n,t){const l=(n-e)/t,i=[];let a,o=e;for(let u=1;u<=t;u++)a=o+l,a=Number(a.toFixed(16)),i.push([o,u===t?n:a]),o=a;return i}export{L as binIndex,E as calculateClassBreaks,U as calculateHistogram,v as calculatePercentile,p as calculateStatistics,f as calculateStringStatistics,k as calculateUniqueValuesCount,q as createClassBreaksDefinition,$ as createUVResult,g as getAttributeComparator,G as getBinParams,j as getEqualIntervalBins,B as getNormalizedValue,d as isNullCountSupported,m as processNullValue,C as processSummaryStatisticsResult,P as resolveCBResult,c as statisticTypes};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const a="20251104",f="61bfaf78a8fb0d16386253622f29c8e7189aa9c2";export{a as buildDate,f as commitHash};
|
package/views/3d/GroundView3D.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import{when as r}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../GroundView.js";import{isIntegratedMeshLayerView as s}from"../support/layerViewUtils.js";let o=class extends(t(a)){constructor(){super(...arguments),this._integratedMeshElevationUpdateHandles=new Map}initialize(){super.initialize(),this.addHandles(r(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e))));const e=this._integratedMeshElevationUpdateHandles;this.addHandles(this.view.allLayerViews.on("change",t=>{t.added.forEach(t=>{s(t)&&e.set(t,t.elevationProvider.on("elevation-change",e=>this._elevationChange(e)))}),t.removed.forEach(t=>{s(t)&&(e.get(t)?.remove(),e.delete(t))})}))}destroy(){this._integratedMeshElevationUpdateHandles.forEach(e=>e.remove()),this._integratedMeshElevationUpdateHandles.clear()}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(t=>t.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return this._terrainSurface?.enabled??!1}get _usingIntegratedMesh(){return this._integratedMeshGroundLayerView?.visible??!1}get spatialReference(){return this._terrainSurface?.spatialReference}intersect(e,t,r,n){this._usingTerrain&&this._terrainSurface?.intersect(e,t,r,n);for(const i of this._integratedMeshElevationUpdateHandles.keys())i.intersect(e,t,r,n)}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}getElevation(e,t,r,n){return this._elevationProvider?.getElevation(e,t,r,n)}getElevations(e,t,r){const{_elevationProvider:n}=this;if(n?.getElevations)return n.getElevations(e,t,r);for(let i=0;i<t;++i)r(i,null)}
|
|
5
|
+
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import{when as r}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../GroundView.js";import{isIntegratedMeshLayerView as s}from"../support/layerViewUtils.js";let o=class extends(t(a)){constructor(){super(...arguments),this._integratedMeshElevationUpdateHandles=new Map}initialize(){super.initialize(),this.addHandles(r(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e))));const e=this._integratedMeshElevationUpdateHandles;this.addHandles(this.view.allLayerViews.on("change",t=>{t.added.forEach(t=>{s(t)&&e.set(t,t.elevationProvider.on("elevation-change",e=>this._elevationChange(e)))}),t.removed.forEach(t=>{s(t)&&(e.get(t)?.remove(),e.delete(t))})}))}destroy(){this._integratedMeshElevationUpdateHandles.forEach(e=>e.remove()),this._integratedMeshElevationUpdateHandles.clear()}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(t=>t.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return this._terrainSurface?.enabled??!1}get _usingIntegratedMesh(){return this._integratedMeshGroundLayerView?.visible??!1}get spatialReference(){return this._terrainSurface?.spatialReference}intersect(e,t,r,n){this._usingTerrain&&this._terrainSurface?.intersect(e,t,r,n);for(const i of this._integratedMeshElevationUpdateHandles.keys())i.intersect(e,t,r,n)}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}getElevation(e,t,r,n){return this._elevationProvider?.getElevation(e,t,r,n)}getElevations(e,t,r){const{_elevationProvider:n}=this;if(n?.getElevations)return n.getElevations(e,t,r);for(let i=0;i<t;++i)r(i,null)}getSphereElevationRange(e,t,r){return this._elevationProvider?.getSphereElevationRange?.(e,t)}getRootElevationRange(){return this._elevationProvider?.getRootElevationRange?.()}get _elevationProvider(){return this._usingIntegratedMesh?this._integratedMeshGroundLayerView?.elevationProvider:this._terrainSurface}get elevationQueryCache(){return this._usingTerrain?this._terrainSurface?.elevationQueryCache:null}get extentAABR(){return this._terrainSurface?.extent}get suspended(){return this._source?.suspended??!1}get ready(){return this._source?.ready??!0}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([n({readOnly:!0})],o.prototype,"_integratedMeshGroundLayerView",null),e([n({readOnly:!0})],o.prototype,"_terrainSurface",null),e([n({readOnly:!0})],o.prototype,"_usingTerrain",null),e([n({readOnly:!0})],o.prototype,"_usingIntegratedMesh",null),e([n({readOnly:!0})],o.prototype,"spatialReference",null),e([n({type:Boolean,readOnly:!0})],o.prototype,"updating",null),e([n({readOnly:!0})],o.prototype,"elevationQueryCache",null),e([n({readOnly:!0})],o.prototype,"extentAABR",null),e([n({readOnly:!0})],o.prototype,"suspended",null),e([n({readOnly:!0})],o.prototype,"ready",null),o=e([i("esri.views.3d.GroundView3D")],o);export{o as GroundView3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deg2rad as e}from"../../../../../core/mathUtils.js";import{createLength as t,toUnit as s,createArea as i}from"../../../../../core/quantity.js";import{lengthUnitFromSpatialReference as o,areaUnitFromSpatialReference as n}from"../../../../../core/units.js";import{set as r,distance as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{C as l,d,f as g,q as c,e as p,g as m,j as u,i as _,n as f}from"../../../../../chunks/vec32.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as L}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as M}from"../../../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as C}from"../../../../../geometry/projectionUtils.js";import{getSphericalPCPF as P}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as R}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as j}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as U}from"../../../../../geometry/projection/projectVectorToVector.js";import{compactIndices as A}from"../../../../../geometry/support/Indices.js";import{segmentIntersects as v}from"../../../../../geometry/support/intersectsBase.js";import{Sphere as I}from"../../../../../geometry/support/sphere.js";import{areaPoints2d as V}from"../../../../../geometry/support/triangle.js";import{bestFitPlane as w,fitHemisphere as W,triangleAreaGeodesic as F,planePointDistance as y,boundingSphere as G}from"../../support/measurementUtils.js";import{getElevationAtPoint as T}from"../../../support/ElevationProvider.js";import{midpoint3d as x,makeOrthonormal as q,tangentFrame as z}from"../../../support/mathUtils.js";import{triangulate as b}from"../../../../support/euclideanAreaMeasurementUtils.js";import{euclideanDistanceBetweenPoints as E}from"../../../../support/euclideanLengthMeasurementUtils.js";import{supportsGeodesicMeasurement as D}from"../../../../support/geodesicMeasurementUtils.js";import{computeEuclideanMeasurementSR as B}from"../../../../support/measurementUtils.js";class H{get numVertices(){return this._length}get hasStagedVertex(){return null!=this._lastCursorPoint}constructor(e,t,s){this._sceneView=e,this._geodesicAreaMeasurementUtils=t,this._geodesicLengthMeasurementUtils=s,this.validMeasurement=!1,this.positionsWorld=[],this.positionsRender=[],this.positionsFittedWorld=[],this.positionsFittedRender=[],this.positionsGeodesic=[],this.positionsSpherical=[],this.positionsStereographic=[],this.pathSegmentLengths=[],this.geodesicPathSegmentLengths=[],this.perimeterSegmentLengths=[],this.intersectingSegments=new Set,this.geodesicIntersectingSegments=new Set,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.areaCentroidWorldCoords=S(),this.areaCentroidRenderCoords=S(),this.geodesicAreaCentroidRenderCoords=S(),this.fittingMode=null,this.area=null,this.geodesicArea=null,this.pathLength=null,this.geodesicPathLength=null,this.perimeterLength=null,this._length=0,this._centroidRenderCoords=S(),this._planeWorldCoords=L(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._lastPathVersion=-1,this._lastCursorPoint=null,this._mode=null,this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=new I;const i=B(e.spatialReference);this._measurementSR=i,this._lengthMeasurementUnit=o(i)??"meters",this._areaMeasurementUnit=n(i)??"square-meters"}update(e,t,s,i,o,n){const r=this._lastPathVersion===e.version,h=t?t.equals(this._lastCursorPoint):null==this._lastCursorPoint,a=this._mode===o;return!(r&&!n&&a&&h)&&(this._lastPathVersion=e.version,this._lastCursorPoint=t,this._updateCursorSegmentLength(e,t),this._update(e,t,s,i,o),!0)}_update(e,s,i,o,n){const r=this._sceneView.renderSpatialReference,h=this._measurementSR,a=i.spatialReference;let l=e.numVertices;const d=!(null==s||s.equals(e.lastPoint)||l>2&&s.equals(e.firstPoint)||e.polygonIsClosed);d&&(l+=1);const g=!e.polygonIsClosed&&l>2,c=e.polygonIsClosed||g;this._resize(l);const p=P(a),m=null!=a&&D(a)?a:null,u=null!=m&&C(a,p),{positionsGeodesic:_,positionsWorld:S,positionsRender:L,positionsSpherical:M}=this,R=(e,t)=>{k(i.elevationProvider,e),j(e,S[t],h),j(e,L[t],r),u&&(j(e,_[t],m),j(e,M[t],p),f(M[t],M[t]))};e.forEachVertexPosition((e,t)=>R(e,t)),d&&R(s,l-1);const U=this._updatePathLengths(c);if(this.pathLength=this._length>1?t(U,this._lengthMeasurementUnit):null,u){const e=this._updateGeodesicPathLengths(c,m);this.geodesicPathLength=null!=e&&this._length>1?e:null}else this.geodesicPathLength=null;if(this._updateMode(n),!c)return this.area=null,this.geodesicArea=null,this.perimeterLength=null,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.intersectingSegments.clear(),this.geodesicIntersectingSegments.clear(),void(this.validMeasurement=!1);this._updateAreaAndPerimeterLength(i,r,h,o),u&&this._updateGeodesicArea(i,m),this.validMeasurement=!0}getData(){return{validMeasurement:this.validMeasurement,numVertices:this.numVertices,hasStagedVertex:this.hasStagedVertex,positionsRender:this.positionsRender,positionsFittedWorld:this.positionsFittedWorld,positionsFittedRender:this.positionsFittedRender,intersectingSegments:this.intersectingSegments,geodesicIntersectingSegments:this.geodesicIntersectingSegments,triangleIndices:this.triangleIndices,geodesicTriangleIndices:this.geodesicTriangleIndices,areaCentroidRenderCoords:this.areaCentroidRenderCoords,geodesicAreaCentroidRenderCoords:this.geodesicAreaCentroidRenderCoords,area:this.area,geodesicArea:this.geodesicArea,pathLength:this.pathLength,geodesicPathLength:this.geodesicPathLength,perimeterLength:this.perimeterLength,actualMeasurementMode:this.actualMeasurementMode}}_resize(e){for(e<this._length&&(this.positionsWorld.length=e,this.positionsRender.length=e,this.positionsFittedWorld.length=e,this.positionsFittedRender.length=e,this.positionsGeodesic.length=e,this.positionsSpherical.length=e,this.positionsStereographic.length=e,this.pathSegmentLengths.length=e,this.geodesicPathSegmentLengths.length=e,this.perimeterSegmentLengths.length=e,this._length=e);this._length<e;)this.positionsWorld.push(S()),this.positionsRender.push(S()),this.positionsFittedWorld.push(a()),this.positionsFittedRender.push(S()),this.positionsGeodesic.push(S()),this.positionsSpherical.push(S()),this.positionsStereographic.push(a()),this.pathSegmentLengths.push(0),this.geodesicPathSegmentLengths.push(0),this.perimeterSegmentLengths.push(0),++this._length}_updatePathLengths(e){const t=this.positionsWorld,s=this.pathSegmentLengths;let i=0;const o=this._length;for(let n=0;n<o;++n){const r=s[n]=l(t[n],t[(n+1)%o]);(n<o-1||e)&&(i+=r)}return i}_updateGeodesicPathLengths(e,i){const o=this.positionsGeodesic,n=this.geodesicPathSegmentLengths;let r=0;const h=this._length;for(let t=0;t<h;++t){const a=this._geodesicLengthMeasurementUtils.geodesicDistance(o[t],o[(t+1)%h],i);if(null==a)return null;const l=s(a,"meters").value,d=n[t]=l;(t<h-1||e)&&(r+=d)}return t(r,"meters")}_updateAreaAndPerimeterLength(e,t,s,i){const o=e.renderCoordsHelper,n=this.positionsWorld,h=this.positionsRender,a=this.positionsFittedWorld,l=this.positionsFittedRender,f=this._planeWorldCoords,S=this._centroidRenderCoords;x(h,S),o.worldUpAtPosition(S,this._worldUp),o.worldBasisAtPosition(S,0,this._worldTangent),R(S,this._worldUp,t,this._worldUp,s),R(S,this._worldTangent,t,this._worldTangent,s),n.length>2&&w(n,f),this.fittingMode=this._selectFittingMode(f,n,this._worldUp,i);let L=0;if("horizontal"===this.fittingMode){let e=-1/0;h.forEach((t,s)=>{const i=o.getAltitude(h[s]);i>e&&(e=i,L=s)})}const M=n[L];let C=f,P=this._worldTangent;"horizontal"===this.fittingMode?C=this._worldUp:"vertical"===this.fittingMode&&(C=this._tempVec3,P=this._worldUp,q(f,this._worldUp,C)),d(this._frame[2],C),q(P,C,this._frame[0]),g(this._frame[1],this._frame[0],this._frame[2]),c(this._frame[1],this._frame[1]);const j=this._tempVec3,A=this._tempU,v=this._tempV;for(let d=0;d<this._length;++d){const e=a[d],i=l[d];p(j,n[d],M),r(e,m(this._frame[0],j),m(this._frame[1],j)),u(A,this._frame[0],e[0]),u(v,this._frame[1],e[1]),_(j,A,v),_(j,j,M),U(j,s,i,t)}this.perimeterLength=this._length>0?this._updatePerimeterLengths():null,x(l,this.areaCentroidRenderCoords),U(this.areaCentroidRenderCoords,t,this.areaCentroidWorldCoords,s),this._updateIntersectingSegments(),this.area=0===this.intersectingSegments.size?this._computeArea():null}_updateGeodesicArea(e,t){const{renderCoordsHelper:s,spatialReference:i}=e,{positionsSpherical:o,positionsStereographic:n}=this,h=this._tempVec3,a=W(o,h);if(!a)return void(this.geodesicArea=null);const l=this._tempU,d=this._tempV;z(h,l,d);for(let g=0;g<this._length;++g){const e=m(o[g],l),t=m(o[g],d),s=m(o[g],h);r(n[g],e/s,t/s)}u(h,h,M(i).radius),s.toRenderCoords(h,P(i),this.geodesicAreaCentroidRenderCoords),this._updateGeodesicIntersectingSegments(),this.geodesicArea=a&&0===this.geodesicIntersectingSegments.size?this._computeGeodesicArea(t):null}_updatePerimeterLengths(){const e=this.positionsFittedWorld,s=this.perimeterSegmentLengths;let i=0;for(let t=0;t<this._length;++t){i+=s[t]=h(e[t],e[(t+1)%this._length])}return t(i,this._lengthMeasurementUnit)}_updateIntersectingSegments(){const e=this.positionsFittedWorld,t=this.intersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];v(o,n,r,h)&&(t.add(s),t.add(i))}}_computeArea(){const e=this.positionsFittedWorld,t=this.triangleIndices=A(b(e));let s=0;for(let i=0;i<t.length;i+=3)s+=V(e[t[i]],e[t[i+1]],e[t[i+2]]);return i(s,this._areaMeasurementUnit)}_updateGeodesicIntersectingSegments(){const e=this.positionsStereographic,t=this.geodesicIntersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];v(o,n,r,h)&&(t.add(s),t.add(i))}}_computeGeodesicArea(e){const t=this.positionsGeodesic,o=this.positionsStereographic,n=this.geodesicTriangleIndices=A(b(o));let r=0;for(let i=0;i<n.length;i+=3){const o=F(t[n[i]],t[n[i+1]],t[n[i+2]],e,this._geodesicAreaMeasurementUtils);if(null==o)return null;r+=s(o,"square-meters").value}return i(r,"square-meters")}_selectFittingMode(t,s,i,o){const n=s.map(e=>Math.abs(y(t,e))).reduce((e,t)=>Math.max(e,t),0);G(s,this._tempSphere);const r=n/(2*this._tempSphere.radius),h=r<o.maxRelativeErrorCoplanar,a=r<o.maxRelativeErrorAlmostCoplanar;let l="horizontal";if(h)l="oblique";else if(a){l=Math.abs(m(i,t))>Math.cos(e(o.verticalAngleThreshold))?"horizontal":"vertical"}return l}_updateCursorSegmentLength(e,t){const s=e.lastPoint;e.isValidPolygon||null==s||null==t?(this.geodesicStagedSegmentLength=null,this.stagedSegmentLength=null):(this.geodesicStagedSegmentLength=this._geodesicLengthMeasurementUtils.geodesicDistanceBetweenPoints(s,t),this.stagedSegmentLength=E(s,t)?.direct)}_updateMode(e){if(0===e){this.actualMeasurementMode="euclidean";let e=0;null!=this.geodesicPathLength&&(e+=this.geodesicPathLength.value),e>Z&&(this.actualMeasurementMode="geodesic")}else this.actualMeasurementMode=1===e?"euclidean":"geodesic";null==this.geodesicPathLength&&(this.actualMeasurementMode="euclidean"),this._mode=e}}function k(e,t){t.hasZ||(t.z=T(e,t,"ground")??0)}const Z=1e5;export{H as MeasurementDataManager};
|
|
5
|
+
import{deg2rad as e}from"../../../../../core/mathUtils.js";import{createLength as t,toUnit as s,createArea as i}from"../../../../../core/quantity.js";import{lengthUnitFromSpatialReference as o,areaUnitFromSpatialReference as n}from"../../../../../core/units.js";import{set as r,distance as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{D as l,d,f as g,q as c,e as p,g as m,j as u,i as _,n as f}from"../../../../../chunks/vec32.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as L}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as M}from"../../../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as C}from"../../../../../geometry/projectionUtils.js";import{getSphericalPCPF as P}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as R}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as j}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as U}from"../../../../../geometry/projection/projectVectorToVector.js";import{compactIndices as A}from"../../../../../geometry/support/Indices.js";import{segmentIntersects as v}from"../../../../../geometry/support/intersectsBase.js";import{Sphere as I}from"../../../../../geometry/support/sphere.js";import{areaPoints2d as V}from"../../../../../geometry/support/triangle.js";import{bestFitPlane as w,fitHemisphere as W,triangleAreaGeodesic as F,planePointDistance as y,boundingSphere as G}from"../../support/measurementUtils.js";import{getElevationAtPoint as T}from"../../../support/ElevationProvider.js";import{midpoint3d as x,makeOrthonormal as q,tangentFrame as z}from"../../../support/mathUtils.js";import{triangulate as b}from"../../../../support/euclideanAreaMeasurementUtils.js";import{euclideanDistanceBetweenPoints as E}from"../../../../support/euclideanLengthMeasurementUtils.js";import{supportsGeodesicMeasurement as D}from"../../../../support/geodesicMeasurementUtils.js";import{computeEuclideanMeasurementSR as B}from"../../../../support/measurementUtils.js";class H{get numVertices(){return this._length}get hasStagedVertex(){return null!=this._lastCursorPoint}constructor(e,t,s){this._sceneView=e,this._geodesicAreaMeasurementUtils=t,this._geodesicLengthMeasurementUtils=s,this.validMeasurement=!1,this.positionsWorld=[],this.positionsRender=[],this.positionsFittedWorld=[],this.positionsFittedRender=[],this.positionsGeodesic=[],this.positionsSpherical=[],this.positionsStereographic=[],this.pathSegmentLengths=[],this.geodesicPathSegmentLengths=[],this.perimeterSegmentLengths=[],this.intersectingSegments=new Set,this.geodesicIntersectingSegments=new Set,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.areaCentroidWorldCoords=S(),this.areaCentroidRenderCoords=S(),this.geodesicAreaCentroidRenderCoords=S(),this.fittingMode=null,this.area=null,this.geodesicArea=null,this.pathLength=null,this.geodesicPathLength=null,this.perimeterLength=null,this._length=0,this._centroidRenderCoords=S(),this._planeWorldCoords=L(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._lastPathVersion=-1,this._lastCursorPoint=null,this._mode=null,this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=new I;const i=B(e.spatialReference);this._measurementSR=i,this._lengthMeasurementUnit=o(i)??"meters",this._areaMeasurementUnit=n(i)??"square-meters"}update(e,t,s,i,o,n){const r=this._lastPathVersion===e.version,h=t?t.equals(this._lastCursorPoint):null==this._lastCursorPoint,a=this._mode===o;return!(r&&!n&&a&&h)&&(this._lastPathVersion=e.version,this._lastCursorPoint=t,this._updateCursorSegmentLength(e,t),this._update(e,t,s,i,o),!0)}_update(e,s,i,o,n){const r=this._sceneView.renderSpatialReference,h=this._measurementSR,a=i.spatialReference;let l=e.numVertices;const d=!(null==s||s.equals(e.lastPoint)||l>2&&s.equals(e.firstPoint)||e.polygonIsClosed);d&&(l+=1);const g=!e.polygonIsClosed&&l>2,c=e.polygonIsClosed||g;this._resize(l);const p=P(a),m=null!=a&&D(a)?a:null,u=null!=m&&C(a,p),{positionsGeodesic:_,positionsWorld:S,positionsRender:L,positionsSpherical:M}=this,R=(e,t)=>{k(i.elevationProvider,e),j(e,S[t],h),j(e,L[t],r),u&&(j(e,_[t],m),j(e,M[t],p),f(M[t],M[t]))};e.forEachVertexPosition((e,t)=>R(e,t)),d&&R(s,l-1);const U=this._updatePathLengths(c);if(this.pathLength=this._length>1?t(U,this._lengthMeasurementUnit):null,u){const e=this._updateGeodesicPathLengths(c,m);this.geodesicPathLength=null!=e&&this._length>1?e:null}else this.geodesicPathLength=null;if(this._updateMode(n),!c)return this.area=null,this.geodesicArea=null,this.perimeterLength=null,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.intersectingSegments.clear(),this.geodesicIntersectingSegments.clear(),void(this.validMeasurement=!1);this._updateAreaAndPerimeterLength(i,r,h,o),u&&this._updateGeodesicArea(i,m),this.validMeasurement=!0}getData(){return{validMeasurement:this.validMeasurement,numVertices:this.numVertices,hasStagedVertex:this.hasStagedVertex,positionsRender:this.positionsRender,positionsFittedWorld:this.positionsFittedWorld,positionsFittedRender:this.positionsFittedRender,intersectingSegments:this.intersectingSegments,geodesicIntersectingSegments:this.geodesicIntersectingSegments,triangleIndices:this.triangleIndices,geodesicTriangleIndices:this.geodesicTriangleIndices,areaCentroidRenderCoords:this.areaCentroidRenderCoords,geodesicAreaCentroidRenderCoords:this.geodesicAreaCentroidRenderCoords,area:this.area,geodesicArea:this.geodesicArea,pathLength:this.pathLength,geodesicPathLength:this.geodesicPathLength,perimeterLength:this.perimeterLength,actualMeasurementMode:this.actualMeasurementMode}}_resize(e){for(e<this._length&&(this.positionsWorld.length=e,this.positionsRender.length=e,this.positionsFittedWorld.length=e,this.positionsFittedRender.length=e,this.positionsGeodesic.length=e,this.positionsSpherical.length=e,this.positionsStereographic.length=e,this.pathSegmentLengths.length=e,this.geodesicPathSegmentLengths.length=e,this.perimeterSegmentLengths.length=e,this._length=e);this._length<e;)this.positionsWorld.push(S()),this.positionsRender.push(S()),this.positionsFittedWorld.push(a()),this.positionsFittedRender.push(S()),this.positionsGeodesic.push(S()),this.positionsSpherical.push(S()),this.positionsStereographic.push(a()),this.pathSegmentLengths.push(0),this.geodesicPathSegmentLengths.push(0),this.perimeterSegmentLengths.push(0),++this._length}_updatePathLengths(e){const t=this.positionsWorld,s=this.pathSegmentLengths;let i=0;const o=this._length;for(let n=0;n<o;++n){const r=s[n]=l(t[n],t[(n+1)%o]);(n<o-1||e)&&(i+=r)}return i}_updateGeodesicPathLengths(e,i){const o=this.positionsGeodesic,n=this.geodesicPathSegmentLengths;let r=0;const h=this._length;for(let t=0;t<h;++t){const a=this._geodesicLengthMeasurementUtils.geodesicDistance(o[t],o[(t+1)%h],i);if(null==a)return null;const l=s(a,"meters").value,d=n[t]=l;(t<h-1||e)&&(r+=d)}return t(r,"meters")}_updateAreaAndPerimeterLength(e,t,s,i){const o=e.renderCoordsHelper,n=this.positionsWorld,h=this.positionsRender,a=this.positionsFittedWorld,l=this.positionsFittedRender,f=this._planeWorldCoords,S=this._centroidRenderCoords;x(h,S),o.worldUpAtPosition(S,this._worldUp),o.worldBasisAtPosition(S,0,this._worldTangent),R(S,this._worldUp,t,this._worldUp,s),R(S,this._worldTangent,t,this._worldTangent,s),n.length>2&&w(n,f),this.fittingMode=this._selectFittingMode(f,n,this._worldUp,i);let L=0;if("horizontal"===this.fittingMode){let e=-1/0;h.forEach((t,s)=>{const i=o.getAltitude(h[s]);i>e&&(e=i,L=s)})}const M=n[L];let C=f,P=this._worldTangent;"horizontal"===this.fittingMode?C=this._worldUp:"vertical"===this.fittingMode&&(C=this._tempVec3,P=this._worldUp,q(f,this._worldUp,C)),d(this._frame[2],C),q(P,C,this._frame[0]),g(this._frame[1],this._frame[0],this._frame[2]),c(this._frame[1],this._frame[1]);const j=this._tempVec3,A=this._tempU,v=this._tempV;for(let d=0;d<this._length;++d){const e=a[d],i=l[d];p(j,n[d],M),r(e,m(this._frame[0],j),m(this._frame[1],j)),u(A,this._frame[0],e[0]),u(v,this._frame[1],e[1]),_(j,A,v),_(j,j,M),U(j,s,i,t)}this.perimeterLength=this._length>0?this._updatePerimeterLengths():null,x(l,this.areaCentroidRenderCoords),U(this.areaCentroidRenderCoords,t,this.areaCentroidWorldCoords,s),this._updateIntersectingSegments(),this.area=0===this.intersectingSegments.size?this._computeArea():null}_updateGeodesicArea(e,t){const{renderCoordsHelper:s,spatialReference:i}=e,{positionsSpherical:o,positionsStereographic:n}=this,h=this._tempVec3,a=W(o,h);if(!a)return void(this.geodesicArea=null);const l=this._tempU,d=this._tempV;z(h,l,d);for(let g=0;g<this._length;++g){const e=m(o[g],l),t=m(o[g],d),s=m(o[g],h);r(n[g],e/s,t/s)}u(h,h,M(i).radius),s.toRenderCoords(h,P(i),this.geodesicAreaCentroidRenderCoords),this._updateGeodesicIntersectingSegments(),this.geodesicArea=a&&0===this.geodesicIntersectingSegments.size?this._computeGeodesicArea(t):null}_updatePerimeterLengths(){const e=this.positionsFittedWorld,s=this.perimeterSegmentLengths;let i=0;for(let t=0;t<this._length;++t){i+=s[t]=h(e[t],e[(t+1)%this._length])}return t(i,this._lengthMeasurementUnit)}_updateIntersectingSegments(){const e=this.positionsFittedWorld,t=this.intersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];v(o,n,r,h)&&(t.add(s),t.add(i))}}_computeArea(){const e=this.positionsFittedWorld,t=this.triangleIndices=A(b(e));let s=0;for(let i=0;i<t.length;i+=3)s+=V(e[t[i]],e[t[i+1]],e[t[i+2]]);return i(s,this._areaMeasurementUnit)}_updateGeodesicIntersectingSegments(){const e=this.positionsStereographic,t=this.geodesicIntersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];v(o,n,r,h)&&(t.add(s),t.add(i))}}_computeGeodesicArea(e){const t=this.positionsGeodesic,o=this.positionsStereographic,n=this.geodesicTriangleIndices=A(b(o));let r=0;for(let i=0;i<n.length;i+=3){const o=F(t[n[i]],t[n[i+1]],t[n[i+2]],e,this._geodesicAreaMeasurementUtils);if(null==o)return null;r+=s(o,"square-meters").value}return i(r,"square-meters")}_selectFittingMode(t,s,i,o){const n=s.map(e=>Math.abs(y(t,e))).reduce((e,t)=>Math.max(e,t),0);G(s,this._tempSphere);const r=n/(2*this._tempSphere.radius),h=r<o.maxRelativeErrorCoplanar,a=r<o.maxRelativeErrorAlmostCoplanar;let l="horizontal";if(h)l="oblique";else if(a){l=Math.abs(m(i,t))>Math.cos(e(o.verticalAngleThreshold))?"horizontal":"vertical"}return l}_updateCursorSegmentLength(e,t){const s=e.lastPoint;e.isValidPolygon||null==s||null==t?(this.geodesicStagedSegmentLength=null,this.stagedSegmentLength=null):(this.geodesicStagedSegmentLength=this._geodesicLengthMeasurementUtils.geodesicDistanceBetweenPoints(s,t),this.stagedSegmentLength=E(s,t)?.direct)}_updateMode(e){if(0===e){this.actualMeasurementMode="euclidean";let e=0;null!=this.geodesicPathLength&&(e+=this.geodesicPathLength.value),e>Z&&(this.actualMeasurementMode="geodesic")}else this.actualMeasurementMode=1===e?"euclidean":"geodesic";null==this.geodesicPathLength&&(this.actualMeasurementMode="euclidean"),this._mode=e}}function k(e,t){t.hasZ||(t.z=T(e,t,"ground")??0)}const Z=1e5;export{H as MeasurementDataManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{m as e,j as n,g as t,e as i,
|
|
5
|
+
import"../../../../core/has.js";import{m as e,j as n,g as t,e as i,F as o}from"../../../../chunks/vec32.js";import r from"../../../../geometry/Point.js";import{sv3d as a}from"../../../../geometry/support/vectorStacks.js";import{automaticHeadingFromCamera as s}from"./lengthDimensionManipulatorUtils.js";import{isGeodesicDimension as l,directUp as d,directStartToEnd as c}from"./lengthDimensionUtils.js";import{constraintThresholdPx as u}from"./settings.js";function m(e,n){return{enabled:n.effectiveFeatureEnabled,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,geometry:e.geometry}}function P(r,s){if(l(r))return 2;if(!r.enabled)return null;const{geometry:m}=r;if(null==m||e(m.directSegment.startRenderSpace,m.directSegment.endRenderSpace))return null;const{camera:P}=s.state,p=d(a.get(),m,s.renderCoordsHelper),f=c(a.get(),m),g=n(a.get(),p,t(f,p)),S=i(a.get(),f,g),v=o(S),y=o(g),{startRenderSpace:A,endRenderSpace:R}=m.directSegment,j=Math.max(P.computeScreenPixelSizeAt(A)*u,P.computeScreenPixelSizeAt(R)*u)**2;return v<j?1:y<j?0:null}function p(e,n,{constraint:t,view:i}){const{unconstrainedGeometry:o}=e;if(null==o)return;const{renderCoordsHelper:a,spatialReference:s}=i,{startRenderSpace:l,endRenderSpace:d}=o.directSegment,c=a.fromRenderCoords(l,new r({spatialReference:s})),u=a.fromRenderCoords(d,new r({spatialReference:s}));let m;m="start"===n?{startPoint:c}:{endPoint:u},f(e,m,{constraint:t,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,unconstrainedGeometry:o,view:i})}function f(e,n,t){const{constraint:i,elevationAlignedStartPoint:o,elevationAlignedEndPoint:r,unconstrainedGeometry:a,view:l}=t,{dimension:d,previousConstraint:c,preConstraintProperties:u}=e;if(null==o||null==r)return;const m=()=>{"startPoint"in n?d.startPoint=n.startPoint:"endPoint"in n&&(d.endPoint=n.endPoint)};if(null==i)m(),null!=c&&null!=u&&(d.measureType=u.measureType,d.orientation=u.orientation);else switch(d.measureType="direct",i){case 0:if(i!==c&&(d.orientation=0),"startPoint"in n){const e=n.startPoint;null!=e&&(e.z=r.z),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.z=o.z),d.endPoint=e}break;case 1:if(i!==c&&(d.orientation=s(a,l)),"startPoint"in n){const e=n.startPoint;null!=e&&(e.x=r.x,e.y=r.y),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.x=o.x,e.y=o.y),d.endPoint=e}break;case 2:i!==c&&null!=u&&(d.orientation=u.orientation),m()}e.previousConstraint=i,e.unconstrainedGeometry=a}export{f as applyConstraint,P as computeConstraint,m as constraintDependencies,p as reapplyConstraint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deg2rad as e}from"../../../../core/mathUtils.js";import{toUnit as t}from"../../../../core/quantity.js";import{adaptiveVerticalLengthUnit as n,adaptiveLengthUnit as r}from"../../../../core/units.js";import{ensureType as i}from"../../../../core/accessorSupport/ensureType.js";import{fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as s,
|
|
5
|
+
import{deg2rad as e}from"../../../../core/mathUtils.js";import{toUnit as t}from"../../../../core/quantity.js";import{adaptiveVerticalLengthUnit as n,adaptiveLengthUnit as r}from"../../../../core/units.js";import{ensureType as i}from"../../../../core/accessorSupport/ensureType.js";import{fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as s,F as d,c,p as l,a as u,f as p,g as m,G as g,n as S,v as f}from"../../../../chunks/vec32.js";import{create as v,ZEROS as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import A from"../../../../geometry/Point.js";import{sv3d as P}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{clonePoint as h}from"../../../../layers/graphics/hydratedFeatures.js";import{EuclideanSegment as j}from"../../interactive/visualElements/support/Segment.js";import{euclideanDirectDistanceBetweenPoints as E,euclideanDirectDistance as w}from"../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistanceThreshold as x}from"../../../support/geodesicMeasurementUtils.js";class z{constructor(e,t,n,r,i,o){this.elevationAlignedStartPoint=e,this.elevationAlignedEndPoint=t,this.directSegment=n,this.dimensionSegment=r,this.primaryOffsetAxis=i,this.spatialReference=o}}const T=i(A);function b(e,i,o,a){if(null==e)return null;let s;if("horizontal"===i)s=a.autoDistanceBetweenPoints2D(T(e.elevationAlignedStartPoint),T(e.elevationAlignedEndPoint));else{const{startRenderSpace:t,endRenderSpace:n}=e.dimensionSegment;s=w(t,n,e.spatialReference)}if(null==s)return null;const d="vertical"===i?n(s.value,s.unit,o):r(s.value,s.unit,o);return t(s,d)}function C(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,dimension:{offset:r,measureType:i,orientation:o}}=e;return{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o}}function U({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,offset:n,measureType:r,orientation:i},o,a=null){if(null==e||null==t)return null;const d=O(a?.directSegment??new j,{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t},o),c=a?.primaryOffsetAxis??v();G(c,{measureType:r,elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,directSegment:d,orientation:i,renderCoordsHelper:o});const l=a?.dimensionSegment??new j;return J({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t})&&"vertical"===r?(s(l.startRenderSpace,d.startRenderSpace),s(l.endRenderSpace,d.endRenderSpace)):K(l,c,n,d,o),new z(e,t,d,l,c,o.spatialReference)}function k(e,t,n,r){return 0===t?(s(e.startRenderSpace,n.startRenderSpace),s(e.endRenderSpace,r.startRenderSpace)):(s(e.startRenderSpace,n.endRenderSpace),s(e.endRenderSpace,r.endRenderSpace)),e}function M(e,t,n,r){c(e.startRenderSpace,t.startRenderSpace,n,r),c(e.endRenderSpace,t.endRenderSpace,n,r)}function H(e,t,n,r){switch(t){case"direct":return O(e,n,r);case"horizontal":case"vertical":{const{elevationAlignedStartPoint:i,elevationAlignedEndPoint:o,dimension:a,geometry:s}=n;let d;if("direct"===a.measureType){d=B(s,r)===i.z>o.z,"horizontal"===t&&(d=!d)}else d=!D(s);const[c,l]=d?[i,o]:[o,i],u=h(l,F);return"horizontal"===t?u.z=c.z:(u.x=c.x,u.y=c.y),r.toRenderCoords(c,e.startRenderSpace),r.toRenderCoords(u,e.endRenderSpace),e}}}function O(e,t,n){return n.toRenderCoords(t.elevationAlignedStartPoint,e.startRenderSpace),n.toRenderCoords(t.elevationAlignedEndPoint,e.endRenderSpace),e}function B(e,t){const n=e.directSegment.eval(.5,P.get()),r=t.worldUpAtPosition(n,P.get()),i=e.dimensionSegment.eval(.5,P.get()),o=u(P.get(),i,n);return!g(o,R)&&m(o,r)>0}function D(e){const{startRenderSpace:t,endRenderSpace:n}=e.dimensionSegment,{startRenderSpace:r,endRenderSpace:i}=e.directSegment;return f(r,t)<f(i,n)}const F=y(0,0,0,null);function I(e,t,n,r){const{directSegment:i}=n,o=G(P.get(),{measureType:t,directSegment:i,renderCoordsHelper:r}),a=K(q,o,0,i,r).eval(.5,P.get()),s=u(P.get(),e,a);return m(s,o)*r.unitInMeters}const q=new j;function G(t,n){const{measureType:r,elevationAlignedStartPoint:i,elevationAlignedEndPoint:a,directSegment:{startRenderSpace:d,endRenderSpace:c},directSegment:f,renderCoordsHelper:v}=n,A=f.eval(.5,P.get()),y=v.worldUpAtPosition(A,P.get()),h=v.worldBasisAtPosition(A,1,P.get());switch(r){case"horizontal":s(t,y);break;case"vertical":m(d,y)<m(c,y)?u(t,c,d):u(t,d,c),p(t,t,y),p(t,t,y);break;case"direct":{const r=n.orientation??0;if(J({elevationAlignedStartPoint:i,elevationAlignedEndPoint:a}))o(L,-e(r),y),l(t,h,L);else{const n=u(P.get(),c,d),i=p(P.get(),n,y);p(i,i,n),o(L,e(r),n),l(t,i,L)}break}}return g(t,R)?s(t,h):S(t,t)}const L=a();function J({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}){return null!=e&&null!=t&&e.x===t.x&&e.y===t.y}function K(e,t,n,r,i){const{startRenderSpace:o,endRenderSpace:a}=r,s=n/i.unitInMeters,[d,l]=N(o,a,t,s);return c(e.startRenderSpace,r.startRenderSpace,t,d),c(e.endRenderSpace,r.endRenderSpace,t,l),e}function N(e,t,n,r=0){const i=m(t,n),o=m(e,n),a=Math.abs(i-o)+r;return i>o?[a,r]:[r,a]}function Q(e,t,n){const r=t.directSegment.eval(.5,P.get());return n.worldUpAtPosition(r,e)}function V(e,t){const{startRenderSpace:n,endRenderSpace:r}=t.directSegment;return u(e,r,n)}function W(e,t,n={invert:!1}){const{startRenderSpace:r,endRenderSpace:i}=t.dimensionSegment;return n.invert?u(e,r,i):u(e,i,r)}function X(e,t){const n=e.directSegment.eval(.5,P.get());return t.headingAtPosition(n,e.primaryOffsetAxis)}function Y(e,t){return d(W(Z,e))/t**2}const Z=v();function $(e){const{elevationAlignedStartPoint:n,elevationAlignedEndPoint:r}=e;if(null==n||null==r)return!1;const i=E(n,r);return null!=i&&t(i,"meters").value>x}function _(e){return null!=e.geometry}export{z as LengthDimensionGeometry,J as arePointsVerticallyAligned,C as computationToGeometryDependencies,U as computeGeometryFromDimension,b as computeLength,G as computeOffsetAxis,I as computeOffsetForPoint,H as computeSegmentForMeasureType,k as computeSpanningSegment,W as dimensionStartToEnd,V as directStartToEnd,Q as directUp,X as headingFromGeometry,$ as isGeodesicDimension,_ as isValidComputation,Y as maxScreenLengthSquaredFromGeometry,M as offsetSegment};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{updatePointsFromFeatureReference as t,getFeatureId as n}from"../../../../analysis/featureReferenceUtils.js";import{createTask as o}from"../../../../core/asyncUtils.js";import{EventedAccessor as i}from"../../../../core/Evented.js";import r from"../../../../core/Handles.js";import{handlesGroup as s,makeHandle as a}from"../../../../core/handleUtils.js";import l from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as c,on as p}from"../../../../core/reactiveUtils.js";import{property as g,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{d as v,e as m,n as f,j as _,i as b,G as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import P from"../../../../geometry/Point.js";import{projectOrLoad as I}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as S}from"../../../../geometry/projection/projectBoundingRect.js";import{intersectsSegment as j}from"../../../../geometry/support/aaBoundingBox.js";import{empty as w,containsPointObject as R,intersectsSegment as A}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as H,create as E}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as L}from"../../../../support/elevationInfoUtils.js";import V from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as F}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as x}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as D}from"../support/projectionUtils.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as U,TaskPriority as z}from"../../../support/Scheduler.js";let N=class extends i{constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=U,this._computationHandles=new r,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):U,this._intersector=new x({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:n,computationResult:o}=t,{observerAdjusted:i,targetAdjusted:r}=n,{start:s,end:a}=o;v(s,i),v(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:n}=this,{inputPoints:o}=e,{observer:i,target:r,observerAdjusted:s,targetAdjusted:a}=o;v(s,i),v(a,r),t(n,this._intersector.intersector,o);const{observerSurfaceNormal:l,targetSurfaceNormal:u}=o,d=this._screenPixelSize,c=Z;null!=l?v(c,l):m(c,a,s);const p=d;f(c,c),_(c,c,Math.min(p,1)),b(s,s,c),null!=u?v(c,u):m(c,s,a);const g=n.state.camera.computeScreenPixelSizeAt(a);f(c,c),_(c,c,Math.min(g,1)),b(a,a,c)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:n}=this,{sceneIntersectionHelper:o,renderCoordsHelper:i}=n;if(null==o)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:u}=a,{start:d,end:c}=s,p=H(d,c,q);r.options.store=0,o.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,m=Z;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){v(t.originalIntersection,h),v(t.originalObserver,d),v(t.originalTarget,c),i.fromRenderCoords(h,m,n.spatialReference);const e=1-y(c,u)/y(d,u);f=y(l,h)>=e*y(l,u)}const _=new P(m,n.spatialReference);{const{result:t,target:o}=e;null!=t?(t.target=o,t.intersectedGraphic=f?null:G(g,n),t.intersectedLocation=f?null:_,t.visible=f):e.result=new V({target:o,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,n),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,n=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==n)return!1;const{observerAdjusted:o,targetAdjusted:i}=e.inputPoints,r=n.intersectsPoint(o),s=n.intersectsPoint(i);return r&&s}_onObserverPositionChange(e,t,o,i,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return D(this.analysis,e.spatialReference,l.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=k(t,o),{absoluteZ:a,elevation:u}=L(t.x,t.y,t.z,this.view.spatialReference,this.view,s),d=t.clone();d.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=d;const c=T();this.view.renderCoordsHelper.toRenderCoords(d,c),this._elevationAlignedObserverPositionRenderSpace=c,this._observerGroundOffsetRenderSpace=a-u,this._observerFeatureId=n(i),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,n,o,i){const{inputPoints:r}=e;switch(v(r.observer,t),r.observerFeatureId=i,r.observerSurfaceNormal=null,o){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,n,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,o,i,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==o)return null!=t&&D(this.analysis,t.spatialReference,l.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const u=k(o,i),{absoluteZ:d,elevation:c}=L(o.x,o.y,o.z,this.view.spatialReference,this.view,u),p=o.clone();switch(p.z=d,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=n(r),a.targetSurfaceNormal=null,u.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,d-c,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return s([this._updatingHandles.add(()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:I(e.target.position,this.view.spatialReference)}),({computation:e,targetPosition:t,targetElevationInfo:n,targetFeatureInfo:o,projectedTargetPosition:i})=>{null==i.pending?this._onTargetPositionChange(e,t,i.geometry,n,o):this._updatingHandles.addPromise(i.pending)},c)])}_connectComputationToObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver}),({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())},c)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId}),({computation:e,observer:t,observerGroundOffset:n,observerElevationMode:o,observerFeatureId:i})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,n,o,i)},c)}_connectComputationToCamera(e){return this._updatingHandles.add(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()})}_connectComputationToSlicePlane(e){return this._updatingHandles.add(()=>this.view.slice.plane,()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()})}_connectComputationToElevation(e){const t=(n,o)=>{const i=this.analysis.observer,r=e.target;let s=null,a=null,l=null,u=null,d=null,c=null;if(null!=i?.position){const e=I(i.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally(()=>t(n,o));s=e.geometry,a=i.elevationInfo,l=i.feature}if(null!=r.position){const e=I(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally(()=>t(n,o));u=e.geometry,d=r.elevationInfo,c=r.feature}null==s&&null==u||(S(n,o,J,this.view.spatialReference),null!=s&&R(J,s)&&this._onObserverPositionChange(null!=i?i.position:null,s,a,l,!1),null!=u&&R(J,u)&&this._onTargetPositionChange(e,r.position,u,d,c,!1),null!=s&&null!=u&&A(J,s,u)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:n})=>t(e,n))}_connectComputationToTask(e){let t=null;const n={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return s([this._updatingHandles.add(()=>e.inputPoints,()=>{t=u(t),t=o(async e=>{await d(this._frameTask.schedule(()=>this._computeResult(n),e))})},{initial:!0,equals:()=>!1}),a(()=>t=u(t))])}_connectComputationToContent(e){return p(()=>this.view.pointsOfInterest?.contentGeometryUpdates.events,"request-update",t=>{const n=t?.renderBounds,{observerAdjusted:o,targetAdjusted:i}=e.inputPoints;(null==n||j(n,o,i))&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())})}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e),this._connectComputationToContent(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_onTargetCollectionChange({added:e,removed:t}){for(const n of t)this._removeTarget(n);for(const n of e)this._addTarget(n)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some(t=>t.target===e)||this._computations.add(new F({target:e}))}_removeTarget(e){const t=this._computations.findIndex(t=>t.target===e);this._computations.removeAt(t)}_connectObserver(){return s([this._updatingHandles.add(()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:I(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null}),({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:n,observerFeatureInfo:o})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,n,o,!0):this._updatingHandles.addPromise(t.pending)},c)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this._computations,e=>this._onComputationCollectionChange(e),{initial:!0,final:!0})}_connectTargets(){return s([this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,e=>this._onTargetCollectionChange(e),{initial:!0,final:!0}),this._updatingHandles.add(()=>this.analysisViewData.cursorTarget,(e,t)=>{this._onCursorTargetChange(e,t)})])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:n}=t;if(null==e||null==n)return!1;const o=Z;n.toRenderCoords(e,o);const i=t.state.camera.computeScreenPixelSizeAt(o);return Math.abs((i-this._screenPixelSize)/this._screenPixelSize)>B}};function k(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:n,inputPoints:o}=e,{start:i,end:r,intersection:s}=n,{originalIntersection:a,originalObserver:l,originalTarget:u}=t;if(v(s,a),o.isValid){const e=Z,t=y(l,a)/y(l,u);C(e,i,l),_(e,e,1-t),b(s,s,e),C(e,r,u),_(e,e,t),b(s,s,e),n.isValid=!0}else e.result=null,n.isValid=!1,n.isTargetVisible=!1}e([g({constructOnly:!0})],N.prototype,"analysis",void 0),e([g({constructOnly:!0})],N.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],N.prototype,"view",void 0),e([g()],N.prototype,"updating",null),e([g()],N.prototype,"priority",null),e([g()],N.prototype,"updateOnCameraChange",void 0),e([g()],N.prototype,"_computations",null),e([g()],N.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],N.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],N.prototype,"_effectiveObserverElevationMode",void 0),e([g()],N.prototype,"_observerFeatureId",void 0),e([g()],N.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],N.prototype,"_updatingHandles",void 0),e([g()],N.prototype,"_frameTask",void 0),e([g()],N.prototype,"_isCameraDirty",null),N=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],N);const B=.1,Z=T(),q=E(),J=w();export{N as LineOfSightController};
|
|
5
|
+
import{__decorate as e}from"tslib";import{updatePointsFromFeatureReference as t,getFeatureId as n}from"../../../../analysis/featureReferenceUtils.js";import{createTask as o}from"../../../../core/asyncUtils.js";import{EventedAccessor as i}from"../../../../core/Evented.js";import r from"../../../../core/Handles.js";import{handlesGroup as s,makeHandle as a}from"../../../../core/handleUtils.js";import l from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as c,on as p}from"../../../../core/reactiveUtils.js";import{property as g,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{d as v,e as m,n as f,j as _,i as b,H as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import P from"../../../../geometry/Point.js";import{projectOrLoad as I}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as S}from"../../../../geometry/projection/projectBoundingRect.js";import{intersectsSegment as j}from"../../../../geometry/support/aaBoundingBox.js";import{empty as w,containsPointObject as R,intersectsSegment as A}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as H,create as E}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as L}from"../../../../support/elevationInfoUtils.js";import V from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as F}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as x}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as D}from"../support/projectionUtils.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as U,TaskPriority as z}from"../../../support/Scheduler.js";let N=class extends i{constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=U,this._computationHandles=new r,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):U,this._intersector=new x({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:n,computationResult:o}=t,{observerAdjusted:i,targetAdjusted:r}=n,{start:s,end:a}=o;v(s,i),v(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:n}=this,{inputPoints:o}=e,{observer:i,target:r,observerAdjusted:s,targetAdjusted:a}=o;v(s,i),v(a,r),t(n,this._intersector.intersector,o);const{observerSurfaceNormal:l,targetSurfaceNormal:u}=o,d=this._screenPixelSize,c=Z;null!=l?v(c,l):m(c,a,s);const p=d;f(c,c),_(c,c,Math.min(p,1)),b(s,s,c),null!=u?v(c,u):m(c,s,a);const g=n.state.camera.computeScreenPixelSizeAt(a);f(c,c),_(c,c,Math.min(g,1)),b(a,a,c)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:n}=this,{sceneIntersectionHelper:o,renderCoordsHelper:i}=n;if(null==o)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:u}=a,{start:d,end:c}=s,p=H(d,c,q);r.options.store=0,o.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,m=Z;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){v(t.originalIntersection,h),v(t.originalObserver,d),v(t.originalTarget,c),i.fromRenderCoords(h,m,n.spatialReference);const e=1-y(c,u)/y(d,u);f=y(l,h)>=e*y(l,u)}const _=new P(m,n.spatialReference);{const{result:t,target:o}=e;null!=t?(t.target=o,t.intersectedGraphic=f?null:G(g,n),t.intersectedLocation=f?null:_,t.visible=f):e.result=new V({target:o,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,n),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,n=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==n)return!1;const{observerAdjusted:o,targetAdjusted:i}=e.inputPoints,r=n.intersectsPoint(o),s=n.intersectsPoint(i);return r&&s}_onObserverPositionChange(e,t,o,i,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return D(this.analysis,e.spatialReference,l.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=k(t,o),{absoluteZ:a,elevation:u}=L(t.x,t.y,t.z,this.view.spatialReference,this.view,s),d=t.clone();d.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=d;const c=T();this.view.renderCoordsHelper.toRenderCoords(d,c),this._elevationAlignedObserverPositionRenderSpace=c,this._observerGroundOffsetRenderSpace=a-u,this._observerFeatureId=n(i),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,n,o,i){const{inputPoints:r}=e;switch(v(r.observer,t),r.observerFeatureId=i,r.observerSurfaceNormal=null,o){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,n,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,o,i,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==o)return null!=t&&D(this.analysis,t.spatialReference,l.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const u=k(o,i),{absoluteZ:d,elevation:c}=L(o.x,o.y,o.z,this.view.spatialReference,this.view,u),p=o.clone();switch(p.z=d,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=n(r),a.targetSurfaceNormal=null,u.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,d-c,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return s([this._updatingHandles.add(()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:I(e.target.position,this.view.spatialReference)}),({computation:e,targetPosition:t,targetElevationInfo:n,targetFeatureInfo:o,projectedTargetPosition:i})=>{null==i.pending?this._onTargetPositionChange(e,t,i.geometry,n,o):this._updatingHandles.addPromise(i.pending)},c)])}_connectComputationToObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver}),({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())},c)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId}),({computation:e,observer:t,observerGroundOffset:n,observerElevationMode:o,observerFeatureId:i})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,n,o,i)},c)}_connectComputationToCamera(e){return this._updatingHandles.add(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()})}_connectComputationToSlicePlane(e){return this._updatingHandles.add(()=>this.view.slice.plane,()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()})}_connectComputationToElevation(e){const t=(n,o)=>{const i=this.analysis.observer,r=e.target;let s=null,a=null,l=null,u=null,d=null,c=null;if(null!=i?.position){const e=I(i.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally(()=>t(n,o));s=e.geometry,a=i.elevationInfo,l=i.feature}if(null!=r.position){const e=I(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally(()=>t(n,o));u=e.geometry,d=r.elevationInfo,c=r.feature}null==s&&null==u||(S(n,o,J,this.view.spatialReference),null!=s&&R(J,s)&&this._onObserverPositionChange(null!=i?i.position:null,s,a,l,!1),null!=u&&R(J,u)&&this._onTargetPositionChange(e,r.position,u,d,c,!1),null!=s&&null!=u&&A(J,s,u)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:n})=>t(e,n))}_connectComputationToTask(e){let t=null;const n={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return s([this._updatingHandles.add(()=>e.inputPoints,()=>{t=u(t),t=o(async e=>{await d(this._frameTask.schedule(()=>this._computeResult(n),e))})},{initial:!0,equals:()=>!1}),a(()=>t=u(t))])}_connectComputationToContent(e){return p(()=>this.view.pointsOfInterest?.contentGeometryUpdates.events,"request-update",t=>{const n=t?.renderBounds,{observerAdjusted:o,targetAdjusted:i}=e.inputPoints;(null==n||j(n,o,i))&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())})}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e),this._connectComputationToContent(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_onTargetCollectionChange({added:e,removed:t}){for(const n of t)this._removeTarget(n);for(const n of e)this._addTarget(n)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some(t=>t.target===e)||this._computations.add(new F({target:e}))}_removeTarget(e){const t=this._computations.findIndex(t=>t.target===e);this._computations.removeAt(t)}_connectObserver(){return s([this._updatingHandles.add(()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:I(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null}),({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:n,observerFeatureInfo:o})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,n,o,!0):this._updatingHandles.addPromise(t.pending)},c)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this._computations,e=>this._onComputationCollectionChange(e),{initial:!0,final:!0})}_connectTargets(){return s([this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,e=>this._onTargetCollectionChange(e),{initial:!0,final:!0}),this._updatingHandles.add(()=>this.analysisViewData.cursorTarget,(e,t)=>{this._onCursorTargetChange(e,t)})])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:n}=t;if(null==e||null==n)return!1;const o=Z;n.toRenderCoords(e,o);const i=t.state.camera.computeScreenPixelSizeAt(o);return Math.abs((i-this._screenPixelSize)/this._screenPixelSize)>B}};function k(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:n,inputPoints:o}=e,{start:i,end:r,intersection:s}=n,{originalIntersection:a,originalObserver:l,originalTarget:u}=t;if(v(s,a),o.isValid){const e=Z,t=y(l,a)/y(l,u);C(e,i,l),_(e,e,1-t),b(s,s,e),C(e,r,u),_(e,e,t),b(s,s,e),n.isValid=!0}else e.result=null,n.isValid=!1,n.isTargetVisible=!1}e([g({constructOnly:!0})],N.prototype,"analysis",void 0),e([g({constructOnly:!0})],N.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],N.prototype,"view",void 0),e([g()],N.prototype,"updating",null),e([g()],N.prototype,"priority",null),e([g()],N.prototype,"updateOnCameraChange",void 0),e([g()],N.prototype,"_computations",null),e([g()],N.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],N.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],N.prototype,"_effectiveObserverElevationMode",void 0),e([g()],N.prototype,"_observerFeatureId",void 0),e([g()],N.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],N.prototype,"_updatingHandles",void 0),e([g()],N.prototype,"_frameTask",void 0),e([g()],N.prototype,"_isCameraDirty",null),N=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],N);const B=.1,Z=T(),q=E(),J=w();export{N as LineOfSightController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{equalsMaybe as s}from"../../../../core/maybe.js";import{property as e,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{
|
|
5
|
+
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{equalsMaybe as s}from"../../../../core/maybe.js";import{property as e,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{G as n}from"../../../../chunks/vec32.js";import{equals as c}from"../../../../geometry/support/ray.js";let p=class extends o{constructor(t){super(t)}clone(){return this}equals(t){return this.context?.type===t.context?.type&&(!this.context||!t.context||this.context.equals(t.context))&&this.id===t.id&&s(this.mapPoint,t.mapPoint)&&n(this.renderPoint,t.renderPoint)&&r(this.normal,t.normal)&&c(this.ray,t.ray)}};t([e({constructOnly:!0})],p.prototype,"context",void 0),t([e({constructOnly:!0})],p.prototype,"id",void 0),t([e({constructOnly:!0})],p.prototype,"mapPoint",void 0),t([e({constructOnly:!0})],p.prototype,"renderPoint",void 0),t([e({constructOnly:!0})],p.prototype,"normal",void 0),t([e({constructOnly:!0})],p.prototype,"ray",void 0),p=t([i("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],p);class a{constructor(t){this.graphic=t,this.type="graphic"}equals(t){return t.type===this.type&&this.graphic===t.graphic}}class y{constructor(){this.type="ground"}equals(t){return t.type===this.type}}const u=new y;export{a as LineOfSightIntersectionContextGraphic,p as LineOfSightIntersectionResult,u as lineOfSightIntersectionContextGround};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{property as n,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{d as o,n as s,j as a,i as c}from"../../../../chunks/vec32.js";import{create as l,clone as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../geometry/Point.js";import{create as u,copy as d,fromPoints as f}from"../../../../geometry/support/ray.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{LineOfSightIntersectionResult as y,lineOfSightIntersectionContextGround as w,LineOfSightIntersectionContextGraphic as h}from"./LineOfSightIntersectionResult.js";import{fromScreen as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{property as n,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{d as o,n as s,j as a,i as c}from"../../../../chunks/vec32.js";import{create as l,clone as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../geometry/Point.js";import{create as u,copy as d,fromPoints as f}from"../../../../geometry/support/ray.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{LineOfSightIntersectionResult as y,lineOfSightIntersectionContextGround as w,LineOfSightIntersectionContextGraphic as h}from"./LineOfSightIntersectionResult.js";import{fromScreen as v}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as j,isIntegratedMeshIntersectorResult as I}from"../../terrain/Intersector.js";import{Intersector as P}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as b}from"../../webgl-engine/lib/intersectorUtilsConversions.js";let x=class extends t{constructor(e){super(e),this._terrainIntersectionOptionsLayerUids=new Set(["terrain"])}initialize(){this.intersector=new P(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=0}getScreenPointIntersection(e){const t=r(e,g.get()),n=v(this.view.state.camera,t,L);return this._getRayIntersection(n)}_getRayIntersection(e,t){const{view:r,intersector:n}=this;if(null==e||null==r.sceneIntersectionHelper)return null;n.options.store=0,r.sceneIntersectionHelper.intersectToolIntersectorRay(e,n,t);const i=n.results.min;if(null==i.target)return null;const o=l();if(!i.getIntersectionPoint(o))return null;if(null!=t?.maxDistance&&!i.withinDistance(t.maxDistance))return null;const s=r.renderCoordsHelper.fromRenderCoords(o,new p({spatialReference:r.spatialReference})),a=m(i.normal);if(j(i))return new y({context:w,id:i.target.lij.slice(),mapPoint:s,renderPoint:o,normal:a,ray:d(e)});if(I(r,i))return new y({context:w,id:`${i.target.layerViewUid}`,mapPoint:s,renderPoint:o,normal:a,ray:d(e)});const c=b(i,r);if(null!=c){const{layer:t}=c,r=c.getObjectId()??c.uid;return new y({context:new h(c),id:`${t?.uid}/${r}`,mapPoint:s,renderPoint:o,normal:a,ray:d(e)})}const u="layerViewUid"in i.target?`${i.target.layerViewUid}`:"";return new y({context:null,id:u,mapPoint:s,renderPoint:o,normal:a,ray:d(e)})}updateFromGroundIntersection(e,t,r){const n=R,i=U,l=S,p=O;o(i,e),this.view.renderCoordsHelper.worldUpAtPosition(i,l),s(l,l);const u=this.view.basemapTerrain.visibleElevationRange,d=(t>=0?1:-1)*((u?Math.abs(u.maxElevation-u.minElevation):100)+Math.abs(t));a(p,l,d),c(n,i,p),f(n,i,L);const g=this._getRayIntersection(L,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=g){const e=O;return a(e,l,t),c(r,g.renderPoint,e),m(g.normal)}return o(r,e),null}};e([n()],x.prototype,"view",void 0),e([n()],x.prototype,"intersector",void 0),x=e([i("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],x);const R=l(),U=l(),S=l(),O=l(),L=u();export{x as LineOfSightRayIntersector};
|