-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
178 lines (144 loc) · 5.91 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>openstreetmap.social</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="flattr:id" content="492765">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js" integrity="sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.1/leaflet.markercluster.js"></script>
<script src="js/leaflet-sidebar.min.js"></script>
<script src="js/guideposts.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.8.1/js/all.js" integrity="sha384-g5uSoOSBd7KkhAMlnQILrecXvzst9TdC09/VM+pjDTCM+1il8RHz5fKANTFFb+gQ" crossorigin="anonymous"></script>
<link rel="shortcut icon" type="image/x-icon" href="ico/favicon.ico">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.1/MarkerCluster.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.1/MarkerCluster.Default.css">
<link rel="stylesheet" href="css/leaflet-sidebar.css">
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div class="container">
<div id="sidebar" class="leaflet-sidebar collapsed">
<!-- nav tabs -->
<div class="leaflet-sidebar-tabs">
<!-- top aligned tabs -->
<ul role="tablist">
<li><a href="#home" role="tab"><i class="fas fa-bars"></i></a></li>
<li><a href="#settings" role="tab"><i class="fas fa-cog"></i></a></li>
</ul>
<!-- bottom aligned tabs -->
<ul role="tablist">
<li><a href="https://github.com/nickpeihl/leaflet-sidebar-v2"><i class="fab fa-github"></i></a></li>
</ul>
</div>
<!-- panel content -->
<div class="leaflet-sidebar-content">
<div class="leaflet-sidebar-pane" id="home">
<h1 class="leaflet-sidebar-header">
openstreetmap.social
<span class="leaflet-sidebar-close"><i class="fas fa-caret-left"></i></span>
</h1>
<h2>links</h2>
<p>map using <a href="http://leafletjs.com/">Leaflet</a>.</p>
<p><a href="https://github.com/walley/api">api - github</a></p>
<p><a href="https://api.openstreetmap.social/webapps">api - webapps</a></p>
<p>work in progress ...</p>
</div>
<div class="leaflet-sidebar-pane" id="autopan">
<h1 class="leaflet-sidebar-header">
autopan
<span class="leaflet-sidebar-close"><i class="fas fa-caret-left"></i></span>
</h1>
<p>
<code>Leaflet.control.sidebar({ autopan: true })</code>
makes shure that the map center always stays visible.
</p>
<p>
The autopan behviour is responsive as well.
Try opening and closing the sidebar from this pane!
</p>
</div>
<div class="leaflet-sidebar-pane" id="messages">
<h1 class="leaflet-sidebar-header">Messages<span class="leaflet-sidebar-close"><i class="fas fa-caret-left"></i></span></h1>
</div>
<div class="leaflet-sidebar-pane" id="settings">
<h1 class="leaflet-sidebar-header">Settings<span class="leaflet-sidebar-close"><i class="fas fa-caret-left"></i></span></h1>
<button class='wbutton'>settings</button>
</div>
</div>
</div>
<div id="map"></div>
<script>
var osmcz = osmcz || {};
var map;
var sidebar;
var guideposts;
var mbAttr = 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
mbUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw';
var streets = L.tileLayer(mbUrl, {id: 'mapbox.streets', attribution: mbAttr});
var mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">openstreetmap</a>'
});
var map = L.map('map', {
center: [49, 17],
zoom: 10,
layers: [mapnik]
});
var base_layers = {
"Mapbox": streets,
"Mapnik": mapnik
};
var overlays = {
};
control = L.control.layers(base_layers, overlays).addTo(map);
// create the sidebar instance and add it to the map
osmcz.sidebar = sidebar = L.control.sidebar({ container: 'sidebar' })
.addTo(map)
.open('home');
guideposts = new osmcz.guideposts(map, base_layers, overlays, control, "xxx");
// add panels dynamically to the sidebar
sidebar
.addPanel({
id: 'guidepost',
tab: '<i class="fas fa-heart"></i>',
title: 'hi',
pane: '<div id="sidebar-content"></div><p>after</p>',
})
.addPanel({
id: 'mail',
tab: '<i class="fa fa-envelope"></i>',
title: 'Messages',
button: function() { alert('you will be able to send notes soon') },
disabled: false,
})
// be notified when a panel is opened
sidebar.on('content', function (ev) {
switch (ev.id) {
case 'autopan':
sidebar.options.autopan = true;
break;
default:
sidebar.options.autopan = false;
}
});
</script>
<div class="bottomleft">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- social -->
<ins class="adsbygoogle"
style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-7270111774772584"
data-ad-slot="2177165841"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
</body>
</html>