-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
956 lines (814 loc) · 60.7 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
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
<!DOCTYPE html>
<html>
<head>
<!--
Copyright 2005-present OpenLayers Contributors. All rights reserved.
THIS SOFTWARE IS PROVIDED BY OPENLAYERS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Aller weiteret Code steht ebenfalls unter der BSD 2-Clause License
contact(äd)opendemdata.info
-->
<meta charset="UTF-8">
<meta name="description" content="LuftdatenInfo Timeslider">
<title>LuftdatenInfo Timeslider</title>
<link rel="stylesheet" href="http://www.openmaps.online/LuftdatenInfoTimeslider/ol_3_3/ol.css" type="text/css">
<style>
html,body {
height:100%;
padding:0;
margin:0;
}
.ol-popup {
position: absolute;
background-color: white;
-webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
padding: 15px;
border-radius: 10px;
border: 1px solid #cccccc;
bottom: 12px;
left: -50px;
min-width: 280px;
}
.ol-popup:after,
.ol-popup:before {
top: 100%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.ol-popup:after {
border-top-color: white;
border-width: 10px;
left: 48px;
margin-left: -10px;
}
.ol-popup:before {
border-top-color: #cccccc;
border-width: 11px;
left: 48px;
margin-left: -11px;
}
.ol-popup-closer {
text-decoration: none;
position: absolute;
top: 2px;
right: 8px;
}
.ol-popup-closer:after {
content: "X";
}
#map1 .ol-attribution {
bottom: 30px;
}
#map2 .ol-attribution {
bottom: 30px;
}
.map {
height: 40%;
width: 100%;
}
.divT{
background-color: white;
height: 30px;
position: relative;
}
.half-map {
float: left;
height: -moz-calc(50% - 100px);
height: -webkit-calc(50% - 100px);
height: calc(50% - 100px);
width: 49%;
background-color: #b5d0d0;
border: solid 1px black;
}
input[type=number]{
width: 30px;
}
.inputNumF{
width: 50px!important;
}
.half-map2 {
height: calc(50% - 100px);
width: 50%;
background-color: #b5d0d0;
}
.mouse-position{ position: absolute;
left: 70px;
top: 170px;
z-index: 1000;
font-weight:bold;
background-color: rgba(0, 60, 136, 0.298039);
padding: 5px;
border-radius: 4px;}
.helpDivS{
position: absolute;
top: 5px;
left: 450px;
z-index: 9999;
margin: 5px;
}
#helpDiv { z-index:9999;
position: absolute;
width: 650px;
height: 500px;
background-color: white;
top: 80px;
overflow: auto;
left: 20px;
border: 3px solid black;
padding: 5px;
}
.downloadDivS{
position: absolute;
top: 1px;
left: 520px;
z-index: 9999;
margin: 5px;
}
.legalDivS{
position: absolute;
top: 1px;
left: 580px;
z-index: 9999;
margin: 5px;
}
#legalDiv { z-index:9999;
position: absolute;
width: 650px;
height: 500px;
background-color: white;
top: 80px;
overflow: auto;
left: 20px;
border: 3px solid black;
padding: 5px;
}
#downloadDiv { z-index:1;
position: absolute;
width: 650px;
height: 500px;
background-color: white;
top: 80px;
overflow: auto;
left: 20px;
border: 3px solid black;
padding: 5px;
}
.left{
left: 15px;
position: relative;
}
</style>
<script src="http://www.openmaps.online/LuftdatenInfoTimeslider/ol_3_3/ol-debug.js" type="text/javascript"></script>
<title>SensorMap</title>
</head>
<body>
<h2> <a href="http://luftdaten.info/" target="_blank">LuftDaten.info</a> wöchentlicher Timeslider</h2>
<div class="helpDivS" id="helpDivS"><img id="help" onclick="helpMe()" src="images/question-circle-regular.png"></div>
<div class="downloadDivS" id="downloadDivS"><img id="download" onclick="downloadMe()" src="images/file-download-solid.png"></div>
<div class="legalDivS" id="legalDivS"><img id="legal" onclick="legalNotes()" src="images/balance-scale-solid.png"></div>
<p>
<div class="left" role="group" aria-label="Animation controls">
<button id="play" type="button">Play</button>
<button id="pause" type="button">Pause</button>
<!-- 7 * 24 Stunden -->
<input type="range" id="range" name="range" min="1" max="168" value="1">
Geschwindigkeit <input class="inputNumF" type="number" id="framerate" name="framerate" min="1" value="300">
<button id="direction" type="button" onclick="toggleDirection()" value="backwards">->Vergangenheit</button>
<span id="info"></span>
</div>
</p>
<div id="map1" class="half-map">
<div class="divT"> PM 10:
<label for="pm10_1">Schwellenwert 1:</label>
<input id="pm10_1" type="number" name="pm10_1" value="15" maxlength="4" size="4">
<label for="pm10_2">Schwellenwert 2:</label>
<input id="pm10_2" type="number" name="pm10_2" value="25" maxlength="4" size="4">
<button type="button" name="reload1" id="reload1">Neu laden</button>
</div>
</div>
<div id="map2" class="half-map">
<div class="divT"> PM 2,5:
<label for="pm25_1">Schwellenwert 1:</label>
<input id="pm25_1" type="number" name="pm25_1" value="5">
<label for="pm25_2">Schwellenwert 2:</label>
<input id="pm25_2" type="number" name="pm25_2" value="10">
<button type="button" name="reload2" id="reload2">Neu laden</button>
</div>
</div>
<div id="map3" class="half-map">
<div class="divT"> Temperatur:
<label for="temp_1">Schwellenwert 1:</label>
<input id="temp_1" type="number" name="temp_1" value="6">
<label for="temp_2">Schwellenwert 2:</label>
<input id="temp_2" type="number" name="temp_2" value="14">
<button type="button" name="reload3" id="reload3">Neu laden</button>
</div>
</div>
<div id="map4" class="half-map">
<div class="divT"> Relative Luftfeuchtigkeit:
<label for="humi_1">Schwellenwert 1:</label>
<input id="humi_1" type="number" name="humi_1" value="75">
<label for="humi_2">Schwellenwert 2:</label>
<input id="humi_2" type="number" name="humi_2" value="85">
<button type="button" name="reload4" id="reload4">Neu laden</button>
</div>
</div>
<div id="mouse-position" class="mouse-position"></div>
<div id="helpDiv" style="display:none;">
<h1>Hilfe</h1>
<p>Diese Kartenanwendung basiert auf den gemessen Daten (Feinstaub PM 10 & 2,5, relative Luftfeuchtigkeit und Temperatur) von <a href="https://luftdaten.info/" target="_blank">Luftdaten.info</a> und einem OpenLayres, PostGIS & Geoserver Stack. </p>
<p>Die Daten von Luftdaten.info werden stündlich in eine PostGIS Datenbank gespielt.</p>
<p>Die API Abfrage liefert den Durchschnitt aller gemessenen Sensorenwerte der letzten 5 Minuten.
Sollte der Request fehlschlagen wird die API noch bis zu fünf mal in einem Intervall von 5min abgefragt.</p>
<a href="https://github.com/opendata-stuttgart/meta/wiki/APIs" target="_blank">zu den OpenData Stuttgart APIs</a>
<p> Es werden nur die Daten der letzten Woche vorgehalten.</p>
<p>Die Daten stehen unter der Database Contents License (<a href="https://opendatacommons.org/licenses/dbcl/1.0/" target="_blank">DbCL</a>) v1.0</p>
<p>Der Code der Anwendung ist auf <a href="https://github.com/OpenDEM/LuftdatenInfoTimeslider" target="_blank">GitHub</a> verfügbar.</p>
<p>Die zum Download angebotenen Daten werden um 1 Uhr MESZ als GeoJsSON extrahiert. Evtl. ist der Unterstrich von .json_ noch zu entfernen.</p>
<p>Die Schwellenwerte können dynamisch angepasst werden:</p>
<p>Grün < Schwellenwert 1>= Gelb =< Schwellenwert 2 < Rot</p> <p>In die PM10 Karte klicken um die Messwerte abzufragen.</p>
<p>Die Anwendung kann parametrisiert aufgerufen werden, z.B.: </p>
<a href="http://www.openmaps.online/LuftdatenInfoTimeslider/?xcoord=7.0&ycoord=51.0&zoomView=10&frameR=1000%22%20target=%22_blank%22%3ELuftdatenInfoTimeslider.html?xcoord=7.0&ycoord=51.0&zoomView=10&frameR=1000</a>
<p>
<ul>
<li>xcoord: X-Koordinate in EPSG:4326</li>
<li>xcoord: Y-Koordinate in EPSG:4326</li>
<li>zoomView: OSM Zoomstufe</li>
<li>frameR: Geschwindigkeit der Kartenaufrufe</li>
</ul>
Bitte bei den kleinen Zoomstufen entsprechend hohe Werte für die Geschwindigkeit wählen, ansonsten kommt der Kartendiesnt nicht mehr mit!
</p>
</div>
<div id=" downloadDiv" style="display:none;">
<h1>Download</h1>
<div id="popup" class="ol-popup">
<a href="#" id="popup-closer" class="ol-popup-closer"></a>
<div id="popup-content"></div>
</div>
<p>todo</p>
</div>
<div id="legalDiv" style="display:none;">
<h1>Impressum & DSGVO</h1>
<p>Verantwortlich für diese Internetseite ist:</p>
<p>Martin Over</p>
<p>Rüdesheimer Str. 33</p>
<p>50679 Köln</p>
<p>contact(at)opendemdata.info</p>
<h3>Haftungsausschluss</h3>
<p><strong>Haftung für Inhalte</strong></p>
<p>Die Inhalte unserer Seiten wurden mit größter Sorgfalt erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1 TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach § 8 bis 10 TMG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntnis einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von entsprechenden Rechtsverletzungen werden wir diese Inhalte umgehend entfernen.</p>
<p><strong>Haftung für Links</strong></p>
<p>Unser Angebot enthält Links zu externen Webseiten Dritter, auf deren Inhalte wir keinen Einfluss haben. Deshalb können wir für diese fremden Inhalte auch keine Gewähr übernehmen. Für die Inhalte der verlinkten Seiten ist stets der jeweilige Anbieter oder Betreiber der Seiten verantwortlich. Die verlinkten Seiten wurden zum Zeitpunkt der Verlinkung auf mögliche Rechtsverstöße überprüft. Rechtswidrige Inhalte waren zum Zeitpunkt der Verlinkung nicht erkennbar. Eine permanente inhaltliche Kontrolle der verlinkten Seiten ist jedoch ohne konkrete Anhaltspunkte</p>
<h3>Urheberrecht</h3>
<p>Die durch die Seitenbetreiber erstellten Inhalte und Werke auf diesen Seiten unterliegen dem deutschen Urheberrecht. Sie sind mit einer Creative Commons Lizenz urheberrechtlich geschützt. Sofern nicht anders angegeben, stehen die Inhalte dieser Seite unter der Creative Commons Namensnennung 3.0 DE Lizenz. Soweit die Inhalte auf dieser Seite nicht vom Betreiber erstellt wurden, werden die Urheberrechte Dritter beachtet. Insbesondere werden Inhalte Dritter als solche gekennzeichnet. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte umgehend entfernen. </p>
<h3>Verwendete Werke Dritter</h3>
<p>Die Icons stammen von <a href="https://fontawesome.com">FontAwesome</a> und stehen unter der <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International Lizenz</a>.</p>
<p>Die Datengrundlage stammt vom Projekt <a href="https://LuftDaten.info">LuftDaten.info</a>.
Die Daten stehen unter der Database Contents License (<a href="https://opendatacommons.org/licenses/dbcl/1.0/" target="_blank">DbCL</a>) v1.0</p>
<h1>Datenschutzerklärung</h1>
<p><strong>Bereitstellung der Website und Erstellung von Protokoll- oder Log-Dateien</strong><strong><br /> </strong><br /> Mit dem Hoster wurde ein entsprechender Vertrag zur Auftragsverarbeitung (AVV) geschlossen. Aufgrund von Datenschutzrichtlinien zu personenbezogenen Daten werden die IP-Adressen der Aufrufer in den Log-Dateien anonymisiert.</p>
<p><strong>Welche Daten werden verarbeitet?</strong><br /> Bei jedem Zugriff auf Inhalte des Internetangebotes werden dort vorübergehend Daten über sogenannte Protokoll- oder Log-Dateien gespeichert, die möglicherweise eine Identifizierung zulassen. Die folgenden Daten werden hierbei erhoben:<br /> - Datum und Uhrzeit des Abrufs<br /> - Name des aufgerufenen Internetdienstes, der aufgerufenen Ressource und der verwendeten Aktion<br /> - Abfrage, die der Client gestellt hat<br /> - übertragene Datenmenge<br /> - Meldung, ob der Abruf erfolgreich war<br /> - IP-Adresse des aufrufenden Rechners (anonymisiert)<br /> - Clientinformationen (u.a. Browser, Betriebssystem)</p>
<p> </p>
<p><strong>Auf welcher Rechtsgrundlage werden diese Daten verarbeitet?</strong><br /> Rechtsgrundlage für die vorübergehende Speicherung der Daten ist Art. 6 Abs. 1 lit. e DS-GVO i.V.m. § 3 Abs. 1 NRWDSAnpUG-EU.</p>
<p><strong>Zu welchen Zwecken erfolgt die Verarbeitung?</strong><strong><br /> </strong>Die Daten aus den Protokoll- bzw. Logdateien dienen zur Sicherstellung der Funktionsfähigkeit der Website. Zudem dienen sie zur Abwehr und Analyse von Angriffen. In diesen Zwecken liegt auch unser berechtigtes Interesse an der Datenverarbeitung.</p>
<p><br /> <strong>Download von Dateien</strong></p>
<p>Die hier angebotenen Datensätze liegen z.T. auf deutschen Serverstandorten anderer Hoster. Auch hier werden Log Dateien gespeichert. Mit den betroffenen Hoster Strato wurde ein entsprechender Vertrag zur Auftragsverarbeitung (AVV) geschlossen.</p>
<p><strong>Karten</strong></p>
<p>In den hier angebotenen Kartenclienten werden auch Karten anderer Anbieter visualisiert. Hier handelt es sich um Kartendienste von folgenden Anbietern:</p>
<p>OpenStreetMap <a href="https://www.openstreetmap.org">https://www.openstreetmap.org</a></p>
</div>
<script type="text/javascript">
try {
if (getUrlVars()["frameR"] !== undefined) {
document.getElementById('framerate').value = Number(getUrlVars()["frameR"]);
}
} catch (e) {}
var playActive = false;
/**
* Elements that make up the popup.
*/
var container = document.getElementById('popup');
var content = document.getElementById('popup-content');
var closer = document.getElementById('popup-closer');
/**
* Create an overlay to anchor the popup to the map.
*/
var overlay = new ol.Overlay({
element: container,
autoPan: true,
autoPanAnimation: {
duration: 250
}
});
/**
* Add a click handler to hide the popup.
* @return {boolean} Don't follow the href.
*/
closer.onclick = function() {
overlay.setPosition(undefined);
closer.blur();
return false;
};
function hoursAgo() {
var dateLast = new Date(Date.now());
// minus 2 tAGE WÄRE FÜR lanuv dATEN INTERESSANT
//dateLast.setDate(dateLast.getDate() - 2);
dateLast.setMinutes(0);
dateLast.setSeconds(0);
console.log(dateLast);
return dateLast;
}
var startDate = hoursAgo();
// in Minuten
var gmtDate = new Date(startDate.valueOf() + startDate.getTimezoneOffset() * 60000);
//2018-04-18 10:00:00
var hours = gmtDate.getHours();
if (hours < 10) {
hours = "0" + hours;
}
var month = gmtDate.getMonth() + 1;
if (month < 10) {
month = "0" + month;
}
var _date = gmtDate.getDate();
if (_date < 10) {
_date = "0" + _date;
}
var datum = gmtDate.getFullYear() + "-" + month + "-" + _date;
var timestamp = datum + ' ' + hours + ':00:00';
console.log(timestamp);
var maxDate = timestamp;
//TIME=2018-05-10T13:00:00.0Z
var ogctime = datum + 'T' + hours + ':00:00.0Z';
var iniDate = true;
var initDateTime = new Date(startDate.valueOf() + startDate.getTimezoneOffset() * 60000);;
console.log(initDateTime);
// set minimumm Date - 1 Week
var minDate = new Date();
minDate.setDate(minDate.getDate() - 7);
minDate.setMinutes(0);
minDate.setSeconds(0);
var gmtDateIni = new Date(minDate.valueOf() + minDate.getTimezoneOffset() * 60000);
var hours = gmtDateIni.getHours();
if (hours < 10) {
hours = "0" + hours;
}
var month = gmtDateIni.getMonth() + 1;
if (month < 10) {
month = "0" + month;
}
var _date = gmtDateIni.getDate();
if (_date < 10) {
_date = "0" + _date;
}
var datum = gmtDate.getFullYear() + "-" + month + "-" + _date;
var minDate = datum + ' ' + hours + ':00:00';
//console.log(minDate);
// set array for matching int to time
var rangeA = [];
var rangeTime = new Date();
rangeTime.setMinutes(0);
rangeTime.setSeconds(0);
for (i = 1; i < 168; i++) {
rangeA.push(rangeTime);
var timeR = rangeTime.getTime()
timeR = timeR - 3600 * 1000;
rangeTime = new Date(timeR);
}
var frameRate = 0.5; // frames per second
var animationId = null;
// pm 10
var sldBody1 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
// pm 2,5
var sldBody2 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
//temp
var sldBody3 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
// humidity
var sldBody4 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer1 = new ol.layer.Image({
title: 'tracks',
source: new ol.source.ImageWMS({
url: 'http://www.opendem.info:8080/geoserver/opendem/wms',
attributions: [new ol.Attribution({
html: "<br/><a href=\"http://luftdaten.info\">LuftDaten.info</a>"
})],
params: {
'LAYERS': 'opendem:luftdateninfo',
'SLD_BODY': sldBody1,
'TIME': ogctime
},
serverType: 'geoserver'
})
});
var layer2 = new ol.layer.Image({
title: 'tracks',
source: new ol.source.ImageWMS({
url: 'http://www.opendem.info:8080/geoserver/opendem/wms',
attributions: [new ol.Attribution({
html: "<br/><a href=\"http://luftdaten.info\">LuftDaten.info</a>"
})],
params: {
'LAYERS': 'opendem:luftdateninfo',
'SLD_BODY': sldBody2,
'TIME': ogctime
},
serverType: 'geoserver'
})
});
var layer3 = new ol.layer.Image({
title: 'tracks',
source: new ol.source.ImageWMS({
url: 'http://www.opendem.info:8080/geoserver/opendem/wms',
attributions: [new ol.Attribution({
html: "<br/><a href=\"http://luftdaten.info\">LuftDaten.info</a>"
})],
params: {
'LAYERS': 'opendem:luftdateninfo',
'SLD_BODY': sldBody3,
'TIME': ogctime
},
serverType: 'geoserver'
})
});
var layer4 = new ol.layer.Image({
title: 'tracks',
source: new ol.source.ImageWMS({
url: 'http://www.opendem.info:8080/geoserver/opendem/wms',
attributions: [new ol.Attribution({
html: "<br/><a href=\"http://luftdaten.info\">LuftDaten.info</a>"
})],
params: {
'LAYERS': 'opendem:luftdateninfo',
'SLD_BODY': sldBody4,
'TIME': ogctime
},
serverType: 'geoserver'
})
});
var layerOsm = new ol.layer.Tile({
source: new ol.source.OSM({url:'https://tile.openstreetmap.org/{z}/{x}/{y}.png'})
});
// url parameter
var xcoord = 6.9619;
var ycoord = 50.9389;
var zoomView = 12;
try {
if (getUrlVars()["xcoord"] != undefined) {
xcoord = parseFloat(getUrlVars()["xcoord"]);
}
} catch (e) {}
try {
if (getUrlVars()["ycoord"] != undefined) {
ycoord = parseFloat(getUrlVars()["ycoord"]);
}
} catch (e) {}
try {
if (getUrlVars()["zoomView"] != undefined) {
zoomView = Number(getUrlVars()["zoomView"]);
}
} catch (e) {}
var view = new ol.View({
center: ol.proj.transform([xcoord, ycoord], 'EPSG:4326', 'EPSG:3857'),
zoom: zoomView
});
// karteen
var map1 = new ol.Map({
target: 'map1',
overlays: [overlay],
layers: [layerOsm, layer1],
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
collapsible: true
})
}).extend([
new ol.control.ScaleLine(),
new ol.control.MousePosition({
coordinateFormat: ol.coordinate.createStringXY(4),
projection: 'EPSG:4326',
// comment the following two lines to have the mouse position
// be placed within the map.
className: 'custom-mouse-position',
target: document.getElementById('mouse-position')
//definedHTML: ' '
//definedHTML: 'coordinates'
})
])
});
var map2 = new ol.Map({
target: 'map2',
layers: [layerOsm, layer2],
view: view
});
var map3 = new ol.Map({
target: 'map3',
layers: [layerOsm, layer3],
view: view
});
var map4 = new ol.Map({
target: 'map4',
layers: [layerOsm, layer4],
view: view
});
// and bind the view properties so they effectively share a view
map1.bindTo('view', map2);
map3.bindTo('view', map2);
map4.bindTo('view', map2);
// event handler
document.addEventListener("DOMContentLoaded", function(event) {
var _selector1 = document.querySelector('button[name=reload1]');
_selector1.addEventListener('click', function(event) {
var sldBody1 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer1New = layer1.getSource();
layer1New.updateParams({
'SLD_BODY': sldBody1
});
map1.render();
});
var _selector2 = document.querySelector('button[name=reload2]');
_selector2.addEventListener('click', function(event) {
var sldBody2 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer2New = layer2.getSource();
layer2New.updateParams({
'SLD_BODY': sldBody2
});
map2.render();
});
var _selector3 = document.querySelector('button[name=reload3]');
_selector3.addEventListener('click', function(event) {
var sldBody3 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer3New = layer3.getSource();
layer3New.updateParams({
'SLD_BODY': sldBody3
});
map3.render();
});
var _selector4 = document.querySelector('button[name=reload4]');
_selector4.addEventListener('click', function(event) {
var sldBody4 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer4New = layer4.getSource();
layer4New.updateParams({
'SLD_BODY': sldBody4
});
map4.render();
});
});
function updateMapTime() {
var gmtDate = new Date(startDate.valueOf() + startDate.getTimezoneOffset() * 60000);
//2018-04-18 10:00:00
var hours = gmtDate.getHours();
if (hours < 10) {
hours = "0" + hours;
}
var month = gmtDate.getMonth() + 1;
if (month < 10) {
month = "0" + month;
}
var _date = gmtDate.getDate();
if (_date < 10) {
_date = "0" + _date;
}
var datum = gmtDate.getFullYear() + "-" + month + "-" + _date;
var timestamp = datum + ' ' + hours + ':00:00';
console.log(minDate + ' ' + timestamp)
// stop after 1 week
if (timestamp === minDate) {
stop();
console.log(initDateTime);
// anders
startDate = initDateTime;
updateInfo();
}
if (timestamp === maxDate) {
stop();
// anders
startDate = initDateTime;
updateInfo();
}
var ogctime = datum + 'T' + hours + ':00:00.0Z';
var sldBody1 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>p1</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm10_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer1New = layer1.getSource();
layer1New.updateParams({
'SLD_BODY': sldBody1,
'TIME': ogctime
});
map1.render();
var sldBody2 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>p2</ogc:PropertyName><ogc:Literal>' + document.getElementById('pm25_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer2New = layer2.getSource();
layer2New.updateParams({
'SLD_BODY': sldBody2,
'TIME': ogctime
});
map2.render();
var sldBody3 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>temperature</ogc:PropertyName><ogc:Literal>' + document.getElementById('temp_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer3New = layer3.getSource();
layer3New.updateParams({
'SLD_BODY': sldBody3,
'TIME': ogctime
});
map3.render();
var sldBody4 = '<?xml version="1.0" encoding="ISO-8859-1"?><StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><se:Name>opendem:luftdateninfo</se:Name><UserStyle><se:FeatureTypeStyle><se:Rule><ogc:Filter><ogc:PropertyIsLessThan><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_1').value + '</ogc:Literal></ogc:PropertyIsLessThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#00FF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:And><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_2').value + '</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_1').value + '</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:And></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FFFF00</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule><se:Rule><ogc:Filter><ogc:PropertyIsGreaterThan><ogc:PropertyName>humidity</ogc:PropertyName><ogc:Literal>' + document.getElementById('humi_2').value + '</ogc:Literal></ogc:PropertyIsGreaterThan></ogc:Filter><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Fill><se:SvgParameter name="fill">#FF0000</se:SvgParameter></se:Fill></se:Mark><se:Size>15</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>';
var layer4New = layer4.getSource();
layer4New.updateParams({
'SLD_BODY': sldBody4,
'TIME': ogctime
});
map4.render();
}
function updateInfo() {
var el = document.getElementById('info');
el.innerHTML = startDate;
}
function setTime() {
if (iniDate == true) {
iniDate = false;
updateInfo();
} else {
if (document.getElementById('direction').value === 'backwards') {
// --> vergangenheit
startDate.setHours(startDate.getHours() - 1);
updateInfo();
var valueR;
for (i = 0; i < rangeA.length; i++) {
if (rangeA[i] == startDate.toString()) {
valueR = i + 1;
}
}
console.log('startDate', startDate);
console.log('startArra', rangeA[1]);
console.log(valueR);
document.getElementById("range").value = valueR;
updateMapTime();
} else {
// --> zukunft
startDate.setHours(startDate.getHours() + 1);
updateInfo();
var valueR;
for (i = 0; i < rangeA.length; i++) {
if (rangeA[i] == startDate.toString()) {
valueR = i - 1;
}
}
console.log('startDate', startDate);
console.log('startArra', rangeA[1]);
console.log(valueR);
document.getElementById("range").value = valueR;
updateMapTime();
}
}
}
setTime();
var stop = function() {
var startButton = document.getElementById('play');
if (playActive === true) {
startButton.style.background = 'red';
playActive = false;
} else {
startButton.style.background = '';
}
if (animationId !== null) {
window.clearInterval(animationId);
animationId = null;
}
};
var play = function() {
playActive = true;
stop();
//animationId = window.setInterval(setTime, 1000 / frameRate);
//animationId = window.setInterval(setTime, 5 / frameRate);
var frameR = document.getElementById('framerate').value;
animationId = window.setInterval(setTime, Number(frameR) / frameRate);
};
var startButton = document.getElementById('play');
startButton.addEventListener('click', play, false);
var stopButton = document.getElementById('pause');
stopButton.addEventListener('click', stop, false);
function helpMe() {
// check legal notes
var legalDiv = document.getElementById("legalDiv");
if (legalDiv.style.display == 'block') {
document.getElementById("legal").style.border = "0px solid red"
legalDiv.style.display = 'none';
}
var helpDiv = document.getElementById("helpDiv");
if (helpDiv.style.display == 'block') {
helpDiv.style.display = 'none';
} else {
helpDiv.style.display = 'block';
}
var help = document.getElementById("help");
if (help.style.border === "2px solid red") {
help.style.border = "0px solid red"
} else {
help.style.border = "2px solid red"
}
}
function legalNotes() {
// check help div
var helpDiv = document.getElementById("helpDiv");
if (helpDiv.style.display == 'block') {
document.getElementById("help").style.border = "0px solid red"
helpDiv.style.display = 'none';
}
var legalDiv = document.getElementById("legalDiv");
if (legalDiv.style.display == 'block') {
legalDiv.style.display = 'none';
} else {
legalDiv.style.display = 'block';
}
var legal = document.getElementById("legal");
if (legal.style.border === "2px solid red") {
legal.style.border = "0px solid red"
} else {
legal.style.border = "2px solid red"
}
}
function toggleDirection() {
var toggler = document.getElementById('direction');
if (toggler.value === 'backwards') {
toggler.value = 'forward'
toggler.innerHTML = '-> Zukunft';
// zurücksetzen auf letzten Zeitpunkt in Vergangenheit
if (document.getElementById('range').value === '1') {
document.getElementById('range').value = 168;
startDate.setHours(startDate.getHours() - 168);
updateInfo();
}
} else {
toggler.value = 'backwards'
toggler.innerHTML = '-> Vergangenheit';
}
}
function downloadMe() {
x = confirm('Download Daten.\nDie Sensordaten stammen von luftdaten.info und stehen unter der Database Contents License (DbCL) v1.0.');
if (x == true) {
window.open("http://www.opendem.info/downloads/luftdateninfo.zip");
} else {
//alert("You have clicked on Cancel Button.");
}
}
//range.oninput = function() {
range.onmouseup = function() {
//
console.log(this.value + ' time ' + rangeA[this.value]);
startDate = rangeA[this.value];
updateInfo();
updateMapTime();
}
map1.on('singleclick', function(evt) {
var coordinate = evt.coordinate;
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
coordinate, 'EPSG:3857', 'EPSG:4326'));
var viewResolution = (map1.getView().getResolution());
var url = layer1.getSource().getGetFeatureInfoUrl(
evt.coordinate, viewResolution, 'EPSG:3857', {
'INFO_FORMAT': 'application/json',
'FEATURE_COUNT': 3
});
if (url) {
var createCORSRequest = function(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// Most browsers.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
// IE8 & IE9
xhr = new XDomainRequest();
xhr.open(method, url);
} else {
// CORS not supported.
xhr = null;
}
return xhr;
};
var method = 'GET';
var xhr = createCORSRequest(method, url);
xhr.onload = function() {
var jsonFI = JSON.parse(this.responseText);
var contentAir = '<p>Gemessene Werte ' + jsonFI.features[0].properties.timest + ':<br/>';
contentAir += 'PM 10: ' + jsonFI.features[0].properties.p1 + '<br/>';
contentAir += 'PM 2.5: ' + jsonFI.features[0].properties.p2 + '<br/>';
contentAir += 'Temperatur: ' + jsonFI.features[0].properties.temperature + '<br/>';
contentAir += 'Luftfeuchtigkeit: ' + jsonFI.features[0].properties.humidity + '</p>';
content.innerHTML = contentAir;
overlay.setPosition(coordinate);
};
xhr.onerror = function() {
// Error code goes here.
};
xhr.send();
}
});
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
vars[key] = value;
});
return vars;
}
</script>
</body>
</html>