-
Notifications
You must be signed in to change notification settings - Fork 16
/
example.html
50 lines (43 loc) · 1.25 KB
/
example.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Leaflet Grid Demo</title>
<link rel="stylesheet" href="/leaflet-0.7/leaflet.css" />
<style type="text/css">
html, body { width: 100%; height: 100%; margin: 0; }
#map { width: 100%; height: 100%; }
.leaflet-grid-label .lng {
margin-left: 8px;
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
</style>
</head>
<body>
<div id="map"></div>
<script src="/leaflet-0.7/leaflet.js"></script>
<script type="text/javascript" src="L.Grid.js"></script>
<script type="text/javascript">
var layer = L.tileLayer("http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg", {
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',
minZoom: 3,
maxZoom: 16
});
var map = L.map('map', {
layers: [layer],
center: [52, 4.2],
zoom: 4
});
var grid = L.grid().addTo(map);
L.control.layers({
'Stamen Watercolor': layer
}, {
'L.Grid': grid
}, {
collapsed: false
}).addTo(map);
</script>
</body>
</html>