File: index.html

package info (click to toggle)
libapache2-mod-tile 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,872 kB
  • sloc: cpp: 18,151; ansic: 7,574; sh: 980; makefile: 163; xml: 27
file content (57 lines) | stat: -rw-r--r-- 1,522 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!doctype html>
<html>
  <head>
    <title>renderd example map</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="icon" href="data:;base64,iVBORw0KGgo=" />
    <link rel="stylesheet" href="leaflet/leaflet.css" />
    <script src="leaflet/leaflet.min.js"></script>
  </head>

  <body style="margin: 0">
    <div id="map" style="position: absolute; width: 100%; height: 100%"></div>

    <script>
      var attribution =
        'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors.';
      var options = {
        maxZoom: 20,
        attribution: attribution,
      };

      var png = L.tileLayer(
        "http://localhost:8081/tiles/renderd-example/{z}/{x}/{y}.png",
        options,
      );

      var jpg = L.tileLayer(
        "http://localhost:8081/tiles/renderd-example-jpg/{z}/{x}/{y}.jpg",
        options,
      );
      var png32 = L.tileLayer(
        "http://localhost:8081/tiles/renderd-example-png32/{z}/{x}/{y}.png",
        options,
      );
      var webp = L.tileLayer(
        "http://localhost:8081/tiles/renderd-example-webp/{z}/{x}/{y}.webp",
        options,
      );

      var map = L.map("map", {
        center: [0, 0],
        zoom: 4,
        layers: [png],
      });

      var baseMaps = {
        JPG: jpg,
        PNG: png,
        PNG32: png32,
        WEBP: webp,
      };

      var layerControl = L.control.layers(baseMaps).addTo(map);
    </script>
  </body>
</html>