-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.html
55 lines (52 loc) · 2.74 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
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1;" />
<title>Leaflet Basemaps Control</title>
<link rel="stylesheet" href="//unpkg.com/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="L.Control.Basemaps.css" />
</head>
<body>
<script src="//unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="L.Control.Basemaps.js"></script>
<div id="map" style="position: absolute; top: 0; left:0; bottom:0; right: 0;"></div>
<script>
var map = L.map("map").setView([44.07, -118.78], 5);
var basemaps = [
L.tileLayer("//stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png", {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
subdomains: "abcd",
maxZoom: 20,
minZoom: 0,
label: "Toner Lite"
}),
L.tileLayer("//stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png", {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
subdomains: "abcd",
maxZoom: 20,
minZoom: 0,
label: "Toner"
}),
L.tileLayer("//stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png", {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
subdomains: "abcd",
maxZoom: 16,
minZoom: 1,
label: "Watercolor"
})
];
map.addControl(
L.control.basemaps({
basemaps: basemaps,
tileX: 0,
tileY: 0,
tileZ: 1
})
);
</script>
</body>
</html>