Get started with Leaflet.awesome-markers CDN

MIT licensed

Leaflet.awesome-markers is a plugin that adds custom, beautiful icons to Leaflet.js maps.

Tags:
  • leaflet
  • retina

Stable version

Copied!

How to start using Leaflet.awesome-markers CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with Leaflet.awesome-markers 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/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.min.js"></script>
  <style>
    #mapid { height: 400px; width: 100%; }
  </style>
</head>
<body>
  <div id="mapid"></div>
  <script>
    const mymap = L.map('mapid').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/">OpenStreetMap</a> contributors',
      maxZoom: 19
    }).addTo(mymap);

    L.awesomeMarkers.icon({
      icon: 'fa-map-marker-alt',
      markerColor: 'red'
    }).addTo(mymap);

    L.marker([51.5, -0.09], { icon: L.awesomeMarkers.icon({ icon: 'fa-map-marker-alt', markerColor: 'red' }) }).addTo(mymap)
      .bindPopup('A beautiful place!')
      .openPopup();
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions