@arcgis/core 4.34.0-next.16 → 4.34.0-next.18
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/analysis/Analysis.js +1 -1
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/analysis/DimensionAnalysis.js +1 -1
- package/analysis/DimensionSimpleStyle.js +1 -1
- package/analysis/DirectLineMeasurementAnalysis.js +1 -1
- package/analysis/LengthDimension.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/analysis/SliceAnalysis.js +1 -1
- package/analysis/SlicePlane.js +1 -1
- package/analysis/ViewshedAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{400a4c9fa62964f8fa1d.js → 1f48d6c76f0014064eca.js} +1 -1
- package/assets/esri/core/workers/chunks/3cf31e51266f40072f71.js +1 -0
- package/assets/esri/core/workers/chunks/{58f403f956b7b3467344.js → 42da01bd3f401a017c0f.js} +1 -1
- package/assets/esri/core/workers/chunks/4325fdd96d9ea344132e.js +1 -0
- package/assets/esri/core/workers/chunks/{a6bcae413e62cd879b46.js → 5859e425c9bca96b6c80.js} +1 -1
- package/assets/esri/core/workers/chunks/5bfccd5dffda74740aa4.js +1 -0
- package/assets/esri/core/workers/chunks/68374cf42a069436830d.js +1 -0
- package/assets/esri/core/workers/chunks/6f8de923519bb16af8ba.js +1 -0
- package/assets/esri/core/workers/chunks/85753105268aeff84e69.js +1 -0
- package/assets/esri/core/workers/chunks/{2990145d7ac3af0d68be.js → 8599df135928d73da4a3.js} +1 -1
- package/assets/esri/core/workers/chunks/8637b9cb30170ac4eae2.js +1 -0
- package/assets/esri/core/workers/chunks/872f151a3a2bc9052be0.js +1 -0
- package/assets/esri/core/workers/chunks/8b4a35e3ed39d8be3394.js +1 -0
- package/assets/esri/core/workers/chunks/974c6b0e3a1f1dd523fa.js +1 -0
- package/assets/esri/core/workers/chunks/{d33a5d79f2163ad62b1d.js → 9965961bad09910f577b.js} +1 -1
- package/assets/esri/core/workers/chunks/9d499a37b960273c3f84.js +1 -0
- package/assets/esri/core/workers/chunks/a507192771e5f4f82973.js +1 -0
- package/assets/esri/core/workers/chunks/a9e1caf05c81055ae194.js +1 -0
- package/assets/esri/core/workers/chunks/{1415d4e2f5f3193be004.js → aa4ae0e54a0507e8dd0f.js} +1 -1
- package/assets/esri/core/workers/chunks/aeabe203da7bcdd580cf.js +1 -0
- package/assets/esri/core/workers/chunks/d3bfd0c382c2f39a787b.js +1 -0
- package/assets/esri/core/workers/chunks/d6df12bed626d56cd6b2.js +1 -0
- package/assets/esri/core/workers/chunks/e0146db608959ead9c97.js +1 -0
- package/assets/esri/core/workers/chunks/{243eb8a317333ec2715b.js → f3e179b48bca50c94538.js} +1 -1
- package/assets/esri/core/workers/chunks/f4442a2b40e44f90b461.js +1 -0
- package/assets/esri/core/workers/chunks/{fa5715ca3ce95d005b0a.js → faa892ad4cc8a90b6c79.js} +1 -1
- package/assets/esri/themes/base/widgets/_Legend.scss +2 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
- package/chunks/sphere.js +1 -1
- package/config.js +1 -1
- package/core/accessorSupport/trackingUtils.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/sql.js +1 -1
- package/geometry/spatialReferenceEllipsoidUtils.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +60 -43
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/orientedImagery/transformations/updateElevation.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +1 -1
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/jsonUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Slice/SliceController.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/support/drapedUtils.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/LineOfSight/LineOfSightTarget.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/assets/esri/core/workers/chunks/254c4f7e277ae9915dce.js +0 -1
- package/assets/esri/core/workers/chunks/273beed633cc37416ad7.js +0 -1
- package/assets/esri/core/workers/chunks/49a57dc1e6d1048fa949.js +0 -1
- package/assets/esri/core/workers/chunks/500fb5f615f0c1db1b66.js +0 -1
- package/assets/esri/core/workers/chunks/52239e958a82ebcd2e7a.js +0 -1
- package/assets/esri/core/workers/chunks/54814a269d44855f0673.js +0 -1
- package/assets/esri/core/workers/chunks/632d1a1287dde980479e.js +0 -1
- package/assets/esri/core/workers/chunks/802c6b1a6cb9264b8e4f.js +0 -1
- package/assets/esri/core/workers/chunks/88b1214c284c2ec7d51b.js +0 -1
- package/assets/esri/core/workers/chunks/932808e485f305b6a26a.js +0 -1
- package/assets/esri/core/workers/chunks/948c5454881e661c3bdc.js +0 -1
- package/assets/esri/core/workers/chunks/95507ff0a243e451b99e.js +0 -1
- package/assets/esri/core/workers/chunks/9959a91c8de6fef499c2.js +0 -1
- package/assets/esri/core/workers/chunks/cfc5e0ec9b0290407383.js +0 -1
- package/assets/esri/core/workers/chunks/d2139307f62ea8bf999a.js +0 -1
- package/assets/esri/core/workers/chunks/ddb66fe6fcd0764daa7a.js +0 -1
- package/assets/esri/core/workers/chunks/eac7af86166c09c6a9be.js +0 -1
- package/assets/esri/core/workers/chunks/ec49e2849766402ad5c7.js +0 -1
package/interfaces.d.ts
CHANGED
|
@@ -2595,6 +2595,7 @@ declare namespace __esri {
|
|
|
2595
2595
|
executeAsyncBatch: ExecuteFunctionAsyncBatch;
|
|
2596
2596
|
fieldsUsed: string[];
|
|
2597
2597
|
geometryUsed: boolean;
|
|
2598
|
+
variablesUsed: string[];
|
|
2598
2599
|
isAsync: boolean;
|
|
2599
2600
|
}
|
|
2600
2601
|
|
|
@@ -4967,7 +4968,7 @@ declare namespace __esri {
|
|
|
4967
4968
|
|
|
4968
4969
|
export class FocusAreas {
|
|
4969
4970
|
/**
|
|
4970
|
-
* The rendering style of the map outside of all enabled focus areas.
|
|
4971
|
+
* The rendering style of the map, applied outside of all enabled focus areas.
|
|
4971
4972
|
*
|
|
4972
4973
|
* @default "bright"
|
|
4973
4974
|
*
|
|
@@ -5019,7 +5020,7 @@ declare namespace __esri {
|
|
|
5019
5020
|
*/
|
|
5020
5021
|
areas?: CollectionProperties<FocusAreaProperties>;
|
|
5021
5022
|
/**
|
|
5022
|
-
* The rendering style of the map outside of all enabled focus areas.
|
|
5023
|
+
* The rendering style of the map, applied outside of all enabled focus areas.
|
|
5023
5024
|
*
|
|
5024
5025
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-effects-FocusAreas.html#style Read more...}
|
|
5025
5026
|
*/
|
|
@@ -21803,7 +21804,7 @@ declare namespace __esri {
|
|
|
21803
21804
|
* @param width The width of the image in pixels.
|
|
21804
21805
|
* @param height The height of the image in pixels.
|
|
21805
21806
|
* @param options The parameter options is an object with the following properties.
|
|
21806
|
-
* @deprecated since version 4.33. Use {@link module:esri/layers/ImageryLayer#fetchPixels
|
|
21807
|
+
* @deprecated since version 4.33. Use {@link module:esri/layers/ImageryLayer#fetchPixels ImageryLayer.fetchPixels} instead.
|
|
21807
21808
|
*
|
|
21808
21809
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#fetchImage Read more...}
|
|
21809
21810
|
*/
|
|
@@ -25787,7 +25788,7 @@ declare namespace __esri {
|
|
|
25787
25788
|
* @param width The width of the image in pixels.
|
|
25788
25789
|
* @param height The height of the image in pixels.
|
|
25789
25790
|
* @param options The parameter options is an object with the following properties.
|
|
25790
|
-
* @deprecated since version 4.33. Use {@link module:esri/layers/ImageryLayer#fetchPixels
|
|
25791
|
+
* @deprecated since version 4.33. Use {@link module:esri/layers/ImageryLayer#fetchPixels ImageryLayer.fetchPixels} instead.
|
|
25791
25792
|
*
|
|
25792
25793
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fetchImage Read more...}
|
|
25793
25794
|
*/
|
|
@@ -36249,7 +36250,7 @@ declare namespace __esri {
|
|
|
36249
36250
|
|
|
36250
36251
|
export class PlaybackInfo {
|
|
36251
36252
|
/**
|
|
36252
|
-
*
|
|
36253
|
+
* Describes the relationship between the layers video data width and height.
|
|
36253
36254
|
*
|
|
36254
36255
|
* @default null
|
|
36255
36256
|
*
|
|
@@ -36257,7 +36258,8 @@ declare namespace __esri {
|
|
|
36257
36258
|
*/
|
|
36258
36259
|
aspectRatio: string | nullish;
|
|
36259
36260
|
/**
|
|
36260
|
-
* The
|
|
36261
|
+
* The file format that holds and organizes video content including the video
|
|
36262
|
+
* data, audio data and metadata.
|
|
36261
36263
|
*
|
|
36262
36264
|
* @default null
|
|
36263
36265
|
*
|
|
@@ -36265,7 +36267,8 @@ declare namespace __esri {
|
|
|
36265
36267
|
*/
|
|
36266
36268
|
containerFormat: string | nullish;
|
|
36267
36269
|
/**
|
|
36268
|
-
* The framerate of the video
|
|
36270
|
+
* The framerate of the video represents the number of frames per second of
|
|
36271
|
+
* the video layer media source.
|
|
36269
36272
|
*
|
|
36270
36273
|
* @default null
|
|
36271
36274
|
*
|
|
@@ -36281,7 +36284,8 @@ declare namespace __esri {
|
|
|
36281
36284
|
*/
|
|
36282
36285
|
gop: number | nullish;
|
|
36283
36286
|
/**
|
|
36284
|
-
*
|
|
36287
|
+
* Defines the key length value (KLV) data encoding standard applied to the
|
|
36288
|
+
* available metadata content within the stream.
|
|
36285
36289
|
*
|
|
36286
36290
|
* @default null
|
|
36287
36291
|
*
|
|
@@ -36320,19 +36324,21 @@ declare namespace __esri {
|
|
|
36320
36324
|
|
|
36321
36325
|
interface PlaybackInfoProperties {
|
|
36322
36326
|
/**
|
|
36323
|
-
*
|
|
36327
|
+
* Describes the relationship between the layers video data width and height.
|
|
36324
36328
|
*
|
|
36325
36329
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PlaybackInfo.html#aspectRatio Read more...}
|
|
36326
36330
|
*/
|
|
36327
36331
|
aspectRatio?: string | nullish;
|
|
36328
36332
|
/**
|
|
36329
|
-
* The
|
|
36333
|
+
* The file format that holds and organizes video content including the video
|
|
36334
|
+
* data, audio data and metadata.
|
|
36330
36335
|
*
|
|
36331
36336
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PlaybackInfo.html#containerFormat Read more...}
|
|
36332
36337
|
*/
|
|
36333
36338
|
containerFormat?: string | nullish;
|
|
36334
36339
|
/**
|
|
36335
|
-
* The framerate of the video
|
|
36340
|
+
* The framerate of the video represents the number of frames per second of
|
|
36341
|
+
* the video layer media source.
|
|
36336
36342
|
*
|
|
36337
36343
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PlaybackInfo.html#framerate Read more...}
|
|
36338
36344
|
*/
|
|
@@ -36344,7 +36350,8 @@ declare namespace __esri {
|
|
|
36344
36350
|
*/
|
|
36345
36351
|
gop?: number | nullish;
|
|
36346
36352
|
/**
|
|
36347
|
-
*
|
|
36353
|
+
* Defines the key length value (KLV) data encoding standard applied to the
|
|
36354
|
+
* available metadata content within the stream.
|
|
36348
36355
|
*
|
|
36349
36356
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PlaybackInfo.html#klv Read more...}
|
|
36350
36357
|
*/
|
|
@@ -48659,7 +48666,7 @@ declare namespace __esri {
|
|
|
48659
48666
|
*
|
|
48660
48667
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-Network.html#dataElement Read more...}
|
|
48661
48668
|
*/
|
|
48662
|
-
dataElement:
|
|
48669
|
+
dataElement: NetworkDataElementJSON | nullish;
|
|
48663
48670
|
/**
|
|
48664
48671
|
* The physical dataset name of the network as defined in the backend database.
|
|
48665
48672
|
*
|
|
@@ -48914,7 +48921,7 @@ declare namespace __esri {
|
|
|
48914
48921
|
*
|
|
48915
48922
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-Network.html#dataElement Read more...}
|
|
48916
48923
|
*/
|
|
48917
|
-
dataElement?:
|
|
48924
|
+
dataElement?: NetworkDataElementJSON | nullish;
|
|
48918
48925
|
/**
|
|
48919
48926
|
* The full extent of the network, defined from the service territory used to create the network.
|
|
48920
48927
|
*
|
|
@@ -48971,6 +48978,13 @@ declare namespace __esri {
|
|
|
48971
48978
|
outFields?: string[];
|
|
48972
48979
|
}
|
|
48973
48980
|
|
|
48981
|
+
/**
|
|
48982
|
+
* Contains the full network definition.
|
|
48983
|
+
*
|
|
48984
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-Network.html#NetworkDataElementJSON Read more...}
|
|
48985
|
+
*/
|
|
48986
|
+
export type NetworkDataElementJSON = any | nullish;
|
|
48987
|
+
|
|
48974
48988
|
export interface NetworkFromPortalItemParams {
|
|
48975
48989
|
portalItem: PortalItem;
|
|
48976
48990
|
}
|
|
@@ -63319,11 +63333,15 @@ declare namespace __esri {
|
|
|
63319
63333
|
*/
|
|
63320
63334
|
readonly searchProperties: globalThis.Map<string, SearchIndexSearchProperties>;
|
|
63321
63335
|
/**
|
|
63322
|
-
* Specifies if the index supports searching entities, relationships or both.
|
|
63336
|
+
* Specifies if the index supports searching provenance, entities, relationships or both.
|
|
63323
63337
|
*
|
|
63324
63338
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-SearchIndex.html#supportedCategory Read more...}
|
|
63325
63339
|
*/
|
|
63326
|
-
readonly supportedCategory:
|
|
63340
|
+
readonly supportedCategory: | "esriTypeUNSPECIFIED"
|
|
63341
|
+
| "esriTypeEntity"
|
|
63342
|
+
| "esriTypeRelationship"
|
|
63343
|
+
| "esriTypeBoth"
|
|
63344
|
+
| "esriTypeMetaEntityProvenance";
|
|
63327
63345
|
/**
|
|
63328
63346
|
* Defines a search index for a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-KnowledgeGraph.html KnowledgeGraph}.
|
|
63329
63347
|
*
|
|
@@ -92591,7 +92609,7 @@ declare namespace __esri {
|
|
|
92591
92609
|
*/
|
|
92592
92610
|
context: WebGL2RenderingContext;
|
|
92593
92611
|
/**
|
|
92594
|
-
* The array of BaseLayerViewGL2D Tile objects computed to cover the MapView's visible area.
|
|
92612
|
+
* The array of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#Tile Tile} objects computed to cover the MapView's visible area.
|
|
92595
92613
|
*
|
|
92596
92614
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#tiles Read more...}
|
|
92597
92615
|
*/
|
|
@@ -92718,7 +92736,7 @@ declare namespace __esri {
|
|
|
92718
92736
|
*/
|
|
92719
92737
|
context?: WebGL2RenderingContext;
|
|
92720
92738
|
/**
|
|
92721
|
-
* The array of BaseLayerViewGL2D Tile objects computed to cover the MapView's visible area.
|
|
92739
|
+
* The array of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#Tile Tile} objects computed to cover the MapView's visible area.
|
|
92722
92740
|
*
|
|
92723
92741
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#tiles Read more...}
|
|
92724
92742
|
*/
|
|
@@ -93634,8 +93652,7 @@ declare namespace __esri {
|
|
|
93634
93652
|
export const SceneViewPerformanceInfo: SceneViewPerformanceInfo;
|
|
93635
93653
|
|
|
93636
93654
|
/**
|
|
93637
|
-
*
|
|
93638
|
-
* developing with {@link https://developers.arcgis.com/javascript/latest/typescript-setup/ TypeScript}.
|
|
93655
|
+
* This module contains convenience functions and typings to work with {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-webgl-RenderNode.html RenderNode}.
|
|
93639
93656
|
*
|
|
93640
93657
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-webgl.html Read more...}
|
|
93641
93658
|
*/
|
|
@@ -110424,7 +110441,7 @@ declare namespace __esri {
|
|
|
110424
110441
|
*/
|
|
110425
110442
|
maxStops: number;
|
|
110426
110443
|
/**
|
|
110427
|
-
* Controls the default properties used when
|
|
110444
|
+
* Controls the default properties used when searching.
|
|
110428
110445
|
*
|
|
110429
110446
|
* @default null
|
|
110430
110447
|
*
|
|
@@ -110538,7 +110555,7 @@ declare namespace __esri {
|
|
|
110538
110555
|
*/
|
|
110539
110556
|
maxStops?: number;
|
|
110540
110557
|
/**
|
|
110541
|
-
* Controls the default properties used when
|
|
110558
|
+
* Controls the default properties used when searching.
|
|
110542
110559
|
*
|
|
110543
110560
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#searchProperties Read more...}
|
|
110544
110561
|
*/
|
|
@@ -112404,7 +112421,7 @@ declare namespace __esri {
|
|
|
112404
112421
|
export interface WorkflowCancelOptions {
|
|
112405
112422
|
error?: Error;
|
|
112406
112423
|
force?: boolean;
|
|
112407
|
-
|
|
112424
|
+
emitCancelEvent?: boolean;
|
|
112408
112425
|
}
|
|
112409
112426
|
|
|
112410
112427
|
export interface WorkflowPreviousOptions {
|
|
@@ -125714,7 +125731,7 @@ declare namespace __esri {
|
|
|
125714
125731
|
*/
|
|
125715
125732
|
printTimeout: number;
|
|
125716
125733
|
/**
|
|
125717
|
-
* The initial state of the print area toggle in the
|
|
125734
|
+
* The initial state of the print area toggle in the UI.
|
|
125718
125735
|
*
|
|
125719
125736
|
* @default false
|
|
125720
125737
|
*
|
|
@@ -125752,7 +125769,7 @@ declare namespace __esri {
|
|
|
125752
125769
|
*/
|
|
125753
125770
|
updateDelay: number;
|
|
125754
125771
|
/**
|
|
125755
|
-
* The view from which
|
|
125772
|
+
* The view from which Print will operate.
|
|
125756
125773
|
*
|
|
125757
125774
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#view Read more...}
|
|
125758
125775
|
*/
|
|
@@ -125921,7 +125938,7 @@ declare namespace __esri {
|
|
|
125921
125938
|
*/
|
|
125922
125939
|
printTimeout?: number;
|
|
125923
125940
|
/**
|
|
125924
|
-
* The initial state of the print area toggle in the
|
|
125941
|
+
* The initial state of the print area toggle in the UI.
|
|
125925
125942
|
*
|
|
125926
125943
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#showPrintAreaEnabled Read more...}
|
|
125927
125944
|
*/
|
|
@@ -125946,7 +125963,7 @@ declare namespace __esri {
|
|
|
125946
125963
|
*/
|
|
125947
125964
|
updateDelay?: number;
|
|
125948
125965
|
/**
|
|
125949
|
-
* The view from which
|
|
125966
|
+
* The view from which Print will operate.
|
|
125950
125967
|
*
|
|
125951
125968
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#view Read more...}
|
|
125952
125969
|
*/
|
|
@@ -127617,7 +127634,7 @@ declare namespace __esri {
|
|
|
127617
127634
|
*/
|
|
127618
127635
|
language: string | nullish;
|
|
127619
127636
|
/**
|
|
127620
|
-
* This property controls prioritization of
|
|
127637
|
+
* This property controls prioritization of Search result
|
|
127621
127638
|
* candidates depending on the view scale.
|
|
127622
127639
|
*
|
|
127623
127640
|
* @default false
|
|
@@ -127724,7 +127741,7 @@ declare namespace __esri {
|
|
|
127724
127741
|
*/
|
|
127725
127742
|
language?: string | nullish;
|
|
127726
127743
|
/**
|
|
127727
|
-
* This property controls prioritization of
|
|
127744
|
+
* This property controls prioritization of Search result
|
|
127728
127745
|
* candidates depending on the view scale.
|
|
127729
127746
|
*
|
|
127730
127747
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchDisabled Read more...}
|
|
@@ -127782,7 +127799,7 @@ declare namespace __esri {
|
|
|
127782
127799
|
*/
|
|
127783
127800
|
constructor(properties?: SearchResultRendererProperties);
|
|
127784
127801
|
/**
|
|
127785
|
-
* The view model for this Search
|
|
127802
|
+
* The view model for this Search.
|
|
127786
127803
|
*
|
|
127787
127804
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#viewModel Read more...}
|
|
127788
127805
|
*/
|
|
@@ -127798,7 +127815,7 @@ declare namespace __esri {
|
|
|
127798
127815
|
*/
|
|
127799
127816
|
showMoreResultsOpen?: boolean;
|
|
127800
127817
|
/**
|
|
127801
|
-
* The view model for this Search
|
|
127818
|
+
* The view model for this Search.
|
|
127802
127819
|
*
|
|
127803
127820
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#viewModel Read more...}
|
|
127804
127821
|
*/
|
|
@@ -128200,7 +128217,7 @@ declare namespace __esri {
|
|
|
128200
128217
|
*/
|
|
128201
128218
|
includeDefaultSources: boolean | Function;
|
|
128202
128219
|
/**
|
|
128203
|
-
* Indicates whether location services are enabled
|
|
128220
|
+
* Indicates whether location services are enabled.
|
|
128204
128221
|
*
|
|
128205
128222
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled Read more...}
|
|
128206
128223
|
*/
|
|
@@ -128214,7 +128231,7 @@ declare namespace __esri {
|
|
|
128214
128231
|
*/
|
|
128215
128232
|
maxInputLength: number;
|
|
128216
128233
|
/**
|
|
128217
|
-
* The maximum number of results returned
|
|
128234
|
+
* The maximum number of results returned if not specified by the source.
|
|
128218
128235
|
*
|
|
128219
128236
|
* @default 6
|
|
128220
128237
|
*
|
|
@@ -128222,7 +128239,7 @@ declare namespace __esri {
|
|
|
128222
128239
|
*/
|
|
128223
128240
|
maxResults: number;
|
|
128224
128241
|
/**
|
|
128225
|
-
* The maximum number of suggestions returned
|
|
128242
|
+
* The maximum number of suggestions returned if not specified by the source.
|
|
128226
128243
|
*
|
|
128227
128244
|
* @default 6
|
|
128228
128245
|
*
|
|
@@ -128313,7 +128330,7 @@ declare namespace __esri {
|
|
|
128313
128330
|
*/
|
|
128314
128331
|
readonly selectedSuggestion: GeometryUnion | SuggestResult | nullish;
|
|
128315
128332
|
/**
|
|
128316
|
-
* The current state
|
|
128333
|
+
* The current state.
|
|
128317
128334
|
*
|
|
128318
128335
|
* @default "ready"
|
|
128319
128336
|
*
|
|
@@ -128343,7 +128360,7 @@ declare namespace __esri {
|
|
|
128343
128360
|
*/
|
|
128344
128361
|
readonly suggestions: SuggestResults[] | nullish;
|
|
128345
128362
|
/**
|
|
128346
|
-
* Enable suggestions
|
|
128363
|
+
* Enable suggestions.
|
|
128347
128364
|
*
|
|
128348
128365
|
* @default true
|
|
128349
128366
|
*
|
|
@@ -128400,7 +128417,7 @@ declare namespace __esri {
|
|
|
128400
128417
|
get portal(): Portal | nullish;
|
|
128401
128418
|
set portal(value: PortalProperties | nullish);
|
|
128402
128419
|
/**
|
|
128403
|
-
*
|
|
128420
|
+
* Search may be used to search features in a
|
|
128404
128421
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html FeatureLayer} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-webdoc-applicationProperties-SearchTable.html table},
|
|
128405
128422
|
* or geocode locations with a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-locator.html locator}.
|
|
128406
128423
|
*
|
|
@@ -128462,7 +128479,7 @@ declare namespace __esri {
|
|
|
128462
128479
|
/**
|
|
128463
128480
|
* Performs a suggest() request on the active Locator.
|
|
128464
128481
|
*
|
|
128465
|
-
* @param value The string value used to suggest() on an active Locator or feature layer. If nothing is passed in, takes the current value
|
|
128482
|
+
* @param value The string value used to suggest() on an active Locator or feature layer. If nothing is passed in, takes the current value.
|
|
128466
128483
|
* @param suggestionDelay The millisecond delay after keyup and before making a `suggest()` network request.
|
|
128467
128484
|
* @param options An object containing an optional `signal` property that can be used to cancel the request.
|
|
128468
128485
|
*
|
|
@@ -128538,7 +128555,7 @@ declare namespace __esri {
|
|
|
128538
128555
|
*/
|
|
128539
128556
|
includeDefaultSources?: boolean | Function;
|
|
128540
128557
|
/**
|
|
128541
|
-
* Indicates whether location services are enabled
|
|
128558
|
+
* Indicates whether location services are enabled.
|
|
128542
128559
|
*
|
|
128543
128560
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled Read more...}
|
|
128544
128561
|
*/
|
|
@@ -128550,13 +128567,13 @@ declare namespace __esri {
|
|
|
128550
128567
|
*/
|
|
128551
128568
|
maxInputLength?: number;
|
|
128552
128569
|
/**
|
|
128553
|
-
* The maximum number of results returned
|
|
128570
|
+
* The maximum number of results returned if not specified by the source.
|
|
128554
128571
|
*
|
|
128555
128572
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults Read more...}
|
|
128556
128573
|
*/
|
|
128557
128574
|
maxResults?: number;
|
|
128558
128575
|
/**
|
|
128559
|
-
* The maximum number of suggestions returned
|
|
128576
|
+
* The maximum number of suggestions returned if not specified by the source.
|
|
128560
128577
|
*
|
|
128561
128578
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions Read more...}
|
|
128562
128579
|
*/
|
|
@@ -128612,7 +128629,7 @@ declare namespace __esri {
|
|
|
128612
128629
|
*/
|
|
128613
128630
|
searchTerm?: string;
|
|
128614
128631
|
/**
|
|
128615
|
-
*
|
|
128632
|
+
* Search may be used to search features in a
|
|
128616
128633
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html FeatureLayer} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-webdoc-applicationProperties-SearchTable.html table},
|
|
128617
128634
|
* or geocode locations with a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-locator.html locator}.
|
|
128618
128635
|
*
|
|
@@ -128632,7 +128649,7 @@ declare namespace __esri {
|
|
|
128632
128649
|
*/
|
|
128633
128650
|
suggestionDelay?: number;
|
|
128634
128651
|
/**
|
|
128635
|
-
* Enable suggestions
|
|
128652
|
+
* Enable suggestions.
|
|
128636
128653
|
*
|
|
128637
128654
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled Read more...}
|
|
128638
128655
|
*/
|
package/kernel.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.18",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
package/layers/FeatureLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import r from"../request.js";import i from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{clone as a}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as c}from"../core/promiseUtils.js";import{sqlAnd as m}from"../core/sql.js";import{urlToObject as h,join as f}from"../core/urlUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import{cast as g}from"../core/accessorSupport/decorators/cast.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import{writer as j}from"../core/accessorSupport/decorators/writer.js";import{excludeTables as T}from"../core/accessorSupport/layerContainerType.js";import F from"../form/FormTemplate.js";import S from"../geometry/SpatialReference.js";import I from"./Layer.js";import{MemorySource as E}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as D}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as x}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as C}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as P}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as M}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as q}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as O}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{PublishableLayer as U}from"./mixins/PublishableLayer.js";import{RefreshableLayer as Q}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import{TrackableLayer as $}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as G,parse as J,cleanTitle as W}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as Z,id as H,labelsVisible as k,opacityDrawingInfo as z,legendEnabled as K,listMode as X,popupEnabled as Y,screenSizePerspectiveEnabled as ee}from"./support/commonProperties.js";import{ensureLayerCredential as te,computeEffectiveEditingEnabled as re,readGlobalIdField as ie,readObjectIdField as oe,createDefaultRenderer as se,addAttachment as ae,updateAttachment as ne,applyEdits as le,uploadAssets as pe,createQuery as ue,deleteAttachments as de,fetchRecomputedExtents as ye,getFeatureType as ce,getFieldDomain as me,queryAttachments as he,queryObjectIds as fe,queryFeatureCount as be,queryExtent as ge,queryRelatedFeatures as we,queryRelatedFeaturesCount as ve,validateBinsQuery as je,hasDataChanged as Te,geometryTypeKebabDict as Fe}from"./support/featureLayerUtils.js";import Se from"./support/FeatureTemplate.js";import Ie from"./support/FeatureType.js";import{defineFieldProperties as Ee}from"./support/fieldProperties.js";import{fixRendererFields as Le,fixTimeInfoFields as De}from"./support/fieldUtils.js";import _e from"./support/LabelClass.js";import{reader as xe}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Ce}from"./support/serviceCapabilitiesUtils.js";import Pe from"./support/TimeInfo.js";import Me from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as qe}from"./support/versionUtils.js";import{DataLayerSource as Oe}from"./support/source/DataLayerSource.js";import{read as Ae}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ve}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Re,rendererTypes as Ue}from"../renderers/support/typeUtils.js";import Qe from"../rest/support/FeatureSet.js";import Be from"../rest/support/Query.js";import{isNumber as Ne}from"../support/guards.js";import{createPopupTemplate as $e}from"../support/popupUtils.js";import{symbolTypes as Ge}from"../symbols/support/typeUtils.js";import{SaveOperationType as Je}from"../webdoc/interfaces.js";import{opacityToTransparency as We}from"../webdoc/support/opacityUtils.js";const Ze="FeatureLayer";function He(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function ke(e){return e&&e instanceof o}const ze=Ee();function Ke(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let Xe=class extends(q(O(M(U(P(C(_(V(N($(B(Q(D(A(R(p(x(L(i.ClonableMixin(I)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=S.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=d((async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case Je.SAVE:return i(this,t);case Je.SAVE_AS:return o(this,r,t)}}))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this.initLayerProperties(e)))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(y).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new s("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))})).then((()=>te(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return l(e),new Me({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Ce(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return re(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&u(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return ie(t.layerDefinition||t)}readObjectIdField(e,t){return oe(t.layerDefinition||t)}get parsedUrl(){const e=h(this.url);return null!=e&&(null!=this.dynamicDataSource?e.path=f(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=f(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Le(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ae(i,t,r)??void 0;return e||n.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return se(t,r)}set source(e){const t=this._get("source");t!==e&&(ke(t)&&this._resetMemorySource(t),ke(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof o?new E({layer:this,items:e}):e:null}readSource(e,t){const r=Qe.fromJSON(t.featureSet);return new E({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map((e=>Se.fromJSON(e))),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?G(this.url,r):r;let t=r;if(!t&&this.url){const e=J(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),W(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map((e=>(e=Ie.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e)))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await ae(this,e,t,Ze);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await ne(this,e,t,r,Ze);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return le(this,e,t)}async uploadAssets(e,t){return pe(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return $e(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await c(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=ue(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=m(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await de(this,e,t,Ze);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ye(this,e,Ze)}getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){return this._titleCreator.getTitle(this,e,t)}getFeatureType(e){return ce(this.types,this.typeIdField,e)}getFieldDomain(e,t){return me(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return he(this,e,t,Ze)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Be.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r;return i}async queryObjectIds(e,t){return await fe(this,e,t,Ze)}async queryFeatureCount(e,t){return be(this,e,t,Ze)}async queryExtent(e,t){return ge(this,e,t,Ze)}async queryRelatedFeatures(e,t){return we(this,e,t,Ze)}async queryRelatedFeaturesCount(e,t){return ve(this,e,t,Ze)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),a=await r.queryTopFeatures(o.default.from(e),t);if(a?.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new s(Ze,"Layer source does not support queryAttributeBins capability");je(e,i,Ze);const o=await import("../rest/support/AttributeBinsQuery.js"),a=await r.queryAttributeBins(o.default.from(e),t);if(a.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Ne)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(He(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return o?.push(He(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return o?.push(He(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return o?.push(He(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new s(Ze,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||qe(this,e))}async save(e){return this._debouncedSaveOperations(Je.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Je.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";u("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return r(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)}))}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),Le(this.renderer,this.fieldsIndex),De(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ve(this,{origin:"service"})}async hasDataChanged(){return Te(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new s("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new s("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this.addHandles([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};e([b({clonable:!1,readOnly:!0})],Xe.prototype,"_titleCreator",null),e([b(Z)],Xe.prototype,"attributeTableTemplate",void 0),e([w("service","capabilities")],Xe.prototype,"readCapabilities",null),e([b({json:{origins:{"web-scene":{write:!1}},write:!0}})],Xe.prototype,"charts",void 0),e([b({readOnly:!0})],Xe.prototype,"createQueryVersion",null),e([b({json:{read:{source:"layerDefinition.copyrightText"}}})],Xe.prototype,"copyright",void 0),e([b({json:{read:{source:"layerDefinition.displayField"}}})],Xe.prototype,"displayField",void 0),e([b({types:Ge,readOnly:!0})],Xe.prototype,"defaultSymbol",void 0),e([b({type:Oe})],Xe.prototype,"dynamicDataSource",void 0),e([b({type:Boolean})],Xe.prototype,"editingEnabled",null),e([w(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Xe.prototype,"readEditingEnabled",null),e([w("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Xe.prototype,"readEditingEnabledFromWebMap",null),e([j(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Xe.prototype,"writeEditingEnabled",null),e([j("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Xe.prototype,"writeEditingEnabledToWebMap",null),e([b({readOnly:!0})],Xe.prototype,"effectiveEditingEnabled",null),e([b({clonable:!1,readOnly:!0})],Xe.prototype,"featureTitleFields",null),e([b({...ze.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Ke}}}}})],Xe.prototype,"fields",void 0),e([b(ze.fieldsIndex)],Xe.prototype,"fieldsIndex",void 0),e([b({type:F,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Xe.prototype,"formTemplate",void 0),e([b({json:{read:{source:"layerDefinition.extent"}}})],Xe.prototype,"fullExtent",void 0),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Ke,writer(e,t,r){const i=e?Fe.toJSON(e):null;i&&u(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Fe.read}}})],Xe.prototype,"geometryType",void 0),e([b({json:{read:{source:"layerDefinition.hasM"}}})],Xe.prototype,"hasM",void 0),e([b({json:{read:{source:"layerDefinition.hasZ"}}})],Xe.prototype,"hasZ",void 0),e([b(H)],Xe.prototype,"id",void 0),e([b({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Xe.prototype,"infoFor3D",void 0),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Xe.prototype,"isTable",void 0),e([w("service","isTable",["type","geometryType"]),w("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Xe.prototype,"readIsTable",null),e([j("web-map","isTable")],Xe.prototype,"writeIsTable",null),e([b(k)],Xe.prototype,"labelsVisible",void 0),e([b({type:[_e],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:xe,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:xe,write:{layerContainerTypes:T}}})],Xe.prototype,"labelingInfo",void 0),e([b((()=>{const e=a(z);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){u(r,We(e),t)}}},e})())],Xe.prototype,"opacity",void 0),e([b(K)],Xe.prototype,"legendEnabled",void 0),e([b({type:["show","hide"],json:(()=>{const e=a(X.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],Xe.prototype,"listMode",void 0),e([w("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],Xe.prototype,"readGlobalIdField",null),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Ke}}}}})],Xe.prototype,"objectIdField",void 0),e([w("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],Xe.prototype,"readObjectIdField",null),e([b({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:T}}})],Xe.prototype,"operationalLayerType",void 0),e([b(ze.outFields)],Xe.prototype,"outFields",void 0),e([b({readOnly:!0})],Xe.prototype,"parsedUrl",null),e([b({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Xe.prototype,"path",void 0),e([b(Y)],Xe.prototype,"popupEnabled",void 0),e([b({type:t,json:{name:"popupInfo",write:!0}})],Xe.prototype,"popupTemplate",void 0),e([b({readOnly:!0})],Xe.prototype,"defaultPopupTemplate",null),e([b({types:Ue,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Re,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:T,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}})],Xe.prototype,"renderer",null),e([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Xe.prototype,"readRenderer",null),e([b()],Xe.prototype,"resourceInfo",void 0),e([b((()=>{const e=a(ee);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],Xe.prototype,"screenSizePerspectiveEnabled",void 0),e([b({clonable:!1})],Xe.prototype,"source",null),e([g("source")],Xe.prototype,"castSource",null),e([w("portal-item","source",["featureSet"]),w("web-map","source",["featureSet"])],Xe.prototype,"readSource",null),e([b({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],Xe.prototype,"spatialReference",void 0),e([b({type:Number})],Xe.prototype,"subtypeCode",void 0),e([b({type:[Se]})],Xe.prototype,"templates",void 0),e([w("templates",["editFieldsInfo","creatorField","editorField","templates"])],Xe.prototype,"readTemplates",null),e([b({type:Pe})],Xe.prototype,"timeInfo",void 0),e([b()],Xe.prototype,"title",void 0),e([w("service","title",["name"]),w("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Xe.prototype,"readTitle",null),e([w("web-map","title",["layerDefinition.name","title"])],Xe.prototype,"readTitleFromWebMap",null),e([b({type:String})],Xe.prototype,"sublayerTitleMode",void 0),e([b({json:{read:!1}})],Xe.prototype,"type",void 0),e([b({type:String})],Xe.prototype,"typeIdField",void 0),e([w("service","typeIdField"),w("typeIdField",["layerDefinition.typeIdField"])],Xe.prototype,"readTypeIdField",null),e([b({type:[Ie]})],Xe.prototype,"types",void 0),e([w("service","types",["types"]),w("types",["layerDefinition.types"])],Xe.prototype,"readTypes",null),e([b({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:T}}}}})],Xe.prototype,"visible",void 0),e([w("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Xe.prototype,"readVisible",null),Xe=e([v("esri.layers.FeatureLayer")],Xe);export{Xe as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import r from"../request.js";import i from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{clone as a}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as c}from"../core/promiseUtils.js";import{sqlAnd as m}from"../core/sql.js";import{urlToObject as h,join as f}from"../core/urlUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import{cast as g}from"../core/accessorSupport/decorators/cast.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import{writer as j}from"../core/accessorSupport/decorators/writer.js";import{excludeTables as T}from"../core/accessorSupport/layerContainerType.js";import F from"../form/FormTemplate.js";import S from"../geometry/SpatialReference.js";import I from"./Layer.js";import{MemorySource as E}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as D}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as x}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as C}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as P}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as q}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as M}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as O}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{PublishableLayer as U}from"./mixins/PublishableLayer.js";import{RefreshableLayer as Q}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import{TrackableLayer as $}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as G,parse as J,cleanTitle as W}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as Z,id as H,labelsVisible as k,opacityDrawingInfo as z,legendEnabled as K,listMode as X,popupEnabled as Y,screenSizePerspectiveEnabled as ee}from"./support/commonProperties.js";import{ensureLayerCredential as te,computeEffectiveEditingEnabled as re,readGlobalIdField as ie,readObjectIdField as oe,createDefaultRenderer as se,addAttachment as ae,updateAttachment as ne,applyEdits as le,uploadAssets as pe,createQuery as ue,deleteAttachments as de,fetchRecomputedExtents as ye,getFeatureType as ce,getFieldDomain as me,queryAttachments as he,queryObjectIds as fe,queryFeatureCount as be,queryExtent as ge,queryRelatedFeatures as we,queryRelatedFeaturesCount as ve,validateBinsQuery as je,hasDataChanged as Te,geometryTypeKebabDict as Fe}from"./support/featureLayerUtils.js";import Se from"./support/FeatureTemplate.js";import Ie from"./support/FeatureType.js";import{defineFieldProperties as Ee}from"./support/fieldProperties.js";import{fixRendererFields as Le,fixTimeInfoFields as De}from"./support/fieldUtils.js";import _e from"./support/LabelClass.js";import{reader as xe}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Ce}from"./support/serviceCapabilitiesUtils.js";import Pe from"./support/TimeInfo.js";import qe from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Me}from"./support/versionUtils.js";import{DataLayerSource as Oe}from"./support/source/DataLayerSource.js";import{read as Ae}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ve}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Re,rendererTypes as Ue}from"../renderers/support/typeUtils.js";import Qe from"../rest/support/FeatureSet.js";import Be from"../rest/support/Query.js";import{isNumber as Ne}from"../support/guards.js";import{createPopupTemplate as $e}from"../support/popupUtils.js";import{symbolTypes as Ge}from"../symbols/support/typeUtils.js";import{SaveOperationType as Je}from"../webdoc/interfaces.js";import{opacityToTransparency as We}from"../webdoc/support/opacityUtils.js";const Ze="FeatureLayer";function He(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function ke(e){return e&&e instanceof o}const ze=Ee();function Ke(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let Xe=class extends(M(O(q(U(P(C(_(V(N($(B(Q(D(A(R(p(x(L(i.ClonableMixin(I)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=S.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=d((async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case Je.SAVE:return i(this,t);case Je.SAVE_AS:return o(this,r,t)}}))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this.initLayerProperties(e)))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(y).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new s("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))})).then((()=>te(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return l(e),new qe({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Ce(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return re(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&u(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return ie(t.layerDefinition||t)}readObjectIdField(e,t){return oe(t.layerDefinition||t)}get parsedUrl(){const e=h(this.url);return null!=e&&(null!=this.dynamicDataSource?e.path=f(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=f(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Le(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ae(i,t,r)??void 0;return e||n.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return se(t,r)}set source(e){const t=this._get("source");t!==e&&(ke(t)&&this._resetMemorySource(t),ke(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof o?new E({layer:this,items:e}):e:null}readSource(e,t){const r=Qe.fromJSON(t.featureSet);return new E({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map((e=>Se.fromJSON(e))),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?G(this.url,r):r;let t=r;if(!t&&this.url){const e=J(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),W(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map((e=>(e=Ie.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e)))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await ae(this,e,t,Ze);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await ne(this,e,t,r,Ze);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return le(this,e,t)}async uploadAssets(e,t){return pe(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return $e(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await c(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=ue(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=m(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await de(this,e,t,Ze);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ye(this,e,Ze)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return ce(this.types,this.typeIdField,e)}getFieldDomain(e,t){return me(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return he(this,e,t,Ze)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Be.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r;return i}async queryObjectIds(e,t){return await fe(this,e,t,Ze)}async queryFeatureCount(e,t){return be(this,e,t,Ze)}async queryExtent(e,t){return ge(this,e,t,Ze)}async queryRelatedFeatures(e,t){return we(this,e,t,Ze)}async queryRelatedFeaturesCount(e,t){return ve(this,e,t,Ze)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),a=await r.queryTopFeatures(o.default.from(e),t);if(a?.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new s(Ze,"Layer source does not support queryAttributeBins capability");je(e,i,Ze);const o=await import("../rest/support/AttributeBinsQuery.js"),a=await r.queryAttributeBins(o.default.from(e),t);if(a.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Ne)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(He(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return o?.push(He(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return o?.push(He(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return o?.push(He(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new s(Ze,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Me(this,e))}async save(e){return this._debouncedSaveOperations(Je.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Je.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";u("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return r(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)}))}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),Le(this.renderer,this.fieldsIndex),De(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ve(this,{origin:"service"})}async hasDataChanged(){return Te(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new s("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new s("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this.addHandles([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};e([b({clonable:!1,readOnly:!0})],Xe.prototype,"_titleCreator",null),e([b(Z)],Xe.prototype,"attributeTableTemplate",void 0),e([w("service","capabilities")],Xe.prototype,"readCapabilities",null),e([b({json:{origins:{"web-scene":{write:!1}},write:!0}})],Xe.prototype,"charts",void 0),e([b({readOnly:!0})],Xe.prototype,"createQueryVersion",null),e([b({json:{read:{source:"layerDefinition.copyrightText"}}})],Xe.prototype,"copyright",void 0),e([b({json:{read:{source:"layerDefinition.displayField"}}})],Xe.prototype,"displayField",void 0),e([b({types:Ge,readOnly:!0})],Xe.prototype,"defaultSymbol",void 0),e([b({type:Oe})],Xe.prototype,"dynamicDataSource",void 0),e([b({type:Boolean})],Xe.prototype,"editingEnabled",null),e([w(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Xe.prototype,"readEditingEnabled",null),e([w("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Xe.prototype,"readEditingEnabledFromWebMap",null),e([j(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Xe.prototype,"writeEditingEnabled",null),e([j("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Xe.prototype,"writeEditingEnabledToWebMap",null),e([b({readOnly:!0})],Xe.prototype,"effectiveEditingEnabled",null),e([b({clonable:!1,readOnly:!0})],Xe.prototype,"featureTitleFields",null),e([b({...ze.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Ke}}}}})],Xe.prototype,"fields",void 0),e([b(ze.fieldsIndex)],Xe.prototype,"fieldsIndex",void 0),e([b({type:F,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Xe.prototype,"formTemplate",void 0),e([b({json:{read:{source:"layerDefinition.extent"}}})],Xe.prototype,"fullExtent",void 0),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Ke,writer(e,t,r){const i=e?Fe.toJSON(e):null;i&&u(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Fe.read}}})],Xe.prototype,"geometryType",void 0),e([b({json:{read:{source:"layerDefinition.hasM"}}})],Xe.prototype,"hasM",void 0),e([b({json:{read:{source:"layerDefinition.hasZ"}}})],Xe.prototype,"hasZ",void 0),e([b(H)],Xe.prototype,"id",void 0),e([b({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Xe.prototype,"infoFor3D",void 0),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Xe.prototype,"isTable",void 0),e([w("service","isTable",["type","geometryType"]),w("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Xe.prototype,"readIsTable",null),e([j("web-map","isTable")],Xe.prototype,"writeIsTable",null),e([b(k)],Xe.prototype,"labelsVisible",void 0),e([b({type:[_e],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:xe,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:xe,write:{layerContainerTypes:T}}})],Xe.prototype,"labelingInfo",void 0),e([b((()=>{const e=a(z);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){u(r,We(e),t)}}},e})())],Xe.prototype,"opacity",void 0),e([b(K)],Xe.prototype,"legendEnabled",void 0),e([b({type:["show","hide"],json:(()=>{const e=a(X.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],Xe.prototype,"listMode",void 0),e([w("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],Xe.prototype,"readGlobalIdField",null),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Ke}}}}})],Xe.prototype,"objectIdField",void 0),e([w("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],Xe.prototype,"readObjectIdField",null),e([b({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:T}}})],Xe.prototype,"operationalLayerType",void 0),e([b(ze.outFields)],Xe.prototype,"outFields",void 0),e([b({readOnly:!0})],Xe.prototype,"parsedUrl",null),e([b({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Xe.prototype,"path",void 0),e([b(Y)],Xe.prototype,"popupEnabled",void 0),e([b({type:t,json:{name:"popupInfo",write:!0}})],Xe.prototype,"popupTemplate",void 0),e([b({readOnly:!0})],Xe.prototype,"defaultPopupTemplate",null),e([b({types:Ue,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Re,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:T,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}})],Xe.prototype,"renderer",null),e([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Xe.prototype,"readRenderer",null),e([b()],Xe.prototype,"resourceInfo",void 0),e([b((()=>{const e=a(ee);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],Xe.prototype,"screenSizePerspectiveEnabled",void 0),e([b({clonable:!1})],Xe.prototype,"source",null),e([g("source")],Xe.prototype,"castSource",null),e([w("portal-item","source",["featureSet"]),w("web-map","source",["featureSet"])],Xe.prototype,"readSource",null),e([b({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],Xe.prototype,"spatialReference",void 0),e([b({type:Number})],Xe.prototype,"subtypeCode",void 0),e([b({type:[Se]})],Xe.prototype,"templates",void 0),e([w("templates",["editFieldsInfo","creatorField","editorField","templates"])],Xe.prototype,"readTemplates",null),e([b({type:Pe})],Xe.prototype,"timeInfo",void 0),e([b()],Xe.prototype,"title",void 0),e([w("service","title",["name"]),w("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Xe.prototype,"readTitle",null),e([w("web-map","title",["layerDefinition.name","title"])],Xe.prototype,"readTitleFromWebMap",null),e([b({type:String})],Xe.prototype,"sublayerTitleMode",void 0),e([b({json:{read:!1}})],Xe.prototype,"type",void 0),e([b({type:String})],Xe.prototype,"typeIdField",void 0),e([w("service","typeIdField"),w("typeIdField",["layerDefinition.typeIdField"])],Xe.prototype,"readTypeIdField",null),e([b({type:[Ie]})],Xe.prototype,"types",void 0),e([w("service","types",["types"]),w("types",["layerDefinition.types"])],Xe.prototype,"readTypes",null),e([b({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:T}}}}})],Xe.prototype,"visible",void 0),e([w("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Xe.prototype,"readVisible",null),Xe=e([v("esri.layers.FeatureLayer")],Xe);export{Xe as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Clonable.js";import r from"../core/Collection.js";import s from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n,whenOrAbort as l}from"../core/promiseUtils.js";import{watch as u,sync as p}from"../core/reactiveUtils.js";import{sqlAnd as y}from"../core/sql.js";import{urlToObject as d,join as c}from"../core/urlUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import b from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as w}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as F}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as v}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as x}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{id as O}from"./support/commonProperties.js";import{ensureLayerCredential as P,computeEffectiveEditingEnabled as G,addAttachment as A,updateAttachment as U,applyEdits as q,createQuery as D,deleteAttachments as M,fetchRecomputedExtents as R,computeDomainFromSubtypes as $,getFeatureSubtype as V,queryAttachments as k,queryObjectIds as N,queryFeatureCount as Q,queryExtent as H,queryRelatedFeatures as J,queryRelatedFeaturesCount as B,hasDataChanged as Z}from"./support/featureLayerUtils.js";import{defineFieldProperties as z}from"./support/fieldProperties.js";import{fixTimeInfoFields as K}from"./support/fieldUtils.js";import{getSymbolWithColorSupport as W,createSimpleRenderersWithUniqueColors as X}from"./support/subtypeGroupLayerUtils.js";import Y from"./support/SubtypeSublayer.js";import ee from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as te}from"./support/versionUtils.js";import re from"../rest/support/Query.js";import{isNumber as se}from"../support/guards.js";import{SaveOperationType as ie}from"../webdoc/interfaces.js";const oe="SubtypeGroupLayer";function ae(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function ne(e,t){const r=[];for(const s of e){const e=new Y;e.read(s,t),r.push(e)}return r}const le=z();function ue(){return{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}let pe=class extends(L(F(v(w(_(E(I(S(x(T(o(j(g(t.ClonableMixin(b))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(r.ofType(Y)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer","Table"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=a((async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/featureLayerUtils.js");switch(e){case ie.SAVE:return s(this,t);case ie.SAVE_AS:return i(this,r,t)}})),this.addHandles(u((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),p))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(n).then((async()=>{if(!this.url)throw new s("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new s("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>P(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return G(this)}get operationalLayerType(){return this.isTable?"SubtypeGroupTable":"SubtypeGroupLayer"}get parsedUrl(){const e=d(this.url);return null!=e&&null!=this.layerId&&(e.path=c(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}async addAttachment(e,t){const r=await A(this,e,t,oe);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await U(this,e,t,r,oe);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return q(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await l(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=D(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=y(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await M(this,e,t,oe);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return R(this,e,oe)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const t=$(this,e);if(t)return t}const r=V(this,t?.feature);if(r){const t=r.domains?.[e];return"inherited"===t?.type?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return i(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return k(this,e,t,oe)}async queryFeatures(e,t){const r=await this.load(),s=re.from(e)??r.createQuery(),i=s.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),s.outFields=i);const o=await r.source.queryFeatures(s,t);if(o?.features)for(const a of o.features)a.layer=a.sourceLayer=this.findSublayerForFeature(a);return o}async queryObjectIds(e,t){return(await N(this,e,t,oe)).filter(se)}async queryFeatureCount(e,t){return Q(this,e,t,oe)}async queryExtent(e,t){return H(this,e,t,oe)}async queryRelatedFeatures(e,t){return J(this,e,t,oe)}async queryRelatedFeaturesCount(e,t){return B(this,e,t,oe)}async save(e){return this._debouncedSaveOperations(ie.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ie.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:i,messages:o}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return o?.push(ae(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return o?.push(ae(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(o?.push(new s("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&te(this,e)}async getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){const r=this.findSublayerForFeature(e);return r?await r.getFeatureTitle(e,t):this.displayField&&this.fieldsIndex.has(this.displayField)?e.attributes[this.fieldsIndex.get(this.displayField).name]??"":this.objectIdField&&this.fieldsIndex.has(this.objectIdField)?e.attributes[this.fieldsIndex.get(this.objectIdField).name]??"":""}get featureTitleFields(){const e=new Set;for(const t of this.sublayers){const r=t.featureTitleFields;for(const t of r)e.add(t)}return[...e]}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new s("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),K(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return Z(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}};e([h({readOnly:!0})],pe.prototype,"createQueryVersion",null),e([h({readOnly:!0})],pe.prototype,"editingEnabled",null),e([h({readOnly:!0})],pe.prototype,"effectiveEditingEnabled",null),e([h({...le.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],pe.prototype,"fields",void 0),e([h(le.fieldsIndex)],pe.prototype,"fieldsIndex",void 0),e([h(O)],pe.prototype,"id",void 0),e([h({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],pe.prototype,"listMode",void 0),e([h({type:["SubtypeGroupLayer","SubtypeGroupTable"],json:{...ue(),origins:{"web-document":ue(),"portal-item":ue()}}})],pe.prototype,"operationalLayerType",null),e([h(le.outFields)],pe.prototype,"outFields",void 0),e([h({readOnly:!0})],pe.prototype,"parsedUrl",null),e([h({clonable:!1})],pe.prototype,"source",null),e([h({type:r.ofType(Y),json:{origins:{service:{read:{source:"subtypes",reader(e,t,s){let i=null;if(this.useUniqueColorsForSublayers){const r=W(t,s);i=r?X(e.length,r):null}const o=e.map((({code:e},r)=>{const o=new Y({subtypeCode:e});o.read(t,s);const a=i?.[r];return a&&o.read({drawingInfo:{renderer:a.toJSON()}},s),o}));return new(r.ofType(Y))(o)}}}},read:{source:["layers","tables"],reader(e,t,s){let i;return"SubtypeGroupLayer"===t.layerType&&t.layers?.length?i=ne(t.layers,s):"SubtypeGroupTable"===t.layerType&&t.tables?.length&&(i=ne(t.tables,s)),new(r.ofType(Y))(i)}},write:{ignoreOrigin:!0,writer(e,t,r,s){const i=[];for(const o of e){const e=o.write({},s);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],pe.prototype,"sublayers",void 0),e([h()],pe.prototype,"useUniqueColorsForSublayers",void 0),e([h({type:ee})],pe.prototype,"timeInfo",void 0),e([h({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],pe.prototype,"title",void 0),e([m("service","title",["name"])],pe.prototype,"readTitleFromService",null),e([h({json:{read:!1}})],pe.prototype,"type",void 0),e([h({clonable:!1,readOnly:!0})],pe.prototype,"featureTitleFields",null),pe=e([f("esri.layers.SubtypeGroupLayer")],pe);const ye=pe;export{ye as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Clonable.js";import r from"../core/Collection.js";import s from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{debounce as n,throwIfAbortError as u,whenOrAbort as l}from"../core/promiseUtils.js";import{watch as p,sync as y}from"../core/reactiveUtils.js";import{sqlAnd as d}from"../core/sql.js";import{urlToObject as c,join as h}from"../core/urlUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as b}from"../core/accessorSupport/decorators/subclass.js";import g from"./Layer.js";import{APIKeyMixin as w}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as F}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as v}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as L}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as T}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as E}from"./mixins/OperationalLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as _}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as C}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as O}from"./support/arcgisLayerUrl.js";import{id as P}from"./support/commonProperties.js";import{ensureLayerCredential as U,computeEffectiveEditingEnabled as A,addAttachment as G,updateAttachment as q,applyEdits as D,createQuery as M,deleteAttachments as k,fetchRecomputedExtents as R,computeDomainFromSubtypes as $,getFeatureSubtype as V,queryAttachments as N,queryObjectIds as Q,queryFeatureCount as H,queryExtent as J,queryRelatedFeatures as B,queryRelatedFeaturesCount as z,hasDataChanged as K}from"./support/featureLayerUtils.js";import{defineFieldProperties as Z}from"./support/fieldProperties.js";import{fixTimeInfoFields as W}from"./support/fieldUtils.js";import{getSymbolWithColorSupport as X,createSimpleRenderersWithUniqueColors as Y}from"./support/subtypeGroupLayerUtils.js";import ee from"./support/SubtypeSublayer.js";import te from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as re}from"./support/versionUtils.js";import se from"../rest/support/Query.js";import{isNumber as ie}from"../support/guards.js";import{SaveOperationType as oe}from"../webdoc/interfaces.js";const ae="SubtypeGroupLayer";function ne(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function ue(e,t){const r=[];for(const s of e){const e=new ee;e.read(s,t),r.push(e)}return r}const le=Z();function pe(){return{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}let ye=class extends(T(v(L(j(C(I(_(S(E(x(a(F(w(t.ClonableMixin(g))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(r.ofType(ee)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer","Table"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=n((async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/featureLayerUtils.js");switch(e){case oe.SAVE:return s(this,t);case oe.SAVE_AS:return i(this,r,t)}})),this.addHandles(p((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),y))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u).then((async()=>{if(!this.url)throw new s("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new s("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>U(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return A(this)}get operationalLayerType(){return this.isTable?"SubtypeGroupTable":"SubtypeGroupLayer"}get parsedUrl(){const e=c(this.url);return null!=e&&null!=this.layerId&&(e.path=h(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?O(this.url,t):t}async addAttachment(e,t){const r=await G(this,e,t,ae);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await q(this,e,t,r,ae);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return D(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await l(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=M(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=d(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await k(this,e,t,ae);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return R(this,e,ae)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const t=$(this,e);if(t)return t}const r=V(this,t?.feature);if(r){const t=r.domains?.[e];return"inherited"===t?.type?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return i(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return N(this,e,t,ae)}async queryFeatures(e,t){const r=await this.load(),s=se.from(e)??r.createQuery(),i=s.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),s.outFields=i);const o=await r.source.queryFeatures(s,t);if(o?.features)for(const a of o.features)a.layer=a.sourceLayer=this.findSublayerForFeature(a);return o}async queryObjectIds(e,t){return(await Q(this,e,t,ae)).filter(ie)}async queryFeatureCount(e,t){return H(this,e,t,ae)}async queryExtent(e,t){return J(this,e,t,ae)}async queryRelatedFeatures(e,t){return B(this,e,t,ae)}async queryRelatedFeaturesCount(e,t){return z(this,e,t,ae)}async save(e){return this._debouncedSaveOperations(oe.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(oe.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:i,messages:o}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return o?.push(ne(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return o?.push(ne(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(o?.push(new s("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&re(this,e)}async getFeatureTitle(e,t){const r=this.findSublayerForFeature(e);return r?await r.getFeatureTitle(e,t):this._getFeatureTitleForUnknownSublayer(e)}async getFeatureTitles(e,t){const r=new Map,s=new Map,i=[s];e.forEach((e=>{const t=this.findSublayerForFeature(e);t?o(r,t,(()=>[])).push(e):s.set(e,this._getFeatureTitleForUnknownSublayer(e))}));const a=await Promise.all(Array.from(r).map((([e,r])=>e.getFeatureTitles(r,t))));return a.forEach((e=>i.push(e))),new Map(i.flatMap((e=>[...e])))}get featureTitleFields(){const e=new Set;for(const t of this.sublayers){const r=t.featureTitleFields;for(const t of r)e.add(t)}return[...e]}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new s("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),W(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return K(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}_getFeatureTitleForUnknownSublayer(e){const{displayField:t,fieldsIndex:r,objectIdField:s}=this;if(t&&r.has(t))return e.attributes[r.get(t).name]??"";const i=e.getObjectId();return null!=i?i.toString():s&&r.has(s)?e.attributes[r.get(s).name]??"":""}};e([m({readOnly:!0})],ye.prototype,"createQueryVersion",null),e([m({readOnly:!0})],ye.prototype,"editingEnabled",null),e([m({readOnly:!0})],ye.prototype,"effectiveEditingEnabled",null),e([m({...le.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ye.prototype,"fields",void 0),e([m(le.fieldsIndex)],ye.prototype,"fieldsIndex",void 0),e([m(P)],ye.prototype,"id",void 0),e([m({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],ye.prototype,"listMode",void 0),e([m({type:["SubtypeGroupLayer","SubtypeGroupTable"],json:{...pe(),origins:{"web-document":pe(),"portal-item":pe()}}})],ye.prototype,"operationalLayerType",null),e([m(le.outFields)],ye.prototype,"outFields",void 0),e([m({readOnly:!0})],ye.prototype,"parsedUrl",null),e([m({clonable:!1})],ye.prototype,"source",null),e([m({type:r.ofType(ee),json:{origins:{service:{read:{source:"subtypes",reader(e,t,s){let i=null;if(this.useUniqueColorsForSublayers){const r=X(t,s);i=r?Y(e.length,r):null}const o=e.map((({code:e},r)=>{const o=new ee({subtypeCode:e});o.read(t,s);const a=i?.[r];return a&&o.read({drawingInfo:{renderer:a.toJSON()}},s),o}));return new(r.ofType(ee))(o)}}}},read:{source:["layers","tables"],reader(e,t,s){let i;return"SubtypeGroupLayer"===t.layerType&&t.layers?.length?i=ue(t.layers,s):"SubtypeGroupTable"===t.layerType&&t.tables?.length&&(i=ue(t.tables,s)),new(r.ofType(ee))(i)}},write:{ignoreOrigin:!0,writer(e,t,r,s){const i=[];for(const o of e){const e=o.write({},s);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],ye.prototype,"sublayers",void 0),e([m()],ye.prototype,"useUniqueColorsForSublayers",void 0),e([m({type:te})],ye.prototype,"timeInfo",void 0),e([m({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],ye.prototype,"title",void 0),e([f("service","title",["name"])],ye.prototype,"readTitleFromService",null),e([m({json:{read:!1}})],ye.prototype,"type",void 0),e([m({clonable:!1,readOnly:!0})],ye.prototype,"featureTitleFields",null),ye=e([b("esri.layers.SubtypeGroupLayer")],ye);const de=ye;export{de as default};
|