leaflet-deepzoom

Leaflet-DeepZoom

npm version license: MIT

Display DeepZoom (DZI) image tiles with Leaflet.
Originally based on Leaflet.Zoomify.


πŸš€ Features


πŸ“¦ Installation

Using npm:

npm install leaflet-deepzoom

Using CDN (for quick demo or CodePen):

<script src="https://unpkg.com/leaflet-deepzoom@latest/leaflet-deepzoom.js"></script>

πŸ—ΊοΈ Example

Live demo: πŸ‘‰ https://alfarisi.github.io/leaflet-deepzoom/example/

Basic example:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>Leaflet DeepZoom Example</title>
  <link
    rel="stylesheet"
    href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
  />
  <style>
    #map { height: 100vh; }
  </style>
</head>
<body>
  <div id="map"></div>

  <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
  <script src="https://unpkg.com/leaflet-deepzoom@latest/leaflet-deepzoom.js"></script>
  <script>
    const map = L.map('map').setView([0, 0], 0);

    var dzLayer = L.tileLayer.deepzoom('DeepZoomImage/hubble_files/', {
      width: 2400,
      height: 3000,
      overlap: 1
    }).addTo(map);

    map.fitBounds(dzLayer.options.bounds);
  </script>
</body>
</html>

βš™οΈ Compatibility

Leaflet Version Plugin Version
1.2.0 and later 2.x
0.7.x 1.x (legacy)

πŸ“„ License

Released under the MIT License.