Get started with esri-leaflet-renderers CDN

Apache-2.0 licensed

Esri-Leaflet-Renderers: library for Esri symbology in Leaflet maps.

Tags:
  • arcgis
  • esri
  • esri leaflet
  • gis
  • leaflet plugin
  • mapping
  • renderers
  • symbology

Stable version

Copied!

How to start using esri-leaflet-renderers CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with esri-leaflet-renderers CDN - cdnhub.io</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/1.7.1/leaflet.css"/>
  <script src="https://cdn.jsdelivr.net/leaflet/1.7.1/leaflet.js"></script>
  <script src="https://cdn.cdnhub.io/esri-leaflet-renderers/3.0.1/esri-leaflet-renderers.js"></script>
  <style>
    #map { height: 400px; width: 100%; }
  </style>
</head>
<body>
  <div id="map"></div>
  <script>
    const map = L.map('map').setView([51.505, -0.09], 13);

    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
      attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
      maxZoom: 19
    }).addTo(map);

    const esriChoroplethProvider = new L.Esri.ChoroplethProvider({
      url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Cities/MapServer'
    });

    const choroplethLayer = L.choropleth(esriChoroplethProvider, {
      opacity: 0.5,
      valueProperty: 'Pop_est'
    }).addTo(map);

    map.fitBounds(choroplethLayer.getBounds());
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions