-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
44 lines (41 loc) · 1.48 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>leaflet-tilelayer-mask</title>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="leaflet-tilelayer-mask.js"></script>
</head>
<body>
<div id="map" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0"></div>
<script>
var map = L.map("map", {
zoom: 15,
center: [35.6323, 139.768815],
maxZoom: 15,
minZoom: 8,
});
map.zoomControl.setPosition("bottomright");
map.attributionControl.addAttribution(
"<a href='https://github.com/frogcat/leaflet-tilelayer-mask'>fork me on GitHub</a>"
);
L.tileLayer("https://cyberjapandata.gsi.go.jp/xyz/seamlessphoto/{z}/{x}/{y}.jpg", {
attribution:
'<a href="https://maps.gsi.go.jp/development/ichiran.html">GSI seamlessphoto</a>',
}).addTo(map);
var mask = L.tileLayer
.mask("https://habs.rad.naro.go.jp/rapid16/{z}/{x}/{y}.png", {
attribution: '<a href="https://habs.rad.naro.go.jp/">NARO/農研機構農業環境研究部門</a>',
maskSize: 512,
maxZoom: 15,
tms: true,
})
.addTo(map);
map.on("mousemove", function (e) {
mask.setCenter(e.containerPoint);
});
</script>
</body>
</html>