esri-gl 1.0.0 → 1.0.2

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esri-gl",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A module for making it easier to use Esri services in mapbox-gl or maplibre-gl.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,8 +1,8 @@
1
- import { u as useDynamicMapService, U as UseEsriServiceResult, x as useTiledMapService, w as useImageService, y as useVectorTileService, v as useFeatureService } from './useFeatureService-BmqltfVc.js';
1
+ import { u as useDynamicMapService, U as UseEsriServiceResult, x as useTiledMapService, w as useImageService, y as useVectorTileService, v as useFeatureService } from './useFeatureService-QUqwJcet.js';
2
2
  import { Map } from 'maplibre-gl';
3
3
  export { Map } from 'maplibre-gl';
4
- import { D as DynamicMapService, T as TiledMapService, e as ImageService, f as VectorTileService, g as FeatureService } from './index-CfCttkZx.js';
5
- export { j as AGOLServiceError, A as ApplyEditsResult, k as AttachmentInfo, B as BatchLayerOperation, l as BetweenFilter, C as ComparisonFilter, m as ComparisonOp, n as DynamicLayer, a as EditResult, o as EsriDrawingInfo, p as EsriDynamicMapLayerSource, q as EsriRenderer, E as EsriServiceOptions, r as EsriTextSymbol, s as Extent, F as FeatureServiceOptions, t as FeatureSet, u as FieldInfo, v as Find, G as GroupFilter, w as IdentifyFeatures, i as IdentifyImage, c as ImageServiceOptions, x as InFilter, L as LayerFilter, y as LayerInfo, z as LayerLabelingInfo, H as LayerMetadata, J as LayerQueryOptions, K as LayerScaleRange, M as LayerSpecification, N as LayerTimeOptions, O as LayerUpdateEvent, P as LayerUpdateType, Q as LegendInfo, R as LogicalOp, S as MapExportOptions, U as NullFilter, W as PaginatedFeatureCollection, X as Query, Y as RasterSourceOptions, Z as Service, _ as ServiceErrorEvent, $ as ServiceEventType, a0 as ServiceMetadata, a1 as SourceSpecification, a2 as StatisticResult, a3 as Task, a4 as TimeAnimationOptions, h as VectorBasemapStyle, V as VectorBasemapStyleOptions, a5 as VectorSourceOptions, d as VectorTileServiceOptions, a6 as cleanTrailingSlash, a7 as find, a8 as getServiceDetails, a9 as identifyImage, aa as query, ab as updateAttribution } from './index-CfCttkZx.js';
4
+ import { D as DynamicMapService, T as TiledMapService, e as ImageService, f as VectorTileService, g as FeatureService } from './index-DczUYC4z.js';
5
+ export { j as AGOLServiceError, A as ApplyEditsResult, k as AttachmentInfo, B as BatchLayerOperation, l as BetweenFilter, C as ComparisonFilter, m as ComparisonOp, n as DynamicLayer, a as EditResult, o as EsriDrawingInfo, p as EsriDynamicMapLayerSource, q as EsriRenderer, E as EsriServiceOptions, r as EsriTextSymbol, s as Extent, F as FeatureServiceOptions, t as FeatureSet, u as FieldInfo, v as Find, G as GroupFilter, w as IdentifyFeatures, i as IdentifyImage, c as ImageServiceOptions, x as InFilter, L as LayerFilter, y as LayerInfo, z as LayerLabelingInfo, H as LayerMetadata, J as LayerQueryOptions, K as LayerScaleRange, M as LayerSpecification, N as LayerTimeOptions, O as LayerUpdateEvent, P as LayerUpdateType, Q as LegendInfo, R as LogicalOp, S as MapExportOptions, U as NullFilter, W as PaginatedFeatureCollection, X as Query, Y as RasterSourceOptions, Z as Service, _ as ServiceErrorEvent, $ as ServiceEventType, a0 as ServiceMetadata, a1 as SourceSpecification, a2 as StatisticResult, a3 as Task, a4 as TimeAnimationOptions, h as VectorBasemapStyle, V as VectorBasemapStyleOptions, a5 as VectorSourceOptions, d as VectorTileServiceOptions, a6 as cleanTrailingSlash, a7 as find, a8 as getServiceDetails, a9 as identifyImage, aa as query, ab as updateAttribution } from './index-DczUYC4z.js';
6
6
  import 'react';
7
7
 
