Skip to main content

Service sources

@loaders.gl/arcgis

Use layers already published in ArcGIS Online or Enterprise in your own application. Connect to the service, authorize access, and request features, imagery, tiles, or scenes without exporting your data.

ArcGIS feature service example

Remote data, explicit steps

Discover once. Request only what the application needs.

Service sources keep endpoint metadata, request construction, and decoded results separate. That makes a remote dataset behave like a predictable part of the data path.

01 · discover

ArcGIS REST endpoint

A service directory exposes layers, operations, and formats.

FeatureServerImageServerSceneServer

02 · request

Request the useful subset

Choose features, images, tiles, or scene content for this view.

wherebboxoutFieldssize

03 · application result

VectorSource · ImageSource · Tileset3DSource

The application receives a source contract rather than a vendor-specific client. ↗

The source owns protocol details; the application owns how returned features, pixels, tiles, or tables are used.

If your data is already in ArcGIS, start with its item page or REST service URL. You can query a feature layer, display a published map, read imagery values, or connect to vector tiles and scenes. Your data stays in ArcGIS; loaders.gl reads the subset your application requests.

Use async createDataSource() to create a source. Feature, image and tile sources can feed deck.gl's SourceLayer; SceneServer needs a compatible I3S rendering path. Existing ArcGIS sharing and service permissions continue to apply.

OGC protocols such as WMS, WMTS, WFS, WCS, CSW, GML, and OGC API remain in @loaders.gl/ogc/wms. Keeping the protocol implementations in their owning modules lets applications install only the service families they use.

The service path

Treat remote services like data sources.

Discover the endpoint, request the useful subset, and hand the result to application code or a renderer without coupling that code to one service vendor.

Discover

Identify service capabilities and available layers

Request

Ask for features, images, tiles, or scene content

Normalize

Use vector, raster, tile, or tileset source contracts

Render

Connect visual results to deck.gl SourceLayer when useful

Detailed guide

Service sources and integration details

The reference below covers supported ArcGIS services, installation, source construction, authentication, capability discovery, and deck.gl integration.

Read the ArcGIS developer guide, authentication recipes, and examples gallery. The complete service inventory includes unsupported operations and service families.

The root exports lightweight service loaders. Authentication and discovery have dedicated /authentication and /discovery entrypoints. Async load() imports the selected implementation. For synchronous createDataSourceSync() or direct source classes, use @loaders.gl/arcgis/bundled; see import patterns.

Start with your published data​

What you already haveChoose this pathProtocol and feature card
A hosted feature layer, layer view, or queryable tableCopy the layer REST URL and query featuresFeatureServer
A tiled map or map image layerRead its cache or request server-rendered map imagesMapServer
An imagery layerChoose rendered imagery or numerical LERC pixels; tile exports are a separate sourceImageServer
A vector tile layerRead MVT tiles and apply your application's stylingVectorTileServer
A scene layerChoose an explicit scene layer and inspect its I3S profileSceneServer
An item ID or an item page URLResolve the portal item, then select a service layerItem resolution does not reproduce a complete web map

Use the service URL from the item's details or ArcGIS Services Directory, not the address of Map Viewer. For a feature service with several layers or tables, select the intended layer ID rather than assuming it is 0. A hosted layer view may expose different fields and filters from its source layer. Begin with the user guide for a complete example.

Service support​

ServiceSource loaderRuntime contractPrimary outputdeck.glDocumentation
ArcGIS FeatureServerArcGISFeatureServerLoaderVectorSourceComplete bounded GeoJSON, binary or Arrow queries; explicit page APISourceLayerFeatureServer
ArcGIS ImageServerArcGISImageServerLoaderImageSourceRendered image or decoded LERC rasterSourceLayer for rendered imagesImageServer
ArcGIS ImageServer tilesArcGISImageTileLoaderTileSourceImage tiles or decoded LERC tilesSourceLayer for image tilesImageServer
ArcGIS MapServerArcGISMapTileLoaderTileSourceCached or dynamically exported image tilesSourceLayerMapServer
ArcGIS VectorTileServerArcGISVectorTileServerLoaderVectorTileSourceRaw MVT or decoded WGS84 featuresSourceLayerVectorTileServer
ArcGIS SceneServerArcGISSceneServerLoaderTileset3DSource or PointCloudTilesetSourceI3S mesh, Point, or Point Cloud tilesApplication-specific 3D rendererSceneServer
ArcGIS service directoryCapability graph utilitiesDiscovery graphFirst matching service endpointNot directly visualCapability discovery

