Quickstart Guide to Leaflet

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>Quickstart Guide to Leaflet</title>
    <style>
      html, body, #map-view-div {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }
    </style>
    <link rel="stylesheet" href="/my-content/libs/leaflet/leaflet.css" />
    <!-- https://unpkg.com/leaflet@1.9.4/dist/leaflet.css -->
    <script src="/my-content/libs/leaflet/leaflet.js"></script>
    <!-- https://unpkg.com/leaflet@1.9.4/dist/leaflet.js -->
  </head>
  <body>
    <div id="map-view-div"></div>
    <script>
      const map = L.map("map-view-div").setView([54.6872, 25.2797], 15);
      const tileLayer = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 19
      }).addTo(map);
    </script>
  </body>
</html>

Leave a Comment