8
8
  interface EsriLayerBaseProps {
@@ -1,9 +1,9 @@
1
1
  import { useState, useEffect, useMemo, useRef } from 'react';
2
- import { D as DynamicMapService, d as TiledMapService, c as ImageService, e as VectorTileService, V as VectorBasemapStyle, F as FeatureService } from './IdentifyImage-DWBF8K_a.js';
3
- export { a as Find, I as IdentifyFeatures, b as IdentifyImage, Q as Query, S as Service, T as Task, f as cleanTrailingSlash, g as find, h as getServiceDetails, i as identifyImage, q as query, u as updateAttribution } from './IdentifyImage-DWBF8K_a.js';
2
+ import { D as DynamicMapService, d as TiledMapService, c as ImageService, e as VectorTileService, V as VectorBasemapStyle, F as FeatureService } from './IdentifyImage-DmyKcbAv.js';
3
+ export { a as Find, I as IdentifyFeatures, b as IdentifyImage, Q as Query, S as Service, T as Task, f as cleanTrailingSlash, g as find, h as getServiceDetails, i as identifyImage, q as query, u as updateAttribution } from './IdentifyImage-DmyKcbAv.js';
4
4
  import { useMap } from 'react-map-gl/mapbox';
5
5
  import { useMap as useMap$1 } from 'react-map-gl/maplibre';
6
- import { b as useFeatureService, e as useVectorTileService, c as useImageService, d as useTiledMapService, u as useDynamicMapService } from './useFeatureService-B0ot0WFz.js';
6
+ import { b as useFeatureService, e as useVectorTileService, c as useImageService, d as useTiledMapService, u as useDynamicMapService } from './useFeatureService-E9PiUOLP.js';
7
7
  import '@mapbox/tilebelt';
8
8
  import 'arcgis-pbf-parser';
9
9
 
package/dist/react.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { U as UseEsriServiceResult, a as UseVectorBasemapStyleOptions, b as UseIdentifyFeaturesOptions, c as UseIdentifyImageOptions, d as UseQueryOptions, e as UseFindOptions, E as EsriServiceProviderProps, f as EsriLayerProps } from './useFeatureService-BmqltfVc.js';
2
- export { g as EsriDynamicLayerProps, h as EsriFeatureLayerProps, i as EsriImageLayerProps, j as EsriLayerBaseProps, k as EsriTiledLayerProps, l as EsriVectorBasemapLayerProps, m as EsriVectorTileLayerProps, n as UseDynamicMapServiceOptions, o as UseEsriServiceOptions, p as UseFeatureEditingResult, q as UseFeatureServiceOptions, r as UseImageServiceOptions, s as UseTiledMapServiceOptions, t as UseVectorTileServiceOptions, u as useDynamicMapService, v as useFeatureService, w as useImageService, x as useTiledMapService, y as useVectorTileService } from './useFeatureService-BmqltfVc.js';
1
+ import { U as UseEsriServiceResult, a as UseVectorBasemapStyleOptions, b as UseIdentifyFeaturesOptions, c as UseIdentifyImageOptions, d as UseQueryOptions, e as UseFindOptions, E as EsriServiceProviderProps, f as EsriLayerProps } from './useFeatureService-QUqwJcet.js';
2
+ export { g as EsriDynamicLayerProps, h as EsriFeatureLayerProps, i as EsriImageLayerProps, j as EsriLayerBaseProps, k as EsriTiledLayerProps, l as EsriVectorBasemapLayerProps, m as EsriVectorTileLayerProps, n as UseDynamicMapServiceOptions, o as UseEsriServiceOptions, p as UseFeatureEditingResult, q as UseFeatureServiceOptions, r as UseImageServiceOptions, s as UseTiledMapServiceOptions, t as UseVectorTileServiceOptions, u as useDynamicMapService, v as useFeatureService, w as useImageService, x as useTiledMapService, y as useVectorTileService } from './useFeatureService-QUqwJcet.js';
3
3
  import { Map } from 'maplibre-gl';
4
4
  export { Map } from 'maplibre-gl';
5
- import { h as VectorBasemapStyle, i as IdentifyImage, g as FeatureService, a as EditResult, A as ApplyEditsResult } from './index-CfCttkZx.js';
6
- export { j as AGOLServiceError, k as AttachmentInfo, B as BatchLayerOperation, l as BetweenFilter, C as ComparisonFilter, m as ComparisonOp, n as DynamicLayer, D as DynamicMapService, o as EsriDrawingInfo, p as EsriDynamicMapLayerSource, q as EsriRenderer, E as EsriServiceOptions, r as EsriTextSymbol, s as Extent, F as FeatureServiceOptions, t as FeatureSet, u as FieldInfo, v as Find, G as GroupFilter, w as IdentifyFeatures, e as ImageService, c as ImageServiceOptions, x as InFilter, L as LayerFilter, y as LayerInfo, z as LayerLabelingInfo, H as LayerMetadata, J as LayerQueryOptions, K as LayerScaleRange, M as LayerSpecification, N as LayerTimeOptions, O as LayerUpdateEvent, P as LayerUpdateType, Q as LegendInfo, R as LogicalOp, S as MapExportOptions, U as NullFilter, W as PaginatedFeatureCollection, X as Query, Y as RasterSourceOptions, Z as Service, _ as ServiceErrorEvent, $ as ServiceEventType, a0 as ServiceMetadata, a1 as SourceSpecification, a2 as StatisticResult, a3 as Task, T as TiledMapService, a4 as TimeAnimationOptions, V as VectorBasemapStyleOptions, a5 as VectorSourceOptions, f as VectorTileService, d as VectorTileServiceOptions, a6 as cleanTrailingSlash, a7 as find, a8 as getServiceDetails, a9 as identifyImage, aa as query, ab as updateAttribution } from './index-CfCttkZx.js';
5
+ import { h as VectorBasemapStyle, i as IdentifyImage, g as FeatureService, a as EditResult, A as ApplyEditsResult } from './index-DczUYC4z.js';
6
+ export { j as AGOLServiceError, k as AttachmentInfo, B as BatchLayerOperation, l as BetweenFilter, C as ComparisonFilter, m as ComparisonOp, n as DynamicLayer, D as DynamicMapService, o as EsriDrawingInfo, p as EsriDynamicMapLayerSource, q as EsriRenderer, E as EsriServiceOptions, r as EsriTextSymbol, s as Extent, F as FeatureServiceOptions, t as FeatureSet, u as FieldInfo, v as Find, G as GroupFilter, w as IdentifyFeatures, e as ImageService, c as ImageServiceOptions, x as InFilter, L as LayerFilter, y as LayerInfo, z as LayerLabelingInfo, H as LayerMetadata, J as LayerQueryOptions, K as LayerScaleRange, M as LayerSpecification, N as LayerTimeOptions, O as LayerUpdateEvent, P as LayerUpdateType, Q as LegendInfo, R as LogicalOp, S as MapExportOptions, U as NullFilter, W as PaginatedFeatureCollection, X as Query, Y as RasterSourceOptions, Z as Service, _ as ServiceErrorEvent, $ as ServiceEventType, a0 as ServiceMetadata, a1 as SourceSpecification, a2 as StatisticResult, a3 as Task, T as TiledMapService, a4 as TimeAnimationOptions, V as VectorBasemapStyleOptions, a5 as VectorSourceOptions, f as VectorTileService, d as VectorTileServiceOptions, a6 as cleanTrailingSlash, a7 as find, a8 as getServiceDetails, a9 as identifyImage, aa as query, ab as updateAttribution } from './index-DczUYC4z.js';
7
7
  import * as geojson from 'geojson';
8
8
  import React from 'react';
9
9
 
package/dist/react.js CHANGED
@@ -1,7 +1,7 @@
1
- export { u as useDynamicMapService, a as useEsriService, b as useFeatureService, c as useImageService, d as useTiledMapService, e as useVectorTileService } from './useFeatureService-B0ot0WFz.js';
1
+ export { u as useDynamicMapService, a as useEsriService, b as useFeatureService, c as useImageService, d as useTiledMapService, e as useVectorTileService } from './useFeatureService-E9PiUOLP.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 './IdentifyImage-DWBF8K_a.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 find, h as getServiceDetails, i as identifyImage, q as query, u as updateAttribution } from './IdentifyImage-DWBF8K_a.js';
3
+ import { V as VectorBasemapStyle, I as IdentifyFeatures, b as IdentifyImage, Q as Query, a as Find } from './IdentifyImage-DmyKcbAv.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 find, h as getServiceDetails, i as identifyImage, q as query, u as updateAttribution } from './IdentifyImage-DmyKcbAv.js';
5
5
  import '@mapbox/tilebelt';
