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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esri-gl",
3
- "version": "1.0.6",
3
+ "version": "2.0.0",
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",
@@ -63,6 +63,10 @@
63
63
  }
64
64
  },
65
65
  "dependencies": {
66
+ "@esri/arcgis-rest-basemap-sessions": "^4.10.2",
67
+ "@esri/arcgis-rest-feature-service": "^4.10.2",
68
+ "@esri/arcgis-rest-portal": "^4.10.2",
69
+ "@esri/arcgis-rest-request": "^4.10.2",
66
70
  "@mapbox/tilebelt": "^2.0.3",
67
71
  "arcgis-pbf-parser": "^0.0.4"
68
72
  }
@@ -1,8 +1,12 @@
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
- import { Map } from 'maplibre-gl';
1
+ import { r as EsriAuthentication, a2 as PortalServiceResult, D as DynamicMapService, T as TiledMapService, g as ImageService, h as VectorTileService, i as FeatureService } from './index-Doq93o-G.js';
2
+ export { l as AGOLServiceError, A as ApplyEditsResult, m as AttachmentInfo, B as BatchLayerOperation, n as BetweenFilter, C as ComparisonFilter, o as ComparisonOp, p as DynamicLayer, a as EditResult, q as EsriAuthOptions, s as EsriDrawingInfo, t as EsriDynamicMapLayerSource, u as EsriRenderer, v as EsriRequestOptions, E as EsriServiceOptions, w as EsriTextSymbol, x as Extent, F as FeatureServiceOptions, y as FeatureSet, z as FieldInfo, G as Find, H as GroupFilter, J as IdentifyFeatures, k as IdentifyImage, c as ImageServiceOptions, K as InFilter, L as LayerFilter, M as LayerInfo, N as LayerLabelingInfo, O as LayerMetadata, Q as LayerQueryOptions, R as LayerScaleRange, S as LayerSpecification, U as LayerTimeOptions, W as LayerUpdateEvent, X as LayerUpdateType, Y as LegendInfo, Z as LogicalOp, _ as MapExportOptions, $ as NullFilter, a0 as PaginatedFeatureCollection, P as PortalItemServiceOptions, a1 as PortalRequestOptions, d as PortalResolvedService, e as PortalServiceKind, a3 as Query, a4 as RasterSourceOptions, a5 as Service, a6 as ServiceErrorEvent, a7 as ServiceEventType, a8 as ServiceMetadata, a9 as SourceSpecification, aa as StatisticResult, ab as Task, ac as TimeAnimationOptions, j as VectorBasemapStyle, V as VectorBasemapStyleOptions, ad as VectorSourceOptions, f as VectorTileServiceOptions, ae as WebMapOptions, af as cleanTrailingSlash, ag as esriRequest, ah as find, ai as getServiceDetails, aj as identifyImage, ak as query, al as resolveAuthentication, am as searchPortalItems, an as serviceFromPortalItem, ao as servicesFromWebMap, ap as updateAttribution } from './index-Doq93o-G.js';
3
+ import * as maplibre_gl from 'maplibre-gl';
3
4
  export { Map } from 'maplibre-gl';
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';
5
+ import { u as useDynamicMapService, U as UseEsriServiceResult, r as useTiledMapService, q as useImageService, s as useVectorTileService, p as useFeatureService } from './useFeatureService-CG70gjQy.js';
6
+ export { ApiKeyManager, ApplicationCredentialsManager, ArcGISAuthError, ArcGISIdentityManager, ArcGISRequestError, FieldType, GeometryType, IAuthenticationManager, ICodedValue, IDomain, IExtent, IFeature, IFeatureSet, IField, IGeometry, IHasZM, IMultipoint, IPoint, IPolygon, IPolyline, IRequestOptions, ISpatialReference, Units } from '@esri/arcgis-rest-request';
7
+ export { IAddAttachmentOptions, IAddFeaturesOptions, IAllLayersAndTablesResponse, IApplyEditsOptions, IApplyEditsResult, IAttachmentInfo, IDecodeValuesOptions, IDeleteAttachmentsOptions, IDeleteFeaturesOptions, IEditFeatureResult, IFeatureServiceDefinition, IGetAttachmentsOptions, IGetFeatureOptions, IGetLayerOptions, ILayer, ILayerDefinition, IOrderByField, IQueryAllFeaturesOptions, IQueryAllFeaturesResponse, IQueryFeaturesOptions, IQueryFeaturesResponse, IQueryRelatedOptions, IQueryRelatedResponse, IQueryResponse, IRelatedRecordGroup, IRelatedRecordsInfo, ISharedEditOptions, ISharedQueryOptions, IStatisticDefinition } from '@esri/arcgis-rest-feature-service';
8
+ export { BasemapStyleSession, IStartSessionParams, StyleFamily } from '@esri/arcgis-rest-basemap-sessions';
9
+ export { IGroup, IItem, IPagingParams, ISearchOptions, ISearchResult, IUser, SearchQueryBuilder } from '@esri/arcgis-rest-portal';
6
10
  import 'react';
