M
MapLibre ArcGIS
Esri's plugin for ArcGIS services
Maintained by Esri
Esri's official MapLibre GL JS plugin for ArcGIS: basemap styles, hosted vector tile layers and feature layers, with the attribution ArcGIS data requires.
Live demo
MapLibre ArcGIS running on MapLibre GL JS in your browser
Loading the map…
Demo code
import { FeatureLayer } from "@esri/maplibre-arcgis";
import type { PluginDemo } from "../types";
export default {
center: [-118.805, 34.027], // Santa Monica Mountains
zoom: 12,
async run({ map, maplibregl }) {
// The plugin adds its own "Powered by Esri" attribution, and refuses to load next to a
// customized one, so take the demo's attribution control off first.
const attribution = map._controls.find(
(control) => control instanceof maplibregl.AttributionControl,
);
if (attribution) map.removeControl(attribution);
// A public ArcGIS feature service (Esri's tutorial trails): no API key needed.
const trails = await FeatureLayer.fromUrl(
"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails/FeatureServer/0",
);
// The plugin turns the service into GeoJSON sources and styled layers.
trails.addSourcesAndLayersTo(map);
},
} satisfies PluginDemo;