Documentation
A TypeScript library that bridges Esri ArcGIS REST services with MapLibre GL JS and Mapbox GL JS, replicating Esri Leaflet's architecture patterns.
Quick Start
esri-gl helps you create sources for use within MapLibre GL JS and Mapbox GL JS. It supports a range of raster and vector datasources provided by the Esri/ArcGIS ecosystem.
Installation
npm install esri-gl
Basic Usage
Import the desired service class and create sources that are automatically added to your map:
import { DynamicMapService } from 'esri-gl';
// Create the source
new DynamicMapService('usa-source', map, {
url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer',
});
// Add it as a layer to your map
map.addLayer({
id: 'usa-layer',
type: 'raster',
source: 'usa-source',
});
CDN Usage
Load the package via CDN:
<script src="https://unpkg.com/esri-gl/dist/esri-gl.js"></script>
new DynamicMapService('usa-source', map, {
url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer',
});
map.addLayer({
id: 'usa-layer',
type: 'raster',
source: 'usa-source',
});
What's Next?
- 📚 Learn about Services - Core service classes
- 🎯 Explore Examples - Interactive demos
- 🔧 API Reference - Detailed documentation