Installation​

npm install @loaders.gl/core @loaders.gl/arcgis

Install @loaders.gl/deck-layers and deck.gl when a service should be rendered directly.

One registry, three entry points​

ARCGIS_LOADERS is the recommended registry for applications that may receive more than one ArcGIS service type. URL detection handles conventional ArcGIS REST endpoint names. Use core.type when a proxy or rewritten URL hides the service type.

Load a service​

For a SourceLoader, load returns a source object rather than downloading an entire service:

import {load} from '@loaders.gl/core';
import {ARCGIS_LOADERS} from '@loaders.gl/arcgis';

const source = await load(serviceUrl, ARCGIS_LOADERS);
const metadata = await source.getMetadata();

Create a typed source​

Use load when the application already knows the service type:

import {createDataSource} from '@loaders.gl/core';
import {ArcGISFeatureServerLoader} from '@loaders.gl/arcgis';

const source = await createDataSource(serviceUrl, [ArcGISFeatureServerLoader]);
const features = await source.getFeatures({
layers: ['0'],
boundingBox: [[-123, 37], [-121, 39]]
});

Render through deck.gl​

SourceLayer resolves the source and dispatches it to the appropriate image, vector, image-tile, or vector-tile renderer. No ArcGIS-specific deck.gl layer is required.

import {SourceLayer} from '@loaders.gl/deck-layers';
import {ARCGIS_LOADERS} from '@loaders.gl/arcgis';

const layer = new SourceLayer({
id: 'city-service',
data: serviceUrl,
loaders: ARCGIS_LOADERS,
extent: [-180, -85.051129, 180, 85.051129],
crs: 'EPSG:4326',
requestCrs: 'EPSG:4326',
layers: ['0'],
pickable: true
});

SourceLayer is intended for visual sources. Catalogs and analytical LERC rasters remain data objects until the application chooses a record, band, color ramp, and NoData treatment.

Authentication and practical setup​

A service that works while you are signed in to ArcGIS may still require credentials in your application. Use anonymous access for public data, an application-managed user session for organizational content, or your organization's backend/proxy flow. API keys are appropriate only for resources and privileges that support them; they do not replace a user's private-data access. The authentication guide covers token callbacks, ArcGIS REST JS sessions, refresh, and Enterprise deployments.

Use ArcGISAuthentication to scope a token to the exact ArcGIS Online, Enterprise, or proxy origin. The credential follows metadata, feature, image, tile, and deck.gl requests:

import {ArcGISAuthentication} from '@loaders.gl/arcgis/authentication';

const source = await load(serviceUrl, ARCGIS_LOADERS, {
core: {
credentials: [
new ArcGISAuthentication({origins: [new URL(serviceUrl).origin], token})
]
}
});

ArcGIS tokens already present in a service URL are preserved and take precedence. Bearer headers, cookies, cancellation, proxies, and custom transports continue to use standard loaders.gl fetch options. Async token callbacks support one deduplicated refresh after 401, 403, 498, or 499. See the authentication guide for the common model and security boundaries.

authentication.createFetch() supplies a shared transport for item resolution, discovery and service requests, with refresh tokens isolated per trusted origin. Sign-in and session lifecycle stay in the application; the ArcGIS package has no Esri SDK dependency. See the ArcGIS authentication guide for session integration.

Service-specific options can add ArcGIS request parameters without bypassing the source API. See the individual service pages for the supported option names.

Before connecting your application​

TaskPractical checkArcGIS documentation
Find the right data URLSelect the actual layer/table endpoint and inspect its metadata with f=pjsonWorking with data services
Confirm accessCheck item sharing and service privileges with the identity your application will useShare items
Choose sign-inRegister your application and use a flow suitable for Online or your Enterprise portalAuthentication types · User authentication flows
Allow browser requestsTest from the deployed application origin; configure CORS or an approved proxyArcGIS Server cross-domain requests
Retrieve the intended recordsApply filters and fields; respect service page limits and inspect completenessFeature query parameters
Preserve map meaningCheck CRS, scale/time settings, attribution and item usage terms; reproduce client styling explicitlyService metadata

Feature pagination is automatic within a bounded query. getFeatures() throws if the result cannot be established as complete; queryFeatures() exposes completion and partial-result reasons. Narrow the query or deliberately configure maxFeatures rather than assuming one response contains all records. See pagination and completeness.

