@arcgis/core 5.2.0-next.6 → 5.2.0-next.7
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/WebLinkChart.d.ts +1 -1
- package/WebMap.d.ts +2 -2
- package/WebScene.d.ts +3 -3
- package/arcade.d.ts +9 -9
- package/arcgisGlobal.d.ts +4 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03354ad3d74d858173b4.js +1 -0
- package/assets/esri/core/workers/chunks/{07a242ea908aa8e2ba28.js → 09a4139fc6d069ab6928.js} +1 -1
- package/assets/esri/core/workers/chunks/09d0e430c66788a2626f.js +640 -0
- package/assets/esri/core/workers/chunks/0a510acf50915e00c62b.js +1 -0
- package/assets/esri/core/workers/chunks/{829a0583b8a228c65379.js → 0b169bb1969f86232a1a.js} +1 -1
- package/assets/esri/core/workers/chunks/{20e2d11f6de438ee883e.js → 0ded58ccb83f624f1460.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1ac98f48bb6d43d97c8.js → 0f3654c8157ec8f22869.js} +3 -3
- package/assets/esri/core/workers/chunks/19dcae83be0fc0aced02.js +1 -0
- package/assets/esri/core/workers/chunks/1eabe746481e0b228498.js +1 -0
- package/assets/esri/core/workers/chunks/{c27cb2a83a1d2e004501.js → 238478cfe493fd4a6100.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf706a5d065a357de51b.js → 2413b383b7f2bdcd4ced.js} +1 -1
- package/assets/esri/core/workers/chunks/277718031c903da2b3b9.js +1 -0
- package/assets/esri/core/workers/chunks/{7ed5b669010db58845f8.js → 294f2803aac000c99693.js} +1 -1
- package/assets/esri/core/workers/chunks/{093f27e4e4781870b431.js → 297ae764445e6f73a5ea.js} +1 -1
- package/assets/esri/core/workers/chunks/2b36a54927f5a7281da3.js +1 -0
- package/assets/esri/core/workers/chunks/{be0eab592db0e651b023.js → 2b814bb51704a5b4fdc2.js} +6 -6
- package/assets/esri/core/workers/chunks/3172d7fc23787a287191.js +1 -0
- package/assets/esri/core/workers/chunks/{eedee0af459e6b8a6116.js → 33e0130e6a40fc768978.js} +1 -1
- package/assets/esri/core/workers/chunks/343ba5ea459e96ba79c6.js +1 -0
- package/assets/esri/core/workers/chunks/{a2159df718a7f2f59271.js → 38a2f34661563c7c29c1.js} +1 -1
- package/assets/esri/core/workers/chunks/3a5c1c501808352857bd.js +1 -0
- package/assets/esri/core/workers/chunks/{a96c7432ca97cbeef4b8.js → 3db898a38a7c5f0efb48.js} +1 -1
- package/assets/esri/core/workers/chunks/3fbb6ff940156a981983.js +1 -0
- package/assets/esri/core/workers/chunks/{24eaf1349ffe10e616e6.js → 40c4e14e7bb505ef10a3.js} +1 -1
- package/assets/esri/core/workers/chunks/4104fa1ede36bcee9be5.js +1 -0
- package/assets/esri/core/workers/chunks/{b002304a45856b024b46.js → 4714241189c13d0db897.js} +1 -1
- package/assets/esri/core/workers/chunks/485d20152495c27b8074.js +1 -0
- package/assets/esri/core/workers/chunks/{16b90d8f628a412ba4ba.js → 4894997bfa438f66da36.js} +1 -1
- package/assets/esri/core/workers/chunks/{0e774f14ba274832f390.js → 520e0e5307eef27becc6.js} +1 -1
- package/assets/esri/core/workers/chunks/53d165b4f30fd64e5d8a.js +1 -0
- package/assets/esri/core/workers/chunks/{c83fea0d0ebd0d8e43fd.js → 542f5469f7b42026b24f.js} +1 -1
- package/assets/esri/core/workers/chunks/5553279998ae07b60f5f.js +1 -0
- package/assets/esri/core/workers/chunks/{cda99b543a0e1979346c.js → 5cb1b950249d651f3837.js} +1 -1
- package/assets/esri/core/workers/chunks/{7601278ebced0c0c31cf.js → 5e3e0d7b85dfd52d1c7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5a2c28dc26c065ea355.js → 62dfbdc847be4800e833.js} +22 -20
- package/assets/esri/core/workers/chunks/{c216cd5d6b5d4fe4bab3.js → 62e77e3c5ca9b4887923.js} +2 -2
- package/assets/esri/core/workers/chunks/{cc479daacd2cf715baa8.js → 62fc3c367f736c73b0d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1f1271434af302938e8.js → 643c33a98f2d30a92001.js} +1 -1
- package/assets/esri/core/workers/chunks/{1c1515e020e32e177b54.js → 6a5356ebed70e0f8f979.js} +1 -1
- package/assets/esri/core/workers/chunks/{3402fb9c596b582311c7.js → 75839240022b280929f7.js} +1 -1
- package/assets/esri/core/workers/chunks/77a4f6f224d7ca4b69f4.js +1 -0
- package/assets/esri/core/workers/chunks/{6637f19b82555738a1d5.js → 78aa5bc6af2758da20d0.js} +1 -1
- package/assets/esri/core/workers/chunks/7df94cb985db41815fad.js +2 -0
- package/assets/esri/core/workers/chunks/{153dc2a0b08a0e44a881.js → 8419934bec7723b0feef.js} +1 -1
- package/assets/esri/core/workers/chunks/{50dc9893e13396f5e35d.js → 875cce0be4f6c89f80f3.js} +2 -2
- package/assets/esri/core/workers/chunks/{c319c3b85cdec73a9f45.js → 877c848beaf9a939862c.js} +1 -1
- package/assets/esri/core/workers/chunks/{ae74f722fb385e45fcf1.js → 893c0d28a5bf3f9f29f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{5abe34bb0110694f7b42.js → 90953a827bc89d0e6bd5.js} +1 -1
- package/assets/esri/core/workers/chunks/{14c6419568d8a7a15cd6.js → 92ab5886aa2d8b9b179f.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e676e888a935c507d90.js → 93d4bda22bde33fafa57.js} +1 -1
- package/assets/esri/core/workers/chunks/{fbb23db01f3cf629d32e.js → 992a90ecbab931198fd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{1765042635084f75d2b3.js → 9b676606bf839b7aa433.js} +1 -1
- package/assets/esri/core/workers/chunks/a261f4c22224511fdfff.js +1 -0
- package/assets/esri/core/workers/chunks/{ea8f642b1db933d2c26f.js → a2ac139d0975085279a6.js} +1 -1
- package/assets/esri/core/workers/chunks/a4d3cbc02dc1186a9a6d.js +1 -0
- package/assets/esri/core/workers/chunks/a8ec5b85c2fa6fb4f391.js +1 -0
- package/assets/esri/core/workers/chunks/{6af77529c977d034d287.js → b23009d9f8eb7c20ce45.js} +1 -1
- package/assets/esri/core/workers/chunks/{1f55d60d3adc31283296.js → b79428c5093614174e76.js} +1 -1
- package/assets/esri/core/workers/chunks/b9bdb1f05e904c3655e4.js +1 -0
- package/assets/esri/core/workers/chunks/c4fc85281ca83af7abaf.js +1 -0
- package/assets/esri/core/workers/chunks/c983e5ce0ff952b65d7f.js +1 -0
- package/assets/esri/core/workers/chunks/{f79bd469b25099a31274.js → ca6907e14b1dde4d5c07.js} +1 -1
- package/assets/esri/core/workers/chunks/cbbd94c53e75efc99876.js +1 -0
- package/assets/esri/core/workers/chunks/{8f94c90fdb0333da2d0f.js → cfd28eba44cf5a296c6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{e9dcc3e9dbafe9bbed84.js → d21480b078ec9680d4c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{ace1899a8e5162b4018d.js → d6bb8db22ba85ad05fd7.js} +1 -1
- package/assets/esri/core/workers/chunks/{8244b74e9c3a30d8d2f6.js → d9d4754062758789f186.js} +2 -2
- package/assets/esri/core/workers/chunks/{d35c475f004367e333eb.js → e094364e54981c91e1b4.js} +1 -1
- package/assets/esri/core/workers/chunks/e33d2ede6c9f1527d51b.js +1 -0
- package/assets/esri/core/workers/chunks/{3e3134e4bc34d4e07179.js → e545df5ea7c0ced92cee.js} +1 -1
- package/assets/esri/core/workers/chunks/{49f6c9e9980b8c624fd7.js → f02fe24177e56a7e42b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1ccc5f2d8892328ab01.js → f5731ad4cfbbf1cc569a.js} +2 -2
- package/assets/esri/themes/base/widgets/_DatePicker.scss +1 -1
- package/chunks/RealisticTree.glsl.js +17 -15
- package/config.d.ts +2 -2
- package/config.js +1 -1
- package/core/Collection.d.ts +25 -25
- package/core/Error.d.ts +1 -1
- package/core/JSONSupport.d.ts +1 -1
- package/core/promiseUtils.d.ts +3 -3
- package/core/reactiveUtils.d.ts +4 -4
- package/core/sql/WhereClause.d.ts +1 -1
- package/core/timeUtils.d.ts +1 -1
- package/core/workers/Connection.d.ts +9 -9
- package/core/workers.d.ts +1 -1
- package/editing/types.d.ts +3 -3
- package/geometry/Mesh.d.ts +9 -2
- package/geometry/Mesh.js +1 -1
- package/geometry/support/MeshMaterial.d.ts +5 -5
- package/geometry/support/MeshTexture.d.ts +19 -19
- package/geometry/support/jsonUtils.d.ts +1 -1
- package/geometry/support/meshUtils.d.ts +130 -2
- package/geometry/support/meshUtils.js +1 -1
- package/identity/Credential.d.ts +1 -1
- package/identity/IdentityManager.d.ts +1 -1
- package/identity/OAuthInfo.d.ts +1 -1
- package/identity/ServerInfo.d.ts +2 -2
- package/interfaces.d.ts +13 -0
- package/intl/number.d.ts +3 -3
- package/intl/substitute.d.ts +2 -2
- package/intl.d.ts +28 -28
- package/kernel.js +1 -1
- package/layers/AnnotationLayer.js +1 -1
- package/layers/BaseDynamicLayer.d.ts +5 -5
- package/layers/BaseTileLayer.d.ts +4 -4
- package/layers/BuildingSceneLayer.d.ts +1 -1
- package/layers/CSVLayer.d.ts +7 -1
- package/layers/CatalogLayer.d.ts +6 -0
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +44 -7
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +7 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +5 -5
- package/layers/MediaLayer.d.ts +2 -2
- package/layers/OrientedImageryLayer.d.ts +29 -2
- package/layers/ParquetLayer.d.ts +7 -1
- package/layers/SceneLayer.d.ts +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.d.ts +1 -1
- package/layers/SubtypeGroupLayer.d.ts +7 -1
- package/layers/TileLayer.d.ts +2 -2
- package/layers/VideoLayer.d.ts +1 -1
- package/layers/VoxelLayer.d.ts +4 -4
- package/layers/WCSLayer.d.ts +2 -2
- package/layers/WFSLayer.d.ts +6 -0
- package/layers/WebTileLayer.d.ts +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +20 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +6 -0
- package/layers/mixins/ArcGISImageService.d.ts +7 -1
- package/layers/mixins/BlendLayer.d.ts +1 -1
- package/layers/mixins/DataSeriesLayer.d.ts +161 -0
- package/layers/mixins/DataSeriesLayer.js +2 -0
- package/layers/mixins/FeatureLayerBase.d.ts +3 -3
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/support/DateTimeFieldFormat.d.ts +10 -10
- package/layers/support/FeatureEffect.d.ts +22 -22
- package/layers/support/FeatureReductionBinning.d.ts +12 -0
- package/layers/support/FeatureReductionCluster.d.ts +12 -0
- package/layers/support/Field.d.ts +2 -2
- package/layers/support/ImageElement.d.ts +1 -1
- package/layers/support/MosaicRule.d.ts +0 -2
- package/layers/support/NumberFieldFormat.d.ts +5 -5
- package/layers/support/StreamConnection.d.ts +1 -1
- package/layers/support/Sublayer.d.ts +2 -2
- package/layers/support/SubtypeSublayer.d.ts +14 -1
- package/layers/support/TimeSeriesFieldTimeMapping.d.ts +30 -0
- package/layers/support/TimeSeriesFieldTimeMapping.js +2 -0
- package/layers/support/TimeSeriesInfo.d.ts +149 -0
- package/layers/support/TimeSeriesInfo.js +2 -0
- package/layers/support/VideoElement.d.ts +1 -1
- package/layers/support/dataSeriesUtils.d.ts +18 -0
- package/layers/support/dataSeriesUtils.js +2 -0
- package/layers/support/kmlUtils.js +1 -1
- package/layers/support/timeSeriesUtils.d.ts +27 -0
- package/layers/support/timeSeriesUtils.js +2 -0
- package/layers/types.d.ts +1 -1
- package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
- package/networks/CircuitManager.d.ts +1 -1
- package/networks/Network.d.ts +1 -1
- package/networks/UnitIdentifierManager.d.ts +1 -1
- package/networks/support/NamedTraceConfiguration.d.ts +1 -1
- package/networks/support/TraceConfiguration.d.ts +2 -2
- package/networks/support/UNTraceConfiguration.d.ts +3 -3
- package/networks/support/jsonTypes.d.ts +7 -1
- package/networks/support/utils.js +1 -1
- package/package.json +3 -3
- package/popup/content/CustomContent.d.ts +1 -1
- package/portal/Portal.d.ts +2 -2
- package/portal/jsonTypes.d.ts +2 -2
- package/renderers/support/AuthoringInfo.d.ts +14 -1
- package/renderers/support/AuthoringInfo.js +1 -1
- package/renderers/support/AuthoringInfoVisualVariable.d.ts +14 -1
- package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
- package/renderers/support/jsonUtils.d.ts +1 -1
- package/renderers/support/utils.d.ts +1 -1
- package/renderers/visualVariables/RotationVariable.d.ts +16 -1
- package/renderers/visualVariables/RotationVariable.js +1 -1
- package/request/types.d.ts +23 -23
- package/rest/geometryService.d.ts +1 -1
- package/rest/knowledgeGraph/CreateReplicaResponse.d.ts +1 -1
- package/rest/knowledgeGraph/GraphApplyEdits.d.ts +1 -1
- package/rest/knowledgeGraph/GraphProperty.d.ts +5 -1
- package/rest/knowledgeGraph/GraphQueryStreamingResult.d.ts +2 -2
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +1 -1
- package/rest/knowledgeGraphService.d.ts +13 -13
- package/rest/layerSources/DynamicDataLayer.d.ts +1 -1
- package/rest/print.d.ts +1 -1
- package/rest/support/AttributeBinsQuery.d.ts +16 -2
- package/rest/support/ClosestFacilityParameters.d.ts +6 -6
- package/rest/support/LastMileDeliveryParameters.d.ts +4 -4
- package/rest/support/LocationToAddressParameters.d.ts +1 -1
- package/rest/support/PrintTemplate.d.ts +5 -5
- package/rest/support/Query.d.ts +18 -4
- package/rest/support/RouteParameters.d.ts +5 -5
- package/rest/support/ServiceAreaParameters.d.ts +6 -6
- package/rest/support/TopFeaturesQuery.d.ts +16 -2
- package/rest/support/meshFeatureSet.js +1 -1
- package/smartMapping/renderers/color.d.ts +40 -0
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/opacity.d.ts +8 -0
- package/smartMapping/renderers/opacity.js +1 -1
- package/smartMapping/renderers/size.d.ts +38 -0
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/regenerateUtils.js +1 -1
- package/smartMapping/renderers/support/timeSeriesUtils.js +2 -0
- package/smartMapping/renderers/type.d.ts +20 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/renderers/univariateColorSize.d.ts +19 -0
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/support/revision.js +1 -1
- package/support/tests/setupServiceMocksMesh.js +1 -1
- package/support/timeUtils.d.ts +3 -3
- package/symbols/Font.d.ts +7 -7
- package/symbols/WebStyleSymbol.d.ts +11 -11
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/support/Symbol3DEmissive.d.ts +8 -2
- package/symbols/support/jsonUtils.d.ts +1 -1
- package/time/TimeExtent.d.ts +2 -2
- package/versionManagement/VersionManagementService.d.ts +8 -8
- package/versionManagement/VersionManager.d.ts +13 -3
- package/versionManagement/VersioningState.d.ts +4 -4
- package/views/2d/MapViewConstraints.d.ts +29 -25
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/BaseLayerView2D.d.ts +4 -20
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +6 -22
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -1
- package/views/3d/glTF/internal/resourceUtils.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/webgl/RenderNode.d.ts +7 -7
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/BreakpointsOwner.d.ts +1 -1
- package/views/DOMContainer.d.ts +6 -6
- package/views/Magnifier.d.ts +1 -1
- package/views/MapView.d.ts +1 -1
- package/views/SceneView.d.ts +2 -2
- package/views/View2D.d.ts +62 -54
- package/views/Viewport2DMixin.d.ts +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileError.d.ts +1 -1
- package/views/input/gamepad/GamepadInputDevice.d.ts +1 -1
- package/views/input/types.d.ts +15 -15
- package/views/layers/FeatureLikeLayerView.d.ts +7 -4
- package/views/layers/GraphicsLayerView.d.ts +6 -3
- package/views/layers/ImageryLayerView.d.ts +4 -0
- package/views/navigation/Navigation.d.ts +1 -1
- package/views/support/WebAssemblyRequirements.js +1 -1
- package/views/types.d.ts +1 -1
- package/webscene/Glow.d.ts +0 -4
- package/widgets/BasemapGallery.d.ts +1 -1
- package/widgets/BasemapLayerList.d.ts +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm.d.ts +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.d.ts +1 -1
- package/widgets/BuildingExplorer.d.ts +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +2 -2
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.d.ts +2 -2
- package/widgets/Daylight.d.ts +1 -1
- package/widgets/Directions.d.ts +1 -1
- package/widgets/Editor.d.ts +1 -1
- package/widgets/Feature.d.ts +1 -1
- package/widgets/FeatureForm.d.ts +1 -1
- package/widgets/FeatureTable/FieldColumn.d.ts +1 -14
- package/widgets/FeatureTable/Grid/Column.d.ts +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -1
- package/widgets/FeatureTemplates.d.ts +1 -1
- package/widgets/FloorFilter.d.ts +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.d.ts +3 -3
- package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
- package/widgets/Fullscreen.d.ts +3 -3
- package/widgets/LayerList/ListItemPanel.d.ts +5 -5
- package/widgets/Legend.d.ts +1 -1
- package/widgets/Locate/LocateViewModel.d.ts +2 -2
- package/widgets/Locate.d.ts +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Popup.d.ts +1 -1
- package/widgets/Print/PrintViewModel.d.ts +2 -2
- package/widgets/Print/TemplateOptions.d.ts +4 -4
- package/widgets/Print.d.ts +6 -6
- package/widgets/Search/SearchViewModel.d.ts +5 -5
- package/widgets/Search.d.ts +4 -4
- package/widgets/ShadowCast.d.ts +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +1 -1
- package/widgets/Slice.d.ts +1 -1
- package/widgets/TableList/ListItemPanel.d.ts +5 -5
- package/widgets/Track/TrackViewModel.d.ts +3 -3
- package/widgets/Track.d.ts +3 -3
- package/widgets/UtilityNetworkTrace.d.ts +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.d.ts +2 -2
- package/widgets/Weather.d.ts +1 -1
- package/widgets/Widget.d.ts +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/widgets/support/types.d.ts +1 -1
- package/widgets/support/widget.d.ts +6 -6
- package/assets/esri/core/workers/chunks/1ddbf5f507ac153234be.js +0 -1
- package/assets/esri/core/workers/chunks/29615df388a0df022d8c.js +0 -1
- package/assets/esri/core/workers/chunks/2bd334f9ab89334df713.js +0 -1
- package/assets/esri/core/workers/chunks/319ff04282dc8ae38b56.js +0 -2
- package/assets/esri/core/workers/chunks/3a6678ee9990d7e83e15.js +0 -1
- package/assets/esri/core/workers/chunks/3b3986276e70297d573b.js +0 -1
- package/assets/esri/core/workers/chunks/46fbd519cc1a37923bfc.js +0 -1
- package/assets/esri/core/workers/chunks/4ef53455c8bc6efee80e.js +0 -1
- package/assets/esri/core/workers/chunks/51ee6102f5f4840a5b47.js +0 -1
- package/assets/esri/core/workers/chunks/58994b6bfcda5f2ada80.js +0 -1
- package/assets/esri/core/workers/chunks/6db274f6767102a39021.js +0 -1
- package/assets/esri/core/workers/chunks/77769663cd712822d33e.js +0 -1
- package/assets/esri/core/workers/chunks/8c5a41ae68775bac3446.js +0 -1
- package/assets/esri/core/workers/chunks/b08a1255dacf6cfcf139.js +0 -640
- package/assets/esri/core/workers/chunks/b098469e0010a6b44df9.js +0 -1
- package/assets/esri/core/workers/chunks/ca1b0cb14ea9ae1bf2a3.js +0 -1
- package/assets/esri/core/workers/chunks/ca4245414d8ecd217f9d.js +0 -1
- package/assets/esri/core/workers/chunks/d3af51a6d9014ff46170.js +0 -1
- package/assets/esri/core/workers/chunks/d561dc933d8fe1672d85.js +0 -1
- package/assets/esri/core/workers/chunks/e38836bfcc7a15a2fd1f.js +0 -1
- package/assets/esri/core/workers/chunks/e645f992ec6f935ee3a5.js +0 -1
- package/assets/esri/core/workers/chunks/eabd4a78221b7e733793.js +0 -1
- package/assets/esri/core/workers/chunks/f05932aea4eb267cba4d.js +0 -1
- /package/assets/esri/core/workers/chunks/{50dc9893e13396f5e35d.js.LICENSE.txt → 62e77e3c5ca9b4887923.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{319ff04282dc8ae38b56.js.LICENSE.txt → 7df94cb985db41815fad.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c216cd5d6b5d4fe4bab3.js.LICENSE.txt → 875cce0be4f6c89f80f3.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{8244b74e9c3a30d8d2f6.js.LICENSE.txt → d9d4754062758789f186.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d1ccc5f2d8892328ab01.js.LICENSE.txt → f5731ad4cfbbf1cc569a.js.LICENSE.txt} +0 -0
package/layers/SceneLayer.d.ts
CHANGED
|
@@ -352,7 +352,7 @@ export interface SceneLayerEvents extends EditBusLayerEvents, LayerEvents {}
|
|
|
352
352
|
* ## Publishing a SceneLayer
|
|
353
353
|
*
|
|
354
354
|
* The SceneLayer displays data coming from a
|
|
355
|
-
* [Scene service](https://
|
|
355
|
+
* [Scene service](https://doc.esri.com/en/arcgis-enterprise/latest/plan/base-arcgis-enterprise-deployment.html).
|
|
356
356
|
* Scene services can hold large volumes of features in an open format that is suitable for web streaming.
|
|
357
357
|
* The SceneLayer loads these features progressively, starting from coarse representations and refines them to
|
|
358
358
|
* higher detail as necessary for close-up views.
|
package/layers/SceneLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../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{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,throwIfAborted as u,isAbortError as y,throwIfNotAbortError as c}from"../core/promiseUtils.js";import{whenOnce as m}from"../core/reactiveUtils.js";import{property as h,subclass as f}from"../core/accessorSupport/decorators.js";import{getProperties as g}from"../core/accessorSupport/utils.js";import v from"../geometry/Point.js";import{projectAsync as w}from"../geometry/projectionUtils.js";import b from"../graphic/SceneGraphicOrigin.js";import I from"./Layer.js";import{NoModelError as L,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 T}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as O}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{SceneService as A}from"./mixins/SceneService.js";import{useViewTimeProperty as E}from"./mixins/TemporalLayer.js";import{isHostedAgolService as U}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as D}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as q}from"./support/capabilities.js";import{elevationInfo as R,labelsVisible as C,legendEnabled as Q,popupEnabled as N,attributeTableTemplate as G,screenSizePerspectiveEnabled as k}from"./support/commonProperties.js";import{getFieldDomain as M,computeEffectiveEditingEnabled as V,getGlobalIdToObjectIdMap as K}from"./support/featureLayerUtils.js";import z from"./support/FeatureReductionSelection.js";import{defineFieldProperties as $}from"./support/fieldProperties.js";import H from"./support/FieldsIndex.js";import{fixRendererFields as W,fixTimeInfoFields as B,unpackFieldNames as Z}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{layersLoaderMap as ae}from"./support/layersLoader.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 ue}from"./support/sceneLayerStatistics.js";import{SceneServiceTimeInfo as ye}from"./support/SceneServiceTimeInfo.js";import ce from"./support/TimeInfo.js";import{loadStyleRenderer as me}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as he}from"../renderers/support/typeUtils.js";import fe from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as ge,elevationModeUnsupportedMessage as ve,featureExpressionUnsupportedMessage as we}from"../support/elevationInfoUtils.js";import{createPopupTemplate as be}from"../support/popupUtils.js";import{extractZipFiles as Ie}from"../support/zipUtils.js";import Le from"../time/TimeExtent.js";import je from"../time/TimeInterval.js";import{queryAttributesFromCachedAttributesId as Fe}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Se,getFetchPopupTemplate as Te}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Oe}from"../webdoc/support/opacityUtils.js";import{reader as _e}from"../core/accessorSupport/decorators/reader.js";const xe=new Set(["3DObject","Point"]),Pe=$();let Ae=class extends(O(A(S(_(x(P(p(T(F(i(I))))))))))){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,this.serviceTimeInfo=null}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 H(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&&V(this.associatedLayer)}get geometryType(){return Ue[this.profile]||"mesh"}set renderer(e){W(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:u},operations:{supportsEditing:y,supportsAdd:c,supportsUpdate:m,supportsDelete:h,supportsQuery:f,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,w=e.operations.supportsChangeTracking,b=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:b&&a,supportsUploadWithItemId:o},data:{supportsAttachment:u,supportsZ:l,supportsM:p,isVersioned:d,queryFormats:e.data.queryFormats,sourceFormats:e.data.sourceFormats},operations:{supportsQuery:f,supportsQueryAttachments:g,supportsEditing:y&&w,supportsAdd:b&&c&&w,supportsDelete:b&&h&&w,supportsUpdate:m&&w,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&&Ee[r]?Ee[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)}get timeInfo(){const e=this.associatedLayer?.timeInfo;if(null==e)return null;const t=e.clone();return B(t,this.fieldsIndex),t}set timeInfo(e){B(e,this.fieldsIndex),this._override("timeInfo",e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override("timeExtent",e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override("timeOffset",e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override("datesInUnknownTimezone",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e?.signal;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 me(this,{origin:"service"},t),W(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 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 queryModels(e,t){const[r,{queryModels:i}]=await Promise.all([this._getAssociatedLayerForQuery(),import("./scene/modelQuerySupport.js")]);return i(this,r,e,t)}async queryModel(e,t){const[r,{queryModel:i}]=await Promise.all([this._getAssociatedLayerForQuery(),import("./scene/modelQuerySupport.js")]);return i(this,r,e,t)}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=Z(this.fieldsIndex,await Se(this,Te(this)));return Fe(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 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 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 U(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(t),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e);u(t);const s=i.reduce((e,t)=>te(this.infoFor3D,t)?e+1:e,0);0===s&&r(new L),s>1&&r(new j);const a=this.spatialReference,l=t.origin,p=await w(l??t.defaultOrigin??new v({x:0,y:0,z:0,spatialReference:a}),a,t),d=a.isGeographic?"local":"georeferenced",{default:y}=await import("../geometry/Mesh.js");u(t);const c=y.createWithExternalSource(p,{type:"client",files:i},{vertexSpace:d,transform:ne(a),unitConversionDisabled:!0}),[m]=await this.uploadAssets([c],{...t,useAssetOrigin:!l});return m}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await Ie(e)).filter(e=>re(t,e))}validateLayer(e){if(e.layerType&&!xe.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=g(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)||!de(this))return;g(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 D(`${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,apiKey:this.apiKey,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 m(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void c(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&&ge(n.getLogger(this),ve("Mesh scene layers","relative-to-scene",e)),ge(n.getLogger(this),we("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})}async loadTimeInfoFromService(e){const{serviceTimeInfo:t}=this;if(null==t)return;const{startTimeField:r,endTimeField:i}=t;if(null==r&&null==i)return;if(de({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const s=async t=>{let i=null;try{const r=await this.fetchStatistics(t,e);i=r?.stats}catch{}if(null==i)return null;const{minTimeStr:s,min:o,maxTimeStr:a,max:n}=i,l=t===r?s??o:a??n;return null!=l?new Date(l):null},[o,a]=await Promise.all([s(r),s(i)]);if(null!=r&&null==o||null!=i&&null==a)return;const n=new Le({start:o,end:a});this.setAtOrigin("timeInfo",new ce({endField:i,startField:r,fullTimeExtent:n}),"service")}};e([h({types:{key:"type",base:null,typeMap:{selection:z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Ae.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})],Ae.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Ae.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Ae.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Ae.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Ae.prototype,"type",void 0),e([h({...Pe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ae.prototype,"fields",void 0),e([h()],Ae.prototype,"types",null),e([h()],Ae.prototype,"typeIdField",null),e([h()],Ae.prototype,"templates",null),e([h()],Ae.prototype,"formTemplate",null),e([h({readOnly:!0})],Ae.prototype,"graphicOrigin",void 0),e([h({readOnly:!0,clonable:!1})],Ae.prototype,"fieldsIndex",null),e([h({type:oe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Ae.prototype,"floorInfo",void 0),e([h(Pe.outFields)],Ae.prototype,"outFields",void 0),e([h({type:J,readOnly:!0,json:{read:!1},clonable:!1})],Ae.prototype,"nodePages",void 0),e([_e("service","nodePages",["nodePages","pointNodePages"])],Ae.prototype,"readNodePages",null),e([h({type:[X],readOnly:!0,clonable:!1})],Ae.prototype,"materialDefinitions",void 0),e([h({type:[Y],readOnly:!0,clonable:!1})],Ae.prototype,"textureSetDefinitions",void 0),e([h({type:[ee],readOnly:!0,clonable:!1})],Ae.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Ae.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Ae.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Ae.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}}})],Ae.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Ae.prototype,"definitionExpression",void 0),e([h({type:pe,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Ae.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Ae.prototype,"path",void 0),e([h(R)],Ae.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Ae.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Ae.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Ae.prototype,"geometryType",null),e([h(C)],Ae.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}})],Ae.prototype,"labelingInfo",void 0),e([h(Q)],Ae.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?Oe(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Ae.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ae.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ae.prototype,"semantic",void 0),e([h({types:he,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Ae.prototype,"renderer",null),e([h({json:{read:!1}})],Ae.prototype,"cachedDrawingInfo",void 0),e([_e("service","cachedDrawingInfo")],Ae.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Ae.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Ae.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Ae.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Ae.prototype,"relationships",null),e([h(N)],Ae.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Ae.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Ae.prototype,"defaultPopupTemplate",null),e([h(G)],Ae.prototype,"attributeTableTemplate",void 0),e([h({type:String,json:{read:!1}})],Ae.prototype,"objectIdField",void 0),e([_e("service","objectIdField",["objectIdField","fields"])],Ae.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Ae.prototype,"globalIdField",void 0),e([_e("service","globalIdField",["globalIdField","fields"])],Ae.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Ae.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Ae.prototype,"profile",void 0),e([_e("service","profile",["store.profile"])],Ae.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Ae.prototype,"normalReferenceFrame",void 0),e([h(k)],Ae.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Ae.prototype,"serviceItemId",void 0),e([h(E)],Ae.prototype,"useViewTime",null),e([h({type:ce,json:{read:!1,write:!1}})],Ae.prototype,"timeInfo",null),e([h({type:Le,json:{read:!1,write:!1}})],Ae.prototype,"timeExtent",null),e([h({type:je,json:{read:!1,write:!1}})],Ae.prototype,"timeOffset",null),e([h({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],Ae.prototype,"datesInUnknownTimezone",null),e([h({type:ye,readOnly:!0,json:{read:{source:"timeInfo"}},clonable:!1})],Ae.prototype,"serviceTimeInfo",void 0),Ae=e([f("esri.layers.SceneLayer")],Ae);const Ee={"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"},Ue={"mesh-pyramids":"mesh",points:"point"},De=Ae;export{De as default};
|
|
2
|
+
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{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,throwIfAborted as u,isAbortError as y,throwIfNotAbortError as c}from"../core/promiseUtils.js";import{whenOnce as m}from"../core/reactiveUtils.js";import{property as h,subclass as f}from"../core/accessorSupport/decorators.js";import{getProperties as g}from"../core/accessorSupport/utils.js";import v from"../geometry/Point.js";import{projectAsync as w}from"../geometry/projectionUtils.js";import b from"../graphic/SceneGraphicOrigin.js";import I from"./Layer.js";import{NoModelError as L,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 T}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as O}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{SceneService as A}from"./mixins/SceneService.js";import{useViewTimeProperty as E}from"./mixins/TemporalLayer.js";import{isHostedAgolService as U}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as D}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as q}from"./support/capabilities.js";import{elevationInfo as R,labelsVisible as C,legendEnabled as Q,popupEnabled as N,attributeTableTemplate as G,screenSizePerspectiveEnabled as k}from"./support/commonProperties.js";import{getFieldDomain as M,computeEffectiveEditingEnabled as V,getGlobalIdToObjectIdMap as K}from"./support/featureLayerUtils.js";import z from"./support/FeatureReductionSelection.js";import{defineFieldProperties as $}from"./support/fieldProperties.js";import H from"./support/FieldsIndex.js";import{fixRendererFields as W,fixTimeInfoFields as B,unpackFieldNames as Z}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{layersLoaderMap as ae}from"./support/layersLoader.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 ue}from"./support/sceneLayerStatistics.js";import{SceneServiceTimeInfo as ye}from"./support/SceneServiceTimeInfo.js";import ce from"./support/TimeInfo.js";import{loadStyleRenderer as me}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as he}from"../renderers/support/typeUtils.js";import fe from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as ge,elevationModeUnsupportedMessage as ve,featureExpressionUnsupportedMessage as we}from"../support/elevationInfoUtils.js";import{createPopupTemplate as be}from"../support/popupUtils.js";import{extractZipFiles as Ie}from"../support/zipUtils.js";import Le from"../time/TimeExtent.js";import je from"../time/TimeInterval.js";import{queryAttributesFromCachedAttributesId as Fe}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Se,getFetchPopupTemplate as Te}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Oe}from"../webdoc/support/opacityUtils.js";import{reader as _e}from"../core/accessorSupport/decorators/reader.js";const xe=new Set(["3DObject","Point"]),Pe=$();let Ae=class extends(O(A(S(_(x(P(p(T(F(i(I))))))))))){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,this.serviceTimeInfo=null}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 H(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&&V(this.associatedLayer)}get geometryType(){return Ue[this.profile]||"mesh"}set renderer(e){W(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:u},operations:{supportsEditing:y,supportsAdd:c,supportsUpdate:m,supportsDelete:h,supportsQuery:f,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,w=e.operations.supportsChangeTracking,b=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:b&&a,supportsUploadWithItemId:o},data:{supportsAttachment:u,supportsZ:l,supportsM:p,isVersioned:d,queryFormats:e.data.queryFormats,sourceFormats:e.data.sourceFormats},operations:{supportsQuery:f,supportsQueryAttachments:g,supportsEditing:y&&w,supportsAdd:b&&c&&w,supportsDelete:b&&h&&w,supportsUpdate:m&&w,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&&Ee[r]?Ee[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)}get timeInfo(){const e=this.associatedLayer?.timeInfo;if(null==e)return null;const t=e.clone();return B(t,this.fieldsIndex),t}set timeInfo(e){B(e,this.fieldsIndex),this._override("timeInfo",e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override("timeExtent",e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override("timeOffset",e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override("datesInUnknownTimezone",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e?.signal;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 me(this,{origin:"service"},t),W(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 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 queryModels(e,t){const[r,{queryModels:i}]=await Promise.all([this._getAssociatedLayerForQuery(),import("./scene/modelQuerySupport.js")]);return i(this,r,e,t)}async queryModel(e,t){const[r,{queryModel:i}]=await Promise.all([this._getAssociatedLayerForQuery(),import("./scene/modelQuerySupport.js")]);return i(this,r,e,t)}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=Z(this.fieldsIndex,await Se(this,Te(this)));return Fe(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 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 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 U(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(t),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e);u(t);const s=i.reduce((e,t)=>te(this.infoFor3D,t)?e+1:e,0);0===s&&r(new L),s>1&&r(new j);const a=this.spatialReference,l=t.origin,p=await w(l??t.defaultOrigin??new v({x:0,y:0,z:0,spatialReference:a}),a,t),d=a.isGeographic?"local":"georeferenced",{createWithExternalSource:y}=await import("../geometry/support/meshUtils.js");u(t);const c=y(p,{type:"client",files:i},{vertexSpace:d,transform:ne(a),unitConversionDisabled:!0}),[m]=await this.uploadAssets([c],{...t,useAssetOrigin:!l});return m}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await Ie(e)).filter(e=>re(t,e))}validateLayer(e){if(e.layerType&&!xe.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=g(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)||!de(this))return;g(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 D(`${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,apiKey:this.apiKey,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 m(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void c(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&&ge(n.getLogger(this),ve("Mesh scene layers","relative-to-scene",e)),ge(n.getLogger(this),we("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})}async loadTimeInfoFromService(e){const{serviceTimeInfo:t}=this;if(null==t)return;const{startTimeField:r,endTimeField:i}=t;if(null==r&&null==i)return;if(de({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const s=async t=>{let i=null;try{const r=await this.fetchStatistics(t,e);i=r?.stats}catch{}if(null==i)return null;const{minTimeStr:s,min:o,maxTimeStr:a,max:n}=i,l=t===r?s??o:a??n;return null!=l?new Date(l):null},[o,a]=await Promise.all([s(r),s(i)]);if(null!=r&&null==o||null!=i&&null==a)return;const n=new Le({start:o,end:a});this.setAtOrigin("timeInfo",new ce({endField:i,startField:r,fullTimeExtent:n}),"service")}};e([h({types:{key:"type",base:null,typeMap:{selection:z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Ae.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})],Ae.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Ae.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Ae.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Ae.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Ae.prototype,"type",void 0),e([h({...Pe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ae.prototype,"fields",void 0),e([h()],Ae.prototype,"types",null),e([h()],Ae.prototype,"typeIdField",null),e([h()],Ae.prototype,"templates",null),e([h()],Ae.prototype,"formTemplate",null),e([h({readOnly:!0})],Ae.prototype,"graphicOrigin",void 0),e([h({readOnly:!0,clonable:!1})],Ae.prototype,"fieldsIndex",null),e([h({type:oe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Ae.prototype,"floorInfo",void 0),e([h(Pe.outFields)],Ae.prototype,"outFields",void 0),e([h({type:J,readOnly:!0,json:{read:!1},clonable:!1})],Ae.prototype,"nodePages",void 0),e([_e("service","nodePages",["nodePages","pointNodePages"])],Ae.prototype,"readNodePages",null),e([h({type:[X],readOnly:!0,clonable:!1})],Ae.prototype,"materialDefinitions",void 0),e([h({type:[Y],readOnly:!0,clonable:!1})],Ae.prototype,"textureSetDefinitions",void 0),e([h({type:[ee],readOnly:!0,clonable:!1})],Ae.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Ae.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Ae.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Ae.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}}})],Ae.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Ae.prototype,"definitionExpression",void 0),e([h({type:pe,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Ae.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Ae.prototype,"path",void 0),e([h(R)],Ae.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Ae.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Ae.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Ae.prototype,"geometryType",null),e([h(C)],Ae.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}})],Ae.prototype,"labelingInfo",void 0),e([h(Q)],Ae.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?Oe(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Ae.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ae.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ae.prototype,"semantic",void 0),e([h({types:he,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Ae.prototype,"renderer",null),e([h({json:{read:!1}})],Ae.prototype,"cachedDrawingInfo",void 0),e([_e("service","cachedDrawingInfo")],Ae.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Ae.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Ae.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Ae.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Ae.prototype,"relationships",null),e([h(N)],Ae.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Ae.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Ae.prototype,"defaultPopupTemplate",null),e([h(G)],Ae.prototype,"attributeTableTemplate",void 0),e([h({type:String,json:{read:!1}})],Ae.prototype,"objectIdField",void 0),e([_e("service","objectIdField",["objectIdField","fields"])],Ae.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Ae.prototype,"globalIdField",void 0),e([_e("service","globalIdField",["globalIdField","fields"])],Ae.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Ae.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Ae.prototype,"profile",void 0),e([_e("service","profile",["store.profile"])],Ae.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Ae.prototype,"normalReferenceFrame",void 0),e([h(k)],Ae.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Ae.prototype,"serviceItemId",void 0),e([h(E)],Ae.prototype,"useViewTime",null),e([h({type:ce,json:{read:!1,write:!1}})],Ae.prototype,"timeInfo",null),e([h({type:Le,json:{read:!1,write:!1}})],Ae.prototype,"timeExtent",null),e([h({type:je,json:{read:!1,write:!1}})],Ae.prototype,"timeOffset",null),e([h({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],Ae.prototype,"datesInUnknownTimezone",null),e([h({type:ye,readOnly:!0,json:{read:{source:"timeInfo"}},clonable:!1})],Ae.prototype,"serviceTimeInfo",void 0),Ae=e([f("esri.layers.SceneLayer")],Ae);const Ee={"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"},Ue={"mesh-pyramids":"mesh",points:"point"},De=Ae;export{De as default};
|
package/layers/StreamLayer.d.ts
CHANGED
|
@@ -222,7 +222,7 @@ export interface StreamLayerProperties extends LayerProperties, CustomParameters
|
|
|
222
222
|
*
|
|
223
223
|
* #### Reference a service URL
|
|
224
224
|
*
|
|
225
|
-
* StreamLayer can consume a [stream service](https://
|
|
225
|
+
* StreamLayer can consume a [stream service](https://doc.esri.com/en/arcgis-enterprise/latest/administer/stream-services.html) published by
|
|
226
226
|
* [The ArcGIS GeoEvent Extension for Server](https://enterprise.arcgis.com/en/geoevent/latest/get-started/what-is-arcgis-geoevent-server.htm).
|
|
227
227
|
* To create a StreamLayer instance from a service, you must set the [url](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/#url) property of the layer to point to
|
|
228
228
|
* the REST endpoint of a stream service. For a layer to be visible in a view, it must be added to the [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/)
|
|
@@ -73,7 +73,7 @@ export interface SubtypeGroupLayerEvents extends EditBusLayerEvents, LayerEvents
|
|
|
73
73
|
* ## Overview
|
|
74
74
|
*
|
|
75
75
|
* The SubtypeGroupLayer is a single layer that automatically creates a [SubtypeSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/SubtypeSublayer/) for
|
|
76
|
-
* each subtype in its corresponding [feature service](https://
|
|
76
|
+
* each subtype in its corresponding [feature service](https://doc.esri.com/en/arcgis-enterprise/latest/administer/what-is-a-feature-service-.html). This allows for each
|
|
77
77
|
* subtype to have its own configured layer properties, and as a result, each sublayer can visualize its feature data with a distinct visibility,
|
|
78
78
|
* renderer, and popup properties. This allows for interaction of the sublayers as if they were individual layers, when in reality, they all share the same feature source.
|
|
79
79
|
*
|
|
@@ -404,6 +404,7 @@ export default class SubtypeGroupLayer extends SubtypeGroupLayerSuperclass {
|
|
|
404
404
|
* @returns The query object representing the layer's definition expression and other configurations.
|
|
405
405
|
* @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/)
|
|
406
406
|
* @example
|
|
407
|
+
* ```js
|
|
407
408
|
* // Get a query object for the layer's current configuration
|
|
408
409
|
* queryParams.outFields will be set to ["*"] to get values for all available fields.
|
|
409
410
|
* const queryParams = layer.createQuery();
|
|
@@ -417,7 +418,9 @@ export default class SubtypeGroupLayer extends SubtypeGroupLayerSuperclass {
|
|
|
417
418
|
* // prints the array of result graphics to the console
|
|
418
419
|
* console.log(results.features);
|
|
419
420
|
* });
|
|
421
|
+
* ```
|
|
420
422
|
* @example
|
|
423
|
+
* ```js
|
|
421
424
|
* // this snippet shows the query parameter object that is returned
|
|
422
425
|
* // from FeatureLayer.createQuery().
|
|
423
426
|
* const queryParams = new Query();
|
|
@@ -440,12 +443,15 @@ export default class SubtypeGroupLayer extends SubtypeGroupLayerSuperclass {
|
|
|
440
443
|
* queryParams.outFields = ["*"];
|
|
441
444
|
* queryParams.where = layer.definitionExpression || "1=1";
|
|
442
445
|
* queryParams.multipatchOption = layer.geometryType === "multipatch" ? "xyFootprint" : null;
|
|
446
|
+
* ```
|
|
443
447
|
* @example
|
|
448
|
+
* ```js
|
|
444
449
|
* // this snippet shows query image footprints from imagery layer
|
|
445
450
|
* // that honors the layer's definitionExpression and other configurations.
|
|
446
451
|
* if (imageryLayer.capabilities.operations.supportsQuery) {
|
|
447
452
|
* const query = imageryLayer.createQuery();
|
|
448
453
|
* const rasters = await imageryLayer.queryRasters(query);
|
|
454
|
+
* ```
|
|
449
455
|
*/
|
|
450
456
|
createQuery(): Query;
|
|
451
457
|
/**
|
package/layers/TileLayer.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface TileLayerProperties extends LayerProperties, CustomParametersMi
|
|
|
33
33
|
export interface TileLayerEvents extends MapImageLayerEvents {}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* The TileLayer allows you work with a cached [map service](https://
|
|
36
|
+
* The TileLayer allows you work with a cached [map service](https://doc.esri.com/en/arcgis-enterprise/latest/administer/what-is-a-map-service.html)
|
|
37
37
|
* exposed by the ArcGIS Server REST API and add it to
|
|
38
38
|
* a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) as a tile layer.
|
|
39
39
|
* A cached service accesses tiles from a cache instead of dynamically rendering images.
|
|
@@ -189,7 +189,7 @@ export default class TileLayer extends TileLayerSuperclass {
|
|
|
189
189
|
* @param col - The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/).
|
|
190
190
|
* @param options - Optional settings for the tile request. The options have the following properties.
|
|
191
191
|
* @returns Returns a promise that resolves to an
|
|
192
|
-
* [HTMLImageElement](https://developer.mozilla.org/
|
|
192
|
+
* [HTMLImageElement](https://developer.mozilla.org/docs/Web/API/HTMLImageElement).
|
|
193
193
|
*/
|
|
194
194
|
fetchTile(level: number, row: number, col: number, options?: AbortOptions): Promise<HTMLImageElement>;
|
|
195
195
|
/**
|
package/layers/VideoLayer.d.ts
CHANGED
|
@@ -209,7 +209,7 @@ export default class VideoLayer extends VideoLayerSuperclass {
|
|
|
209
209
|
* Defines the codecs on the media content of the video layer. The
|
|
210
210
|
* codec for audio, text and video are defined on the video service
|
|
211
211
|
* during layer creation. Media type and formats are described in more
|
|
212
|
-
* detail [here](https://developer.mozilla.org/
|
|
212
|
+
* detail [here](https://developer.mozilla.org/docs/Web/Media/Guides/Formats).
|
|
213
213
|
*
|
|
214
214
|
* @since 4.33
|
|
215
215
|
*/
|
package/layers/VoxelLayer.d.ts
CHANGED
|
@@ -135,8 +135,8 @@ export type VoxelRenderMode = "volume" | "surfaces";
|
|
|
135
135
|
* <span id="creating-a-voxel-layer"></span>
|
|
136
136
|
* ## Creating a VoxelLayer
|
|
137
137
|
* From ArcGIS Pro, you can [author](https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/voxel-scene-layer.htm) a
|
|
138
|
-
* voxel layer and [publish](https://
|
|
139
|
-
* it as a [Scene Service](https://
|
|
138
|
+
* voxel layer and [publish](https://doc.esri.com/en/arcgis-enterprise/latest/share/publish-scenes.html)
|
|
139
|
+
* it as a [Scene Service](https://doc.esri.com/en/arcgis-enterprise/latest/administer/approaches-for-publishing-services-with-arcgis.html).
|
|
140
140
|
* Scene Services can be hosted on ArcGIS Online or ArcGIS Enterprise by uploading a Scene Layer Package (.slpk) or
|
|
141
141
|
* by [sharing](https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/voxel-scene-layer.htm#ESRI_SECTION1_C30D73392D964D51A8B606128A8A6E8F)
|
|
142
142
|
* it from ArcGIS Pro.
|
|
@@ -208,8 +208,8 @@ export type VoxelRenderMode = "volume" | "surfaces";
|
|
|
208
208
|
* It is possible to have multiple slices in a VoxelLayer
|
|
209
209
|
* by modifying the [VoxelVolumeStyle's slices](https://developers.arcgis.com/javascript/latest/references/core/layers/voxel/VoxelVolumeStyle/#slices) or
|
|
210
210
|
* by authoring [slices](https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/voxel-layer-slices.htm) in ArcGIS Pro
|
|
211
|
-
* before [publishing](https://
|
|
212
|
-
* the voxel layer as a [scene service](https://
|
|
211
|
+
* before [publishing](https://doc.esri.com/en/arcgis-enterprise/latest/administer/approaches-for-publishing-services-with-arcgis.html)
|
|
212
|
+
* the voxel layer as a [scene service](https://doc.esri.com/en/arcgis-enterprise/latest/share/publish-scenes.html).
|
|
213
213
|
*
|
|
214
214
|
* Slices modified using [VoxelVolumeStyle's slices](https://developers.arcgis.com/javascript/latest/references/core/layers/voxel/VoxelVolumeStyle/#slices)
|
|
215
215
|
* and the [slices](https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/voxel-layer-slices.htm) authored from ArcGIS Pro
|
package/layers/WCSLayer.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface WCSLayerProperties extends LayerProperties, RefreshableLayerPro
|
|
|
31
31
|
/**
|
|
32
32
|
* Use this property to append custom parameters to all WCS requests.
|
|
33
33
|
* The custom parameters are applied to `GetCapabilities`, `DescribeCoverage`, `GetCoverage`
|
|
34
|
-
* [operations](https://
|
|
34
|
+
* [operations](https://doc.esri.com/en/arcgis-enterprise/latest/administer/communicating-with-a-wcs-service-in-a-web-browser.html) of
|
|
35
35
|
* WCS services.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
@@ -124,7 +124,7 @@ export default class WCSLayer extends WCSLayerSuperclass {
|
|
|
124
124
|
/**
|
|
125
125
|
* Use this property to append custom parameters to all WCS requests.
|
|
126
126
|
* The custom parameters are applied to `GetCapabilities`, `DescribeCoverage`, `GetCoverage`
|
|
127
|
-
* [operations](https://
|
|
127
|
+
* [operations](https://doc.esri.com/en/arcgis-enterprise/latest/administer/communicating-with-a-wcs-service-in-a-web-browser.html) of
|
|
128
128
|
* WCS services.
|
|
129
129
|
*
|
|
130
130
|
* @example
|
package/layers/WFSLayer.d.ts
CHANGED
|
@@ -632,6 +632,7 @@ export default class WFSLayer extends WFSLayerSuperclass {
|
|
|
632
632
|
* @returns The query object representing the layer's definition expression and other configurations.
|
|
633
633
|
* @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/)
|
|
634
634
|
* @example
|
|
635
|
+
* ```js
|
|
635
636
|
* // Get a query object for the layer's current configuration
|
|
636
637
|
* queryParams.outFields will be set to ["*"] to get values for all available fields.
|
|
637
638
|
* const queryParams = layer.createQuery();
|
|
@@ -645,7 +646,9 @@ export default class WFSLayer extends WFSLayerSuperclass {
|
|
|
645
646
|
* // prints the array of result graphics to the console
|
|
646
647
|
* console.log(results.features);
|
|
647
648
|
* });
|
|
649
|
+
* ```
|
|
648
650
|
* @example
|
|
651
|
+
* ```js
|
|
649
652
|
* // this snippet shows the query parameter object that is returned
|
|
650
653
|
* // from FeatureLayer.createQuery().
|
|
651
654
|
* const queryParams = new Query();
|
|
@@ -668,12 +671,15 @@ export default class WFSLayer extends WFSLayerSuperclass {
|
|
|
668
671
|
* queryParams.outFields = ["*"];
|
|
669
672
|
* queryParams.where = layer.definitionExpression || "1=1";
|
|
670
673
|
* queryParams.multipatchOption = layer.geometryType === "multipatch" ? "xyFootprint" : null;
|
|
674
|
+
* ```
|
|
671
675
|
* @example
|
|
676
|
+
* ```js
|
|
672
677
|
* // this snippet shows query image footprints from imagery layer
|
|
673
678
|
* // that honors the layer's definitionExpression and other configurations.
|
|
674
679
|
* if (imageryLayer.capabilities.operations.supportsQuery) {
|
|
675
680
|
* const query = imageryLayer.createQuery();
|
|
676
681
|
* const rasters = await imageryLayer.queryRasters(query);
|
|
682
|
+
* ```
|
|
677
683
|
*/
|
|
678
684
|
createQuery(): Query;
|
|
679
685
|
/**
|
package/layers/WebTileLayer.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export default class WebTileLayer extends WebTileLayerSuperclass {
|
|
|
124
124
|
* @param col - The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/).
|
|
125
125
|
* @param options - Optional settings for the tile request. The options have the following properties.
|
|
126
126
|
* @returns Returns a promise that resolves to an
|
|
127
|
-
* [HTMLImageElement](https://developer.mozilla.org/
|
|
127
|
+
* [HTMLImageElement](https://developer.mozilla.org/docs/Web/API/HTMLImageElement).
|
|
128
128
|
*/
|
|
129
129
|
fetchTile(level: number, row: number, col: number, options?: AbortOptions): Promise<HTMLImageElement>;
|
|
130
130
|
/**
|
|
@@ -83,6 +83,7 @@ export interface CatalogFootprintLayerProperties extends LayerProperties, BlendL
|
|
|
83
83
|
* @see [CatalogFootprintLayer.getFieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldConfiguration)
|
|
84
84
|
* @see [CatalogFootprintLayer.getFieldAlias](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldAlias)
|
|
85
85
|
* @example
|
|
86
|
+
* ```js
|
|
86
87
|
* // Adding a new field configuration
|
|
87
88
|
* const addNewConfig = (layer, fieldName, alias, fieldFormat) => {
|
|
88
89
|
* // Check if there is already an existing configuration for fieldName
|
|
@@ -94,7 +95,9 @@ export interface CatalogFootprintLayerProperties extends LayerProperties, BlendL
|
|
|
94
95
|
* layer.fieldConfigurations = newConfigs;
|
|
95
96
|
* }
|
|
96
97
|
* };
|
|
98
|
+
* ```
|
|
97
99
|
* @example
|
|
100
|
+
* ```js
|
|
98
101
|
* // Updating an existing field configuration
|
|
99
102
|
* const updateConfig = (layer, fieldName, alias, fieldFormat) => {
|
|
100
103
|
* const existingConfig = layer.getFieldConfiguration(fieldName);
|
|
@@ -109,7 +112,9 @@ export interface CatalogFootprintLayerProperties extends LayerProperties, BlendL
|
|
|
109
112
|
* layer.fieldConfigurations = newConfigs;
|
|
110
113
|
* }
|
|
111
114
|
* };
|
|
115
|
+
* ```
|
|
112
116
|
* @example
|
|
117
|
+
* ```js
|
|
113
118
|
* // Deleting an existing field configuration
|
|
114
119
|
* const deleteConfig = (layer, fieldName) => {
|
|
115
120
|
* const existingConfig = layer.getFieldConfiguration(fieldName);
|
|
@@ -120,6 +125,7 @@ export interface CatalogFootprintLayerProperties extends LayerProperties, BlendL
|
|
|
120
125
|
* layer.fieldConfigurations = newConfigs;
|
|
121
126
|
* }
|
|
122
127
|
* };
|
|
128
|
+
* ```
|
|
123
129
|
*/
|
|
124
130
|
fieldConfigurations?: FieldConfigurationProperties[] | null;
|
|
125
131
|
/**
|
|
@@ -320,6 +326,7 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
|
|
|
320
326
|
* @see [CatalogFootprintLayer.getFieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldConfiguration)
|
|
321
327
|
* @see [CatalogFootprintLayer.getFieldAlias](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldAlias)
|
|
322
328
|
* @example
|
|
329
|
+
* ```js
|
|
323
330
|
* // Adding a new field configuration
|
|
324
331
|
* const addNewConfig = (layer, fieldName, alias, fieldFormat) => {
|
|
325
332
|
* // Check if there is already an existing configuration for fieldName
|
|
@@ -331,7 +338,9 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
|
|
|
331
338
|
* layer.fieldConfigurations = newConfigs;
|
|
332
339
|
* }
|
|
333
340
|
* };
|
|
341
|
+
* ```
|
|
334
342
|
* @example
|
|
343
|
+
* ```js
|
|
335
344
|
* // Updating an existing field configuration
|
|
336
345
|
* const updateConfig = (layer, fieldName, alias, fieldFormat) => {
|
|
337
346
|
* const existingConfig = layer.getFieldConfiguration(fieldName);
|
|
@@ -346,7 +355,9 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
|
|
|
346
355
|
* layer.fieldConfigurations = newConfigs;
|
|
347
356
|
* }
|
|
348
357
|
* };
|
|
358
|
+
* ```
|
|
349
359
|
* @example
|
|
360
|
+
* ```js
|
|
350
361
|
* // Deleting an existing field configuration
|
|
351
362
|
* const deleteConfig = (layer, fieldName) => {
|
|
352
363
|
* const existingConfig = layer.getFieldConfiguration(fieldName);
|
|
@@ -357,6 +368,7 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
|
|
|
357
368
|
* layer.fieldConfigurations = newConfigs;
|
|
358
369
|
* }
|
|
359
370
|
* };
|
|
371
|
+
* ```
|
|
360
372
|
*/
|
|
361
373
|
get fieldConfigurations(): FieldConfiguration[] | null | undefined;
|
|
362
374
|
set fieldConfigurations(value: FieldConfigurationProperties[] | null | undefined);
|
|
@@ -598,10 +610,11 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
|
|
|
598
610
|
* @returns An array of field configuration objects, or `null` if the layer does not have any fields that require formatting.
|
|
599
611
|
* @since 5.1
|
|
600
612
|
* @see [CatalogFootprintLayer.fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations)
|
|
601
|
-
* @returns An array of field configuration objects, or `null` if the layer does not have any fields that require formatting.
|
|
602
613
|
* @example
|
|
614
|
+
* ```js
|
|
603
615
|
* const fieldConfigs = layer.createFieldConfigurations();
|
|
604
616
|
* layer.fieldConfigurations = fieldConfigs;
|
|
617
|
+
* ```
|
|
605
618
|
*/
|
|
606
619
|
createFieldConfigurations(): FieldConfiguration[] | null | undefined;
|
|
607
620
|
/**
|
|
@@ -624,6 +637,7 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
|
|
|
624
637
|
* @returns The query object representing the layer's definition expression and other configurations.
|
|
625
638
|
* @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/)
|
|
626
639
|
* @example
|
|
640
|
+
* ```js
|
|
627
641
|
* // Get a query object for the layer's current configuration
|
|
628
642
|
* queryParams.outFields will be set to ["*"] to get values for all available fields.
|
|
629
643
|
* const queryParams = layer.createQuery();
|
|
@@ -637,7 +651,9 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
|
|
|
637
651
|
* // prints the array of result graphics to the console
|
|
638
652
|
* console.log(results.features);
|
|
639
653
|
* });
|
|
654
|
+
* ```
|
|
640
655
|
* @example
|
|
656
|
+
* ```js
|
|
641
657
|
* // this snippet shows the query parameter object that is returned
|
|
642
658
|
* // from FeatureLayer.createQuery().
|
|
643
659
|
* const queryParams = new Query();
|
|
@@ -660,12 +676,15 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
|
|
|
660
676
|
* queryParams.outFields = ["*"];
|
|
661
677
|
* queryParams.where = layer.definitionExpression || "1=1";
|
|
662
678
|
* queryParams.multipatchOption = layer.geometryType === "multipatch" ? "xyFootprint" : null;
|
|
679
|
+
* ```
|
|
663
680
|
* @example
|
|
681
|
+
* ```js
|
|
664
682
|
* // this snippet shows query image footprints from imagery layer
|
|
665
683
|
* // that honors the layer's definitionExpression and other configurations.
|
|
666
684
|
* if (imageryLayer.capabilities.operations.supportsQuery) {
|
|
667
685
|
* const query = imageryLayer.createQuery();
|
|
668
686
|
* const rasters = await imageryLayer.queryRasters(query);
|
|
687
|
+
* ```
|
|
669
688
|
*/
|
|
670
689
|
createQuery(): Query;
|
|
671
690
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../config.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import{Loadable as o}from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{join as h}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f,subclass as g}from"../../../core/accessorSupport/decorators.js";import q from"../../../geometry/Extent.js";import w from"../../../geometry/SpatialReference.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as E}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as O}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as b,getFeatureJSON as _,getFeatureIds as R,getAttachmentEditsJSON as A,isProtectedOrPrivateVersionError as F,unpackEditResultData as I,createEditedFeatures as v}from"../applyEditsUtils.js";import{createDrawingInfo as x}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as M}from"../../support/featureLayerUtils.js";import{getAssetMapTable as N}from"../../support/infoFor3D.js";import{executeQueryJSON as U}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as C}from"../../../rest/query/operations/editsZScale.js";import D from"../../../rest/support/Query.js";import L from"../../../time/TimeExtent.js";import{isSafeToEditVersion as J,isVersionInEditSession as k,isHistoricVersion as Q,currentSessionId as P}from"../../../versionManagement/support/versionManagementUtils.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let B=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer","Annotation Layer","Dimension Layer","Annotation SubLayer","Dimension SubLayer"]),this.refresh=c(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([y(()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a,uniqueIdFields:i}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,u=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n,l=u&&e?.query.supportsFormatPBFWithCurves,c=e?.operations?.supportsQueryAttachments??!1,d=e?.query?.relativeTimeBinWindow??0,p=t.path;return new j({dynamicDataSource:o,fieldsIndex:a,gdbVersion:r,infoFor3D:n,pbfSupported:u,pbfSupportedWithCurves:l,queryAttachmentsSupported:c,relativeTimeBinWindow:d,sourceSpatialReference:s,uniqueIdFields:i,url:p})}async addAttachment(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return b(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await M(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return b(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await M(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map(e=>_(this.layer,e,n))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map(e=>_(this.layer,e,n))??[],y=(await Promise.all(p)).filter(s),h=R(this.layer,e.deleteFeatures,u);C(d,y,a.spatialReference);const m=await A(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,q={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await J(this.layer.url,g,!0);const w=k(this.layer.url,g||null);if(await Q(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(q.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:y.length?y:null,deletes:h.length?h:null,attachments:m,assetMaps:l}]),q.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),q.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(q.adds=d.length?JSON.stringify(d):null,q.updates=y.length?JSON.stringify(y):null,q.deletes=h.length?u?JSON.stringify(h):h.join(","):null,q.attachments=m&&JSON.stringify(m),q.assetMaps=null!=l?JSON.stringify(l):void 0);const S=this._getLayerRequestOptions({method:"post",query:q});w&&(S.authMode="immediate",S.query.returnEditMoment=!0,S.query.sessionId=P);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}catch(b){if(!F(b))throw b;S.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(b)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&q.fromJSON(c),timeExtent:l&&L.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){const t=new Map;if(r.features.forEach(r=>{const s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){const r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(const e of r.fields){const r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!T(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&h(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(G)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=x(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter(e=>e.geometry);if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(E(t))s.push(e);else{const t=e.origin,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(O)??n[0];for(const r of l.assets)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=I(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new w(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:v(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=N(i);if(null==n)return!1;const o=h(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map(e=>e.getAttribute(r)).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new D({where:`${c} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,c],returnGeometry:!1}),y=await U(o,p),{features:m}=y;return 0!==m.length&&!u.some(e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter(e=>e.getAttribute(c)===t);if(0===i.length)return!0;const n=i.map(e=>e.getAttribute(d));return s.getExternalSourcesOnService(a).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};e([f()],B.prototype,"type",void 0),e([f({constructOnly:!0})],B.prototype,"layer",void 0),e([f({constructOnly:!0})],B.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],B.prototype,"queryTask",null),B=e([g("esri.layers.graphics.sources.FeatureLayerSource")],B);const G=1e3;export{B as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../config.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import{Loadable as o}from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{join as h}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f,subclass as g}from"../../../core/accessorSupport/decorators.js";import q from"../../../geometry/Extent.js";import w from"../../../geometry/SpatialReference.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as E}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as O}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as _,getFeatureJSON as b,getFeatureIds as R,getAttachmentEditsJSON as F,isProtectedOrPrivateVersionError as A,unpackEditResultData as I,createEditedFeatures as v}from"../applyEditsUtils.js";import{createDrawingInfo as x}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as M}from"../../support/featureLayerUtils.js";import{getAssetMapTable as N}from"../../support/infoFor3D.js";import{executeQueryJSON as U}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as C}from"../../../rest/query/operations/editsZScale.js";import D from"../../../rest/support/Query.js";import J from"../../../time/TimeExtent.js";import{isSafeToEditVersion as L,isVersionInEditSession as k,isHistoricVersion as Q,currentSessionId as P}from"../../../versionManagement/support/versionManagementUtils.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let B=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer","Annotation Layer","Dimension Layer"]),this.refresh=c(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([y(()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a,uniqueIdFields:i}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,u=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n,l=u&&e?.query.supportsFormatPBFWithCurves,c=e?.operations?.supportsQueryAttachments??!1,d=e?.query?.relativeTimeBinWindow??0,p=t.path;return new j({dynamicDataSource:o,fieldsIndex:a,gdbVersion:r,infoFor3D:n,pbfSupported:u,pbfSupportedWithCurves:l,queryAttachmentsSupported:c,relativeTimeBinWindow:d,sourceSpatialReference:s,uniqueIdFields:i,url:p})}async addAttachment(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return _(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await M(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return _(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await M(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map(e=>b(this.layer,e,n))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map(e=>b(this.layer,e,n))??[],y=(await Promise.all(p)).filter(s),h=R(this.layer,e.deleteFeatures,u);C(d,y,a.spatialReference);const m=await F(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,q={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await L(this.layer.url,g,!0);const w=k(this.layer.url,g||null);if(await Q(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(q.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:y.length?y:null,deletes:h.length?h:null,attachments:m,assetMaps:l}]),q.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),q.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(q.adds=d.length?JSON.stringify(d):null,q.updates=y.length?JSON.stringify(y):null,q.deletes=h.length?u?JSON.stringify(h):h.join(","):null,q.attachments=m&&JSON.stringify(m),q.assetMaps=null!=l?JSON.stringify(l):void 0);const S=this._getLayerRequestOptions({method:"post",query:q});w&&(S.authMode="immediate",S.query.returnEditMoment=!0,S.query.sessionId=P);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}catch(_){if(!A(_))throw _;S.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(_)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&q.fromJSON(c),timeExtent:l&&J.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){const t=new Map;if(r.features.forEach(r=>{const s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){const r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(const e of r.fields){const r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!T(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&h(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(G)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=x(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter(e=>e.geometry);if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(E(t))s.push(e);else{const t=e.origin,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(O)??n[0];for(const r of l.assets)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=I(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new w(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:v(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=N(i);if(null==n)return!1;const o=h(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map(e=>e.getAttribute(r)).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new D({where:`${c} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,c],returnGeometry:!1}),y=await U(o,p),{features:m}=y;return 0!==m.length&&!u.some(e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter(e=>e.getAttribute(c)===t);if(0===i.length)return!0;const n=i.map(e=>e.getAttribute(d));return s.getExternalSourcesOnService(a).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};e([f()],B.prototype,"type",void 0),e([f({constructOnly:!0})],B.prototype,"layer",void 0),e([f({constructOnly:!0})],B.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],B.prototype,"queryTask",null),B=e([g("esri.layers.graphics.sources.FeatureLayerSource")],B);const G=1e3;export{B as default};
|
|
@@ -560,6 +560,7 @@ export default class KnowledgeGraphSublayer extends KnowledgeGraphSublayerSuperc
|
|
|
560
560
|
* @returns The query object representing the layer's definition expression and other configurations.
|
|
561
561
|
* @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/)
|
|
562
562
|
* @example
|
|
563
|
+
* ```js
|
|
563
564
|
* // Get a query object for the layer's current configuration
|
|
564
565
|
* queryParams.outFields will be set to ["*"] to get values for all available fields.
|
|
565
566
|
* const queryParams = layer.createQuery();
|
|
@@ -573,7 +574,9 @@ export default class KnowledgeGraphSublayer extends KnowledgeGraphSublayerSuperc
|
|
|
573
574
|
* // prints the array of result graphics to the console
|
|
574
575
|
* console.log(results.features);
|
|
575
576
|
* });
|
|
577
|
+
* ```
|
|
576
578
|
* @example
|
|
579
|
+
* ```js
|
|
577
580
|
* // this snippet shows the query parameter object that is returned
|
|
578
581
|
* // from FeatureLayer.createQuery().
|
|
579
582
|
* const queryParams = new Query();
|
|
@@ -596,12 +599,15 @@ export default class KnowledgeGraphSublayer extends KnowledgeGraphSublayerSuperc
|
|
|
596
599
|
* queryParams.outFields = ["*"];
|
|
597
600
|
* queryParams.where = layer.definitionExpression || "1=1";
|
|
598
601
|
* queryParams.multipatchOption = layer.geometryType === "multipatch" ? "xyFootprint" : null;
|
|
602
|
+
* ```
|
|
599
603
|
* @example
|
|
604
|
+
* ```js
|
|
600
605
|
* // this snippet shows query image footprints from imagery layer
|
|
601
606
|
* // that honors the layer's definitionExpression and other configurations.
|
|
602
607
|
* if (imageryLayer.capabilities.operations.supportsQuery) {
|
|
603
608
|
* const query = imageryLayer.createQuery();
|
|
604
609
|
* const rasters = await imageryLayer.queryRasters(query);
|
|
610
|
+
* ```
|
|
605
611
|
*/
|
|
606
612
|
createQuery(): Query;
|
|
607
613
|
/**
|
|
@@ -844,10 +844,11 @@ export abstract class ArcGISImageService {
|
|
|
844
844
|
* [queries](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLayerView/#queryFeatures) against the layer views of feature-based layers, or all fields in the layer for
|
|
845
845
|
* [queries against the layer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#queryFeatures).
|
|
846
846
|
*
|
|
847
|
-
* @since 5.1
|
|
848
847
|
* @returns The query object representing the layer's definition expression and other configurations.
|
|
848
|
+
* @since 5.1
|
|
849
849
|
* @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/)
|
|
850
850
|
* @example
|
|
851
|
+
* ```js
|
|
851
852
|
* // Get a query object for the layer's current configuration
|
|
852
853
|
* queryParams.outFields will be set to ["*"] to get values for all available fields.
|
|
853
854
|
* const queryParams = layer.createQuery();
|
|
@@ -861,7 +862,9 @@ export abstract class ArcGISImageService {
|
|
|
861
862
|
* // prints the array of result graphics to the console
|
|
862
863
|
* console.log(results.features);
|
|
863
864
|
* });
|
|
865
|
+
* ```
|
|
864
866
|
* @example
|
|
867
|
+
* ```js
|
|
865
868
|
* // this snippet shows the query parameter object that is returned
|
|
866
869
|
* // from FeatureLayer.createQuery().
|
|
867
870
|
* const queryParams = new Query();
|
|
@@ -884,12 +887,15 @@ export abstract class ArcGISImageService {
|
|
|
884
887
|
* queryParams.outFields = ["*"];
|
|
885
888
|
* queryParams.where = layer.definitionExpression || "1=1";
|
|
886
889
|
* queryParams.multipatchOption = layer.geometryType === "multipatch" ? "xyFootprint" : null;
|
|
890
|
+
* ```
|
|
887
891
|
* @example
|
|
892
|
+
* ```js
|
|
888
893
|
* // this snippet shows query image footprints from imagery layer
|
|
889
894
|
* // that honors the layer's definitionExpression and other configurations.
|
|
890
895
|
* if (imageryLayer.capabilities.operations.supportsQuery) {
|
|
891
896
|
* const query = imageryLayer.createQuery();
|
|
892
897
|
* const rasters = await imageryLayer.queryRasters(query);
|
|
898
|
+
* ```
|
|
893
899
|
*/
|
|
894
900
|
createQuery(): Query;
|
|
895
901
|
/**
|