npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

esri-gl

v1.0.5

Published

A module for making it easier to use Esri services in mapbox-gl or maplibre-gl.

Readme

esri-gl

A TypeScript library that bridges Esri ArcGIS REST services with MapLibre GL JS and Mapbox GL JS.

npm version CI TypeScript License: MIT Documentation · Live Demos · npm

Features

Services

  • DynamicMapService — Server-rendered raster tiles with dynamic styling, filtering, labeling, and identify
  • TiledMapService — Pre-cached tiles for fast basemaps
  • ImageService — Analytical raster data with rendering rules and temporal support
  • FeatureService — Vector data with smart vector tile detection, GeoJSON fallback, editing, and attachments
  • VectorTileService — Client-rendered vector tiles
  • VectorBasemapStyle — Esri's professional basemap styles

Tasks

  • IdentifyFeatures / IdentifyImage — Query features and pixel values at map locations
  • Query — Spatial and attribute queries with automatic pagination
  • Find — Text-based feature search across layers

Integrations

  • React HooksuseDynamicMapService, useFeatureService, useQuery, etc.
  • react-map-gl — Declarative <EsriDynamicLayer>, <EsriFeatureLayer>, etc.
  • TypeScript — Full type safety with comprehensive interfaces

Installation

npm install esri-gl

Entry Points

| Import | Use Case | |--------|----------| | esri-gl | Core services and tasks | | esri-gl/react | React hooks | | esri-gl/react-map-gl | react-map-gl components |

CDN (UMD)

<script src="https://unpkg.com/esri-gl@latest/dist/index.umd.js"></script>
<script>
  const service = new esrigl.DynamicMapService('source', map, { url: '...' });
</script>

Quick Start

import { DynamicMapService } from 'esri-gl';

const map = new maplibregl.Map({
  container: 'map',
  style: 'https://demotiles.maplibre.org/style.json',
  center: [-95, 37],
  zoom: 4
});

map.on('load', () => {
  const service = new DynamicMapService('usa-source', map, {
    url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer',
    layers: [0, 1, 2],
    transparent: true
  });

  map.addLayer({ id: 'usa-layer', type: 'raster', source: 'usa-source' });
});

Service Examples

FeatureService

const service = new FeatureService('features-source', map, {
  url: 'https://services.arcgis.com/.../FeatureServer/0',
  where: "STATUS = 'Active'",
  outFields: 'NAME,STATUS',
  token: 'your-token' // optional
});

map.addLayer({
  id: 'features-layer',
  type: 'circle',
  source: 'features-source',
  paint: { 'circle-radius': 5, 'circle-color': '#007cbf' }
});

// Edit features
await service.addFeatures([feature]);
await service.applyEdits({ adds: [], updates: [], deletes: [1, 2] });

ImageService

const service = new ImageService('landsat-source', map, {
  url: 'https://landsat2.arcgis.com/arcgis/rest/services/Landsat/MS/ImageServer',
  renderingRule: { rasterFunction: 'Natural Color' }
});

VectorBasemapStyle

VectorBasemapStyle.applyStyle(map, 'arcgis/streets', { apiKey: 'YOUR_KEY' });

Tasks

import { IdentifyFeatures, query } from 'esri-gl';

// Identify features at a point
const results = await new IdentifyFeatures('https://.../MapServer')
  .at({ lng: -95, lat: 37 })
  .on(map)
  .layers('all')
  .tolerance(5)
  .run();

// Query with pagination
const all = await query({ url: 'https://.../FeatureServer/0' })
  .where("STATE_NAME = 'California'")
  .runAll();

React Integration

Hooks

import { useDynamicMapService, useIdentifyFeatures } from 'esri-gl/react';

const { service, loading, error } = useDynamicMapService({
  sourceId: 'usa-service',
  map,
  options: {
    url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer',
    layers: [0, 1, 2]
  }
});

react-map-gl Components

import { EsriDynamicLayer, EsriFeatureLayer } from 'esri-gl/react-map-gl';

<Map mapStyle="mapbox://styles/mapbox/streets-v11">
  <EsriDynamicLayer
    id="census"
    url="https://.../Census/MapServer"
    layers={[0, 1]}
    opacity={0.8}
  />
  <EsriFeatureLayer
    id="states"
    url="https://.../FeatureServer/0"
    paint={{ 'fill-color': '#627BC1', 'fill-opacity': 0.6 }}
  />
</Map>

Examples

Working examples in examples/:

| Example | Description | |---------|-------------| | maplibre-esm | All services and tasks with vanilla MapLibre | | maplibre-react-hooks | React hooks with MapLibre | | maplibre-react-map-gl | react-map-gl components |

cd examples/maplibre-esm && npm install && npm run dev

Development

npm run dev          # Start demo dev server
npm run build        # Build library (ESM + UMD)
npm run test         # Run tests (727 tests, 31 suites)
npm run type-check   # TypeScript check
npm run lint         # ESLint
npm run build:docs   # Build documentation site
npm run build:demo   # Build demo site

Contributing

  1. Fork and create a feature branch
  2. Make changes and add tests
  3. Run npm run test && npm run type-check && npm run lint
  4. Submit a pull request

Pre-commit hooks automatically run formatting, linting, and tests via Husky.

Support

License

MIT — see LICENSE

Acknowledgements