esri-gl 1.0.6 → 2.0.0
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/README.md +52 -2
- package/dist/{index-DczUYC4z.d.ts → index-Doq93o-G.d.ts} +252 -75
- package/dist/{IdentifyImage-DmyKcbAv.js → index-DsY1_0df.js} +825 -678
- package/dist/index-DsY1_0df.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +7181 -1017
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +5 -1
- package/dist/react-map-gl.d.ts +42 -13
- package/dist/react-map-gl.js +292 -304
- package/dist/react-map-gl.js.map +1 -1
- package/dist/react.d.ts +23 -28
- package/dist/react.js +202 -178
- package/dist/react.js.map +1 -1
- package/dist/{useFeatureService-E9PiUOLP.js → useFeatureService-BRY6PHUs.js} +50 -12
- package/dist/useFeatureService-BRY6PHUs.js.map +1 -0
- package/dist/{useFeatureService-QUqwJcet.d.ts → useFeatureService-CG70gjQy.d.ts} +29 -41
- package/package.json +8 -5
- package/dist/IdentifyImage-DmyKcbAv.js.map +0 -1
- package/dist/useFeatureService-E9PiUOLP.js.map +0 -1
package/dist/react.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export { u as useDynamicMapService, a as useEsriService, b as useFeatureService, c as useImageService, d as useTiledMapService, e as useVectorTileService } from './useFeatureService-
|
|
1
|
+
export { u as useDynamicMapService, a as useEsriService, b as useFeatureService, c as useImageService, d as useTiledMapService, e as useVectorTileService } from './useFeatureService-BRY6PHUs.js';
|
|
2
2
|
import React, { useState, useRef, useCallback, useEffect, useContext, createContext } from 'react';
|
|
3
|
-
import { V as VectorBasemapStyle, I as IdentifyFeatures, b as IdentifyImage, Q as Query, a as Find } from './
|
|
4
|
-
export { D as DynamicMapService, F as FeatureService, c as ImageService, S as Service, T as Task, d as TiledMapService, e as VectorTileService, f as cleanTrailingSlash, g as
|
|
3
|
+
import { V as VectorBasemapStyle, I as IdentifyFeatures, b as IdentifyImage, Q as Query, a as Find, k as serviceFromPortalItem } from './index-DsY1_0df.js';
|
|
4
|
+
export { D as DynamicMapService, F as FeatureService, c as ImageService, S as Service, T as Task, d as TiledMapService, e as VectorTileService, f as cleanTrailingSlash, g as esriRequest, h as find, i as getServiceDetails, j as identifyImage, q as query, r as resolveAuthentication, s as searchPortalItems, l as servicesFromWebMap, u as updateAttribution } from './index-DsY1_0df.js';
|
|
5
|
+
export { BasemapStyleSession } from '@esri/arcgis-rest-basemap-sessions';
|
|
6
|
+
export { ApiKeyManager, ApplicationCredentialsManager, ArcGISAuthError, ArcGISIdentityManager, ArcGISRequestError } from '@esri/arcgis-rest-request';
|
|
7
|
+
export { SearchQueryBuilder } from '@esri/arcgis-rest-portal';
|
|
8
|
+
import '@esri/arcgis-rest-feature-service';
|
|
5
9
|
import '@mapbox/tilebelt';
|
|
6
10
|
import 'arcgis-pbf-parser';
|
|
7
11
|
|
|
@@ -81,41 +85,61 @@ function useVectorBasemapStyle(params = {}) {
|
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
/**
|
|
84
|
-
*
|
|
88
|
+
* Shared state + wrapper used by task/editing hooks. Collapses the
|
|
89
|
+
* repetitive `setLoading(true); try { ... } catch { setError(...) }
|
|
90
|
+
* finally { setLoading(false) }` dance into one call site.
|
|
85
91
|
*/
|
|
86
|
-
function
|
|
87
|
-
url,
|
|
88
|
-
tolerance,
|
|
89
|
-
returnGeometry
|
|
90
|
-
}) {
|
|
92
|
+
function useAsyncOperation() {
|
|
91
93
|
const [loading, setLoading] = useState(false);
|
|
92
94
|
const [error, setError] = useState(null);
|
|
93
|
-
const
|
|
95
|
+
const run = useCallback(async (fn, failureMessage = 'Operation failed') => {
|
|
94
96
|
setLoading(true);
|
|
95
97
|
setError(null);
|
|
96
98
|
try {
|
|
97
|
-
|
|
98
|
-
map,
|
|
99
|
-
...rest
|
|
100
|
-
} = additionalOptions ?? {};
|
|
101
|
-
const identifyTask = new IdentifyFeatures({
|
|
102
|
-
url,
|
|
103
|
-
tolerance,
|
|
104
|
-
returnGeometry,
|
|
105
|
-
...rest
|
|
106
|
-
});
|
|
107
|
-
identifyTask.at(point);
|
|
108
|
-
if (map) identifyTask.on(map);
|
|
109
|
-
const results = await identifyTask.run();
|
|
110
|
-
return results;
|
|
99
|
+
return await fn();
|
|
111
100
|
} catch (err) {
|
|
112
|
-
const errorObj = err instanceof Error ? err : new Error(
|
|
101
|
+
const errorObj = err instanceof Error ? err : new Error(failureMessage);
|
|
113
102
|
setError(errorObj);
|
|
114
103
|
throw errorObj;
|
|
115
104
|
} finally {
|
|
116
105
|
setLoading(false);
|
|
117
106
|
}
|
|
118
|
-
}, [
|
|
107
|
+
}, []);
|
|
108
|
+
return {
|
|
109
|
+
loading,
|
|
110
|
+
error,
|
|
111
|
+
run
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Hook for using IdentifyFeatures task
|
|
117
|
+
*/
|
|
118
|
+
function useIdentifyFeatures({
|
|
119
|
+
url,
|
|
120
|
+
tolerance,
|
|
121
|
+
returnGeometry
|
|
122
|
+
}) {
|
|
123
|
+
const {
|
|
124
|
+
loading,
|
|
125
|
+
error,
|
|
126
|
+
run
|
|
127
|
+
} = useAsyncOperation();
|
|
128
|
+
const identify = useCallback((point, additionalOptions) => run(async () => {
|
|
129
|
+
const {
|
|
130
|
+
map,
|
|
131
|
+
...rest
|
|
132
|
+
} = additionalOptions ?? {};
|
|
133
|
+
const identifyTask = new IdentifyFeatures({
|
|
134
|
+
url,
|
|
135
|
+
tolerance,
|
|
136
|
+
returnGeometry,
|
|
137
|
+
...rest
|
|
138
|
+
});
|
|
139
|
+
identifyTask.at(point);
|
|
140
|
+
if (map) identifyTask.on(map);
|
|
141
|
+
return identifyTask.run();
|
|
142
|
+
}, 'Identify failed'), [url, tolerance, returnGeometry, run]);
|
|
119
143
|
return {
|
|
120
144
|
identify,
|
|
121
145
|
loading,
|
|
@@ -127,32 +151,24 @@ function useIdentifyFeatures({
|
|
|
127
151
|
* Hook for using IdentifyImage task
|
|
128
152
|
*/
|
|
129
153
|
function useIdentifyImage(options) {
|
|
130
|
-
const
|
|
131
|
-
|
|
154
|
+
const {
|
|
155
|
+
loading,
|
|
156
|
+
error,
|
|
157
|
+
run
|
|
158
|
+
} = useAsyncOperation();
|
|
132
159
|
const {
|
|
133
160
|
url,
|
|
134
161
|
token,
|
|
135
162
|
returnGeometry
|
|
136
163
|
} = options;
|
|
137
|
-
const identifyImage = useCallback(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
identifyTask.at(point);
|
|
146
|
-
const results = await identifyTask.run();
|
|
147
|
-
return results;
|
|
148
|
-
} catch (err) {
|
|
149
|
-
const errorObj = err instanceof Error ? err : new Error('Identify image failed');
|
|
150
|
-
setError(errorObj);
|
|
151
|
-
throw errorObj;
|
|
152
|
-
} finally {
|
|
153
|
-
setLoading(false);
|
|
154
|
-
}
|
|
155
|
-
}, [url, token, returnGeometry]);
|
|
164
|
+
const identifyImage = useCallback((point, additionalOptions) => run(async () => {
|
|
165
|
+
const identifyTask = new IdentifyImage({
|
|
166
|
+
...options,
|
|
167
|
+
...additionalOptions
|
|
168
|
+
});
|
|
169
|
+
identifyTask.at(point);
|
|
170
|
+
return identifyTask.run();
|
|
171
|
+
}, 'Identify image failed'), [url, token, returnGeometry, run]);
|
|
156
172
|
return {
|
|
157
173
|
identifyImage,
|
|
158
174
|
loading,
|
|
@@ -164,56 +180,37 @@ function useIdentifyImage(options) {
|
|
|
164
180
|
* Hook for using Query task
|
|
165
181
|
*/
|
|
166
182
|
function useQuery(options) {
|
|
167
|
-
const
|
|
168
|
-
|
|
183
|
+
const {
|
|
184
|
+
loading,
|
|
185
|
+
error,
|
|
186
|
+
run
|
|
187
|
+
} = useAsyncOperation();
|
|
169
188
|
const {
|
|
170
189
|
url,
|
|
171
190
|
where,
|
|
172
191
|
outFields,
|
|
173
192
|
returnGeometry
|
|
174
193
|
} = options;
|
|
175
|
-
const query = useCallback(async
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
setError(null);
|
|
196
|
-
try {
|
|
197
|
-
const {
|
|
198
|
-
maxPages,
|
|
199
|
-
...rest
|
|
200
|
-
} = additionalOptions || {};
|
|
201
|
-
const queryTask = new Query({
|
|
202
|
-
...options,
|
|
203
|
-
...rest
|
|
204
|
-
});
|
|
205
|
-
const results = await queryTask.runAll({
|
|
206
|
-
maxPages
|
|
207
|
-
});
|
|
208
|
-
return results;
|
|
209
|
-
} catch (err) {
|
|
210
|
-
const errorObj = err instanceof Error ? err : new Error('Query failed');
|
|
211
|
-
setError(errorObj);
|
|
212
|
-
throw errorObj;
|
|
213
|
-
} finally {
|
|
214
|
-
setLoading(false);
|
|
215
|
-
}
|
|
216
|
-
}, [url, where, outFields, returnGeometry]);
|
|
194
|
+
const query = useCallback(additionalOptions => run(async () => {
|
|
195
|
+
const queryTask = new Query({
|
|
196
|
+
...options,
|
|
197
|
+
...additionalOptions
|
|
198
|
+
});
|
|
199
|
+
return queryTask.run();
|
|
200
|
+
}, 'Query failed'), [url, where, outFields, returnGeometry, run]);
|
|
201
|
+
const queryAll = useCallback(additionalOptions => run(async () => {
|
|
202
|
+
const {
|
|
203
|
+
maxPages,
|
|
204
|
+
...rest
|
|
205
|
+
} = additionalOptions || {};
|
|
206
|
+
const queryTask = new Query({
|
|
207
|
+
...options,
|
|
208
|
+
...rest
|
|
209
|
+
});
|
|
210
|
+
return queryTask.runAll({
|
|
211
|
+
maxPages
|
|
212
|
+
});
|
|
213
|
+
}, 'Query failed'), [url, where, outFields, returnGeometry, run]);
|
|
217
214
|
return {
|
|
218
215
|
query,
|
|
219
216
|
queryAll,
|
|
@@ -231,29 +228,21 @@ function useFind({
|
|
|
231
228
|
layers,
|
|
232
229
|
searchFields
|
|
233
230
|
}) {
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
} catch (err) {
|
|
250
|
-
const errorObj = err instanceof Error ? err : new Error('Find failed');
|
|
251
|
-
setError(errorObj);
|
|
252
|
-
throw errorObj;
|
|
253
|
-
} finally {
|
|
254
|
-
setLoading(false);
|
|
255
|
-
}
|
|
256
|
-
}, [url, searchText, layers, searchFields]);
|
|
231
|
+
const {
|
|
232
|
+
loading,
|
|
233
|
+
error,
|
|
234
|
+
run
|
|
235
|
+
} = useAsyncOperation();
|
|
236
|
+
const find = useCallback(additionalOptions => run(async () => {
|
|
237
|
+
const findTask = new Find({
|
|
238
|
+
url,
|
|
239
|
+
searchText,
|
|
240
|
+
layers,
|
|
241
|
+
searchFields,
|
|
242
|
+
...additionalOptions
|
|
243
|
+
});
|
|
244
|
+
return findTask.run();
|
|
245
|
+
}, 'Find failed'), [url, searchText, layers, searchFields, run]);
|
|
257
246
|
return {
|
|
258
247
|
find,
|
|
259
248
|
loading,
|
|
@@ -265,81 +254,116 @@ function useFind({
|
|
|
265
254
|
* Hook for feature editing operations on a FeatureService
|
|
266
255
|
*/
|
|
267
256
|
function useFeatureEditing(service) {
|
|
268
|
-
const
|
|
269
|
-
|
|
257
|
+
const {
|
|
258
|
+
loading,
|
|
259
|
+
error,
|
|
260
|
+
run
|
|
261
|
+
} = useAsyncOperation();
|
|
270
262
|
const [lastResult, setLastResult] = useState(null);
|
|
271
|
-
const
|
|
263
|
+
const runEdit = useCallback(async (op, failureMessage) => {
|
|
272
264
|
if (!service) throw new Error('FeatureService not available');
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
265
|
+
const result = await run(op, failureMessage);
|
|
266
|
+
setLastResult(result);
|
|
267
|
+
return result;
|
|
268
|
+
}, [service, run]);
|
|
269
|
+
const addFeatures = useCallback((features, options) => runEdit(() => service.addFeatures(features, options), 'Add features failed'), [service, runEdit]);
|
|
270
|
+
const updateFeatures = useCallback((features, options) => runEdit(() => service.updateFeatures(features, options), 'Update features failed'), [service, runEdit]);
|
|
271
|
+
const deleteFeatures = useCallback(params => runEdit(() => service.deleteFeatures(params), 'Delete features failed'), [service, runEdit]);
|
|
272
|
+
const applyEdits = useCallback((edits, options) => runEdit(() => service.applyEdits(edits, options), 'Apply edits failed'), [service, runEdit]);
|
|
273
|
+
return {
|
|
274
|
+
addFeatures,
|
|
275
|
+
updateFeatures,
|
|
276
|
+
deleteFeatures,
|
|
277
|
+
applyEdits,
|
|
278
|
+
loading,
|
|
279
|
+
error,
|
|
280
|
+
lastResult
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Resolve an ArcGIS portal item id to an esri-gl service (adding its source to
|
|
286
|
+
* the map) via {@link serviceFromPortalItem}. Re-resolves when `itemId` / `map`
|
|
287
|
+
* change and cleans up the previous service.
|
|
288
|
+
*/
|
|
289
|
+
function usePortalItem({
|
|
290
|
+
sourceId,
|
|
291
|
+
map,
|
|
292
|
+
itemId,
|
|
293
|
+
options
|
|
294
|
+
}) {
|
|
295
|
+
const [service, setService] = useState(null);
|
|
296
|
+
const [kind, setKind] = useState(null);
|
|
297
|
+
const [url, setUrl] = useState(null);
|
|
298
|
+
const [title, setTitle] = useState(null);
|
|
299
|
+
const [loading, setLoading] = useState(false);
|
|
300
|
+
const [error, setError] = useState(null);
|
|
301
|
+
const [reloadKey, setReloadKey] = useState(0);
|
|
302
|
+
const serviceRef = useRef(null);
|
|
303
|
+
const optionsRef = useRef(options);
|
|
304
|
+
optionsRef.current = options;
|
|
305
|
+
const cleanup = useCallback(() => {
|
|
306
|
+
if (serviceRef.current) {
|
|
307
|
+
try {
|
|
308
|
+
serviceRef.current.remove();
|
|
309
|
+
} catch (err) {
|
|
310
|
+
if (process.env?.NODE_ENV !== 'test') {
|
|
311
|
+
console.warn('usePortalItem: error removing service:', err);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
serviceRef.current = null;
|
|
285
315
|
}
|
|
286
|
-
}, [
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const errorObj = err instanceof Error ? err : new Error('Update features failed');
|
|
297
|
-
setError(errorObj);
|
|
298
|
-
throw errorObj;
|
|
299
|
-
} finally {
|
|
316
|
+
}, []);
|
|
317
|
+
const reload = useCallback(() => setReloadKey(key => key + 1), []);
|
|
318
|
+
useEffect(() => {
|
|
319
|
+
if (!map || !itemId) {
|
|
320
|
+
cleanup();
|
|
321
|
+
setService(null);
|
|
322
|
+
setKind(null);
|
|
323
|
+
setUrl(null);
|
|
324
|
+
setTitle(null);
|
|
325
|
+
// Clear any in-flight loading state from a previous itemId/map.
|
|
300
326
|
setLoading(false);
|
|
327
|
+
return;
|
|
301
328
|
}
|
|
302
|
-
|
|
303
|
-
const deleteFeatures = useCallback(async params => {
|
|
304
|
-
if (!service) throw new Error('FeatureService not available');
|
|
329
|
+
let cancelled = false;
|
|
305
330
|
setLoading(true);
|
|
306
331
|
setError(null);
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
332
|
+
cleanup();
|
|
333
|
+
serviceFromPortalItem(sourceId, map, itemId, optionsRef.current).then(result => {
|
|
334
|
+
if (cancelled) {
|
|
335
|
+
try {
|
|
336
|
+
result.service.remove();
|
|
337
|
+
} catch {
|
|
338
|
+
/* ignore */
|
|
339
|
+
}
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
serviceRef.current = result.service;
|
|
343
|
+
setService(result.service);
|
|
344
|
+
setKind(result.kind);
|
|
345
|
+
setUrl(result.url);
|
|
346
|
+
setTitle(result.title ?? null);
|
|
316
347
|
setLoading(false);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
if (!service) throw new Error('FeatureService not available');
|
|
321
|
-
setLoading(true);
|
|
322
|
-
setError(null);
|
|
323
|
-
try {
|
|
324
|
-
const result = await service.applyEdits(edits, options);
|
|
325
|
-
setLastResult(result);
|
|
326
|
-
return result;
|
|
327
|
-
} catch (err) {
|
|
328
|
-
const errorObj = err instanceof Error ? err : new Error('Apply edits failed');
|
|
329
|
-
setError(errorObj);
|
|
330
|
-
throw errorObj;
|
|
331
|
-
} finally {
|
|
348
|
+
}).catch(err => {
|
|
349
|
+
if (cancelled) return;
|
|
350
|
+
setError(err instanceof Error ? err : new Error('Failed to resolve portal item'));
|
|
332
351
|
setLoading(false);
|
|
333
|
-
}
|
|
334
|
-
|
|
352
|
+
});
|
|
353
|
+
return () => {
|
|
354
|
+
cancelled = true;
|
|
355
|
+
};
|
|
356
|
+
}, [map, itemId, sourceId, reloadKey, cleanup]);
|
|
357
|
+
// Remove the resolved service on unmount.
|
|
358
|
+
useEffect(() => () => cleanup(), [cleanup]);
|
|
335
359
|
return {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
360
|
+
service,
|
|
361
|
+
kind,
|
|
362
|
+
url,
|
|
363
|
+
title,
|
|
340
364
|
loading,
|
|
341
365
|
error,
|
|
342
|
-
|
|
366
|
+
reload
|
|
343
367
|
};
|
|
344
368
|
}
|
|
345
369
|
|
|
@@ -408,5 +432,5 @@ function EsriLayer({
|
|
|
408
432
|
return null;
|
|
409
433
|
}
|
|
410
434
|
|
|
411
|
-
export { EsriLayer, EsriServiceProvider, Find, IdentifyFeatures, IdentifyImage, Query, VectorBasemapStyle, useEsriMap, useFeatureEditing, useFind, useIdentifyFeatures, useIdentifyImage, useQuery, useVectorBasemapStyle };
|
|
435
|
+
export { EsriLayer, EsriServiceProvider, Find, IdentifyFeatures, IdentifyImage, Query, VectorBasemapStyle, serviceFromPortalItem, useEsriMap, useFeatureEditing, useFind, useIdentifyFeatures, useIdentifyImage, usePortalItem, useQuery, useVectorBasemapStyle };
|
|
412
436
|
//# sourceMappingURL=react.js.map
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":["../src/react/hooks/useVectorBasemapStyle.ts","../src/react/hooks/useIdentifyFeatures.ts","../src/react/hooks/useIdentifyImage.ts","../src/react/hooks/useQuery.ts","../src/react/hooks/useFind.ts","../src/react/hooks/useFeatureEditing.ts","../src/react/components/EsriServiceProvider.tsx","../src/react/components/EsriLayer.tsx"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from 'react';\nimport { VectorBasemapStyle } from '@/Services/VectorBasemapStyle';\nimport type { VectorBasemapStyleAuthOptions } from '@/Services/VectorBasemapStyle';\nimport type { UseVectorBasemapStyleOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing VectorBasemapStyle lifecycle\n * Note: VectorBasemapStyle has a different constructor signature than other services\n */\nexport function useVectorBasemapStyle(\n params: Pick<UseVectorBasemapStyleOptions, 'options'> = {}\n): UseEsriServiceResult<VectorBasemapStyle> {\n const { options } = params;\n const [service, setService] = useState<VectorBasemapStyle | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const serviceRef = useRef<VectorBasemapStyle | null>(null);\n\n const cleanupService = useCallback(() => {\n const existing = serviceRef.current;\n if (existing) {\n try {\n existing.remove();\n } catch (cleanupError) {\n console.warn('Failed to remove VectorBasemapStyle service', cleanupError);\n }\n }\n serviceRef.current = null;\n setService(null);\n }, []);\n\n const basemapEnum = options?.basemapEnum ?? 'arcgis/streets';\n const token = options?.token;\n const apiKey = options?.apiKey;\n const language = options?.language;\n const worldview = options?.worldview;\n const hasCredential = Boolean(token || apiKey);\n\n const reload = useCallback(() => {\n if (!hasCredential) {\n cleanupService();\n setLoading(false);\n setError(null);\n return;\n }\n\n setLoading(true);\n setError(null);\n\n try {\n cleanupService();\n\n const authOptions: VectorBasemapStyleAuthOptions = {};\n if (token) authOptions.token = token;\n if (apiKey) authOptions.apiKey = apiKey;\n if (language) authOptions.language = language;\n if (worldview) authOptions.worldview = worldview;\n\n const newService = new VectorBasemapStyle(basemapEnum, authOptions);\n setService(newService);\n serviceRef.current = newService;\n } catch (err) {\n setError(err instanceof Error ? err : new Error('Failed to create service'));\n } finally {\n setLoading(false);\n }\n }, [hasCredential, cleanupService, token, apiKey, language, worldview, basemapEnum]);\n\n // Initialize service when options change\n useEffect(() => {\n if (!hasCredential) {\n cleanupService();\n return;\n }\n\n reload();\n\n // Cleanup on unmount or options change\n return () => {\n cleanupService();\n };\n }, [reload, cleanupService, hasCredential]);\n\n return {\n service,\n loading,\n error,\n reload,\n };\n}\n","import { useState, useCallback } from 'react';\nimport { IdentifyFeatures } from '@/Tasks/IdentifyFeatures';\nimport type { Map } from '@/types';\nimport type { UseIdentifyFeaturesOptions } from '../types';\n\n/**\n * Hook for using IdentifyFeatures task\n */\nexport function useIdentifyFeatures({\n url,\n tolerance,\n returnGeometry,\n}: UseIdentifyFeaturesOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const identify = useCallback(\n async (\n point: { lng: number; lat: number },\n additionalOptions?: Record<string, unknown> & { map?: Map }\n ) => {\n setLoading(true);\n setError(null);\n\n try {\n const { map, ...rest } = additionalOptions ?? {};\n\n const identifyTask = new IdentifyFeatures({\n url,\n tolerance,\n returnGeometry,\n ...rest,\n });\n\n identifyTask.at(point);\n if (map) identifyTask.on(map);\n\n const results = await identifyTask.run();\n return results;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Identify failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [url, tolerance, returnGeometry]\n );\n\n return {\n identify,\n loading,\n error,\n };\n}\n","import { useState, useCallback } from 'react';\nimport { IdentifyImage } from '@/Tasks/IdentifyImage';\nimport type { UseIdentifyImageOptions } from '../types';\n\nexport interface UseIdentifyImageResult {\n identifyImage: (\n point: { lng: number; lat: number } | [number, number],\n additionalOptions?: Partial<UseIdentifyImageOptions> & Record<string, unknown>\n ) => Promise<Awaited<ReturnType<IdentifyImage['run']>>>;\n loading: boolean;\n error: Error | null;\n}\n\n/**\n * Hook for using IdentifyImage task\n */\nexport function useIdentifyImage(options: UseIdentifyImageOptions): UseIdentifyImageResult {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const { url, token, returnGeometry } = options;\n\n const identifyImage = useCallback<UseIdentifyImageResult['identifyImage']>(\n async (point, additionalOptions) => {\n setLoading(true);\n setError(null);\n\n try {\n const identifyTask = new IdentifyImage({\n ...options,\n ...additionalOptions,\n });\n\n identifyTask.at(point);\n\n const results = await identifyTask.run();\n return results;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Identify image failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [url, token, returnGeometry]\n );\n\n return {\n identifyImage,\n loading,\n error,\n };\n}\n","import { useState, useCallback } from 'react';\nimport { Query } from '@/Tasks/Query';\nimport type { UseQueryOptions } from '../types';\n\n/**\n * Hook for using Query task\n */\nexport function useQuery(options: UseQueryOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const { url, where, outFields, returnGeometry } = options;\n\n const query = useCallback(\n async (additionalOptions?: Record<string, unknown>) => {\n setLoading(true);\n setError(null);\n\n try {\n const queryTask = new Query({\n ...options,\n ...additionalOptions,\n });\n\n const results = await queryTask.run();\n return results;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Query failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [url, where, outFields, returnGeometry]\n );\n\n const queryAll = useCallback(\n async (additionalOptions?: Record<string, unknown> & { maxPages?: number }) => {\n setLoading(true);\n setError(null);\n\n try {\n const { maxPages, ...rest } = additionalOptions || {};\n const queryTask = new Query({\n ...options,\n ...rest,\n });\n\n const results = await queryTask.runAll({ maxPages });\n return results;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Query failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [url, where, outFields, returnGeometry]\n );\n\n return {\n query,\n queryAll,\n loading,\n error,\n };\n}\n","import { useState, useCallback } from 'react';\nimport { Find } from '@/Tasks/Find';\nimport type { UseFindOptions } from '../types';\n\n/**\n * Hook for using Find task\n */\nexport function useFind({ url, searchText, layers, searchFields }: UseFindOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const find = useCallback(\n async (additionalOptions?: Record<string, unknown>) => {\n setLoading(true);\n setError(null);\n\n try {\n const findTask = new Find({\n url,\n searchText,\n layers,\n searchFields,\n ...additionalOptions,\n });\n\n const results = await findTask.run();\n return results;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Find failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [url, searchText, layers, searchFields]\n );\n\n return {\n find,\n loading,\n error,\n };\n}\n","import { useState, useCallback } from 'react';\nimport type { FeatureService } from '@/Services/FeatureService';\nimport type { EditResult, ApplyEditsResult } from '@/types';\n\nexport interface UseFeatureEditingResult {\n addFeatures: (\n features: GeoJSON.Feature[],\n options?: { gdbVersion?: string }\n ) => Promise<EditResult[]>;\n updateFeatures: (\n features: GeoJSON.Feature[],\n options?: { gdbVersion?: string }\n ) => Promise<EditResult[]>;\n deleteFeatures: (params: { objectIds?: number[]; where?: string }) => Promise<EditResult[]>;\n applyEdits: (\n edits: {\n adds?: GeoJSON.Feature[];\n updates?: GeoJSON.Feature[];\n deletes?: number[];\n },\n options?: { gdbVersion?: string }\n ) => Promise<ApplyEditsResult>;\n loading: boolean;\n error: Error | null;\n lastResult: EditResult[] | ApplyEditsResult | null;\n}\n\n/**\n * Hook for feature editing operations on a FeatureService\n */\nexport function useFeatureEditing(service: FeatureService | null): UseFeatureEditingResult {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [lastResult, setLastResult] = useState<EditResult[] | ApplyEditsResult | null>(null);\n\n const addFeatures = useCallback(\n async (features: GeoJSON.Feature[], options?: { gdbVersion?: string }) => {\n if (!service) throw new Error('FeatureService not available');\n setLoading(true);\n setError(null);\n try {\n const result = await service.addFeatures(features, options);\n setLastResult(result);\n return result;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Add features failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [service]\n );\n\n const updateFeatures = useCallback(\n async (features: GeoJSON.Feature[], options?: { gdbVersion?: string }) => {\n if (!service) throw new Error('FeatureService not available');\n setLoading(true);\n setError(null);\n try {\n const result = await service.updateFeatures(features, options);\n setLastResult(result);\n return result;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Update features failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [service]\n );\n\n const deleteFeatures = useCallback(\n async (params: { objectIds?: number[]; where?: string }) => {\n if (!service) throw new Error('FeatureService not available');\n setLoading(true);\n setError(null);\n try {\n const result = await service.deleteFeatures(params);\n setLastResult(result);\n return result;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Delete features failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [service]\n );\n\n const applyEdits = useCallback(\n async (\n edits: { adds?: GeoJSON.Feature[]; updates?: GeoJSON.Feature[]; deletes?: number[] },\n options?: { gdbVersion?: string }\n ) => {\n if (!service) throw new Error('FeatureService not available');\n setLoading(true);\n setError(null);\n try {\n const result = await service.applyEdits(edits, options);\n setLastResult(result);\n return result;\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error('Apply edits failed');\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n [service]\n );\n\n return {\n addFeatures,\n updateFeatures,\n deleteFeatures,\n applyEdits,\n loading,\n error,\n lastResult,\n };\n}\n","import React, { createContext, useContext } from 'react';\nimport type { EsriServiceProviderProps } from '../types';\nimport type { Map } from '@/types';\n\ninterface EsriServiceContextValue {\n map: Map | null;\n}\n\nconst EsriServiceContext = createContext<EsriServiceContextValue>({\n map: null,\n});\n\n/**\n * Context provider for sharing map instance across Esri components\n */\nexport function EsriServiceProvider({ children, map = null }: EsriServiceProviderProps) {\n return React.createElement(EsriServiceContext.Provider, { value: { map } }, children);\n}\n\n/**\n * Hook to access the current map from EsriServiceProvider\n */\nexport function useEsriMap(): Map | null {\n const context = useContext(EsriServiceContext);\n return context.map;\n}\n","import { useEffect } from 'react';\nimport { useEsriMap } from './EsriServiceProvider';\nimport type { EsriLayerProps } from '../types';\n\n/**\n * Generic Esri layer component that adds a layer to the map\n */\nexport function EsriLayer({\n sourceId,\n layerId,\n type,\n paint = {},\n layout = {},\n beforeId,\n}: EsriLayerProps) {\n const map = useEsriMap();\n\n useEffect(() => {\n if (!map) return;\n\n // Check if layer already exists\n if (map.getLayer(layerId)) {\n return;\n }\n\n // Add layer to map\n const layerSpec = {\n id: layerId,\n type,\n source: sourceId,\n paint,\n layout,\n } as Parameters<typeof map.addLayer>[0]; // Type assertion for layer specification\n\n if (beforeId) {\n map.addLayer(layerSpec, beforeId);\n } else {\n map.addLayer(layerSpec);\n }\n\n // Cleanup function\n return () => {\n if (map.getLayer(layerId)) {\n map.removeLayer(layerId);\n }\n };\n }, [map, sourceId, layerId, type, paint, layout, beforeId]);\n\n return null;\n}\n"],"names":["useVectorBasemapStyle","params","options","service","setService","useState","loading","setLoading","error","setError","serviceRef","useRef","cleanupService","useCallback","existing","current","remove","cleanupError","console","warn","basemapEnum","token","apiKey","language","worldview","hasCredential","Boolean","reload","authOptions","newService","VectorBasemapStyle","err","Error","useEffect","useIdentifyFeatures","url","tolerance","returnGeometry","identify","point","additionalOptions","map","rest","identifyTask","IdentifyFeatures","at","on","results","run","errorObj","useIdentifyImage","identifyImage","IdentifyImage","useQuery","where","outFields","query","queryTask","Query","queryAll","maxPages","runAll","useFind","searchText","layers","searchFields","find","findTask","Find","useFeatureEditing","lastResult","setLastResult","addFeatures","features","result","updateFeatures","deleteFeatures","applyEdits","edits","EsriServiceContext","createContext","EsriServiceProvider","children","React","createElement","Provider","value","useEsriMap","context","useContext","EsriLayer","sourceId","layerId","type","paint","layout","beforeId","getLayer","layerSpec","id","source","addLayer","removeLayer"],"mappings":";;;;;;;AAKA;;;AAGG;AACG,SAAUA,qBAAqBA,CACnCC,MAAA,GAAwD,EAAE,EAAA;EAE1D,MAAM;AAAEC,IAAAA;AAAO,GAAE,GAAGD,MAAM;EAC1B,MAAM,CAACE,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAA4B,IAAI,CAAC;EACvE,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAACG,KAAK,EAAEC,QAAQ,CAAC,GAAGJ,QAAQ,CAAe,IAAI,CAAC;AACtD,EAAA,MAAMK,UAAU,GAAGC,MAAM,CAA4B,IAAI,CAAC;AAE1D,EAAA,MAAMC,cAAc,GAAGC,WAAW,CAAC,MAAK;AACtC,IAAA,MAAMC,QAAQ,GAAGJ,UAAU,CAACK,OAAO;AACnC,IAAA,IAAID,QAAQ,EAAE;MACZ,IAAI;QACFA,QAAQ,CAACE,MAAM,EAAE;MACnB,CAAC,CAAC,OAA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AAA,MAAMvD,GAAG,GAAG8C,UAAU,EAAE;AAExBtD,EAAAA,SAAS,CAAC,MAAK;IACb,IAAI,CAACQ,GAAG,EAAE;AAEV;AACA,IAAA,IAAIA,GAAG,CAACwD,QAAQ,CAACL,OAAO,CAAC,EAAE;AACzB,MAAA;AACF,IAAA;AAEA;AACA,IAAA,MAAMM,SAAS,GAAG;AAChBC,MAAAA,EAAE,EAAEP,OAAO;MACXC,IAAI;AACJO,MAAAA,MAAM,EAAET,QAAQ;MAChBG,KAAK;AACLC,MAAAA;AACqC,KAAA,CAAC;AAExC,IAAA,IAAIC,QAAQ,EAAE;AACZvD,MAAAA,GAAG,CAAC4D,QAAQ,CAACH,SAAS,EAAEF,QAAQ,CAAC;AACnC,IAAA,CAAC,MAAM;AACLvD,MAAAA,GAAG,CAAC4D,QAAQ,CAACH,SAAS,CAAC;AACzB,IAAA;AAEA;AACA,IAAA,OAAO,MAAK;AACV,MAAA,IAAIzD,GAAG,CAACwD,QAAQ,CAACL,OAAO,CAAC,EAAE;AACzBnD,QAAAA,GAAG,CAAC6D,WAAW,CAACV,OAAO,CAAC;AAC1B,MAAA;IACF,CAAC;AACH,EAAA,CAAC,EAAE,CAACnD,GAAG,EAAEkD,QAAQ,EAAEC,OAAO,EAAEC,IAAI,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,CAAC,CAAC;AAE3D,EAAA,OAAO,IAAI;AACb;;;;"}
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../src/react/hooks/useVectorBasemapStyle.ts","../src/react/hooks/useAsyncOperation.ts","../src/react/hooks/useIdentifyFeatures.ts","../src/react/hooks/useIdentifyImage.ts","../src/react/hooks/useQuery.ts","../src/react/hooks/useFind.ts","../src/react/hooks/useFeatureEditing.ts","../src/react/hooks/usePortalItem.ts","../src/react/components/EsriServiceProvider.tsx","../src/react/components/EsriLayer.tsx"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from 'react';\nimport { VectorBasemapStyle } from '@/Services/VectorBasemapStyle';\nimport type { VectorBasemapStyleAuthOptions } from '@/Services/VectorBasemapStyle';\nimport type { UseVectorBasemapStyleOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing VectorBasemapStyle lifecycle\n * Note: VectorBasemapStyle has a different constructor signature than other services\n */\nexport function useVectorBasemapStyle(\n params: Pick<UseVectorBasemapStyleOptions, 'options'> = {}\n): UseEsriServiceResult<VectorBasemapStyle> {\n const { options } = params;\n const [service, setService] = useState<VectorBasemapStyle | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const serviceRef = useRef<VectorBasemapStyle | null>(null);\n\n const cleanupService = useCallback(() => {\n const existing = serviceRef.current;\n if (existing) {\n try {\n existing.remove();\n } catch (cleanupError) {\n console.warn('Failed to remove VectorBasemapStyle service', cleanupError);\n }\n }\n serviceRef.current = null;\n setService(null);\n }, []);\n\n const basemapEnum = options?.basemapEnum ?? 'arcgis/streets';\n const token = options?.token;\n const apiKey = options?.apiKey;\n const language = options?.language;\n const worldview = options?.worldview;\n const hasCredential = Boolean(token || apiKey);\n\n const reload = useCallback(() => {\n if (!hasCredential) {\n cleanupService();\n setLoading(false);\n setError(null);\n return;\n }\n\n setLoading(true);\n setError(null);\n\n try {\n cleanupService();\n\n const authOptions: VectorBasemapStyleAuthOptions = {};\n if (token) authOptions.token = token;\n if (apiKey) authOptions.apiKey = apiKey;\n if (language) authOptions.language = language;\n if (worldview) authOptions.worldview = worldview;\n\n const newService = new VectorBasemapStyle(basemapEnum, authOptions);\n setService(newService);\n serviceRef.current = newService;\n } catch (err) {\n setError(err instanceof Error ? err : new Error('Failed to create service'));\n } finally {\n setLoading(false);\n }\n }, [hasCredential, cleanupService, token, apiKey, language, worldview, basemapEnum]);\n\n // Initialize service when options change\n useEffect(() => {\n if (!hasCredential) {\n cleanupService();\n return;\n }\n\n reload();\n\n // Cleanup on unmount or options change\n return () => {\n cleanupService();\n };\n }, [reload, cleanupService, hasCredential]);\n\n return {\n service,\n loading,\n error,\n reload,\n };\n}\n","import { useCallback, useState } from 'react';\n\nexport interface UseAsyncOperationResult {\n loading: boolean;\n error: Error | null;\n /**\n * Wrap an async callback with the loading/error state machine shared by\n * every task-style hook. Rethrows after setting error state so callers\n * can still `await` and handle failures at the call site.\n */\n run: <T>(fn: () => Promise<T>, failureMessage?: string) => Promise<T>;\n}\n\n/**\n * Shared state + wrapper used by task/editing hooks. Collapses the\n * repetitive `setLoading(true); try { ... } catch { setError(...) }\n * finally { setLoading(false) }` dance into one call site.\n */\nexport function useAsyncOperation(): UseAsyncOperationResult {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const run = useCallback(\n async <T>(fn: () => Promise<T>, failureMessage = 'Operation failed'): Promise<T> => {\n setLoading(true);\n setError(null);\n try {\n return await fn();\n } catch (err) {\n const errorObj = err instanceof Error ? err : new Error(failureMessage);\n setError(errorObj);\n throw errorObj;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n return { loading, error, run };\n}\n","import { useCallback } from 'react';\nimport { IdentifyFeatures } from '@/Tasks/IdentifyFeatures';\nimport type { Map } from '@/types';\nimport type { UseIdentifyFeaturesOptions } from '../types';\nimport { useAsyncOperation } from './useAsyncOperation';\n\n/**\n * Hook for using IdentifyFeatures task\n */\nexport function useIdentifyFeatures({\n url,\n tolerance,\n returnGeometry,\n}: UseIdentifyFeaturesOptions) {\n const { loading, error, run } = useAsyncOperation();\n\n const identify = useCallback(\n (\n point: { lng: number; lat: number },\n additionalOptions?: Record<string, unknown> & { map?: Map }\n ) =>\n run(async () => {\n const { map, ...rest } = additionalOptions ?? {};\n\n const identifyTask = new IdentifyFeatures({\n url,\n tolerance,\n returnGeometry,\n ...rest,\n });\n\n identifyTask.at(point);\n if (map) identifyTask.on(map);\n\n return identifyTask.run();\n }, 'Identify failed'),\n [url, tolerance, returnGeometry, run]\n );\n\n return {\n identify,\n loading,\n error,\n };\n}\n","import { useCallback } from 'react';\nimport { IdentifyImage } from '@/Tasks/IdentifyImage';\nimport type { UseIdentifyImageOptions } from '../types';\nimport { useAsyncOperation } from './useAsyncOperation';\n\nexport interface UseIdentifyImageResult {\n identifyImage: (\n point: { lng: number; lat: number } | [number, number],\n additionalOptions?: Partial<UseIdentifyImageOptions> & Record<string, unknown>\n ) => Promise<Awaited<ReturnType<IdentifyImage['run']>>>;\n loading: boolean;\n error: Error | null;\n}\n\n/**\n * Hook for using IdentifyImage task\n */\nexport function useIdentifyImage(options: UseIdentifyImageOptions): UseIdentifyImageResult {\n const { loading, error, run } = useAsyncOperation();\n const { url, token, returnGeometry } = options;\n\n const identifyImage = useCallback<UseIdentifyImageResult['identifyImage']>(\n (point, additionalOptions) =>\n run(async () => {\n const identifyTask = new IdentifyImage({\n ...options,\n ...additionalOptions,\n });\n\n identifyTask.at(point);\n\n return identifyTask.run();\n }, 'Identify image failed'),\n [url, token, returnGeometry, run]\n );\n\n return {\n identifyImage,\n loading,\n error,\n };\n}\n","import { useCallback } from 'react';\nimport { Query } from '@/Tasks/Query';\nimport type { UseQueryOptions } from '../types';\nimport { useAsyncOperation } from './useAsyncOperation';\n\n/**\n * Hook for using Query task\n */\nexport function useQuery(options: UseQueryOptions) {\n const { loading, error, run } = useAsyncOperation();\n const { url, where, outFields, returnGeometry } = options;\n\n const query = useCallback(\n (additionalOptions?: Record<string, unknown>) =>\n run(async () => {\n const queryTask = new Query({\n ...options,\n ...additionalOptions,\n });\n return queryTask.run();\n }, 'Query failed'),\n [url, where, outFields, returnGeometry, run]\n );\n\n const queryAll = useCallback(\n (additionalOptions?: Record<string, unknown> & { maxPages?: number }) =>\n run(async () => {\n const { maxPages, ...rest } = additionalOptions || {};\n const queryTask = new Query({\n ...options,\n ...rest,\n });\n return queryTask.runAll({ maxPages });\n }, 'Query failed'),\n [url, where, outFields, returnGeometry, run]\n );\n\n return {\n query,\n queryAll,\n loading,\n error,\n };\n}\n","import { useCallback } from 'react';\nimport { Find } from '@/Tasks/Find';\nimport type { UseFindOptions } from '../types';\nimport { useAsyncOperation } from './useAsyncOperation';\n\n/**\n * Hook for using Find task\n */\nexport function useFind({ url, searchText, layers, searchFields }: UseFindOptions) {\n const { loading, error, run } = useAsyncOperation();\n\n const find = useCallback(\n (additionalOptions?: Record<string, unknown>) =>\n run(async () => {\n const findTask = new Find({\n url,\n searchText,\n layers,\n searchFields,\n ...additionalOptions,\n });\n return findTask.run();\n }, 'Find failed'),\n [url, searchText, layers, searchFields, run]\n );\n\n return {\n find,\n loading,\n error,\n };\n}\n","import { useCallback, useState } from 'react';\nimport type { FeatureService } from '@/Services/FeatureService';\nimport type { EditResult, ApplyEditsResult } from '@/types';\nimport type { UseFeatureEditingResult } from '../types';\nimport { useAsyncOperation } from './useAsyncOperation';\n\nexport type { UseFeatureEditingResult };\n\n/**\n * Hook for feature editing operations on a FeatureService\n */\nexport function useFeatureEditing(service: FeatureService | null): UseFeatureEditingResult {\n const { loading, error, run } = useAsyncOperation();\n const [lastResult, setLastResult] = useState<EditResult[] | ApplyEditsResult | null>(null);\n\n const runEdit = useCallback(\n async <T extends EditResult[] | ApplyEditsResult>(\n op: () => Promise<T>,\n failureMessage: string\n ): Promise<T> => {\n if (!service) throw new Error('FeatureService not available');\n const result = await run(op, failureMessage);\n setLastResult(result);\n return result;\n },\n [service, run]\n );\n\n const addFeatures = useCallback(\n (features: GeoJSON.Feature[], options?: { gdbVersion?: string }) =>\n runEdit(() => service!.addFeatures(features, options), 'Add features failed'),\n [service, runEdit]\n );\n\n const updateFeatures = useCallback(\n (features: GeoJSON.Feature[], options?: { gdbVersion?: string }) =>\n runEdit(() => service!.updateFeatures(features, options), 'Update features failed'),\n [service, runEdit]\n );\n\n const deleteFeatures = useCallback(\n (params: { objectIds?: number[]; where?: string }) =>\n runEdit(() => service!.deleteFeatures(params), 'Delete features failed'),\n [service, runEdit]\n );\n\n const applyEdits = useCallback(\n (\n edits: { adds?: GeoJSON.Feature[]; updates?: GeoJSON.Feature[]; deletes?: number[] },\n options?: { gdbVersion?: string }\n ) => runEdit(() => service!.applyEdits(edits, options), 'Apply edits failed'),\n [service, runEdit]\n );\n\n return {\n addFeatures,\n updateFeatures,\n deleteFeatures,\n applyEdits,\n loading,\n error,\n lastResult,\n };\n}\n","import { useState, useEffect, useRef, useCallback } from 'react';\nimport { serviceFromPortalItem } from '@/Portal';\nimport type { PortalResolvedService } from '@/Portal';\nimport type { UsePortalItemOptions, UsePortalItemResult } from '../types';\n\n/**\n * Resolve an ArcGIS portal item id to an esri-gl service (adding its source to\n * the map) via {@link serviceFromPortalItem}. Re-resolves when `itemId` / `map`\n * change and cleans up the previous service.\n */\nexport function usePortalItem({\n sourceId,\n map,\n itemId,\n options,\n}: UsePortalItemOptions): UsePortalItemResult {\n const [service, setService] = useState<PortalResolvedService | null>(null);\n const [kind, setKind] = useState<UsePortalItemResult['kind']>(null);\n const [url, setUrl] = useState<string | null>(null);\n const [title, setTitle] = useState<string | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [reloadKey, setReloadKey] = useState(0);\n\n const serviceRef = useRef<PortalResolvedService | null>(null);\n const optionsRef = useRef(options);\n optionsRef.current = options;\n\n const cleanup = useCallback(() => {\n if (serviceRef.current) {\n try {\n serviceRef.current.remove();\n } catch (err) {\n if (process.env?.NODE_ENV !== 'test') {\n console.warn('usePortalItem: error removing service:', err);\n }\n }\n serviceRef.current = null;\n }\n }, []);\n\n const reload = useCallback(() => setReloadKey(key => key + 1), []);\n\n useEffect(() => {\n if (!map || !itemId) {\n cleanup();\n setService(null);\n setKind(null);\n setUrl(null);\n setTitle(null);\n // Clear any in-flight loading state from a previous itemId/map.\n setLoading(false);\n return;\n }\n\n let cancelled = false;\n setLoading(true);\n setError(null);\n cleanup();\n\n serviceFromPortalItem(sourceId, map, itemId, optionsRef.current)\n .then(result => {\n if (cancelled) {\n try {\n result.service.remove();\n } catch {\n /* ignore */\n }\n return;\n }\n serviceRef.current = result.service;\n setService(result.service);\n setKind(result.kind);\n setUrl(result.url);\n setTitle(result.title ?? null);\n setLoading(false);\n })\n .catch(err => {\n if (cancelled) return;\n setError(err instanceof Error ? err : new Error('Failed to resolve portal item'));\n setLoading(false);\n });\n\n return () => {\n cancelled = true;\n };\n }, [map, itemId, sourceId, reloadKey, cleanup]);\n\n // Remove the resolved service on unmount.\n useEffect(() => () => cleanup(), [cleanup]);\n\n return { service, kind, url, title, loading, error, reload };\n}\n","import React, { createContext, useContext } from 'react';\nimport type { EsriServiceProviderProps } from '../types';\nimport type { Map } from '@/types';\n\ninterface EsriServiceContextValue {\n map: Map | null;\n}\n\nconst EsriServiceContext = createContext<EsriServiceContextValue>({\n map: null,\n});\n\n/**\n * Context provider for sharing map instance across Esri components\n */\nexport function EsriServiceProvider({ children, map = null }: EsriServiceProviderProps) {\n return React.createElement(EsriServiceContext.Provider, { value: { map } }, children);\n}\n\n/**\n * Hook to access the current map from EsriServiceProvider\n */\nexport function useEsriMap(): Map | null {\n const context = useContext(EsriServiceContext);\n return context.map;\n}\n","import { useEffect } from 'react';\nimport { useEsriMap } from './EsriServiceProvider';\nimport type { EsriLayerProps } from '../types';\n\n/**\n * Generic Esri layer component that adds a layer to the map\n */\nexport function EsriLayer({\n sourceId,\n layerId,\n type,\n paint = {},\n layout = {},\n beforeId,\n}: EsriLayerProps) {\n const map = useEsriMap();\n\n useEffect(() => {\n if (!map) return;\n\n // Check if layer already exists\n if (map.getLayer(layerId)) {\n return;\n }\n\n // Add layer to map\n const layerSpec = {\n id: layerId,\n type,\n source: sourceId,\n paint,\n layout,\n } as Parameters<typeof map.addLayer>[0]; // Type assertion for layer specification\n\n if (beforeId) {\n map.addLayer(layerSpec, beforeId);\n } else {\n map.addLayer(layerSpec);\n }\n\n // Cleanup function\n return () => {\n if (map.getLayer(layerId)) {\n map.removeLayer(layerId);\n }\n };\n }, [map, sourceId, layerId, type, paint, layout, beforeId]);\n\n return null;\n}\n"],"names":["useVectorBasemapStyle","params","options","service","setService","useState","loading","setLoading","error","setError","serviceRef","useRef","cleanupService","useCallback","existing","current","remove","cleanupError","console","warn","basemapEnum","token","apiKey","language","worldview","hasCredential","Boolean","reload","authOptions","newService","VectorBasemapStyle","err","Error","useEffect","useAsyncOperation","run","fn","failureMessage","errorObj","useIdentifyFeatures","url","tolerance","returnGeometry","identify","point","additionalOptions","map","rest","identifyTask","IdentifyFeatures","at","on","useIdentifyImage","identifyImage","IdentifyImage","useQuery","where","outFields","query","queryTask","Query","queryAll","maxPages","runAll","useFind","searchText","layers","searchFields","find","findTask","Find","useFeatureEditing","lastResult","setLastResult","runEdit","op","result","addFeatures","features","updateFeatures","deleteFeatures","applyEdits","edits","usePortalItem","sourceId","itemId","kind","setKind","setUrl","title","setTitle","reloadKey","setReloadKey","optionsRef","cleanup","process","env","NODE_ENV","key","cancelled","serviceFromPortalItem","then","catch","EsriServiceContext","createContext","EsriServiceProvider","children","React","createElement","Provider","value","useEsriMap","context","useContext","EsriLayer","layerId","type","paint","layout","beforeId","getLayer","layerSpec","id","source","addLayer","removeLayer"],"mappings":";;;;;;;;;;;AAKA;;;AAGG;AACG,SAAUA,qBAAqBA,CACnCC,MAAA,GAAwD,EAAE,EAAA;EAE1D,MAAM;AAAEC,IAAAA;AAAO,GAAE,GAAGD,MAAM;EAC1B,MAAM,CAACE,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAA4B,IAAI,CAAC;EACvE,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAACG,KAAK,EAAEC,QAAQ,CAAC,GAAGJ,QAAQ,CAAe,IAAI,CAAC;AACtD,EAAA,MAAMK,UAAU,GAAGC,MAAM,CAA4B,IAAI,CAAC;AAE1D,EAAA,MAAMC,cAAc,GAAGC,WAAW,CAAC,MAAK;AACtC,IAAA,MAAMC,QAAQ,GAAGJ,UAAU,CAACK,OAAO;AACnC,IAAA,IAAID,QAAQ,EAAE;MACZ,IAAI;QACFA,QAAQ,CAACE,MAAM,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