forked from Turbo87/leaflet-sidebar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwo-sidebars.html
79 lines (63 loc) · 2.15 KB
/
two-sidebars.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
<title>leaflet-sidebar example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<link rel="stylesheet" href="../src/L.Control.Sidebar.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.ie.css" /><![endif]-->
<style>
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
}
.lorem {
font-style: italic;
color: #AAA;
}
</style>
</head>
<body>
<div id="sidebar-left">
<h1>left sidebar</h1>
</div>
<div id="sidebar-right">
<h1>right sidebar</h1>
</div>
<div id="map"></div>
<a href="https://github.com/Turbo87/leaflet-sidebar/"><img style="position: fixed; top: 0; right: 0; border: 0; z-index: 3000" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="../src/L.Control.Sidebar.js"></script>
<script>
var map = L.map('map');
map.setView([51.2, 7], 9);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © OpenStreetMap contributors'
}).addTo(map);
var leftSidebar = L.control.sidebar('sidebar-left', {
position: 'left'
});
map.addControl(leftSidebar);
var rightSidebar = L.control.sidebar('sidebar-right', {
position: 'right'
});
map.addControl(rightSidebar);
setTimeout(function () {
leftSidebar.toggle();
}, 500);
setTimeout(function () {
rightSidebar.toggle();
}, 2500);
setInterval(function () {
leftSidebar.toggle();
}, 5000);
setInterval(function () {
rightSidebar.toggle();
}, 7000);
</script>
</body>
</html>