@arcgis/core 6.0.0-next.20 → 6.0.0-next.21
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/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0049b66ccbfb168caa76.js +1 -0
- package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
- package/assets/esri/core/workers/chunks/{564565246dae080f5e6c.js → 1f6b601147521a42e65c.js} +1 -1
- package/assets/esri/core/workers/chunks/25d14874198773d2d836.js +1 -0
- package/assets/esri/core/workers/chunks/{00d66e3fba5ab4d2aa3c.js → 461e63a0f436c41a9f4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a485130781b49dbf608.js → 601e1d020b8115497944.js} +1 -1
- package/assets/esri/core/workers/chunks/728837812940d7f2ef43.js +1 -0
- package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fab290090ef2ccae810.js → 9e0559cd0bb01a0ed9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{597db9c90f19092d8d66.js → a0c9e3f8b7d55d6dc1d5.js} +10 -10
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
- package/assets/esri/core/workers/chunks/{9d61740ef8bdcc162be1.js → a8df3f59728f841b608e.js} +1 -1
- package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
- package/assets/esri/core/workers/chunks/db9921fbda556f142c4a.js +1 -0
- package/assets/esri/core/workers/chunks/{612104dff305ff062dfa.js → dfc81e66196c402f39b4.js} +2 -2
- package/assets/esri/core/workers/chunks/{a34b3d2e11a777e1ff3f.js → f28b63c1179366dac8a2.js} +1 -1
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +113 -121
- package/config.d.ts +62 -34
- package/config.js +1 -1
- package/core/workers/Connection.d.ts +58 -89
- package/core/workers.d.ts +45 -54
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +7 -5
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +9 -3
- package/layers/MapNotesLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.d.ts +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/support/Sublayer.d.ts +29 -15
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/package.json +3 -3
- package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
- package/rest/layerSources/DynamicDataLayer.js +1 -1
- package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
- package/rest/layerSources/DynamicWorkspaceLayer.d.ts +45 -0
- package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
- package/rest/layerSources/typeUtils.js +2 -0
- package/rest/print.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/symbols/LineSymbol3D.d.ts +5 -3
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/layers/AnnotationFeatureLayerView2D.js +1 -1
- package/views/2d/layers/CSVLayerView2D.js +1 -1
- package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
- package/views/2d/layers/DimensionFeatureLayerView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/GeoJSONLayerView2D.js +1 -1
- package/views/2d/layers/KnowledgeGraphSublayerView2D.js +1 -1
- package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
- package/views/2d/layers/OrientedImageryLayerView2D.js +1 -1
- package/views/2d/layers/ParquetLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
- package/views/2d/layers/WFSLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
- package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
- package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/BreakpointsOwner.d.ts +6 -0
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/types.d.ts +3 -0
- package/views/ui/UI.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +0 -1
- package/assets/esri/core/workers/chunks/370aad23df597db80d65.js +0 -1
- package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
- package/assets/esri/core/workers/chunks/6ad309154fe84210d23c.js +0 -1
- package/assets/esri/core/workers/chunks/a49fe94933b65b4b64f8.js +0 -1
- package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
|
@@ -49,30 +49,23 @@ export interface InvokeOptions extends AbortOptions {
|
|
|
49
49
|
*
|
|
50
50
|
* ```js
|
|
51
51
|
* // Module loaded in main thread
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* .
|
|
63
|
-
*
|
|
64
|
-
* connection.close();
|
|
65
|
-
* connection = null;
|
|
66
|
-
*
|
|
67
|
-
* return result;
|
|
68
|
-
* });
|
|
52
|
+
* import { open } from "@arcgis/core/core/workers.js";
|
|
53
|
+
*
|
|
54
|
+
* export async function getSumAsync(numbers) {
|
|
55
|
+
* const connection = await open(new URL("./calculator.js", import.meta.url).href, {
|
|
56
|
+
* isESM: true
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* try {
|
|
60
|
+
* return await connection.invoke("getSum", numbers);
|
|
61
|
+
* } finally {
|
|
62
|
+
* connection.close();
|
|
63
|
+
* }
|
|
69
64
|
* }
|
|
70
65
|
*
|
|
71
66
|
* // Invoke our method.
|
|
72
|
-
* getSumAsync([0, 2, 4, 6, 8])
|
|
73
|
-
*
|
|
74
|
-
* console.log("Result:", result);
|
|
75
|
-
* });
|
|
67
|
+
* const result = await getSumAsync([0, 2, 4, 6, 8]);
|
|
68
|
+
* console.log("Result:", result);
|
|
76
69
|
* ```
|
|
77
70
|
*
|
|
78
71
|
* <span id="multiple-parameters"></span>
|
|
@@ -102,55 +95,37 @@ export interface InvokeOptions extends AbortOptions {
|
|
|
102
95
|
*
|
|
103
96
|
* ```js
|
|
104
97
|
* // Module loaded in main thread
|
|
105
|
-
* export function mapMultiplyAsync(numbers, factor) {
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* numbers: numbers,
|
|
116
|
-
* factor: factor
|
|
117
|
-
* });
|
|
118
|
-
* })
|
|
119
|
-
* .then(function(result) {
|
|
120
|
-
* // close the connection after we are done.
|
|
121
|
-
* connection.close();
|
|
122
|
-
* connection = null;
|
|
123
|
-
*
|
|
124
|
-
* return result;
|
|
98
|
+
* export async function mapMultiplyAsync(numbers, factor) {
|
|
99
|
+
* const connection = await open(new URL("./calculator.js", import.meta.url).href, {
|
|
100
|
+
* isESM: true
|
|
101
|
+
* });
|
|
102
|
+
*
|
|
103
|
+
* try {
|
|
104
|
+
* // Invoke mapMultiply and pass an object with two key-value pairs.
|
|
105
|
+
* return await connection.invoke("mapMultiply", {
|
|
106
|
+
* numbers: numbers,
|
|
107
|
+
* factor: factor
|
|
125
108
|
* });
|
|
109
|
+
* } finally {
|
|
110
|
+
* connection.close();
|
|
111
|
+
* }
|
|
126
112
|
* }
|
|
127
113
|
*
|
|
128
114
|
* // Invoke the method.
|
|
129
|
-
* mapMultiplyAsync([0, 2, 4, 6, 8], 2)
|
|
130
|
-
*
|
|
131
|
-
* console.log("Result:", result);
|
|
132
|
-
* });
|
|
115
|
+
* const result = await mapMultiplyAsync([0, 2, 4, 6, 8], 2);
|
|
116
|
+
* console.log("Result:", result);
|
|
133
117
|
* ```
|
|
134
118
|
*
|
|
135
119
|
* <span id="using-transferables"></span>
|
|
136
120
|
* ## Using transferables
|
|
137
121
|
*
|
|
138
|
-
*
|
|
122
|
+
* [Transferable objects](https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Transferable_objects) can be used
|
|
139
123
|
* to transfer data between main and worker thread to avoid copying the data. With this approach,
|
|
140
124
|
* the ownership of the object is transferred to the other context. Use this technique to transfer large
|
|
141
125
|
* chuck of memory with [ArrayBuffers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer),
|
|
142
126
|
* a [MessagePort](https://developer.mozilla.org/docs/Web/API/MessagePort),
|
|
143
127
|
* or an [ImageBitmap](https://developer.mozilla.org/docs/Web/API/ImageBitmap).
|
|
144
128
|
*
|
|
145
|
-
* > [!CAUTION]
|
|
146
|
-
* >
|
|
147
|
-
* > **Note**
|
|
148
|
-
* >
|
|
149
|
-
* > The `Transferable` interface technically no longer exists. The functionality of `Transferable` objects still exists,
|
|
150
|
-
* > however, but is implemented at a more fundamental level
|
|
151
|
-
* > (technically speaking, using the `[Transferable]` [WebIDL](https://developer.mozilla.org/docs/Glossary/WebIDL)
|
|
152
|
-
* > extended attribute). See also [Transferable objects](https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Transferable_objects).
|
|
153
|
-
*
|
|
154
129
|
* To transfer an object to the worker, use the `transferList` parameter of the [invoke()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/#invoke) method.
|
|
155
130
|
* For the remote method to return or resolve with a transferable object, the result returned must have
|
|
156
131
|
* two properties: `result` and `transferList`, `result` being an object and `transferList` the array
|
|
@@ -184,26 +159,19 @@ export interface InvokeOptions extends AbortOptions {
|
|
|
184
159
|
*
|
|
185
160
|
* ```js
|
|
186
161
|
* // Module loaded in main thread
|
|
187
|
-
* export function mapMultiplyFloat64Async(numbers, factor) {
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* numbers: numbers,
|
|
197
|
-
* factor: factor
|
|
198
|
-
* });
|
|
199
|
-
* })
|
|
200
|
-
* .then(function(result) {
|
|
201
|
-
* // close the connection after we are done.
|
|
202
|
-
* connection.close();
|
|
203
|
-
* connection = null;
|
|
204
|
-
*
|
|
205
|
-
* return result;
|
|
162
|
+
* export async function mapMultiplyFloat64Async(numbers, factor) {
|
|
163
|
+
* const connection = await open(new URL("./calculator.js", import.meta.url).href, {
|
|
164
|
+
* isESM: true
|
|
165
|
+
* });
|
|
166
|
+
*
|
|
167
|
+
* try {
|
|
168
|
+
* return await connection.invoke("mapMultiplyFloat64", {
|
|
169
|
+
* numbers: numbers,
|
|
170
|
+
* factor: factor
|
|
206
171
|
* });
|
|
172
|
+
* } finally {
|
|
173
|
+
* connection.close();
|
|
174
|
+
* }
|
|
207
175
|
* }
|
|
208
176
|
*
|
|
209
177
|
* // Invoke our method.
|
|
@@ -213,11 +181,9 @@ export interface InvokeOptions extends AbortOptions {
|
|
|
213
181
|
* floats[2] = 4;
|
|
214
182
|
* floats[3] = 6;
|
|
215
183
|
* floats[4] = 8;
|
|
216
|
-
* mapMultiplyFloat64Async(floats, 2)
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
* console.log("Result:", resultFloats);
|
|
220
|
-
* });
|
|
184
|
+
* const result = await mapMultiplyFloat64Async(floats, 2);
|
|
185
|
+
* const resultFloats = new Float64Array(result);
|
|
186
|
+
* console.log("Result:", resultFloats);
|
|
221
187
|
* ```
|
|
222
188
|
*
|
|
223
189
|
* @since 4.2
|
|
@@ -250,16 +216,19 @@ export default abstract class Connection {
|
|
|
250
216
|
* const controller = new AbortController();
|
|
251
217
|
* const signal = controller.signal;
|
|
252
218
|
*
|
|
253
|
-
* //
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
* }
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
219
|
+
* // Invoke a function on a worker thread.
|
|
220
|
+
* async function invokeWithTimeout() {
|
|
221
|
+
* try {
|
|
222
|
+
* const result = await connection.invoke("myLongRunningRemoteFunction", { someParameter: 10 }, {
|
|
223
|
+
* signal
|
|
224
|
+
* });
|
|
225
|
+
* console.log(result);
|
|
226
|
+
* } catch (error) {
|
|
227
|
+
* console.error(error);
|
|
228
|
+
* }
|
|
229
|
+
* }
|
|
230
|
+
*
|
|
231
|
+
* invokeWithTimeout();
|
|
263
232
|
*
|
|
264
233
|
* // if the call it takes more than 10 secs, abort:
|
|
265
234
|
* setTimeout(() => {
|
package/core/workers.d.ts
CHANGED
|
@@ -32,14 +32,18 @@ import type { AbortOptions } from "./promiseUtils.js";
|
|
|
32
32
|
*
|
|
33
33
|
* Possible Value | Description
|
|
34
34
|
* ---------------|------------
|
|
35
|
-
* distributed | The module is loaded in each available worker. Each
|
|
36
|
-
* dedicated | The module is loaded in
|
|
37
|
-
* local | The module
|
|
35
|
+
* distributed | The module is loaded in each available worker. Each invocation is handled by an available worker. Use this strategy when the module is stateless and does not need to retain data between invocations.
|
|
36
|
+
* dedicated | The module is loaded in a single worker, and all invocations are handled by that worker. Use this strategy when the module needs to retain state between invocations or maintain stateful communication with the main thread.
|
|
37
|
+
* local | The module runs on the main thread instead of in a worker. Use this strategy when worker execution is unavailable or not desired. This can affect UI responsiveness.
|
|
38
38
|
*/
|
|
39
39
|
export type OpenStrategy = "distributed" | "dedicated" | "local";
|
|
40
40
|
|
|
41
41
|
export interface OpenOptions extends AbortOptions {
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* An object containing methods that the worker module can call on the main thread.
|
|
44
|
+
* In a custom worker class, declare a `remoteClient` property and use
|
|
45
|
+
* `this.remoteClient.invoke("methodName", data)` to invoke a method on this object.
|
|
46
|
+
*/
|
|
43
47
|
client?: any;
|
|
44
48
|
/**
|
|
45
49
|
* Indicates whether the module is an ES module.
|
|
@@ -51,7 +55,7 @@ export interface OpenOptions extends AbortOptions {
|
|
|
51
55
|
*/
|
|
52
56
|
isESM?: boolean;
|
|
53
57
|
/**
|
|
54
|
-
* Indicates how to load the module. See
|
|
58
|
+
* Indicates how to load the module. See [OpenStrategy](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#OpenStrategy) for a list of possible values.
|
|
55
59
|
*
|
|
56
60
|
* @default distributed
|
|
57
61
|
*/
|
|
@@ -66,67 +70,54 @@ export interface OpenOptions extends AbortOptions {
|
|
|
66
70
|
* @returns Resolves to an instance of [Connection](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/).
|
|
67
71
|
* @see [Connection](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/)
|
|
68
72
|
* @example
|
|
69
|
-
*
|
|
70
|
-
* // to a folder called workersFolder.
|
|
71
|
-
* esriConfig.workers.loaderConfig = {
|
|
72
|
-
* paths: {
|
|
73
|
-
* myWorkers: new URL("./workersFolder", document.baseURI).href
|
|
74
|
-
* }
|
|
75
|
-
* };
|
|
73
|
+
* import { open } from "@arcgis/core/core/workers.js";
|
|
76
74
|
*
|
|
77
|
-
* //
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* .
|
|
84
|
-
*
|
|
85
|
-
*
|
|
75
|
+
* // Load an ESM worker module and invoke its "getMaxNumber" function.
|
|
76
|
+
* const connection = await open(new URL("./workersFolder/Calculator.js", import.meta.url).href, {
|
|
77
|
+
* isESM: true
|
|
78
|
+
* });
|
|
79
|
+
* try {
|
|
80
|
+
* // Invoke the worker function and receive its result on the main thread.
|
|
81
|
+
* const result = await connection.invoke("getMaxNumber", [0, 1, 2, 3, 4]);
|
|
82
|
+
* console.log(result);
|
|
83
|
+
* } finally {
|
|
84
|
+
* connection.close();
|
|
85
|
+
* }
|
|
86
86
|
*
|
|
87
87
|
* //*********************************************************
|
|
88
|
-
* // module:
|
|
88
|
+
* // module: workersFolder/Calculator.js
|
|
89
89
|
* //*********************************************************
|
|
90
|
-
*
|
|
91
|
-
* return
|
|
92
|
-
*
|
|
93
|
-
* getMaxNumber: function (number) {
|
|
94
|
-
* return Math.max.apply(null, numbers);
|
|
95
|
-
* }
|
|
96
|
-
* };
|
|
97
|
-
* });
|
|
90
|
+
* export function getMaxNumber(numbers) {
|
|
91
|
+
* return Math.max(...numbers);
|
|
92
|
+
* }
|
|
98
93
|
* @example
|
|
99
|
-
* // Load
|
|
100
|
-
*
|
|
101
|
-
*
|
|
94
|
+
* // Load an ESM worker module that calls a function on the main thread.
|
|
95
|
+
* const connection = await open(new URL("./workerScripts/TimeOfDay.js", import.meta.url).href, {
|
|
96
|
+
* isESM: true,
|
|
102
97
|
* client: {
|
|
103
|
-
* getCurrentTime
|
|
98
|
+
* getCurrentTime() {
|
|
104
99
|
* return Date.now();
|
|
105
100
|
* }
|
|
106
101
|
* }
|
|
107
|
-
* })
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* .
|
|
112
|
-
*
|
|
113
|
-
*
|
|
102
|
+
* });
|
|
103
|
+
*
|
|
104
|
+
* try {
|
|
105
|
+
* const result = await connection.invoke("timeOfTheDay");
|
|
106
|
+
* console.log(result);
|
|
107
|
+
* } finally {
|
|
108
|
+
* connection.close();
|
|
109
|
+
* }
|
|
114
110
|
*
|
|
115
111
|
* //*********************************************************
|
|
116
|
-
* // module: workerScripts/
|
|
112
|
+
* // module: workerScripts/TimeOfDay.js
|
|
117
113
|
* //*********************************************************
|
|
114
|
+
* export default class TimeOfTheDay {
|
|
115
|
+
* remoteClient;
|
|
118
116
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* return remoteClient.invoke("getCurrentTime")
|
|
125
|
-
* .then((time) => {
|
|
126
|
-
* return "The time is " + time;
|
|
127
|
-
* });
|
|
128
|
-
* }
|
|
129
|
-
* };
|
|
130
|
-
* });
|
|
117
|
+
* async timeOfTheDay() {
|
|
118
|
+
* const time = await this.remoteClient.invoke("getCurrentTime");
|
|
119
|
+
* return `The time is ${time}`;
|
|
120
|
+
* }
|
|
121
|
+
* }
|
|
131
122
|
*/
|
|
132
123
|
export function open(modulePath: string, options?: OpenOptions): Promise<Connection>;
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.
|
|
2
|
+
import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.21`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
|
package/layers/FeatureLayer.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type Subtype from "./support/Subtype.js";
|
|
|
13
13
|
import type SymbolLayerDrawing from "./support/SymbolLayerDrawing.js";
|
|
14
14
|
import type PortalItem from "../portal/PortalItem.js";
|
|
15
15
|
import type DynamicDataLayer from "../rest/layerSources/DynamicDataLayer.js";
|
|
16
|
+
import type DynamicWorkspaceLayer from "../rest/layerSources/DynamicWorkspaceLayer.js";
|
|
16
17
|
import type AttachmentInfo from "../rest/query/support/AttachmentInfo.js";
|
|
17
18
|
import type AttributeBinsFeatureSet from "../rest/support/AttributeBinsFeatureSet.js";
|
|
18
19
|
import type FeatureSet from "../rest/support/FeatureSet.js";
|
|
@@ -23,13 +24,13 @@ import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
|
23
24
|
import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js";
|
|
24
25
|
import type { AddAttachmentOptions, AttachmentEditOptions, EditOptions, Edits, EditsResult, FeatureEditResult } from "../editing/types.js";
|
|
25
26
|
import type { LayerEvents, LayerProperties } from "./Layer.js";
|
|
26
|
-
import type { LayerSaveAsOptions, LayerSaveOptions
|
|
27
|
+
import type { FeatureTitleOptions, LayerSaveAsOptions, LayerSaveOptions } from "./types.js";
|
|
27
28
|
import type { APIKeyMixin, APIKeyMixinProperties } from "./mixins/APIKeyMixin.js";
|
|
28
29
|
import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
|
|
29
30
|
import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
|
|
30
31
|
import type { DataSeriesLayer, DataSeriesLayerProperties } from "./mixins/DataSeriesLayer.js";
|
|
31
32
|
import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mixins/DisplayFilteredLayer.js";
|
|
32
|
-
import type {
|
|
33
|
+
import type { EditBusLayerEvents, EditBusLayer } from "./mixins/EditBusLayer.js";
|
|
33
34
|
import type { FeatureEffectLayer, FeatureEffectLayerProperties } from "./mixins/FeatureEffectLayer.js";
|
|
34
35
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
35
36
|
import type { FeatureReductionLayer, FeatureReductionLayerProperties } from "./mixins/FeatureReductionLayer.js";
|
|
@@ -53,6 +54,7 @@ import type { TopFeaturesQueryProperties } from "../rest/support/TopFeaturesQuer
|
|
|
53
54
|
import type { CreatePopupTemplateOptions } from "../support/popupUtils.js";
|
|
54
55
|
import type { ObjectId } from "../views/types.js";
|
|
55
56
|
import type { AttributeTableTemplateProperties } from "../tables/AttributeTableTemplate.js";
|
|
57
|
+
import type { DynamicWorkspaceLayerProperties } from "../rest/layerSources/DynamicWorkspaceLayer.js";
|
|
56
58
|
import type { DynamicDataLayerProperties } from "../rest/layerSources/DynamicDataLayer.js";
|
|
57
59
|
import type { FieldConfigurationProperties } from "./support/FieldConfiguration.js";
|
|
58
60
|
import type { FieldProperties } from "./support/Field.js";
|
|
@@ -151,7 +153,7 @@ export interface FeatureLayerProperties extends LayerProperties, APIKeyMixinProp
|
|
|
151
153
|
* }
|
|
152
154
|
* });
|
|
153
155
|
*/
|
|
154
|
-
dynamicDataSource?: DynamicDataLayerProperties | null;
|
|
156
|
+
dynamicDataSource?: (DynamicDataLayerProperties & { type: "data-layer" }) | (DynamicWorkspaceLayerProperties & { type: "workspace-layer" }) | null;
|
|
155
157
|
/**
|
|
156
158
|
* An array of [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) objects that control how fields are displayed in popups and other UI elements. Each object specifies options for an individual field, such as its display name, via `alias`, and formatting rules, via `fieldFormat`. Assign this property before the layer loads to ensure the configurations take effect. For more information, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
|
|
157
159
|
* If no field configurations are provided, they are automatically created when a [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupTemplate) is assigned to the layer. If no [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupTemplate) is set, you can manually define field configurations to customize how fields are shown.
|
|
@@ -909,8 +911,8 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
|
|
|
909
911
|
* }
|
|
910
912
|
* });
|
|
911
913
|
*/
|
|
912
|
-
get dynamicDataSource(): DynamicDataLayer |
|
|
913
|
-
set dynamicDataSource(value: DynamicDataLayerProperties |
|
|
914
|
+
get dynamicDataSource(): DynamicDataLayer | DynamicWorkspaceLayer | null;
|
|
915
|
+
set dynamicDataSource(value: (DynamicDataLayerProperties & { type: "data-layer" }) | (DynamicWorkspaceLayerProperties & { type: "workspace-layer" }) | null);
|
|
914
916
|
/**
|
|
915
917
|
* Determines if the layer is editable.
|
|
916
918
|
*
|
package/layers/FeatureLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t,__decorate as n}from"tslib";import r from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as a}from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{disposable as ee,makeHandle as te}from"../core/handleUtils.js";import{clone as c}from"../core/lang.js";import ne from"../core/Logger.js";import{destroyMaybe as re}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as ie}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as l}from"../core/object.js";import{debounce as ae,throwIfAbortError as oe,whenOrAbort as se,onAbort as ce}from"../core/promiseUtils.js";import{sqlAnd as le}from"../core/sql.js";import{property as u,subclass as ue}from"../core/accessorSupport/decorators.js";import{excludeTables as d}from"../core/accessorSupport/layerContainerType.js";import de from"../form/FormTemplate.js";import fe from"../geometry/SpatialReference.js";import pe from"../graphic/FeatureGraphicOrigin.js";import me from"./Layer.js";import{MemorySource as f}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as he}from"./mixins/APIKeyMixin.js";import{ArcGISService as p}from"./mixins/ArcGISService.js";import{BlendLayer as m}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as g}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as _}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as v}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as y}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as b}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as x}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{OrderedLayer as C}from"./mixins/OrderedLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{PublishableLayer as T}from"./mixins/PublishableLayer.js";import{RefreshableLayer as E}from"./mixins/RefreshableLayer.js";import{ReloadableLayer as D}from"./mixins/ReloadableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as k}from"./mixins/TemporalLayer.js";import{TrackableLayer as A}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as j,parse as M,cleanTitle as N}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as P,id as F,labelsVisible as I,opacityDrawingInfo as L,legendEnabled as R,listMode as ge,popupEnabled as _e,screenSizePerspectiveEnabled as ve}from"./support/commonProperties.js";import{ensureLayerCredential as ye,computeEffectiveEditingEnabled as be,readGlobalIdField as xe,readObjectIdField as Se,createDefaultRenderer as Ce,addAttachment as we,updateAttachment as Te,applyEdits as Ee,uploadAssets as De,createQuery as Oe,deleteAttachments as ke,fetchRecomputedExtents as Ae,getFeatureType as je,getFieldDomain as Me,queryAttachments as Ne,queryObjectIds as Pe,queryFeatureCount as Fe,queryExtent as Ie,queryRelatedFeatures as Le,queryRelatedFeaturesCount as Re,validateBinsQuery as ze,hasDataChanged as Be,geometryTypeKebabDict as z}from"./support/featureLayerUtils.js";import B from"./support/FeatureTemplate.js";import V from"./support/FeatureType.js";import Ve from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as He,fieldConfigurationsFromPopupTemplate as Ue,fieldConfigurationsFromFields as We}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Ge}from"./support/fieldProperties.js";import{fixRendererFields as H,fixTimeInfoFields as Ke}from"./support/fieldUtils.js";import qe from"./support/LabelClass.js";import{reader as U}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Je}from"./support/serviceCapabilitiesUtils.js";import W from"./support/SymbolLayerDrawing.js";import Ye from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Xe}from"./support/versionUtils.js";import{read as Ze}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Qe}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as $e,rendererTypes as et}from"../renderers/support/typeUtils.js";import tt from"../rest/layerSources/DynamicDataLayer.js";import nt from"../rest/support/FeatureSet.js";import G from"../rest/support/Query.js";import{isNumber as rt}from"../support/guards.js";import{createPopupTemplate as it}from"../support/popupUtils.js";import{symbolTypes as at}from"../symbols/support/typeUtils.js";import{opacityToTransparency as ot}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as K}from"../webdoc/support/unsupportedErrors.js";import{reader as q}from"../core/accessorSupport/decorators/reader.js";import{writer as J}from"../core/accessorSupport/decorators/writer.js";const Y=`FeatureLayer`;function X(e){return e&&e instanceof o}const Z=Ge();function Q(e,t,n){let r=!!n?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let $=class extends D(b(x(y(T(v(_(m(C(k(g(A(O(E(p(S(w(ie(h(he(a(me))))))))))))))))))))){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.graphicOrigin=new pe(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=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=fe.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedPortalItemTypes=[`Feature Service`,`Feature Collection`,`Scene Service`],this.supportedSourceTypes=new Set([`Feature Layer`,`Oriented Imagery Layer`,`Table`,`Catalog Layer`]),this.templates=null,this.title=null,this.sublayerTitleMode=`item-title`,this.type=`feature`,this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ae(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);let n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(oe).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){let e=await this._fetchFirstValidLayerId(t);e!=null&&(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(()=>ye(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get _titleCreator(){let e=this._get(`_titleCreator`);return re(e),new Ye({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,Je(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?!1: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,n){return this._readEditingEnabled(t,!0,n)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,n,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return be(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource()||(this._override(`fieldConfigurations`,e),!this.loaded))return;let t=He(this,e);t&&this._set(`popupTemplate`,t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden(`fieldConfigurations`)?this._get(`fieldConfigurations`):Ue(this)||null}readIsTable(e,t){return t=t?.layerDefinition??t,t.type===`Table`||!t.geometryType}writeIsTable(e,t,n,r){r?.writeLayerSchema&&l(n,e?`Table`:`Feature Layer`,t)}readSymbolLayerDrawing(e,t){let n=t.layerDefinition?.drawingInfo,r=n?.renderer,i=n?.symbolLayerDrawing;return r&&i?new W(i):null}readGlobalIdField(e,t){return xe(t.layerDefinition||t)}readObjectIdField(e,t){return Se(t.layerDefinition||t)}writePopupTemplate(e,t,n,r){e&&(t[n]=e.toJSON({...r,writeFieldFormat:!r?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){H(e,this.fieldsIndex),this._set(`renderer`,e)}readRenderer(e,t,n){t=t.layerDefinition||t;let r=t.drawingInfo?.renderer;if(r){let e=Ze(r,t,n)??void 0;return e||ne.getLogger(this).error(`Failed to create renderer`,{rendererDefinition:t.drawingInfo.renderer,layer:this,context:n}),e}return Ce(t,n)}get source(){return this._get(`source`)}set source(e){e||=null;let t=this._get(`source`);t!==e&&((Array.isArray(e)||e instanceof o)&&(e=new f({layer:this,items:e})),X(t)&&this._resetMemorySource(t),X(e)&&this._initMemorySource(e),this._set(`source`,e))}readSource(e,t){let n=nt.fromJSON(t.featureSet);return new f({layer:this,items:n?.features??[]})}readTemplates(e,t){let n=t.editFieldsInfo,r=n?.creatorField,i=n?.editorField;return e=e?.map(e=>B.fromJSON(e)),this._fixTemplates(e,r),this._fixTemplates(e,i),e}readTitle(e,t){let n=t.layerDefinition?.name??t.name,r=t.title||t.layerDefinition?.title;if(n){if(this.sublayerTitleMode===`item-title`)return this.url?j(this.url,n):n;let e=n;if(!e&&this.url){let t=M(this.url);t!=null&&(e=t.title)}if(!e)return;let t=this.portalItem?.title;return this.sublayerTitleMode===`item-title-and-service-name`&&t&&t!==e&&(e=t+` - `+e),N(e)}if(this.sublayerTitleMode===`item-title`&&r)return r}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){t=t.layerDefinition||t;let n=t.typeIdField;if(n&&t.fields){n=n.toLowerCase();let e=t.fields.find(e=>e.name.toLowerCase()===n);e&&(n=e.name)}return n}readTypes(e,t){t=t.layerDefinition||t,e=t.types;let n=t.editFieldsInfo,r=n?.creatorField,i=n?.editorField;return e?.map(e=>(e=V.fromJSON(e),this._fixTemplates(e.templates,r),this._fixTemplates(e.templates,i),e))}readVisible(e,t){if(t.layerDefinition?.defaultVisibility!=null)return!!t.layerDefinition.defaultVisibility;if(t.visibility!=null)return!!t.visibility}async addAttachment(e,t,n){let r=await we(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,n,r){let i=await Te(this,e,t,n,Y,r);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Ee(this,e,t)}async uploadAssets(e,t){return De(this,e,t)}createFieldConfigurations(){return We(this)}createPopupTemplate(e){return it(this,e)}async createGraphicsSource(n){let r={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:n});let{default:t}=await se(import(`./graphics/sources/FeatureLayerSource.js`),n),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});return e(r,ee(ce(n,()=>i.cancelLoad())??te()),!1),await i.load({signal:n}),i}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}createQuery(){let e=Oe(this);e.dynamicDataSource=this.dynamicDataSource;let t=this.subtypeCode==null?null:`${this.subtypeField} = ${this.subtypeCode}`;return e.where=le(this.definitionExpression,t)||`1=1`,e}async deleteAttachments(e,t,n){let r=await ke(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return Ae(this,e,Y)}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 je(this.types,this.typeIdField,e)}getFieldAlias(e){let t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return Me(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return Ne(this,e,t,Y)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(G.from(e)??n.createQuery(),t),i=this.graphicOrigin;if(r?.features)for(let e of r.features)e.layer=e.sourceLayer=n,e.origin=i;return r}async queryObjectIds(e,t){return await Pe(this,e,t,Y)}async queryFeatureCount(e,t){return Fe(this,e,t,Y)}async queryExtent(e,t){return Ie(this,e,t,Y)}async queryRelatedFeatures(e,t){return Le(this,e,t,Y)}async queryRelatedFeaturesCount(e,t){return Re(this,e,t,Y)}async queryPivot(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryPivot||!r?.operations?.supportsQueryPivot)throw new s(Y,`Layer source does not support queryPivot capability`);let i=await import(`../rest/support/PivotQuery.js`),a=await n.queryPivot(i.default.from(e),t),o=this.graphicOrigin;if(a?.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryTopFeatures(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopFeatures||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopFeatures capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`),a=await n.queryTopFeatures(i.default.from(e),t),o=this.graphicOrigin;if(a?.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryAttributeBins(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryAttributeBins)throw new s(Y,`Layer source does not support queryAttributeBins capability`);ze(e,r,Y);let i=await import(`../rest/support/AttributeBinsQuery.js`),a=await n.queryAttributeBins(i.default.from(e),t),o=this.graphicOrigin;if(a.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryTopObjectIds(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopObjectIds||!r?.query.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopObjectIds capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return(await n.queryTopObjectIds(i.default.from(e),t)).filter(rt)}async queryTopFeaturesExtent(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopExtents||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopExtents capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return n.queryTopExtents(i.default.from(e),t)}async queryTopFeatureCount(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopCount||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryFeatureCount capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return n.queryTopCount(i.default.from(e),t)}read(e,t){let n=e.featureCollection;if((n||e.type===`Feature Collection`)&&(this.resourceInfo=e),n){let{layers:e,showLegend:r}=n;e?.length===1&&(super.read(e[0],t),r!=null&&super.read({showLegend:r},t))}super.read(e,t),X(this.source)&&t?.origin===`service`&&([`objectIdField`,`fields`,`timeInfo`,`dateFieldsTimeZone`,`uniqueIdFields`].forEach(e=>{this.revertToOrigin(e,`service`)}),this.spatialReference||this.revertToOrigin(`spatialReference`,`service`))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};let{origin:n,layerContainerType:r}=t;if(this.dynamicDataSource)return K(t,this,`a dynamic data source cannot be written to web scenes, web maps and feature service items`),null;if(this.isTable){if((n===`web-map`||n===`web-scene`)&&r!==`tables`)return K(t,this,`a table source can only be written to tables`),null;if(this._hasMemorySource())return K(t,this,`an in-memory table source cannot be written to web scenes and web maps`),null}else if(this.loaded&&(n===`web-map`||n===`web-scene`)&&r===`tables`)return K(t,this,`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(Y,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return this.loaded?this.source?.type===`memory`||Xe(this,e):!1}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,n){let r=e.layerDefinition?.capabilities;if(r||(r=e.capabilities,t&&n?.origin===`web-map`&&!this._hasMemorySource()&&r))return this._hasEditingCapability(r)}_hasEditingCapability(e){return e.toLowerCase().split(`,`).map(e=>e.trim()).includes(`editing`)}_writeEditingEnabled(e,t,n,r){if(!e){let e=this.capabilities?.operations?.supportsSync?`Query,Sync`:`Query`;l(`layerDefinition.capabilities`,e,t),n&&!r?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return i(this.url??``,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e}).then(e=>{let 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(),H(this.renderer,this.fieldsIndex),Ke(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&this.geometryType===`mesh`&&(this.capabilities.query.supportsReturnMesh=!0),Qe(this,{origin:`service`})}canReload(){return super.canReload()&&!this._hasMemorySource()}async reloadFromService(e){let t=this.source;await t.reload({signal:e}),await this.initLayerProperties(t)}async hasDataChanged(){return Be(this)}async fetchPublishingStatus(){let e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():`unavailable`}_verifyFields(){let e=this.parsedUrl?.path??`undefined`;this.objectIdField||console.log(`FeatureLayer: 'objectIdField' property is not defined (url: `+e+`)`),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(e=>e.type===`geometry`)||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=>{let n=e.prototype?.attributes;n&&t&&delete n[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[...e.layers||[],...e.tables||[]].find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};n([u({clonable:!1,readOnly:!0})],$.prototype,`_titleCreator`,null),n([u(P)],$.prototype,`attributeTableTemplate`,void 0),n([q(`service`,`capabilities`)],$.prototype,`readCapabilities`,null),n([u({json:{origins:{"web-scene":{write:!1}},write:!0}})],$.prototype,`charts`,void 0),n([u({readOnly:!0})],$.prototype,`createQueryVersion`,null),n([u({json:{read:{source:`layerDefinition.copyrightText`}}})],$.prototype,`copyright`,void 0),n([u({json:{read:{source:`layerDefinition.displayField`}}})],$.prototype,`displayField`,void 0),n([u({types:at,readOnly:!0})],$.prototype,`defaultSymbol`,void 0),n([u({type:tt})],$.prototype,`dynamicDataSource`,void 0),n([u({type:Boolean})],$.prototype,`editingEnabled`,null),n([q([`portal-item`,`web-scene`],`editingEnabled`,[`layerDefinition.capabilities`])],$.prototype,`readEditingEnabled`,null),n([q(`web-map`,`editingEnabled`,[`capabilities`,`layerDefinition.capabilities`])],$.prototype,`readEditingEnabledFromWebMap`,null),n([J([`portal-item`,`web-scene`],`editingEnabled`,{"layerDefinition.capabilities":{type:String}})],$.prototype,`writeEditingEnabled`,null),n([J(`web-map`,`editingEnabled`,{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],$.prototype,`writeEditingEnabledToWebMap`,null),n([u({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),n([u({clonable:!1,readOnly:!0})],$.prototype,`featureTitleFields`,null),n([u({type:[Ve],json:{name:`layerDefinition.fieldConfigurations`,write:{overridePolicy(e,t,n){return{enabled:!n?.writeLayerSchema,ignoreOrigin:this.originIdOf(t)===1}}}}})],$.prototype,`fieldConfigurations`,null),n([u({...Z.fields,json:{read:{source:`layerDefinition.fields`},origins:{service:{name:`fields`},"web-map":{write:{target:`layerDefinition.fields`,overridePolicy:Q}}}}})],$.prototype,`fields`,void 0),n([u(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),n([u({type:de,json:{name:`formInfo`,write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,`formTemplate`,void 0),n([u({json:{read:{source:`layerDefinition.extent`}}})],$.prototype,`fullExtent`,void 0),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.geometryType`,overridePolicy:Q,writer(e,t,n){let r=e?z.toJSON(e):null;r&&l(n,r,t)}}}},read:{source:`layerDefinition.geometryType`,reader:z.read}}})],$.prototype,`geometryType`,void 0),n([u({readOnly:!0,clonable:!1})],$.prototype,`graphicOrigin`,void 0),n([u({json:{read:{source:`layerDefinition.hasM`}}})],$.prototype,`hasM`,void 0),n([u({json:{read:{source:`layerDefinition.hasZ`}}})],$.prototype,`hasZ`,void 0),n([u(F)],$.prototype,`id`,void 0),n([u({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],$.prototype,`infoFor3D`,void 0),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.type`}}}}})],$.prototype,`isTable`,void 0),n([q(`service`,`isTable`,[`type`,`geometryType`]),q(`isTable`,[`layerDefinition.type`,`layerDefinition.geometryType`])],$.prototype,`readIsTable`,null),n([J(`web-map`,`isTable`)],$.prototype,`writeIsTable`,null),n([u(I)],$.prototype,`labelsVisible`,void 0),n([u({type:[qe],json:{origins:{service:{name:`drawingInfo.labelingInfo`,read:U,write:!1}},name:`layerDefinition.drawingInfo.labelingInfo`,read:U,write:{layerContainerTypes:d}}})],$.prototype,`labelingInfo`,void 0),n([u({type:W,json:{name:`layerDefinition.drawingInfo.symbolLayerDrawing`,write:!0,origins:{"web-scene":{write:!1}}}})],$.prototype,`symbolLayerDrawing`,void 0),n([q([`portal-item`,`web-map`],`symbolLayerDrawing`,[`layerDefinition.drawingInfo.renderer`,`layerDefinition.drawingInfo.symbolLayerDrawing`])],$.prototype,`readSymbolLayerDrawing`,null),n([u((()=>{let e=c(L);return e.json.origins[`portal-item`]={write:{target:`layerDefinition.drawingInfo.transparency`,writer(e,t,n){l(n,ot(e),t)}}},e})())],$.prototype,`opacity`,void 0),n([u(R)],$.prototype,`legendEnabled`,void 0),n([u({type:[`show`,`hide`],json:(()=>{let e=c(ge.json);return e.origins[`portal-item`]={read:!1,write:!1},e})()})],$.prototype,`listMode`,void 0),n([q(`globalIdField`,[`layerDefinition.globalIdField`,`layerDefinition.fields`])],$.prototype,`readGlobalIdField`,null),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.objectIdField`,overridePolicy:Q}}}}})],$.prototype,`objectIdField`,void 0),n([q(`objectIdField`,[`layerDefinition.objectIdField`,`layerDefinition.fields`])],$.prototype,`readObjectIdField`,null),n([u({type:[`ArcGISFeatureLayer`],json:{write:{target:`layerType`,ignoreOrigin:!0,layerContainerTypes:d}}})],$.prototype,`operationalLayerType`,void 0),n([u(Z.outFields)],$.prototype,`outFields`,void 0),n([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],$.prototype,`path`,void 0),n([u(_e)],$.prototype,`popupEnabled`,void 0),n([u({type:r,json:{name:`popupInfo`,write:!0}})],$.prototype,`popupTemplate`,void 0),n([J(`popupTemplate`)],$.prototype,`writePopupTemplate`,null),n([u({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),n([u({types:et,json:{origins:{service:{write:{target:`drawingInfo.renderer`,enabled:!1}},"web-scene":{types:$e,name:`layerDefinition.drawingInfo.renderer`,write:{layerContainerTypes:d,overridePolicy(e,t,n){return{ignoreOrigin:n?.writeLayerSchema,layerContainerTypes:d}}}}},write:{target:`layerDefinition.drawingInfo.renderer`,overridePolicy(e,t,n){return{ignoreOrigin:n?.writeLayerSchema,layerContainerTypes:d}}}}})],$.prototype,`renderer`,null),n([q(`service`,`renderer`,[`drawingInfo.renderer`,`defaultSymbol`]),q(`renderer`,[`layerDefinition.drawingInfo.renderer`,`layerDefinition.defaultSymbol`])],$.prototype,`readRenderer`,null),n([u()],$.prototype,`resourceInfo`,void 0),n([u((()=>{let e=c(ve);return e.json.origins[`portal-item`]={read:!1,write:!1},e})())],$.prototype,`screenSizePerspectiveEnabled`,void 0),n([u({clonable:!1})],$.prototype,`source`,null),n([q(`portal-item`,`source`,[`featureSet`]),q(`web-map`,`source`,[`featureSet`])],$.prototype,`readSource`,null),n([u({json:{read:{source:`layerDefinition.extent.spatialReference`}}})],$.prototype,`spatialReference`,void 0),n([u({type:Number})],$.prototype,`subtypeCode`,void 0),n([u({readOnly:!1})],$.prototype,`subtypeField`,void 0),n([u({readOnly:!1})],$.prototype,`subtypes`,void 0),n([u({type:[B]})],$.prototype,`templates`,void 0),n([q(`templates`,[`editFieldsInfo`,`creatorField`,`editorField`,`templates`])],$.prototype,`readTemplates`,null),n([u()],$.prototype,`title`,void 0),n([q(`service`,`title`,[`name`]),q(`portal-item`,`title`,[`layerDefinition.title`,`layerDefinition.name`,`title`])],$.prototype,`readTitle`,null),n([q(`web-map`,`title`,[`layerDefinition.name`,`title`])],$.prototype,`readTitleFromWebMap`,null),n([u({type:String})],$.prototype,`sublayerTitleMode`,void 0),n([u({json:{read:!1}})],$.prototype,`type`,void 0),n([u({type:String})],$.prototype,`typeIdField`,void 0),n([q(`service`,`typeIdField`),q(`typeIdField`,[`layerDefinition.typeIdField`])],$.prototype,`readTypeIdField`,null),n([u({type:[V]})],$.prototype,`types`,void 0),n([q(`service`,`types`,[`types`]),q(`types`,[`layerDefinition.types`])],$.prototype,`readTypes`,null),n([u({type:Boolean,json:{origins:{"portal-item":{write:{target:`layerDefinition.defaultVisibility`,layerContainerTypes:d}}}}})],$.prototype,`visible`,void 0),n([q(`portal-item`,`visible`,[`visibility`,`layerDefinition.defaultVisibility`])],$.prototype,`readVisible`,null),$=n([ue(`esri.layers.FeatureLayer`)],$);export{$ as default};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as n}from"tslib";import r from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as a}from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{disposable as ee,makeHandle as te}from"../core/handleUtils.js";import{clone as c}from"../core/lang.js";import ne from"../core/Logger.js";import{destroyMaybe as re}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as ie}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as l}from"../core/object.js";import{debounce as ae,throwIfAbortError as oe,whenOrAbort as se,onAbort as ce}from"../core/promiseUtils.js";import{sqlAnd as le}from"../core/sql.js";import{property as u,subclass as ue}from"../core/accessorSupport/decorators.js";import{excludeTables as d}from"../core/accessorSupport/layerContainerType.js";import de from"../form/FormTemplate.js";import fe from"../geometry/SpatialReference.js";import pe from"../graphic/FeatureGraphicOrigin.js";import me from"./Layer.js";import{MemorySource as f}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as he}from"./mixins/APIKeyMixin.js";import{ArcGISService as p}from"./mixins/ArcGISService.js";import{BlendLayer as m}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as g}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as _}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as v}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as y}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as b}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as x}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{OrderedLayer as C}from"./mixins/OrderedLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{PublishableLayer as T}from"./mixins/PublishableLayer.js";import{RefreshableLayer as E}from"./mixins/RefreshableLayer.js";import{ReloadableLayer as D}from"./mixins/ReloadableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as k}from"./mixins/TemporalLayer.js";import{TrackableLayer as A}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as j,parse as M,cleanTitle as N}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as P,id as F,labelsVisible as I,opacityDrawingInfo as L,legendEnabled as R,listMode as ge,popupEnabled as _e,screenSizePerspectiveEnabled as ve}from"./support/commonProperties.js";import{ensureLayerCredential as ye,computeEffectiveEditingEnabled as be,readGlobalIdField as xe,readObjectIdField as Se,createDefaultRenderer as Ce,addAttachment as we,updateAttachment as Te,applyEdits as Ee,uploadAssets as De,createQuery as Oe,deleteAttachments as ke,fetchRecomputedExtents as Ae,getFeatureType as je,getFieldDomain as Me,queryAttachments as Ne,queryObjectIds as Pe,queryFeatureCount as Fe,queryExtent as Ie,queryRelatedFeatures as Le,queryRelatedFeaturesCount as Re,validateBinsQuery as ze,hasDataChanged as Be,geometryTypeKebabDict as z}from"./support/featureLayerUtils.js";import B from"./support/FeatureTemplate.js";import V from"./support/FeatureType.js";import Ve from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as He,fieldConfigurationsFromPopupTemplate as Ue,fieldConfigurationsFromFields as We}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Ge}from"./support/fieldProperties.js";import{fixRendererFields as H,fixTimeInfoFields as Ke}from"./support/fieldUtils.js";import qe from"./support/LabelClass.js";import{reader as U}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Je}from"./support/serviceCapabilitiesUtils.js";import W from"./support/SymbolLayerDrawing.js";import Ye from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Xe}from"./support/versionUtils.js";import{read as Ze}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Qe}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as $e,rendererTypes as et}from"../renderers/support/typeUtils.js";import{dynamicDataSourceTypes as tt}from"../rest/layerSources/typeUtils.js";import nt from"../rest/support/FeatureSet.js";import G from"../rest/support/Query.js";import{isNumber as rt}from"../support/guards.js";import{createPopupTemplate as it}from"../support/popupUtils.js";import{symbolTypes as at}from"../symbols/support/typeUtils.js";import{opacityToTransparency as ot}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as K}from"../webdoc/support/unsupportedErrors.js";import{reader as q}from"../core/accessorSupport/decorators/reader.js";import{writer as J}from"../core/accessorSupport/decorators/writer.js";const Y=`FeatureLayer`;function X(e){return e&&e instanceof o}const Z=Ge();function Q(e,t,n){let r=!!n?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let $=class extends D(b(x(y(T(v(_(m(C(k(g(A(O(E(p(S(w(ie(h(he(a(me))))))))))))))))))))){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.graphicOrigin=new pe(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=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=fe.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedPortalItemTypes=[`Feature Service`,`Feature Collection`,`Scene Service`],this.supportedSourceTypes=new Set([`Feature Layer`,`Oriented Imagery Layer`,`Table`,`Catalog Layer`]),this.templates=null,this.title=null,this.sublayerTitleMode=`item-title`,this.type=`feature`,this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ae(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);let n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(oe).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){let e=await this._fetchFirstValidLayerId(t);e!=null&&(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(()=>ye(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get _titleCreator(){let e=this._get(`_titleCreator`);return re(e),new Ye({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,Je(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?!1: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,n){return this._readEditingEnabled(t,!0,n)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,n,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return be(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource()||(this._override(`fieldConfigurations`,e),!this.loaded))return;let t=He(this,e);t&&this._set(`popupTemplate`,t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden(`fieldConfigurations`)?this._get(`fieldConfigurations`):Ue(this)||null}readIsTable(e,t){return t=t?.layerDefinition??t,t.type===`Table`||!t.geometryType}writeIsTable(e,t,n,r){r?.writeLayerSchema&&l(n,e?`Table`:`Feature Layer`,t)}readSymbolLayerDrawing(e,t){let n=t.layerDefinition?.drawingInfo,r=n?.renderer,i=n?.symbolLayerDrawing;return r&&i?new W(i):null}readGlobalIdField(e,t){return xe(t.layerDefinition||t)}readObjectIdField(e,t){return Se(t.layerDefinition||t)}writePopupTemplate(e,t,n,r){e&&(t[n]=e.toJSON({...r,writeFieldFormat:!r?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){H(e,this.fieldsIndex),this._set(`renderer`,e)}readRenderer(e,t,n){t=t.layerDefinition||t;let r=t.drawingInfo?.renderer;if(r){let e=Ze(r,t,n)??void 0;return e||ne.getLogger(this).error(`Failed to create renderer`,{rendererDefinition:t.drawingInfo.renderer,layer:this,context:n}),e}return Ce(t,n)}get source(){return this._get(`source`)}set source(e){e||=null;let t=this._get(`source`);t!==e&&((Array.isArray(e)||e instanceof o)&&(e=new f({layer:this,items:e})),X(t)&&this._resetMemorySource(t),X(e)&&this._initMemorySource(e),this._set(`source`,e))}readSource(e,t){let n=nt.fromJSON(t.featureSet);return new f({layer:this,items:n?.features??[]})}readTemplates(e,t){let n=t.editFieldsInfo,r=n?.creatorField,i=n?.editorField;return e=e?.map(e=>B.fromJSON(e)),this._fixTemplates(e,r),this._fixTemplates(e,i),e}readTitle(e,t){let n=t.layerDefinition?.name??t.name,r=t.title||t.layerDefinition?.title;if(n){if(this.sublayerTitleMode===`item-title`)return this.url?j(this.url,n):n;let e=n;if(!e&&this.url){let t=M(this.url);t!=null&&(e=t.title)}if(!e)return;let t=this.portalItem?.title;return this.sublayerTitleMode===`item-title-and-service-name`&&t&&t!==e&&(e=t+` - `+e),N(e)}if(this.sublayerTitleMode===`item-title`&&r)return r}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){t=t.layerDefinition||t;let n=t.typeIdField;if(n&&t.fields){n=n.toLowerCase();let e=t.fields.find(e=>e.name.toLowerCase()===n);e&&(n=e.name)}return n}readTypes(e,t){t=t.layerDefinition||t,e=t.types;let n=t.editFieldsInfo,r=n?.creatorField,i=n?.editorField;return e?.map(e=>(e=V.fromJSON(e),this._fixTemplates(e.templates,r),this._fixTemplates(e.templates,i),e))}readVisible(e,t){if(t.layerDefinition?.defaultVisibility!=null)return!!t.layerDefinition.defaultVisibility;if(t.visibility!=null)return!!t.visibility}async addAttachment(e,t,n){let r=await we(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,n,r){let i=await Te(this,e,t,n,Y,r);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Ee(this,e,t)}async uploadAssets(e,t){return De(this,e,t)}createFieldConfigurations(){return We(this)}createPopupTemplate(e){return it(this,e)}async createGraphicsSource(n){let r={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:n});let{default:t}=await se(import(`./graphics/sources/FeatureLayerSource.js`),n),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});return e(r,ee(ce(n,()=>i.cancelLoad())??te()),!1),await i.load({signal:n}),i}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}createQuery(){let e=Oe(this);e.dynamicDataSource=this.dynamicDataSource;let t=this.subtypeCode==null?null:`${this.subtypeField} = ${this.subtypeCode}`;return e.where=le(this.definitionExpression,t)||`1=1`,e}async deleteAttachments(e,t,n){let r=await ke(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return Ae(this,e,Y)}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 je(this.types,this.typeIdField,e)}getFieldAlias(e){let t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return Me(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return Ne(this,e,t,Y)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(G.from(e)??n.createQuery(),t),i=this.graphicOrigin;if(r?.features)for(let e of r.features)e.layer=e.sourceLayer=n,e.origin=i;return r}async queryObjectIds(e,t){return await Pe(this,e,t,Y)}async queryFeatureCount(e,t){return Fe(this,e,t,Y)}async queryExtent(e,t){return Ie(this,e,t,Y)}async queryRelatedFeatures(e,t){return Le(this,e,t,Y)}async queryRelatedFeaturesCount(e,t){return Re(this,e,t,Y)}async queryPivot(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryPivot||!r?.operations?.supportsQueryPivot)throw new s(Y,`Layer source does not support queryPivot capability`);let i=await import(`../rest/support/PivotQuery.js`),a=await n.queryPivot(i.default.from(e),t),o=this.graphicOrigin;if(a?.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryTopFeatures(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopFeatures||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopFeatures capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`),a=await n.queryTopFeatures(i.default.from(e),t),o=this.graphicOrigin;if(a?.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryAttributeBins(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryAttributeBins)throw new s(Y,`Layer source does not support queryAttributeBins capability`);ze(e,r,Y);let i=await import(`../rest/support/AttributeBinsQuery.js`),a=await n.queryAttributeBins(i.default.from(e),t),o=this.graphicOrigin;if(a.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryTopObjectIds(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopObjectIds||!r?.query.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopObjectIds capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return(await n.queryTopObjectIds(i.default.from(e),t)).filter(rt)}async queryTopFeaturesExtent(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopExtents||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopExtents capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return n.queryTopExtents(i.default.from(e),t)}async queryTopFeatureCount(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopCount||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryFeatureCount capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return n.queryTopCount(i.default.from(e),t)}read(e,t){let n=e.featureCollection;if((n||e.type===`Feature Collection`)&&(this.resourceInfo=e),n){let{layers:e,showLegend:r}=n;e?.length===1&&(super.read(e[0],t),r!=null&&super.read({showLegend:r},t))}super.read(e,t),X(this.source)&&t?.origin===`service`&&([`objectIdField`,`fields`,`timeInfo`,`dateFieldsTimeZone`,`uniqueIdFields`].forEach(e=>{this.revertToOrigin(e,`service`)}),this.spatialReference||this.revertToOrigin(`spatialReference`,`service`))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};let{origin:n,layerContainerType:r}=t;if(this.dynamicDataSource)return K(t,this,`a dynamic data source cannot be written to web scenes, web maps and feature service items`),null;if(this.isTable){if((n===`web-map`||n===`web-scene`)&&r!==`tables`)return K(t,this,`a table source can only be written to tables`),null;if(this._hasMemorySource())return K(t,this,`an in-memory table source cannot be written to web scenes and web maps`),null}else if(this.loaded&&(n===`web-map`||n===`web-scene`)&&r===`tables`)return K(t,this,`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(Y,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return this.loaded?this.source?.type===`memory`||Xe(this,e):!1}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,n){let r=e.layerDefinition?.capabilities;if(r||(r=e.capabilities,t&&n?.origin===`web-map`&&!this._hasMemorySource()&&r))return this._hasEditingCapability(r)}_hasEditingCapability(e){return e.toLowerCase().split(`,`).map(e=>e.trim()).includes(`editing`)}_writeEditingEnabled(e,t,n,r){if(!e){let e=this.capabilities?.operations?.supportsSync?`Query,Sync`:`Query`;l(`layerDefinition.capabilities`,e,t),n&&!r?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return i(this.url??``,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e}).then(e=>{let 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(),H(this.renderer,this.fieldsIndex),Ke(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&this.geometryType===`mesh`&&(this.capabilities.query.supportsReturnMesh=!0),Qe(this,{origin:`service`})}canReload(){return super.canReload()&&!this._hasMemorySource()}async reloadFromService(e){let t=this.source;await t.reload({signal:e}),await this.initLayerProperties(t)}async hasDataChanged(){return Be(this)}async fetchPublishingStatus(){let e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():`unavailable`}_verifyFields(){let e=this.parsedUrl?.path??`undefined`;this.objectIdField||console.log(`FeatureLayer: 'objectIdField' property is not defined (url: `+e+`)`),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(e=>e.type===`geometry`)||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=>{let n=e.prototype?.attributes;n&&t&&delete n[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[...e.layers||[],...e.tables||[]].find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};n([u({clonable:!1,readOnly:!0})],$.prototype,`_titleCreator`,null),n([u(P)],$.prototype,`attributeTableTemplate`,void 0),n([q(`service`,`capabilities`)],$.prototype,`readCapabilities`,null),n([u({json:{origins:{"web-scene":{write:!1}},write:!0}})],$.prototype,`charts`,void 0),n([u({readOnly:!0})],$.prototype,`createQueryVersion`,null),n([u({json:{read:{source:`layerDefinition.copyrightText`}}})],$.prototype,`copyright`,void 0),n([u({json:{read:{source:`layerDefinition.displayField`}}})],$.prototype,`displayField`,void 0),n([u({types:at,readOnly:!0})],$.prototype,`defaultSymbol`,void 0),n([u({types:tt})],$.prototype,`dynamicDataSource`,void 0),n([u({type:Boolean})],$.prototype,`editingEnabled`,null),n([q([`portal-item`,`web-scene`],`editingEnabled`,[`layerDefinition.capabilities`])],$.prototype,`readEditingEnabled`,null),n([q(`web-map`,`editingEnabled`,[`capabilities`,`layerDefinition.capabilities`])],$.prototype,`readEditingEnabledFromWebMap`,null),n([J([`portal-item`,`web-scene`],`editingEnabled`,{"layerDefinition.capabilities":{type:String}})],$.prototype,`writeEditingEnabled`,null),n([J(`web-map`,`editingEnabled`,{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],$.prototype,`writeEditingEnabledToWebMap`,null),n([u({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),n([u({clonable:!1,readOnly:!0})],$.prototype,`featureTitleFields`,null),n([u({type:[Ve],json:{name:`layerDefinition.fieldConfigurations`,write:{overridePolicy(e,t,n){return{enabled:!n?.writeLayerSchema,ignoreOrigin:this.originIdOf(t)===1}}}}})],$.prototype,`fieldConfigurations`,null),n([u({...Z.fields,json:{read:{source:`layerDefinition.fields`},origins:{service:{name:`fields`},"web-map":{write:{target:`layerDefinition.fields`,overridePolicy:Q}}}}})],$.prototype,`fields`,void 0),n([u(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),n([u({type:de,json:{name:`formInfo`,write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,`formTemplate`,void 0),n([u({json:{read:{source:`layerDefinition.extent`}}})],$.prototype,`fullExtent`,void 0),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.geometryType`,overridePolicy:Q,writer(e,t,n){let r=e?z.toJSON(e):null;r&&l(n,r,t)}}}},read:{source:`layerDefinition.geometryType`,reader:z.read}}})],$.prototype,`geometryType`,void 0),n([u({readOnly:!0,clonable:!1})],$.prototype,`graphicOrigin`,void 0),n([u({json:{read:{source:`layerDefinition.hasM`}}})],$.prototype,`hasM`,void 0),n([u({json:{read:{source:`layerDefinition.hasZ`}}})],$.prototype,`hasZ`,void 0),n([u(F)],$.prototype,`id`,void 0),n([u({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],$.prototype,`infoFor3D`,void 0),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.type`}}}}})],$.prototype,`isTable`,void 0),n([q(`service`,`isTable`,[`type`,`geometryType`]),q(`isTable`,[`layerDefinition.type`,`layerDefinition.geometryType`])],$.prototype,`readIsTable`,null),n([J(`web-map`,`isTable`)],$.prototype,`writeIsTable`,null),n([u(I)],$.prototype,`labelsVisible`,void 0),n([u({type:[qe],json:{origins:{service:{name:`drawingInfo.labelingInfo`,read:U,write:!1}},name:`layerDefinition.drawingInfo.labelingInfo`,read:U,write:{layerContainerTypes:d}}})],$.prototype,`labelingInfo`,void 0),n([u({type:W,json:{name:`layerDefinition.drawingInfo.symbolLayerDrawing`,write:!0,origins:{"web-scene":{write:!1}}}})],$.prototype,`symbolLayerDrawing`,void 0),n([q([`portal-item`,`web-map`],`symbolLayerDrawing`,[`layerDefinition.drawingInfo.renderer`,`layerDefinition.drawingInfo.symbolLayerDrawing`])],$.prototype,`readSymbolLayerDrawing`,null),n([u((()=>{let e=c(L);return e.json.origins[`portal-item`]={write:{target:`layerDefinition.drawingInfo.transparency`,writer(e,t,n){l(n,ot(e),t)}}},e})())],$.prototype,`opacity`,void 0),n([u(R)],$.prototype,`legendEnabled`,void 0),n([u({type:[`show`,`hide`],json:(()=>{let e=c(ge.json);return e.origins[`portal-item`]={read:!1,write:!1},e})()})],$.prototype,`listMode`,void 0),n([q(`globalIdField`,[`layerDefinition.globalIdField`,`layerDefinition.fields`])],$.prototype,`readGlobalIdField`,null),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.objectIdField`,overridePolicy:Q}}}}})],$.prototype,`objectIdField`,void 0),n([q(`objectIdField`,[`layerDefinition.objectIdField`,`layerDefinition.fields`])],$.prototype,`readObjectIdField`,null),n([u({type:[`ArcGISFeatureLayer`],json:{write:{target:`layerType`,ignoreOrigin:!0,layerContainerTypes:d}}})],$.prototype,`operationalLayerType`,void 0),n([u(Z.outFields)],$.prototype,`outFields`,void 0),n([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],$.prototype,`path`,void 0),n([u(_e)],$.prototype,`popupEnabled`,void 0),n([u({type:r,json:{name:`popupInfo`,write:!0}})],$.prototype,`popupTemplate`,void 0),n([J(`popupTemplate`)],$.prototype,`writePopupTemplate`,null),n([u({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),n([u({types:et,json:{origins:{service:{write:{target:`drawingInfo.renderer`,enabled:!1}},"web-scene":{types:$e,name:`layerDefinition.drawingInfo.renderer`,write:{layerContainerTypes:d,overridePolicy(e,t,n){return{ignoreOrigin:n?.writeLayerSchema,layerContainerTypes:d}}}}},write:{target:`layerDefinition.drawingInfo.renderer`,overridePolicy(e,t,n){return{ignoreOrigin:n?.writeLayerSchema,layerContainerTypes:d}}}}})],$.prototype,`renderer`,null),n([q(`service`,`renderer`,[`drawingInfo.renderer`,`defaultSymbol`]),q(`renderer`,[`layerDefinition.drawingInfo.renderer`,`layerDefinition.defaultSymbol`])],$.prototype,`readRenderer`,null),n([u()],$.prototype,`resourceInfo`,void 0),n([u((()=>{let e=c(ve);return e.json.origins[`portal-item`]={read:!1,write:!1},e})())],$.prototype,`screenSizePerspectiveEnabled`,void 0),n([u({clonable:!1})],$.prototype,`source`,null),n([q(`portal-item`,`source`,[`featureSet`]),q(`web-map`,`source`,[`featureSet`])],$.prototype,`readSource`,null),n([u({json:{read:{source:`layerDefinition.extent.spatialReference`}}})],$.prototype,`spatialReference`,void 0),n([u({type:Number})],$.prototype,`subtypeCode`,void 0),n([u({readOnly:!1})],$.prototype,`subtypeField`,void 0),n([u({readOnly:!1})],$.prototype,`subtypes`,void 0),n([u({type:[B]})],$.prototype,`templates`,void 0),n([q(`templates`,[`editFieldsInfo`,`creatorField`,`editorField`,`templates`])],$.prototype,`readTemplates`,null),n([u()],$.prototype,`title`,void 0),n([q(`service`,`title`,[`name`]),q(`portal-item`,`title`,[`layerDefinition.title`,`layerDefinition.name`,`title`])],$.prototype,`readTitle`,null),n([q(`web-map`,`title`,[`layerDefinition.name`,`title`])],$.prototype,`readTitleFromWebMap`,null),n([u({type:String})],$.prototype,`sublayerTitleMode`,void 0),n([u({json:{read:!1}})],$.prototype,`type`,void 0),n([u({type:String})],$.prototype,`typeIdField`,void 0),n([q(`service`,`typeIdField`),q(`typeIdField`,[`layerDefinition.typeIdField`])],$.prototype,`readTypeIdField`,null),n([u({type:[V]})],$.prototype,`types`,void 0),n([q(`service`,`types`,[`types`]),q(`types`,[`layerDefinition.types`])],$.prototype,`readTypes`,null),n([u({type:Boolean,json:{origins:{"portal-item":{write:{target:`layerDefinition.defaultVisibility`,layerContainerTypes:d}}}}})],$.prototype,`visible`,void 0),n([q(`portal-item`,`visible`,[`visibility`,`layerDefinition.defaultVisibility`])],$.prototype,`readVisible`,null),$=n([ue(`esri.layers.FeatureLayer`)],$);export{$ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{MultiOriginJSONSupportMixin as n}from"../core/MultiOriginJSONSupport.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureClass as a}from"../core/accessorSupport/ensureType.js";import o from"../geometry/SpatialReference.js";import{getInfo as s}from"../geometry/support/spatialReferenceUtils.js";import c from"./Layer.js";import{BlendLayer as l}from"./mixins/BlendLayer.js";import{RasterJobHandlerMixin as u}from"./mixins/RasterJobHandlerMixin.js";import{ScaleRangeLayer as d}from"./mixins/ScaleRangeLayer.js";import f from"./raster/datasets/GeospatialPDFRaster.js";import{clip as p}from"./raster/functions/clipUtils.js";import m from"./support/PortalItemData.js";import h from"./support/TileInfo.js";let g=class extends l(d(u(n(c)))){constructor(e){super(e),this._frame=null,this._objectURL=null,this.clippedToNeatline=!1,this.data=null,this.raster=null,this.serviceRasterInfo=null,this.spatialReference=null,this.type=`geospatial-pdf`}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy(),this._objectURL&&=(URL.revokeObjectURL(this._objectURL),null)}get fullExtent(){return this.serviceRasterInfo?.extent}async fetchImageBitmapTile(){throw new t(`geospatial-pdf-layer:fetch-image-bitmap-tile`,`GeospatialPDFLayer does not expose pre-rendered image tile URLs.`)}async fetchPixels(e,t,n,r={}){return _(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(n),r)}async fetchTile(e,n,r,i={}){if(_(this),i.requestAsImageElement)throw new t(`geospatial-pdf-layer:fetch-tile`,`GeospatialPDFLayer does not support requestAsImageElement.`);await this._initJobHandler();let a=await this.raster.fetchTile(e,n,r,i);return
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{MultiOriginJSONSupportMixin as n}from"../core/MultiOriginJSONSupport.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureClass as a}from"../core/accessorSupport/ensureType.js";import o from"../geometry/SpatialReference.js";import{getInfo as s}from"../geometry/support/spatialReferenceUtils.js";import c from"./Layer.js";import{BlendLayer as l}from"./mixins/BlendLayer.js";import{RasterJobHandlerMixin as u}from"./mixins/RasterJobHandlerMixin.js";import{ScaleRangeLayer as d}from"./mixins/ScaleRangeLayer.js";import f from"./raster/datasets/GeospatialPDFRaster.js";import{clip as p}from"./raster/functions/clipUtils.js";import m from"./support/PortalItemData.js";import h from"./support/TileInfo.js";let g=class extends l(d(u(n(c)))){constructor(e){super(e),this._frame=null,this._objectURL=null,this.clippedToNeatline=!1,this.data=null,this.raster=null,this.serviceRasterInfo=null,this.spatialReference=null,this.type=`geospatial-pdf`}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy(),this._objectURL&&=(URL.revokeObjectURL(this._objectURL),null)}get fullExtent(){return this.serviceRasterInfo?.extent}async fetchImageBitmapTile(){throw new t(`geospatial-pdf-layer:fetch-image-bitmap-tile`,`GeospatialPDFLayer does not expose pre-rendered image tile URLs.`)}async fetchPixels(e,t,n,r={}){return _(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(n),r)}async fetchTile(e,n,r,i={}){if(_(this),i.requestAsImageElement)throw new t(`geospatial-pdf-layer:fetch-tile`,`GeospatialPDFLayer does not support requestAsImageElement.`);await this._initJobHandler();let a=await this.raster.fetchTile(e,n,r,i),o=this.clippedToNeatline?this._frame?.sourceNeatlinePolygon:this._frame?.sourceMediaBoxPolygon;return o&&a.pixelBlock&&this._frame&&a.srcExtent&&(a.pixelBlock=await p(a.pixelBlock,a.srcExtent,o)),a}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,n=!1){if(!this.loaded||t==null)return null;if(n&&e.equals(this.spatialReference))return this.tileInfo;let r=s(e);return h.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return _(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(_(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getDataUrl(e){let{data:n}=this;if(typeof n==`string`)return n;if(n instanceof File)return this._objectURL=URL.createObjectURL(n),this._objectURL;if(n instanceof m){await n.portalItem.load({signal:e?.signal});let r=n.portalItem.url;if(!r)throw new t(`geospatial-pdf-layer:load`,`Portal item does not have a valid data URL.`);return r}throw new t(`geospatialpdf-layer:missing-data`,`A data source must be specified.`)}async _load(e){let t=await this._getDataUrl(e);await this._openRaster(t,e?.signal)}async _openRaster(e,n){let r=new f({url:e});if(await r.open({signal:n}),!r.rasterInfo)throw r.destroy(),new t(`geospatialpdf-layer:load`,`cannot load resources on `+e);let{rasterInfo:i}=r;this._set(`serviceRasterInfo`,i),this.setAtOrigin(`spatialReference`,i.spatialReference,`service`),this.setAtOrigin(`tileInfo`,i.storageInfo.tileInfo,`service`),this._frame=r.frame,this.raster=r}};e([r({clonable:!1})],g.prototype,`_compatibleFullExtent`,void 0),e([r({type:Boolean})],g.prototype,`clippedToNeatline`,void 0),e([r({cast:e=>e?typeof e==`string`||e instanceof File?e:a(m,e):null})],g.prototype,`data`,void 0),e([r({json:{read:!1}})],g.prototype,`fullExtent`,null),e([r()],g.prototype,`raster`,void 0),e([r()],g.prototype,`serviceRasterInfo`,void 0),e([r({readOnly:!0,type:o,json:{read:!1}})],g.prototype,`spatialReference`,void 0),e([r({type:h,readOnly:!0})],g.prototype,`tileInfo`,void 0),e([r({readOnly:!0,value:`geospatial-pdf`})],g.prototype,`type`,void 0),g=e([i(`esri.layers.GeospatialPDFLayer`)],g);function _(e){if(!e.raster||!e.serviceRasterInfo)throw new t(`imagery-tile`,`no raster`)}const v=g;export{v as default};
|
|
@@ -243,9 +243,10 @@ export interface MapImageLayerEvents extends RefreshableLayerEvents, LayerEvents
|
|
|
243
243
|
* <span id="dynamic-layers"></span>
|
|
244
244
|
* ## Dynamic layers
|
|
245
245
|
*
|
|
246
|
-
* Sublayers may be rendered on the fly as dynamic layers. There are
|
|
247
|
-
* [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/references/core/rest/layerSources/DynamicMapLayer/)
|
|
248
|
-
* [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/references/core/rest/layerSources/DynamicDataLayer/)
|
|
246
|
+
* Sublayers may be rendered on the fly as dynamic layers. There are three types of dynamic layers:
|
|
247
|
+
* [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/references/core/rest/layerSources/DynamicMapLayer/),
|
|
248
|
+
* [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/references/core/rest/layerSources/DynamicDataLayer/), and
|
|
249
|
+
* [DynamicWorkspaceLayer](https://developers.arcgis.com/javascript/latest/references/core/rest/layerSources/DynamicWorkspaceLayer/).
|
|
249
250
|
*
|
|
250
251
|
* [Dynamic map layers](https://developers.arcgis.com/javascript/latest/references/core/rest/layerSources/DynamicMapLayer/) allow you
|
|
251
252
|
* to override sublayers in the map service with new renderers,
|
|
@@ -260,6 +261,11 @@ export interface MapImageLayerEvents extends RefreshableLayerEvents, LayerEvents
|
|
|
260
261
|
* published and configured with the ArcGIS Server Manager.
|
|
261
262
|
* Data from tables may be joined to other tables or dynamic map layers.
|
|
262
263
|
*
|
|
264
|
+
* [Dynamic workspace layers](https://developers.arcgis.com/javascript/latest/references/core/rest/layerSources/DynamicWorkspaceLayer/) allow you
|
|
265
|
+
* to use pre-authored ArcGIS Pro layer files (`.lyrx`) stored in registered folders.
|
|
266
|
+
* These layers support advanced renderers and cartographically enriched symbols
|
|
267
|
+
* that are not supported by the map service's REST API specifications.
|
|
268
|
+
*
|
|
263
269
|
* > [!WARNING]
|
|
264
270
|
* >
|
|
265
271
|
* > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content.
|
|
@@ -77,9 +77,9 @@ export interface MapNotesLayerProperties extends LayerProperties, PortalLayerPro
|
|
|
77
77
|
* // get the layer type ("map-notes")
|
|
78
78
|
* console.log(map.layers.at(0).type);
|
|
79
79
|
* // get the title
|
|
80
|
-
* console.log(map.layers.
|
|
80
|
+
* console.log(map.layers.at(0).sublayers.at(0).sublayers.at(0).attributes.title);
|
|
81
81
|
* // update the popupTemplate
|
|
82
|
-
* map.layers.
|
|
82
|
+
* map.layers.at(0).sublayers.at(1).sublayers.at(0).popupTemplate.content = "{title} has an updated popup";
|
|
83
83
|
* });
|
|
84
84
|
* ```
|
|
85
85
|
*
|
|
@@ -17,7 +17,7 @@ import type { APIKeyMixin, APIKeyMixinProperties } from "./mixins/APIKeyMixin.js
|
|
|
17
17
|
import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
|
|
18
18
|
import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
|
|
19
19
|
import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mixins/DisplayFilteredLayer.js";
|
|
20
|
-
import type {
|
|
20
|
+
import type { EditBusLayerEvents, EditBusLayer } from "./mixins/EditBusLayer.js";
|
|
21
21
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
22
22
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
23
23
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|