@arcgis/core 6.0.0-next.21 → 6.0.0-next.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PopupTemplate.js +1 -1
- package/analysis/LineOfSightAnalysis.d.ts +1 -1
- package/analysis/LineOfSightAnalysisObserver.d.ts +5 -4
- package/analysis/LineOfSightAnalysisTarget.d.ts +4 -4
- package/analysis/Viewshed.d.ts +4 -4
- package/arcgisGlobal.d.ts +0 -5
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{3c277a0f099d67090d07.js → 02335385b1476fe322eb.js} +1 -1
- package/assets/esri/core/workers/chunks/092e311cb7aea92a6a26.js +1 -0
- package/assets/esri/core/workers/chunks/0df9a906f7823c23d426.js +1 -0
- package/assets/esri/core/workers/chunks/{4911ce62421a6c3320b0.js → 13c64087be3b2985a21b.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e19629899a5becf8e19.js → 150e7a7bd5df25693da7.js} +1 -1
- package/assets/esri/core/workers/chunks/{3704b4e7efc3abc1a7b1.js → 242a77066ac5cdb5b7d7.js} +1 -1
- package/assets/esri/core/workers/chunks/2ad69cc496235702bbf2.js +1 -0
- package/assets/esri/core/workers/chunks/2c0cb214fedb29487eef.js +1 -0
- package/assets/esri/core/workers/chunks/2f91fd61019d2a37476d.js +1 -0
- package/assets/esri/core/workers/chunks/3cd04d23b73beaf79650.js +1 -0
- package/assets/esri/core/workers/chunks/434a8ba841a59e0deab9.js +1 -0
- package/assets/esri/core/workers/chunks/{60f92eb03c6e17ab4747.js → 435b90168f79c5587a07.js} +1 -1
- package/assets/esri/core/workers/chunks/{f00458654c7c34c369ef.js → 45ba4aa87a4732198596.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e096537a3a5555a4a93.js → 4cb751dc8d00bdaeb04c.js} +1 -1
- package/assets/esri/core/workers/chunks/504184828048310a052c.js +1 -0
- package/assets/esri/core/workers/chunks/{eca44e53bcee9b08d70a.js → 5046214dd32029cb733d.js} +1 -1
- package/assets/esri/core/workers/chunks/517106048980a3cbe072.js +1 -0
- package/assets/esri/core/workers/chunks/53ff68d4f9e365fc15cd.js +1 -0
- package/assets/esri/core/workers/chunks/542e5640ea1b80ef801a.js +1 -0
- package/assets/esri/core/workers/chunks/58865772bed48141a56a.js +1 -0
- package/assets/esri/core/workers/chunks/5a9b7eb26f936f03d02e.js +1 -0
- package/assets/esri/core/workers/chunks/5d76f4d97beee494bbbf.js +1 -0
- package/assets/esri/core/workers/chunks/5f07f52bb8b7721f08d3.js +1 -0
- package/assets/esri/core/workers/chunks/{d08ff41e2a9bcd58b64a.js → 636cd05abfbdff19029e.js} +1 -1
- package/assets/esri/core/workers/chunks/{461e63a0f436c41a9f4a.js → 64b360625c68cb863a08.js} +1 -1
- package/assets/esri/core/workers/chunks/67f54efc817b241f8746.js +1 -0
- package/assets/esri/core/workers/chunks/6d41444b46677aa762a7.js +1 -0
- package/assets/esri/core/workers/chunks/6dfe96b056bec30068df.js +1 -0
- package/assets/esri/core/workers/chunks/7159d9c36869cd82599e.js +29 -0
- package/assets/esri/core/workers/chunks/792d2b62356a1d953c88.js +1 -0
- package/assets/esri/core/workers/chunks/{814751e705c05099f864.js → 7c75a8ee266c36baa902.js} +1 -1
- package/assets/esri/core/workers/chunks/947674b2ca8be65b9bcc.js +1 -0
- package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +1 -0
- package/assets/esri/core/workers/chunks/{a0c9e3f8b7d55d6dc1d5.js → 96c4ea9cfa3930f1c3fb.js} +25 -21
- package/assets/esri/core/workers/chunks/{601e1d020b8115497944.js → 9d40786c5ceface786ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{a35c69a4751d28c39907.js → 9e7c4eda135c4911b268.js} +1 -1
- package/assets/esri/core/workers/chunks/a64446a3328a7323e307.js +1 -0
- package/assets/esri/core/workers/chunks/a65951f1d5702cfd996e.js +1 -0
- package/assets/esri/core/workers/chunks/aa4f3751f0d830113bed.js +1 -0
- package/assets/esri/core/workers/chunks/ad96132bc89671e595f3.js +1 -0
- package/assets/esri/core/workers/chunks/b0ca81a07cff25df19d2.js +1 -0
- package/assets/esri/core/workers/chunks/b1d989b72203113a06fe.js +1 -0
- package/assets/esri/core/workers/chunks/{9e0559cd0bb01a0ed9d7.js → b3273f847405799e3362.js} +1 -1
- package/assets/esri/core/workers/chunks/b4c3ec081874b49ff89b.js +1 -0
- package/assets/esri/core/workers/chunks/b6d71a4ab788a09714f3.js +1 -0
- package/assets/esri/core/workers/chunks/c0d7ae314ebfad1e3791.js +1 -0
- package/assets/esri/core/workers/chunks/c82daefb193aae895bc0.js +1 -0
- package/assets/esri/core/workers/chunks/d8a7eba588d374b2f961.js +1 -0
- package/assets/esri/core/workers/chunks/ee08ae5b73439a1ff666.js +1 -0
- package/assets/esri/core/workers/chunks/{557671c897ca5563be6c.js → f6bd7b52745b82ba73dc.js} +1 -1
- package/assets/esri/core/workers/chunks/fcaf9450642fcef83286.js +1 -0
- package/assets/esri/core/workers/chunks/feb41abc03d677df6f73.js +1 -0
- package/assets/esri/core/workers/chunks/ffcb99693182a621a93e.js +1 -0
- package/assets/esri/themes/base/_core.scss +0 -2
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/CloudsComposition.glsl.js +2 -2
- package/chunks/Component.glsl.js +9 -12
- package/chunks/DefaultMaterial.glsl.js +4 -5
- package/chunks/Path.glsl.js +2 -4
- package/chunks/RealisticTree.glsl.js +3 -3
- package/chunks/SSAO.glsl.js +1 -2
- package/config.d.ts +11 -30
- package/config.js +1 -1
- package/core/accessorSupport/trackingUtils.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers.d.ts +17 -0
- package/geometry/support/MeshComponent.d.ts +1 -1
- package/geometry/support/clipRay.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/vcsData.js +1 -1
- package/interfaces.d.ts +0 -55
- package/kernel.js +1 -1
- package/layers/ElevationLayer.d.ts +6 -2
- package/layers/FeatureLayer.d.ts +32 -14
- package/layers/GeoJSONLayer.d.ts +2 -107
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +2 -1
- package/layers/SceneLayer.d.ts +40 -16
- package/layers/SubtypeGroupLayer.d.ts +63 -0
- package/layers/ViewshedLayer.d.ts +10 -4
- package/layers/WMSLayer.d.ts +2 -69
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/TemporalLayer.d.ts +70 -48
- package/layers/mixins/TiledImagery.d.ts +0 -11
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/support/LabelClass.d.ts +20 -2
- package/layers/support/Sublayer.d.ts +32 -2
- package/layers/support/TimeInformation.js +2 -0
- package/libs/basisu/textureMetadata.js +2 -0
- package/package.json +3 -3
- package/popup/content.d.ts +38 -1
- package/popup/content.js +1 -1
- package/rest/layerSources/DynamicWorkspaceLayer.d.ts +10 -6
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/timeUtils.js +2 -0
- package/smartMapping/popup/support/clusterUtils.js +1 -1
- package/smartMapping/popup/support/utils.js +2 -2
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/regenerateUtils.js +1 -1
- package/support/timeUtils.d.ts +11 -0
- package/symbols/TextSymbol.d.ts +27 -2
- package/time/legacyTimeZoneMap.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/GlyphWorker.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/AggregateStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/bins/BinAdapter.js +1 -1
- package/views/2d/layers/features/processor/bins/BinLevelState.js +1 -1
- package/views/2d/layers/features/processor/clusters/ClusterAdapter.js +1 -1
- package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +1 -1
- package/views/2d/layers/features/processor/tracks/TrackAdapter.js +1 -1
- package/views/2d/layers/features/processor/tracks/TrackLevelState.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ByReferenceTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/StreamSourceChunk.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +16 -1
- package/views/3d/environment/SunLighting.js +1 -1
- package/views/3d/environment/VirtualLighting.d.ts +16 -1
- package/views/3d/environment/VirtualLighting.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
- package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +1 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +6 -6
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +9 -4
- package/views/3d/webgl-engine/effects/snowcover/applySnow.glsl.js +18 -0
- package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/worldSizedRibbonLineIntersectionUtils.js +2 -0
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/BasemapView.js +1 -1
- package/views/GroundView.d.ts +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +2 -2
- package/views/layers/ViewshedLayerView.d.ts +2 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Locate.d.ts +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +61 -2
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +3 -2
- package/widgets/TimeSlider.d.ts +5 -4
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/support/GeolocationPositioning.d.ts +1 -2
- package/assets/esri/core/workers/chunks/0bd5012da287469b17d5.js +0 -1
- package/assets/esri/core/workers/chunks/1f6b601147521a42e65c.js +0 -1
- package/assets/esri/core/workers/chunks/25d14874198773d2d836.js +0 -1
- package/assets/esri/core/workers/chunks/2d13a22f7b2427927fdc.js +0 -1
- package/assets/esri/core/workers/chunks/34e0a8a3a2beea50f4f5.js +0 -1
- package/assets/esri/core/workers/chunks/42045cf46497828cd3c0.js +0 -1
- package/assets/esri/core/workers/chunks/42fd2a7b22b03dacc6a7.js +0 -1
- package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +0 -1
- package/assets/esri/core/workers/chunks/4e350d6c76957f5beb70.js +0 -1
- package/assets/esri/core/workers/chunks/4fe34da1c5d63e66ce98.js +0 -1
- package/assets/esri/core/workers/chunks/501c6e14ab119785252b.js +0 -1
- package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +0 -1
- package/assets/esri/core/workers/chunks/6059853ef3b6cddbe869.js +0 -1
- package/assets/esri/core/workers/chunks/6c255c029d67423e4dac.js +0 -1
- package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +0 -1
- package/assets/esri/core/workers/chunks/6c9acd9e4e201dc380e9.js +0 -1
- package/assets/esri/core/workers/chunks/728837812940d7f2ef43.js +0 -1
- package/assets/esri/core/workers/chunks/74c866e0b66e61751861.js +0 -1
- package/assets/esri/core/workers/chunks/7bbfe9ff352afc566367.js +0 -1
- package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +0 -1
- package/assets/esri/core/workers/chunks/95dbbddac6581b9d671f.js +0 -1
- package/assets/esri/core/workers/chunks/a8df3f59728f841b608e.js +0 -1
- package/assets/esri/core/workers/chunks/aa1ac7954e4f0fefe15b.js +0 -1
- package/assets/esri/core/workers/chunks/b48952e1fb4cb7360dd0.js +0 -1
- package/assets/esri/core/workers/chunks/b5df193c93e9c19f9700.js +0 -1
- package/assets/esri/core/workers/chunks/befa32b9e7b3fbdd431e.js +0 -1
- package/assets/esri/core/workers/chunks/c2c1f51a4668055c2838.js +0 -1
- package/assets/esri/core/workers/chunks/d0f5bee9db1ad51ae687.js +0 -1
- package/assets/esri/core/workers/chunks/d678828726371243d5eb.js +0 -1
- package/assets/esri/core/workers/chunks/dd0310184fe4832755a8.js +0 -1
- package/assets/esri/core/workers/chunks/de5ecb567bd69c613e9d.js +0 -1
- package/assets/esri/core/workers/chunks/dfc81e66196c402f39b4.js +0 -29
- package/assets/esri/core/workers/chunks/e1f5d00878f27e1d413e.js +0 -1
- package/assets/esri/core/workers/chunks/fb70ab267a08e24b710f.js +0 -1
- package/assets/esri/core/workers/chunks/fc44d45598a7476bc606.js +0 -1
- package/assets/esri/themes/base/widgets/_DirectionalPad.scss +0 -85
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ar.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.bg.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.bs.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ca.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.cs.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.da.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.de.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.el.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.en.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.es.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.et.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.fi.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.fr.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.he.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.hr.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.hu.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.id.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.it.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ja.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ko.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.lt.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.lv.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.nl.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.no.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.pl.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.pt-BR.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.pt-PT.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ro.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.ru.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.sk.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.sl.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.sr.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.sv.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.th.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.tr.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.uk.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.vi.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-CN.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-HK.json +0 -1
- package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-TW.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ar.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.bg.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.bs.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ca.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.cs.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.da.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.de.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.el.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.en.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.es.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.et.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.fi.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.fr.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.he.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.hr.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.hu.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.id.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.it.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ja.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ko.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.lt.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.lv.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.nl.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.no.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.pl.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.pt-BR.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.pt-PT.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ro.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.ru.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.sk.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.sl.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.sr.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.sv.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.th.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.tr.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.uk.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.vi.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.zh-CN.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.zh-HK.json +0 -1
- package/assets/esri/widgets/Track/t9n/messages.zh-TW.json +0 -1
- package/views/2d/layers/features/FeatureSpatialIndex.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +0 -2
- package/views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js +0 -12
- package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +0 -85
- package/widgets/DirectionalPad/DirectionalPadViewModel.js +0 -2
- package/widgets/DirectionalPad/VisibleElements.d.ts +0 -40
- package/widgets/DirectionalPad/VisibleElements.js +0 -2
- package/widgets/DirectionalPad/constants.js +0 -2
- package/widgets/DirectionalPad/css.js +0 -2
- package/widgets/DirectionalPad/types.d.ts +0 -27
- package/widgets/DirectionalPad/utils.js +0 -2
- package/widgets/DirectionalPad.d.ts +0 -156
- package/widgets/DirectionalPad.js +0 -2
- package/widgets/Track/TrackViewModel.d.ts +0 -131
- package/widgets/Track/TrackViewModel.js +0 -2
- package/widgets/Track/types.d.ts +0 -6
- package/widgets/Track.d.ts +0 -278
- package/widgets/Track.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderJSON as t}from"../../../support/FeatureSetReaderJSON.js";class n extends e{constructor(e,t,n,r,i){super(),this._metadata=e,this._reader=t,this._page=n,this._end=r,this._fileId=i,this.chunkId=`${this._fileId}.${this._page}${this.end?`e`:``}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader??t.empty(this._metadata)}get first(){return this._page===0}get end(){return this._end}get queryInfo(){return{type:`snapshot`,chunkId:this.chunkId,page:this._page,size:this.size(),end:this.end}}get lodInfo(){return null}async updateFields(e,t,n){if(this._fileId!=null)return this._reader?.updateFields(e,this._fileId,t,n)}getTileReader(e){let t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}export{n as ParquetSnapshotSourceChunk};
|
|
2
|
+
import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderJSON as t}from"../../../support/FeatureSetReaderJSON.js";class n extends e{constructor(e,t,n,r,i){super(),this._metadata=e,this._reader=t,this._page=n,this._end=r,this._fileId=i,this.chunkId=`${this._fileId}.${this._page}${this.end?`e`:``}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader??t.empty(this._metadata)}get first(){return this._page===0}get end(){return this._end}get queryInfo(){return{type:`snapshot`,chunkId:this.chunkId,page:this._page,size:this.size(),end:this.end}}get lodInfo(){return null}async updateFields(e,t,n){if(this._fileId!=null)return this._reader?.updateFields(e,this._fileId,t,n)}getTileReader(e){let t=this.reader.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}export{n as ParquetSnapshotSourceChunk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{EventEmitter as e}from"../../../../../../../core/Evented.js";import has from"../../../../../../../core/has.js";import{create as t}from"../../../../../../../geometry/support/aaBoundingBox.js";import{FeatureStoreQueryAdapter as n}from"../../../FeatureStoreQueryAdapter.js";import{OverrideParameters as r,OverrideState as i}from"./Overrides.js";class a{constructor(){this._chunks=new Map,this._chunksToRemove=[],this.events=new e,this.featureAdapter=new n}destroy(){this.clear()}clear(){for(let e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrides?.clearWeakOverrides()}get usedMemory(){let e=0;for(let t of this._chunks.values())e+=t.usedMemory;return e}async update(e){if(this._overrides){let t=await r.create(e);this._overrides.update(t)}this._postQueryFilter=e.postQueryFilter;for(let
|
|
2
|
+
import{EventEmitter as e}from"../../../../../../../core/Evented.js";import has from"../../../../../../../core/has.js";import{create as t}from"../../../../../../../geometry/support/aaBoundingBox.js";import{FeatureStoreQueryAdapter as n}from"../../../FeatureStoreQueryAdapter.js";import{OverrideParameters as r,OverrideState as i}from"./Overrides.js";class a{constructor(){this._chunks=new Map,this._chunksToRemove=[],this.events=new e,this.featureAdapter=new n}destroy(){this.clear()}clear(){for(let e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrides?.clearWeakOverrides()}get usedMemory(){let e=0;for(let t of this._chunks.values())e+=t.usedMemory;return e}async update(e){if(this._overrides){let t=await r.create(e);this._overrides.update(t)}let t=this._postQueryFilter?.hash!==e.postQueryFilter?.hash;this._postQueryFilter=e.postQueryFilter;for(let e of this.insertedChunks())e.reader.applyPostQueryFilter(this._postQueryFilter),t&&e.invalidate();this._schema=e}*chunks(){this._overrides&&(yield this._overrides.asChunk()),yield*this._chunks.values()}insertedChunks(){return this._chunks.values()}insert(e){has(`esri-2d-update-debug`)&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._overrides?.onChunkInsert(e),this._chunks.set(e.chunkId,e),this._postQueryFilter&&(e.reader.applyPostQueryFilter(this._postQueryFilter),e.invalidate()),this.events.emit(`changed`)}remove(e){has(`esri-2d-update-debug`)&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}removeById(e){has(`esri-2d-update-debug`)&&console.debug(`Chunk[${e}] SourceChunkStore.remove`);let t=this._chunks.get(e);this._chunks.delete(e),t&&this._chunksToRemove.push(t)}cleanup(){let e=this._chunksToRemove;return this._chunksToRemove=[],this._overrides?.cleanup(this._chunks.values()),e}async applyOverride(e){if(this._overrides==null){let e=await r.create(this._schema);this._overrides=new i(e);for(let e of this._chunks.values())this._overrides.onChunkInsert(e)}this._overrides.apply(e,this),this.events.emit(`changed`);for(let e of this._chunks.values())e.invalidate()}takeOverrideUpdate(){return this._overrides?.takeOverrideUpdate()}refresh(){this.events.emit(`refresh`)}forEach(e){let t=new Set;for(let n of this.chunks()){let r=n.reader.getCursor();for(;r.next();){let n=r.getObjectId();t.has(n)||(e(r.copy()),t.add(n))}}}forEachUnsafe(e){let t=new Set;for(let n of this.chunks()){let r=n.reader.getCursor();for(;r.next();){let n=r.getObjectId();t.has(n)||(e(r),t.add(n))}}}mapObjectIdsFromGlobalIds(e,t){let n=new Map,r=new Set(e);return this._overrides?.putWeakObjectIdsFromGlobalIds(n,r,t),this._forEachUnsafeIgnoreOverrides(e=>{let i=e.readAttribute(t);if(i&&r.has(i)&&!n.has(i)){let t=e.getObjectId();n.set(i,t)}}),n}forEachInBounds(e,t){let n=new Set;for(let r of this.chunks()){let i=r.reader.queryFeaturesInBounds(e);for(;i.next();){let e=i.getObjectId();n.has(e)||(t(i.copy()),n.add(e))}}}forEachBounds(e,n){let r=t();for(let t of e)t.getBounds(r)&&n(r)}_forEachUnsafeIgnoreOverrides(e){let t=new Set;for(let n of this._chunks.values()){let r=n.reader.withoutOverrides().getCursor();for(;r.next();){let n=r.getObjectId();t.has(n)||(e(r),t.add(n))}}}}export{a as FeatureSourceChunkStore};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{ASourceChunk as e}from"./ASourceChunk.js";class t extends e{constructor(e){super(),this._reader=e,this.chunkId=`stream-chunk`,this.normalizedChunkId=`stream-chunk`}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:`stream`,chunkId:this.chunkId,size:this.size(),end:this.end}}get lodInfo(){return null}getTileReader(e){let t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}export{t as StreamSourceChunk};
|
|
2
|
+
import{ASourceChunk as e}from"./ASourceChunk.js";class t extends e{constructor(e){super(),this._reader=e,this.chunkId=`stream-chunk`,this.normalizedChunkId=`stream-chunk`}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:`stream`,chunkId:this.chunkId,size:this.size(),end:this.end}}get lodInfo(){return null}getTileReader(e){let t=this.reader.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}export{t as StreamSourceChunk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{diff as n}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as r}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as i,maxHighlightGroups as a,filterFlag0 as o,effectFlag0 as s}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as c}from"../../../engine/webgl/DisplayId.js";import{nanMagicNumber as l}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as u,DEBUG_ATTR_UPDATES as d}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as f}from"./DisplayIdGenerator.js";import p from"./FeatureFilterEvaluator.js";import{PixelType as m}from"../../../../webgl/enums.js";function h(e,t){if(!e||!t)return e;switch(t){case`radius`:case`distance`:return 2*e;case`diameter`:case`width`:return e;case`area`:return Math.sqrt(e)}return e}const g=()=>t.getLogger(`esri.views.layers.2d.features.support.AttributeStore`),_=t=>{switch(t){case m.UNSIGNED_BYTE:return Uint8Array;case m.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case m.FLOAT:return Float32Array;default:g().error(new e(`webgl-utils`,`Unable to handle type ${t}`));return}},v=u(d,g()),y={sharedArrayBuffer:has(`esri-shared-array-buffer`),atomics:has(`esri-atomics`)};class b{constructor(e,t,n){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;let{pixelType:r,layout:i,textureOnly:a}=t;this.textureOnly=a||!1,this.pixelType=r,this.layout=i,this._resetRange(),this.size=e,this.isLocal=n,a||(this.data=this._initData(r,e))}get usedMemory(){return this.data?.byteLength??0}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){let n=this.data;for(let r=0;r<this.size*this.size;r++)n[r*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){let n=this.data;for(let r=0;r<this.size*this.size;r++)n[r*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,n){let r=this.data;for(let i of n)r[i*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}setComponentTexel(e,t,n){let r=this.data;r[n*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n)}unsetComponentTexel(e,t,n){let r=this.data;r[n*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n)}getData(e,t){let n=c(e);return this.data[n*this.texelSize+t]}setData(e,t,n){let r=c(e),i=1<<t;(this.layout&i)===0?g().error(`mapview-attributes-store`,`Tried to set a value for a texel's readonly component`):this.data!=null&&(this.data[r*this.texelSize+t]=n,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r))}expand(e){if(this.size=e,!this.textureOnly){let t=this._initData(this.pixelType,e),n=this.data;t.set(n),this.data=t}}toMessage(){let e=this.dirtyStart,t=this.dirtyEnd,n=this.texelSize;if(e>t)return null;this._resetRange();let r=!this.isLocal,i=this.pixelType,a=this.layout,o=this.data;return{start:e,end:t,data:r&&o.slice(e*n,(t+1)*n)||null,pixelType:i,layout:a}}_initData(e,t){let n=ArrayBuffer,r=_(e),i=r.BYTES_PER_ELEMENT,a=new r(new n(t*t*4*i));for(let e=0;e<a.length;e+=4)a[e+1]=255;return a}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class x{constructor(e){this._client=e,this._filters=[],this._blocks=[],this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=i,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new f,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(this._blockDescriptors!=null)return;let e=m.FLOAT;v(`Creating AttributeStore ${y.sharedArrayBuffer?`with`:`without`} shared memory`),this._blockDescriptors=[{pixelType:m.UNSIGNED_BYTE,layout:1},{pixelType:m.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:m.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:m.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get usedMemory(){let e=0;for(let t of this._blocks)t&&(e+=t.usedMemory);return e+=this._idGenerator.usedMemory,e}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,i=0){let a=n(this._schema,e);if(this.version=i,a&&(has(`esri-2d-update-debug`)&&console.debug(`Version[${i}] AttributeStore.update`,{changed:a}),this._schema=e,this._attributeComputeInfo=null,this._matcherFilter=void 0,this._initialize(),e!=null)){if(r&&(this._filters=await Promise.all(e.filters.map(async({bitIndex:e,filters:t})=>({bitIndex:e,evaluators:await Promise.all(t.map(e=>p.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:r.outSpatialReference,filterJSON:e})))})))),e.type===`simple`&&e.matcherFilter&&(this._matcherFilter=await t.createComputedField(e.matcherFilter),this._updateReferences(this._matcherFilter)),e.type===`multi`){this._attributeComputeInfo={type:`multi`,keyField:e.keyField,map:new Map};for(let n in e.bindings){let r=e.bindings[n];await Promise.all(r.map(async e=>{let r=await this._bind(t,e,parseInt(n,10));this._updateReferences(r)}))}}else this._attributeComputeInfo={type:`feature`,map:new Map},await Promise.all(e.bindings.map(async e=>{let n=await this._bind(t,e);this._updateReferences(n)}))}}setData(e,t,n,r){let i=c(e);this._ensureSizeForTexel(i),this._getBlock(t).setData(e,n,r)}getData(e,t,n){return this._getBlock(t).getData(e,n)}unsetAttributeData(e){let t=c(e);this._getBlock(0).setData(t,0,0)}referencesScale(){if(this._matcherFilter?.hasArcadeDependency(`scale`))return!0;let e=this._attributeComputeInfo;if(!e)return!1;if(e.type===`multi`){for(let t of e.map.values())for(let{field:e}of t.values())if(e?.hasArcadeDependency(`scale`))return!0}else for(let{field:t}of e.map.values())if(t?.hasArcadeDependency(`scale`))return!0;return!1}setAttributeData(e,t,n,r){let i=c(e);this._ensureSizeForTexel(i);let a=this.getFilterFlags(t,r);this._passesMatcherFilter(t,n)||(a&=~o),this._getBlock(0).setData(i,0,a);let s=this._attributeComputeInfo,u=null;s&&(u=s.type===`multi`?s.map.get(t.readAttribute(s.keyField)):s.map,u?.size&&u.forEach((e,r)=>{let a=r*1%4,o=Math.floor(r*1/4),s=this._getBlock(o+3),c=e.field?.read(t,n);e.valueRepresentation&&(c=h(c,e.valueRepresentation)),(c===null||isNaN(c)||c===1/0||c===-1/0)&&(c=l),s.setData(i,a,c)}))}get epoch(){return this._epoch}sendUpdates(){let e=this._blocks.map(e=>e==null?null:e.toMessage()),t=this._getInitArgs();this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,n){let r=await e.createComputedField(t),{valueRepresentation:i}=t,a=this._attributeComputeInfo;if(a.type===`multi`){let e=a.map.get(n)??new Map;e.set(t.binding,{field:r,valueRepresentation:i}),a.map.set(n,e)}else a.map.set(t.binding,{field:r,valueRepresentation:i});return r}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(1),this._getBlock(2),this._getBlock(7),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e==null?null:{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType})})}_getBlock(e){let t=this._blocks[e];if(t!=null)return t;v(`Initializing AttributeBlock at index ${e}`);let n=new b(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=n,this._initialized=!1,n}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){let e=this._size<<=1;v(`Expanding block size to`,e,this._blocks);for(let t of this._blocks)t?.expand(e);return this._initialized=!1,this._size=e,0}return g().error(new e(`mapview-limitations`,`Maximum number of onscreen features exceeded.`)),-1}_updateReferences(e){r(this._arcadeDependencies,e)}_passesMatcherFilter(e,t){if(this._matcherFilter===void 0)return!0;if(this._matcherFilter===null)return!1;let n=this._matcherFilter.read(e,t);return n==null||isNaN(n)||n===1/0||n===-1/0?!1:n>=-(2**53-1)&&n<=2**53-1}isVisible(e){return!!(this._getBlock(0).getData(e,0)&1<<a)}getFilterFlags(e,t){let n=o|s;for(let{bitIndex:r,evaluators:i}of this._filters){let a=1<<r;i.some(n=>n.check(e,t))?n|=a:n&=~a}return n}}export{x as AttributeStore,h as getVisualVariableSizeValueRepresentationRatio};
|
|
2
|
+
import e from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{notDeepEqual as n}from"../../../../../core/object.js";import{collectExpressionDependencies as r}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as i,filterFlag0 as a,maxHighlightGroups as o,effectFlag0 as s}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as c}from"../../../engine/webgl/DisplayId.js";import{nanMagicNumber as l}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as u,DEBUG_ATTR_UPDATES as d}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as f}from"./DisplayIdGenerator.js";import p from"./FeatureFilterEvaluator.js";import{PixelType as m}from"../../../../webgl/enums.js";function h(e,t){if(!e||!t)return e;switch(t){case`radius`:case`distance`:return 2*e;case`diameter`:case`width`:return e;case`area`:return Math.sqrt(e)}return e}const g=()=>t.getLogger(`esri.views.layers.2d.features.support.AttributeStore`),_=t=>{switch(t){case m.UNSIGNED_BYTE:return Uint8Array;case m.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case m.FLOAT:return Float32Array;default:g().error(new e(`webgl-utils`,`Unable to handle type ${t}`));return}},v=u(d,g()),y={sharedArrayBuffer:has(`esri-shared-array-buffer`),atomics:has(`esri-atomics`)};class b{constructor(e,t,n){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;let{pixelType:r,layout:i,textureOnly:a}=t;this.textureOnly=a||!1,this.pixelType=r,this.layout=i,this._resetRange(),this.size=e,this.isLocal=n,a||(this.data=this._initData(r,e))}get usedMemory(){return this.data?.byteLength??0}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){let n=this.data;for(let r=0;r<this.size*this.size;r++)n[r*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){let n=this.data;for(let r=0;r<this.size*this.size;r++)n[r*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,n){let r=this.data;for(let i of n)r[i*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}setComponentTexel(e,t,n){let r=this.data;r[n*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n)}unsetComponentTexel(e,t,n){let r=this.data;r[n*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n)}getData(e,t){let n=c(e);return this.data[n*this.texelSize+t]}setData(e,t,n){let r=c(e),i=1<<t;(this.layout&i)===0?g().error(`mapview-attributes-store`,`Tried to set a value for a texel's readonly component`):this.data!=null&&(this.data[r*this.texelSize+t]=n,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r))}expand(e){if(this.size=e,!this.textureOnly){let t=this._initData(this.pixelType,e),n=this.data;t.set(n),this.data=t}}toMessage(){let e=this.dirtyStart,t=this.dirtyEnd,n=this.texelSize;if(e>t)return null;this._resetRange();let r=!this.isLocal,i=this.pixelType,a=this.layout,o=this.data;return{start:e,end:t,data:r&&o.slice(e*n,(t+1)*n)||null,pixelType:i,layout:a}}_initData(e,t){let n=ArrayBuffer,r=_(e),i=r.BYTES_PER_ELEMENT,a=new r(new n(t*t*4*i));for(let e=0;e<a.length;e+=4)a[e+1]=255;return a}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class x{constructor(e){this._client=e,this.version=0,this._filters=[],this._blocks=[],this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=i,this._rendererDependencies=new Set,this._initialized=!1,this._pendingAttributeUpdate={filterMask:0,matcherChanged:!1,rendererChanged:!1},this._epoch=1,this._idGenerator=new f}destroy(){this._abortController.abort()}_initialize(){if(this._blockDescriptors!=null)return;let e=m.FLOAT;v(`Creating AttributeStore ${y.sharedArrayBuffer?`with`:`without`} shared memory`),this._blockDescriptors=[{pixelType:m.UNSIGNED_BYTE,layout:1},{pixelType:m.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:m.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:m.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get usedMemory(){let e=0;for(let t of this._blocks)t&&(e+=t.usedMemory);return e+=this._idGenerator.usedMemory,e}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(e){return!!this._matcherFilter?.hasArcadeDependency(e)||this._rendererDependencies.has(e)}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,i=0,a){let o=this._schema;this._schema=e,this.version=i,this._initialize(),has(`esri-2d-update-debug`)&&console.debug(`Version[${i}] AttributeStore.update`,{changed:n(o,e)});let[s,c,l]=await Promise.all([this._updateFilters(o,r,a),this._updateMatcherFilter(o,t,a),this._updateRendererAttributes(o,t,a)]);this._pendingAttributeUpdate.filterMask|=s,this._pendingAttributeUpdate.matcherChanged||=c,this._pendingAttributeUpdate.rendererChanged||=l}applyUpdate(e,t,n){let r=this._pendingAttributeUpdate,i=this._lastEvaluationScale!==t.$view.scale,o=r.matcherChanged||i&&!!this._matcherFilter?.hasArcadeDependency(`scale`),s=r.rendererChanged||i&&this._rendererDependencies.has(`scale`),c=r.filterMask|(o?a:0);if(!c&&!s)return;let l=!1;for(let r of e)l||=r.getSize()>0,c&&this._setFilterData(r,n,c),c&a&&this._setMatcherFilterVisibility(r,t),s&&this._setRendererAttributeData(r,t);l&&(this._pendingAttributeUpdate={filterMask:0,matcherChanged:!1,rendererChanged:!1},this._lastEvaluationScale=t.$view.scale)}setData(e,t,n,r){let i=c(e);this._ensureSizeForTexel(i),this._getBlock(t).setData(e,n,r)}setDataForReader(e,t,n){this._setFilterData(e,n),this._setMatcherFilterVisibility(e,t),this._setRendererAttributeData(e,t)}get epoch(){return this._epoch}sendUpdates(){let e=this._blocks.map(e=>e==null?null:e.toMessage()),t=this._getInitArgs();this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1}async _updateFilters(e,t,r){if(!t)return 0;let i=new Map;for(let t of e?.filters??[])i.set(t.bitIndex,t);let a=new Map;for(let e of this._schema.filters)a.set(e.bitIndex,e);let s=0;for(let e=0;e<o+2;e++){let o=i.get(e),c=a.get(e),l=this._filters.find(this._matchesFilterBitIndex.bind(this,e));if(!c)o&&(this._filters=this._filters.filter(this._hasDifferentFilterBitIndex.bind(this,e)),s|=1<<e);else if(!l||n(o?.filters,c.filters)){let n=await Promise.all(c.filters.map(this._getFilterEvaluator.bind(this,o,l,t)));l?l.evaluators=n:this._filters.push({bitIndex:e,evaluators:n}),s|=1<<e}else r.currentUserChanged&&(s|=1<<e)}return s}async _updateMatcherFilter(e,t,r){let i=this._schema,a=e?.type===`simple`?e.matcherFilter:void 0,o=i.type===`simple`?i.matcherFilter:void 0;return n(a,o)?(this._matcherFilter=o==null?void 0:await t.createComputedField(o),!0):!(o==null||!r.timeZoneChanged&&(!this._matcherFilter||!r.dependencies.some(this._matcherFilter.hasArcadeDependency,this._matcherFilter)))}async _updateRendererAttributes(e,t,r){let i=this._schema,a=!e||e.type!==i.type,o=n(e?.bindings,i.bindings),s=e?.type===`multi`&&i.type===`multi`&&e.keyField!==i.keyField;return a||o||s?(await this._compileRendererAttributes(i,t),!0):!(!r.timeZoneChanged&&!r.dependencies.some(this._rendererDependencies.has,this._rendererDependencies))}_matchesFilterBitIndex(e,t){return t.bitIndex===e}_hasDifferentFilterBitIndex(e,t){return t.bitIndex!==e}_getFilterEvaluator(e,t,r,i){if(e&&t)for(let[r,a]of e.filters.entries()){if(n(a,i))continue;let e=t.evaluators[r];if(e)return Promise.resolve(e);break}return p.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:r.outSpatialReference,filterJSON:i})}async _compileRendererAttributes(e,t){if(this._rendererDependencies.clear(),e.type===`multi`){this._attributeComputeInfo={type:`multi`,keyField:e.keyField,map:new Map};for(let n in e.bindings)await Promise.all(e.bindings[n].map(this._bind.bind(this,t,parseInt(n,10))))}else this._attributeComputeInfo={type:`feature`,map:new Map},await Promise.all(e.bindings.map(this._bind.bind(this,t,void 0)))}_setFilterData(e,t,n=255){let r=(a|s)&n;for(let{bitIndex:e}of this._filters)r&=~(1<<e);let i=e.getCursor();for(;i.next();){let e=i.getDisplayId();this._ensureSizeForTexel(c(e));let t=this._getBlock(0);t.setData(e,0,t.getData(e,0)&~n|r)}let o=this._getBlock(0);for(let{bitIndex:r,evaluators:i}of this._filters){let a=1<<r;if(n&a)for(let n of i)n.forEachMatch(e,t,this._setFilterFlag.bind(this,o,a))}}_setFilterFlag(e,t,n){let r=c(n.getDisplayId());e.setComponentTexel(0,t,r)}_setMatcherFilterVisibility(e,t){if(this._matcherFilter===void 0)return;let n=e.getCursor(),r=this._getBlock(0);for(;n.next();)this._passesMatcherFilter(n,t)||r.unsetComponentTexel(0,a,c(n.getDisplayId()))}_setRendererAttributeData(e,t){let n=this._attributeComputeInfo;if(!n)return;let r=e.getCursor();for(;r.next();){let e=n.type===`multi`?n.map.get(r.readAttribute(n.keyField)):n.map;if(!e?.size)continue;let i=c(r.getDisplayId());for(let[n,a]of e){let e=n*1%4,o=Math.floor(n*1/4),s=this._getBlock(o+3),c=a.field?.read(r,t);a.valueRepresentation&&(c=h(c,a.valueRepresentation)),(c===null||isNaN(c)||c===1/0||c===-1/0)&&(c=l),s.setData(i,e,c)}}}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,n){let i=await e.createComputedField(n);r(this._rendererDependencies,i);let{valueRepresentation:a}=n,o=this._attributeComputeInfo;if(o.type===`multi`){let e=o.map.get(t)??new Map;e.set(n.binding,{field:i,valueRepresentation:a}),o.map.set(t,e)}else o.map.set(n.binding,{field:i,valueRepresentation:a});return i}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(1),this._getBlock(2),this._getBlock(7),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e==null?null:{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType})})}_getBlock(e){let t=this._blocks[e];if(t!=null)return t;v(`Initializing AttributeBlock at index ${e}`);let n=new b(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=n,this._initialized=!1,n}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){let e=this._size<<=1;v(`Expanding block size to`,e,this._blocks);for(let t of this._blocks)t?.expand(e);return this._initialized=!1,this._size=e,0}return g().error(new e(`mapview-limitations`,`Maximum number of onscreen features exceeded.`)),-1}_passesMatcherFilter(e,t){if(this._matcherFilter===void 0)return!0;if(this._matcherFilter===null)return!1;let n=this._matcherFilter.read(e,t);return n==null||isNaN(n)||n===1/0||n===-1/0?!1:n>=-(2**53-1)&&n<=2**53-1}isVisible(e){return!!(this._getBlock(0).getData(e,0)&1<<o)}}export{x as AttributeStore,h as getVisualVariableSizeValueRepresentationRatio};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../core/Error.js";import t from"../../../../../core/Logger.js";import{create as n}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as r}from"../../../../../geometry/support/boundsUtils.js";import{normalizeQueryLike as i}from"../../../../../layers/graphics/data/queryUtils.js";import{getSpatialQueryOperator as a}from"../../../../../layers/graphics/data/spatialQuerySupport.js";import{getTimeOperator as o}from"../../../../../layers/graphics/data/timeSupport.js";import s from"../../../../../rest/support/Query.js";import{FeatureStoreQueryAdapter as c}from"../FeatureStoreQueryAdapter.js";import{createWhereClause as l}from"./whereUtils.js";class u{constructor(e){this.
|
|
2
|
+
import e from"../../../../../core/Error.js";import t from"../../../../../core/Logger.js";import{create as n}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as r}from"../../../../../geometry/support/boundsUtils.js";import{normalizeQueryLike as i}from"../../../../../layers/graphics/data/queryUtils.js";import{getSpatialQueryOperator as a}from"../../../../../layers/graphics/data/spatialQuerySupport.js";import{getTimeOperator as o}from"../../../../../layers/graphics/data/timeSupport.js";import s from"../../../../../rest/support/Query.js";import{FeatureStoreQueryAdapter as c}from"../FeatureStoreQueryAdapter.js";import{createWhereClause as l}from"./whereUtils.js";class u{constructor(e){this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){let t=new u(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}forEachMatch(e,t,i){let a=this.geometry&&this.spatialRel!==`esriSpatialRelDisjoint`?e.queryFeaturesInBounds(r(n(),this.geometry)):e.getCursor();for(;a.next();)this._applyFilter(a,t)&&i(a)}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(let t of e)this._idToVisibility.set(t,1)}setTrue(e){let t=[],n=[],r=new Set(e);return this._idToVisibility.forEach((e,i)=>{let a=!!(this._idToVisibility.get(i)&1),o=r.has(i);!a&&o?t.push(i):a&&!o&&n.push(i),this._idToVisibility.set(i,o?3:0)}),{show:t,hide:n}}createQuery(){let{geometry:e,spatialRel:t,where:n,timeExtent:r,objectIds:i}=this;return s.fromJSON({geometry:e,spatialRel:t,where:n,timeExtent:r,objectIds:i})}async update(e,t){this._hash=JSON.stringify(e);let n=await i(e,null,t);await Promise.all([this._setGeometryFilter(n),this._setIdFilter(n),this._setAttributeFilter(n),this._setTimeFilter(n)])}async _setAttributeFilter(e){e?.where?(this._clause=await l(e.where,this._serviceInfo.fieldsIndex),this.where=e.where):(this._clause=null,this.where=null)}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry){this._spatialQueryOperator=null,this.geometry=null,this.spatialRel=null;return}let t=e.geometry,n=e.spatialRel??`esriSpatialRelIntersects`,r=await a(n,t,this._serviceInfo.geometryType);this._spatialQueryOperator=r,this.geometry=t,this.spatialRel=n}_setTimeFilter(n){if(this.timeExtent=this._timeOperator=null,n?.timeExtent){if(this._serviceInfo.timeInfo)this.timeExtent=n.timeExtent,this._timeOperator=o(this._serviceInfo.timeInfo,n.timeExtent,c.Shared);else{let r=new e(`feature-layer-view:time-filter-not-available`,`Unable to apply time filter, as layer doesn't have time metadata.`,n.timeExtent);t.getLogger(`esri.views.2d.layers.features.controllers.FeatureFilter`).error(r)}}}_applyFilter(e,t){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e,t)}_filterByExpression(e,t){return!this.where||this._clause(e,t)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;let t=e.readGeometryWorldSpace();return t?this._spatialQueryOperator(t):!1}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}}export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import{createArcadeGeometryFromOptimizedGeometry as t}from"../../../../../arcade/geometry/adapters/optimized.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as n}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as i}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as a}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as s}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as c,quantizeY as l}from"../../../../../geometry/support/quantizationUtils.js";import{zScale as u}from"../../../../../geometry/support/zscale.js";import{getCentroidOptimizedGeometry as d}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as f,generalizeOptimizedGeometry as p,quantizeOptimizedGeometry as m,unquantizeOptimizedGeometryInPlace as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as g}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as v,unknown as y}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has(`featurelayer-simplify-thresholds`)??[.5,.5,.5,.5],S=x[0],C=x[1],w=x[2],T=x[3],E=has(`featurelayer-simplify-payload-size-factors`)??[1,2,4],D=E[0],O=E[1],k=E[2],A=has(`featurelayer-simplify-mobile-factor`)??2,j=has(`esri-mobile`),M=4294967295;function N(e,t,n){if(!(e.length>t))for(;e.length<=t;)e.push(n)}class P{constructor(e){this.metadata=e,this.type=`FeatureSetReader`,this._overrides=null,this._postQueryFilteredIds=new Set,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._deleted=new Set,this._caches=new Map,this.arcadeDeclaredClass=`esri.arcade.Feature`,this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get geometryDensity(){return{sampleCount:0,densePairCount:0}}getAreaSimplificationThreshold(e,t){let n=1,r=j?A:1;t>4e6?n=k*r:t>1e6?n=O*r:t>5e5?n=D*r:t>1e5&&(n=r);let i=0;return e>4e3?i=T*n:e>2e3?i=w*n:e>100?i=C:e>15&&(i=S),i}getBounds(e){N(this._boundsBuffer,this.getIndex()*4+4,0);let t=this.getBoundsXMin();if(t===M||!isFinite(t))return!1;if(this.getBoundsXMin()===0){let t=this.readGeometryWorldSpace();if(t?.isPoint&&t.coords[0]===0&&t.coords[1]===0)return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(M),!1;let n=1/0,r=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{n=Math.min(n,e),r=Math.min(r,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(n),this.setBoundsYMin(r),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,n,r,i,a),!0}let n=this.getBoundsXMin(),r=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,n,r,i,a),!0}getBoundsXMin(){return this._boundsBuffer[this.getIndex()*4]}setBoundsXMin(e){this._boundsBuffer[this.getIndex()*4]=e}getBoundsYMin(){return this._boundsBuffer[this.getIndex()*4+1]}setBoundsYMin(e){this._boundsBuffer[this.getIndex()*4+1]=e}getBoundsXMax(){return this._boundsBuffer[this.getIndex()*4+2]}setBoundsXMax(e){this._boundsBuffer[this.getIndex()*4+2]=e}getBoundsYMax(){return this._boundsBuffer[this.getIndex()*4+3]}setBoundsYMax(e){this._boundsBuffer[this.getIndex()*4+3]=e}readAttributeAsTimestamp(e){let t=this.readAttribute(e);return typeof t==`string`?new Date(t).getTime():typeof t==`number`||t==null?t:null}readAttribute(e,t=!1){let n=this._readAttribute(e,t);if(n!==void 0)return n;for(let n of this._joined){n.setIndex(this.getIndex());let r=n._readAttribute(e,t);if(r!==void 0)return r}}readAttributes(){let e=this._readAttributes();for(let t of this._joined){t.setIndex(this.getIndex());let n=t._readAttributes();for(let t of Object.keys(n))e[t]=n[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){let e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){let e=this.readGeometryWorldSpace(),t=this.readAttributes(),n=this.readCentroidWorldSpace();return new g(e,t,n,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){let e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){let e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){let e=this.readGeometryForDisplay();return f(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){let e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){let e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){let e=this._readGeometryDeltaDecoded(!0);if(!e){let e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&this.metadata.geometryType===`esriGeometryPolyline`&&(t=p(t,this.metadata.geometryType,e.scale[0])),t&&=m(t,this.metadata.geometryType,e,t.hasZ,t.hasM,!0),!t){let t=this.readCentroidForDisplay();if(!t)return null;let n=c(e,t.coords[0]),r=l(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(n,r).deltaDecode()}return t}_transformToWorldSpace(e){if(!e)return null;e=e.clone();let t=this.getInTransform();t&&h(e,t);let n=u(this.metadata.spatialReference,this.metadata.outSpatialReference);if(e.hasZ&&n!==1){let{stride:t,coords:r}=e;for(let e=2;e<r.length;e+=t)r[e]*=n}return e}readGeometryWorldSpace(){let e=this._readGeometry();return e||=this._createDeltaQuantizedGeometryFromServerCentroid(),this._transformToWorldSpace(e)}readCentroidForDisplay(){let e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){let e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();return this._transformToWorldSpace(t)}setCache(e){let t=this._caches.get(e);t??(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}delete(){this._deleted.add(this.getObjectId())}getByReferenceVertexCount(){return null}get underlyingMemory(){let e=0;e+=n(this._boundsBuffer);for(let t of this._caches.values())e+=t.usedMemory;return e}getDisplayTransform(){return null}_readGeometryDeltaDecoded(e){let t=this._readGeometry(e);if(this.geometryType===`esriGeometryPoint`||!t)return t;let n=this.getInTransform();if(!t||!n)return t;let r=n.scale[2]??1,i=n.translate[2]??0,a=n.scale[3]??1,o=n.translate[3]??0,{hasZ:s,hasM:c,stride:l,size:u,coords:d}=t,f=s&&(r!==1||i!==0),p=c&&(a!==1||o!==0);if(f||p){let e=s?3:2;for(let t=0,n=l*u;t<n;t+=l)f&&(d[t+2]=r*d[t+2]+i),p&&(d[t+e]=a*d[t+e]+o)}return t.deltaDecode()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){let e=this.readGeometryWorldSpace();if(e==null)return null;let n;switch(this.geometryType){case`esriGeometryPoint`:n=`point`;break;case`esriGeometryMultipoint`:n=`multipoint`;break;case`esriGeometryPolyline`:n=`polyline`;break;case`esriGeometryPolygon`:n=`polygon`;break;default:throw Error(`Unexpected geometry type: ${this.geometryType}`)}return t(n,{lengths:e.lengths,coords:e.coords,hasZ:this.hasZ,hasM:this.hasM},this.metadata.outSpatialReference)}autocastArcadeDate(t,n){return n&&n instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(n):e.dateJSAndZoneToArcadeDate(n,this.contextTimeZone??v):n}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===y}field(t){let n=this.fields.get(t);if(n)switch(n.type){case`date-only`:case`esriFieldTypeDateOnly`:return r.fromReader(this.readAttribute(t,!1));case`time-only`:case`esriFieldTypeTimeOnly`:return i.fromReader(this.readAttribute(t,!1));case`esriFieldTypeTimestampOffset`:case`timestamp-offset`:return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case`date`:case`esriFieldTypeDate`:return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(let a of this._joined)if(a.setIndex(this.getIndex()),n=a.fields.get(t),n)switch(n.type){case`date-only`:case`esriFieldTypeDateOnly`:return r.fromReader(a._readAttribute(t,!1));case`time-only`:case`esriFieldTypeTimeOnly`:return i.fromReader(a._readAttribute(t,!1));case`esriFieldTypeTimestampOffset`:case`timestamp-offset`:return e.fromReaderAsTimeStampOffset(a._readAttribute(t,!1));case`date`:case`esriFieldTypeDate`:return this.autocastArcadeDate(t,a._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw Error(`Field ${t} does not exist`)}setField(e,t){throw Error(`Unable to update feature attribute values, feature is readonly`)}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&this.geometry()==null}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());let t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);let n={geometry:t.geometry,attributes:{...t.attributes}};for(let e in n.attributes){let t=n.attributes[e];t instanceof Date&&(n.attributes[e]=t.getTime())}return JSON.stringify(n)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(){return{attributes:this._readAttributes(),geometry:this.geometry()?.castAsJson()??null}}castAsJsonAsync(){return Promise.resolve(this.castAsJson())}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;let t=this.getCursor();for(;t.next();)e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}_getExists(){let e=this.getObjectId();return this._deleted.has(e)?!1:this._overrides?!this._overrides.hasOverride(e):!this._postQueryFilteredIds.has(e)}_computeDisplayCentroid(e){if(this.getInTransform()==null)return d(e);let t=a.fromOptimized(e,this.geometryType);t.yFactor*=-1;let n=s(t);return n?isNaN(n[0])||isNaN(n[1])?d(e):(n[1]*=-1,new _([],n)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone,e._postQueryFilteredIds=this._postQueryFilteredIds,e._deleted=this._deleted}_readLegacyGeometryWorldSpace(){let e=this.readGeometryWorldSpace();return f(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){let e=this._readServerCentroid();if(!e)return null;let[t,n]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,n)}_createDeltaQuantizedExtrudedGeometry(e,t){return this.geometryType===`esriGeometryPolyline`?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new _([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new _([2],[e-1,t+1,1,-1])}}export{P as FeatureSetReader};
|
|
2
|
+
import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import{createArcadeGeometryFromOptimizedGeometry as t}from"../../../../../arcade/geometry/adapters/optimized.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as n,estimateNumberMemory as r,baseObjectMemory as i}from"../../../../../core/memoryEstimations.js";import{r as a}from"../../../../../chunks/rbush.js";import{DateOnly as o}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as c}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as l,create as u}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as d}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as f,quantizeY as p,normalizeTransform as m}from"../../../../../geometry/support/quantizationUtils.js";import{zScale as h}from"../../../../../geometry/support/zscale.js";import{getCentroidOptimizedGeometry as g}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as _,generalizeOptimizedGeometry as v,quantizeOptimizedGeometry as y,unquantizeOptimizedGeometryInPlace as b}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as x}from"../../../../../layers/graphics/OptimizedFeature.js";import S from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as C,unknown as w}from"../../../../../time/constants.js";import{GeohashSpatialIndex as T}from"../aggregation/GeohashSpatialIndex.js";import{GridSpatialIndex as E}from"../aggregation/GridSpatialIndex.js";import{FeatureSetCache as D}from"./FeatureSetCache.js";const O=has(`featurelayer-simplify-thresholds`)??[.5,.5,.5,.5],k=O[0],A=O[1],j=O[2],M=O[3],N=has(`featurelayer-simplify-payload-size-factors`)??[1,2,4],P=N[0],F=N[1],I=N[2],L=has(`featurelayer-simplify-mobile-factor`)??2,R=has(`esri-mobile`),z=4294967295;function B(e,t,n){if(!(e.length>t))for(;e.length<=t;)e.push(n)}class V{constructor(e){this.metadata=e,this.type=`FeatureSetReader`,this._overrides=null,this._postQueryFilteredIds=new Set,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._aggregateCache={},this._deleted=new Set,this._caches=new Map,this.arcadeDeclaredClass=`esri.arcade.Feature`,this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get geometryDensity(){return{sampleCount:0,densePairCount:0}}getAreaSimplificationThreshold(e,t){let n=1,r=R?L:1;t>4e6?n=I*r:t>1e6?n=F*r:t>5e5?n=P*r:t>1e5&&(n=r);let i=0;return e>4e3?i=M*n:e>2e3?i=j*n:e>100?i=A:e>15&&(i=k),i}getBounds(e){B(this._boundsBuffer,this.getIndex()*4+4,0);let t=this.getBoundsXMin();if(t===z||!isFinite(t))return!1;if(this.getBoundsXMin()===0){let t=this.readGeometryWorldSpace();if(t?.isPoint&&t.coords[0]===0&&t.coords[1]===0)return l(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(z),!1;let n=1/0,r=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{n=Math.min(n,e),r=Math.min(r,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(n),this.setBoundsYMin(r),this.setBoundsXMax(i),this.setBoundsYMax(a),l(e,n,r,i,a),!0}let n=this.getBoundsXMin(),r=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return l(e,n,r,i,a),!0}getBoundsXMin(){return this._boundsBuffer[this.getIndex()*4]}setBoundsXMin(e){this._boundsBuffer[this.getIndex()*4]=e}getBoundsYMin(){return this._boundsBuffer[this.getIndex()*4+1]}setBoundsYMin(e){this._boundsBuffer[this.getIndex()*4+1]=e}getBoundsXMax(){return this._boundsBuffer[this.getIndex()*4+2]}setBoundsXMax(e){this._boundsBuffer[this.getIndex()*4+2]=e}getBoundsYMax(){return this._boundsBuffer[this.getIndex()*4+3]}setBoundsYMax(e){this._boundsBuffer[this.getIndex()*4+3]=e}readAttributeAsTimestamp(e){let t=this.readAttribute(e);return typeof t==`string`?new Date(t).getTime():typeof t==`number`||t==null?t:null}readAttribute(e,t=!1){let n=this._readAttribute(e,t);if(n!==void 0)return n;for(let n of this._joined){n.setIndex(this.getIndex());let r=n._readAttribute(e,t);if(r!==void 0)return r}}readAttributes(){let e=this._readAttributes();for(let t of this._joined){t.setIndex(this.getIndex());let n=t._readAttributes();for(let t of Object.keys(n))e[t]=n[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){let e=this.copy();return e._overrides=null,e._aggregateCache={},e}readOptimizedFeatureWorldSpace(){let e=this.readGeometryWorldSpace(),t=this.readAttributes(),n=this.readCentroidWorldSpace();return new x(e,t,n,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){let e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){let e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){let e=this.readGeometryForDisplay();return _(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){let e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){let e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){let e=this._readGeometryDeltaDecoded(!0);if(!e){let e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&this.metadata.geometryType===`esriGeometryPolyline`&&(t=v(t,this.metadata.geometryType,e.scale[0])),t&&=y(t,this.metadata.geometryType,e,t.hasZ,t.hasM,!0),!t){let t=this.readCentroidForDisplay();if(!t)return null;let n=f(e,t.coords[0]),r=p(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(n,r).deltaDecode()}return t}_transformToWorldSpace(e){if(!e)return null;e=e.clone();let t=this.getInTransform();t&&b(e,t);let n=h(this.metadata.spatialReference,this.metadata.outSpatialReference);if(e.hasZ&&n!==1){let{stride:t,coords:r}=e;for(let e=2;e<r.length;e+=t)r[e]*=n}return e}readGeometryWorldSpace(){let e=this._readGeometry();return e||=this._createDeltaQuantizedGeometryFromServerCentroid(),this._transformToWorldSpace(e)}readCentroidForDisplay(){let e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){let e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();return this._transformToWorldSpace(t)}setCache(e){let t=this._caches.get(e);t??(t=new D(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}delete(){this._deleted.add(this.getObjectId())}getByReferenceVertexCount(){return null}get underlyingMemory(){let e=0;e+=n(this._boundsBuffer),e+=(this._spatialIndex?.all().length??0)*r,e+=this._aggregateCache.gridIndex?.usedMemory??0,e+=this._aggregateCache.geohashIndex?.usedMemory??0;for(let t of this._caches.values())e+=t.usedMemory;return e}getDisplayTransform(){return null}queryFeaturesInBounds(e){let t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return H.from(this,this.getSpatialIndex().search(t))}getSpatialIndex(){if(this._spatialIndex)return this._spatialIndex;let e=[],t=this.copy(),n=u();for(let r=0;r<this.getSize();r++)t.setIndex(r),t.getBounds(n)&&e.push(t.getIndex());let r=a(9,e=>(t.setIndex(e),{minX:t.getBoundsXMin(),minY:t.getBoundsYMin(),maxX:t.getBoundsXMax(),maxY:t.getBoundsYMax()}));return r.load(e),this._spatialIndex=r,r}getGridIndex(e){return e.hash!==this._aggregateCache.gridIndex?.hash&&(this._aggregateCache.gridIndex=new E(e,this.copy())),this._aggregateCache.gridIndex}getGeohashIndex(e){return e.hash!==this._aggregateCache.geohashIndex?.hash&&(this._aggregateCache.geohashIndex=new T(e,this.copy())),this._aggregateCache.geohashIndex}invalidateAggregateIndices(){this._aggregateCache.gridIndex=void 0,this._aggregateCache.geohashIndex=void 0}_readGeometryDeltaDecoded(e){let t=this._readGeometry(e);if(this.geometryType===`esriGeometryPoint`||!t)return t;let n=this.getInTransform();if(!t||!n)return t;let r=n.scale[2]??1,i=n.translate[2]??0,a=n.scale[3]??1,o=n.translate[3]??0,{hasZ:s,hasM:c,stride:l,size:u,coords:d}=t,f=s&&(r!==1||i!==0),p=c&&(a!==1||o!==0);if(f||p){let e=s?3:2;for(let t=0,n=l*u;t<n;t+=l)f&&(d[t+2]=r*d[t+2]+i),p&&(d[t+e]=a*d[t+e]+o)}return t.deltaDecode()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){let e=this.readGeometryWorldSpace();if(e==null)return null;let n;switch(this.geometryType){case`esriGeometryPoint`:n=`point`;break;case`esriGeometryMultipoint`:n=`multipoint`;break;case`esriGeometryPolyline`:n=`polyline`;break;case`esriGeometryPolygon`:n=`polygon`;break;default:throw Error(`Unexpected geometry type: ${this.geometryType}`)}return t(n,{lengths:e.lengths,coords:e.coords,hasZ:this.hasZ,hasM:this.hasM},this.metadata.outSpatialReference)}autocastArcadeDate(t,n){return n&&n instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(n):e.dateJSAndZoneToArcadeDate(n,this.contextTimeZone??C):n}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===w}field(t){let n=this.fields.get(t);if(n)switch(n.type){case`date-only`:case`esriFieldTypeDateOnly`:return o.fromReader(this.readAttribute(t,!1));case`time-only`:case`esriFieldTypeTimeOnly`:return s.fromReader(this.readAttribute(t,!1));case`esriFieldTypeTimestampOffset`:case`timestamp-offset`:return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case`date`:case`esriFieldTypeDate`:return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(let r of this._joined)if(r.setIndex(this.getIndex()),n=r.fields.get(t),n)switch(n.type){case`date-only`:case`esriFieldTypeDateOnly`:return o.fromReader(r._readAttribute(t,!1));case`time-only`:case`esriFieldTypeTimeOnly`:return s.fromReader(r._readAttribute(t,!1));case`esriFieldTypeTimestampOffset`:case`timestamp-offset`:return e.fromReaderAsTimeStampOffset(r._readAttribute(t,!1));case`date`:case`esriFieldTypeDate`:return this.autocastArcadeDate(t,r._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw Error(`Field ${t} does not exist`)}setField(e,t){throw Error(`Unable to update feature attribute values, feature is readonly`)}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&this.geometry()==null}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());let t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);let n={geometry:t.geometry,attributes:{...t.attributes}};for(let e in n.attributes){let t=n.attributes[e];t instanceof Date&&(n.attributes[e]=t.getTime())}return JSON.stringify(n)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(){return{attributes:this._readAttributes(),geometry:this.geometry()?.castAsJson()??null}}castAsJsonAsync(){return Promise.resolve(this.castAsJson())}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;let t=new Set;e.forEachMatch(this,{currentUser:null},e=>{t.add(e.getObjectId())});let n=[],r=this.getCursor();for(;r.next();)t.has(r.getObjectId())||n.push(r.getObjectId());for(let e of n)this._postQueryFilteredIds.add(e)}_getExists(){let e=this.getObjectId();return this._deleted.has(e)?!1:this._overrides?!this._overrides.hasOverride(e):!this._postQueryFilteredIds.has(e)}_computeDisplayCentroid(e){if(this.getInTransform()==null)return g(e);let t=c.fromOptimized(e,this.geometryType);t.yFactor*=-1;let n=d(t);return n?isNaN(n[0])||isNaN(n[1])?g(e):(n[1]*=-1,new S([],n)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._spatialIndex=this._spatialIndex,e._aggregateCache=this._aggregateCache,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone,e._postQueryFilteredIds=this._postQueryFilteredIds,e._deleted=this._deleted}_readLegacyGeometryWorldSpace(){let e=this.readGeometryWorldSpace();return _(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){let e=this._readServerCentroid();if(!e)return null;let[t,n]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,n)}_createDeltaQuantizedExtrudedGeometry(e,t){return this.geometryType===`esriGeometryPolyline`?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new S([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new S([2],[e-1,t+1,1,-1])}}class H extends V{static from(e,t){if(e instanceof this){let n=new Set(t),r=e._indices.filter(e=>n.has(e)),i=e.copy();return i._indices=r,i._currentIndex=-1,i}return new H(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTransform=null,this._reader=e,this._indices=t}setTransformForDisplay(e){let t=this._reader.getInTransform();if(t==null){this._displayTransform=m(e);return}let n=m(t),r=m(e),[i,a]=n.scale,[o,s]=n.translate,[c,l]=r.scale,[u,d]=r.translate,f=i/c,p=a/l,h=(o-u)/c,g=(s-d)/l;this._displayTransform={originPosition:`lowerLeft`,scale:[1/f,1/p,1,1],translate:[-h/f,-g/p,0,0]}}getInTransform(){return this._reader.getInTransform()}getDisplayTransform(){return this._displayTransform}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){let e=new H(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e._displayTransform=this._displayTransform,e._processorAttributes=this._processorAttributes,e}getSpatialIndex(){return this._reader.getSpatialIndex()}getGridIndex(e){throw Error(`Cannot request a grid index from an indirect feature set reader.`)}getGeohashIndex(e){throw Error(`Cannot request a geohash index from an indirect feature set reader.`)}get contextTimeZone(){return this._reader.contextTimeZone}set contextTimeZone(e){this._reader.contextTimeZone=e}get usedMemory(){return i+this._reader.usedMemory}setProcessorAttributes(e){this._processorAttributes=Object.assign(this._processorAttributes??{},e)}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}readXForDisplay(){return this._displayTransform?f(this._displayTransform,this._reader.readXForDisplay()):this._reader.readXForDisplay()}readYForDisplay(){return this._displayTransform?p(this._displayTransform,this._reader.readYForDisplay()):this._reader.readYForDisplay()}readGeometryForDisplay(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform):this._reader.readGeometryForDisplay()}readCentroidForDisplay(){let e=this._reader.readCentroidForDisplay()?.clone();if(e){let[t,n]=e.coords;this._displayTransform&&(e.coords[0]=f(this._displayTransform,t),e.coords[1]=p(this._displayTransform,n))}return e}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}readAttribute(e,t=!1){let n=this._reader.readAttribute(e,t);return n!=null||!this._processorAttributes?n:this._processorAttributes[e]}readAttributes(){return{...this._processorAttributes,...this._reader.readAttributes()}}joinAttributes(e){return this._reader.joinAttributes(e)}getBounds(e){return this._reader.getBounds(e)}getBoundsXMin(){return this._reader.getBoundsXMin()}setBoundsXMin(e){this._reader.setBoundsXMin(e)}getBoundsYMin(){return this._reader.getBoundsYMin()}setBoundsYMin(e){this._reader.setBoundsYMin(e)}getBoundsXMax(){return this._reader.getBoundsXMax()}setBoundsXMax(e){this._reader.setBoundsXMax(e)}getBoundsYMax(){return this._reader.getBoundsYMax()}setBoundsYMax(e){this._reader.setBoundsYMax(e)}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readXWorldSpace(){return this._reader.readXWorldSpace()}readYWorldSpace(){return this._reader.readYWorldSpace()}_readX(){return this._reader.readXForDisplay()}_readY(){return this._reader.readYForDisplay()}_readServerCentroid(){return this._reader._readServerCentroid()}readLegacyFeatureForDisplay(){let e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){let e=this.readGeometryForDisplay();return _(e,this.geometryType,!1,!1)}readGeometryArea(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform)?.area()??0:this._reader.readGeometryArea()}readGeometryWorldSpace(){return this._reader.readGeometryWorldSpace()}_readGeometry(){return this._reader._readGeometry()}get geometryDensity(){return this._reader.geometryDensity}_readAttribute(e,t){throw Error(`Error: Should not be called. Underlying _reader should be used instead`)}_readAttributes(){throw Error(`Error: Should not be called. Underlying _reader should be used instead`)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this._reader.field(e)}hasField(e){return this._reader.hasField(e)}setField(e,t){return this._reader.setField(e,t)}keys(){return this._reader.keys()}castToText(e=!1){return this._reader.castToText(e)}}export{V as FeatureSetReader,H as FeatureSetReaderIndirect};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as n,isGeometryWithZ as r,isGeometryWithM as i}from"../../../../../geometry/support/jsonTypeUtils.js";import{convertFromGeometry as a,generalizeOptimizedGeometry as o,quantizeOptimizedGeometry as s}from"../../../../../layers/graphics/featureConversionUtils.js";import c from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as l}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as u}from"./FeatureSetReader.js";class d extends u{static from(e,t,n){return new d(e,t,n)}constructor(e,t,n){super(n),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;let r=t.lod;r.wrap&&(this._wrappingInfo={worldSizeX:r.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??{writers:[],dependencies:new Map,exports:new Map,requiresCoordination:!1}}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){let e=n(this._current.geometry);return e===`esriGeometryPoint`?`esriGeometryMultipoint`:e}getCursor(){return this.copy()}copy(){let e=new d(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw Error(`Fields reading not supported to graphics.`)}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw Error(`InternalError: exceededTransferLimit not implemented for graphics.`)}get hasZ(){return r(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e=``;for(let t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw Error(`InternalError: Setting displayId not supported for graphics.`)}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw Error(`InternalError: readGeometryArea not supported for graphics.`)}_readGeometry(){if(!this._cachedGeometry){let e=a(this._current.projectedGeometry);if(this.geometryType===`esriGeometryPolyline`&&(e=o(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=s(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;let{worldSizeX:t}=this._wrappingInfo;if(e.isPoint){if(t===1){e.coords.push(l,0),e.coords.push(-l*2,0),e.lengths.push(3);return}if(t===2){e.coords.push(l*2,0),e.coords.push(-l*4,0),e.lengths.push(3);return}this._wrapVertex(e.coords,0,2,t)}else if(this.geometryType===`esriGeometryMultipoint`){if(t===1){let t=e.coords.slice();t[0]-=512;let n=e.coords.slice();n[0]+=512,e.coords.push(...t,...n);let r=e.lengths[0];e.lengths.push(r,r);return}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,n,r){let i=t*n,a=e[i];a<-(l*(r-2))?e[i]=a+l*r:a>l*(r-1)&&(e[i]=a-l*r)}_readX(){let e=this._readGeometry();return e==null?0:e.coords[0]}_readY(){let e=this._readGeometry();return e==null?0:e.coords[1]}_readServerCentroid(){switch(this.geometryType){case`esriGeometryPolygon`:{let e=t(this._current.projectedGeometry),n=new c([],e,this.hasZ,!1);return s(n,this.geometryType,this._tile.transform)}case`esriGeometryPolyline`:{let t=this._current.projectedGeometry,n=e(t.paths,this.hasZ),r=new c([],n,this.hasZ,!1);return s(r,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){let n=this._current.attributes[e];if(n!==void 0)return n;let r=e.toLowerCase();for(let e in this._current.attributes)if(e.toLowerCase()===r)return this._current.attributes[e]}_readAttributes(){return this._current.attributes}}export{d as GraphicsReader};
|
|
2
|
+
import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as n,isGeometryWithZ as r,isGeometryWithM as i}from"../../../../../geometry/support/jsonTypeUtils.js";import{convertFromGeometry as a,generalizeOptimizedGeometry as o,quantizeOptimizedGeometry as s}from"../../../../../layers/graphics/featureConversionUtils.js";import c from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as l}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as u}from"./FeatureSetReader.js";class d extends u{static from(e,t,n){return new d(e,t,n)}constructor(e,t,n){super(n),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;let r=t.lod;r.wrap&&(this._wrappingInfo={worldSizeX:r.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??{writers:[],dependencies:new Map,exports:new Map,requiresCoordination:!1}}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){let e=n(this._current.geometry);return e===`esriGeometryPoint`?`esriGeometryMultipoint`:e}getCursor(){return this.copy()}copy(){let e=new d(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw Error(`Fields reading not supported to graphics.`)}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw Error(`InternalError: exceededTransferLimit not implemented for graphics.`)}get hasZ(){return r(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e=``;for(let t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw Error(`InternalError: Setting displayId not supported for graphics.`)}setIndex(e){this._cachedGeometry=null,this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw Error(`InternalError: readGeometryArea not supported for graphics.`)}_readGeometry(){if(!this._cachedGeometry){let e=a(this._current.projectedGeometry);if(this.geometryType===`esriGeometryPolyline`&&(e=o(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=s(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;let{worldSizeX:t}=this._wrappingInfo;if(e.isPoint){if(t===1){e.coords.push(l,0),e.coords.push(-l*2,0),e.lengths.push(3);return}if(t===2){e.coords.push(l*2,0),e.coords.push(-l*4,0),e.lengths.push(3);return}this._wrapVertex(e.coords,0,2,t)}else if(this.geometryType===`esriGeometryMultipoint`){if(t===1){let t=e.coords.slice();t[0]-=512;let n=e.coords.slice();n[0]+=512,e.coords.push(...t,...n);let r=e.lengths[0];e.lengths.push(r,r);return}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,n,r){let i=t*n,a=e[i];a<-(l*(r-2))?e[i]=a+l*r:a>l*(r-1)&&(e[i]=a-l*r)}_readX(){let e=this._readGeometry();return e==null?0:e.coords[0]}_readY(){let e=this._readGeometry();return e==null?0:e.coords[1]}_readServerCentroid(){switch(this.geometryType){case`esriGeometryPolygon`:{let e=t(this._current.projectedGeometry),n=new c([],e,this.hasZ,!1);return s(n,this.geometryType,this._tile.transform)}case`esriGeometryPolyline`:{let t=this._current.projectedGeometry,n=e(t.paths,this.hasZ),r=new c([],n,this.hasZ,!1);return s(r,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){let n=this._current.attributes[e];if(n!==void 0)return n;let r=e.toLowerCase();for(let e in this._current.attributes)if(e.toLowerCase()===r)return this._current.attributes[e]}_readAttributes(){return this._current.attributes}}export{d as GraphicsReader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as a,throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as d,isPolygon as f,isExtent as p,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import h from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as g,CIMSymbolHelper as _}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as v}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as y,errorPolylineSymbol2D as b,errorPolygonSymbol2D as x}from"../../../../symbols/support/defaults.js";import{filterFlag0 as S}from"../../engine/webgl/definitions.js";import{FeatureTile as C}from"../../engine/webgl/FeatureTile.js";import{MeshData as w}from"../../engine/webgl/mesh/MeshData.js";import{createCalloutMeshWriterCoordinator as T}from"../../engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js";import{MeshWriterGroupCoordinator as E}from"../../engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js";import{ResourceProxy as D}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as O}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createMeshWriterGroup as k}from"../../engine/webgl/util/Matcher.js";import{createStorageSchema as A}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as j}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as M}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as N}from"../features/support/FeatureMetadata.js";import{GraphicsReader as P}from"../features/support/GraphicsReader.js";import F from"./GraphicStore.js";import{FeatureCommandQueue as I}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as L}from"../support/UpdateTracking2D.js";class R{static getOrCreate(e,t,n){let r=t.get(e.id);return r||(r=new R(e,n),t.set(e.id,r)),r}static fromItems(e,t,n){let r=new R(e,n);for(let e of t)r.append(e);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||=P.from(this.addedOrModified,this.tile,this.metadata),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let z=class extends r(t){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._highlightFlagsByObjectId=new Map,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new L({debugName:`GraphicsView2D`}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new I({process:e=>{switch(e.type){case`update`:return this._update();default:throw Error(`InternalError: Unsupported command`)}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set(`graphics`,null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new M({spatialReference:this.view.spatialReference,fields:new h}),this._attributeStore=new j({isLocal:!0,update:e=>{has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});let e=A(null,[]);this._attributeStore.update(e,this._storage,null)}initialize(){this._initAttributeStore(),this._metadata=N.createGraphics(this.view.spatialReference),this._resourceProxy=new D({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw Error(`InternalError: Graphics do not support Dictionary requests`)},fetchMesh:e=>{throw Error(`InternalError: Graphics do not support Mesh requests`)}}),this.addHandles([s(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on(`update`,this._onTileUpdate.bind(this)),this.container.on(`attach`,()=>{this.addHandles([this.graphics.on(`change`,()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new F(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking(`CommandQueue`,this._commandQueue.updateTracking);let e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return typeof this.renderer==`function`?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){return!this._attached||this._updateTracking.updating}hitTest(e,t){if(!this.view||this.view.suspended)return[];let{resolution:r,rotation:i}=this.view.state,a=this._graphicStore.hitTest(e,t,r,i),o=new Set(a),s=this.graphics.items.reduce((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e),new Map);return a.map(e=>s.get(e)).filter(n)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange(`updating`)}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlightFilters(e){this._highlightFlagsByObjectId.clear();for(let{order:t,filters:n}of e){let e=1<<t;for(let t of n)for(let n of t.objectIds??[]){let t=this._highlightFlagsByObjectId.get(n)??0;this._highlightFlagsByObjectId.set(n,t|e)}}if(this.container.setHighlightActive(this._highlightFlagsByObjectId.size>0),this._attached)for(let e of this._graphicStore.items())this._setFilterState(e);this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){a(this._commandQueue.push({type:`update`}))}async _update(){try{if(has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;let e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(let t of e.updated)this.container.restartAnimation(t.objectId);if(!e.hasAnyUpdate()){this._attributeStore.sendUpdates();return}e.removed.length&&(this._cleanupRequired=!0),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);let t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(let t of e.added)this._setFilterState(t);for(let t of e.updated)this._setFilterState(t);has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch{}this._cleanupSharedResources()}_createTileMessages(e){let t=new Map;for(let n of e.added){let e=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).append(n)}for(let n of e.updated){let e=this.view.graphicsTileStore.getIntersectingTiles(n.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).removed.push(n.displayId);for(let e of r)R.getOrCreate(e,t,this._metadata).append(n)}for(let n of e.removed){let e=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).removed.push(n.displayId)}return Array.from(t.values())}async _densifyItemsForDisplay(e){let t=new Map;for(let n of e)for(let e of n.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){let t={timeZone:null,timeExtent:null};for(let{tile:n,reader:r}of e){has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${n.id}] GraphicsView fetchResources`,e);let i=r.getCursor();for(;i.next();)for(let e of i.getMeshWriters().writers)e.enqueueRequest(this._resourceProxy,i,n.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(let t of e){has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);let e=this._writeMeshes(t),n=this._tiles.get(t.tile.key);n||=this._createFeatureTile(t.tile.key),has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(n,{type:`update`,modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){let t={timeZone:null,timeExtent:null},n=new w(e.tile.id),r=e.reader.getCursor();for(;r.next();)n.entityStart(r.getDisplayId(),r.getZOrder()),new E({out:n,proxy:this._resourceProxy,feature:r,options:e.tile.createArcadeEvaluationOptions(t),level:e.tile.level,coordinatorFactories:[T]}).coordinateAndWrite(r.getMeshWriters()),n.entityEnd();return{...n.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){let t=e.displayId,n=this._highlightFlagsByObjectId.get(e.objectId)??0;this._attributeStore.setData(t,0,0,n|(e.visible?S:0))}_getSymbolForGraphic(e){return e.symbol==null?this._effectiveRenderer==null?this._getNullSymbol(e):this._effectiveRenderer.getSymbol(e):e.symbol}async _ensureSymbolResource(e){if(!e.symbol)return;let t=await this._getSymbolInfo(e.symbol);if(!t)return;let n=t.linearCIM.filter(e=>e.type===`text`);e.symbolResource=n.length>0?{symbolInfo:t,textInfo:await this._getTextResources(e,n)}:{symbolInfo:t}}_getSymbolInfo(e){let t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){let n=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(n);return{hash:e,cimSymbol:n,linearCIM:r,meshWriters:await this._createMeshWriters(n,r,t.type===`text`)}}async _convertToCIMSymbol(e){let t=g(e);return t.type===`web-style`?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:[`cim`,`web`]})):t}async _createLinearCIM(e){return await _.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t,n){o(this._controller.signal);let r=this.container.instanceStore,i=this.view.stage.meshWriterRegistry,a=await O(e,t,r,n),s=await Promise.all(a.map(e=>i.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)));return k(s,a)}_onTileUpdate(e){if(e.added&&e.added.length>0)for(let t of e.added)this._updateTracking.consumePromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(let t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){let t=this.view.featuresTilingScheme.getTileBounds(u(),e),n=this.view.featuresTilingScheme.getTileResolution(e.level),r=new C(e,n,t[0],t[3],this.container.labelStore);return r.presenting=!0,this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;let t=this._graphicStore.queryItems(e);if(!t.length)return;let n=this._createFeatureTile(e.key),r=R.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);let i=this._writeMeshes(r);n.update({type:`append`,append:i,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;let t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){let t=e.geometry;return t?d(t)?b:f(t)||p(t)?x:this.defaultPointSymbolEnabled?y:null:this.defaultPointSymbolEnabled?y:null}async _getTextResources(e,t){let n=[],r=[];for(let i=0;i<t.length;i++){let a=t[i],{resource:o,overrides:s}=a.textRasterizationParam;if(s?.length>0){let t=v.resolveSymbolOverrides({type:`CIMSymbolReference`,primitiveOverrides:s,symbol:{type:`CIMPointSymbol`,symbolLayers:[{type:`CIMVectorMarker`,enable:!0,size:o.symbol.height,anchorPointUnits:`Relative`,frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:`CIMMarkerGraphic`,geometry:{x:0,y:0},symbol:o.symbol,textString:o.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{let{textString:t}=e.symbolLayers[0].markerGraphics[0];r.push({type:`cim-rasterization-info`,resource:{type:`text`,textString:t||``,font:o.font}}),a.text=o.textString=t||``}),n.push(t)}else r.push({type:`cim-rasterization-info`,resource:o})}n.length>0&&await Promise.all(n);let a=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),o=await Promise.all(a);i(o);let s=new Map;for(let e=0;e<t.length;e++){let n=t[e];s.set(n.textRasterizationParam.resource.symbol,{text:n.text,glyphMosaicItems:o[e]})}return s}_cleanupSharedResources(){if(!this._cleanupRequired)return;let e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;let t=new Set;for(let e of this._graphicStore.items()){let n=e.symbolResource?.symbolInfo.hash;t.add(n)}let n=new Set(this._hashToSymbolInfo.keys());for(let e of n.values())t.has(e)||this._hashToSymbolInfo.delete(e)}};e([c()],z.prototype,`_effectiveRenderer`,null),e([c({constructOnly:!0})],z.prototype,`layerId`,void 0),e([c({constructOnly:!0})],z.prototype,`requestUpdateCallback`,void 0),e([c()],z.prototype,`container`,void 0),e([c({constructOnly:!0})],z.prototype,`graphics`,void 0),e([c()],z.prototype,`renderer`,void 0),e([c()],z.prototype,`_updateTracking`,void 0),e([c()],z.prototype,`updating`,null),e([c()],z.prototype,`view`,void 0),e([c()],z.prototype,`updateRequested`,void 0),e([c()],z.prototype,`defaultPointSymbolEnabled`,void 0),z=e([l(`esri.views.2d.layers.graphics.GraphicsView2D`)],z);const B=z;export{B as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as a,throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as d,isPolygon as f,isExtent as p,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import h from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as g,CIMSymbolHelper as _}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as v}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as y,errorPolylineSymbol2D as b,errorPolygonSymbol2D as x}from"../../../../symbols/support/defaults.js";import{filterFlag0 as S}from"../../engine/webgl/definitions.js";import{FeatureTile as C}from"../../engine/webgl/FeatureTile.js";import{MeshData as w}from"../../engine/webgl/mesh/MeshData.js";import{createCalloutMeshWriterCoordinator as T}from"../../engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js";import{MeshWriterGroupCoordinator as E}from"../../engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js";import{ResourceProxy as D}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as O}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createMeshWriterGroup as k}from"../../engine/webgl/util/Matcher.js";import{createStorageSchema as A}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as j}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as M}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as N}from"../features/support/FeatureMetadata.js";import{GraphicsReader as P}from"../features/support/GraphicsReader.js";import F from"./GraphicStore.js";import{FeatureCommandQueue as I}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as L}from"../support/UpdateTracking2D.js";class R{static getOrCreate(e,t,n){let r=t.get(e.id);return r||(r=new R(e,n),t.set(e.id,r)),r}static fromItems(e,t,n){let r=new R(e,n);for(let e of t)r.append(e);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||=P.from(this.addedOrModified,this.tile,this.metadata),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let z=class extends r(t){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._highlightFlagsByObjectId=new Map,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new L({debugName:`GraphicsView2D`}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new I({process:e=>{switch(e.type){case`update`:return this._update();default:throw Error(`InternalError: Unsupported command`)}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set(`graphics`,null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new M({spatialReference:this.view.spatialReference,fields:new h}),this._attributeStore=new j({isLocal:!0,update:e=>{has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});let e=A(null,[]);this._attributeStore.update(e,this._storage,null,0,{dependencies:[],timeZoneChanged:!1,currentUserChanged:!1})}initialize(){this._initAttributeStore(),this._metadata=N.createGraphics(this.view.spatialReference),this._resourceProxy=new D({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw Error(`InternalError: Graphics do not support Dictionary requests`)},fetchMesh:e=>{throw Error(`InternalError: Graphics do not support Mesh requests`)}}),this.addHandles([s(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on(`update`,this._onTileUpdate.bind(this)),this.container.on(`attach`,()=>{this.addHandles([this.graphics.on(`change`,()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new F(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking(`CommandQueue`,this._commandQueue.updateTracking);let e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return typeof this.renderer==`function`?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){return!this._attached||this._updateTracking.updating}hitTest(e,t){if(!this.view||this.view.suspended)return[];let{resolution:r,rotation:i}=this.view.state,a=this._graphicStore.hitTest(e,t,r,i),o=new Set(a),s=this.graphics.items.reduce((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e),new Map);return a.map(e=>s.get(e)).filter(n)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange(`updating`)}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlightFilters(e){this._highlightFlagsByObjectId.clear();for(let{order:t,filters:n}of e){let e=1<<t;for(let t of n)for(let n of t.objectIds??[]){let t=this._highlightFlagsByObjectId.get(n)??0;this._highlightFlagsByObjectId.set(n,t|e)}}if(this.container.setHighlightActive(this._highlightFlagsByObjectId.size>0),this._attached)for(let e of this._graphicStore.items())this._setFilterState(e);this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){a(this._commandQueue.push({type:`update`}))}async _update(){try{if(has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;let e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(let t of e.updated)this.container.restartAnimation(t.objectId);if(!e.hasAnyUpdate()){this._attributeStore.sendUpdates();return}e.removed.length&&(this._cleanupRequired=!0),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);let t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(let t of e.added)this._setFilterState(t);for(let t of e.updated)this._setFilterState(t);has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has(`esri-2d-update-debug`)&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch{}this._cleanupSharedResources()}_createTileMessages(e){let t=new Map;for(let n of e.added){let e=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).append(n)}for(let n of e.updated){let e=this.view.graphicsTileStore.getIntersectingTiles(n.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).removed.push(n.displayId);for(let e of r)R.getOrCreate(e,t,this._metadata).append(n)}for(let n of e.removed){let e=this.view.graphicsTileStore.getIntersectingTiles(n.symbolBounds);for(let r of e)R.getOrCreate(r,t,this._metadata).removed.push(n.displayId)}return Array.from(t.values())}async _densifyItemsForDisplay(e){let t=new Map;for(let n of e)for(let e of n.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){let t={timeZone:null,timeExtent:null};for(let{tile:n,reader:r}of e){has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${n.id}] GraphicsView fetchResources`,e);let i=r.getCursor();for(;i.next();)for(let e of i.getMeshWriters().writers)e.enqueueRequest(this._resourceProxy,i,n.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(let t of e){has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);let e=this._writeMeshes(t),n=this._tiles.get(t.tile.key);n||=this._createFeatureTile(t.tile.key),has(`esri-2d-update-debug`)&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(n,{type:`update`,modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){let t={timeZone:null,timeExtent:null},n=new w(e.tile.id),r=e.reader.getCursor();for(;r.next();)n.entityStart(r.getDisplayId(),r.getZOrder()),new E({out:n,proxy:this._resourceProxy,feature:r,options:e.tile.createArcadeEvaluationOptions(t),level:e.tile.level,coordinatorFactories:[T]}).coordinateAndWrite(r.getMeshWriters()),n.entityEnd();return{...n.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){let t=e.displayId,n=this._highlightFlagsByObjectId.get(e.objectId)??0;this._attributeStore.setData(t,0,0,n|(e.visible?S:0))}_getSymbolForGraphic(e){return e.symbol==null?this._effectiveRenderer==null?this._getNullSymbol(e):this._effectiveRenderer.getSymbol(e):e.symbol}async _ensureSymbolResource(e){if(!e.symbol)return;let t=await this._getSymbolInfo(e.symbol);if(!t)return;let n=t.linearCIM.filter(e=>e.type===`text`);e.symbolResource=n.length>0?{symbolInfo:t,textInfo:await this._getTextResources(e,n)}:{symbolInfo:t}}_getSymbolInfo(e){let t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){let n=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(n);return{hash:e,cimSymbol:n,linearCIM:r,meshWriters:await this._createMeshWriters(n,r,t.type===`text`)}}async _convertToCIMSymbol(e){let t=g(e);return t.type===`web-style`?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:[`cim`,`web`]})):t}async _createLinearCIM(e){return await _.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t,n){o(this._controller.signal);let r=this.container.instanceStore,i=this.view.stage.meshWriterRegistry,a=await O(e,t,r,n),s=await Promise.all(a.map(e=>i.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)));return k(s,a)}_onTileUpdate(e){if(e.added&&e.added.length>0)for(let t of e.added)this._updateTracking.consumePromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(let t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){let t=this.view.featuresTilingScheme.getTileBounds(u(),e),n=this.view.featuresTilingScheme.getTileResolution(e.level),r=new C(e,n,t[0],t[3],this.container.labelStore);return r.presenting=!0,this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;let t=this._graphicStore.queryItems(e);if(!t.length)return;let n=this._createFeatureTile(e.key),r=R.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);let i=this._writeMeshes(r);n.update({type:`append`,append:i,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;let t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){let t=e.geometry;return t?d(t)?b:f(t)||p(t)?x:this.defaultPointSymbolEnabled?y:null:this.defaultPointSymbolEnabled?y:null}async _getTextResources(e,t){let n=[],r=[];for(let i=0;i<t.length;i++){let a=t[i],{resource:o,overrides:s}=a.textRasterizationParam;if(s?.length>0){let t=v.resolveSymbolOverrides({type:`CIMSymbolReference`,primitiveOverrides:s,symbol:{type:`CIMPointSymbol`,symbolLayers:[{type:`CIMVectorMarker`,enable:!0,size:o.symbol.height,anchorPointUnits:`Relative`,frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:`CIMMarkerGraphic`,geometry:{x:0,y:0},symbol:o.symbol,textString:o.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{let{textString:t}=e.symbolLayers[0].markerGraphics[0];r.push({type:`cim-rasterization-info`,resource:{type:`text`,textString:t||``,font:o.font}}),a.text=o.textString=t||``}),n.push(t)}else r.push({type:`cim-rasterization-info`,resource:o})}n.length>0&&await Promise.all(n);let a=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),o=await Promise.all(a);i(o);let s=new Map;for(let e=0;e<t.length;e++){let n=t[e];s.set(n.textRasterizationParam.resource.symbol,{text:n.text,glyphMosaicItems:o[e]})}return s}_cleanupSharedResources(){if(!this._cleanupRequired)return;let e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;let t=new Set;for(let e of this._graphicStore.items()){let n=e.symbolResource?.symbolInfo.hash;t.add(n)}let n=new Set(this._hashToSymbolInfo.keys());for(let e of n.values())t.has(e)||this._hashToSymbolInfo.delete(e)}};e([c()],z.prototype,`_effectiveRenderer`,null),e([c({constructOnly:!0})],z.prototype,`layerId`,void 0),e([c({constructOnly:!0})],z.prototype,`requestUpdateCallback`,void 0),e([c()],z.prototype,`container`,void 0),e([c({constructOnly:!0})],z.prototype,`graphics`,void 0),e([c()],z.prototype,`renderer`,void 0),e([c()],z.prototype,`_updateTracking`,void 0),e([c()],z.prototype,`updating`,null),e([c()],z.prototype,`view`,void 0),e([c()],z.prototype,`updateRequested`,void 0),e([c()],z.prototype,`defaultPointSymbolEnabled`,void 0),z=e([l(`esri.views.2d.layers.graphics.GraphicsView2D`)],z);const B=z;export{B as default};
|
package/views/3d/GroundView3D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import has from"../../core/has.js";import{when as n,watch as r,syncAndInitial as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as s,equals as c,intersection as l,union as u}from"../../geometry/support/aaBoundingRect.js";import d from"../GroundView.js";import{ElevationRange as f}from"./support/ElevationRange.js";import{toBoundingRect as p}from"./support/extentUtils.js";import{webMercatorWorldExtent as m,geographicWorldExtent as h}from"./terrain/TerrainConst.js";import{isIntegratedMeshLayerView as g}from"../support/layerViewUtils.js";const _=Symbol(`integrated-mesh-elevation-providers`);let v=class extends t(d){initialize(){super.initialize(),this.addHandles(n(()=>this._terrainSurface,e=>e.on(`elevation-change`,e=>this._elevationChange(e)))),r(()=>[this.view?.basemapView?.groundLayerViews.toArray(),this.layerViews.toArray()],()=>{this.removeHandles(_),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on(`elevation-change`,e=>this._elevationChange(e))),_)},i),this.addHandles([r(()=>this.memoizedElevationQueryDependencies,()=>{this.emit(`elevation-query-change`)})])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>e.type===`elevation`||e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit(`elevation-change`,e)}get _integratedMeshGroundLayerViews(){return has(`enable-feature:im-as-ground`)?[...this.view?.basemapView?.groundLayerViews.filter(g)??[],...this.layerViews.filter(g)]:[...this.view?.basemapView?.groundLayerViews.filter(g).filter(e=>e.replacesTerrain)??[]]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){let{spatialReference:e}=this,{clippingArea:t}=this.view;if(t==null||e==null)return null;let n=s(),r=p(t,n,e)?n:null,i=this._get(`userClippingExtent`);return c(r,i)?i:r}
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import has from"../../core/has.js";import{when as n,watch as r,syncAndInitial as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as s,equals as c,intersection as l,union as u}from"../../geometry/support/aaBoundingRect.js";import d from"../GroundView.js";import{ElevationRange as f}from"./support/ElevationRange.js";import{toBoundingRect as p}from"./support/extentUtils.js";import{webMercatorWorldExtent as m,geographicWorldExtent as h}from"./terrain/TerrainConst.js";import{isIntegratedMeshLayerView as g}from"../support/layerViewUtils.js";const _=Symbol(`integrated-mesh-elevation-providers`);let v=class extends t(d){initialize(){super.initialize(),this.addHandles(n(()=>this._terrainSurface,e=>e.on(`elevation-change`,e=>this._elevationChange(e)))),r(()=>[this.view?.basemapView?.groundLayerViews.toArray(),this.layerViews.toArray()],()=>{this.removeHandles(_),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on(`elevation-change`,e=>this._elevationChange(e))),_)},i),this.addHandles([r(()=>this.memoizedElevationQueryDependencies,()=>{this.emit(`elevation-query-change`)})])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>e.type===`elevation`||e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit(`elevation-change`,e)}get _integratedMeshGroundLayerViews(){return has(`enable-feature:im-as-ground`)?[...this.view?.basemapView?.groundLayerViews.filter(g)??[],...this.layerViews.filter(g)]:[...this.view?.basemapView?.groundLayerViews.filter(g).filter(e=>e.replacesTerrain)??[]]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){let{spatialReference:e}=this,{clippingArea:t}=this.view;if(t==null||e==null)return null;let n=s(),r=p(t,n,e)?n:null,i=this._get(`userClippingExtent`);return c(r,i)?i:r}isUpdating(){return this._usingTerrain&&this._terrainSurface.updating||super.isUpdating()}getElevation(e,t,n,r){let i=this._usingTerrain?this._terrainSurface?.getElevation(e,t,n,r):null;return this._integratedMeshGroundLayerViews.reduce((i,a)=>{let o=a.elevationProvider.getElevation(e,t,n,r);return o==null?i:Math.max(o,i??o)},i)}getElevations(e,t,n){let r=this.view.groundSpatialReference;if(r==null)for(let e=0;e<t;++e)n(e,null);else for(let i=0;i<t;++i){let t=i*3;n(i,this.getElevation(e[t],e[t+1],e[t+2],r))}}intersect(e,t,n,r){this._usingTerrain&&this._terrainSurface.intersect(e,t,n,r),this._integratedMeshGroundLayerViews.forEach(i=>i.intersect(e,t,n,r))}getSphereElevationRange(e,t,n){let r=this._usingTerrain?this._terrainSurface?.getSphereElevationRange?.(e,t):null;return this._integratedMeshGroundLayerViews.reduce((n,r)=>{let i=r.elevationProvider.getSphereElevationRange?.(e,t);return i==null||(n??=new f,n.expandElevationRange(i)),n},r?new f(r.minElevation,r.maxElevation):null)}getRootElevationRange(){let e=this._usingTerrain?this._terrainSurface?.getRootElevationRange?.():null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>{let n=t.elevationProvider.getRootElevationRange?.();return n==null||(e??=new f,e.expandElevationRange(n)),e},e?new f(e.minElevation,e.maxElevation):null)}get elevationQueryCache(){let e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(let e of this.ground?.allLayers??[])if(e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain&&e.loadStatus!==`failed`&&e.queryElevationCallback==null)return!1;return!0}get groundExtent(){let{fullGroundExtent:e}=this;return e?this.userClippingExtent?l(e,this.userClippingExtent,s()):this.fullGroundExtent:null}get fullGroundExtent(){let e=this._usingTerrain?this._terrainSurface.fullGroundExtent:null;if(this._integratedMeshGroundLayerViews.length===0)return e;let t=this.view.spatialReference;if(!t.isWebMercator&&!t.isWGS84)return e;let n=b(t);return e?u(e,n,s()):n}get visibleElevationRange(){let e=this._usingTerrain?this._terrainSurface.visibleElevationRange:null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>e==null?new f(t.visibleElevationRange.minElevation,t.visibleElevationRange.maxElevation):(e.expandElevationRange(t.visibleElevationRange),e),e?new f(e.minElevation,e.maxElevation):null)??y}get opaque(){return this._usingTerrain&&this._terrainSurface.opaque||this._integratedMeshGroundLayerViews.some(({opaque:e})=>e)}get invisible(){return(!this._usingTerrain||this._terrainSurface.invisible)&&this._integratedMeshGroundLayerViews.every(({invisible:e})=>e)}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return this._usingTerrain?this._terrainSurface?.wireframe??!1:!1}get freeze(){return this._usingTerrain&&(this._terrainSurface?.freeze??!1)||this._integratedMeshGroundLayerViews.some(e=>e.type===`integrated-mesh-3dtiles`&&e.freeze)}set freeze(e){this._usingTerrain&&(this._terrainSurface.freeze=e),this._integratedMeshGroundLayerViews.forEach(t=>{t.type===`integrated-mesh-3dtiles`&&(t.freeze=e)})}get suspended(){return(!this._usingTerrain||super.suspended)&&this._integratedMeshGroundLayerViews.length>0&&this._integratedMeshGroundLayerViews.every(({suspended:e})=>e)}get ready(){return!this._usingTerrain&&this._integratedMeshGroundLayerViews.length===0?!1:(!this._usingTerrain||this._terrainSurface.ready)&&this._integratedMeshGroundLayerViews.every(({ready:e})=>e)}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([a()],v.prototype,`memoizedElevationQueryDependencies`,null),e([a({readOnly:!0})],v.prototype,`_integratedMeshGroundLayerViews`,null),e([a({readOnly:!0})],v.prototype,`_terrainSurface`,null),e([a({readOnly:!0})],v.prototype,`_usingTerrain`,null),e([a({readOnly:!0})],v.prototype,`spatialReference`,null),e([a({readOnly:!0})],v.prototype,`userClippingExtent`,null),e([a({readOnly:!0})],v.prototype,`elevationQueryCache`,null),e([a()],v.prototype,`elevationQueryReady`,null),e([a({readOnly:!0})],v.prototype,`groundExtent`,null),e([a({readOnly:!0})],v.prototype,`fullGroundExtent`,null),e([a({readOnly:!0})],v.prototype,`visibleElevationRange`,null),e([a({readOnly:!0})],v.prototype,`opaque`,null),e([a({readOnly:!0})],v.prototype,`invisible`,null),e([a({readOnly:!0})],v.prototype,`baseOpacity`,null),e([a({readOnly:!0})],v.prototype,`wireframe`,null),e([a()],v.prototype,`freeze`,null),e([a({readOnly:!0})],v.prototype,`suspended`,null),e([a({readOnly:!0})],v.prototype,`ready`,null),v=e([o(`esri.views.3d.GroundView3D`)],v);const y=new f(0,0);function b(e){return e.isWebMercator?m:h}export{v as GroundView3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import n from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{debounce as i,isPromiseLike as a}from"../../../../core/promiseUtils.js";import{createVolume as o}from"../../../../core/quantity.js";import s from"../../../../core/ReactiveMap.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{runUntracked as d}from"../../../../core/accessorSupport/tracking.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxes as p}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as ee}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as g,scale as te,set as ne,negate as re}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v,clone as ie}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../core/support/UpdatingHandles.js";import oe from"../../../../geometry/Multipoint.js";import{projectOrLoad as y}from"../../../../geometry/projectionUtils.js";import{containsExecute as b}from"../../../../geometry/operators/containsOperator.js";import{convexHullExecute as se}from"../../../../geometry/operators/convexHullOperator.js";import{simplifyExecute as ce}from"../../../../geometry/operators/simplifyOperator.js";import{unionExecuteMany as le}from"../../../../geometry/operators/unionOperator.js";import{computeTranslationToOriginAndRotation as ue}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as de}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as x,create as fe,fromExtent as S,intersects as C}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as w}from"../../../../geometry/support/coordinateSystem.js";import{isClockwise as T}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as E}from"../../../../geometry/support/DoubleArray.js";import{t as D}from"../../../../chunks/vec3.js";import O from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as k}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as A}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as j,VolumeMeasurementPerimeterTooLargeError as M,VolumeMeasurementUnsupportedCoordinateSystemError as N,VolumeMeasurementUnsupportedLayerTransparencyError as P}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as F}from"./VolumeMeasurementRawResult.js";import I from"./VolumeMeasurementResult.js";import{ElevationContext as L}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as R}from"../../support/ElevationProvider.js";import{Obb as z}from"../../support/orientedBoundingBox.js";import{polygonToRenderInfoElevationAligned as B}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as V}from"../../terrain/tileUtils.js";import{CutFillComputation as pe,TargetGeometryRenderInfo as me}from"../../webgl-engine/lib/CutFillComputation.js";import{GeometryWorkerHandle as he}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as ge}from"../../../support/layerViewUtils.js";let H=class extends n{constructor(e){super(e),this._measurementWorkerHandle=new he,this.depthExtremaPositions=null,this.analysisObb=null,this._updatingHandles=new ae,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new V,this._intersectingObbsByLayerView=new s,this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,n,r)=>{if(!this._computation.done)return;let{renderCoordsHelper:i}=this.view,a=new A({extent:t,localOrigin:n,renderCoordsHelper:i});this._computation.update(a,r),this._determineDataCoverage(a,e);let[o]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),c(()=>this._computation.done).then(()=>{this._updateDepthExtremaPositions(a,this._computation.result)})]);if(this.error){this._rawResult=null;return}let s=this._computation.result;this._updateResult(a,s,o.status===`fulfilled`?o.value:null)}),this._determineDataCoverage=(e,t)=>{let{frustum:n}=this._computation,{cameraDimensions:r}=e;t.extent&&n&&(this._intersectingObbsByLayerView.clear(),this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,n)}),this._intersectingObbsByLayerView.size>0?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,r):(this._findIntersectingTerrainTiles(t.extent),this._sufficientDataCoverage=this._sufficientTerrainCoverage(r)))}}initialize(){let e=this.view;this._computation=new pe({view:e}),this.addHandles([this._createElevationUpdateHandle(),this._updatingHandles.add(()=>({localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo}),({localOrigin:e,targetGeometryRenderInfo:t})=>{let n=this._projectedGeometry,r=n?.extent;!n||!r||!e||!t?(this._rawResult=null,this.depthExtremaPositions=null,this.analysisObb=null,this._sufficientDataCoverage=!0):this._updatingHandles.consumePromise(this._debouncedUpdate(n,r,e,t))})])}destroy(){this._updatingHandles.destroy(),this._computation.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){let e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;let t=ce(e),n=y(t,this.view.spatialReference);return n.pending?(this._updatingHandles.consumePromise(n.pending),null):(t&&!n.geometry&&k(this.analysis,e.spatialReference,r.getLogger(this)),n.geometry)}get _localOrigin(){let e=this._projectedGeometry?.extent;return e?v(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){let e=this._projectedGeometry;return e?d(()=>{let t=e.clone();return _e(this.view.elevationProvider,t),t}):null}get targetGeometry(){let{elevationAlignedGeometry:e}=this;if(!e)return null;let t=this.analysis.measureType,{effectiveTargetElevation:n}=this.viewData;if(t===`stockpile`||n==null)return e;let r=e.clone();return r.rings.forEach(e=>e.forEach(e=>e[2]=n)),r}get _targetGeometryRenderInfo(){let e=this.targetGeometry,t=this._localOrigin;if(!e||!t)return null;let{elevationProvider:n,renderCoordsHelper:r}=this.view,i=B(e,n,r,L.fromElevationInfo(new O({mode:`absolute-height`})));if(a(i))return this._updatingHandles.consumePromise(i),null;if(i==null)return null;let{positions:o,polygonIndices:s,vertexCount:c}=i,l=E(c*3),u=f(),d=f();return ue(e.spatialReference,t,u,r.spatialReference),d[12]=-u[12],d[13]=-u[13],d[14]=-u[14],D(l,o,d),new me(l,s)}get updating(){return this._computation.updating||this._updatingHandles.updating}get result(){let e=this._rawResult,{volume:t,area:n,length:r}=this.viewData.effectiveDisplayUnits;return e&&!this.error?new I({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:n,lengthUnit:r}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>ge(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new j}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){let{spatialReference:e,state:{isLocal:n}}=this.view;if(!n||!e.isWebMercator)return null;let r=this._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return r!=null&&r>i?new M:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;let e=this._perimeterForError,{maxPerimeterGlobal:n}=t;return e!=null&&e>n?new M:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new N:null}get _unsupportedLayerTransparencyError(){let e=this.view.map.ground&&this.view.map.ground.opacity<1,t=this._intersectingObbsByLayerView.size>0;return this._intersectingObbsByLayerView.keys().some(e=>e.fullOpacity<1)||e&&!t?new P:null}get _perimeterForError(){let e=this._projectedGeometry;if(e==null)return null;let t=null;for(let n of e.rings){if(!T(n))continue;let e=ye(be(n));t=e?Math.max(t??0,e):t}return t==null?null:t*e.spatialReference.metersPerUnit}_createElevationUpdateHandle(){let e=e=>{let t=this._projectedGeometry?.extent;e.context===`ground`&&t&&(de(e.extent,e.spatialReference,G,this.view.spatialReference),S(t,K),C(G,K)&&this.notifyChange(`elevationAlignedGeometry`))};return this.view.elevationProvider.on(`elevation-change`,t=>e(t))}_updateResult(e,t,n){if(!t)return;let{unitInMeters:r}=this.view.renderCoordsHelper,{dimensions:{width:i,height:a},cameraNearFar:{near:s,far:c}}=e,l=i/t.width*(a/t.height),u=U(t.cut.totalDepth,s,c)*l,d=U(t.fill.totalDepth,s,c)*l,f=r**3;this._rawResult=new F({cutVolume:o(Math.abs(u*f),`cubic-meters`),fillVolume:o(d*f,`cubic-meters`),area:n?.area,perimeter:n?.length})}_updateDepthExtremaPositions(e,t){if(!t)return;let{dimensions:{width:n,height:r},cameraNearFar:{near:i,far:a},cameraPositionRenderSpace:o,northVector:s,eastVector:c,upVector:l}=e,u=e=>{let{depthExtremum:u,depthExtremumCoords:[d,f],totalDepth:p}=e,m=ie(o);return p!==0&&(g(m,m,c,n*(d/t.width-.5)),g(m,m,s,r*(f/t.height-.5))),g(m,m,l,-U(u,i,a)),m},d={cut:u(t.cut),fill:u(t.fill)};this.depthExtremaPositions=d,this.analysisObb=ve(e,d)}_findIntersectingObbs(e,t){let n=[];e.type===`integrated-mesh-3d`&&e.getVisibleNodes().forEach(r=>{e.isNodeLoaded(r.index)&&r.geometryObbInRenderSR?.intersectsFrustum(t)&&n.push(r.geometryObbInRenderSR)}),e.type===`integrated-mesh-3dtiles`&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&n.push(e)}),n.length>0&&this._intersectingObbsByLayerView.set(e,n)}_sufficientIntegratedMeshCoverage(e,t){let{renderCoordsHelper:n,spatialReference:r}=this.view,i=[],a=new oe({spatialReference:r});if(this._intersectingObbsByLayerView.forEach(e=>{e.forEach(e=>{if(W(e.radius,t)&&(e.getCorners($),a.points.length=0,$.forEach(e=>{let t=n.fromRenderCoords(e,Se,r);t&&a.addPoint([t[0],t[1]])}),a.points.length)){let e=se(a);e?.type===`polygon`&&i.push(e)}})}),!i.length)return!1;let o=le(i);return!!o&&b(o,e)}_findIntersectingTerrainTiles(e){let{basemapTerrain:t}=this.view;this._intersectingTiles.length=0,S(e,q);let n=this._tileIterator;n.reset(t.rootTiles);for(let e=n.next();e;e=n.next())e.intersectsExtent(q)?e.rendered&&this._intersectingTiles.push(e):n.skipSubtree()}_sufficientTerrainCoverage(e){let{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;let n=256/t.pixelSize;return this._intersectingTiles.every(t=>W(t.radius*n,e))}};e([l()],H.prototype,`_projectedGeometry`,null),e([l()],H.prototype,`_localOrigin`,null),e([l()],H.prototype,`elevationAlignedGeometry`,null),e([l()],H.prototype,`targetGeometry`,null),e([l()],H.prototype,`_targetGeometryRenderInfo`,null),e([l({constructOnly:!0})],H.prototype,`analysis`,void 0),e([l({constructOnly:!0})],H.prototype,`viewData`,void 0),e([l({constructOnly:!0})],H.prototype,`view`,void 0),e([l()],H.prototype,`updating`,null),e([l()],H.prototype,`result`,null),e([l()],H.prototype,`depthExtremaPositions`,void 0),e([l()],H.prototype,`analysisObb`,void 0),e([l()],H.prototype,`error`,null),e([l()],H.prototype,`_imLayerViewsAffectingMeasurement`,null),e([l()],H.prototype,`_insufficientDataError`,null),e([l()],H.prototype,`_perimeterTooLargeError`,null),e([l()],H.prototype,`_perimeterTooLargeLocalError`,null),e([l()],H.prototype,`_perimeterTooLargeGlobalError`,null),e([l()],H.prototype,`_unsupportedCoordinateSystemError`,null),e([l()],H.prototype,`_unsupportedLayerTransparencyError`,null),e([l()],H.prototype,`_perimeterForError`,null),e([l()],H.prototype,`_computation`,void 0),e([l({readOnly:!0})],H.prototype,`_updatingHandles`,void 0),e([l()],H.prototype,`_rawResult`,void 0),e([l()],H.prototype,`_sufficientDataCoverage`,void 0),H=e([u(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementController`)],H);function _e(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=R(e,t,`ground`)??0))}function U(e,t,n){return e*(n-t)+t}function ve(e,t){let{boundingRect:n,eastVector:r,northVector:i,upVector:a}=e;w(t.cut,r,i,a,J),w(t.fill,r,i,a,Y);let o=(n[0]+n[2])*.5,s=(n[1]+n[3])*.5,c=Math.min(J[2],Y[2]),l=Math.max(J[2],Y[2]),u=(c+l)*.5;return te(X,r,o),g(X,X,i,s),g(X,X,a,u),ne(Z,(n[2]-n[0])*.5,(n[3]-n[1])*.5,(l-c)*.5),re(Q,a),new z(X,Z,p(xe,Q,r,i))}function ye(e){if(!e)return null;let t=null,n=null,r=0;for(let i of e)t||=[i[0],i[1]],n?r+=h(n,i):n=[0,0],n[0]=i[0],n[1]=i[1];return t&&n&&(r+=h(n,t)),Math.sqrt(r)}function*be(e){let t=ee();for(let n=0;n<e.length;n++)t[0]=e[n][0],t[1]=e[n][1],yield t}const W=(e,t)=>e<(t.width+t.height)/2,G=x(),K=x(),q=fe(),J=_(),Y=_(),X=_(),Z=_(),Q=_(),xe=m(),$=Array(8).fill(0).map(()=>_()),Se=_();export{H as VolumeMeasurementController};
|
|
2
|
+
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import n from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{debounce as i,isPromiseLike as a}from"../../../../core/promiseUtils.js";import{createVolume as o}from"../../../../core/quantity.js";import s from"../../../../core/ReactiveMap.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{runUntracked as d}from"../../../../core/accessorSupport/tracking.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxes as p}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as ee}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as g,scale as te,set as ne,negate as re}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v,clone as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import x from"../../../../geometry/Multipoint.js";import{projectOrLoad as ie}from"../../../../geometry/projectionUtils.js";import{containsExecute as ae}from"../../../../geometry/operators/containsOperator.js";import{convexHullExecute as oe}from"../../../../geometry/operators/convexHullOperator.js";import{simplifyExecute as se}from"../../../../geometry/operators/simplifyOperator.js";import{unionExecuteMany as ce}from"../../../../geometry/operators/unionOperator.js";import{computeTranslationToOriginAndRotation as le}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as S,fromExtent as C}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as w}from"../../../../geometry/support/coordinateSystem.js";import{isClockwise as T}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as E}from"../../../../geometry/support/DoubleArray.js";import{t as D}from"../../../../chunks/vec3.js";import O from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as k}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as A}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as j,VolumeMeasurementPerimeterTooLargeError as M,VolumeMeasurementUnsupportedCoordinateSystemError as N,VolumeMeasurementUnsupportedLayerTransparencyError as P}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as F}from"./VolumeMeasurementRawResult.js";import I from"./VolumeMeasurementResult.js";import{ElevationContext as L}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as R}from"../../support/ElevationProvider.js";import{createElevationUpdateHandle as z}from"../../support/elevationUpdateUtils.js";import{Obb as B}from"../../support/orientedBoundingBox.js";import{polygonToRenderInfoElevationAligned as ue}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as V}from"../../terrain/tileUtils.js";import{CutFillComputation as H,TargetGeometryRenderInfo as U}from"../../webgl-engine/lib/CutFillComputation.js";import{GeometryWorkerHandle as de}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as fe}from"../../../support/layerViewUtils.js";let W=class extends n{constructor(e){super(e),this._measurementWorkerHandle=new de,this.depthExtremaPositions=null,this.analysisObb=null,this._updatingHandles=new b,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new V,this._intersectingObbsByLayerView=new s,this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,n,r)=>{if(!this._computation.done)return;let{renderCoordsHelper:i}=this.view,a=new A({extent:t,localOrigin:n,renderCoordsHelper:i});this._computation.update(a,r),this._determineDataCoverage(a,e);let[o]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),c(()=>this._computation.done).then(()=>{this._updateDepthExtremaPositions(a,this._computation.result)})]);if(this.error){this._rawResult=null;return}let s=this._computation.result;this._updateResult(a,s,o.status===`fulfilled`?o.value:null)}),this._determineDataCoverage=(e,t)=>{let{frustum:n}=this._computation,{cameraDimensions:r}=e;t.extent&&n&&(this._intersectingObbsByLayerView.clear(),this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,n)}),this._intersectingObbsByLayerView.size>0?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,r):(this._findIntersectingTerrainTiles(t.extent),this._sufficientDataCoverage=this._sufficientTerrainCoverage(r)))}}initialize(){let e=this.view;this._computation=new H({view:e}),this.addHandles([z({view:e,geometry:()=>this._projectedGeometry,context:`ground`,onElevationChanges:()=>this.notifyChange(`elevationAlignedGeometry`)}),this._updatingHandles.add(()=>({localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo}),({localOrigin:e,targetGeometryRenderInfo:t})=>{let n=this._projectedGeometry,r=n?.extent;!n||!r||!e||!t?(this._rawResult=null,this.depthExtremaPositions=null,this.analysisObb=null,this._sufficientDataCoverage=!0):this._updatingHandles.consumePromise(this._debouncedUpdate(n,r,e,t))})])}destroy(){this._updatingHandles.destroy(),this._computation.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){let e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;let t=se(e),n=ie(t,this.view.spatialReference);return n.pending?(this._updatingHandles.consumePromise(n.pending),null):(t&&!n.geometry&&k(this.analysis,e.spatialReference,r.getLogger(this)),n.geometry)}get _localOrigin(){let e=this._projectedGeometry?.extent;return e?v(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){let e=this._projectedGeometry;return e?d(()=>{let t=e.clone();return pe(this.view.elevationProvider,t),t}):null}get targetGeometry(){let{elevationAlignedGeometry:e}=this;if(!e)return null;let t=this.analysis.measureType,{effectiveTargetElevation:n}=this.viewData;if(t===`stockpile`||n==null)return e;let r=e.clone();return r.rings.forEach(e=>e.forEach(e=>e[2]=n)),r}get _targetGeometryRenderInfo(){let e=this.targetGeometry,t=this._localOrigin;if(!e||!t)return null;let{elevationProvider:n,renderCoordsHelper:r}=this.view,i=ue(e,n,r,L.fromElevationInfo(new O({mode:`absolute-height`})));if(a(i))return this._updatingHandles.consumePromise(i),null;if(i==null)return null;let{positions:o,polygonIndices:s,vertexCount:c}=i,l=E(c*3),u=f(),d=f();return le(e.spatialReference,t,u,r.spatialReference),d[12]=-u[12],d[13]=-u[13],d[14]=-u[14],D(l,o,d),new U(l,s)}get updating(){return this._computation.updating||this._updatingHandles.updating}get result(){let e=this._rawResult,{volume:t,area:n,length:r}=this.viewData.effectiveDisplayUnits;return e&&!this.error?new I({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:n,lengthUnit:r}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>fe(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new j}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){let{spatialReference:e,state:{isLocal:n}}=this.view;if(!n||!e.isWebMercator)return null;let r=this._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return r!=null&&r>i?new M:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;let e=this._perimeterForError,{maxPerimeterGlobal:n}=t;return e!=null&&e>n?new M:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new N:null}get _unsupportedLayerTransparencyError(){let e=this.view.map.ground&&this.view.map.ground.opacity<1,t=this._intersectingObbsByLayerView.size>0;return this._intersectingObbsByLayerView.keys().some(e=>e.fullOpacity<1)||e&&!t?new P:null}get _perimeterForError(){let e=this._projectedGeometry;if(e==null)return null;let t=null;for(let n of e.rings){if(!T(n))continue;let e=he(ge(n));t=e?Math.max(t??0,e):t}return t==null?null:t*e.spatialReference.metersPerUnit}_updateResult(e,t,n){if(!t)return;let{unitInMeters:r}=this.view.renderCoordsHelper,{dimensions:{width:i,height:a},cameraNearFar:{near:s,far:c}}=e,l=i/t.width*(a/t.height),u=G(t.cut.totalDepth,s,c)*l,d=G(t.fill.totalDepth,s,c)*l,f=r**3;this._rawResult=new F({cutVolume:o(Math.abs(u*f),`cubic-meters`),fillVolume:o(d*f,`cubic-meters`),area:n?.area,perimeter:n?.length})}_updateDepthExtremaPositions(e,t){if(!t)return;let{dimensions:{width:n,height:r},cameraNearFar:{near:i,far:a},cameraPositionRenderSpace:o,northVector:s,eastVector:c,upVector:l}=e,u=e=>{let{depthExtremum:u,depthExtremumCoords:[d,f],totalDepth:p}=e,m=y(o);return p!==0&&(g(m,m,c,n*(d/t.width-.5)),g(m,m,s,r*(f/t.height-.5))),g(m,m,l,-G(u,i,a)),m},d={cut:u(t.cut),fill:u(t.fill)};this.depthExtremaPositions=d,this.analysisObb=me(e,d)}_findIntersectingObbs(e,t){let n=[];e.type===`integrated-mesh-3d`&&e.getVisibleNodes().forEach(r=>{e.isNodeLoaded(r.index)&&r.geometryObbInRenderSR?.intersectsFrustum(t)&&n.push(r.geometryObbInRenderSR)}),e.type===`integrated-mesh-3dtiles`&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&n.push(e)}),n.length>0&&this._intersectingObbsByLayerView.set(e,n)}_sufficientIntegratedMeshCoverage(e,t){let{renderCoordsHelper:n,spatialReference:r}=this.view,i=[],a=new x({spatialReference:r});if(this._intersectingObbsByLayerView.forEach(e=>{e.forEach(e=>{if(K(e.radius,t)&&(e.getCorners($),a.points.length=0,$.forEach(e=>{let t=n.fromRenderCoords(e,ve,r);t&&a.addPoint([t[0],t[1]])}),a.points.length)){let e=oe(a);e?.type===`polygon`&&i.push(e)}})}),!i.length)return!1;let o=ce(i);return!!o&&ae(o,e)}_findIntersectingTerrainTiles(e){let{basemapTerrain:t}=this.view;this._intersectingTiles.length=0,C(e,q);let n=this._tileIterator;n.reset(t.rootTiles);for(let e=n.next();e;e=n.next())e.intersectsExtent(q)?e.rendered&&this._intersectingTiles.push(e):n.skipSubtree()}_sufficientTerrainCoverage(e){let{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;let n=256/t.pixelSize;return this._intersectingTiles.every(t=>K(t.radius*n,e))}};e([l()],W.prototype,`_projectedGeometry`,null),e([l()],W.prototype,`_localOrigin`,null),e([l()],W.prototype,`elevationAlignedGeometry`,null),e([l()],W.prototype,`targetGeometry`,null),e([l()],W.prototype,`_targetGeometryRenderInfo`,null),e([l({constructOnly:!0})],W.prototype,`analysis`,void 0),e([l({constructOnly:!0})],W.prototype,`viewData`,void 0),e([l({constructOnly:!0})],W.prototype,`view`,void 0),e([l()],W.prototype,`updating`,null),e([l()],W.prototype,`result`,null),e([l()],W.prototype,`depthExtremaPositions`,void 0),e([l()],W.prototype,`analysisObb`,void 0),e([l()],W.prototype,`error`,null),e([l()],W.prototype,`_imLayerViewsAffectingMeasurement`,null),e([l()],W.prototype,`_insufficientDataError`,null),e([l()],W.prototype,`_perimeterTooLargeError`,null),e([l()],W.prototype,`_perimeterTooLargeLocalError`,null),e([l()],W.prototype,`_perimeterTooLargeGlobalError`,null),e([l()],W.prototype,`_unsupportedCoordinateSystemError`,null),e([l()],W.prototype,`_unsupportedLayerTransparencyError`,null),e([l()],W.prototype,`_perimeterForError`,null),e([l()],W.prototype,`_computation`,void 0),e([l({readOnly:!0})],W.prototype,`_updatingHandles`,void 0),e([l()],W.prototype,`_rawResult`,void 0),e([l()],W.prototype,`_sufficientDataCoverage`,void 0),W=e([u(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementController`)],W);function pe(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=R(e,t,`ground`)??0))}function G(e,t,n){return e*(n-t)+t}function me(e,t){let{boundingRect:n,eastVector:r,northVector:i,upVector:a}=e;w(t.cut,r,i,a,J),w(t.fill,r,i,a,Y);let o=(n[0]+n[2])*.5,s=(n[1]+n[3])*.5,c=Math.min(J[2],Y[2]),l=Math.max(J[2],Y[2]),u=(c+l)*.5;return te(X,r,o),g(X,X,i,s),g(X,X,a,u),ne(Z,(n[2]-n[0])*.5,(n[3]-n[1])*.5,(l-c)*.5),re(Q,a),new B(X,Z,p(_e,Q,r,i))}function he(e){if(!e)return null;let t=null,n=null,r=0;for(let i of e)t||=[i[0],i[1]],n?r+=h(n,i):n=[0,0],n[0]=i[0],n[1]=i[1];return t&&n&&(r+=h(n,t)),Math.sqrt(r)}function*ge(e){let t=ee();for(let n=0;n<e.length;n++)t[0]=e[n][0],t[1]=e[n][1],yield t}const K=(e,t)=>e<(t.width+t.height)/2,q=S(),J=_(),Y=_(),X=_(),Z=_(),Q=_(),_e=m(),$=Array(8).fill(0).map(()=>_()),ve=_();export{W as VolumeMeasurementController};
|
|
@@ -2,7 +2,7 @@ import type WebSceneSunLighting from "../../../webscene/SunLighting.js";
|
|
|
2
2
|
import type { EventedMixin } from "../../../core/Evented.js";
|
|
3
3
|
import type { SunLightingProperties as WebSceneSunLightingProperties } from "../../../webscene/SunLighting.js";
|
|
4
4
|
|
|
5
|
-
export interface SunLightingProperties extends WebSceneSunLightingProperties, Partial<Pick<SunLighting, "cameraTrackingEnabled">> {
|
|
5
|
+
export interface SunLightingProperties extends WebSceneSunLightingProperties, Partial<Pick<SunLighting, "cameraTrackingEnabled" | "globalIllumination">> {
|
|
6
6
|
/**
|
|
7
7
|
* The current date and time of the simulated sun. When setting the date, specifying the time zone is important,
|
|
8
8
|
* otherwise the time zone of the browser will be used. This might lead to different lighting for users in different
|
|
@@ -63,6 +63,21 @@ export default class SunLighting extends SunLightingSuperclass {
|
|
|
63
63
|
*/
|
|
64
64
|
get date(): Date;
|
|
65
65
|
set date(value: (Date | number | string));
|
|
66
|
+
/**
|
|
67
|
+
* Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
|
|
68
|
+
* surfaces, while areas where surrounding objects block ambient light receive more natural shading.
|
|
69
|
+
*
|
|
70
|
+
* **Known limitations**
|
|
71
|
+
*
|
|
72
|
+
* - Is not supported with [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/).
|
|
73
|
+
* - Is disabled at high camera altitudes.
|
|
74
|
+
* - May produce temporarily noisy lighting after camera or scene changes.
|
|
75
|
+
* - May reduce rendering performance.
|
|
76
|
+
*
|
|
77
|
+
* @beta
|
|
78
|
+
* @since 5.2
|
|
79
|
+
*/
|
|
80
|
+
accessor globalIllumination: boolean;
|
|
66
81
|
/** Indicates that the light source is simulated position of the sun. */
|
|
67
82
|
get type(): "sun";
|
|
68
83
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/SunLighting.js";var a;let o=a=class extends t(i){static calculateTimezoneOffset({hours:e,minutes:t,seconds:n}){return Math.round(e+t/60+n/3600)}constructor(e){super(e),this.cameraTrackingEnabled=!0,this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0},this.type=`sun`;let t=new Date().getFullYear(),n=new Date(`March 15, `+t+` 12:00:00 UTC`);this._set(`defaultDate`,n),this._set(`date`,n)}get defaultDate(){return new Date(this._get(`defaultDate`))}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}set defaultDate(e){let t=this._get(`date`)===this._get(`defaultDate`);e=new Date(e),this._set(`defaultDate`,e),t&&this._set(`date`,e)}set date(e){e!=null&&(this.positionTimezoneInfo.autoUpdated=!1,this._set(`date`,new Date(e)))}autoUpdate(e,t){let n=a.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=t.hours,this.positionTimezoneInfo.minutes=t.minutes,this.positionTimezoneInfo.seconds=t.seconds;let r=null;e!=null&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(e.getTime())?(r=this.defaultDate.getTime(),this._set(`date`,this.defaultDate)):(r=this.date&&this.date.getTime(),this._set(`date`,new Date(e))));let i=a.calculateTimezoneOffset(this.positionTimezoneInfo);if(n!==i&&(s.target=this,s.timezoneOffset=i,this.emit(`timezone-will-change`,s),s.target=null),e!=null)return isNaN(e.getTime())||r!==e.getTime()}clone(){let e=this._get(`date`)===this._get(`defaultDate`),t=new a({...this.cloneConstructProperties(),defaultDate:this.defaultDate
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import has from"../../../core/has.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/SunLighting.js";var a;let o=a=class extends t(i){static calculateTimezoneOffset({hours:e,minutes:t,seconds:n}){return Math.round(e+t/60+n/3600)}constructor(e){super(e),this.cameraTrackingEnabled=!0,this.globalIllumination=has(`enable-feature:global-illumination`)??!1,this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0},this.type=`sun`;let t=new Date().getFullYear(),n=new Date(`March 15, `+t+` 12:00:00 UTC`);this._set(`defaultDate`,n),this._set(`date`,n)}get defaultDate(){return new Date(this._get(`defaultDate`))}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}set defaultDate(e){let t=this._get(`date`)===this._get(`defaultDate`);e=new Date(e),this._set(`defaultDate`,e),t&&this._set(`date`,e)}set date(e){e!=null&&(this.positionTimezoneInfo.autoUpdated=!1,this._set(`date`,new Date(e)))}autoUpdate(e,t){let n=a.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=t.hours,this.positionTimezoneInfo.minutes=t.minutes,this.positionTimezoneInfo.seconds=t.seconds;let r=null;e!=null&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(e.getTime())?(r=this.defaultDate.getTime(),this._set(`date`,this.defaultDate)):(r=this.date&&this.date.getTime(),this._set(`date`,new Date(e))));let i=a.calculateTimezoneOffset(this.positionTimezoneInfo);if(n!==i&&(s.target=this,s.timezoneOffset=i,this.emit(`timezone-will-change`,s),s.target=null),e!=null)return isNaN(e.getTime())||r!==e.getTime()}clone(){let e=this._get(`date`)===this._get(`defaultDate`),t=new a({...this.cloneConstructProperties(),...this.cloneNonPersistentConstructProperties(),defaultDate:this.defaultDate});return e&&t._set(`date`,t._get(`defaultDate`)),t.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated,t.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours,t.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes,t.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds,t}cloneWithWebsceneLighting(e){let t=this.clone();return e.date!=null&&(t.date=e.date),t.directShadowsEnabled=e.directShadowsEnabled,t.glow=e.glow?.clone(),t.displayUTCOffset=e.displayUTCOffset,t}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled,globalIllumination:this.globalIllumination}}};e([n({type:Boolean})],o.prototype,`cameraTrackingEnabled`,void 0),e([n({type:Boolean})],o.prototype,`globalIllumination`,void 0),e([n({type:Date})],o.prototype,`defaultDate`,null),e([n({type:Date})],o.prototype,`date`,null),e([n({readOnly:!0,type:[`sun`],json:{write:!0}})],o.prototype,`type`,void 0),o=a=e([r(`esri.views.3d.environment.SunLighting`)],o);const s={target:null,timezoneOffset:0},c=o;export{c as default};
|
|
@@ -2,7 +2,7 @@ import type WebSceneVirtualLighting from "../../../webscene/VirtualLighting.js";
|
|
|
2
2
|
import type { EventedMixin } from "../../../core/Evented.js";
|
|
3
3
|
import type { VirtualLightingProperties as WebSceneVirtualLightingProperties } from "../../../webscene/VirtualLighting.js";
|
|
4
4
|
|
|
5
|
-
export interface VirtualLightingProperties extends WebSceneVirtualLightingProperties {}
|
|
5
|
+
export interface VirtualLightingProperties extends WebSceneVirtualLightingProperties, Partial<Pick<VirtualLighting, "globalIllumination">> {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The VirtualLighting class allows you to change the lighting in the scene to virtual light. The position of the light
|
|
@@ -41,6 +41,21 @@ export interface VirtualLightingProperties extends WebSceneVirtualLightingProper
|
|
|
41
41
|
*/
|
|
42
42
|
export default class VirtualLighting extends VirtualLightingSuperclass {
|
|
43
43
|
constructor(properties?: VirtualLightingProperties);
|
|
44
|
+
/**
|
|
45
|
+
* Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
|
|
46
|
+
* surfaces, while areas where surrounding objects block ambient light receive more natural shading.
|
|
47
|
+
*
|
|
48
|
+
* **Known limitations**
|
|
49
|
+
*
|
|
50
|
+
* - Is not supported with [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/).
|
|
51
|
+
* - Is disabled at high camera altitudes.
|
|
52
|
+
* - May produce temporarily noisy lighting after camera or scene changes.
|
|
53
|
+
* - May reduce rendering performance.
|
|
54
|
+
*
|
|
55
|
+
* @beta
|
|
56
|
+
* @since 5.2
|
|
57
|
+
*/
|
|
58
|
+
accessor globalIllumination: boolean;
|
|
44
59
|
/**
|
|
45
60
|
* Indicates that the light source is virtual light. Virtual light is top - right position respect to the camera
|
|
46
61
|
* enabling user to observe the scene independant to the possition of the sun.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/VirtualLighting.js";var a;let o=a=class extends t(i){constructor(e){super(e),this.cameraTrackingEnabled=!0,this.type=`virtual`}clone(){return new a({...this.cloneConstructProperties()
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import has from"../../../core/has.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/VirtualLighting.js";var a;let o=a=class extends t(i){constructor(e){super(e),this.cameraTrackingEnabled=!0,this.globalIllumination=has(`enable-feature:global-illumination`)??!1,this.type=`virtual`}clone(){return new a({...this.cloneConstructProperties(),...this.cloneNonPersistentConstructProperties()})}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}cloneWithWebsceneLighting(e){let t=this.clone();return t.directShadowsEnabled=e.directShadowsEnabled,t.glow=e.glow?.clone(),t}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled,globalIllumination:this.globalIllumination}}};e([n({type:Boolean})],o.prototype,`cameraTrackingEnabled`,void 0),e([n({type:Boolean})],o.prototype,`globalIllumination`,void 0),e([n({readOnly:!0,type:[`virtual`],json:{write:{isRequired:!0}}})],o.prototype,`type`,void 0),o=a=e([r(`esri.views.3d.environment.VirtualLighting`)],o);const s=o;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{clock as e}from"../../../../../core/clock.js";import{removeMaybe as t}from"../../../../../core/maybe.js";import{ignoreAbortErrors as n}from"../../../../../core/promiseUtils.js";import{createScreenPointArray as r}from"../../../../../core/screenUtils.js";import{copy as i,subtract as a,add as o,distance as s}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../../../geometry/ellipsoidUtils.js";import{fromRenderCamera as u}from"../../../webgl.js";import{shortenTranslation as d}from"../../../state/utils/groundNavigationUtils.js";import{pickPointAndInitSphere as f}from"../../../state/utils/navigationUtils.js";import{OffsetCorrectionController as p}from"../../../state/utils/OffsetCorrectionController.js";import m from"../../../webgl/RenderCamera.js";import{InputHandler as h}from"../../../../input/InputHandler.js";import{eventMatchesPointerAction as g}from"../../../../input/handlers/support.js";class _ extends h{constructor(e,t){super(!0),this._view=e,this._tmpTranslation=c(),this._tmpTargetLocation=c(),this._tmpCenterOffset=c(),this._errorCursorHandle=null,this._errorTimeout=null,this.registerIncoming(`double-click`,t,e=>this._handleDoubleClick(e)),this._offsetCorrectionController=new p(this._view)}_handleDoubleClick(e){if(this._view.navigation.mode.type!==`ground`)return;let{data:t}=e;g(t,`primary`)&&(this._move(e),e.stopPropagation())}_move(e){let t=this._view.navigation.mode;if(t.type!==`ground`)return;let c=this._view.state.camera,p=new m().copyFrom(c),h=r(e.data.x,e.data.y);if(this._view.state.isGlobal){let e=f(this._view,this._view.state.camera,h,l(this._view.spatialReference).radius,1,{include:t.include,exclude:t.exclude});if(e.scenePickPoint==null||!e.hasGeometryIntersection){this._showErrorCursor();return}i(this._tmpTargetLocation,e.scenePickPoint)}else if(!this._view.sceneIntersectionHelper.intersectScreenFreePointFallback(h,this._tmpTargetLocation,{include:t.include,exclude:t.exclude})){this._showErrorCursor();return}a(this._tmpTranslation,this._tmpTargetLocation,c.eye),d(this._tmpTranslation,this._tmpTranslation,.99,2),o(this._tmpTargetLocation,c.eye,this._tmpTranslation),a(this._tmpCenterOffset,p.center,p.eye),p.eye=this._tmpTargetLocation,p.center=o(this._tmpCenterOffset,this._tmpTargetLocation,this._tmpCenterOffset),this._offsetCorrectionController.immediatelyCorrectGroundElevation({camera:p,correctionLimit:1e3}),n(this._view.goTo(u(this._view,p),{liftOffDisabled:!0,duration:500*Math.max(1,Math.sqrt(s(p.eye,this._view.state.camera.eye)/100))}))}onUninstall(){this._errorTimeout=t(this._errorTimeout),this._errorCursorHandle=t(this._errorCursorHandle),super.onUninstall()}_showErrorCursor(){this._errorTimeout=t(this._errorTimeout),this._errorCursorHandle=t(this._errorCursorHandle),this._errorCursorHandle=this._view.acquireCursor(`not-allowed`,`high`),this._errorTimeout=e.setTimeout(()=>{this._errorCursorHandle=t(this._errorCursorHandle),this._errorTimeout=null},500)}}export{_ as GroundDoubleClickMove};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../Camera.js";import{clock as n}from"../../../../core/clock.js";import r from"../../../../core/Logger.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../Camera.js";import{clock as n}from"../../../../core/clock.js";import r from"../../../../core/Logger.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{removeMaybe as a}from"../../../../core/maybe.js";import{onAbort as o}from"../../../../core/promiseUtils.js";import{createScreenPointArray as s}from"../../../../core/screenUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{subtract as u,add as d,copy as f,cross as p,normalize as m,scale as h,dot as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import{shortenTranslation as y}from"../../state/utils/groundNavigationUtils.js";import{OffsetCorrectionController as b}from"../../state/utils/OffsetCorrectionController.js";import x from"../../webgl/RenderCamera.js";import{InteractiveToolBase as S}from"../../../interactive/InteractiveToolBase.js";let C=class extends S{constructor(e){super(e),this.isGroundNavigationPlacementTool=!0,this._internalAbortController=new AbortController,this._tmpMouseDirection=_(),this._tmpWorldUp=_(),this._tmpHorizontalForward=_(),this._tmpTranslation=_(),this._tmpScratchVector=_(),this._hasErrorCursor=!1,this._errorTimeout=null}initialize(){this.signal&&this.addHandles([o(this.signal,()=>{this.cancel(),this.active&&(this.view.activeTool=null)})]),this.finishToolCreation()}cancel(){super.cancel(),this._internalAbortController?.abort()}onDeactivate(){this.emit(`cancel`)}get cursor(){return this.active?this._hasErrorCursor?`not-allowed`:`crosshair`:null}async onInputEvent(e){if(!this.active||e.type!==`immediate-click`)return;e.stopPropagation();let n=this.view.state.camera,i=this.view.sceneIntersectionHelper,a=_();if(!i.intersectScreen(s(e.x,e.y),a,{include:this.groundMode?.include,exclude:this.groundMode?.exclude})){r.getLogger(this).warn(`The clicked location did not produce a valid target. Try again by clicking in a different location.`),this._showErrorCursor();return}if(u(this._tmpTranslation,a,n.eye),y(this._tmpTranslation,this._tmpTranslation,.999,.5),d(a,n.eye,this._tmpTranslation),this.groundMode?.offset){let e=new x().copyFrom(n);e.eye=a,new b(this.view).immediatelyCorrectGroundElevation({camera:e,navigationModeOverride:this.groundMode}),f(a,e.eye)}let o=this.cameraTurningEnabled?this._computeHeadingOffset(n,a):0,c=this.view.renderCoordsHelper.fromRenderCoords(a,new v({spatialReference:this.view.spatialReference})),l=new t({position:c,heading:this.view.camera.heading+o,tilt:85});this.emit(`success`,l),this.view.activeTool=null}_computeHeadingOffset(e,t){let n=this.view.renderCoordsHelper.worldUpAtPosition(t,this._tmpWorldUp),r=p(this._tmpHorizontalForward,n,e.viewRight);u(this._tmpMouseDirection,t,e.eye),m(this._tmpMouseDirection,this._tmpMouseDirection),u(this._tmpMouseDirection,this._tmpMouseDirection,h(this._tmpScratchVector,n,g(n,this._tmpMouseDirection))),m(this._tmpMouseDirection,this._tmpMouseDirection);let a=p(_(),this._tmpMouseDirection,r),o=Math.sign(g(a,n)),s=Math.acos(g(this._tmpMouseDirection,r));return o*i(s)}_showErrorCursor(){this._hasErrorCursor=!0,this._errorTimeout=a(this._errorTimeout),this._errorTimeout=n.setTimeout(()=>{this._hasErrorCursor=!1,this._errorTimeout=null},500)}};e([c({constructOnly:!0})],C.prototype,`view`,void 0),e([c({constructOnly:!0})],C.prototype,`signal`,void 0),e([c({constructOnly:!0})],C.prototype,`cameraTurningEnabled`,void 0),e([c({constructOnly:!0})],C.prototype,`groundMode`,void 0),e([c()],C.prototype,`_hasErrorCursor`,void 0),e([c({readOnly:!0})],C.prototype,`cursor`,null),C=e([l(`esri.views.3d.interactive.placementTools.GroundNavigationPlacementTool3D`)],C);export{C as GroundNavigationPlacementTool3D};
|