-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutdoormap-slider.htm
205 lines (166 loc) · 5.83 KB
/
outdoormap-slider.htm
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<html>
<head>
<title>OSM und verschiedene geologische Karten</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<style type="text/css">
#basemapslidercontainer {
position: absolute;
top: 50px;
right: 10px;
z-index: 1000;
}
#basemapslider{
font-size:62.5%;
margin: 14px;
height: 125px;
width:7px;
}
</style>
<script>
$(document).ready(function () {
$("#basemapslider").slider({
animate: true,
value: 0.5,
orientation: "vertical",
min: 0,
max: 1,
step: 0.1,
slide: function (event, ui) {
for(var ol in overlays) {
// do something with obj[key]
overlays[ol].setOpacity(ui.value);
};
}
});
$('#basemapslider').mousedown(function(){
map.dragging.disable();
})
$('#basemapslider').mouseup(function(){
map.dragging.enable();
})
});
</script>
</head>
<body>
<div id="map" style="width: 1600; height: 1000px">
<div id="basemapslidercontainer">
<div id="basemapslider"></div>
</div>
</div>
<script src="leaflet-hash.js"></script>
<script>
var map = L.map('map', {}).setView([51.7991, 10.6156], 13);
mapnik_link = '<a href="http://openstreetmap.org">OpenStreetMap</a>';
tf_link = '<a href="http://thunderforest.com/">Thunderforest</a>';
opentopomap_link = '<a href="http://opentopomap.org">OpenTopoMap</a>'
var tf = L.tileLayer(
'http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png', {
attribution: 'Map data © '+mapnik_link+' Contributors & '+tf_link,
maxZoom: 18, attributionControl: true,
});
tf.addTo(map);
var tf_landscape = L.tileLayer(
'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png', {
attribution: 'Map data © '+mapnik_link+' Contributors & '+tf_link,
maxZoom: 18, attributionControl: true,
});
var mapnik = L.tileLayer(
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data © ' + mapnik_link,
maxZoom: 19,
});
var mapnik_bw = L.tileLayer(
'http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: 'Map data © ' + mapnik_link+' Contributors & toolserver.org bw-mapnik',
});
var opentopomap = L.tileLayer(
'http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
maxZoom: 16,
attribution: 'Kartendaten: © '+mapnik_link+', SRTM | Kartendarstellung: © '+opentopomap_link,
});
var wmsigme = L.tileLayer.wms("https://services.bgr.de/wms/geologie/igme5000/?", {
layers: 'la_GeoKonti',
format: 'image/png',
transparent: true,
attribution: 'IGME: <a href="http://www.bgr.bund.de/DE/Themen/Sammlungen-Grundlagen/GG_geol_Info/NichtPublizieren/Europa/IGME5000/igme5000_node.html">BGR</a>',
opacity: 0.5,
//crs:'3857'
});
var wmsgk1000 = L.tileLayer.wms("https://services.bgr.de/wms/geologie/gk1000/", {
layers: '0,1,3',
format: 'image/png',
transparent: true,
attribution: 'GK1000: <a href="http://www.bgr.bund.de/DE/Themen/Sammlungen-Grundlagen/GG_geol_Info/Karten/Deutschland/GK1000/gk1000_node.html">BGR</a>',
opacity: 0.5,
//crs:'3857'
});
var wmsbsk1000 = L.tileLayer.wms("https://services.bgr.de/wms/rohstoffe/bsk1000/?", {
layers: '2,8',
format: 'image/png',
transparent: true,
attribution: 'BSK1000: <a href="http://www.bgr.de/service/rohstoffe/BSK1000/index.php?">BGR</a>',
opacity: 0.5,
//crs:'3857'
});
var wmsguek = L.tileLayer.wms("https://services.bgr.de/wms/geologie/guek200/?", {
layers: '1',
format: 'image/png',
transparent: true,
attribution: 'GÜK200: <a href="http://www.bgr.bund.de/DE/Themen/Sammlungen-Grundlagen/GG_geol_Info/Karten/Deutschland/GUEK200/guek200_inhalt.html">BGR</a>',
opacity: 0.5,
//crs:'3857'
});
var wmsgk25nds = L.tileLayer.wms("http://nibis.lbeg.de/cardomap3/public/ogc.ashx?NODEID=201&Service=WMS", {
layers: 'L160',
format: 'image/png',
transparent: true,
attribution: 'GK25 Niedersachsen: <a href="http://www.lbeg.niedersachsen.de/portal/live.php?navigation_id=731&article_id=596&_psmand=4">LBEG</a>',
opacity: 0.5,
//crs:'3857'
});
var wmsgk25by = L.tileLayer.wms("http://www.bis.bayern.de/wms/lfu/gk25_wms?", {
layers: 'GK500',
format: 'image/png',
transparent: true,
attribution: 'GK25 Bayern: Creative Commons Namensnennung (CC BY 3.0), Datenquelle: Bayerisches Landesamt für Umwelt, www.lfu.bayern.de',
opacity: 0.5,
//crs:'3857'
});
var wmsdop40nrw = L.tileLayer.wms("http://www.wms.nrw.de/geobasis/wms_nw_dop40", {
layers: 'WMS_NW_DOP40',
format: 'image/png',
transparent: true,
attribution: "DOP40 NRW: Bezirksregierung Köln, Abteilung Geobasis NRW",
opacity: 0.5,
//crs:'3857'
});
var baseLayers = {
//"Kein":null,
"Mapnik":mapnik,
"Mapnik (s/w)": mapnik_bw,
"Thunderforest": tf,
"TF landscape": tf_landscape,
"OpenTopoMap": opentopomap,
};
var overlays = {
"IGME" :wmsigme,
"GK25 NDS" : wmsgk25nds,
//"GK25 BY" : wmsgk25by, // GK25 BY kriegt erst irgendwann EPSG:3857
"DOP40 NRW": wmsdop40nrw,
"GÜK200" : wmsguek,
"GK1000" : wmsgk1000,
"BSK1000" : wmsbsk1000,
};
L.control.layers(baseLayers, overlays).addTo(map);
var hash = new L.Hash(map);
</script>
</body>
</html>