7
11
 
8
12
  /**
@@ -10,17 +14,19 @@ import 'react';
10
14
  * Esri service when any defined value is passed on a layer component.
11
15
  */
12
16
  interface EsriAuthProps {
13
- /** ArcGIS token sent with every request as `token` query param */
17
+ /** ArcGIS token (sent as the `token` request parameter) */
14
18
  token?: string;
15
- /** ArcGIS API key sent via `X-Esri-Authorization` header */
19
+ /** ArcGIS Location Platform API key (sent as the `token` parameter) */
16
20
  apiKey?: string;
17
- /** Proxy URL or flag forwarded to the service */
21
+ /** ArcGIS REST JS authentication manager (preferred for OAuth/user sign-in) */
22
+ authentication?: EsriAuthentication;
23
+ /** @deprecated No longer applied. */
18
24
  proxy?: string | boolean;
19
25
  /** Whether to fetch and apply service attribution (default true in services) */
20
26
  getAttributionFromService?: boolean;
21
27
  /** Extra request params merged into every service request */
22
28
  requestParams?: Record<string, unknown>;
23
- /** Extra fetch options used by the service */
29
+ /** @deprecated No longer forwarded to requests; use `authentication`. */
24
30
  fetchOptions?: RequestInit;
25
31
  }
26
32
  interface EsriLayerBaseProps extends EsriAuthProps {
@@ -51,7 +57,14 @@ interface EsriVectorTileLayerProps extends EsriLayerBaseProps {
51
57
  }
52
58
  interface EsriVectorBasemapLayerProps extends EsriLayerBaseProps {
53
59
  basemapEnum: string;
54
- token: string;
60
+ /** OAuth / user token (v2 host). Provide `token` or `apiKey`. */
61
+ token?: string;
62
+ /** ArcGIS Location Platform API key (v1 host). Provide `token` or `apiKey`. */
63
+ apiKey?: string;
64
+ /** Optional locale for the basemap labels. */
65
+ language?: string;
66
+ /** Optional worldview. */
67
+ worldview?: string;
55
68
  }
56
69
  interface EsriFeatureLayerProps extends EsriLayerBaseProps {
57
70
  url: string;
@@ -61,6 +74,16 @@ interface EsriFeatureLayerProps extends EsriLayerBaseProps {
61
74
  paint?: Record<string, unknown>;
62
75
  layout?: Record<string, unknown>;
63
76
  }
77
+ interface EsriPortalLayerProps extends EsriLayerBaseProps {
78
+ /** ArcGIS portal item id to resolve to a service. */
79
+ itemId: string;
80
+ /** For multi-layer Feature Services, which sublayer to load (default 0). */
81
+ layerId?: number;
82
+ /** Portal sharing REST URL (defaults to ArcGIS Online). */
83
+ portal?: string;
84
+ /** Called once the item resolves, with the resolved service/kind/url/title. */
85
+ onResolve?: (result: PortalServiceResult) => void;
86
+ }
64
87
 
65
88
  /**
66
89
  * React Map GL component for Esri Dynamic Map Service
@@ -92,11 +115,17 @@ declare function EsriVectorBasemapLayer(props: EsriVectorBasemapLayerProps): nul
92
115
  */
93
116
  declare function EsriFeatureLayer(props: EsriFeatureLayerProps): null;
94
117
 
118
+ /**
119
+ * React Map GL component that resolves an ArcGIS portal item id to the matching
120
+ * esri-gl service and adds a renderer-appropriate layer for it.
121
+ */
122
+ declare function EsriPortalLayer(props: EsriPortalLayerProps): null;
123
+
95
124
  /**
96
125
  * Hook for using Esri services with Mapbox GL JS (via react-map-gl)
97
126
  */
98
127
  declare function useEsriMapboxLayer(): {
99
- map: Map | null;
128
+ map: maplibre_gl.Map | undefined;
100
129
  useDynamicMapService: (options: Parameters<typeof useDynamicMapService>[0]) => UseEsriServiceResult<DynamicMapService>;
101
130
  useTiledMapService: (options: Parameters<typeof useTiledMapService>[0]) => UseEsriServiceResult<TiledMapService>;
102
131
  useImageService: (options: Parameters<typeof useImageService>[0]) => UseEsriServiceResult<ImageService>;
@@ -108,7 +137,7 @@ declare function useEsriMapboxLayer(): {
108
137
  * Hook for using Esri services with MapLibre GL JS (via react-map-gl/maplibre)
109
138
  */
110
139
  declare function useEsriMaplibreLayer(): {
111
- map: Map | null;
140
+ map: maplibre_gl.Map | undefined;
112
141
  useDynamicMapService: (options: Parameters<typeof useDynamicMapService>[0]) => UseEsriServiceResult<DynamicMapService>;
113
142
  useTiledMapService: (options: Parameters<typeof useTiledMapService>[0]) => UseEsriServiceResult<TiledMapService>;
114
143
  useImageService: (options: Parameters<typeof useImageService>[0]) => UseEsriServiceResult<ImageService>;
@@ -116,5 +145,5 @@ declare function useEsriMaplibreLayer(): {
116
145
  useFeatureService: (options: Parameters<typeof useFeatureService>[0]) => UseEsriServiceResult<FeatureService>;
117
146
  };
118
147
 
119
- export { DynamicMapService, EsriDynamicLayer, EsriFeatureLayer, EsriImageLayer, EsriTiledLayer, EsriVectorBasemapLayer, EsriVectorTileLayer, FeatureService, ImageService, TiledMapService, VectorTileService, useEsriMapboxLayer, useEsriMaplibreLayer };
120
- export type { EsriDynamicLayerProps as ReactMapGLEsriDynamicLayerProps, EsriFeatureLayerProps as ReactMapGLEsriFeatureLayerProps, EsriImageLayerProps as ReactMapGLEsriImageLayerProps, EsriTiledLayerProps as ReactMapGLEsriTiledLayerProps, EsriVectorBasemapLayerProps as ReactMapGLEsriVectorBasemapLayerProps, EsriVectorTileLayerProps as ReactMapGLEsriVectorTileLayerProps };
148
+ export { DynamicMapService, EsriAuthentication, EsriDynamicLayer, EsriFeatureLayer, EsriImageLayer, EsriPortalLayer, EsriTiledLayer, EsriVectorBasemapLayer, EsriVectorTileLayer, FeatureService, ImageService, PortalServiceResult, TiledMapService, VectorTileService, useEsriMapboxLayer, useEsriMaplibreLayer };
149
+ export type { EsriDynamicLayerProps as ReactMapGLEsriDynamicLayerProps, EsriFeatureLayerProps as ReactMapGLEsriFeatureLayerProps, EsriImageLayerProps as ReactMapGLEsriImageLayerProps, EsriPortalLayerProps as ReactMapGLEsriPortalLayerProps, EsriTiledLayerProps as ReactMapGLEsriTiledLayerProps, EsriVectorBasemapLayerProps as ReactMapGLEsriVectorBasemapLayerProps, EsriVectorTileLayerProps as ReactMapGLEsriVectorTileLayerProps };