@arcgis/core 4.34.0-next.85 → 4.34.0-next.87
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/Basemap.js +1 -1
- package/Ground.js +1 -1
- package/Map.js +1 -1
- package/analysis/ElevationProfile/ElevationProfileLineGround.d.ts +4 -0
- package/analysis/ElevationProfile/{ElevationProfileGroundLine.js → ElevationProfileLineGround.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileLineInput.d.ts +4 -0
- package/analysis/ElevationProfile/{ElevationProfileInputLine.js → ElevationProfileLineInput.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +4 -0
- package/analysis/ElevationProfile/{ElevationProfileQueryLine.js → ElevationProfileLineQuery.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileLineScene.d.ts +4 -0
- package/analysis/ElevationProfile/{ElevationProfileSceneLine.js → ElevationProfileLineScene.js} +1 -1
- package/analysis/ElevationProfile/elevationProfileLineTypes.js +1 -1
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/arcade/functions/measures.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0074f1836d7ff69ff6ec.js +1 -0
- package/assets/esri/core/workers/chunks/03ef19f0753d68770444.js +1 -0
- package/assets/esri/core/workers/chunks/06c389283ee5b60573f2.js +1 -0
- package/assets/esri/core/workers/chunks/09c2004126f4a5242b85.js +1 -0
- package/assets/esri/core/workers/chunks/0b679d5a1bfdbd006d6e.js +1 -0
- package/assets/esri/core/workers/chunks/0f05425954578ac796ec.js +1 -0
- package/assets/esri/core/workers/chunks/109149c378aa4c5f8526.js +1 -0
- package/assets/esri/core/workers/chunks/143503f6eb270c4683f8.js +1 -0
- package/assets/esri/core/workers/chunks/177840d5f0076c0de46b.js +316 -0
- package/assets/esri/core/workers/chunks/1c1b0cc91fe9cb3fec61.js +1 -0
- package/assets/esri/core/workers/chunks/{9eb1bfcb9b05f2a36748.js → 1f2d13466c60a6b57717.js} +1 -1
- package/assets/esri/core/workers/chunks/1fc6311d4f0d27e88737.js +1 -0
- package/assets/esri/core/workers/chunks/257fd65786feb5951b90.js +1 -0
- package/assets/esri/core/workers/chunks/{7a23b127f551bf13ef54.js → 268f5b233640a9dbbf89.js} +2 -2
- package/assets/esri/core/workers/chunks/2896ada406074f754b00.js +1 -0
- package/assets/esri/core/workers/chunks/28d30be414e59eabd963.js +1 -0
- package/assets/esri/core/workers/chunks/29471e0b3f7296dee096.js +1 -0
- package/assets/esri/core/workers/chunks/{3192b68675ff2afcb1d6.js → 2d3ae187f8aa3495d4ae.js} +1 -1
- package/assets/esri/core/workers/chunks/2dc88379ee94fabdaf52.js +1 -0
- package/assets/esri/core/workers/chunks/336b54144afec0c7d396.js +2 -0
- package/assets/esri/core/workers/chunks/366db86914a63e6d0c68.js +1 -0
- package/assets/esri/core/workers/chunks/{d66cdb9bb494da19696b.js → 47e4f66c33bb697fbe6b.js} +2 -2
- package/assets/esri/core/workers/chunks/481c2b01e2fe92249698.js +1 -0
- package/assets/esri/core/workers/chunks/4840bd93d8fe15c7aefd.js +1 -0
- package/assets/esri/core/workers/chunks/4d4db6854aff7656f6e1.js +1 -0
- package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +1 -0
- package/assets/esri/core/workers/chunks/639d856cd217914dfe1f.js +1 -0
- package/assets/esri/core/workers/chunks/68f5a2d2666636c3f807.js +1 -0
- package/assets/esri/core/workers/chunks/7540b34e743a23e67729.js +1 -0
- package/assets/esri/core/workers/chunks/7be11a3ef1f49245089f.js +1 -0
- package/assets/esri/core/workers/chunks/819a8bc1f0a694017ee6.js +1 -0
- package/assets/esri/core/workers/chunks/{afb76f9d6abedef771df.js → 8380a092ffc8e92ede7a.js} +1 -1
- package/assets/esri/core/workers/chunks/8d63b42aea32ce2e5d09.js +1 -0
- package/assets/esri/core/workers/chunks/8de11aab65d91e7f1a4d.js +1 -0
- package/assets/esri/core/workers/chunks/9386a0ebff78b6303ed2.js +1 -0
- package/assets/esri/core/workers/chunks/{4d47187bc0821413492d.js → 95bae3c275f1483eb7ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{f8f85207b382c1ea038c.js → 97489bf16a1d327992b2.js} +3 -3
- package/assets/esri/core/workers/chunks/a2652d10bb0bc41c9a8d.js +1 -0
- package/assets/esri/core/workers/chunks/a845c68e76382a73da5e.js +1 -0
- package/assets/esri/core/workers/chunks/{9c64b78c5c9b35b31d98.js → aa78b69219d9a0ef1c54.js} +2 -2
- package/assets/esri/core/workers/chunks/b09b34f64a6bc2b49e0a.js +1 -0
- package/assets/esri/core/workers/chunks/b0a03b6edbcf6e933431.js +1 -0
- package/assets/esri/core/workers/chunks/{1859a11df9f579b993d7.js → b2fbb44e219232e61cbd.js} +1 -1
- package/assets/esri/core/workers/chunks/b4349db7155673329432.js +1 -0
- package/assets/esri/core/workers/chunks/b8997ae5893afa0298d1.js +1 -0
- package/assets/esri/core/workers/chunks/c0ae186620b68d43b338.js +1 -0
- package/assets/esri/core/workers/chunks/{d153b29c542c37ae1636.js → c50e8d5f554cf151865c.js} +2 -2
- package/assets/esri/core/workers/chunks/c5cc0fc652432a9264cc.js +1 -0
- package/assets/esri/core/workers/chunks/c6cae8471c5d4ae40c65.js +1 -0
- package/assets/esri/core/workers/chunks/cab2a1382bdd32bb34d8.js +1 -0
- package/assets/esri/core/workers/chunks/ce937ff0dd1147ea297e.js +1 -0
- package/assets/esri/core/workers/chunks/d142a42755a78bb157ed.js +1 -0
- package/assets/esri/core/workers/chunks/{280af3640f8e93c1024e.js → d6e0528eacee7ea4c1ce.js} +2 -2
- package/assets/esri/core/workers/chunks/d9d86cf0500fa29d1d43.js +1 -0
- package/assets/esri/core/workers/chunks/db5a985ccc6b7d0ad855.js +1 -0
- package/assets/esri/core/workers/chunks/f3ee035fa7bf638c8e60.js +1 -0
- package/assets/esri/core/workers/chunks/{b15ff6c9ef2de8a49853.js → f651c05604eab83aef5f.js} +2 -2
- package/assets/esri/core/workers/chunks/{ed773dab5965e42a2879.js → f6e18668f728dfd8ba5e.js} +2 -2
- package/assets/esri/core/workers/chunks/fc5ac54aab66562c8463.js +1 -0
- package/assets/esri/core/workers/chunks/ff8e2f998169ca3a7a68.js +1 -0
- package/assets/esri/libs/dracoMeshDecoder/draco_mesh_decoder.wasm +0 -0
- package/assets/esri/libs/i3s/i3s.wasm +0 -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/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis.json +1 -0
- package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
- package/chunks/CloudsComposition.glsl.js +2 -2
- package/chunks/HUDMaterial.glsl.js +49 -50
- package/chunks/LineMarker.glsl.js +34 -34
- package/chunks/PointRenderer.glsl.js +4 -4
- package/chunks/ShadowHighlight.glsl.js +3 -3
- package/chunks/draco_mesh_decoder.js +1 -1
- package/config.js +1 -1
- package/core/NestedMap.js +1 -1
- package/core/iteratorUtils.js +1 -1
- package/editing/geometry/lineUtils.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +188 -134
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/cypherUtils.js +1 -1
- package/layers/support/FieldConfiguration.js +1 -1
- package/layers/support/fieldConfigUtils.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/package.json +5 -5
- package/portal/schemas/definitions.js +1 -1
- package/support/basemapEnsureType.js +1 -1
- package/support/revision.js +1 -1
- package/support/userTypeGuards/isBasemap.js +5 -0
- package/symbols/support/previewSymbol2D.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/Processor.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/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
- package/views/2d/layers/features/schema/SourceSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +5 -0
- package/views/2d/layers/features/sources/strategies/AFeatureTileLoadStrategy.js +5 -0
- package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +5 -0
- package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +5 -0
- package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +5 -0
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/GroundView3D.js +5 -0
- package/views/3d/analysis/ElevationProfile/{ElevationProfileSceneLineComputation.js → ElevationProfileLineSceneComputation.js} +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/engineContent/marker.js +1 -1
- package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +11 -11
- package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/InstancedCommandVAO.js +5 -0
- package/views/3d/webgl-engine/materials/renderers/InstancedCommandVAOs.js +5 -0
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +14 -9
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +8 -8
- package/views/BasemapView.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/analysis/ElevationProfile/{ElevationProfileGroundLineComputation.js → ElevationProfileLineGroundComputation.js} +1 -1
- package/views/analysis/ElevationProfile/{ElevationProfileInputLineComputation.js → ElevationProfileLineInputComputation.js} +1 -1
- package/views/analysis/ElevationProfile/{ElevationProfileQueryLineComputation.js → ElevationProfileLineQueryComputation.js} +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/webgl/RenderbufferDescriptor.js +1 -1
- package/views/webgl/TextureDescriptor.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/VertexArrayObject.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/modelUploadUtils.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/support/splitFeatureUtils.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +2 -2
- package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +2 -2
- package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +2 -2
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/adapters/layer/GraphicsLayerAdapter.js +5 -0
- package/widgets/Sketch/adapters/layer/MapNotesLayerAdapter.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileGroundLine.d.ts +0 -4
- package/analysis/ElevationProfile/ElevationProfileInputLine.d.ts +0 -4
- package/analysis/ElevationProfile/ElevationProfileQueryLine.d.ts +0 -4
- package/analysis/ElevationProfile/ElevationProfileSceneLine.d.ts +0 -4
- package/assets/esri/core/workers/chunks/03e5d1a00d85e4d16bff.js +0 -1
- package/assets/esri/core/workers/chunks/0914a52fb33af5d77fab.js +0 -1
- package/assets/esri/core/workers/chunks/1d491447b13f2f2b4399.js +0 -1
- package/assets/esri/core/workers/chunks/20850b0fdb55fb17bc90.js +0 -1
- package/assets/esri/core/workers/chunks/25ea02dd7d45a90cbb3b.js +0 -1
- package/assets/esri/core/workers/chunks/264a9a916e1e972b69d7.js +0 -1
- package/assets/esri/core/workers/chunks/30c85a1a4f118cc45a25.js +0 -1
- package/assets/esri/core/workers/chunks/3ef8a7468d7e3b2f0b69.js +0 -351
- package/assets/esri/core/workers/chunks/486ea51306c619238e41.js +0 -1
- package/assets/esri/core/workers/chunks/49cb78c85de0102e5f02.js +0 -1
- package/assets/esri/core/workers/chunks/5610dfde4e636e2333a9.js +0 -1
- package/assets/esri/core/workers/chunks/5c1cdc2ec06c4c6bd0b3.js +0 -1
- package/assets/esri/core/workers/chunks/609abf071c4ea24955c2.js +0 -1
- package/assets/esri/core/workers/chunks/71c2a8e5a17803d3e949.js +0 -1
- package/assets/esri/core/workers/chunks/7402c2853f6aed8d1bc7.js +0 -1
- package/assets/esri/core/workers/chunks/7889a909394c61a9d3e0.js +0 -1
- package/assets/esri/core/workers/chunks/79a9f47dfa9ebabb5dbd.js +0 -1
- package/assets/esri/core/workers/chunks/86378d4f4d7f9a370c22.js +0 -1
- package/assets/esri/core/workers/chunks/99ac292a858bbedc6a89.js +0 -1
- package/assets/esri/core/workers/chunks/9a6fa91dd204f64d2590.js +0 -1
- package/assets/esri/core/workers/chunks/9cdeead9d444e8d95477.js +0 -1
- package/assets/esri/core/workers/chunks/aa1eb7b4d9ccda725da5.js +0 -1
- package/assets/esri/core/workers/chunks/b19d723d09f5bea9ca27.js +0 -1
- package/assets/esri/core/workers/chunks/b4a053063e6022080d31.js +0 -1
- package/assets/esri/core/workers/chunks/b4b26cc2ba3ff30e1d03.js +0 -1
- package/assets/esri/core/workers/chunks/b78ea9cc4d5f2fd3d871.js +0 -1
- package/assets/esri/core/workers/chunks/bbb585f0b484ab5eabb3.js +0 -1
- package/assets/esri/core/workers/chunks/bd4125d163f372a7e978.js +0 -1
- package/assets/esri/core/workers/chunks/c2bc70b65f5c2a2c9671.js +0 -1
- package/assets/esri/core/workers/chunks/cd1869e183001266c4c1.js +0 -2
- package/assets/esri/core/workers/chunks/d0a149050f7f1c1ada09.js +0 -1
- package/assets/esri/core/workers/chunks/d2fe403d6ab237bc89c2.js +0 -1
- package/assets/esri/core/workers/chunks/d51e8eeb1e1eb0605cc9.js +0 -1
- package/assets/esri/core/workers/chunks/da42cc4f6142846cb745.js +0 -1
- package/assets/esri/core/workers/chunks/dd84f630466a26722d57.js +0 -1
- package/assets/esri/core/workers/chunks/e080628ac6e1cf25dc72.js +0 -1
- package/assets/esri/core/workers/chunks/e17df11c98dbd869302b.js +0 -1
- package/assets/esri/core/workers/chunks/e1b3ae6426886e2fab07.js +0 -1
- package/assets/esri/core/workers/chunks/e8e0f73fb94e63e2abc3.js +0 -1
- package/assets/esri/core/workers/chunks/f45c343527709f6f91c2.js +0 -1
- package/assets/esri/core/workers/chunks/f6513ec888a7d927d948.js +0 -1
- package/assets/esri/core/workers/chunks/fcac475e4e82911b3126.js +0 -1
- package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +0 -5
- package/views/2d/layers/features/sources/strategies/ATileLoadStrategy.js +0 -5
- package/views/2d/layers/features/sources/strategies/DrillDownTileLoadStrategy.js +0 -5
- package/views/2d/layers/features/sources/strategies/PagedTileLoadStrategy.js +0 -5
- package/views/2d/layers/features/sources/strategies/SnapshotLoadStrategy.js +0 -5
- /package/assets/esri/core/workers/chunks/{7a23b127f551bf13ef54.js.LICENSE.txt → 268f5b233640a9dbbf89.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{cd1869e183001266c4c1.js.LICENSE.txt → 336b54144afec0c7d396.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{280af3640f8e93c1024e.js.LICENSE.txt → 47e4f66c33bb697fbe6b.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{9c64b78c5c9b35b31d98.js.LICENSE.txt → aa78b69219d9a0ef1c54.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d153b29c542c37ae1636.js.LICENSE.txt → c50e8d5f554cf151865c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b15ff6c9ef2de8a49853.js.LICENSE.txt → d6e0528eacee7ea4c1ce.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d66cdb9bb494da19696b.js.LICENSE.txt → f651c05604eab83aef5f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{ed773dab5965e42a2879.js.LICENSE.txt → f6e18668f728dfd8ba5e.js.LICENSE.txt} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/Extent.js";import n from"../geometry/SpatialReference.js";import m from"./Layer.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/Extent.js";import n from"../geometry/SpatialReference.js";import m from"./Layer.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as d}from"./mixins/ScaleRangeLayer.js";import{url as f,elevationInfo as S}from"./support/commonProperties.js";import{hasEsriCrs as x,initFullExtent as v}from"./support/tiles3DUtils.js";import{logInvalidElevationInfoWarning as j,elevationModeRequiredMessage as g,featureExpressionUnsupportedMessage as w}from"../support/elevationInfoUtils.js";let R=class extends(y(h(d(s(u(c(m))))))){constructor(e){super(e),this.operationalLayerType="GaussianSplatLayer",this.type="gaussian-splat",this.opacity=1,this.minScale=0,this.maxScale=0,this.url=null,this.rootTilesetJSON=null,this.fullExtent=new p(-180,-90,180,90,this.spatialReference),this.spatialReference=new n({wkid:4326,vcsWkid:115700}),this.esriCrsSpatialReference=null,this.esriCrsFullExtent=null}get supportedSpatialReferences(){return this.initialized&&this.esriCrsSpatialReference?[this.spatialReference,this.esriCrsSpatialReference]:[this.spatialReference]}get fullExtents(){return this.initialized&&this.esriCrsFullExtent?[this.fullExtent,this.esriCrsFullExtent]:[this.fullExtent]}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("GaussianSplat"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service"})}},e)}catch(s){o(s)}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(e=>{this.rootTilesetJSON=e.data;const t=x(this.rootTilesetJSON);this.fullExtent=v(this.rootTilesetJSON,!1),this.spatialReference=this.fullExtent.spatialReference,t&&(this.esriCrsFullExtent=v(this.rootTilesetJSON,!0),this.esriCrsSpatialReference=this.esriCrsFullExtent.spatialReference)},e=>{o(e)});await e}}_validateElevationInfo(e){const t="Gaussian Splat layers";j(r.getLogger(this),g(t,"absolute-height",e)),j(r.getLogger(this),w(t,e))}};e([a({type:["GaussianSplatLayer"]})],R.prototype,"operationalLayerType",void 0),e([a({readOnly:!0})],R.prototype,"type",void 0),e([a({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],R.prototype,"opacity",void 0),e([a({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],R.prototype,"minScale",void 0),e([a({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],R.prototype,"maxScale",void 0),e([a(f)],R.prototype,"url",void 0),e([a({type:p})],R.prototype,"fullExtent",void 0),e([a({type:n})],R.prototype,"spatialReference",void 0),e([a({readOnly:!0})],R.prototype,"supportedSpatialReferences",null),e([a({type:[p]})],R.prototype,"fullExtents",null),e([a({type:["show","hide"]})],R.prototype,"listMode",void 0),e([a(S)],R.prototype,"elevationInfo",null),R=e([l("esri.layers.GaussianSplatLayer")],R);const E=R;export{E as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import o from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as c}from"../core/accessorSupport/decorators/persistable.js";import d from"../geometry/Extent.js";import u from"../geometry/SpatialReference.js";import h from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as T,url as v}from"./support/commonProperties.js";import L from"./support/SceneModifications.js";import{initFullExtent as w}from"./support/tiles3DUtils.js";import x from"../portal/Portal.js";import{logInvalidElevationInfoWarning as b,elevationModeRequiredMessage as I,featureExpressionUnsupportedMessage as P}from"../support/elevationInfoUtils.js";import{f as R}from"../chunks/persistableUrlUtils.js";import{isBasemap as k}from"../support/userTypeGuards/isBasemap.js";let U=class extends(y(S(_(j(i(g(f(h)))))))){readModifications(e,t,o){this._modificationsSource={url:R(e,o),context:o}}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new u({wkid:4326,vcsWkid:115700}),this.fullExtent=new d(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[r,i]of Object.entries(e)){if("uri"===r)try{const e=new URL("https://tmp"+i).searchParams.get("session");if(e)return e}catch(o){}"object"==typeof i&&null!==i&&t.push(i)}}return null}async requestRootAndSession(e){const i=(e,t)=>new o("request-root-and-session:"+e,"requestRootAndSession: "+t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((o,n)=>{this.url||n(i("url-missing","requestRootAndSession: url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,o)=>{if(this.replacesTerrain&&!this._key){const r=this.portalItem?.portal||this.parent?.portalItem?.portal||x.getDefault();r.signIn().then(()=>{r.g3dTilesEnabled||o(i("g3dTilesEnabled-false","g3dTilesEnabled is false")),t(r.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>o(i("session-key-not-found","can't get session key")))},()=>o(i("sign-in.failed","can't sign in to portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data)),this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=w(this._rootTilesetJSON),o(),this._rootRequestPromise=null):n(i("root-parse-failed","Error parsing root tile"))},e=>{s(e),n(e),this._rootRequestPromise=null,r.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>n(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new o("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(r){s(r)}if(null!=this._modificationsSource){const t=await L.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this.requestRootAndSession(t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},e=>{r.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})}get hasAttributionData(){return!1}async fetchAttributionData(){return{}}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";b(r.getLogger(this),I(t,"absolute-height",e)),b(r.getLogger(this),P(t,e))}get replacesTerrain(){return this.hasGoogleUrl&&this._isUsedAsGroundLayer}get _isUsedAsGroundLayer(){return k(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],U.prototype,"operationalLayerType",void 0),e([l({type:L,clonable:e=>e.clone()}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],U.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],U.prototype,"readModifications",null),e([l({type:u})],U.prototype,"spatialReference",void 0),e([l({type:d})],U.prototype,"fullExtent",void 0),e([l(T)],U.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],U.prototype,"listMode",void 0),e([l(v)],U.prototype,"url",void 0),e([l({readOnly:!0})],U.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],U.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],U.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],U.prototype,"maxScale",void 0),e([l()],U.prototype,"replacesTerrain",null),e([l()],U.prototype,"_isUsedAsGroundLayer",null),e([l()],U.prototype,"hasGoogleUrl",null),U=e([m("esri.layers.IntegratedMesh3DTilesLayer")],U);const q=U;export{q as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import r from"../core/Error.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as a,sync as n}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{persistable as m}from"../core/accessorSupport/decorators/persistable.js";import c from"./Layer.js";import{APIKeyMixin as y}from"./mixins/APIKeyMixin.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as u}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{SceneService as S}from"./mixins/SceneService.js";import{elevationInfo as j}from"./support/commonProperties.js";import{I3SNodePageDefinition as L,I3SMaterialDefinition as T,I3STextureSetDefinition as _,I3SGeometryDefinition as w}from"./support/I3SLayerDefinitions.js";import x from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as I,elevationModeRequiredMessage as b,featureExpressionUnsupportedMessage as M}from"../support/elevationInfoUtils.js";import{f as O}from"../chunks/persistableUrlUtils.js";import{isBasemap as U}from"../support/userTypeGuards/isBasemap.js";let A=class extends(S(h(u(v(g(i(f(y(t(c)))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this.path=null,this.definitionExpression=null,this._canReplaceTerrain=!1}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:O(e,r),context:r}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){s(r)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await x.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new r("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new r("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new r("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";I(o.getLogger(this),b(t,"absolute-height",e)),I(o.getLogger(this),M(t,e))}get replacesTerrain(){return this._canReplaceTerrain&&this._isUsedAsGroundLayer}get _isUsedAsGroundLayer(){return U(this.parent)}};e([p({type:String,readOnly:!0})],A.prototype,"geometryType",void 0),e([p({type:["show","hide"]})],A.prototype,"listMode",void 0),e([p({type:["IntegratedMeshLayer"]})],A.prototype,"operationalLayerType",void 0),e([p({json:{read:!1},readOnly:!0})],A.prototype,"type",void 0),e([p({type:L,readOnly:!0,clonable:!1})],A.prototype,"nodePages",void 0),e([p({type:[T],readOnly:!0,clonable:!1})],A.prototype,"materialDefinitions",void 0),e([p({type:[_],readOnly:!0,clonable:!1})],A.prototype,"textureSetDefinitions",void 0),e([p({type:[w],readOnly:!0,clonable:!1})],A.prototype,"geometryDefinitions",void 0),e([p({readOnly:!0})],A.prototype,"serviceUpdateTimeStamp",void 0),e([p({type:x,clonable:e=>e?.clone()??e}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],A.prototype,"modifications",void 0),e([l(["web-scene","portal-item"],"modifications")],A.prototype,"readModifications",null),e([p(j)],A.prototype,"elevationInfo",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),e([p()],A.prototype,"replacesTerrain",null),e([p()],A.prototype,"_isUsedAsGroundLayer",null),e([p()],A.prototype,"_canReplaceTerrain",void 0),A=e([d("esri.layers.IntegratedMeshLayer")],A);const P=A;export{P as default};
|
package/layers/ParquetLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{watch as a}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import l from"../geometry/SpatialReference.js";import d from"../graphic/ParquetGraphicOrigin.js";import m from"./Layer.js";import{ParquetSource as c}from"./graphics/sources/ParquetSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as h}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as g}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as j}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as x}from"./mixins/OrderedLayer.js";import{PortalLayer as F}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as b}from"./mixins/TemporalLayer.js";import{labelsVisible as I}from"./support/commonProperties.js";import O from"./support/FeatureTemplate.js";import R from"./support/Field.js";import{defineFieldProperties as q}from"./support/fieldProperties.js";import{fixRendererFields as P,fixTimeInfoFields as T}from"./support/fieldUtils.js";import w from"./support/LabelClass.js";import{reader as C}from"./support/labelingInfo.js";import{ParquetEncodingBase as Q}from"./support/ParquetEncodingBase.js";import D from"./support/ParquetEncodingLocation.js";import z from"./support/ParquetEncodingWkb.js";import{completeParquetLayerInfo as B,parquetGeometryTypeKebabDict as E}from"./support/parquetUtils.js";import{rendererTypes as A}from"../renderers/support/typeUtils.js";import L from"../rest/support/Query.js";import{createPopupTemplate as G}from"../support/popupUtils.js";const U=q(),M="__OBJECTID",W={types:{key:"type",base:Q,typeMap:{wkb:z,location:D}}};let _=class extends(h(j(g(y(x(b(S(v(F(p(f(r(m))))))))))))){constructor(e){super(e),this.capabilities=k(),this.copyright=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.encoding=null,this.geometryType=null,this.graphicOrigin=new d(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=M,this.outFields=null,this.popupTemplate=null,this.source=null,this.spatialReference=l.WGS84,this.templates=null,this.title="Parquet",this.type="parquet",this.urls=new s}async load(e){return this.addResolvingPromise(this._load(e)),this.addHandles([a(()=>this.customParameters,e=>this.source?.setCustomParameters(e))]),this}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return null==this.geometryType}set renderer(e){P(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return G(this,e)}createQuery(){const e=new L;return e.returnGeometry=!0,e.outFields=["*"],e}async createSource(e){const t=await B({urls:this.urls,fields:this.fields,encoding:this.encoding,geometryType:this.geometryType,spatialReference:this.spatialReference,file:this.file},{customParameters:this.customParameters});let{fields:r,geometryType:s,encoding:p,spatialReference:a,urls:n,file:u,displayOptimization:d}=t;if(null==r)throw new o("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",t);if(a){if(!a.isGeographic&&!a.isWebMercator)throw new o("parquet-layer:unsupported","Unable to create parquet source: currently only geographic and Web Mercator supported",t);a.isGeographic&&!a.isWGS84&&(i.getLogger("parquet-layer").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:t.spatialReference}),a=l.WGS84)}r.push(new R({name:M,type:"oid",alias:M}));const m=new c({urls:n.items,fields:r,objectIdField:M,spatialReference:a,encoding:p,geometryType:s,file:u,customParameters:this.customParameters??void 0,displayOptimization:d});return await m.load(e),m}getFieldDomain(e,t){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,t){await this.load();const r=await this.source.queryFeatures(this._normalizeQuery(e),t),s=this.graphicOrigin;if(r?.features)for(const o of r.features)o.layer=o.sourceLayer=this,o.origin=s;return r}async queryObjectIds(e,t){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),t)}async queryFeatureCount(e,t){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),t)}async queryExtent(e,t){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),t)}_normalizeQuery(e){return L.from(e)??this.createQuery()}async _load(e){const t=await this.createSource(e);this._set("source",t),this.fields=t.fields,this.objectIdField=t.objectIdField,this.encoding=t.encoding,this.file=t.file,this.geometryType=t.geometryType,t.spatialReference&&(this.spatialReference=t.spatialReference),this.displayOptimization=t.displayOptimization,t.fullExtent&&(this.fullExtent=t.fullExtent),P(this.renderer,this.fieldsIndex),T(this.timeInfo,this.fieldsIndex)}};e([n({readOnly:!0,json:{read:!1,write:!1}})],_.prototype,"capabilities",void 0),e([n({type:String})],_.prototype,"copyright",void 0),e([n({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),e([n()],_.prototype,"displayOptimization",void 0),e([n({type:[R],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],_.prototype,"fields",void 0),e([n(U.fieldsIndex)],_.prototype,"fieldsIndex",void 0),e([n(W)],_.prototype,"encoding",void 0),e([n({json:{read:{reader:E.read}}})],_.prototype,"geometryType",void 0),e([n({readOnly:!0,clonable:!1})],_.prototype,"graphicOrigin",void 0),e([n(I)],_.prototype,"labelsVisible",void 0),e([n({type:[w],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:C},write:!0}})],_.prototype,"labelingInfo",void 0),e([n()],_.prototype,"file",void 0),e([n({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],_.prototype,"objectIdField",void 0),e([n(U.outFields)],_.prototype,"outFields",void 0),e([n({type:t,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([n({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"}}}})],_.prototype,"renderer",null),e([n({json:{read:!1},cast:null,type:c,readOnly:!0})],_.prototype,"source",void 0),e([n({type:l})],_.prototype,"spatialReference",void 0),e([n({type:[O]})],_.prototype,"templates",void 0),e([n()],_.prototype,"title",void 0),e([n({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([n({type:s.ofType(String)})],_.prototype,"urls",void 0),_=e([u("esri.layers.ParquetLayer")],_);const H=_;function k(){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:8e3,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{H as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{watch as a}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import l from"../geometry/SpatialReference.js";import d from"../graphic/ParquetGraphicOrigin.js";import m from"./Layer.js";import{ParquetSource as c}from"./graphics/sources/ParquetSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as h}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as g}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as j}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as x}from"./mixins/OrderedLayer.js";import{PortalLayer as F}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as b}from"./mixins/TemporalLayer.js";import{labelsVisible as I}from"./support/commonProperties.js";import O from"./support/FeatureTemplate.js";import R from"./support/Field.js";import{defineFieldProperties as q}from"./support/fieldProperties.js";import{fixRendererFields as P,fixTimeInfoFields as T}from"./support/fieldUtils.js";import w from"./support/LabelClass.js";import{reader as C}from"./support/labelingInfo.js";import{ParquetEncodingBase as Q}from"./support/ParquetEncodingBase.js";import D from"./support/ParquetEncodingLocation.js";import z from"./support/ParquetEncodingWkb.js";import{completeParquetLayerInfo as B,parquetGeometryTypeKebabDict as E}from"./support/parquetUtils.js";import{rendererTypes as A}from"../renderers/support/typeUtils.js";import L from"../rest/support/Query.js";import{createPopupTemplate as G}from"../support/popupUtils.js";const U=q(),M="__OBJECTID",W={types:{key:"type",base:Q,typeMap:{wkb:z,location:D}}};let _=class extends(h(j(g(y(x(b(S(v(F(p(f(r(m))))))))))))){constructor(e){super(e),this.capabilities=k(),this.copyright=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.encoding=null,this.geometryType=null,this.graphicOrigin=new d(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=M,this.outFields=null,this.popupTemplate=null,this.source=null,this.spatialReference=l.WGS84,this.templates=null,this.title="Parquet",this.type="parquet",this.urls=new s}async load(e){return this.addResolvingPromise(this._load(e)),this.addHandles([a(()=>this.urls,e=>this.source?.updateFiles(e.items)),a(()=>this.customParameters,e=>this.source?.setCustomParameters(e))]),this}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return null==this.geometryType}set renderer(e){P(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return G(this,e)}createQuery(){const e=new L;return e.returnGeometry=!0,e.outFields=["*"],e}async createSource(e){const t=await B({urls:this.urls,fields:this.fields,encoding:this.encoding,geometryType:this.geometryType,spatialReference:this.spatialReference,file:this.file},{customParameters:this.customParameters});let{fields:r,geometryType:s,encoding:p,spatialReference:a,urls:n,file:u,displayOptimization:d}=t;if(null==r)throw new o("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",t);if(a){if(!a.isGeographic&&!a.isWebMercator)throw new o("parquet-layer:unsupported","Unable to create parquet source: currently only geographic and Web Mercator supported",t);a.isGeographic&&!a.isWGS84&&(i.getLogger("parquet-layer").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:t.spatialReference}),a=l.WGS84)}r.push(new R({name:M,type:"oid",alias:M}));const m=new c({urls:n.items,fields:r,objectIdField:M,spatialReference:a,encoding:p,geometryType:s,file:u,customParameters:this.customParameters??void 0,displayOptimization:d});return await m.load(e),m}getFieldDomain(e,t){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,t){await this.load();const r=await this.source.queryFeatures(this._normalizeQuery(e),t),s=this.graphicOrigin;if(r?.features)for(const o of r.features)o.layer=o.sourceLayer=this,o.origin=s;return r}async queryObjectIds(e,t){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),t)}async queryFeatureCount(e,t){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),t)}async queryExtent(e,t){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),t)}_normalizeQuery(e){return L.from(e)??this.createQuery()}async _load(e){const t=await this.createSource(e);this._set("source",t),this.fields=t.fields,this.objectIdField=t.objectIdField,this.encoding=t.encoding,this.file=t.file,this.geometryType=t.geometryType,t.spatialReference&&(this.spatialReference=t.spatialReference),this.displayOptimization=t.displayOptimization,t.fullExtent&&(this.fullExtent=t.fullExtent),P(this.renderer,this.fieldsIndex),T(this.timeInfo,this.fieldsIndex)}};e([n({readOnly:!0,json:{read:!1,write:!1}})],_.prototype,"capabilities",void 0),e([n({type:String})],_.prototype,"copyright",void 0),e([n({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),e([n()],_.prototype,"displayOptimization",void 0),e([n({type:[R],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],_.prototype,"fields",void 0),e([n(U.fieldsIndex)],_.prototype,"fieldsIndex",void 0),e([n(W)],_.prototype,"encoding",void 0),e([n({json:{read:{reader:E.read}}})],_.prototype,"geometryType",void 0),e([n({readOnly:!0,clonable:!1})],_.prototype,"graphicOrigin",void 0),e([n(I)],_.prototype,"labelsVisible",void 0),e([n({type:[w],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:C},write:!0}})],_.prototype,"labelingInfo",void 0),e([n()],_.prototype,"file",void 0),e([n({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],_.prototype,"objectIdField",void 0),e([n(U.outFields)],_.prototype,"outFields",void 0),e([n({type:t,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([n({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"}}}})],_.prototype,"renderer",null),e([n({json:{read:!1},cast:null,type:c,readOnly:!0})],_.prototype,"source",void 0),e([n({type:l})],_.prototype,"spatialReference",void 0),e([n({type:[O]})],_.prototype,"templates",void 0),e([n()],_.prototype,"title",void 0),e([n({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([n({type:s.ofType(String)})],_.prototype,"urls",void 0),_=e([u("esri.layers.ParquetLayer")],_);const H=_;function k(){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:8e3,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{H as default};
|
package/layers/SceneLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y,throwIfNotAbortError as u}from"../core/promiseUtils.js";import{whenOnce as c}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as f}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Point.js";import b from"../graphic/SceneGraphicOrigin.js";import w from"./Layer.js";import{NoModelError as I,MultipleModelsError as L}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as j}from"./mixins/APIKeyMixin.js";import{ArcGISService as F}from"./mixins/ArcGISService.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as O}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as P}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{SceneService as T}from"./mixins/SceneService.js";import{useViewTimeProperty as x}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as E}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as D}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as U}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as R}from"./support/capabilities.js";import{elevationInfo as q,labelsVisible as C,legendEnabled as G,popupEnabled as N,attributeTableTemplate as Q,screenSizePerspectiveEnabled as V}from"./support/commonProperties.js";import{getFieldDomain as M,computeEffectiveEditingEnabled as k,getGlobalIdToObjectIdMap as K}from"./support/featureLayerUtils.js";import{FeatureReduction as $}from"./support/FeatureReduction.js";import H from"./support/FeatureReductionSelection.js";import{defineFieldProperties as z}from"./support/fieldProperties.js";import W from"./support/FieldsIndex.js";import{fixRendererFields as Z,unpackFieldNames as B}from"./support/fieldUtils.js";import{I3SNodePageDefinition as J,I3SMaterialDefinition as X,I3STextureSetDefinition as Y,I3SGeometryDefinition as ee}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as te,isFileSupported as re}from"./support/infoFor3D.js";import ie from"./support/LabelClass.js";import{reader as se}from"./support/labelingInfo.js";import oe from"./support/LayerFloorInfo.js";import{layerLookupMap as ae}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as ne}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as le}from"./support/RangeInfo.js";import pe from"./support/SceneFilter.js";import{cacheIsOutOfSync as de}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ye}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ue}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as ce}from"../renderers/support/typeUtils.js";import he from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as fe,elevationModeUnsupportedMessage as me,featureExpressionUnsupportedMessage as ge}from"../support/elevationInfoUtils.js";import{createPopupTemplate as ve}from"../support/popupUtils.js";import{extractZipFiles as be}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as we}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Ie,getFetchPopupTemplate as Le}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as je}from"../webdoc/support/opacityUtils.js";const Fe=new Set(["3DObject","Point"]),Se=z();let Oe=class extends(E(O(T(F(_(P(A(p(S(j(i(w)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new b(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?M(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new W(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:J.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&k(this.associatedLayer)}get geometryType(){return Pe[this.profile]||"mesh"}set renderer(e){Z(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:R;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&_e[r]?_e[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ue(this,{origin:"service"},t),Z(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new he;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=B(this.fieldsIndex,await Ie(this,Le(this)));return we(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new o("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s.origin=this.graphicOrigin,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ve(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new o("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return D(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await K(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce((e,t)=>te(this.infoFor3D,t)?e+1:e,0);0===s&&r(new I),s>1&&r(new L);const a=this.spatialReference,l=t.location??new v({x:0,y:0,z:0,spatialReference:a}),p=l.spatialReference.isGeographic?"local":"georeferenced",{default:d}=await import("../geometry/Mesh.js"),y=d.createWithExternalSource(l,{type:"client",files:i},{vertexSpace:p,transform:ne(l.spatialReference),unitConversionDisabled:!0}),[u]=await this.uploadAssets([y],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await be(e)).filter(e=>re(t,e))}validateLayer(e){if(e.layerType&&!Fe.has(e.layerType))throw new o("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new o("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=f(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!D(this.associatedLayer?.url)||!de(this))return;f(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await U(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ae.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){y(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(a(e));try{await c(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void u(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&fe(n.getLogger(this),me("Mesh scene layers","relative-to-scene",e)),fe(n.getLogger(this),ge("Scene layers",e))}async fetchStatistics(e,t){return await ye({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([h({types:{key:"type",base:$,typeMap:{selection:H}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Oe.prototype,"featureReduction",void 0),e([h({type:[le],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Oe.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Oe.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Oe.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Oe.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Oe.prototype,"type",void 0),e([h({...Se.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Oe.prototype,"fields",void 0),e([h()],Oe.prototype,"types",null),e([h()],Oe.prototype,"typeIdField",null),e([h()],Oe.prototype,"templates",null),e([h()],Oe.prototype,"formTemplate",null),e([h({readOnly:!0})],Oe.prototype,"graphicOrigin",void 0),e([h({readOnly:!0,clonable:!1})],Oe.prototype,"fieldsIndex",null),e([h({type:oe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Oe.prototype,"floorInfo",void 0),e([h(Se.outFields)],Oe.prototype,"outFields",void 0),e([h({type:J,readOnly:!0,json:{read:!1},clonable:!1})],Oe.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],Oe.prototype,"readNodePages",null),e([h({type:[X],readOnly:!0,clonable:!1})],Oe.prototype,"materialDefinitions",void 0),e([h({type:[Y],readOnly:!0,clonable:!1})],Oe.prototype,"textureSetDefinitions",void 0),e([h({type:[ee],readOnly:!0,clonable:!1})],Oe.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Oe.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Oe.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Oe.prototype,"statisticsInfo",void 0),e([h({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Oe.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Oe.prototype,"definitionExpression",void 0),e([h({type:pe,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Oe.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Oe.prototype,"path",void 0),e([h(q)],Oe.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Oe.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Oe.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Oe.prototype,"geometryType",null),e([h(C)],Oe.prototype,"labelsVisible",void 0),e([h({type:[ie],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:se},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:se},write:!0}})],Oe.prototype,"labelingInfo",void 0),e([h(G)],Oe.prototype,"legendEnabled",void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?je(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Oe.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Oe.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Oe.prototype,"semantic",void 0),e([h({types:ce,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Oe.prototype,"renderer",null),e([h({json:{read:!1}})],Oe.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],Oe.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Oe.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Oe.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Oe.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Oe.prototype,"relationships",null),e([h(N)],Oe.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Oe.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Oe.prototype,"defaultPopupTemplate",null),e([h(Q)],Oe.prototype,"attributeTableTemplate",void 0),e([h({type:String,json:{read:!1}})],Oe.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],Oe.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Oe.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],Oe.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Oe.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Oe.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],Oe.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Oe.prototype,"normalReferenceFrame",void 0),e([h(V)],Oe.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Oe.prototype,"serviceItemId",void 0),e([h(x)],Oe.prototype,"useViewTime",null),Oe=e([g("esri.layers.SceneLayer")],Oe);const _e={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Pe={"mesh-pyramids":"mesh",points:"point"},Ae=Oe;export{Ae as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import{deprecated as o}from"../core/deprecate.js";import a from"../core/Error.js";import{abortHandle as n}from"../core/handleUtils.js";import l from"../core/Logger.js";import{destroyMaybe as p}from"../core/maybe.js";import{MultiOriginJSONMixin as d}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as y,isAbortError as u,throwIfNotAbortError as c}from"../core/promiseUtils.js";import{whenOnce as h}from"../core/reactiveUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as m}from"../core/accessorSupport/utils.js";import{reader as g}from"../core/accessorSupport/decorators/reader.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import b from"../geometry/Point.js";import w from"../graphic/SceneGraphicOrigin.js";import L from"./Layer.js";import{NoModelError as I,MultipleModelsError as j}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as _}from"./mixins/EditBusLayer.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{SceneService as x}from"./mixins/SceneService.js";import{useViewTimeProperty as E}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as D}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as U}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as R}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as q}from"./support/capabilities.js";import{elevationInfo as C,labelsVisible as G,legendEnabled as N,popupEnabled as Q,attributeTableTemplate as V,screenSizePerspectiveEnabled as M}from"./support/commonProperties.js";import{getFieldDomain as k,computeEffectiveEditingEnabled as K,getGlobalIdToObjectIdMap as $}from"./support/featureLayerUtils.js";import{FeatureReduction as H}from"./support/FeatureReduction.js";import z from"./support/FeatureReductionSelection.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import Z from"./support/FieldsIndex.js";import{fixRendererFields as B,unpackFieldNames as J}from"./support/fieldUtils.js";import{I3SNodePageDefinition as X,I3SMaterialDefinition as Y,I3STextureSetDefinition as ee,I3SGeometryDefinition as te}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as re,isFileSupported as ie}from"./support/infoFor3D.js";import se from"./support/LabelClass.js";import{reader as oe}from"./support/labelingInfo.js";import ae from"./support/LayerFloorInfo.js";import{layerLookupMap as ne}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as le}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as pe}from"./support/RangeInfo.js";import de from"./support/SceneFilter.js";import{cacheIsOutOfSync as ye}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ue}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ce}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as he}from"../renderers/support/typeUtils.js";import fe from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as me,elevationModeUnsupportedMessage as ge,featureExpressionUnsupportedMessage as ve}from"../support/elevationInfoUtils.js";import{createPopupTemplate as be}from"../support/popupUtils.js";import{extractZipFiles as we}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as Le}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Ie,getFetchPopupTemplate as je}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Fe}from"../webdoc/support/opacityUtils.js";const Se=new Set(["3DObject","Point"]),Oe=W();let _e=class extends(D(_(x(S(P(T(A(d(O(F(i(L)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new w(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=p(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?k(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:X.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&K(this.associatedLayer)}get geometryType(){return Te[this.profile]||"mesh"}set renderer(e){B(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:q;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Pe[r]?Pe[r]:(l.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ce(this,{origin:"service"},t),B(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){l.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new fe;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=J(this.fieldsIndex,await Ie(this,je(this)));return Le(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new a("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s.origin=this.graphicOrigin,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(l.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return be(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==o)throw new a(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new a(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return U(s.url)&&n&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await $(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={},null!=t.location&&o(l.getLogger(this),"The 'location' option of convertMesh() has been deprecated in favour of 'origin'.",{version:"4.34",replacement:"origin",warnOnce:!0});const r=e=>{throw l.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new a("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce((e,t)=>re(this.infoFor3D,t)?e+1:e,0);0===s&&r(new I),s>1&&r(new j);const n=this.spatialReference,p=t.origin??t.location,d=p??t.defaultOrigin??new b({x:0,y:0,z:0,spatialReference:n}),y=d.spatialReference.isGeographic?"local":"georeferenced",{default:u}=await import("../geometry/Mesh.js"),c=u.createWithExternalSource(d,{type:"client",files:i},{vertexSpace:y,transform:le(d.spatialReference),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!p});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await we(e)).filter(e=>ie(t,e))}validateLayer(e){if(e.layerType&&!Se.has(e.layerType))throw new a("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new a("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new a("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new a("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new a("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=m(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!U(this.associatedLayer?.url)||!ye(this))return;m(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await R(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ne.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){u(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(n(e));try{await h(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void c(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?l.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):l.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&me(l.getLogger(this),ge("Mesh scene layers","relative-to-scene",e)),me(l.getLogger(this),ve("Scene layers",e))}async fetchStatistics(e,t){return await ue({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([f({types:{key:"type",base:H,typeMap:{selection:z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],_e.prototype,"featureReduction",void 0),e([f({type:[pe],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],_e.prototype,"rangeInfos",void 0),e([f({json:{read:!1}})],_e.prototype,"associatedLayer",void 0),e([f({type:["show","hide"]})],_e.prototype,"listMode",void 0),e([f({type:["ArcGISSceneServiceLayer"]})],_e.prototype,"operationalLayerType",void 0),e([f({json:{read:!1},readOnly:!0})],_e.prototype,"type",void 0),e([f({...Oe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"fields",void 0),e([f()],_e.prototype,"types",null),e([f()],_e.prototype,"typeIdField",null),e([f()],_e.prototype,"templates",null),e([f()],_e.prototype,"formTemplate",null),e([f({readOnly:!0})],_e.prototype,"graphicOrigin",void 0),e([f({readOnly:!0,clonable:!1})],_e.prototype,"fieldsIndex",null),e([f({type:ae,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],_e.prototype,"floorInfo",void 0),e([f(Oe.outFields)],_e.prototype,"outFields",void 0),e([f({type:X,readOnly:!0,json:{read:!1},clonable:!1})],_e.prototype,"nodePages",void 0),e([g("service","nodePages",["nodePages","pointNodePages"])],_e.prototype,"readNodePages",null),e([f({type:[Y],readOnly:!0,clonable:!1})],_e.prototype,"materialDefinitions",void 0),e([f({type:[ee],readOnly:!0,clonable:!1})],_e.prototype,"textureSetDefinitions",void 0),e([f({type:[te],readOnly:!0,clonable:!1})],_e.prototype,"geometryDefinitions",void 0),e([f({readOnly:!0})],_e.prototype,"serviceUpdateTimeStamp",void 0),e([f({readOnly:!0})],_e.prototype,"attributeStorageInfo",void 0),e([f({readOnly:!0})],_e.prototype,"statisticsInfo",void 0),e([f({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],_e.prototype,"excludeObjectIds",void 0),e([f({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_e.prototype,"definitionExpression",void 0),e([f({type:de,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],_e.prototype,"filter",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],_e.prototype,"path",void 0),e([f(C)],_e.prototype,"elevationInfo",null),e([f({readOnly:!0,json:{read:!1}})],_e.prototype,"effectiveCapabilities",null),e([f({readOnly:!0})],_e.prototype,"effectiveEditingEnabled",null),e([f({type:String})],_e.prototype,"geometryType",null),e([f(G)],_e.prototype,"labelsVisible",void 0),e([f({type:[se],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:oe},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:oe},write:!0}})],_e.prototype,"labelingInfo",void 0),e([f(N)],_e.prototype,"legendEnabled",void 0),e([f({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Fe(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],_e.prototype,"opacity",void 0),e([f({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"priority",void 0),e([f({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"semantic",void 0),e([f({types:he,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],_e.prototype,"renderer",null),e([f({json:{read:!1}})],_e.prototype,"cachedDrawingInfo",void 0),e([g("service","cachedDrawingInfo")],_e.prototype,"readCachedDrawingInfo",null),e([f({readOnly:!0,json:{read:!1}})],_e.prototype,"capabilities",null),e([f({type:Boolean,json:{read:!1}})],_e.prototype,"editingEnabled",null),e([f({readOnly:!0,json:{write:!1,read:!1}})],_e.prototype,"infoFor3D",null),e([f({readOnly:!0,json:{write:!1,read:!1}})],_e.prototype,"relationships",null),e([f(Q)],_e.prototype,"popupEnabled",void 0),e([f({type:r,json:{name:"popupInfo",write:!0}})],_e.prototype,"popupTemplate",void 0),e([f({readOnly:!0,json:{read:!1}})],_e.prototype,"defaultPopupTemplate",null),e([f(V)],_e.prototype,"attributeTableTemplate",void 0),e([f({type:String,json:{read:!1}})],_e.prototype,"objectIdField",void 0),e([g("service","objectIdField",["objectIdField","fields"])],_e.prototype,"readObjectIdField",null),e([f({type:String,json:{read:!1}})],_e.prototype,"globalIdField",void 0),e([g("service","globalIdField",["globalIdField","fields"])],_e.prototype,"readGlobalIdField",null),e([f({readOnly:!0,type:String,json:{read:!1}})],_e.prototype,"displayField",null),e([f({type:String,json:{read:!1}})],_e.prototype,"profile",void 0),e([g("service","profile",["store.profile"])],_e.prototype,"readProfile",null),e([f({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],_e.prototype,"normalReferenceFrame",void 0),e([f(M)],_e.prototype,"screenSizePerspectiveEnabled",void 0),e([f({json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"serviceItemId",void 0),e([f(E)],_e.prototype,"useViewTime",null),_e=e([v("esri.layers.SceneLayer")],_e);const Pe={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Te={"mesh-pyramids":"mesh",points:"point"},Ae=_e;export{Ae as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import{createTask as r}from"../core/asyncUtils.js";import i from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{checkWebPSupport as L}from"./support/imageUtils.js";import U from"./support/SpriteSource.js";import R from"./support/TileInfo.js";import{TilemapCache as O}from"./support/TilemapCache.js";import{loadMetadata as P}from"./support/vectorTileLayerLoader.js";import{createForItemRead as M}from"../portal/support/jsonContext.js";import{parseKnownArcGISOnlineDomain as C}from"../portal/support/urlUtils.js";import{e as V}from"../chunks/persistableUrlUtils.js";import{areSchemasOverlapping as D,unionTileInfos as E}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import N from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as k}from"../views/webgl/capabilities.js";let K=class extends(_(I(x(v(j(b(T(w(g(s(f))))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(l).then(async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey},authMode:this.portalItem.portal.authMode})).data&&this.read({url:r},M(this.portalItem,"portal-item"))}).catch(l).then(()=>this._loadStyle(e));return this.addResolvingPromise(r),Promise.resolve(this)}get apiKey(){return super.apiKey}set apiKey(e){super.apiKey=e}set portalItem(e){super.portalItem=e}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`);const r=C(e);t.styleUrl=V(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r<e.length;r++)D(t,e[r].tileInfo)&&(t=E(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new O({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=k().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,o=new U({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await o.load(t),this._spriteSourceMap.set(e,o)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=k().maxTextureSize,i=e.spriteUrl,o=i?n(i,{...this.customParameters,token:this.apiKey}):null;if(!o&&"url"===e.type)return null;const s=new U(e,r);try{await s.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,s),o&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=o),this.emit("spriteSource-change",{spriteSource:s}),s}catch(a){l(a)}return null}async loadStyle(e,t){const i=e||this.style||this.url;return this._loadingTask&&"string"==typeof i&&this.url===i||(this._loadingTask?.abort(),this._loadingTask=r(e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(i,{signal:e})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return o(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return o(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new i("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await P(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await L("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new N(r.style,!1)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const o=t[1]||"";for(const s of r)if(s.toLowerCase().includes(i))return y(`//static.arcgis.com/attribution/Vector${o}/${s}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],K.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],K.prototype,"listMode",void 0),e([u({json:{read:!0,write:!0}})],K.prototype,"blendMode",void 0),e([u({readOnly:!0,json:{read:!1}})],K.prototype,"capabilities",null),e([u({readOnly:!0})],K.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],K.prototype,"fullExtent",null),e([u({json:{read:!1},readOnly:!0,type:d})],K.prototype,"initialExtent",null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],K.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],K.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],K.prototype,"parsedUrl",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],K.prototype,"path",void 0),e([u({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],K.prototype,"refreshInterval",void 0),e([u()],K.prototype,"style",void 0),e([u({readOnly:!0})],K.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],K.prototype,"spatialReference",null),e([u({readOnly:!0})],K.prototype,"styleRepository",void 0),e([u({readOnly:!0})],K.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],K.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],K.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],K.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],K.prototype,"tileInfo",null),e([u()],K.prototype,"tilemapCache",void 0),e([c("service","tilemapCache",["capabilities","tileInfo"])],K.prototype,"readTilemapCache",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],K.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],K.prototype,"url",void 0),e([u({readOnly:!0})],K.prototype,"version",void 0),e([c("version",["version","currentVersion"])],K.prototype,"readVersion",null),K=e([m("esri.layers.VectorTileLayer")],K);const B=K;export{B as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import{createTask as r}from"../core/asyncUtils.js";import i from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{url as L}from"./support/commonProperties.js";import{checkWebPSupport as U}from"./support/imageUtils.js";import P from"./support/SpriteSource.js";import R from"./support/TileInfo.js";import{TilemapCache as O}from"./support/TilemapCache.js";import{loadMetadata as M}from"./support/vectorTileLayerLoader.js";import{createForItemRead as C}from"../portal/support/jsonContext.js";import{parseKnownArcGISOnlineDomain as V}from"../portal/support/urlUtils.js";import{e as D}from"../chunks/persistableUrlUtils.js";import{areSchemasOverlapping as E,unionTileInfos as N}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import k from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as K}from"../views/webgl/capabilities.js";let B=class extends(_(I(x(v(j(b(T(w(g(s(f))))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(l).then(async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey},authMode:this.portalItem.portal.authMode})).data&&this.read({url:r},C(this.portalItem,"portal-item"))}).catch(l).then(()=>this._loadStyle(e));return this.addResolvingPromise(r),Promise.resolve(this)}get apiKey(){return super.apiKey}set apiKey(e){super.apiKey=e}set portalItem(e){super.portalItem=e}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`);const r=V(e);t.styleUrl=D(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r<e.length;r++)E(t,e[r].tileInfo)&&(t=N(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new O({layer:this}):null}set url(e){if(!e)return void this._set("url",e);const t=a(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=K().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,o=new P({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await o.load(t),this._spriteSourceMap.set(e,o)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=K().maxTextureSize,i=e.spriteUrl,o=i?n(i,{...this.customParameters,token:this.apiKey}):null;if(!o&&"url"===e.type)return null;const s=new P(e,r);try{await s.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,s),o&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=o),this.emit("spriteSource-change",{spriteSource:s}),s}catch(a){l(a)}return null}async loadStyle(e,t){const i=e||this.style||this.url;return this._loadingTask&&"string"==typeof i&&this.url===i||(this._loadingTask?.abort(),this._loadingTask=r(e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(i,{signal:e})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return o(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return o(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new i("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await M(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await U("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new k(r.style,!1)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const o=t[1]||"";for(const s of r)if(s.toLowerCase().includes(i))return y(`//static.arcgis.com/attribution/Vector${o}/${s}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],B.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],B.prototype,"listMode",void 0),e([u({json:{read:!0,write:!0}})],B.prototype,"blendMode",void 0),e([u({readOnly:!0,json:{read:!1}})],B.prototype,"capabilities",null),e([u({readOnly:!0})],B.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],B.prototype,"fullExtent",null),e([u({json:{read:!1},readOnly:!0,type:d})],B.prototype,"initialExtent",null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],B.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],B.prototype,"parsedUrl",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],B.prototype,"path",void 0),e([u({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],B.prototype,"refreshInterval",void 0),e([u()],B.prototype,"style",void 0),e([u({readOnly:!0})],B.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],B.prototype,"spatialReference",null),e([u({readOnly:!0})],B.prototype,"styleRepository",void 0),e([u({readOnly:!0})],B.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],B.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],B.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],B.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],B.prototype,"tileInfo",null),e([u()],B.prototype,"tilemapCache",void 0),e([c("service","tilemapCache",["capabilities","tileInfo"])],B.prototype,"readTilemapCache",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],B.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}}),u(L)],B.prototype,"url",null),e([u({readOnly:!0})],B.prototype,"version",void 0),e([c("version",["version","currentVersion"])],B.prototype,"readVersion",null),B=e([m("esri.layers.VectorTileLayer")],B);const A=B;export{A as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{Loadable as r}from"../../../core/Loadable.js";import o from"../../../core/Logger.js";import{open as s}from"../../../core/workers/workers.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../geometry/Extent.js";import l from"../../support/FieldsIndex.js";import{toParquetJSONGeometryType as u}from"../../support/parquetUtils.js";import p from"../../../rest/support/FeatureSet.js";let c=class extends r{constructor(e){super(e),this.type="parquet",this.urls=null,this.fields=null,this.objectIdField=null,this.spatialReference=null}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._initialize(t)),Promise.resolve(this)}destroy(){this._connection.destroy()}setCustomParameters(e){this.customParameters=e,this._proxy.setCustomParameters(this.customParameters).catch(()=>{o.getLogger(this).warn("Failed to update customParameters")})}async queryFeaturesJSON(e,t={}){return await this.load(t),this._proxy.queryFeatures(e.toJSON(),{signal:t?.signal})}async queryFeatures(e,t={}){const r=await this.queryFeaturesJSON(e,{signal:t?.signal});return p.fromJSON(r)}async queryObjectIds(e,t){return await this._proxy.queryObjectIds(e.toJSON(),{signal:t?.signal})}async queryFeatureCount(e,t){return this._proxy.queryFeatureCount(e.toJSON(),{signal:t?.signal})}async queryExtent(e,t){if(null==this.encoding)return o.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const r=await this._proxy.queryExtent(e.toJSON(),{signal:t?.signal});return{count:r.count,extent:a.fromJSON(r.extent)}}async _initialize(e){let r;if(this._connection=await s("ParquetSourceWorker",{strategy:"dedicated"}),this._proxy=this._connection.createInvokeProxy(),this.geometryType&&this.encoding){if(!this.spatialReference)throw new t("parquet:unsupported","SpatialReference must be defined");r={geometryType:u(this.geometryType),spatialReference:this.spatialReference.toJSON(),encoding:this.encoding.toJSON(),displayOptimization:this.displayOptimization}}const o=new l(this.fields).toJSON(),{extent:i}=await this._proxy.load({urls:this.urls,metadata:{fieldsIndex:o,geometryType:r?.geometryType??"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:r?.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null},geometryInfo:r,customParameters:this.customParameters});this.fullExtent=i?a.fromJSON(i):null}};e([i()],c.prototype,"type",void 0),e([i()],c.prototype,"urls",void 0),e([i()],c.prototype,"fields",void 0),e([i()],c.prototype,"encoding",void 0),e([i()],c.prototype,"geometryType",void 0),e([i()],c.prototype,"objectIdField",void 0),e([i()],c.prototype,"spatialReference",void 0),e([i()],c.prototype,"file",void 0),e([i()],c.prototype,"customParameters",void 0),e([i()],c.prototype,"displayOptimization",void 0),e([i()],c.prototype,"fullExtent",void 0),c=e([n("esri.layers.graphics.sources.ParquetSource")],c);export{c as ParquetSource};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{Loadable as r}from"../../../core/Loadable.js";import o from"../../../core/Logger.js";import{open as s}from"../../../core/workers/workers.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../geometry/Extent.js";import l from"../../support/FieldsIndex.js";import{toParquetJSONGeometryType as u}from"../../support/parquetUtils.js";import p from"../../../rest/support/FeatureSet.js";let c=class extends r{constructor(e){super(e),this.type="parquet",this.urls=null,this.fields=null,this.objectIdField=null,this.spatialReference=null}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._initialize(t)),Promise.resolve(this)}destroy(){this._connection.destroy()}setCustomParameters(e){this.customParameters=e,this._proxy.setCustomParameters(this.customParameters).catch(()=>{o.getLogger(this).warn("Failed to update customParameters")})}async updateFiles(e){this.urls=e,await this._proxy.updateFiles(e)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._proxy.queryFeatures(e.toJSON(),{signal:t?.signal})}async queryFeatures(e,t={}){const r=await this.queryFeaturesJSON(e,{signal:t?.signal});return p.fromJSON(r)}async queryObjectIds(e,t){return await this._proxy.queryObjectIds(e.toJSON(),{signal:t?.signal})}async queryFeatureCount(e,t){return this._proxy.queryFeatureCount(e.toJSON(),{signal:t?.signal})}async queryExtent(e,t){if(null==this.encoding)return o.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const r=await this._proxy.queryExtent(e.toJSON(),{signal:t?.signal});return{count:r.count,extent:a.fromJSON(r.extent)}}async _initialize(e){let r;if(this._connection=await s("ParquetSourceWorker",{strategy:"dedicated"}),this._proxy=this._connection.createInvokeProxy(),this.geometryType&&this.encoding){if(!this.spatialReference)throw new t("parquet:unsupported","SpatialReference must be defined");r={geometryType:u(this.geometryType),spatialReference:this.spatialReference.toJSON(),encoding:this.encoding.toJSON(),displayOptimization:this.displayOptimization}}const o=new l(this.fields).toJSON(),{extent:i}=await this._proxy.load({urls:this.urls,metadata:{fieldsIndex:o,geometryType:r?.geometryType??"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:r?.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null},geometryInfo:r,customParameters:this.customParameters});this.fullExtent=i?a.fromJSON(i):null}};e([i()],c.prototype,"type",void 0),e([i()],c.prototype,"urls",void 0),e([i()],c.prototype,"fields",void 0),e([i()],c.prototype,"encoding",void 0),e([i()],c.prototype,"geometryType",void 0),e([i()],c.prototype,"objectIdField",void 0),e([i()],c.prototype,"spatialReference",void 0),e([i()],c.prototype,"file",void 0),e([i()],c.prototype,"customParameters",void 0),e([i()],c.prototype,"displayOptimization",void 0),e([i()],c.prototype,"fullExtent",void 0),c=e([n("esri.layers.graphics.sources.ParquetSource")],c);export{c as ParquetSource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as r}from"../../../../core/compilerUtils.js";import s from"../../../../core/Error.js";import{assertIsSome as o}from"../../../../core/maybe.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import a from"../../../../geometry/SpatialReference.js";import{set as i,create as u,expandWithRect as l,expandWithAABB as f,negativeInfinity as
|
|
5
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as r}from"../../../../core/compilerUtils.js";import s from"../../../../core/Error.js";import{assertIsSome as o}from"../../../../core/maybe.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import a from"../../../../geometry/SpatialReference.js";import{set as i,create as u,expandWithRect as l,expandWithAABB as f,negativeInfinity as c,fromRect as d}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as m,QueryEngine as h}from"../../data/QueryEngine.js";import{QueryEngineResult as y}from"../../data/QueryEngineResult.js";import p from"../../../support/FieldsIndex.js";import{collectSQLFieldNames as _}from"../../../support/fieldUtils.js";import{createParquetFile as g,readGeoMetadata as I}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as w}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as x}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as R}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as F}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as C}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const q=new w,j=8e3;class b{constructor(){this._fileInfos=new Map,this._queue=new n({concurrency:1,process:(e,t)=>this._executeQuery(e,t)})}async load(r){this.setCustomParameters(r.customParameters),this._geometryInfo=r.geometryInfo;for(const e of r.urls){const t=await g(e,{geometryInfo:r.geometryInfo,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(e,{index:this._fileInfos.size,file:t})}this._metadata=F.createFeature(r.metadata),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:r.geometryInfo?.geometryType??"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:a.fromJSON(r.geometryInfo?.spatialReference),aggregateAdapter:null,timeInfo:null,definitionExpression:null};const s=this._fileInfos.values().next().value;if(!s)return{extent:null};const{fields:o,timeZoneByFieldName:n}=r.metadata.fieldsIndex,f=o.map(e=>({...e,column:s.file.columnForFieldName(e.name)})),d=p.fromJSON({fields:f,timeZoneByFieldName:n});if(this._fieldsIndex=d,r.metadata.spatialReference&&(this._fullExtent=E(this._fileInfos.values(),r.metadata.spatialReference)),null==this._fullExtent&&"location"===r.geometryInfo?.encoding.type){const{latitudeFieldName:s,longitudeFieldName:o}=r.geometryInfo.encoding,n=this._fieldsIndex.get(s)?.column,a=this._fieldsIndex.get(o)?.column,f=i(u(),c);for(const r of this._fileInfos.values())for(const s of r.file.rowGroups()){const r={stack:[],error:void 0,hasError:!1};try{const t=e(r,s.columnDescriptorForAttribute(n),!1),o=e(r,s.columnDescriptorForAttribute(a),!1),i=[o.minValue(),t.minValue(),o.maxValue(),t.maxValue()];l(f,i),s.free()}catch(m){r.error=m,r.hasError=!0}finally{t(r)}}this._fullExtent={xmin:f[0],ymin:f[1],xmax:f[3],ymax:f[4],spatialReference:r.metadata.spatialReference}}return{extent:this._fullExtent}}destroy(){for(const e of this._fileInfos.values())e.file.free();this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}async updateFiles(e){const t=new Set(e);for(const[r,s]of this._fileInfos.entries())t.has(r)?t.delete(r):(s.file.free(),this._fileInfos.delete(r));for(const r of t){const e=await g(r,{geometryInfo:this._geometryInfo,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(r,{index:this._fileInfos.size,file:e})}}async queryFeatures(e,t){if(this._validateQuery(e),e.objectIds?.length){return(await this._enqueueQuery(e,t)).createQueryResponse()}e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0;return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){if(this._validateQuery(e),!Q(e))return this._getFeatureCount();e.resultRecordCount=e.resultRecordCount??this._getFeatureCount(),e.resultOffset=e.resultOffset??0,delete e.outFields,delete e.returnGeometry;return(await this._enqueueQuery(e,t)).createQueryResponseForCount()}async queryObjectIds(e,t){if(this._validateQuery(e),!Q(e))return Array.from({length:this._getFeatureCount()},(e,t)=>t);e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0,delete e.returnGeometry,delete e.outFields;return(await this._enqueueQuery(e,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){if(this._validateQuery(e),this._fullExtent&&!Q(e))return{count:this._getFeatureCount(),extent:this._fullExtent};const s=r(this._metadata.spatialReference);e.resultOffset=e.resultOffset??0,e.resultRecordCount=e.resultRecordCount??this._getFeatureCount(),e.returnGeometry=!0,delete e.outFields;const o=i(u(),c),n=u(),a=await this._enqueueQuery(e,t);let l=0;for(const r of a.items)r.getBounds(n)&&(f(o,n),l+=1);return{count:l,extent:m(o,s,e.outSR?r(e.outSR):s,s,!1)}}_getFeatureCount(){return Array.from(this._fileInfos.values()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(e.outStatistics)throw new s("parquet:unsupported","Statistics queries are not supported",{query:e});if(e.orderByFields?.length)throw new s("parquet:unsupported","Queries using orderBy are not supported",{query:e})}async*_fetchChunks(e,t){for(const r of this._fileInfos.values()){const s=r.file.numRows(),o=Math.ceil(s/j);for(let n=0;n<o;n++){const s=n*j,o=await r.file.readChunk(s,j,e.fields,e.returnGeometry,t);for(const e of o){const t=new C(this._metadata,this._fieldsIndex,e,0,r.index),s=new x(t,null,0,!1),o=S(this._metadata,[s],this._queryEngineParams);yield o}}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.objectIds?.length)for(const o of this._fileInfos.values()){const s=[],n=(await o.file.readChunksByRowId(new Uint32Array(e.objectIds),r.fields,r.returnGeometry,t)).map((e,t)=>new C(this._metadata,this._fieldsIndex,e,t,o.index)).map((e,t)=>new x(e,null,t,!1)),a=S(this._metadata,n,this._queryEngineParams),i=await a.executeQueryForOpaqueFeatures(e,t);for(const e of i)s.push(e);return new y(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:q})}let s=e.resultRecordCount,n=e.resultOffset;o(s),o(n),delete e.resultRecordCount,delete e.resultOffset;const a=[];for await(const o of this._fetchChunks(r,t)){const r=await o.executeQueryForOpaqueFeatures(e,t);if(r.length>n){const t=r.slice(n,Math.min(n+s,r.length));for(const e of t)a.push(e);if(n=0,s-=t.length,0===s)return new y(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:q})}else n-=r.length}return new y(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:q})}async _getReadParams(e){const t=new Set;if(e.where&&await _(t,this._fieldsIndex,e.where),e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:this._getAttributeIds(Array.from(t)),returnGeometry:!!e.returnGeometry||!!e.geometry}}_getAttributeIds(e){if(null==e)return new Uint32Array;if(e.includes("*"))return new Uint32Array(this._fieldsIndex.fields.map(e=>e.column).filter(e=>null!=e));const t=[];for(const r of e){const e=this._fieldsIndex.get(r);if(null==e)throw new s("unknown-field",`Field ${r} does not exist`);null==e.column||t.push(e.column)}return new Uint32Array(t)}}function Q(e){return Object.keys(e).some(e=>v(e))}function v(e){switch(e){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"where":case"objectIds":case"historicMoment":return!0;default:return!1}}function S(e,t,r){const s=new R(()=>e);for(const o of t)s.insert(o);return new h({...r,featureStore:s})}function O(e){switch(e.length){case 4:return d(u(),e);case 6:return e;default:throw new s("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function E(e,t){const r=i(u(),c);for(const s of e){const e=I(s.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const o=O(t.bbox);f(r,o)}return{xmin:r[0],ymin:r[1],xmax:r[3],ymax:r[4],spatialReference:t}}export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";import{initializeProjection as m,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as T}from"./supportUtils.js";import{executeQueryStreaming as I}from"../../rest/knowledgeGraphService.js";import M from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import D from"../../rest/support/Query.js";let E=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach(e=>{o(this.memberIdTypeLookup,e.id,()=>new Set).add(s)}),this.sublayerCaches.set(s,a)})}addToLayer(e){e.forEach(({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}})}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new D({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach(i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)}),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[l,m]of s){const e=`${l}_ids`;a[e]=m,t&&0!==t?.length?r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await I(this.knowledgeGraph,new M({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,l]of n.entries()){const e=`${d}_ids`;o[e]=l,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await I(this.knowledgeGraph,new M({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[m,h]of o.entries()){const e=`${m}_ids`;s[e]=h,a.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await I(this.knowledgeGraph,new M({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const l=[];for(const[m,h]of p)for(const e of h)l.push({id:e,typeName:m});return l}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],l=new Map,m=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&m.set(e.name,e)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&m.set(e.name,e)}),e||this.inclusionModeDefinition?e?e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))l.has(t)?l.get(t)?.push(e):l.set(t,[e])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e.useAllData?l.set(t,null):e.members&&e.members.forEach(e=>{l.has(t)&&null!==l.get(t)?l.get(t)?.push(e.id):l.set(t,[e.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,null)}));for(const[s,h]of l){const e=new Set(h),l=new Promise((d,l)=>{const c=async()=>{const d=new Set,l=[];let c,u="",f=!1;if(t||m.get(s)?.properties?.forEach(e=>{e.name&&d.add(e.name)}),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach(e=>{u+=`, n.${e}`,l.push(e)});else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach(e=>{u+=`, n.${e}`,l.push(e)})}c=new M(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await I(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,()=>new Set).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,()=>new Set).add(p.id),o(this.relationshipConnectionsLookup,p.id,()=>[p.originId,p.destinationId]));a<t.length;a++)p.properties[l[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach(e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],()=>new Set).add(s))})}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then(()=>{d(null)}).catch(e=>{"AbortError"===e.name?d(null):l(e)})});d.push(l),this._processingCacheUpdatesLookup.get(s)?.push(l)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map(e=>e.id));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)});t.forEach(e=>{this.sublayerCaches.get(e)?.forEach((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)})})}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,D=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let E=!b&&D?Array.from(D).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(E=e.objectIds);else if(null!=e.objectIds&&E&&E.length>0){const t=e.objectIds;e.objectIds=E.filter(e=>t.includes(e))}else if(null!=e.objectIds)E=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=E}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach(e=>{s.add(e.name)}):i.forEach(e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)})}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let w=b?.geometryMaxBoundingRectangleSizeX,I=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await m(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(w&&I&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:w,ymax:I}),t=h(e,c);w=t.xmax,I=t.ymax}if(o.xmax-o.xmin>w)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${w}° latitude, limit exceeded`);if(o.ymax-o.ymin>I)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${I}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(e=>{i.fieldNames.includes(e.name)&&s.add(e.name)})}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{u+=`, n.${e}`,r.push(e)}),p=new M({openCypherQuery:u,bindParameters:{param_filter_geom:new l({rings:T(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach(e=>{n.fieldNames.includes(e.name)&&s.add(e.name)});const o=new Set(["column-reference","string","number","binary-expression"]),r=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let p=!1;const d=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return p=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return p=!0,"";{let i=e.right.value;i.startsWith("%")&&(i=i.slice(1)),i.endsWith("%")&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,""};i=d(n.parseTree),p&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;E&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{n+=`, n.${e}`,r.push(e)}),p=new M(E?{openCypherQuery:n,bindParameters:{ids:E}}:{openCypherQuery:n})}const N=(await I(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await N.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}}),t}};e([r()],E.prototype,"knowledgeGraph",void 0),e([r()],E.prototype,"inclusionModeDefinition",void 0),e([r()],E.prototype,"entityTypeNames",void 0),e([r()],E.prototype,"relationshipTypeNames",void 0),e([r()],E.prototype,"geographicLookup",void 0),e([r()],E.prototype,"sublayerCaches",void 0),e([r()],E.prototype,"nodeConnectionsLookup",void 0),e([r()],E.prototype,"relationshipConnectionsLookup",void 0),e([r()],E.prototype,"memberIdTypeLookup",void 0),E=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],E);export{E as KnowledgeGraphLayerDataManager};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import m from"../../geometry/Polygon.js";import{initializeProjection as l,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import{recursiveParseSqlToCypher as T}from"./cypherUtils.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as I}from"./supportUtils.js";import{executeQueryStreaming as M}from"../../rest/knowledgeGraphService.js";import D from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import E from"../../rest/support/Query.js";let N=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach(e=>{o(this.memberIdTypeLookup,e.id,()=>new Set).add(s)}),this.sublayerCaches.set(s,a)})}addToLayer(e){e.forEach(({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}})}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new E({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach(i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)}),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[m,l]of s){const e=`${m}_ids`;a[e]=l,t&&0!==t?.length?r.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await M(this.knowledgeGraph,new D({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,m]of n.entries()){const e=`${d}_ids`;o[e]=m,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await M(this.knowledgeGraph,new D({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[l,h]of o.entries()){const e=`${l}_ids`;s[e]=h,a.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await M(this.knowledgeGraph,new D({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const m=[];for(const[l,h]of p)for(const e of h)m.push({id:e,typeName:l});return m}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],m=new Map,l=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,e)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&l.set(e.name,e)}),e||this.inclusionModeDefinition?e?e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))m.has(t)?m.get(t)?.push(e):m.set(t,[e])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e.useAllData?m.set(t,null):e.members&&e.members.forEach(e=>{m.has(t)&&null!==m.get(t)?m.get(t)?.push(e.id):m.set(t,[e.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&m.set(e.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&m.set(e.name,null)}));for(const[s,h]of m){const e=new Set(h),m=new Promise((d,m)=>{const c=async()=>{const d=new Set,m=[];let c,u="",f=!1;if(t||l.get(s)?.properties?.forEach(e=>{e.name&&d.add(e.name)}),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach(e=>{u+=`, n.${e}`,m.push(e)});else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach(e=>{u+=`, n.${e}`,m.push(e)})}c=new D(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await M(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,()=>new Set).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,()=>new Set).add(p.id),o(this.relationshipConnectionsLookup,p.id,()=>[p.originId,p.destinationId]));a<t.length;a++)p.properties[m[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach(e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],()=>new Set).add(s))})}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then(()=>{d(null)}).catch(e=>{"AbortError"===e.name?d(null):m(e)})});d.push(m),this._processingCacheUpdatesLookup.get(s)?.push(m)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map(e=>e.id));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)});t.forEach(e=>{this.sublayerCaches.get(e)?.forEach((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)})})}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,E=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let N=!b&&E?Array.from(E).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(N=e.objectIds);else if(null!=e.objectIds&&N&&N.length>0){const t=e.objectIds;e.objectIds=N.filter(e=>t.includes(e))}else if(null!=e.objectIds)N=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=N}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach(e=>{s.add(e.name)}):i.forEach(e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)})}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let T=b?.geometryMaxBoundingRectangleSizeX,w=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await l(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await l(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(T&&w&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:T,ymax:w}),t=h(e,c);T=t.xmax,w=t.ymax}if(o.xmax-o.xmin>T)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${T}° latitude, limit exceeded`);if(o.ymax-o.ymin>w)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${w}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(e=>{i.fieldNames.includes(e.name)&&s.add(e.name)})}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{u+=`, n.${e}`,r.push(e)}),p=new D({openCypherQuery:u,bindParameters:{param_filter_geom:new m({rings:I(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach(e=>{n.fieldNames.includes(e.name)&&s.add(e.name)});const o={systemOidFieldName:y,supportedSqlTypes:new Set(["column-reference","string","number","binary-expression"]),supportedSqlOperators:new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]),unsupportedOperationFound:!1};i=T(n.parseTree,o),o.unsupportedOperationFound&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;N&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{n+=`, n.${e}`,r.push(e)}),p=new D(N?{openCypherQuery:n,bindParameters:{ids:N}}:{openCypherQuery:n})}const k=(await M(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await k.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}}),t}};e([r()],N.prototype,"knowledgeGraph",void 0),e([r()],N.prototype,"inclusionModeDefinition",void 0),e([r()],N.prototype,"entityTypeNames",void 0),e([r()],N.prototype,"relationshipTypeNames",void 0),e([r()],N.prototype,"geographicLookup",void 0),e([r()],N.prototype,"sublayerCaches",void 0),e([r()],N.prototype,"nodeConnectionsLookup",void 0),e([r()],N.prototype,"relationshipConnectionsLookup",void 0),e([r()],N.prototype,"memberIdTypeLookup",void 0),N=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],N);export{N as KnowledgeGraphLayerDataManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
async function
|
|
5
|
+
async function e(e){const{CharStream:r,CommonTokenStream:t,ParseTreeWalker:n}=await import("../../chunks/antlr4.web.js"),{default:s}=await import("./antlr/BindParamsListener.js"),{default:a}=await import("../../chunks/CypherLexer.js"),{default:o}=await import("../../chunks/CypherParser.js"),{default:i}=await import("./antlr/SimpleErrorListener.js"),p=new i,u=new a(new r(e));u.removeErrorListeners(),u.addErrorListener(p);const l=new o(new t(u));l.removeErrorListeners(),l.addErrorListener(p);const m=l.oC_Cypher(),f=new s;return(new n).walk(f,m),{bindParameters:Array.from(new Set(f.bindParams)).map(e=>e.slice(1)),parseErrors:p.errors}}const r=(e,t)=>{if("column-reference"===e.type)return e.column===t.systemOidFieldName?"ID(n)":`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&t.supportedSqlTypes.has(e.left.type)&&t.supportedSqlTypes.has(e.right.type)&&t.supportedSqlOperators.has(e.operator))return`${r(e.left,t)} ${e.operator} ${r(e.right,t)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let r="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)r+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return t.unsupportedOperationFound=!0,"";r+=`lower(n.${e.left.column})`}if(r+=" CONTAINS (","string"!==e.right.type)return t.unsupportedOperationFound=!0,"";{let t=e.right.value;t.startsWith("%")&&(t=t.slice(1)),t.endsWith("%")&&(t=t.slice(0,-1)),r+=`'${t.toLowerCase()}')`}return r}return t.unsupportedOperationFound=!0,""};export{e as getBindParametersFromCypherQuery,r as recursiveParseSqlToCypher};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as
|
|
5
|
+
import{__decorate as o}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import s from"./DateTimeFieldFormat.js";import p from"./FieldFormat.js";import a from"./NumberFieldFormat.js";const m={base:p,key:"type",errorContext:"field-configuration-field-format",typeMap:{"date-time":s,number:a}};let l=class extends(r(t)){constructor(o){super(o),this.alias=null,this.name=void 0,this.fieldFormat=null}};o([e({type:String,json:{write:!0}})],l.prototype,"alias",void 0),o([e({type:String,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"name",void 0),o([e({types:m,json:{write:!0}})],l.prototype,"fieldFormat",void 0),l=o([i("esri.layers.support.FieldConfiguration")],l);export{l as default};
|