For viewport updates, debounce requests and cancel obsolete work with AbortSignal. Test a secured layer, token expiry and follow-up tile/scene resources from your production origin. A successful metadata request alone does not verify an entire service workflow. The troubleshooting guide covers common symptoms.

Capability discovery​

Applications can discover an ArcGIS REST directory and select its services by kind, format, and coordinate system. Discovery is optional: direct source construction is simpler when the endpoint is already known.

import {ARCGIS_LOADERS} from '@loaders.gl/arcgis';
import {discoverArcGISCapabilities, selectArcGISService} from '@loaders.gl/arcgis/discovery';
import {load} from '@loaders.gl/core';

const graph = await discoverArcGISCapabilities('https://example.com/arcgis/rest/services');
const imagery = graph && selectArcGISService(graph, {kind: 'image', format: 'lerc'});
const source = imagery && await load(imagery.url, ARCGIS_LOADERS, {
core: {type: imagery.capabilities.type}
});

Discovery performs one metadata request per discovered service. Pass a custom fetch function when using authentication, a proxy, or a test transport.

SceneServer layers​

ArcGISSceneServerSource provides a thin service facade for explicit I3S SceneServer layer endpoints. It normalizes layer metadata and delegates traversal and decoding to the existing I3S mesh, Point, or Point Cloud source.

import {ArcGISSceneServerSource} from '@loaders.gl/arcgis/bundled';
import {coreApi} from '@loaders.gl/core';

const service = new ArcGISSceneServerSource(
'https://example.com/arcgis/rest/services/City/SceneServer/layers/0',
{'arcgis-scene-server': {token: 'secret'}},
coreApi
);

const metadata = await service.getMetadata();
const tilesetSource = await service.getTilesetSource();

For a URL ending at /SceneServer, provide arcgis-scene-server.layerId. Mesh, Point, and Point Cloud profiles are selected automatically.

The facade also exposes query(options) / getFeatures(options) for read-only SceneServer layer queries and preserves the raw response metadata. Use aggregateArcGISSceneFeatures for local group-by and numeric aggregation. Renderer and popup expressions are preserved as metadata and remain the responsibility of the consuming renderer.

Choosing a service​

NeedRecommended source
Query individual vector features and propertiesFeatureServer
Display server-rendered analytical imageryImageServer
Analyze pixel values, bands, masks, or statisticsImageServer with LERC
Display a cached ArcGIS basemapMapServer
Display a dynamic MapServer as tilesMapServer in dynamic mode
Decode and style ArcGIS-hosted vector tilesVectorTileServer
Select among many ArcGIS endpointsCapability discovery, then a concrete source

Design boundaries​

  • Sources are read-only clients. Editing, transactions, and administrative ArcGIS APIs are out of scope.
  • Service metadata is normalized for cross-provider use while provider-specific metadata remains available from the concrete source.
  • Reprojection-aware metadata and tile grids are exposed, but loaders.gl does not silently resample analytical raster values.
  • LERC decoding preserves typed arrays, masks, NoData values, and statistics. Visualization remains explicit because a scientifically correct color mapping is application-specific.

Portal items​

Use resolveArcGISItem from @loaders.gl/arcgis/items to resolve service-backed portal items into explicit layer/table choices. See the item guide and embedded example for supported item types, metadata, authentication and deployment verification.

Sources and credits​

See the package source and license inventory and the project-wide Attributions and Credits.

Format guides​

Package exports​

All exported subpaths (16)

These are the package's public exports, including format entry points, parsers, writers, sources, and worker assets.

FormatImport subpath
@loaders.gl/arcgis/arcgis-feature-server-loader
@loaders.gl/arcgis/arcgis-image-server-loader
@loaders.gl/arcgis/arcgis-image-tile-loader
@loaders.gl/arcgis/arcgis-map-tile-loader
@loaders.gl/arcgis/arcgis-scene-server-loader
@loaders.gl/arcgis/arcgis-vector-tile-server-loader
@loaders.gl/arcgis/authentication
@loaders.gl/arcgis/bundled
@loaders.gl/arcgis/discovery
@loaders.gl/arcgis/feature-service
@loaders.gl/arcgis/image-service
@loaders.gl/arcgis/items
@loaders.gl/arcgis/map-service
@loaders.gl/arcgis/scene-aggregation
@loaders.gl/arcgis/scene-service
@loaders.gl/arcgis/vector-tile-service