3rd-Party Plugins

Leaflet

Leaflet is an open-source JavaScript library for mobile-friendly interactive maps. It supports Map, TileLayer, Marker, Popup, Polyline, Polygon, and more.

Installation

Leaflet is installed via NPM as a third-party dependency by referring to package.json. During the Theme Installation process, it is compiled by the Build Tools into the /dist/assets/vendors/leaflet directory (leaflet.bundle.css and leaflet.bundle.js). Optionally, esri-leaflet and esri-leaflet-geocoder are included in the same bundle for geocoding.

Require Assets

To use Leaflet in your pages, include the following CSS and script in the order shown.
				
					<!DOCTYPE html>
<html>
 <head>
  <!--Vendor styles -->
  <link href="/dist/assets/vendors/leaflet/leaflet.bundle.css" rel="stylesheet"/>
  <!--Core styles-->
  <link href="/dist/assets/css/styles.css" rel="stylesheet"/>
 </head>
 <body>
  <div id="map" style="height: 400px;">
  </div>
  <!--Core bundle script-->
  <script src="/dist/assets/js/core.bundle.js">
  </script>
  <!--Vendor script -->
  <script src="/dist/assets/vendors/leaflet/leaflet.bundle.js">
  </script>
  <!--Custom script -->
  <script src="/dist/assets/pages/plugins/leaflet/basic-map.js">
  </script>
 </body>
</html>

				
			

Basic Map

A simple Leaflet map with a tile layer (OpenStreetMap), center, and zoom. Uses L.map, L.tileLayer per the Leaflet API reference.

Markers and Popups

Markers with popups using L.marker and bindPopup. Optional custom icon via L.divIcon.

Polylines and Polygons

Vector layers using L.polyline and L.polygon per the Leaflet API reference.