-
Notifications
You must be signed in to change notification settings - Fork 1
/
leaflet-layers.html
37 lines (31 loc) · 1.43 KB
/
leaflet-layers.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
<!doctype html>
<html>
<head>
<title>Leaflet Layers</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.css">
<script src="http://cdn.leafletjs.com/leaflet-0.4/leaflet.js"></script>
<link rel="stylesheet" href="map-toy.css">
<meta name="viewport" content="initial-scale=1.0, target-densitydpi=device-dpi, user-scalable=no, width=device-width">
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
var attribution = 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.';
var toner = L.tileLayer('http://tile.stamen.com/toner/{z}/{x}/{y}.png', {
attribution: attribution
});
var watercolor = L.tileLayer('http://tile.stamen.com/watercolor/{z}/{x}/{y}.png', {
attribution: attribution
});
var map = L.map('map', {
center: new L.LatLng(46.19815, 6.13278),
zoom: 10,
layers: [toner, watercolor]
});
L.control.layers({
"Toner": toner,
"Watercolor": watercolor
}).addTo(map);
</script>
</body>
</html>