6
6
  import 'arcgis-pbf-parser';
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { useState, useRef, useCallback, useEffect } from 'react';
2
- import { D as DynamicMapService, d as TiledMapService, c as ImageService, e as VectorTileService, F as FeatureService } from './IdentifyImage-DWBF8K_a.js';
2
+ import { D as DynamicMapService, d as TiledMapService, c as ImageService, e as VectorTileService, F as FeatureService } from './IdentifyImage-DmyKcbAv.js';
3
3
 
4
4
  /**
5
5
  * Base hook for managing Esri services lifecycle
@@ -202,4 +202,4 @@ function useFeatureService({
202
202
  }
203
203
 
204
204
  export { useEsriService as a, useFeatureService as b, useImageService as c, useTiledMapService as d, useVectorTileService as e, useDynamicMapService as u };
205
- //# sourceMappingURL=useFeatureService-B0ot0WFz.js.map
205
+ //# sourceMappingURL=useFeatureService-E9PiUOLP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureService-B0ot0WFz.js","sources":["../src/react/hooks/useEsriService.ts","../src/react/hooks/useDynamicMapService.ts","../src/react/hooks/useTiledMapService.ts","../src/react/hooks/useImageService.ts","../src/react/hooks/useVectorTileService.ts","../src/react/hooks/useFeatureService.ts"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from 'react';\nimport type { UseEsriServiceResult } from '../types';\nimport type { Map } from '@/types';\n\n// Interface for services that can be removed\ninterface RemovableService {\n remove(): void;\n}\n\n/**\n * Base hook for managing Esri services lifecycle\n */\nexport function useEsriService<T extends RemovableService>(\n createService: (map: Map) => T,\n map: Map | null\n): UseEsriServiceResult<T> {\n const [service, setService] = useState<T | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n // Track if a service creation is in progress to prevent race conditions\n const isCreatingService = useRef(false);\n // Store the current service in a ref to avoid stale closure issues in cleanup\n const serviceRef = useRef<T | null>(null);\n // Track the createService function to detect changes\n const createServiceRef = useRef(createService);\n createServiceRef.current = createService;\n\n // Memoized reload function\n const reload = useCallback(() => {\n if (!map || isCreatingService.current) return;\n\n isCreatingService.current = true;\n setLoading(true);\n setError(null);\n\n try {\n // Clean up existing service using ref to avoid stale closure\n if (serviceRef.current) {\n try {\n serviceRef.current.remove();\n } catch (err) {\n // Log error but don't fail the reload\n if (process.env?.NODE_ENV !== 'test') {\n console.warn('Error removing existing service:', err);\n }\n }\n }\n\n // Create new service using the ref to get the latest createService\n const newService = createServiceRef.current(map);\n serviceRef.current = newService;\n setService(newService);\n } catch (err) {\n setError(err instanceof Error ? err : new Error('Failed to create service'));\n serviceRef.current = null;\n } finally {\n setLoading(false);\n isCreatingService.current = false;\n }\n }, [map]);\n\n // Initialize service when map becomes available\n useEffect(() => {\n if (!map) {\n // Clean up service when map is removed\n if (serviceRef.current) {\n try {\n serviceRef.current.remove();\n } catch (err) {\n if (process.env?.NODE_ENV !== 'test') {\n console.warn('Error removing service during cleanup:', err);\n }\n }\n serviceRef.current = null;\n }\n setService(null);\n return;\n }\n\n // Add a small delay to ensure map is fully initialized\n let retryTimeoutId: ReturnType<typeof setTimeout> | undefined;\n const timeoutId = setTimeout(() => {\n // Check if map is still valid\n if (map && typeof map.addSource === 'function') {\n reload();\n } else {\n // If map is not ready, try again after a short delay\n retryTimeoutId = setTimeout(() => {\n if (map && typeof map.addSource === 'function') {\n reload();\n }\n }, 100);\n }\n }, 10);\n\n return () => {\n clearTimeout(timeoutId);\n if (retryTimeoutId) clearTimeout(retryTimeoutId);\n };\n }, [map, reload]);\n\n // Cleanup on unmount only\n useEffect(() => {\n return () => {\n // This cleanup function runs on unmount\n if (serviceRef.current) {\n try {\n serviceRef.current.remove();\n } catch (err) {\n if (process.env?.NODE_ENV !== 'test') {\n console.warn('Error removing service during cleanup:', err);\n }\n }\n serviceRef.current = null;\n }\n };\n }, []); // Empty dependency array - only run cleanup on unmount\n\n return {\n service,\n loading,\n error,\n reload,\n };\n}\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useEsriService } from './useEsriService';\nimport { DynamicMapService } from '@/Services/DynamicMapService';\nimport type { UseDynamicMapServiceOptions, UseEsriServiceResult } from '../types';\nimport type { Map } from '@/types';\n\n/**\n * Hook for managing DynamicMapService lifecycle\n */\nexport function useDynamicMapService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseDynamicMapServiceOptions): UseEsriServiceResult<DynamicMapService> {\n const optionsRef = useRef(options);\n\n const createService = useCallback(\n (mapInstance: Map) => new DynamicMapService(sourceId, mapInstance, options, sourceOptions),\n [sourceId, sourceOptions] // Remove options from dependencies to prevent service recreation\n );\n\n const result = useEsriService(createService, map);\n\n // Update service options when they change\n useEffect(() => {\n if (result.service && options !== optionsRef.current && map) {\n // Add a small delay to ensure the service is fully initialized\n const timeoutId = setTimeout(() => {\n if (!result.service || !map) return;\n\n // Check for specific option changes that we can handle without recreation\n if (options.layers !== optionsRef.current.layers) {\n const layers = options.layers || [];\n if (Array.isArray(layers) || typeof layers === 'number') {\n try {\n result.service.setLayers(layers);\n } catch (error) {\n console.warn('useDynamicMapService: Error setting layers:', error);\n }\n }\n }\n\n if (options.layerDefs !== optionsRef.current.layerDefs) {\n const layerDefs = options.layerDefs || {};\n try {\n result.service.setLayerDefs(layerDefs);\n } catch (error) {\n console.warn('useDynamicMapService: Error setting layer definitions:', error);\n }\n }\n\n // Update the ref to track current options\n optionsRef.current = options;\n }, 50);\n\n return () => clearTimeout(timeoutId);\n }\n }, [result.service, options, map]);\n\n return result;\n}\n","import { useEsriService } from './useEsriService';\nimport { TiledMapService } from '@/Services/TiledMapService';\nimport type { UseTiledMapServiceOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing TiledMapService lifecycle\n */\nexport function useTiledMapService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseTiledMapServiceOptions): UseEsriServiceResult<TiledMapService> {\n return useEsriService(\n mapInstance => new TiledMapService(sourceId, mapInstance, options, sourceOptions),\n map\n );\n}\n","import { useEsriService } from './useEsriService';\nimport { ImageService } from '@/Services/ImageService';\nimport type { UseImageServiceOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing ImageService lifecycle\n */\nexport function useImageService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseImageServiceOptions): UseEsriServiceResult<ImageService> {\n return useEsriService(\n mapInstance => new ImageService(sourceId, mapInstance, options, sourceOptions),\n map\n );\n}\n","import { useEsriService } from './useEsriService';\nimport { VectorTileService } from '@/Services/VectorTileService';\nimport type { UseVectorTileServiceOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing VectorTileService lifecycle\n */\nexport function useVectorTileService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseVectorTileServiceOptions): UseEsriServiceResult<VectorTileService> {\n return useEsriService(\n mapInstance => new VectorTileService(sourceId, mapInstance, options, sourceOptions),\n map\n );\n}\n","import { useEsriService } from './useEsriService';\nimport { FeatureService } from '@/Services/FeatureService';\nimport type { UseFeatureServiceOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing FeatureService lifecycle\n */\nexport function useFeatureService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseFeatureServiceOptions): UseEsriServiceResult<FeatureService> {\n return useEsriService(\n mapInstance => new FeatureService(sourceId, mapInstance, options, sourceOptions),\n map\n );\n}\n"],"names":["useEsriService","createService","map","service","setService","useState","loading","setLoading","error","setError","isCreatingService","useRef","serviceRef","createServiceRef","current","reload","useCallback","remove","err","process","env","NODE_ENV","console","warn","newService","Error","useEffect","retryTimeoutId","timeoutId","setTimeout","addSource","clearTimeout","useDynamicMapService","sourceId","options","sourceOptions","optionsRef","mapInstance","DynamicMapService","result","layers","Array","isArray","setLayers","layerDefs","setLayerDefs","useTiledMapService","TiledMapService","useImageService","ImageService","useVectorTileService","VectorTileService","useFeatureService","FeatureService"],"mappings":";;;AASA;;AAEG;AACG,SAAUA,cAAcA,CAC5BC,aAA8B,EAC9BC,GAAe,EAAA;EAEf,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAAW,IAAI,CAAC;EACtD,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAACG,KAAK,EAAEC,QAAQ,CAAC,GAAGJ,QAAQ,CAAe,IAAI,CAAC;AAEtD;AACA,EAAA,MAAMK,iBAAiB,GAAGC,MAAM,CAAC,KAAK,CAAC;AACvC;AACA,EAAA,MAAMC,UAAU,GAAGD,MAAM,CAAW,IAAI,CAAC;AACzC;AACA,EAAA,MAAME,gBAAgB,GAAGF,MAAM,CAACV,aAAa,CAAC;EAC9CY,gBAAgB,CAACC,OAAO,GAAGb,aAAa;AAExC;AACA,EAAA,MAAMc,MAAM,GAAGC,WAAW,CAAC,MAAK;AAC9B,IAAA,IAAI,CAACd,GAAG,IAAIQ,iBAAiB,CAACI,OAAO,EAAE;IAEvCJ,iBAAiB,CAACI,OAAO,GAAG,IAAI;IAChCP,UAAU,CAAC,IAAI,CAAC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AW,EAAEH,OAAO,EAAEC,aAAa,CAAC,EACnFjC,GAAG,CACJ;AACH;;ACbA;;AAEG;AACG,SAAUkD,iBAAiBA,CAAC;EAChCnB,QAAQ;EACR/B,GAAG;EACHgC,OAAO;AACPC,EAAAA;AAAa,CACY,EAAA;AACzB,EAAA,OAAOnC,cAAc,CACnBqC,WAAW,IAAI,IAAIgB,cAAc,CAACpB,QAAQ,EAAEI,WAAW,EAAEH,OAAO,EAAEC,aAAa,CAAC,EAChFjC,GAAG,CACJ;AACH;;;;"}
1
+ {"version":3,"file":"useFeatureService-E9PiUOLP.js","sources":["../src/react/hooks/useEsriService.ts","../src/react/hooks/useDynamicMapService.ts","../src/react/hooks/useTiledMapService.ts","../src/react/hooks/useImageService.ts","../src/react/hooks/useVectorTileService.ts","../src/react/hooks/useFeatureService.ts"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from 'react';\nimport type { UseEsriServiceResult } from '../types';\nimport type { Map } from '@/types';\n\n// Interface for services that can be removed\ninterface RemovableService {\n remove(): void;\n}\n\n/**\n * Base hook for managing Esri services lifecycle\n */\nexport function useEsriService<T extends RemovableService>(\n createService: (map: Map) => T,\n map: Map | null\n): UseEsriServiceResult<T> {\n const [service, setService] = useState<T | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n // Track if a service creation is in progress to prevent race conditions\n const isCreatingService = useRef(false);\n // Store the current service in a ref to avoid stale closure issues in cleanup\n const serviceRef = useRef<T | null>(null);\n // Track the createService function to detect changes\n const createServiceRef = useRef(createService);\n createServiceRef.current = createService;\n\n // Memoized reload function\n const reload = useCallback(() => {\n if (!map || isCreatingService.current) return;\n\n isCreatingService.current = true;\n setLoading(true);\n setError(null);\n\n try {\n // Clean up existing service using ref to avoid stale closure\n if (serviceRef.current) {\n try {\n serviceRef.current.remove();\n } catch (err) {\n // Log error but don't fail the reload\n if (process.env?.NODE_ENV !== 'test') {\n console.warn('Error removing existing service:', err);\n }\n }\n }\n\n // Create new service using the ref to get the latest createService\n const newService = createServiceRef.current(map);\n serviceRef.current = newService;\n setService(newService);\n } catch (err) {\n setError(err instanceof Error ? err : new Error('Failed to create service'));\n serviceRef.current = null;\n } finally {\n setLoading(false);\n isCreatingService.current = false;\n }\n }, [map]);\n\n // Initialize service when map becomes available\n useEffect(() => {\n if (!map) {\n // Clean up service when map is removed\n if (serviceRef.current) {\n try {\n serviceRef.current.remove();\n } catch (err) {\n if (process.env?.NODE_ENV !== 'test') {\n console.warn('Error removing service during cleanup:', err);\n }\n }\n serviceRef.current = null;\n }\n setService(null);\n return;\n }\n\n // Add a small delay to ensure map is fully initialized\n let retryTimeoutId: ReturnType<typeof setTimeout> | undefined;\n const timeoutId = setTimeout(() => {\n // Check if map is still valid\n if (map && typeof map.addSource === 'function') {\n reload();\n } else {\n // If map is not ready, try again after a short delay\n retryTimeoutId = setTimeout(() => {\n if (map && typeof map.addSource === 'function') {\n reload();\n }\n }, 100);\n }\n }, 10);\n\n return () => {\n clearTimeout(timeoutId);\n if (retryTimeoutId) clearTimeout(retryTimeoutId);\n };\n }, [map, reload]);\n\n // Cleanup on unmount only\n useEffect(() => {\n return () => {\n // This cleanup function runs on unmount\n if (serviceRef.current) {\n try {\n serviceRef.current.remove();\n } catch (err) {\n if (process.env?.NODE_ENV !== 'test') {\n console.warn('Error removing service during cleanup:', err);\n }\n }\n serviceRef.current = null;\n }\n };\n }, []); // Empty dependency array - only run cleanup on unmount\n\n return {\n service,\n loading,\n error,\n reload,\n };\n}\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useEsriService } from './useEsriService';\nimport { DynamicMapService } from '@/Services/DynamicMapService';\nimport type { UseDynamicMapServiceOptions, UseEsriServiceResult } from '../types';\nimport type { Map } from '@/types';\n\n/**\n * Hook for managing DynamicMapService lifecycle\n */\nexport function useDynamicMapService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseDynamicMapServiceOptions): UseEsriServiceResult<DynamicMapService> {\n const optionsRef = useRef(options);\n\n const createService = useCallback(\n (mapInstance: Map) => new DynamicMapService(sourceId, mapInstance, options, sourceOptions),\n [sourceId, sourceOptions] // Remove options from dependencies to prevent service recreation\n );\n\n const result = useEsriService(createService, map);\n\n // Update service options when they change\n useEffect(() => {\n if (result.service && options !== optionsRef.current && map) {\n // Add a small delay to ensure the service is fully initialized\n const timeoutId = setTimeout(() => {\n if (!result.service || !map) return;\n\n // Check for specific option changes that we can handle without recreation\n if (options.layers !== optionsRef.current.layers) {\n const layers = options.layers || [];\n if (Array.isArray(layers) || typeof layers === 'number') {\n try {\n result.service.setLayers(layers);\n } catch (error) {\n console.warn('useDynamicMapService: Error setting layers:', error);\n }\n }\n }\n\n if (options.layerDefs !== optionsRef.current.layerDefs) {\n const layerDefs = options.layerDefs || {};\n try {\n result.service.setLayerDefs(layerDefs);\n } catch (error) {\n console.warn('useDynamicMapService: Error setting layer definitions:', error);\n }\n }\n\n // Update the ref to track current options\n optionsRef.current = options;\n }, 50);\n\n return () => clearTimeout(timeoutId);\n }\n }, [result.service, options, map]);\n\n return result;\n}\n","import { useEsriService } from './useEsriService';\nimport { TiledMapService } from '@/Services/TiledMapService';\nimport type { UseTiledMapServiceOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing TiledMapService lifecycle\n */\nexport function useTiledMapService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseTiledMapServiceOptions): UseEsriServiceResult<TiledMapService> {\n return useEsriService(\n mapInstance => new TiledMapService(sourceId, mapInstance, options, sourceOptions),\n map\n );\n}\n","import { useEsriService } from './useEsriService';\nimport { ImageService } from '@/Services/ImageService';\nimport type { UseImageServiceOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing ImageService lifecycle\n */\nexport function useImageService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseImageServiceOptions): UseEsriServiceResult<ImageService> {\n return useEsriService(\n mapInstance => new ImageService(sourceId, mapInstance, options, sourceOptions),\n map\n );\n}\n","import { useEsriService } from './useEsriService';\nimport { VectorTileService } from '@/Services/VectorTileService';\nimport type { UseVectorTileServiceOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing VectorTileService lifecycle\n */\nexport function useVectorTileService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseVectorTileServiceOptions): UseEsriServiceResult<VectorTileService> {\n return useEsriService(\n mapInstance => new VectorTileService(sourceId, mapInstance, options, sourceOptions),\n map\n );\n}\n","import { useEsriService } from './useEsriService';\nimport { FeatureService } from '@/Services/FeatureService';\nimport type { UseFeatureServiceOptions, UseEsriServiceResult } from '../types';\n\n/**\n * Hook for managing FeatureService lifecycle\n */\nexport function useFeatureService({\n sourceId,\n map,\n options,\n sourceOptions,\n}: UseFeatureServiceOptions): UseEsriServiceResult<FeatureService> {\n return useEsriService(\n mapInstance => new FeatureService(sourceId, mapInstance, options, sourceOptions),\n map\n );\n}\n"],"names":["useEsriService","createService","map","service","setService","useState","loading","setLoading","error","setError","isCreatingService","useRef","serviceRef","createServiceRef","current","reload","useCallback","remove","err","process","env","NODE_ENV","console","warn","newService","Error","useEffect","retryTimeoutId","timeoutId","setTimeout","addSource","clearTimeout","useDynamicMapService","sourceId","options","sourceOptions","optionsRef","mapInstance","DynamicMapService","result","layers","Array","isArray","setLayers","layerDefs","setLayerDefs","useTiledMapService","TiledMapService","useImageService","ImageService","useVectorTileService","VectorTileService","useFeatureService","FeatureService"],"mappings":";;;AASA;;AAEG;AACG,SAAUA,cAAcA,CAC5BC,aAA8B,EAC9BC,GAAe,EAAA;EAEf,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAAW,IAAI,CAAC;EACtD,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAACG,KAAK,EAAEC,QAAQ,CAAC,GAAGJ,QAAQ,CAAe,IAAI,CAAC;AAEtD;AACA,EAAA,MAAMK,iBAAiB,GAAGC,MAAM,CAAC,KAAK,CAAC;AACv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EAAA;AACvB,EAAA,OAAOnC,cAAc,CACnBqC,WAAW,IAAI,IAAIY,YAAY,CAAChB,QAAQ,EAAEI,WAAW,EAAEH,OAAO,EAAEC,aAAa,CAAC,EAC9EjC,GAAG,CACJ;AACH;;ACbA;;AAEG;AACG,SAAUgD,oBAAoBA,CAAC;EACnCjB,QAAQ;EACR/B,GAAG;EACHgC,OAAO;AACPC,EAAAA;AAAa,CACe,EAAA;AAC5B,EAAA,OAAOnC,cAAc,CACnBqC,WAAW,IAAI,IAAIc,iBAAiB,CAAClB,QAAQ,EAAEI,WAAW,EAAEH,OAAO,EAAEC,aAAa,CAAC,EACnFjC,GAAG,CACJ;AACH;;ACbA;;AAEG;AACG,SAAUkD,iBAAiBA,CAAC;EAChCnB,QAAQ;EACR/B,GAAG;EACHgC,OAAO;AACPC,EAAAA;AAAa,CACY,EAAA;AACzB,EAAA,OAAOnC,cAAc,CACnBqC,WAAW,IAAI,IAAIgB,cAAc,CAACpB,QAAQ,EAAEI,WAAW,EAAEH,OAAO,EAAEC,aAAa,CAAC,EAChFjC,GAAG,CACJ;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- import { E as EsriServiceOptions, a as EditResult, A as ApplyEditsResult, F as FeatureServiceOptions, b as FindOptions, I as IdentifyImageOptions, c as ImageServiceOptions, V as VectorBasemapStyleOptions, d as VectorTileServiceOptions, D as DynamicMapService, T as TiledMapService, e as ImageService, f as VectorTileService, g as FeatureService } from './index-CfCttkZx.js';
1
+ import { E as EsriServiceOptions, a as EditResult, A as ApplyEditsResult, F as FeatureServiceOptions, b as FindOptions, I as IdentifyImageOptions, c as ImageServiceOptions, V as VectorBasemapStyleOptions, d as VectorTileServiceOptions, D as DynamicMapService, T as TiledMapService, e as ImageService, f as VectorTileService, g as FeatureService } from './index-DczUYC4z.js';
2
2
  import { ReactNode } from 'react';
3
3
  import { Map } from 'maplibre-gl';
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esri-gl",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "A module for making it easier to use Esri services in mapbox-gl or maplibre-gl.",
6
6
  "main": "dist/index.js",
@@ -32,9 +32,9 @@
32
32
  "build": "npm run clean && npm run type-check && rollup -c && node ./scripts/prepare-dist-package.mjs",
33
33
  "build:prod": "npm run clean && npm run type-check && npm run lint && rollup -c && node ./scripts/prepare-dist-package.mjs",
34
34
  "build:watch": "rollup -c --watch",
35
- "build:example": "vite build",
36
- "preview:example": "vite preview",
37
- "build-docs": "cd docs && npm run build",
35
+ "build:docs": "cd docs && npm run build",
36
+ "build:demo": "vite build",
37
+ "preview:demo": "vite preview",
38
38
  "dev:docs": "cd docs && npm start",
39
39
  "serve:docs": "cd docs && npm run serve",
40
40
  "clean": "rimraf dist",
@@ -84,8 +84,9 @@
84
84
  "@eslint/js": "^9.39.2",
85
85
  "@rollup/plugin-alias": "^6.0.0",
86
86
  "@rollup/plugin-babel": "^6.1.0",
87
+ "@rollup/plugin-commonjs": "^29.0.2",
87
88
  "@rollup/plugin-node-resolve": "^16.0.3",
88
- "@rollup/plugin-terser": "^0.4.4",
89
+ "@rollup/plugin-terser": "^1.0.0",
89
90
  "@rollup/plugin-typescript": "^12.3.0",
90
91
  "@testing-library/dom": "^10.4.1",
91
92
  "@testing-library/jest-dom": "^6.9.1",