JavaScript Libraries

How to use Esri Leaflet with modern JavaScript libraries and frameworks.

Introduction

Leaflet and Esri Leaflet can be used with all the modern JavaScript libraries like React, Svelte, Vue, and Angular. In general, you'll use the functionality in your framework to get a reference to a DOM Node. For example, refs in React or the use: directive in Svelte. Then you can import Leaflet and Esri Leaflet using modern ES6 style imports:

import { Map as LeafletMap, Icon, Marker } from "leaflet";
import { FeatureLayer } from "esri-leaflet";

... and use these just as you normally would.

Resources

There are a variety of helper libraries and examples helping you to use Esri Leaflet with the latest JavaScript libraries and frameworks:

Edit this page on GitHub