Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43d809cc18 | ||
|
|
e3f27aac7e | ||
|
|
b7a09e98e3 | ||
|
|
2251f25fcb | ||
|
|
9bb73b9ab5 | ||
|
|
87af90f047 | ||
|
|
aed22c7567 | ||
|
|
703834c9da | ||
|
|
26d6b0f252 | ||
|
|
3b5b07968e | ||
|
|
23ccbb8d9b | ||
|
|
dff6994a2b | ||
|
|
31fb40a220 | ||
|
|
1d286c3f50 | ||
|
|
70f933d8e2 | ||
|
|
2134402e93 | ||
|
|
331b529834 | ||
|
|
b074f0e695 | ||
|
|
f8a4a0abf2 | ||
|
|
52b55705b8 | ||
|
|
5433cb606a | ||
|
|
23ab30907f | ||
|
|
08ce986f24 | ||
|
|
124efe8f2c | ||
|
|
9669bd5ec8 | ||
|
|
3c35af9493 | ||
|
|
22f656a5fe | ||
|
|
8885f666af | ||
|
|
2892708399 | ||
|
|
61d272ec72 | ||
|
|
87da50a1f4 | ||
|
|
a7f19281ff | ||
|
|
2843c584a9 | ||
|
|
1a8d59d9cf | ||
|
|
c30e7ad781 | ||
|
|
20de44f50d | ||
|
|
fdc8b9f65b | ||
|
|
c9786126b8 | ||
|
|
db8703ab7a | ||
|
|
3b41bc4dfc | ||
|
|
fd632f2af6 | ||
|
|
1ac4702a75 | ||
|
|
80045a3f54 | ||
|
|
deea103fdf | ||
|
|
e24ed63022 | ||
|
|
170ee33d07 | ||
|
|
b82a6d2bff | ||
|
|
81204d76c7 | ||
|
|
91b1f6f28c | ||
|
|
ad920ee0fc | ||
|
|
9a5c2650e4 | ||
|
|
4c4429f000 | ||
|
|
f83b3aed22 | ||
|
|
f07c55d3bf | ||
|
|
1aaecbb879 | ||
|
|
9e9862b3d0 | ||
|
|
142ac10dd0 | ||
|
|
c858c586cd | ||
|
|
d1f9b64ab0 | ||
|
|
ce43a0a07d | ||
|
|
84479f45e1 | ||
|
|
80fab7459c | ||
|
|
2eca635f6d | ||
|
|
25d397fb0e | ||
|
|
9617cc5fa3 | ||
|
|
f467b77f48 | ||
|
|
6501b3fff7 | ||
|
|
85eb830ef1 | ||
|
|
210ea26747 | ||
|
|
b42911ada5 | ||
|
|
264036fe53 | ||
|
|
2238086066 | ||
|
|
021046ec29 | ||
|
|
63f9d9d43a | ||
|
|
78ea7b0397 | ||
|
|
8d8e0c5ff7 | ||
|
|
02624a53c8 | ||
|
|
5bfa403288 | ||
|
|
873a21f539 | ||
|
|
fd135405db | ||
|
|
9ea976c762 | ||
|
|
5a1b780eaf | ||
|
|
f374ee0a1c | ||
|
|
6b3c421ba8 | ||
|
|
855826d2bb | ||
|
|
a89a1af22c | ||
|
|
fdbade688a | ||
|
|
fc8133a954 | ||
|
|
ddba2012bb | ||
|
|
1814e81cdb | ||
|
|
76f269d297 | ||
|
|
8321e19a4a | ||
|
|
e50c816f05 | ||
|
|
11fcdbb305 | ||
|
|
49b9e492ac | ||
|
|
1c947c98d2 | ||
|
|
338d54ade4 | ||
|
|
8770857bd7 | ||
|
|
acb023cd20 | ||
|
|
a73450ac92 | ||
|
|
271caf6f20 | ||
|
|
c15e401da5 | ||
|
|
ad14cf44b3 | ||
|
|
14d988b0b4 | ||
|
|
3161f1542e | ||
|
|
4ed2af95c0 | ||
|
|
55a6c166b6 | ||
|
|
3de24436a0 | ||
|
|
43178d916e | ||
|
|
33ed07b142 | ||
|
|
2e27ccf170 | ||
|
|
ca182f594e | ||
|
|
fa0ef11337 | ||
|
|
b7ad42c462 | ||
|
|
b38fcddad7 | ||
|
|
c1fbfcd2c4 | ||
|
|
882bd9aa14 | ||
|
|
2d55865ed3 | ||
|
|
02de112405 | ||
|
|
7f3d188f9e | ||
|
|
6f2bfad0e5 | ||
|
|
3f3754a5e4 | ||
|
|
f6f9003908 | ||
|
|
8886ea4abb | ||
|
|
4b6fb951b2 | ||
|
|
d23b9f2a7c | ||
|
|
1736a73973 | ||
|
|
32d89b91f8 | ||
|
|
02679c30b0 | ||
|
|
19dc9b75c5 | ||
|
|
1285d68eb4 | ||
|
|
a38905569c |
No files matched your search
@@ -1,17 +1,33 @@
|
|||||||
* text=auto !eol
|
* text=auto !eol
|
||||||
www/TileLayer.Grayscale.js -text
|
scripts/mkEvents.csh -text
|
||||||
www/first.png -text
|
wsgi/showEnv.py -text
|
||||||
www/jquery.localtime-0.9.1.min.js -text
|
www/.htaccess -text
|
||||||
www/jquery.tablesorter.min.js -text
|
www/copyright.inc.de -text
|
||||||
www/jquery.tablesorter.pager.css -text
|
www/external/TileLayer.Grayscale.js -text
|
||||||
www/jquery.tablesorter.pager.min.js -text
|
www/external/css/dvf.css -text
|
||||||
www/jquery.tablesorter.widgets.min.js -text
|
www/external/css/leaflet.label.css -text
|
||||||
www/last.png -text
|
www/external/easyPrint.css -text
|
||||||
www/leaflet.css -text
|
www/external/first.png -text
|
||||||
www/leaflet.js -text
|
www/external/jQuery.print.js -text
|
||||||
|
www/external/jquery.localtime-0.9.1.min.js -text
|
||||||
|
www/external/jquery.tablesorter.min.js -text
|
||||||
|
www/external/jquery.tablesorter.pager.css -text
|
||||||
|
www/external/jquery.tablesorter.pager.min.js -text
|
||||||
|
www/external/jquery.tablesorter.widgets.min.js -text
|
||||||
|
www/external/last.png -text
|
||||||
|
www/external/leaflet-dvf.markers.min.js -text
|
||||||
|
www/external/leaflet.css -text
|
||||||
|
www/external/leaflet.easyPrint.js -text
|
||||||
|
www/external/leaflet.js -text
|
||||||
|
www/external/leaflet.label.js -text
|
||||||
|
www/external/next.png -text
|
||||||
|
www/external/prev.png -text
|
||||||
|
www/external/print.png -text
|
||||||
|
www/external/sprintf.min.js -text
|
||||||
|
www/external/theme.blue.css -text
|
||||||
|
www/external/widget-pager.js -text
|
||||||
|
www/impressum.inc.de -text
|
||||||
|
www/info.inc.de -text
|
||||||
www/logo_RUB_155x30.png -text
|
www/logo_RUB_155x30.png -text
|
||||||
www/next.png -text
|
www/more.inc.de -text
|
||||||
www/prev.png -text
|
www/spinner.gif -text
|
||||||
www/sprintf.min.js -text
|
|
||||||
www/theme.blue.css -text
|
|
||||||
www/widget-pager.js -text
|
|
||||||
@@ -1,2 +1,11 @@
|
|||||||
|
scripts/events.xml
|
||||||
|
scripts/geolocation.js
|
||||||
|
wsgi/.idea
|
||||||
|
www/dlsv
|
||||||
www/event.xml
|
www/event.xml
|
||||||
|
www/events.xml
|
||||||
|
www/geolocation.js
|
||||||
|
www/geolocationTable.js
|
||||||
www/stations.xml
|
www/stations.xml
|
||||||
|
|
||||||
|
.vscode/settings.json
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
STIME=$1
|
||||||
|
curl -o events.xml "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=${STIME}&orderby=time&minlat=50.92&maxlat=52.76&minlon=4.26&maxlon=9.74&minmag=1.1"
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
'''
|
||||||
|
Script to lookup city names of events with Nominatim service
|
||||||
|
|
||||||
|
The input should be an valid quakeML file passed to stdin.
|
||||||
|
The output will will be a javascript structure to be included in the
|
||||||
|
SeisObs map service.
|
||||||
|
|
||||||
|
The script should be updated regulary keep the total number of all
|
||||||
|
AJAX calls to the Nominatim service small, e. g. :
|
||||||
|
curl -s "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js
|
||||||
|
|
||||||
|
License
|
||||||
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
'''
|
||||||
|
|
||||||
|
def mkGeolocationTable(file=''):
|
||||||
|
# imports
|
||||||
|
try:
|
||||||
|
import xml.etree.cElementTree as ET
|
||||||
|
except ImportError:
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
from sys import stdin
|
||||||
|
import warnings
|
||||||
|
from time import sleep
|
||||||
|
from geopy.geocoders import Photon
|
||||||
|
import urllib2 as URL
|
||||||
|
import json as JSON
|
||||||
|
|
||||||
|
# constants
|
||||||
|
namespaces = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7',
|
||||||
|
'qml': 'http://quakeml.org/xmlns/bed/1.2'}
|
||||||
|
|
||||||
|
def simple_warning(message, category, filename, lineno, file=None, line=None):
|
||||||
|
return 'Warning: %s\n' % (message)
|
||||||
|
warnings.formatwarning = simple_warning
|
||||||
|
|
||||||
|
# try loading the file
|
||||||
|
geolocationTable = {}
|
||||||
|
if file :
|
||||||
|
try:
|
||||||
|
jsonfile = open(file)
|
||||||
|
jsonfileContent = jsonfile.read().split('=')[1].replace(';', '')
|
||||||
|
geolocationTable = JSON.loads(jsonfileContent)
|
||||||
|
except:
|
||||||
|
geolocationTable = {}
|
||||||
|
warnings.warn('Could not parse file %s' %file)
|
||||||
|
|
||||||
|
# parse event.xml
|
||||||
|
DOM = ET.parse(stdin).getroot()
|
||||||
|
geolocator = Photon()
|
||||||
|
|
||||||
|
# iterate over all events
|
||||||
|
for event in DOM.iterfind('qml:eventParameters/qml:event', namespaces):
|
||||||
|
publicID = event.attrib['publicID'].split('/')[2]
|
||||||
|
lat = event.find('./qml:origin/qml:latitude/qml:value', namespaces).text
|
||||||
|
lng = event.find('./qml:origin/qml:longitude/qml:value', namespaces).text
|
||||||
|
evaluationMode = event.find('./qml:origin/qml:evaluationMode', namespaces).text
|
||||||
|
|
||||||
|
if publicID in geolocationTable:
|
||||||
|
warnings.warn('Skipping cached event %s' %(publicID))
|
||||||
|
elif evaluationMode == 'automatic':
|
||||||
|
warnings.warn('Skipping automatic event %s' %(publicID))
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
location = geolocator.reverse("{lat}, {lng}".format(lat=lat, lng=lng))
|
||||||
|
except:
|
||||||
|
warnings.warn('Reverse Geolocation failed. Skipping event.')
|
||||||
|
sleep(1.1)
|
||||||
|
continue
|
||||||
|
place = []
|
||||||
|
try:
|
||||||
|
place = location.raw['properties']['city']
|
||||||
|
except KeyError:
|
||||||
|
try:
|
||||||
|
place = location.raw['properties']['town']
|
||||||
|
except KeyError:
|
||||||
|
try:
|
||||||
|
place = location.raw['properties']['village']
|
||||||
|
except KeyError:
|
||||||
|
try:
|
||||||
|
place = location.raw['properties']['county']
|
||||||
|
except KeyError:
|
||||||
|
warnings.warn('Could not extract city for event {0} at {1} N / {2} E (URL: {3})'.format(publicID, lat, lng, url))
|
||||||
|
warnings.warn('Sucessfully looked up location for event {0}.'.format(publicID))
|
||||||
|
geolocationTable[publicID] = place
|
||||||
|
sleep(1.1)
|
||||||
|
|
||||||
|
# dump json
|
||||||
|
print 'var geolocationTable = '+JSON.dumps(geolocationTable, sort_keys=True)+';'
|
||||||
|
|
||||||
|
# __main__
|
||||||
|
if __name__ == "__main__":
|
||||||
|
def printline(line):
|
||||||
|
print line
|
||||||
|
|
||||||
|
# parse arguments
|
||||||
|
import argparse
|
||||||
|
versionText = '$Revision$ ($Date$, $Author$)'.replace('$', '').replace(':','')
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description='Reverese geocoding lookup of events in xml format (stdin).',
|
||||||
|
epilog=versionText)
|
||||||
|
parser.add_argument('-v', '-V', '--version', action='version',
|
||||||
|
version=versionText)
|
||||||
|
parser.add_argument('-f', '--file', action='store', dest='file',
|
||||||
|
help='read in JSON file containing old output.')
|
||||||
|
cla = parser.parse_args()
|
||||||
|
|
||||||
|
# call mkGeolocationTable(...)
|
||||||
|
mkGeolocationTable(file=cla.file)
|
||||||
@@ -0,0 +1,407 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
Get waveform data from FDSN web service and create a fancy plot
|
||||||
|
This programme runs as a script or as a WSGI application.
|
||||||
|
|
||||||
|
Subversion information:
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
:license
|
||||||
|
Copyright 2020 Kasper Fischer <kasper.fischer@ruhr-uni-bochum.de>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
MA 02110-1301, USA.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def utc2local(utctime, timezone='Europe/Berlin'):
|
||||||
|
"""
|
||||||
|
utc2local(utctime, timezone='Europe/Berlin')
|
||||||
|
converts the UTCDateTime object utctime into a
|
||||||
|
datetime object of the given timezone
|
||||||
|
"""
|
||||||
|
|
||||||
|
import pytz
|
||||||
|
|
||||||
|
utc = pytz.utc
|
||||||
|
local = pytz.timezone(timezone)
|
||||||
|
utctime = utc.localize(utctime.datetime)
|
||||||
|
return local.normalize(utctime.astimezone(local))
|
||||||
|
|
||||||
|
|
||||||
|
def fancy_plot(st, wsgi=False, img_format='png', color=True):
|
||||||
|
"""
|
||||||
|
creating fancy plot from ObsPy stream st
|
||||||
|
returns cStringIO object if wsgi == True
|
||||||
|
:type st: ObsPy Stream object
|
||||||
|
:type wsgi: bool
|
||||||
|
:type img_format: str
|
||||||
|
:type color: bool
|
||||||
|
"""
|
||||||
|
|
||||||
|
import matplotlib as mpl
|
||||||
|
from matplotlib.dates import date2num, AutoDateLocator, AutoDateFormatter
|
||||||
|
|
||||||
|
if wsgi:
|
||||||
|
try:
|
||||||
|
import cStringIO as StringIO
|
||||||
|
except ImportError:
|
||||||
|
import StringIO as StringIO
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from numpy import arange
|
||||||
|
|
||||||
|
# setup figure parameters
|
||||||
|
if wsgi:
|
||||||
|
mpl.rcParams['figure.figsize'] = [12.0, 6.75] # 16:9 aspect ratio
|
||||||
|
else:
|
||||||
|
mpl.rcParams['figure.figsize'] = [16.0, 9.0] # 16:9 aspect ratio
|
||||||
|
|
||||||
|
# get starttime, endtime, localtime and timezone
|
||||||
|
tr = st[0]
|
||||||
|
stime = tr.stats.starttime
|
||||||
|
etime = tr.stats.endtime
|
||||||
|
localtime = utc2local(stime)
|
||||||
|
if localtime.tzname() == u'CET':
|
||||||
|
tzname = u'MEZ'
|
||||||
|
else:
|
||||||
|
tzname = u'MESZ'
|
||||||
|
tz = localtime.timetz().tzinfo
|
||||||
|
|
||||||
|
# create proper time vector
|
||||||
|
d = arange(date2num(stime), date2num(etime), (date2num(etime) - date2num(stime)) / tr.stats.npts)
|
||||||
|
|
||||||
|
# setup time axis decorator
|
||||||
|
locator = AutoDateLocator(interval_multiples=True, minticks=5, maxticks=8, tz=tz)
|
||||||
|
minor_locator = AutoDateLocator(interval_multiples=True, minticks=9, maxticks=70, tz=tz)
|
||||||
|
formatter = AutoDateFormatter(locator, tz=tz)
|
||||||
|
formatter.scaled[1. / (24. * 60.)] = '%H:%M:%S'
|
||||||
|
formatter.scaled[1. / (24. * 60. * 60. * 10.)] = '%H:%M:%S.%f'
|
||||||
|
|
||||||
|
# draw figure
|
||||||
|
if color:
|
||||||
|
trace_color = {'Z': 'r', 'N': 'b', 'E': 'g'}
|
||||||
|
else:
|
||||||
|
trace_color = {'Z': 'k', 'N': 'k', 'E': 'k'}
|
||||||
|
|
||||||
|
fig = plt.figure()
|
||||||
|
|
||||||
|
ax1 = fig.add_subplot(311)
|
||||||
|
ax1.xaxis.set_major_locator(locator)
|
||||||
|
ax1.xaxis.set_major_formatter(formatter)
|
||||||
|
ax1.plot_date(d, st.select(component='Z')[0].data * 1000., trace_color['Z'], label=u'Z', tz=tz)
|
||||||
|
plt.title(u'Station %s' % st[0].stats.station, fontsize=24)
|
||||||
|
plt.legend(loc='upper right')
|
||||||
|
ax1.grid(b=True)
|
||||||
|
|
||||||
|
ax2 = fig.add_subplot(312, sharex=ax1, sharey=ax1)
|
||||||
|
ax2.plot_date(d, st.select(component='N')[0].data * 1000., trace_color['N'], label=u'N', tz=tz)
|
||||||
|
ax2.grid(b=True)
|
||||||
|
plt.ylabel(u'Geschwindigkeit [mm/s]', fontsize=16)
|
||||||
|
plt.legend(loc='upper right')
|
||||||
|
|
||||||
|
ax3 = fig.add_subplot(313, sharex=ax1, sharey=ax1)
|
||||||
|
ax3.plot_date(d, st.select(component='E')[0].data * 1000., trace_color['E'], label=u'E', tz=tz)
|
||||||
|
ax3.grid(b=True)
|
||||||
|
plt.legend(loc='upper right')
|
||||||
|
|
||||||
|
plt.xlabel(u'%s (%s)' % (localtime.strftime('%d.%m.%Y'), tzname), fontsize=16)
|
||||||
|
ax1.minorticks_on()
|
||||||
|
ax1.xaxis.set_minor_locator(minor_locator)
|
||||||
|
|
||||||
|
if wsgi:
|
||||||
|
buf = StringIO.StringIO()
|
||||||
|
plt.savefig(buf, format=img_format, facecolor="lightgray")
|
||||||
|
return buf
|
||||||
|
else:
|
||||||
|
if cla['filename']:
|
||||||
|
plt.savefig(cla['filename'], dpi=300, transparent=True)
|
||||||
|
else:
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
def trace_dayplot(st, deltat = None,
|
||||||
|
ftype='none', fmin=1.0, fmax=7.0,
|
||||||
|
col=('b', 'r', 'g'), interval=20, outpattern='',
|
||||||
|
wsgi=False):
|
||||||
|
"""
|
||||||
|
|
||||||
|
:type st: object
|
||||||
|
:type ftype: str
|
||||||
|
:type fmin: float
|
||||||
|
:type fmax: float
|
||||||
|
:type col: tuple
|
||||||
|
:type interval: float
|
||||||
|
:type outpattern: str
|
||||||
|
:type wsgi: bool
|
||||||
|
"""
|
||||||
|
|
||||||
|
if wsgi:
|
||||||
|
try:
|
||||||
|
import cStringIO as StringIO
|
||||||
|
except ImportError:
|
||||||
|
import StringIO as StringIO
|
||||||
|
|
||||||
|
# filter
|
||||||
|
if (ftype == 'bandpass') or (ftype == 'bandstop'):
|
||||||
|
st.filter(ftype, freqmin=fmin, freqmax=fmax)
|
||||||
|
elif (ftype == 'lowpass') or (ftype == 'highpass'):
|
||||||
|
st.filter(ftype, freq=fmin)
|
||||||
|
st.merge()
|
||||||
|
|
||||||
|
stime = st[0].stats.starttime
|
||||||
|
if deltat:
|
||||||
|
etime = stime + deltat
|
||||||
|
else:
|
||||||
|
etime = st[0].stats.endtime
|
||||||
|
|
||||||
|
# plot
|
||||||
|
for i in range(0, len(st)):
|
||||||
|
if wsgi:
|
||||||
|
buf = StringIO.StringIO()
|
||||||
|
st[i].plot(outfile=buf, format=outpattern, type='dayplot', color=col, interval=interval,
|
||||||
|
starttime=stime, endtime=etime)
|
||||||
|
return buf
|
||||||
|
else:
|
||||||
|
if outpattern != '':
|
||||||
|
imagefile = outpattern.format(st[i].stats.network,
|
||||||
|
st[i].stats.station,
|
||||||
|
st[i].stats.channel,
|
||||||
|
st[i].stats.starttime.year,
|
||||||
|
st[i].stats.starttime.julday)
|
||||||
|
st[i].plot(type='dayplot', color=col, interval=interval,
|
||||||
|
outfile=imagefile)
|
||||||
|
else:
|
||||||
|
st[i].plot(type='dayplot', color=col, interval=interval)
|
||||||
|
|
||||||
|
|
||||||
|
def get_fdsn(bulk_request, output='VEL', base_url='https://ariadne.geophysik.ruhr-uni-bochum.de'):
|
||||||
|
"""
|
||||||
|
Fetches waveform data from FDSN web service and returns
|
||||||
|
instrument corrected seismogram of type given in parameter output.
|
||||||
|
Acceptable values for output are "VEL", "DISP" and "ACC" (see ObsPy documentation)
|
||||||
|
|
||||||
|
:rtype : object
|
||||||
|
:param bulk_request: list
|
||||||
|
:param output: str
|
||||||
|
:param base_url: str
|
||||||
|
:return: ObsPy Stream() object
|
||||||
|
"""
|
||||||
|
import warnings
|
||||||
|
from obspy.fdsn import Client
|
||||||
|
from obspy.fdsn.header import FDSNException
|
||||||
|
|
||||||
|
try:
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
|
client = Client(base_url=base_url, debug=False)
|
||||||
|
st = client.get_waveforms_bulk(bulk_request, attach_response=True)
|
||||||
|
|
||||||
|
st.merge()
|
||||||
|
stime = st[0].stats.starttime
|
||||||
|
etime = st[0].stats.endtime
|
||||||
|
for trace in st.traces:
|
||||||
|
stime = max(stime, trace.stats.starttime)
|
||||||
|
etime = min(etime, trace.stats.endtime)
|
||||||
|
st.trim(starttime=stime, endtime=etime)
|
||||||
|
|
||||||
|
# choose 1 s taper
|
||||||
|
taper_fraction = 1 / (etime - stime)
|
||||||
|
for trace in st.traces:
|
||||||
|
# filter, remove response
|
||||||
|
trace.filter('bandpass', freqmin=0.01, freqmax=25, corners=3, zerophase=False). \
|
||||||
|
remove_response(output=output, zero_mean=True, taper=True, taper_fraction=taper_fraction)
|
||||||
|
return st
|
||||||
|
except FDSNException:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def main(backend=None, args=None, wsgi=False):
|
||||||
|
"""
|
||||||
|
Main function to create a waveform plot.
|
||||||
|
This functions calls get_fdsn and fancy_plot to create the figure.
|
||||||
|
If wsgi == True it returns an ioString object containing the figure.
|
||||||
|
|
||||||
|
:type backend: str
|
||||||
|
:type args: dict
|
||||||
|
:type wsgi: bool
|
||||||
|
:rtype : object
|
||||||
|
:param backend:
|
||||||
|
:param args:
|
||||||
|
:param wsgi:
|
||||||
|
:return: ioString object with created image
|
||||||
|
"""
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
import matplotlib as mpl
|
||||||
|
|
||||||
|
if wsgi:
|
||||||
|
backend = 'Agg'
|
||||||
|
if backend:
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
|
mpl.use(backend)
|
||||||
|
from obspy import UTCDateTime
|
||||||
|
|
||||||
|
if args:
|
||||||
|
deltat = args['length']
|
||||||
|
if args['stime']:
|
||||||
|
otime = UTCDateTime(args['stime'])
|
||||||
|
else:
|
||||||
|
otime = UTCDateTime() - 3600. - deltat
|
||||||
|
network = args['station'].split('.')[0]
|
||||||
|
station = args['station'].split('.')[1]
|
||||||
|
if args['type'] == 'dayplot':
|
||||||
|
if network == 'Z3':
|
||||||
|
channel = 'HHZ'
|
||||||
|
else:
|
||||||
|
channel = 'BHZ'
|
||||||
|
else:
|
||||||
|
if args['length'] < 3600.:
|
||||||
|
channel = 'HH?'
|
||||||
|
else:
|
||||||
|
if network == 'Z3':
|
||||||
|
channel = 'HH?'
|
||||||
|
else:
|
||||||
|
channel = 'BH?'
|
||||||
|
else:
|
||||||
|
otime = UTCDateTime() - 3600.
|
||||||
|
deltat = 30
|
||||||
|
network = 'GR'
|
||||||
|
station = 'BUG'
|
||||||
|
channel = 'HH?'
|
||||||
|
|
||||||
|
st = get_fdsn([(network, station, '*', channel, otime, otime + deltat)], base_url=args['server'])
|
||||||
|
if st is not None:
|
||||||
|
stime = max(st[0].stats.starttime, otime)
|
||||||
|
etime = min(st[0].stats.endtime, otime + deltat)
|
||||||
|
st.trim(starttime=stime, endtime=etime)
|
||||||
|
|
||||||
|
if wsgi:
|
||||||
|
if args['type'] == 'dayplot':
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
|
return trace_dayplot(st, outpattern=args['format'], wsgi=wsgi, deltat=deltat)
|
||||||
|
else:
|
||||||
|
return fancy_plot(st, wsgi=wsgi, img_format=args['format'], color=args['color'])
|
||||||
|
else:
|
||||||
|
if args['type'] == 'dayplot':
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
|
trace_dayplot(st, wsgi=wsgi)
|
||||||
|
else:
|
||||||
|
fancy_plot(st, color=args['color'])
|
||||||
|
elif not wsgi:
|
||||||
|
warnings.warn('No data available!')
|
||||||
|
|
||||||
|
|
||||||
|
def application(environ, start_response):
|
||||||
|
"""
|
||||||
|
Function application - Wrapper to process wsgi request
|
||||||
|
:param environ: contains information on the wsgi environment
|
||||||
|
:type environ: dict
|
||||||
|
:param start_response: function to process response header by the wsgi server
|
||||||
|
:type start_response: function
|
||||||
|
:return: response to be sent to the client by the wsgi server
|
||||||
|
:rtype: list
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
from cgi import FieldStorage
|
||||||
|
|
||||||
|
# set HOME environment variable to a directory the httpd server can write to
|
||||||
|
# otherwise matplotlib won't work
|
||||||
|
os.environ['HOME'] = '/tmp/wsgi-kasper'
|
||||||
|
try:
|
||||||
|
os.mkdir('/tmp/wsgi-kasper')
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# fake command line arguments
|
||||||
|
# setting needed default values
|
||||||
|
wsgi_args = {'server': 'http://localhost/'}
|
||||||
|
|
||||||
|
# fill wsgi_args with environment variables
|
||||||
|
form = FieldStorage(fp=environ['wsgi.input'], environ=environ)
|
||||||
|
wsgi_args['station'] = form.getfirst('station', 'GR.BUG').upper()
|
||||||
|
wsgi_args['stime'] = form.getfirst('start_time', [])
|
||||||
|
wsgi_args['length'] = form.getfirst('length', '30')
|
||||||
|
wsgi_args['length'] = abs(int(wsgi_args['length']))
|
||||||
|
wsgi_args['format'] = form.getfirst('format', 'png').lower()
|
||||||
|
if wsgi_args['format'] != 'png' and wsgi_args['format'] != 'svg':
|
||||||
|
wsgi_args['format'] = 'png'
|
||||||
|
wsgi_args['color'] = form.getfirst('color', 'TRUE').upper()
|
||||||
|
if wsgi_args['color'] == 'FALSE':
|
||||||
|
wsgi_args['color'] = False
|
||||||
|
else:
|
||||||
|
wsgi_args['color'] = True
|
||||||
|
wsgi_args['type'] = form.getfirst('type', '').lower()
|
||||||
|
if (wsgi_args['type'] != 'dayplot' and wsgi_args['type'] != 'normal') or wsgi_args['type'] == '':
|
||||||
|
if wsgi_args['length'] < 43200:
|
||||||
|
wsgi_args['type'] = 'normal'
|
||||||
|
else:
|
||||||
|
wsgi_args['type'] = 'dayplot'
|
||||||
|
|
||||||
|
# process the request
|
||||||
|
buf = main(args=wsgi_args, backend='Agg', wsgi=True)
|
||||||
|
if buf is not None:
|
||||||
|
data = buf.getvalue()
|
||||||
|
buf.close()
|
||||||
|
data_length = len(data)
|
||||||
|
|
||||||
|
if wsgi_args['format'] == 'svg':
|
||||||
|
wsgi_args['format'] = 'svg+xml'
|
||||||
|
start_response('200 OK', [('Content-Type', 'image/%s' % wsgi_args['format']), ('Content-Length', '%d' % data_length)])
|
||||||
|
return [data]
|
||||||
|
else:
|
||||||
|
start_response('400 Bad Request', [])
|
||||||
|
return []
|
||||||
|
|
||||||
|
# __main__
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import os
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description=u'Get event waveform data of all RuhrNet stations.',
|
||||||
|
epilog=u'$Revision$ ($Date$, $Author$)'.replace(
|
||||||
|
"$", ""))
|
||||||
|
parser.add_argument(u'-v', u'-V', u'--version', action='version',
|
||||||
|
version=u'$Revision$ ($Date$, \
|
||||||
|
$Author$)'.replace('$', ''))
|
||||||
|
parser.add_argument(u'-u', u'--url', action='store', dest='server',
|
||||||
|
default=u'https://ariadne.geophysik.ruhr-uni-bochum.de',
|
||||||
|
help=u'Base URL of the FDSN web service (https://ariadne.geophysik.ruhr-uni-bochum.de).')
|
||||||
|
parser.add_argument(u'-t', u'--type', action='store', dest='type', metavar='TYPE',
|
||||||
|
help=u'Type of plot: normal or dayplot.')
|
||||||
|
parser.add_argument(u'-f', u'--file', action='store', dest='filename', metavar='FILENAME',
|
||||||
|
help=u'Save plot to file FILENAME')
|
||||||
|
parser.add_argument(u'-c', u'--color', action='store_true', help=u'Create color plot.')
|
||||||
|
parser.add_argument(u'-l', u'--length', action='store', type=int, default=30,
|
||||||
|
help=u'Length of waveform window in seconds (30 s).')
|
||||||
|
group = parser.add_mutually_exclusive_group(required=True)
|
||||||
|
group.add_argument(u'-s', u'--start_time', dest='stime', action='store', metavar='START',
|
||||||
|
help=u'Start time of waveform window.')
|
||||||
|
group.add_argument(u'-e', u'--event', action='store', metavar='EVENTID',
|
||||||
|
help=u'Get starttime from event P-phase onset at station.')
|
||||||
|
parser.add_argument(u'station', action='store', metavar='NET.STATION',
|
||||||
|
help=u'Station to plot.')
|
||||||
|
|
||||||
|
cla = vars(parser.parse_args())
|
||||||
|
|
||||||
|
if os.getenv('DISPLAY'):
|
||||||
|
main(args=cla)
|
||||||
|
else:
|
||||||
|
main('Agg', cla)
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
def application(environ, start_response):
|
||||||
|
"""
|
||||||
|
Function application - Wrapper to process wsgi request
|
||||||
|
:param environ: contains information on the wsgi environment
|
||||||
|
:type environ: dict
|
||||||
|
:param start_response: function to process response header by the wsgi server
|
||||||
|
:type start_response: function
|
||||||
|
:return: response to be sent to the client by the wsgi server
|
||||||
|
:rtype: list
|
||||||
|
"""
|
||||||
|
|
||||||
|
from cgi import FieldStorage
|
||||||
|
|
||||||
|
form = FieldStorage(fp=environ['wsgi.input'], environ=environ)
|
||||||
|
|
||||||
|
start_response('200 OK', [('Content-Type', 'text/html')])
|
||||||
|
return [form]
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
Produce a dayplot from seismogram recordings
|
||||||
|
|
||||||
|
Subversion information:
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
license: gpl3
|
||||||
|
Copyright 2012-2020 Seismological Observatory, Ruhr-University Bochum
|
||||||
|
http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs
|
||||||
|
Contributors:
|
||||||
|
Martina Rische <martina.rische@rub.de>
|
||||||
|
Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
|
Sebastian Wehling-Benatelli <sebastian.wehling@rub.de>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def trace_dayplot(st, ftype='bandpass', fmin=1.0, fmax=7.0,
|
||||||
|
col=('b', 'r', 'g'), interval=20.0, outpattern=''):
|
||||||
|
"""
|
||||||
|
|
||||||
|
:type st: object
|
||||||
|
:type ftype: str
|
||||||
|
:type fmin: float
|
||||||
|
:type fmax: float
|
||||||
|
:type col: tuple
|
||||||
|
:type interval: float
|
||||||
|
:type outpattern: str
|
||||||
|
"""
|
||||||
|
|
||||||
|
# filter
|
||||||
|
if (ftype == 'bandpass') or (ftype == 'bandstop'):
|
||||||
|
st.filter(ftype, freqmin=fmin, freqmax=fmax)
|
||||||
|
elif (ftype == 'lowpass') or (ftype == 'highpass'):
|
||||||
|
st.filter(ftype, freq=fmin)
|
||||||
|
st.merge()
|
||||||
|
|
||||||
|
# plot
|
||||||
|
for i in range(0, len(st)):
|
||||||
|
if outpattern != '':
|
||||||
|
imagefile = outpattern.format(st[i].stats.network,
|
||||||
|
st[i].stats.station,
|
||||||
|
st[i].stats.channel,
|
||||||
|
st[i].stats.starttime.year,
|
||||||
|
st[i].stats.starttime.julday)
|
||||||
|
st[i].plot(type='dayplot', color=col, interval=interval,
|
||||||
|
outfile=imagefile)
|
||||||
|
else:
|
||||||
|
st[i].plot(type='dayplot', color=col, interval=interval)
|
||||||
|
|
||||||
|
|
||||||
|
# __main__
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
# parse arguments
|
||||||
|
import argparse
|
||||||
|
from obspy.core import read
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description='Produce filtered 24h-plot (dayplot).',
|
||||||
|
epilog='$Rev: 403 $ ($Date: 2012-04-13 12:16:22 +0200 (Fri, 13 Apr 2012) $, $Author: kasper $)')
|
||||||
|
parser.add_argument('-v', '-V', '--version', action='version',
|
||||||
|
version='$Rev: 403 $ ($Date: 2012-04-13 12:16:22 +0200 (Fri, 13 Apr 2012) $, $Author: kasper $)')
|
||||||
|
parser.add_argument('file', action='store', metavar='FILE', nargs='+',
|
||||||
|
help='File(s) to use for the dayplot. One dayplot will be used for every file. \
|
||||||
|
Use wildcards to use multiple file for one plot')
|
||||||
|
parser.add_argument('-f', '--filter', action='store', dest='ftype',
|
||||||
|
default='bandpass',
|
||||||
|
choices=['none', 'bandpass', 'bandstop', 'lowpass', 'highpass'],
|
||||||
|
help='Select filtertype to filter the data (default: bandpass)\
|
||||||
|
Note: For low- and highpass only fmin is used.')
|
||||||
|
parser.add_argument('--fmin', action='store', type=float, dest='fmin',
|
||||||
|
default=1.0,
|
||||||
|
help='Lower frequency of the filter in Hz (default: 1.0)')
|
||||||
|
parser.add_argument('--fmax', action='store', type=float, dest='fmax',
|
||||||
|
default=7.0,
|
||||||
|
help='Upper frequency of the filter in Hz (default: 7.0)')
|
||||||
|
parser.add_argument('-c', '--color', '--colour', action='store', dest='color',
|
||||||
|
default=('b', 'r', 'g'),
|
||||||
|
help='Color selection to use in the dayplot (default: brg)')
|
||||||
|
parser.add_argument('-i', '--interval', action='store', type=int, dest='interval',
|
||||||
|
default=20,
|
||||||
|
help='Interval length to show in each line of the dayplot in minutes (default: 20)')
|
||||||
|
parser.add_argument('-o', '--output', action='store', dest='outpattern',
|
||||||
|
default='',
|
||||||
|
help="Output filename pattern for the plot. (default: unset, show plot on screen only), \
|
||||||
|
Use {0} to substitute network code, \
|
||||||
|
{1} to substitute station code, \
|
||||||
|
{2} to substitute station channel, \
|
||||||
|
{3} to substitute year, \
|
||||||
|
{4} to substitute doy number \
|
||||||
|
.format (supported formats: emf, eps, pdf, png, ps, raw, rgba, svg, svgz)")
|
||||||
|
|
||||||
|
cla = parser.parse_args()
|
||||||
|
if cla.fmin < 0:
|
||||||
|
cla.fmin = -cla.fmin
|
||||||
|
if cla.fmax < 0:
|
||||||
|
cla.fmax = -cla.fmax
|
||||||
|
|
||||||
|
# call trace_dayplot(...) for each file
|
||||||
|
for datafile in cla.file:
|
||||||
|
trace_dayplot(read(datafile), cla.ftype, cla.fmin, cla.fmax, cla.color,
|
||||||
|
cla.interval, cla.outpattern)
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Allow from all
|
||||||
|
Header always set Access-Control-Allow-Origin "https://fdsnws.geophysik.ruhr-uni-bochum.de"
|
||||||
|
Header always append Access-Control-Allow-Origin "https://photon.komoot.de"
|
||||||
|
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
|
||||||
|
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
|
||||||
|
Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location"
|
||||||
|
Header always set Access-Control-Max-Age "600"
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<div class="accordioncontent">
|
||||||
|
<p >Das Urheberrecht der verwendeten Daten, Kartengrundlagen und
|
||||||
|
JavaScript Dateien liegt bei dem jeweiligen Urheber. Die
|
||||||
|
Benutzung unterliegt verschiedenen Lizenzen. Eine normale
|
||||||
|
Nutzung zur Darstellung im Internet ist dabei bei den benutzten
|
||||||
|
Quellen frei mögliche. Eine darüber hinaus gehende Nutzung (z.
|
||||||
|
B. drucken, speichern, Weiterverwendung in anderen Publikationen
|
||||||
|
etc.) ist nur unter <b>Beachtung der verschiedenen Lizenzen</b>
|
||||||
|
möglich. Diese sind im folgenden zusammengefasst.</p>
|
||||||
|
|
||||||
|
<h4>Kartengrundlage und Nominatim Dienst</h4>
|
||||||
|
<p>Die Kartengrundlagen und der Nominatim Dienst (reverse
|
||||||
|
Geocodierung) basieren auf Daten des <a
|
||||||
|
href="//www.openstreetmap.org" target="_blank">OpenStreetMap</a>
|
||||||
|
Projektes und wurden durch <a href="//www.mapquest.com/"
|
||||||
|
target="_blank">MapQuest</a> <img alt="Mapquest Logo"
|
||||||
|
src="//developer.mapquest.com/content/osm/mq_logo.png" /> zur
|
||||||
|
Verfügung gestellt. Hierfür gelten die „<a
|
||||||
|
href="//developer.mapquest.com/web/info/terms-of-use"
|
||||||
|
target="_blank">Terms of use</a>“ des Anbieters. Diese gestatten
|
||||||
|
eine nicht-kommerzielle, öffentlich zugängliche Nutzung.</p>
|
||||||
|
|
||||||
|
<h4>Ereignisdaten und Stationsdaten</h4>
|
||||||
|
<p>Die dargestellten Daten der seismischen Ereignisse und der
|
||||||
|
seismischen Stationen unterliegen der „<a
|
||||||
|
href="http://opendatacommons.org/licenses/odbl/summary"
|
||||||
|
target="_blank">Open Data Commons Open Database Lizenz</a>“
|
||||||
|
(ODbL). Die Daten dürfen frei kopieren, weitergegeben,
|
||||||
|
übermittel sowie angepasst werden, sofern das <a
|
||||||
|
href="http://www.gmg.ruhr-uni-bochum.de"
|
||||||
|
target="_blamk">Seismologische Observatorium der
|
||||||
|
Ruhr-Universität</a> als Quelle genannt wird. Werden diese Daten
|
||||||
|
wiederverwendet, so unterliegen sie weiterhin dieser Lizenz. Der
|
||||||
|
vollständige <a
|
||||||
|
href="http://opendatacommons.org/licenses/odbl/1.0/"
|
||||||
|
target="_blank">Lizenztext</a> erläutert die Rechte und
|
||||||
|
Pflichten dieser Lizenz.</p>
|
||||||
|
|
||||||
|
<h4>JavaScript Dateien</h4>
|
||||||
|
<p>Diese Webseite benutzt verschiedene JavaScript Bibliotheken,
|
||||||
|
die unterschiedlichen Lizenzen unterliegen. Die jeweiligen
|
||||||
|
Lizenzen werden in der Regel im Quellcode der benutzten
|
||||||
|
Bibliotheken aufgeführt.</p>
|
||||||
|
|
||||||
|
<h4>Sonstiger Inhalt</h4>
|
||||||
|
<p>Sonstiger Inhalt dieser Webseite unterliegt der
|
||||||
|
„Creative-Commons''-Lizenz „<a
|
||||||
|
href="https://creativecommons.org/licenses/by-sa/4.0/deed.de"
|
||||||
|
target="_blank">Namensnennung – Weitergabe unter gleichen
|
||||||
|
Bedingungen</a>“ 4.0 (CC BY-SA). Der vollständige <a
|
||||||
|
href="https://creativecommons.org/licenses/by-sa/4.0/legalcode"
|
||||||
|
target="_blank">Lizenztext</a> erläutert die Rechte und
|
||||||
|
Pflichten dieser Lizenz.</p>
|
||||||
|
</div>
|
||||||
@@ -1,22 +1,62 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
* events.js *
|
||||||
|
* script for event specific functions and setup *
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
/* License
|
||||||
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* adding row(s) to a table and format date strings afterwards */
|
||||||
|
function addTableRow(row, table) {
|
||||||
|
var added = $('#'+table+' tbody').append(row);
|
||||||
|
added.find('.tablesorter-childRow td').hide();
|
||||||
|
$('#'+table).find('td.utctime-date').each(function() {
|
||||||
|
$.localtime.formatObject($(this), "dd.MM.yyyy");
|
||||||
|
$(this).removeClass('utctime-date');
|
||||||
|
$(this).addClass('localtime-date');
|
||||||
|
});
|
||||||
|
$('#'+table).find('td.utctime-time').each(function() {
|
||||||
|
$.localtime.formatObject($(this), "HH:mm");
|
||||||
|
$(this).removeClass('utctime-time');
|
||||||
|
$(this).addClass('localtime-time');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/* do reverse geolocation lookup */
|
/* do reverse geolocation lookup */
|
||||||
function getGeolocation(id, lat, lng) {
|
function getGeolocation(id, lat, lng) {
|
||||||
if ( !geolocationTable[id] ) {
|
if ( $.inArray(id, geolocationTable) == -1 ) {
|
||||||
// $.getJSON( "//nominatim.openstreetmap.org/reverse", { lat: lat, lon: lng, zoom: 10, format: "json" } )
|
$.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng } )
|
||||||
$.getJSON( "//open.mapquestapi.com/nominatim/v1/reverse.php", { lat: lat, lon: lng, zoom: 10, format: "json" } )
|
|
||||||
.done(function( json ) {
|
.done(function( json ) {
|
||||||
var city = json.address["city"];
|
if ( json.features[0] ) {
|
||||||
var country = json.address["country"];
|
var city = json.features[0].properties.city;
|
||||||
var countryCode = json.address["country_code"].toUpperCase();
|
var countryCode = json.features[0].properties.country;
|
||||||
geolocationTable[id] = city;
|
geolocationTable[id] = city;
|
||||||
( country != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
|
( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
|
||||||
if ( city ) {
|
if ( city ) {
|
||||||
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
|
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
|
||||||
var sort = [[0,1],[1,1],[2,1]];
|
var sort = [[0,1],[1,1],[2,1]];
|
||||||
$("#eventstable").trigger("update", [true]);
|
$("#eventstable").trigger("update", [true]);
|
||||||
$("#eventstable").trigger("updateCache");
|
$("#eventstable").trigger("updateCache");
|
||||||
$("#eventstable").trigger("sorton", [sort]);
|
$("#eventstable").trigger("sorton", [sort]);
|
||||||
} else {
|
} else {
|
||||||
console.log("Nominatim did not provide a city tag for "+lat+" / "+lng);
|
// console.log("Nominatim did not provide a city tag for "+lat+" / "+lng);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.fail(function( jqxhr, textStatus, error ) {
|
.fail(function( jqxhr, textStatus, error ) {
|
||||||
@@ -27,34 +67,44 @@ function getGeolocation(id, lat, lng) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Load events using ajax */
|
/* Load events using ajax */
|
||||||
function ajaxLoadEvents(stime, etime) {
|
function ajaxLoadEvents(stime, etime, eventid, url, target) {
|
||||||
var mapBounds = map.getBounds();
|
var mapBounds = map.getBounds();
|
||||||
var N = mapBounds.getNorth();
|
var request_data = {};
|
||||||
var E = mapBounds.getEast();
|
var rtime;
|
||||||
var S = mapBounds.getSouth();
|
var ajax_url = config['ajax']['eventURL'];
|
||||||
var W = mapBounds.getWest();
|
if ( stime == '' || !stime ) {
|
||||||
var d = 0.1;
|
stime = new Date();
|
||||||
if ( !stime ) {
|
stime.setDate(stime.getDate()-config['map']['timespan']);
|
||||||
var stime = new Date();
|
rtime = new Date();
|
||||||
stime.setDate(stime.getDate()-180);
|
rtime.setDate(rtime.getDate()-Math.min(config['ajax']['timespan'], config['map']['timespan']));
|
||||||
|
} else {
|
||||||
|
rtime = stime;
|
||||||
};
|
};
|
||||||
if ( !etime ) {
|
if ( url ) {
|
||||||
var etime = new Date();
|
var ajax_url = url;
|
||||||
etime.setDate(etime.getDate()+1);
|
request_data = {};
|
||||||
};
|
} else {
|
||||||
var url = "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query"
|
if ( eventid ) {
|
||||||
var request_data = {
|
request_data = { eventid: eventid };
|
||||||
starttime: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
} else {
|
||||||
endtime: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
request_data = {
|
||||||
minlat: S-d,
|
starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()),
|
||||||
maxlat: N+d,
|
orderby: 'time-asc',
|
||||||
minlon: W-d,
|
minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']),
|
||||||
maxlon: E+d,
|
maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']),
|
||||||
minmag: minMag-0.1,
|
minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']),
|
||||||
|
maxlon: sprintf('%.2f', mapBounds.getEast()+config['map']['latlngDelta']),
|
||||||
|
minmag: sprintf('%.1f', config['event']['minMag']-config['event']['minMagDelta']),
|
||||||
|
};
|
||||||
|
if ( etime ) {
|
||||||
|
request_data['endtime'] = sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate());
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
if ( etime == '' || !etime ) { etime = new Date(); };
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: url,
|
url: ajax_url,
|
||||||
data: request_data,
|
data: request_data,
|
||||||
dataType: "xml",
|
dataType: "xml",
|
||||||
success: function (xml) {
|
success: function (xml) {
|
||||||
@@ -64,53 +114,146 @@ function ajaxLoadEvents(stime, etime) {
|
|||||||
var otime = $(this).find('origin > time > value').text();
|
var otime = $(this).find('origin > time > value').text();
|
||||||
var lng = $(this).find('origin > longitude > value').text();
|
var lng = $(this).find('origin > longitude > value').text();
|
||||||
var lat = $(this).find('origin > latitude > value').text();
|
var lat = $(this).find('origin > latitude > value').text();
|
||||||
var mag = $(this).find('magnitude > mag > value').text();
|
var depth = $(this).find('origin > depth > value').text();
|
||||||
var evaluationMode = $(this).find('evaluationMode').text();
|
var evaluationMode = $(this).find('origin > evaluationMode').text();
|
||||||
var evaluationStatus = $(this).find('evaluationStatus').text();
|
var evaluationStatus = $(this).find('origin > evaluationStatus').text();
|
||||||
var type = $(this).find('type').last().text();
|
var type = $(this).find('type').last().text();
|
||||||
var location = getLocation(Number(lat), Number(lng))[0];
|
var location
|
||||||
( location ) ? null : location = $(this).find('description > text').text();
|
|
||||||
// create table row: Date, Time, Mag, Location
|
// create table row: Date, Time, Mag, Location
|
||||||
if ( !eventTable[id] && ( type == 'earthquake' || type == 'induced or triggered event' || type == 'outside of network interest') && evaluationMode != 'automatic' && evaluationStatus != 'preliminary' && Number(mag)+0.05 >= minMag ) {
|
if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] ) >= 0 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) {
|
||||||
|
geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later
|
||||||
|
location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() );
|
||||||
|
// general event info (1st line)
|
||||||
var row = '<tr class="tablesorter-hasChildRow">'
|
var row = '<tr class="tablesorter-hasChildRow">'
|
||||||
+ '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
|
+ '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
|
||||||
+ '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
|
+ '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
|
||||||
+ sprintf('<td class="ar">%.1f</td>', Number(mag))
|
+ sprintf('<td class="ar">%.1f</td>', Number(mag))
|
||||||
+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a><a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
|
+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a> <a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
|
||||||
+ '</tr>';
|
+ '</tr>';
|
||||||
row += '<tr class="tablesorter-childRow">'
|
// setting up event details (2nd line)
|
||||||
+ '<td colspan="4" eventid="'+id+'">not implemented</td></tr>';
|
row += '<tr class="tablesorter-childRow event-details">'
|
||||||
var added = $('#eventstable tbody').append(row);
|
+ '<td colspan="4" eventid="'+id+'">Daten werden geladen ...</td></tr>';
|
||||||
added.find('.tablesorter-childRow td').hide();
|
// setting up download links (3nd line)
|
||||||
$('#eventstable').find('td.utctime-date').each(function() {
|
var xmlurl = sprintf('%s?formatted=true&includearrivals=true&eventid=%s', config['ajax']['eventURL'], id);
|
||||||
$.localtime.formatObject($(this), "dd.MM.yyyy");
|
var oTime = new Date(otime);
|
||||||
$(this).removeClass('utctime-date');
|
if ( ~oTime ) {
|
||||||
$(this).addClass('localtime-date');
|
oTime = new Date(otime.split('.')[0]);
|
||||||
});
|
};
|
||||||
$('#eventstable').find('td.utctime-time').each(function() {
|
var sTime = new Date(oTime.getTime()-10*1000.-oTime.getMilliseconds());
|
||||||
$.localtime.formatObject($(this), "HH:mm");
|
var eTime = new Date(oTime.getTime()+50*1000.-oTime.getMilliseconds());
|
||||||
$(this).removeClass('utctime-time');
|
var mseedurl = sprintf('%s?net=GE,GR,RN&cha=EH?,HH?&start=%04d-%02d-%02dT%02d:%02d:%02d&end=%04d-%02d-%02dT%02d:%02d:%02d', config['ajax']['mseedURL'], Number(sTime.getUTCFullYear()), Number(sTime.getUTCMonth())+1, Number(sTime.getUTCDate()), Number(sTime.getUTCHours()), Number(sTime.getUTCMinutes()), Number(sTime.getUTCSeconds()), Number(eTime.getUTCFullYear()), Number(eTime.getUTCMonth())+1, Number(eTime.getUTCDate()), Number(eTime.getUTCHours()), Number(eTime.getUTCMinutes()), Number(eTime.getUTCSeconds()));
|
||||||
$(this).addClass('localtime-time');
|
row += '<tr class="tablesorter-childRow event-download">'
|
||||||
});
|
+ '<td colspan="4" eventid="'+id+'">'
|
||||||
|
+ sprintf('Download <a class="xml-link" target="_blank" download="%s.xml" href="%s">QuakeML</a> or <a class="mseed-link" target="_blank" download="%s.mseed" href="%s">miniSEED</a>', id, xmlurl, id, mseedurl)
|
||||||
|
+ '</td></tr>';
|
||||||
|
// add row to table
|
||||||
|
if ( stime <= oTime && etime >= oTime ) {
|
||||||
|
addTableRow(row, 'eventstable');
|
||||||
|
};
|
||||||
|
if ( target ) {
|
||||||
|
addTableRow(row, target);
|
||||||
|
}
|
||||||
// create marker
|
// create marker
|
||||||
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag));
|
if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) {
|
||||||
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
|
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type);
|
||||||
+ sprintf('<p>Ereignis: %s</br>', id)
|
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
|
||||||
+ sprintf('Ort: %.4f °N, %.4f °O </br>', Number(lat), Number(lng))
|
+ sprintf('<p>Ereignis: %s<br />', id)
|
||||||
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
|
+ sprintf('Type: %s<br />', type)
|
||||||
marker.bindPopup(text);
|
+ sprintf('Magnitude: %3.1f<br />', Number(mag))
|
||||||
// try to get better location with reverse geolocation lookup (nominatim)
|
+ sprintf('Ort: %.4f °N, %.4f °O <br />', Number(lat), Number(lng))
|
||||||
getGeolocation(id, lat, lng);
|
+ sprintf('Tiefe: %.1f km<br />', Number(depth)/1000.)
|
||||||
|
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
|
||||||
|
marker.bindPopup(text);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
initStationTable();
|
|
||||||
var sort = [[0,1],[1,1],[2,1]];
|
var sort = [[0,1],[1,1],[2,1]];
|
||||||
$("#eventstable").trigger("update", [true]);
|
$("#eventstable").trigger("update", [true]);
|
||||||
$("#eventstable").trigger("updateCache");
|
$("#eventstable").trigger("updateCache");
|
||||||
$("#eventstable").trigger("sorton", [sort]);
|
$("#eventstable").trigger("sorton", [sort]);
|
||||||
initMapLink();
|
initMapLink();
|
||||||
|
eventLayer.bringToBack();
|
||||||
|
highlightFirstEvent();
|
||||||
|
},
|
||||||
|
error: function( jqxhr, textStatus, error ) {
|
||||||
|
var err = textStatus + ", " + error;
|
||||||
|
console.log( "Request Failed: " + err );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// create events csv download link
|
||||||
|
request_data['format'] = 'text';
|
||||||
|
if ( eventid == '' || !eventid ) { $('#events-csv-link').attr('href', config['ajax']['eventURL']+'?'+$.param(request_data)) };
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ajaxLoadEventInfo */
|
||||||
|
function ajaxLoadEventInfo(id) {
|
||||||
|
var request_data = {
|
||||||
|
eventid: id,
|
||||||
|
includeArrivals: true,
|
||||||
|
};
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: config['ajax']['eventURL'],
|
||||||
|
data: request_data,
|
||||||
|
dataType: "xml",
|
||||||
|
success: function (xml) {
|
||||||
|
eventDetails[id] = true;
|
||||||
|
$(xml).find('event').each(function () {
|
||||||
|
var event = $(this);
|
||||||
|
var mag = $(this).find('magnitude > mag > value').text();
|
||||||
|
var otime = $(this).find('origin > time > value').text();
|
||||||
|
var lng = $(this).find('origin > longitude > value').text();
|
||||||
|
var lng_err = $(this).find('origin > longitude > uncertainty').text();
|
||||||
|
var lat = $(this).find('origin > latitude > value').text();
|
||||||
|
var lat_err = $(this).find('origin > latitude > uncertainty').text();
|
||||||
|
var depth = $(this).find('origin > depth > value').text();
|
||||||
|
var depth_err = $(this).find('origin > depth > uncertainty').text();
|
||||||
|
var rms = $(this).find('origin > quality > standardError').text();
|
||||||
|
var gap = $(this).find('origin > quality > azimuthalGap').text();
|
||||||
|
var phases_count = $(this).find('origin > quality > usedPhaseCount').text();
|
||||||
|
var type = $(this).find('type').last().text();
|
||||||
|
// setting up general event info
|
||||||
|
var row = "<pre>"
|
||||||
|
+ sprintf("ID %49s\n", id)
|
||||||
|
+ sprintf("Type %47s\n\n", type)
|
||||||
|
+ "Origin\n"
|
||||||
|
+ sprintf("Date %18s\n", otime.split('T')[0])
|
||||||
|
+ sprintf("Time %18s UTC\n", otime.split('T')[1].substring(0, 11))
|
||||||
|
+ sprintf("Latitude %14.4f °N +- %4.1f km\n",Number(lat), Number(lat_err))
|
||||||
|
+ sprintf("Longitude %13.4f °E +- %4.1f km\n", Number(lng), Number(lng_err))
|
||||||
|
+ sprintf("Depth %14.1f km +- %4.1f km\n", Number(depth)/1000., Number(depth_err)/1000.)
|
||||||
|
+ sprintf("Magnitude %10.1f\n", Number(mag))
|
||||||
|
+ sprintf("Residual RMS %7.1f sec\n", Number(rms))
|
||||||
|
+ sprintf("Azimuthal gap %6.1f °\n\n", Number(gap))
|
||||||
|
+ sprintf("%d Phase arrivals:\n", Number(phases_count))
|
||||||
|
+ "sta net dist azi phase time res wt\n";
|
||||||
|
// adding phase info (TODO sort by distance)
|
||||||
|
$(this).find('origin > arrival').each(function() {
|
||||||
|
var pickid = $(this).find('pickID').text();
|
||||||
|
var azi = $(this).find('azimuth').text();
|
||||||
|
var dist = $(this).find('distance').text();
|
||||||
|
var tres = $(this).find('timeResidual').text();
|
||||||
|
var phase = $(this).find('phase').text();
|
||||||
|
var tweight = $(this).find('timeWeight').text();
|
||||||
|
if ( Number(tweight) > 0.0 ) {
|
||||||
|
var waveformid = event.find('pick[publicID="'+pickid+'"] > waveformID');
|
||||||
|
var networkcode = waveformid.attr('networkCode');
|
||||||
|
var stationcode = waveformid.attr('stationCode');
|
||||||
|
var channel = waveformid.attr('channelCode').substring(2,2);
|
||||||
|
var phasemode = event.find('pick[publicID="'+pickid+'"] > evaluationMode').text().substring(0,1).toUpperCase();
|
||||||
|
var picktime = event.find('pick[publicID="'+pickid+'"] > time > value').text().split('T')[1].substring(0,11);
|
||||||
|
row = row
|
||||||
|
+ sprintf('%-4s %2s %5.1f %5.1f %3s %1s %13s %5.1f %5.2f\n', stationcode, networkcode, Number(dist), Number(azi), phase, phasemode, picktime, Number(tres), Number(tweight));
|
||||||
|
};
|
||||||
|
});
|
||||||
|
row = row + '</pre>';
|
||||||
|
$('#eventstable > tbody > tr.event-details > td[eventid='+id+']').html(row);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
null;
|
||||||
},
|
},
|
||||||
error: function( jqxhr, textStatus, error ) {
|
error: function( jqxhr, textStatus, error ) {
|
||||||
var err = textStatus + ", " + error;
|
var err = textStatus + ", " + error;
|
||||||
@@ -119,54 +262,84 @@ function ajaxLoadEvents(stime, etime) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// add row to table
|
/* toggles visibility of filtered markers
|
||||||
function addEventRow(id, props) {
|
* only events in the event list are shown */
|
||||||
$('#eventstable').tablesorter({
|
function toggleFilteredMarkers() {
|
||||||
sortList: "[[0,0], [1,1]], [2,1]",
|
// show all shown events in map
|
||||||
resort: true,
|
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
|
||||||
showProcessing: true,
|
if ( $(this).attr("eventid") ) {
|
||||||
pager_size: 35
|
map.addLayer(eventTable[$(this).attr("eventid")]);
|
||||||
|
};
|
||||||
});
|
});
|
||||||
var html = '<tr class="tablesorter-hasChildRow">'
|
// hide filtered events in map
|
||||||
+ '<td class="utctime-date">'+props.date+'T'+props.time.split('.')[0]+'Z</td>'
|
$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() {
|
||||||
+ '<td class="utctime-time">'+props.date+'T'+props.time.split('.')[0]+'Z</td>'
|
if ( $(this).attr("eventid") ) {
|
||||||
+ '<td class="ar">'+props.mag+'</td>'
|
map.removeLayer(eventTable[$(this).attr("eventid")]);
|
||||||
+ '<td><a href="#" class="toggle">'+props.location+'</a><a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
|
};
|
||||||
+ '</tr>'
|
|
||||||
+ '<tr class="tablesorter-childRow">'
|
|
||||||
+ '<td colspan="4" eventid="'+id+'">'
|
|
||||||
+ "<pre>ID "+id+"\n\n"
|
|
||||||
+ "Origin\n"
|
|
||||||
+ "Date "+props.date+"\n"
|
|
||||||
+ "Time "+props.time+"\n"
|
|
||||||
+ "Latitude "+props.lat+" deg +/- "+props.lat_err+" km\n"
|
|
||||||
+ "Longitude "+props.lon+" deg +/- "+props.lon_err+" km\n"
|
|
||||||
+ "Depth "+props.depth+" km +/- "+props.depth_err+" km\n"
|
|
||||||
+ "Residual RMS "+props.rms+" s\n"
|
|
||||||
+ "Azimuthal gap "+props.gap+" deg\n\n"
|
|
||||||
+ props.no_phases + " Phase arrivals:\n"
|
|
||||||
+ "sta net dist azi phase time res wt sta\n";
|
|
||||||
for ( i = 0 ; i < props.no_phases ; i++ ) {
|
|
||||||
html += props.phases[i];
|
|
||||||
( i < props.no_phases -1 ) ? html += "\n" : null ;
|
|
||||||
};
|
|
||||||
html += "</pre></td></tr>\n";
|
|
||||||
var added = $('#eventstable tbody').append(html);
|
|
||||||
added.find('.tablesorter-childRow td').hide();
|
|
||||||
$('#eventstable').find('td.utctime-date').each(function() {
|
|
||||||
$.localtime.formatObject($(this), "dd. MM. yyyy");
|
|
||||||
$(this).removeClass('utctime-date');
|
|
||||||
$(this).addClass('localtime-date');
|
|
||||||
});
|
});
|
||||||
$('#eventstable').find('td.utctime-time').each(function() {
|
highlightFirstEvent();
|
||||||
$.localtime.formatObject($(this), "HH:mm");
|
|
||||||
$(this).removeClass('utctime-time');
|
|
||||||
$(this).addClass('localtime-time');
|
|
||||||
});
|
|
||||||
// force resorting
|
|
||||||
$("#eventstable").trigger("update", [true]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Highlight the first event of the event list on the map if no
|
||||||
|
* other event is selected */
|
||||||
|
function highlightFirstEvent() {
|
||||||
|
var highlightStyle = {
|
||||||
|
color: config['event']['markerColorH'],
|
||||||
|
fillColor: config['event']['markerColorH'],
|
||||||
|
fillOpacity: 1,
|
||||||
|
};
|
||||||
|
var normalStyle = {
|
||||||
|
fillColor: config['event']['markerColor'],
|
||||||
|
color: config['event']['markerColor'],
|
||||||
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
};
|
||||||
|
$("#eventstable a.map-link").each( function() {
|
||||||
|
if ( $(this).attr("eventid") ) {
|
||||||
|
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
|
||||||
|
$(this).removeClass('first');
|
||||||
|
$(this).text('Karte');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$("#eventstable > tbody > tr:not(.filtered):visible").first().find("a.map-link").each(function() {
|
||||||
|
if ( $(this).attr("eventid") ) {
|
||||||
|
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
|
||||||
|
eventTable[$(this).attr("eventid")].bringToFront();
|
||||||
|
$(this).addClass('first');
|
||||||
|
$(this).text('Karte (rot)');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function highlightEvent( id ) {
|
||||||
|
var highlightStyle = {
|
||||||
|
color: config['event']['markerColorH'],
|
||||||
|
fillColor: config['event']['markerColorH'],
|
||||||
|
fillOpacity: 1,
|
||||||
|
};
|
||||||
|
var normalStyle = {
|
||||||
|
fillColor: config['event']['markerColor'],
|
||||||
|
color: config['event']['markerColor'],
|
||||||
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
};
|
||||||
|
$("#eventstable > tbody > tr:not(.filtered)").find("a.map-link").each( function() {
|
||||||
|
if ( $(this).attr("eventid") ) {
|
||||||
|
if ( $(this).attr("eventid") == id ) {
|
||||||
|
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
|
||||||
|
eventTable[$(this).attr("eventid")].bringToFront();
|
||||||
|
$(this).addClass('first');
|
||||||
|
$(this).text('Karte (rot)');
|
||||||
|
} else {
|
||||||
|
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
|
||||||
|
$(this).removeClass('first');
|
||||||
|
$(this).text('Karte');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* document ready *
|
||||||
|
**********************************************************************/
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// tablesorter for event list
|
// tablesorter for event list
|
||||||
$("#eventstable").tablesorter(
|
$("#eventstable").tablesorter(
|
||||||
@@ -195,31 +368,33 @@ $(document).ready(function() {
|
|||||||
showProcessing: true,
|
showProcessing: true,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// hide child rows
|
// hide child rows
|
||||||
$('#eventstable > tbody > tr.tablesorter-childRow td').hide();
|
$('#eventstable > tbody > tr.tablesorter-childRow td').hide();
|
||||||
|
|
||||||
// update map after filtering
|
// update map after filtering
|
||||||
$('#eventstable').bind('filterEnd', function(){
|
$('#eventstable').bind('filterEnd', function(){
|
||||||
toggleFilteredMarkers();
|
toggleFilteredMarkers();
|
||||||
});
|
});
|
||||||
|
|
||||||
// highlight first event
|
// highlight first event
|
||||||
$('#eventstable').bind('sortEnd', function(){
|
$('#eventstable').bind('sortEnd', function(){
|
||||||
highlightFirstEvent();
|
highlightFirstEvent();
|
||||||
});
|
});
|
||||||
|
$('#eventstable').bind('pagerComplete', function(){
|
||||||
|
highlightFirstEvent();
|
||||||
|
});
|
||||||
// show / hide event info
|
// show / hide event info
|
||||||
$('#eventstable').delegate('.toggle', 'click' , function(){
|
$('#eventstable').delegate('.toggle', 'click' , function(){
|
||||||
|
// load event details
|
||||||
|
var eventid = $(this).attr('eventid');
|
||||||
|
( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid);
|
||||||
|
|
||||||
// toggle visibility of selected row
|
// toggle visibility of selected row
|
||||||
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
|
||||||
|
|
||||||
// mark currently selected row and remove class selected from all other rows
|
// mark currently selected row and remove class selected from all other rows
|
||||||
// hide other rows
|
// hide other rows
|
||||||
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
|
||||||
$(this).closest('tbody').find('td.selected').each(function(){
|
$(this).closest('tbody').find('td.selected').each(function(){
|
||||||
if ( ! $(this).hasClass('selected-now') ) {
|
if ( ! $(this).hasClass('selected-now') ) {
|
||||||
$(this).hide('slow');
|
$(this).hide();
|
||||||
$(this).removeClass('selected');
|
$(this).removeClass('selected');
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -228,12 +403,39 @@ $(document).ready(function() {
|
|||||||
var selected = $(this).hasClass('selected');
|
var selected = $(this).hasClass('selected');
|
||||||
if ( selected ) {
|
if ( selected ) {
|
||||||
$(this).removeClass('selected');
|
$(this).removeClass('selected');
|
||||||
|
highlightFirstEvent();
|
||||||
} else {
|
} else {
|
||||||
$(this).addClass('selected');
|
$(this).addClass('selected');
|
||||||
|
highlightEvent($(this).attr('eventid'));
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
// update selection / type info
|
||||||
|
$("#events-timespan").text(config['map']['timespan']);
|
||||||
|
$("#events-minmag").text(sprintf('%.1f', config['event']['minMag']));
|
||||||
|
config['event']['typeWhitelist'].map(function(type) {
|
||||||
|
var typetext;
|
||||||
|
( $("#events-type").text() == "Symbole:" ) ? typetext = ' ' : typetext = ', ';
|
||||||
|
switch ( type ) {
|
||||||
|
case 'earthquake':
|
||||||
|
typetext += 'tektonisches Erdbeben (Stern)';
|
||||||
|
break;
|
||||||
|
case 'explosion':
|
||||||
|
typetext += 'Explosion (Sechseck)';
|
||||||
|
break;
|
||||||
|
case 'induced or triggered event':
|
||||||
|
typetext += '(bergbau-)induziertes Ereignis (Kreis)';
|
||||||
|
break;
|
||||||
|
case 'quarry blast':
|
||||||
|
case 'controlled explosion':
|
||||||
|
case 'explosion':
|
||||||
|
typetext += 'Sprengung (Rad)';
|
||||||
|
break;
|
||||||
|
case 'nuclear explosion':
|
||||||
|
typetext += 'Atomwaffentest (Viereck)';
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
$("#events-type").append(typetext);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,441 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
* events.js *
|
||||||
|
* script for event specific functions and setup *
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
/* License
|
||||||
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* adding row(s) to a table and format date strings afterwards */
|
||||||
|
function addTableRow(row, table) {
|
||||||
|
var added = $('#'+table+' tbody').append(row);
|
||||||
|
added.find('.tablesorter-childRow td').hide();
|
||||||
|
$('#'+table).find('td.utctime-date').each(function() {
|
||||||
|
$.localtime.formatObject($(this), "dd.MM.yyyy");
|
||||||
|
$(this).removeClass('utctime-date');
|
||||||
|
$(this).addClass('localtime-date');
|
||||||
|
});
|
||||||
|
$('#'+table).find('td.utctime-time').each(function() {
|
||||||
|
$.localtime.formatObject($(this), "HH:mm");
|
||||||
|
$(this).removeClass('utctime-time');
|
||||||
|
$(this).addClass('localtime-time');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* do reverse geolocation lookup */
|
||||||
|
function getGeolocation(id, lat, lng) {
|
||||||
|
if ( $.inArray(id, geolocationTable) == -1 ) {
|
||||||
|
$.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng } )
|
||||||
|
.done(function( json ) {
|
||||||
|
if ( json.features[0] ) {
|
||||||
|
var city = json.features[0].properties.city;
|
||||||
|
var countryCode = json.features[0].properties.country;
|
||||||
|
geolocationTable[id] = city;
|
||||||
|
( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
|
||||||
|
if ( city ) {
|
||||||
|
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
|
||||||
|
var sort = [[0,1],[1,1],[2,1]];
|
||||||
|
$("#eventstable").trigger("update", [true]);
|
||||||
|
$("#eventstable").trigger("updateCache");
|
||||||
|
$("#eventstable").trigger("sorton", [sort]);
|
||||||
|
} else {
|
||||||
|
// console.log("Nominatim did not provide a city tag for "+lat+" / "+lng);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.fail(function( jqxhr, textStatus, error ) {
|
||||||
|
var err = textStatus + ", " + error;
|
||||||
|
console.log( "Request Failed: " + err );
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Load events using ajax */
|
||||||
|
function ajaxLoadEvents(stime, etime, eventid, url, target) {
|
||||||
|
var mapBounds = map.getBounds();
|
||||||
|
var request_data = {};
|
||||||
|
var rtime;
|
||||||
|
var ajax_url = config['ajax']['eventURL'];
|
||||||
|
if ( stime == '' || !stime ) {
|
||||||
|
stime = new Date();
|
||||||
|
stime.setDate(stime.getDate()-config['map']['timespan']);
|
||||||
|
rtime = new Date();
|
||||||
|
rtime.setDate(rtime.getDate()-Math.min(config['ajax']['timespan'], config['map']['timespan']));
|
||||||
|
} else {
|
||||||
|
rtime = stime;
|
||||||
|
};
|
||||||
|
if ( url ) {
|
||||||
|
var ajax_url = url;
|
||||||
|
request_data = {};
|
||||||
|
} else {
|
||||||
|
if ( eventid ) {
|
||||||
|
request_data = { eventid: eventid };
|
||||||
|
} else {
|
||||||
|
request_data = {
|
||||||
|
starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()),
|
||||||
|
orderby: 'time-asc',
|
||||||
|
minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']),
|
||||||
|
maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']),
|
||||||
|
minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']),
|
||||||
|
maxlon: sprintf('%.2f', mapBounds.getEast()+config['map']['latlngDelta']),
|
||||||
|
minmag: sprintf('%.1f', config['event']['minMag']-config['event']['minMagDelta']),
|
||||||
|
};
|
||||||
|
if ( etime ) {
|
||||||
|
request_data['endtime'] = sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate());
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if ( etime == '' || !etime ) { etime = new Date(); };
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: ajax_url,
|
||||||
|
data: request_data,
|
||||||
|
dataType: "xml",
|
||||||
|
success: function (xml) {
|
||||||
|
$(xml).find('event').each(function () {
|
||||||
|
var id = $(this).attr('publicID').split('/')[2];
|
||||||
|
var mag = $(this).find('magnitude > mag > value').text();
|
||||||
|
var otime = $(this).find('origin > time > value').text();
|
||||||
|
var lng = $(this).find('origin > longitude > value').text();
|
||||||
|
var lat = $(this).find('origin > latitude > value').text();
|
||||||
|
var depth = $(this).find('origin > depth > value').text();
|
||||||
|
var evaluationMode = $(this).find('origin > evaluationMode').text();
|
||||||
|
var evaluationStatus = $(this).find('origin > evaluationStatus').text();
|
||||||
|
var type = $(this).find('type').last().text();
|
||||||
|
var location
|
||||||
|
// create table row: Date, Time, Mag, Location
|
||||||
|
if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] ) >= 0 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) {
|
||||||
|
geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later
|
||||||
|
location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() );
|
||||||
|
// general event info (1st line)
|
||||||
|
var row = '<tr class="tablesorter-hasChildRow">'
|
||||||
|
+ '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
|
||||||
|
+ '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
|
||||||
|
+ sprintf('<td class="ar">%.1f</td>', Number(mag))
|
||||||
|
+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a> <a class="map-link" href="#" eventid="'+id+'">map</a></td>'
|
||||||
|
+ '</tr>';
|
||||||
|
// setting up event details (2nd line)
|
||||||
|
row += '<tr class="tablesorter-childRow event-details">'
|
||||||
|
+ '<td colspan="4" eventid="'+id+'">Daten werden geladen ...</td></tr>';
|
||||||
|
// setting up download links (3nd line)
|
||||||
|
var xmlurl = sprintf('%s?formatted=true&includearrivals=true&eventid=%s', config['ajax']['eventURL'], id);
|
||||||
|
var oTime = new Date(otime);
|
||||||
|
if ( ~oTime ) {
|
||||||
|
oTime = new Date(otime.split('.')[0]);
|
||||||
|
};
|
||||||
|
var sTime = new Date(oTime.getTime()-10*1000.-oTime.getMilliseconds());
|
||||||
|
var eTime = new Date(oTime.getTime()+50*1000.-oTime.getMilliseconds());
|
||||||
|
var mseedurl = sprintf('%s?net=GE,GR,RN&cha=EH?,HH?&start=%04d-%02d-%02dT%02d:%02d:%02d&end=%04d-%02d-%02dT%02d:%02d:%02d', config['ajax']['mseedURL'], Number(sTime.getUTCFullYear()), Number(sTime.getUTCMonth())+1, Number(sTime.getUTCDate()), Number(sTime.getUTCHours()), Number(sTime.getUTCMinutes()), Number(sTime.getUTCSeconds()), Number(eTime.getUTCFullYear()), Number(eTime.getUTCMonth())+1, Number(eTime.getUTCDate()), Number(eTime.getUTCHours()), Number(eTime.getUTCMinutes()), Number(eTime.getUTCSeconds()));
|
||||||
|
row += '<tr class="tablesorter-childRow event-download">'
|
||||||
|
+ '<td colspan="4" eventid="'+id+'">'
|
||||||
|
+ sprintf('Download <a class="xml-link" target="_blank" download="%s.xml" href="%s">QuakeML</a> or <a class="mseed-link" target="_blank" download="%s.mseed" href="%s">miniSEED</a>', id, xmlurl, id, mseedurl)
|
||||||
|
+ '</td></tr>';
|
||||||
|
// add row to table
|
||||||
|
if ( stime <= oTime && etime >= oTime ) {
|
||||||
|
addTableRow(row, 'eventstable');
|
||||||
|
};
|
||||||
|
if ( target ) {
|
||||||
|
addTableRow(row, target);
|
||||||
|
}
|
||||||
|
// create marker
|
||||||
|
if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) {
|
||||||
|
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type);
|
||||||
|
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
|
||||||
|
+ sprintf('<p>Ereignis: %s<br />', id)
|
||||||
|
+ sprintf('Type: %s<br />', type)
|
||||||
|
+ sprintf('Magnitude: %3.1f<br />', Number(mag))
|
||||||
|
+ sprintf('Ort: %.4f °N, %.4f °O <br />', Number(lat), Number(lng))
|
||||||
|
+ sprintf('Tiefe: %.1f km<br />', Number(depth)/1000.)
|
||||||
|
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
|
||||||
|
marker.bindPopup(text);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
var sort = [[0,1],[1,1],[2,1]];
|
||||||
|
$("#eventstable").trigger("update", [true]);
|
||||||
|
$("#eventstable").trigger("updateCache");
|
||||||
|
$("#eventstable").trigger("sorton", [sort]);
|
||||||
|
initMapLink();
|
||||||
|
eventLayer.bringToBack();
|
||||||
|
highlightFirstEvent();
|
||||||
|
},
|
||||||
|
error: function( jqxhr, textStatus, error ) {
|
||||||
|
var err = textStatus + ", " + error;
|
||||||
|
console.log( "Request Failed: " + err );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// create events csv download link
|
||||||
|
request_data['format'] = 'text';
|
||||||
|
if ( eventid == '' || !eventid ) { $('#events-csv-link').attr('href', config['ajax']['eventURL']+'?'+$.param(request_data)) };
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ajaxLoadEventInfo */
|
||||||
|
function ajaxLoadEventInfo(id) {
|
||||||
|
var request_data = {
|
||||||
|
eventid: id,
|
||||||
|
includeArrivals: true,
|
||||||
|
};
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: config['ajax']['eventURL'],
|
||||||
|
data: request_data,
|
||||||
|
dataType: "xml",
|
||||||
|
success: function (xml) {
|
||||||
|
eventDetails[id] = true;
|
||||||
|
$(xml).find('event').each(function () {
|
||||||
|
var event = $(this);
|
||||||
|
var mag = $(this).find('magnitude > mag > value').text();
|
||||||
|
var otime = $(this).find('origin > time > value').text();
|
||||||
|
var lng = $(this).find('origin > longitude > value').text();
|
||||||
|
var lng_err = $(this).find('origin > longitude > uncertainty').text();
|
||||||
|
var lat = $(this).find('origin > latitude > value').text();
|
||||||
|
var lat_err = $(this).find('origin > latitude > uncertainty').text();
|
||||||
|
var depth = $(this).find('origin > depth > value').text();
|
||||||
|
var depth_err = $(this).find('origin > depth > uncertainty').text();
|
||||||
|
var rms = $(this).find('origin > quality > standardError').text();
|
||||||
|
var gap = $(this).find('origin > quality > azimuthalGap').text();
|
||||||
|
var phases_count = $(this).find('origin > quality > usedPhaseCount').text();
|
||||||
|
var type = $(this).find('type').last().text();
|
||||||
|
// setting up general event info
|
||||||
|
var row = "<pre>"
|
||||||
|
+ sprintf("ID %49s\n", id)
|
||||||
|
+ sprintf("Type %47s\n\n", type)
|
||||||
|
+ "Origin\n"
|
||||||
|
+ sprintf("Date %18s\n", otime.split('T')[0])
|
||||||
|
+ sprintf("Time %18s UTC\n", otime.split('T')[1].substring(0, 11))
|
||||||
|
+ sprintf("Latitude %14.4f °N +- %4.1f km\n",Number(lat), Number(lat_err))
|
||||||
|
+ sprintf("Longitude %13.4f °E +- %4.1f km\n", Number(lng), Number(lng_err))
|
||||||
|
+ sprintf("Depth %14.1f km +- %4.1f km\n", Number(depth)/1000., Number(depth_err)/1000.)
|
||||||
|
+ sprintf("Magnitude %10.1f\n", Number(mag))
|
||||||
|
+ sprintf("Residual RMS %7.1f sec\n", Number(rms))
|
||||||
|
+ sprintf("Azimuthal gap %6.1f °\n\n", Number(gap))
|
||||||
|
+ sprintf("%d Phase arrivals:\n", Number(phases_count))
|
||||||
|
+ "sta net dist azi phase time res wt\n";
|
||||||
|
// adding phase info (TODO sort by distance)
|
||||||
|
$(this).find('origin > arrival').each(function() {
|
||||||
|
var pickid = $(this).find('pickID').text();
|
||||||
|
var azi = $(this).find('azimuth').text();
|
||||||
|
var dist = $(this).find('distance').text();
|
||||||
|
var tres = $(this).find('timeResidual').text();
|
||||||
|
var phase = $(this).find('phase').text();
|
||||||
|
var tweight = $(this).find('timeWeight').text();
|
||||||
|
if ( Number(tweight) > 0.0 ) {
|
||||||
|
var waveformid = event.find('pick[publicID="'+pickid+'"] > waveformID');
|
||||||
|
var networkcode = waveformid.attr('networkCode');
|
||||||
|
var stationcode = waveformid.attr('stationCode');
|
||||||
|
var channel = waveformid.attr('channelCode').substring(2,2);
|
||||||
|
var phasemode = event.find('pick[publicID="'+pickid+'"] > evaluationMode').text().substring(0,1).toUpperCase();
|
||||||
|
var picktime = event.find('pick[publicID="'+pickid+'"] > time > value').text().split('T')[1].substring(0,11);
|
||||||
|
row = row
|
||||||
|
+ sprintf('%-4s %2s %5.1f %5.1f %3s %1s %13s %5.1f %5.2f\n', stationcode, networkcode, Number(dist), Number(azi), phase, phasemode, picktime, Number(tres), Number(tweight));
|
||||||
|
};
|
||||||
|
});
|
||||||
|
row = row + '</pre>';
|
||||||
|
$('#eventstable > tbody > tr.event-details > td[eventid='+id+']').html(row);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
null;
|
||||||
|
},
|
||||||
|
error: function( jqxhr, textStatus, error ) {
|
||||||
|
var err = textStatus + ", " + error;
|
||||||
|
console.log( "Request Failed: " + err );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* toggles visibility of filtered markers
|
||||||
|
* only events in the event list are shown */
|
||||||
|
function toggleFilteredMarkers() {
|
||||||
|
// show all shown events in map
|
||||||
|
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
|
||||||
|
if ( $(this).attr("eventid") ) {
|
||||||
|
map.addLayer(eventTable[$(this).attr("eventid")]);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
// hide filtered events in map
|
||||||
|
$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() {
|
||||||
|
if ( $(this).attr("eventid") ) {
|
||||||
|
map.removeLayer(eventTable[$(this).attr("eventid")]);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
highlightFirstEvent();
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Highlight the first event of the event list on the map if no
|
||||||
|
* other event is selected */
|
||||||
|
function highlightFirstEvent() {
|
||||||
|
var highlightStyle = {
|
||||||
|
color: config['event']['markerColorH'],
|
||||||
|
fillColor: config['event']['markerColorH'],
|
||||||
|
fillOpacity: 1,
|
||||||
|
};
|
||||||
|
var normalStyle = {
|
||||||
|
fillColor: config['event']['markerColor'],
|
||||||
|
color: config['event']['markerColor'],
|
||||||
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
};
|
||||||
|
$("#eventstable a.map-link").each( function() {
|
||||||
|
if ( $(this).attr("eventid") ) {
|
||||||
|
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
|
||||||
|
$(this).removeClass('first');
|
||||||
|
$(this).text('map');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$("#eventstable > tbody > tr:not(.filtered):visible").first().find("a.map-link").each(function() {
|
||||||
|
if ( $(this).attr("eventid") ) {
|
||||||
|
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
|
||||||
|
eventTable[$(this).attr("eventid")].bringToFront();
|
||||||
|
$(this).addClass('first');
|
||||||
|
$(this).text('map (red)');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function highlightEvent( id ) {
|
||||||
|
var highlightStyle = {
|
||||||
|
color: config['event']['markerColorH'],
|
||||||
|
fillColor: config['event']['markerColorH'],
|
||||||
|
fillOpacity: 1,
|
||||||
|
};
|
||||||
|
var normalStyle = {
|
||||||
|
fillColor: config['event']['markerColor'],
|
||||||
|
color: config['event']['markerColor'],
|
||||||
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
};
|
||||||
|
$("#eventstable > tbody > tr:not(.filtered)").find("a.map-link").each( function() {
|
||||||
|
if ( $(this).attr("eventid") ) {
|
||||||
|
if ( $(this).attr("eventid") == id ) {
|
||||||
|
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
|
||||||
|
eventTable[$(this).attr("eventid")].bringToFront();
|
||||||
|
$(this).addClass('first');
|
||||||
|
$(this).text('map (red)');
|
||||||
|
} else {
|
||||||
|
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
|
||||||
|
$(this).removeClass('first');
|
||||||
|
$(this).text('map');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* document ready *
|
||||||
|
**********************************************************************/
|
||||||
|
$(document).ready(function() {
|
||||||
|
// tablesorter for event list
|
||||||
|
$("#eventstable").tablesorter(
|
||||||
|
{
|
||||||
|
theme : 'blue',
|
||||||
|
dateFormat : "ddmmyyyy",
|
||||||
|
headers: {
|
||||||
|
0: { sorter: "shortDate" }
|
||||||
|
},
|
||||||
|
cssChildRow: "tablesorter-childRow", // this is the default setting
|
||||||
|
widgets: ["uitheme", "zebra", "filter", "pager"], // initialize zebra and filter widgets, "scroller"
|
||||||
|
widgetOptions: {
|
||||||
|
// possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
|
||||||
|
pager_output: '# {startRow} - {endRow} ({totalRows}) | page {page} ({totalPages})',
|
||||||
|
pager_removeRows: false,
|
||||||
|
pager_size: 35,
|
||||||
|
filter_childRows : true,
|
||||||
|
filter_cssFilter : 'tablesorter-filter',
|
||||||
|
filter_startsWith : false,
|
||||||
|
filter_ignoreCase : true,
|
||||||
|
scroller_height: $('div.map').height() - 250,
|
||||||
|
scroller_barWidth: 10,
|
||||||
|
scroller_jumpToHeader: false,
|
||||||
|
sortList: "[[0,1], [1,1], [2,1]]",
|
||||||
|
resort: true,
|
||||||
|
showProcessing: true,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// hide child rows
|
||||||
|
$('#eventstable > tbody > tr.tablesorter-childRow td').hide();
|
||||||
|
// update map after filtering
|
||||||
|
$('#eventstable').bind('filterEnd', function(){
|
||||||
|
toggleFilteredMarkers();
|
||||||
|
});
|
||||||
|
// highlight first event
|
||||||
|
$('#eventstable').bind('sortEnd', function(){
|
||||||
|
highlightFirstEvent();
|
||||||
|
});
|
||||||
|
$('#eventstable').bind('pagerComplete', function(){
|
||||||
|
highlightFirstEvent();
|
||||||
|
});
|
||||||
|
// show / hide event info
|
||||||
|
$('#eventstable').delegate('.toggle', 'click' , function(){
|
||||||
|
// load event details
|
||||||
|
var eventid = $(this).attr('eventid');
|
||||||
|
( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid);
|
||||||
|
|
||||||
|
// toggle visibility of selected row
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
|
||||||
|
// mark currently selected row and remove class selected from all other rows
|
||||||
|
// hide other rows
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
|
||||||
|
$(this).closest('tbody').find('td.selected').each(function(){
|
||||||
|
if ( ! $(this).hasClass('selected-now') ) {
|
||||||
|
$(this).hide();
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').each(function(){
|
||||||
|
$(this).removeClass('selected-now');
|
||||||
|
var selected = $(this).hasClass('selected');
|
||||||
|
if ( selected ) {
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
highlightFirstEvent();
|
||||||
|
} else {
|
||||||
|
$(this).addClass('selected');
|
||||||
|
highlightEvent($(this).attr('eventid'));
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
// update selection / type info
|
||||||
|
$("#events-timespan").text(config['map']['timespan']);
|
||||||
|
$("#events-minmag").text(sprintf('%.1f', config['event']['minMag']));
|
||||||
|
config['event']['typeWhitelist'].map(function(type) {
|
||||||
|
var typetext;
|
||||||
|
( $("#events-type").text() == "Symbols:" ) ? typetext = ' ' : typetext = ', ';
|
||||||
|
switch ( type ) {
|
||||||
|
case 'earthquake':
|
||||||
|
typetext += 'tectonic earthquake (star)';
|
||||||
|
break;
|
||||||
|
case 'explosion':
|
||||||
|
typetext += 'explosion (hexagon)';
|
||||||
|
break;
|
||||||
|
case 'induced or triggered event':
|
||||||
|
typetext += '(mining-)induced event (circle)';
|
||||||
|
break;
|
||||||
|
case 'quarry blast':
|
||||||
|
case 'controlled explosion':
|
||||||
|
case 'explosion':
|
||||||
|
typetext += 'quarry blast (wheel)';
|
||||||
|
break;
|
||||||
|
case 'nuclear explosion':
|
||||||
|
typetext += 'nuclear weapon test (square)';
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
$("#events-type").append(typetext);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,207 @@
|
|||||||
|
div.leaflet-div-icon {
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 2px 2px 0px 2px;
|
||||||
|
font-size: small;
|
||||||
|
margin: 0px auto;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
width: auto;
|
||||||
|
background: '#fff';
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
||||||
|
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
|
||||||
|
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
|
||||||
|
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||||
|
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
border-bottom-color: #b3b3b3;
|
||||||
|
-webkit-border-radius: 10px;
|
||||||
|
-moz-border-radius: 10px;
|
||||||
|
border-radius: 10px;
|
||||||
|
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||||
|
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||||
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
div.leaflet-div-icon div {
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
line-height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.leaflet-div-icon div div {
|
||||||
|
display: block;
|
||||||
|
font-size: xx-small;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.legend-content {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.legend-box {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 8px;
|
||||||
|
border: solid 1px #000;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.leaflet-div-icon div div.legend-box {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 4px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.leaflet-div-icon div div.key {
|
||||||
|
margin: 2px 4px 0px 0px;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-layer-legend div {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-layer-legend .legend-box, .data-layer-legend .key {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choropleth-text {
|
||||||
|
font-size: x-small;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scale-bars i {
|
||||||
|
vertical-align: bottom;
|
||||||
|
display: inline-block;
|
||||||
|
background-color: silver;
|
||||||
|
height: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.min-value, .max-value {
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.min-value {
|
||||||
|
text-align: right;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max-value {
|
||||||
|
text-align: left;
|
||||||
|
margin-left: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scale-value {
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-layer-legend {
|
||||||
|
padding: 8px 0px 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scale-bars {
|
||||||
|
vertical-align: middle;
|
||||||
|
line-height: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend-title {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-popup-content {
|
||||||
|
overflow: auto;
|
||||||
|
max-height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.palette-element {
|
||||||
|
display: inline-block;
|
||||||
|
width: 12px;
|
||||||
|
height: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-control-legend {
|
||||||
|
background-color: rgba(255, 255, 255, 0.7);
|
||||||
|
padding: 0px;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
max-height: 70px;
|
||||||
|
width: 268px;
|
||||||
|
box-shadow: 0 1px 7px #999;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-control-legend.larger {
|
||||||
|
max-height: 50%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-control-legend .legend {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-control-legend i {
|
||||||
|
background-image: none;
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
.photo {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: white;
|
||||||
|
box-shadow: 2px 2px 3px rgba(100, 100, 100, 0.5);
|
||||||
|
opacity: 0;
|
||||||
|
-moz-transition: opacity 1s; /* Firefox 4 */
|
||||||
|
-webkit-transition: opacity 1s; /* Safari and Chrome */
|
||||||
|
-o-transition: opacity 1s;
|
||||||
|
transition: opacity 1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.photo-info {
|
||||||
|
background-color: rgba(0, 0, 0, 0.6);
|
||||||
|
padding: 10px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
color: white;
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.photo-link {
|
||||||
|
float: right;
|
||||||
|
height: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author-link {
|
||||||
|
margin-left: 2px;
|
||||||
|
width: 400px;
|
||||||
|
display: block;
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
text.leaflet-svg-text {
|
||||||
|
alignment-baseline: central;
|
||||||
|
dominant-baseline: central;
|
||||||
|
text-anchor: middle;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
.leaflet-label {
|
||||||
|
background: rgb(235, 235, 235);
|
||||||
|
background: rgba(235, 235, 235, 0.81);
|
||||||
|
background-clip: padding-box;
|
||||||
|
border-color: #777;
|
||||||
|
border-color: rgba(0,0,0,0.25);
|
||||||
|
border-radius: 4px;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 4px;
|
||||||
|
color: #111;
|
||||||
|
display: block;
|
||||||
|
font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 1px 6px;
|
||||||
|
position: absolute;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
pointer-events: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
z-index: 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-label.leaflet-clickable {
|
||||||
|
cursor: pointer;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-label:before,
|
||||||
|
.leaflet-label:after {
|
||||||
|
border-top: 6px solid transparent;
|
||||||
|
border-bottom: 6px solid transparent;
|
||||||
|
content: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-label:before {
|
||||||
|
border-right: 6px solid black;
|
||||||
|
border-right-color: inherit;
|
||||||
|
left: -10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-label:after {
|
||||||
|
border-left: 6px solid black;
|
||||||
|
border-left-color: inherit;
|
||||||
|
right: -10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-label-right:before,
|
||||||
|
.leaflet-label-left:after {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
.leaflet-control-easyPrint a {
|
||||||
|
background:#fff url(print.png) no-repeat 5px;
|
||||||
|
background-size:16px 16px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
|
||||||
|
html {padding: 0px!important;}
|
||||||
|
.leaflet-control-easyPrint-button{display: none!important;}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#map {
|
||||||
|
width: 1200;
|
||||||
|
height: 800;
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 720 B |
@@ -0,0 +1,161 @@
|
|||||||
|
/* jQuery.print, version 1.0.3
|
||||||
|
* (c) Sathvik Ponangi, Doers' Guild
|
||||||
|
* Licence: CC-By (http://creativecommons.org/licenses/by/3.0/)
|
||||||
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
(function($) {"use strict";
|
||||||
|
// A nice closure for our definitions
|
||||||
|
|
||||||
|
function getjQueryObject(string) {
|
||||||
|
// Make string a vaild jQuery thing
|
||||||
|
var jqObj = $("");
|
||||||
|
try {
|
||||||
|
jqObj = $(string).clone();
|
||||||
|
} catch(e) {
|
||||||
|
jqObj = $("<span />").html(string);
|
||||||
|
}
|
||||||
|
return jqObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isNode(o) {
|
||||||
|
/* http://stackoverflow.com/a/384380/937891 */
|
||||||
|
return !!( typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$.print = $.fn.print = function() {
|
||||||
|
// Print a given set of elements
|
||||||
|
|
||||||
|
var options, $this, self = this;
|
||||||
|
|
||||||
|
// console.log("Printing", this, arguments);
|
||||||
|
|
||||||
|
if ( self instanceof $) {
|
||||||
|
// Get the node if it is a jQuery object
|
||||||
|
self = self.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNode(self)) {
|
||||||
|
// If `this` is a HTML element, i.e. for
|
||||||
|
// $(selector).print()
|
||||||
|
$this = $(self);
|
||||||
|
if (arguments.length > 0) {
|
||||||
|
options = arguments[0];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (arguments.length > 0) {
|
||||||
|
// $.print(selector,options)
|
||||||
|
$this = $(arguments[0]);
|
||||||
|
if (isNode($this[0])) {
|
||||||
|
if (arguments.length > 1) {
|
||||||
|
options = arguments[1];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// $.print(options)
|
||||||
|
options = arguments[0];
|
||||||
|
$this = $("html");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// $.print()
|
||||||
|
$this = $("html");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default options
|
||||||
|
var defaults = {
|
||||||
|
globalStyles : true,
|
||||||
|
mediaPrint : false,
|
||||||
|
stylesheet : null,
|
||||||
|
noPrintSelector : ".no-print",
|
||||||
|
iframe : true,
|
||||||
|
append : null,
|
||||||
|
prepend : null
|
||||||
|
};
|
||||||
|
// Merge with user-options
|
||||||
|
options = $.extend({}, defaults, (options || {}));
|
||||||
|
|
||||||
|
var $styles = $("");
|
||||||
|
if (options.globalStyles) {
|
||||||
|
// Apply the stlyes from the current sheet to the printed page
|
||||||
|
$styles = $("style, link, meta, title");
|
||||||
|
} else if (options.mediaPrint) {
|
||||||
|
// Apply the media-print stylesheet
|
||||||
|
$styles = $("link[media=print]");
|
||||||
|
}
|
||||||
|
if (options.stylesheet) {
|
||||||
|
// Add a custom stylesheet if given
|
||||||
|
$styles = $.merge($styles, $('<link rel="stylesheet" href="' + options.stylesheet + '">'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a copy of the element to print
|
||||||
|
var copy = $this.clone();
|
||||||
|
// Wrap it in a span to get the HTML markup string
|
||||||
|
copy = $("<span/>").append(copy);
|
||||||
|
// Remove unwanted elements
|
||||||
|
copy.find(options.noPrintSelector).remove();
|
||||||
|
// Add in the styles
|
||||||
|
copy.append($styles.clone());
|
||||||
|
// Appedned content
|
||||||
|
copy.append(getjQueryObject(options.append));
|
||||||
|
// Prepended content
|
||||||
|
copy.prepend(getjQueryObject(options.prepend));
|
||||||
|
// Get the HTML markup string
|
||||||
|
var content = copy.html();
|
||||||
|
// Destroy the copy
|
||||||
|
copy.remove();
|
||||||
|
|
||||||
|
var w, wdoc;
|
||||||
|
if (options.iframe) {
|
||||||
|
// Use an iframe for printing
|
||||||
|
try {
|
||||||
|
var $iframe = $(options.iframe + "");
|
||||||
|
var iframeCount = $iframe.length;
|
||||||
|
if (iframeCount === 0) {
|
||||||
|
// Create a new iFrame if none is given
|
||||||
|
$iframe = $('<iframe height="0" width="0" border="0" wmode="Opaque"/>').prependTo('body').css({
|
||||||
|
"position" : "absolute",
|
||||||
|
"top" : -999,
|
||||||
|
"left" : -999
|
||||||
|
});
|
||||||
|
}
|
||||||
|
w = $iframe.get(0);
|
||||||
|
w = w.contentWindow || w.contentDocument || w;
|
||||||
|
wdoc = w.document || w.contentDocument || w;
|
||||||
|
wdoc.open();
|
||||||
|
wdoc.write(content);
|
||||||
|
wdoc.close();
|
||||||
|
setTimeout(function() {
|
||||||
|
// Fix for IE : Allow it to render the iframe
|
||||||
|
w.focus();
|
||||||
|
w.print();
|
||||||
|
setTimeout(function() {
|
||||||
|
// Fix for IE
|
||||||
|
if (iframeCount === 0) {
|
||||||
|
// Destroy the iframe if created here
|
||||||
|
$iframe.remove();
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
}, 250);
|
||||||
|
} catch (e) {
|
||||||
|
// Use the pop-up method if iframe fails for some reason
|
||||||
|
console.error("Failed to print from iframe", e.stack, e.message);
|
||||||
|
w = window.open();
|
||||||
|
w.document.write(content);
|
||||||
|
w.document.close();
|
||||||
|
w.focus();
|
||||||
|
w.print();
|
||||||
|
w.close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Use a new window for printing
|
||||||
|
w = window.open();
|
||||||
|
w.document.write(content);
|
||||||
|
w.document.close();
|
||||||
|
w.focus();
|
||||||
|
w.print();
|
||||||
|
w.close();
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
|
Before Width: | Height: | Size: 737 B After Width: | Height: | Size: 737 B |
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
@preserve Leaflet Data Visualization Framework, a JavaScript library for creating thematic maps using Leaflet
|
||||||
|
(c) 2013, Scott Fairgrieve, HumanGeo
|
||||||
|
*/
|
||||||
|
L.LinearFunction=L.Class.extend({initialize:function(t,e,i){this.setOptions(i),this.setRange(t,e)},_calculateParameters:function(t,e){0===this._xRange?(this._slope=0,this._b=t.y):(this._slope=(e.y-t.y)/this._xRange,this._b=t.y-this._slope*t.x)},_arrayToPoint:function(t){return{x:t[0],y:t[1]}},setOptions:function(t){L.Util.setOptions(this,t),this._preProcess=this.options.preProcess,this._postProcess=this.options.postProcess},getBounds:function(){var t=Math.min(this._minPoint.x,this._maxPoint.x),e=Math.max(this._minPoint.x,this._maxPoint.x),i=Math.min(this._minPoint.y,this._maxPoint.y),n=Math.max(this._minPoint.y,this._maxPoint.y);return[new L.Point(t,i),new L.Point(e,n)]},setRange:function(t,e){return t=t instanceof Array?this._arrayToPoint(t):t,e=e instanceof Array?this._arrayToPoint(e):e,this._minPoint=t,this._maxPoint=e,this._xRange=e.x-t.x,this._calculateParameters(t,e),this},setMin:function(t){return this.setRange(t,this._maxPoint),this},setMax:function(t){return this.setRange(this._minPoint,t),this},setPreProcess:function(t){return this._preProcess=t,this},setPostProcess:function(t){return this._postProcess=t,this},evaluate:function(t){var e;return this._preProcess&&(t=this._preProcess(t)),e=Number((this._slope*t).toFixed(6))+Number(this._b.toFixed(6)),this._postProcess&&(e=this._postProcess(e)),e},random:function(){var t=Math.random()*this._xRange+this._minPoint.x;return this.evaluate(t)},sample:function(t){t=Math.max(t,2);for(var e=t-1,i=this._xRange/e,n=this._minPoint.x,a=[];this._maxPoint.x>=n;)a.push(this.evaluate(n)),n+=i;return a},samplePoints:function(t){t=Math.max(t,2);for(var e=t-1,i=this._xRange/e,n=this._minPoint.x,a=[];this._maxPoint.x>=n;)a.push(new L.Point(n,this.evaluate(n))),n+=i;return a},getIntersectionPoint:function(t){var e=null;if(this._slope!==t._slope){var i=(this._b-t._b)/(t._slope-this._slope),n=this.evaluate(i);e=new L.Point(i,n)}return e}}),L.ColorFunction=L.LinearFunction.extend({options:{alpha:1,includeAlpha:!1},initialize:function(t,e,i){L.Util.setOptions(this,i),this._parts=[],this._dynamicPart=null,this._outputPrecision=0,this._prefix=null,this._formatOutput=function(t){return t.toFixed(this._outputPrecision)},this._mapOutput=function(t){for(var e=[],i=0;this._parts.length>i;++i){var n=this._parts[i];e.push(t[n])}return this.options.includeAlpha&&e.push(this.options.alpha),e},this._getColorString=function(t){t=this._formatOutput(t),this.options[this._dynamicPart]=t;var e=this._mapOutput(this.options);return this._writeColor(this._prefix,e)},this._writeColor=function(t,e){return this.options.includeAlpha&&(t+="a"),t+"("+e.join(",")+")"};var n=function(t){i&&i.postProcess&&(t=i.postProcess.call(this,t));var e=this._getColorString(t);return L.Browser.ie&&e.indexOf("hsl")>-1&&(e=L.hslColor(e).toRGBString()),e};L.LinearFunction.prototype.initialize.call(this,t,e,{preProcess:this.options.preProcess,postProcess:n})}}),L.HSLColorFunction=L.ColorFunction.extend({initialize:function(t,e,i){L.ColorFunction.prototype.initialize.call(this,t,e,i),this._parts=["outputHue","outputSaturation","outputLuminosity"],this._prefix="hsl",this._outputPrecision=2}}),L.RGBColorFunction=L.ColorFunction.extend({initialize:function(t,e,i){L.ColorFunction.prototype.initialize.call(this,t,e,i),this._parts=["outputRed","outputBlue","outputGreen"],this._prefix="rgb",this._outputPrecision=0}}),L.RGBRedFunction=L.LinearFunction.extend({options:{outputGreen:0,outputBlue:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputRed"}}),L.RGBBlueFunction=L.LinearFunction.extend({options:{outputRed:0,outputGreen:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputBlue"}}),L.RGBGreenFunction=L.LinearFunction.extend({options:{outputRed:0,outputBlue:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputGreen"}}),L.RGBColorBlendFunction=L.LinearFunction.extend({initialize:function(t,e,i,n){i=new L.RGBColor(i),n=new L.RGBColor(n);var a=i.r(),o=n.r(),r=i.g(),s=n.g(),f=i.b(),d=n.b();this._minX=t,this._maxX=e,this._redFunction=new L.LinearFunction(new L.Point(t,a),new L.Point(e,o)),this._greenFunction=new L.LinearFunction(new L.Point(t,r),new L.Point(e,s)),this._blueFunction=new L.LinearFunction(new L.Point(t,f),new L.Point(e,d))},getBounds:function(){var t=this._redFunction.getBounds(),e=this._greenFunction.getBounds(),i=this._blueFunction.getBounds(),n=Math.min(t[0].y,e[0].y,i[0].y),a=Math.max(t[0].y,e[0].y,i[0].y);return[new L.Point(t[0].x,n),new L.Point(t[1].x,a)]},evaluate:function(t){return new L.RGBColor([this._redFunction.evaluate(t),this._greenFunction.evaluate(t),this._blueFunction.evaluate(t)]).toRGBString()}}),L.HSLHueFunction=L.HSLColorFunction.extend({options:{outputSaturation:"100%",outputLuminosity:"50%"},initialize:function(t,e,i){L.HSLColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputHue"}}),L.HSLSaturaLine truncated
|
||||||
|
},luminosityPalette:function(t,e,i,n,a){return new L.HSLLuminosityFunction(new L.Point(t,i),new L.Point(e,n),a)},saturationPalette:function(t,e,i,n,a){return new L.HSLSaturationFunction(new L.Point(t,i),new L.Point(e,n),a)},rgbBlendPalette:function(t,e,i,n,a){return new L.RGBColorBlendFunction(t,e,i,n,a)},hslBlendPalette:function(t,e,i,n,a){return new L.HSLColorBlendFunction(t,e,i,n,a)},customColorPalette:function(t,e,i,n){return new L.CustomColorFunction(t,e,i,n)}},L.DynamicColorPalettes={rainbow:{text:"Rainbow",getPalette:function(t,e){return L.Palettes.huePalette(t,e,0,300)}},greentored:{text:"Green - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,120,0)}},yellowtored:{text:"Yellow - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,60,0)}},orangetored:{text:"Orange - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,30,0)}},redtopurple:{text:"Red - Purple",getPalette:function(t,e){return L.Palettes.huePalette(t,e,360,270)}},bluetored:{text:"Blue - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,210,360)}},bluetored2:{text:"Blue - Red 2",getPalette:function(t,e){return L.Palettes.huePalette(t,e,180,0)}},whitetored:{text:"White - Red",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:0})}},whitetoorange:{text:"White - Orange",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:30})}},whitetoyellow:{text:"White - Yellow",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:60})}},whitetogreen:{text:"White - Green",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:120})}},whitetoltblue:{text:"White - Lt. Blue",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:180})}},whitetoblue:{text:"White - Blue",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:240})}},whitetopurple:{text:"White - Purple",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:270})}},graytored:{text:"Gray - Red",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:0})}},graytoorange:{text:"Gray - Orange",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:30})}},graytoyellow:{text:"Gray - Yellow",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:60})}},graytogreen:{text:"Gray - Green",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:120})}},graytoltblue:{text:"Gray - Lt. Blue",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:180})}},graytoblue:{text:"Gray - Blue",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:240})}},graytopurple:{text:"Gray - Purple",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:270})}}},L.DynamicPaletteElement=L.Class.extend({initialize:function(t,e){this._key=t,this._dynamicPalette=e},generate:function(t){var e=L.DomUtil.create("div","palette"),i=t.count,n=this._dynamicPalette.getPalette(0,i-1),a=t.width,o=!0;void 0!=t.showText&&(o=t.showText),e.setAttribute("data-palette-key",this._key),this._dynamicPalette.text&&o&&(L.DomUtil.create("div","palette-text",e).innerHTML='<i class="icon-ok hidden"></i>'+this._dynamicPalette.text);var r=a/i;t.className&&L.DomUtil.addClass(e,t.className);for(var s=0;i>s;++s){var s=L.DomUtil.create("i","palette-element");for(var f in n){var d=n[f],c=d.evaluate?d.evaluate(s):d;L.StyleConverter.setCSSProperty(s,f,c)}s.style.width=r+"px",e.appendChild(s)}return e}}),L.Path.XLINK_NS="http://www.w3.org/1999/xlink";var TextFunctions=TextFunctions||{__updatePath:L.Path.prototype._updatePath,_updatePath:function(){this.__updatePath.call(this),this.options.text&&this._createText(this.options.text)},_initText:function(){this.options.text&&this._createText(this.options.text)},getTextAnchor:function(){return this._point?this._point:void 0},setTextAnchor:function(t){this._text&&(this._text.setAttribute("x",t.x),this._text.setAttribute("y",t.y))},_createText:function(t){this._text&&this._container.removeChild(this._text),this._pathDef&&this._defs.removeChild(this._pathDef);var e=function(t,e){var i="";for(var n in e)i+=n+": "+e[n]+";";return t.setAttribute("style",i),t},i=function(t,e){for(var i in e)t.setAttribute(i,e[i]);return t};this._text=this._createElement("text");var n=document.createTextNode(t.text);if(t.path){var a=t.path,o=L.Util.guid(),r=this._createElement("path");r.setAttribute("d",this._path.getAttribute("d")),r.setAttribute("id",o),this._defs||(this._defs=this._createElement("defs"),this._container.appendChild(this._defs)),this._defs.appendChild(r),this._pathDef=r;var s=this._createElement("textPath");a.startOffset&&s.setAttribute("startOffset",a.startOffset),a.attr&&i(s,a.attr),a.style&&e(s,a.style),s.setAttributeNS(L.Path.XLINK_NS,"xlink:href","#"+o),s.appendChild(n),this._text.appendChild(s)}else{this._text.appendCLine truncated
|
||||||
|
n=new L.RadialBarMarker(this._latlng,f),this.addLayer(n)}}}});
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
|
||||||
|
L.Control.EasyPrint = L.Control.extend({
|
||||||
|
options: {
|
||||||
|
position: 'topright',
|
||||||
|
title: 'Print map',
|
||||||
|
},
|
||||||
|
|
||||||
|
onAdd: function () {
|
||||||
|
var container = L.DomUtil.create('div', 'leaflet-control-easyPrint leaflet-bar leaflet-control');
|
||||||
|
|
||||||
|
this.link = L.DomUtil.create('a', 'leaflet-control-easyPrint-button leaflet-bar-part', container);
|
||||||
|
this.link.href = 'javascript:void($("#map").print({stylesheet:"external/easyPrint.css"}))';
|
||||||
|
|
||||||
|
return container;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
_click: function (e) {
|
||||||
|
L.DomEvent.stopPropagation(e);
|
||||||
|
L.DomEvent.preventDefault(e);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
L.easyPrint = function() {
|
||||||
|
return new L.Control.EasyPrint();
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
Leaflet.label, a plugin that adds labels to markers and vectors for Leaflet powered maps.
|
||||||
|
(c) 2012-2013, Jacob Toye, Smartrak
|
||||||
|
|
||||||
|
https://github.com/Leaflet/Leaflet.label
|
||||||
|
http://leafletjs.com
|
||||||
|
https://github.com/jacobtoye
|
||||||
|
*/
|
||||||
|
(function(){L.labelVersion="0.2.2-dev",L.Label=L.Class.extend({includes:L.Mixin.Events,options:{className:"",clickable:!1,direction:"right",noHide:!1,offset:[12,-15],opacity:1,zoomAnimation:!0},initialize:function(t,e){L.setOptions(this,t),this._source=e,this._animated=L.Browser.any3d&&this.options.zoomAnimation,this._isOpen=!1},onAdd:function(t){this._map=t,this._pane=this._source instanceof L.Marker?t._panes.markerPane:t._panes.popupPane,this._container||this._initLayout(),this._pane.appendChild(this._container),this._initInteraction(),this._update(),this.setOpacity(this.options.opacity),t.on("moveend",this._onMoveEnd,this).on("viewreset",this._onViewReset,this),this._animated&&t.on("zoomanim",this._zoomAnimation,this),L.Browser.touch&&!this.options.noHide&&L.DomEvent.on(this._container,"click",this.close,this)},onRemove:function(t){this._pane.removeChild(this._container),t.off({zoomanim:this._zoomAnimation,moveend:this._onMoveEnd,viewreset:this._onViewReset},this),this._removeInteraction(),this._map=null},setLatLng:function(t){return this._latlng=L.latLng(t),this._map&&this._updatePosition(),this},setContent:function(t){return this._previousContent=this._content,this._content=t,this._updateContent(),this},close:function(){var t=this._map;t&&(L.Browser.touch&&!this.options.noHide&&L.DomEvent.off(this._container,"click",this.close),t.removeLayer(this))},updateZIndex:function(t){this._zIndex=t,this._container&&this._zIndex&&(this._container.style.zIndex=t)},setOpacity:function(t){this.options.opacity=t,this._container&&L.DomUtil.setOpacity(this._container,t)},_initLayout:function(){this._container=L.DomUtil.create("div","leaflet-label "+this.options.className+" leaflet-zoom-animated"),this.updateZIndex(this._zIndex)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updatePosition(),this._container.style.visibility="")},_updateContent:function(){this._content&&this._map&&this._prevContent!==this._content&&"string"==typeof this._content&&(this._container.innerHTML=this._content,this._prevContent=this._content,this._labelWidth=this._container.offsetWidth)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),s=this.options.direction,a=this._labelWidth,l=L.point(this.options.offset);"right"===s||"auto"===s&&o.x<n.x?(L.DomUtil.addClass(i,"leaflet-label-right"),L.DomUtil.removeClass(i,"leaflet-label-left"),t=t.add(l)):(L.DomUtil.addClass(i,"leaflet-label-left"),L.DomUtil.removeClass(i,"leaflet-label-right"),t=t.add(L.point(-l.x-a,l.y))),L.DomUtil.setPosition(i,t)},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPosition(e)},_onMoveEnd:function(){this._animated&&"auto"!==this.options.direction||this._updatePosition()},_onViewReset:function(t){t&&t.hard&&this._update()},_initInteraction:function(){if(this.options.clickable){var t=this._container,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];L.DomUtil.addClass(t,"leaflet-clickable"),L.DomEvent.on(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)L.DomEvent.on(t,e[i],this._fireMouseEvent,this)}},_removeInteraction:function(){if(this.options.clickable){var t=this._container,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];L.DomUtil.removeClass(t,"leaflet-clickable"),L.DomEvent.off(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)L.DomEvent.off(t,e[i],this._fireMouseEvent,this)}},_onMouseClick:function(t){this.hasEventListeners(t.type)&&L.DomEvent.stopPropagation(t),this.fire(t.type,{originalEvent:t})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&L.DomEvent.preventDefault(t),"mousedown"!==t.type?L.DomEvent.stopPropagation(t):L.DomEvent.preventDefault(t)}}),L.BaseMarkerMethods={showLabel:function(){return this.label&&this._map&&(this.label.setLatLng(this._latlng),this._map.showLabel(this.label)),this},hideLabel:function(){return this.label&&this.label.close(),this},setLabelNoHide:function(t){this._labelNoHide!==t&&(this._labelNoHide=t,t?(this._removeLabelRevealHandlers(),this.showLabel()):(this._addLabelRevealHandlers(),this.hideLabel()))},bindLabel:function(t,e){var i=this.options.icon?this.options.icon.options.labelAnchor:this.options.labelAnchor,n=L.point(i)||L.point(0,0);return n=n.add(L.Label.prototype.options.offset),e&&e.offset&&(n=n.add(e.offset)),e=L.Util.extend({offset:n},e),this._labelNoHide=e.noHide,this.label||(this._labelNoHide||this._addLabelRevealHandlers(),this.on("remove",this.hideLabel,this).on("move",this._moveLabel,this).on("add",this._onMarkerAdd,this),this._hasLabelHandlers=!0),this.label=new L.Label(e,this).setContent(t),this},unbindLabel:function(){return this.label&&(this.hideLabel(),this.label=null,this._hasLabelHandlersLine truncated
|
||||||
|
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 736 B |
|
Before Width: | Height: | Size: 745 B After Width: | Height: | Size: 745 B |
|
After Width: | Height: | Size: 219 B |
@@ -0,0 +1,29 @@
|
|||||||
|
<div class="accordioncontent">
|
||||||
|
<h4>Anschrift</h4>
|
||||||
|
Seismologisches Observatorium der<br />
|
||||||
|
Ruhr-Universität Bochum<br />
|
||||||
|
NA 3/174<br />
|
||||||
|
44780 Bochum<br />
|
||||||
|
Tel.: 0234 32-27574<br />
|
||||||
|
Fax: 0234 32-07574<br />
|
||||||
|
|
||||||
|
<p>Die Ruhr-Universität ist eine Körperschaft des Öffentlichen Rechts. Sie wird durch ihren Rektor Herrn Prof. Dr. Elmar W. Weiler gesetzlich vertreten.</p>
|
||||||
|
<p>Zuständige Aufsichtsbehörde ist das Ministerium für Innovation, Wissenschaft und Forschung des Landes Nordrhein-Westfalen, Völklinger Straße 49, 40221 Düsseldorf.</p>
|
||||||
|
<p>Umsatzsteuer-Identifikationsnummer: DE 127 056 261</p>
|
||||||
|
|
||||||
|
<h4>Inhaltliche und technische Verantwortung für die Seiten des Seismologischen Observatoriums der Ruhr-Universität Bochum</h4>
|
||||||
|
Herr Dr. Kasper D. Fischer<br />
|
||||||
|
Ruhr-Universität Bochum<br />
|
||||||
|
44780 Bochum<br />
|
||||||
|
Tel.: 0234 32-27574<br />
|
||||||
|
Fax: 0234 32-07574<br />
|
||||||
|
E-Mail: kasper.fischer@ruhr-uni-bochum.de<br />
|
||||||
|
|
||||||
|
<p>Meldungen über missbräuchliche Nutzungen, die von Stationen aus dem IP-Namensbereich ruhr-uni-bochum.de ausgehen, senden Sie bitte an die Email-Adresse
|
||||||
|
abuse@ruhr-uni-bochum.de. Gleichfalls bittet die Ruhr-Universität um Mitteilung an dieselbe Email-Adresse, wenn rechtswidrige Inhalte durch Links auf Seiten der Ruhr-Universität zu
|
||||||
|
erreichen sind.</p>
|
||||||
|
|
||||||
|
<h4>Rechtliche Hinweise</h4>
|
||||||
|
<p>Die Ruhr-Universität Bochum übernimmt keine Gewähr für die Richtigkeit und Vollständigkeit der auf ihren Internetseiten befindlichen Informationen. Das gleiche gilt für die
|
||||||
|
Inhalte verlinkter Seiten.</p>
|
||||||
|
</div>
|
||||||
@@ -7,44 +7,65 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Style definitions -->
|
<!-- Style definitions -->
|
||||||
<link rel="stylesheet" href="main.css">
|
<link rel="stylesheet" href="main.css" />
|
||||||
|
<!-- link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" / -->
|
||||||
|
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css" />
|
||||||
|
<link rel="stylesheet" href="external/theme.blue.css"/>
|
||||||
|
<link rel="stylesheet" href="external/jquery.tablesorter.pager.css" />
|
||||||
|
<link rel="stylesheet" href="external/leaflet.css" />
|
||||||
|
<!-- link rel="stylesheet" href="external/css/dvf.css" type="text/css" media="screen" / -->
|
||||||
|
<link rel="stylesheet" href="external/css/leaflet.label.css" type="text/css" media="screen" />
|
||||||
|
<link rel="stylesheet" href="external/easyPrint.css"/>
|
||||||
|
|
||||||
<!-- jQuery & jQueryUI -->
|
<!-- jQuery & jQueryUI -->
|
||||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
|
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
|
||||||
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css">
|
<script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
|
||||||
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
|
|
||||||
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
|
|
||||||
|
|
||||||
<!-- Localtime -->
|
<!-- Localtime & sprintf -->
|
||||||
<script type="text/javascript" src="jquery.localtime-0.9.1.min.js"></script>
|
<script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="external/sprintf.min.js"></script>
|
||||||
|
|
||||||
<!-- Tablesorter: required -->
|
<!-- Tablesorter: required -->
|
||||||
<link rel="stylesheet" href="theme.blue.css">
|
<script type="text/javascript" src="external/jquery.tablesorter.min.js"></script>
|
||||||
<script src="jquery.tablesorter.min.js"></script>
|
<script type="text/javascript" src="external/jquery.tablesorter.widgets.min.js"></script>
|
||||||
<!-- script src="widget-scroller.js"></script -->
|
<script type="text/javascript" src="external/widget-pager.js"></script>
|
||||||
<script src="jquery.tablesorter.widgets.min.js"></script>
|
<!-- script type="text/javascript" src="external/jquery.tablesorter.pager.min.js"></script -->
|
||||||
<script src="jquery.tablesorter.pager.min.js"></script>
|
<!-- script type="text/javascript" src="external/widget-scroller.js"></script -->
|
||||||
|
|
||||||
<!-- misc functions -->
|
|
||||||
<script src="misc.js"></script>
|
|
||||||
<script src="sprintf.min.js"></script>
|
|
||||||
|
|
||||||
<!-- Tablesorter: pager -->
|
|
||||||
<link rel="stylesheet" href="jquery.tablesorter.pager.css">
|
|
||||||
<script src="widget-pager.js"></script>
|
|
||||||
<script src="events.js"></script>
|
|
||||||
|
|
||||||
<!-- Leaflet -->
|
<!-- Leaflet -->
|
||||||
<link rel="stylesheet" href="leaflet.css" />
|
<script type="text/javascript" src="external/leaflet.js"></script>
|
||||||
<script src="leaflet.js"></script>
|
<script type="text/javascript" src="external/TileLayer.Grayscale.js"></script>
|
||||||
<!-- script src="TileLayer.Grayscale.js"></script -->
|
<script type="text/javascript" src="external/leaflet-dvf.markers.min.js"></script>
|
||||||
<script src="map.js"></script>
|
<script type="text/javascript" src="external/leaflet.label.js"></script>
|
||||||
|
<script src="external/jQuery.print.js"></script>
|
||||||
|
<script src="external/leaflet.easyPrint.js"></script>
|
||||||
|
<script src="https://open.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script>
|
||||||
|
<!-- <script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script> -->
|
||||||
|
|
||||||
<!-- Stations -->
|
<!-- Map, Events & Stations -->
|
||||||
<script src="stations.js"></script>
|
<script type="text/javascript" src="misc.js"></script>
|
||||||
|
<script type="text/javascript" src="geolocation.js"></script>
|
||||||
|
<script type="text/javascript" src="specialevents.js"></script>
|
||||||
|
<script type="text/javascript" src="map.js"></script>
|
||||||
|
<script type="text/javascript" src="events.js"></script>
|
||||||
|
<script type="text/javascript" src="stations.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<!-- noscript -->
|
||||||
|
<noscript>
|
||||||
|
<div class="noscript">
|
||||||
|
<div class="noscriptcontent">
|
||||||
|
<h2>Kein JavaScript verfügbar!</h2>
|
||||||
|
<p>Diese Seite benötigt JavaScript. Bitte schalten Sie JavaScript ein.</p>
|
||||||
|
<h2>JavaScript disabled!</h2>
|
||||||
|
<p>This page requires JavaScript to work. Please enable JavaScript.</p>
|
||||||
|
<h2>Impressum</h2>
|
||||||
|
<!--#include virtual="impressum.inc.de" -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
<!-- Tabs -->
|
||||||
<div class="info" id="tabs">
|
<div class="info" id="tabs">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#eventstab"><span>Ereignisse</span></a></li>
|
<li><a href="#eventstab"><span>Ereignisse</span></a></li>
|
||||||
@@ -55,11 +76,11 @@
|
|||||||
<!-- Ereignisse -->
|
<!-- Ereignisse -->
|
||||||
<div class="tab" id="eventstab">
|
<div class="tab" id="eventstab">
|
||||||
<div class="pager events" id="eventspager">
|
<div class="pager events" id="eventspager">
|
||||||
<img src="first.png" class="first" alt="First" />
|
<img src="external/first.png" class="first" alt="First" />
|
||||||
<img src="prev.png" class="prev" alt="Prev" />
|
<img src="external/prev.png" class="prev" alt="Prev" />
|
||||||
<span class="pagedisplay"></span>
|
<span class="pagedisplay"></span>
|
||||||
<img src="next.png" class="next" alt="Next" />
|
<img src="external/next.png" class="next" alt="Next" />
|
||||||
<img src="last.png" class="last" alt="Last" />
|
<img src="external/last.png" class="last" alt="Last" />
|
||||||
<select class="pagesize" title="Select page size">
|
<select class="pagesize" title="Select page size">
|
||||||
<option value="5">5</option>
|
<option value="5">5</option>
|
||||||
<option value="10">10</option>
|
<option value="10">10</option>
|
||||||
@@ -71,7 +92,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select class="gotoPage" title="Select page number"></select>
|
<select class="gotoPage" title="Select page number"></select>
|
||||||
</div>
|
</div>
|
||||||
<table class="tablesorter" id="eventstable" data-sortlist="[[0,0],[1,1],[2,1]]">
|
<table class="tablesorter" id="eventstable">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col width="85" />
|
<col width="85" />
|
||||||
<col width="50" />
|
<col width="50" />
|
||||||
@@ -89,16 +110,24 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p>Nominatim Search Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png"></p>
|
<p class="table-caption">
|
||||||
|
Ereignisse der letzten <span id="events-timespan">180</span> Tage ab Magnitude <span id="events-minmag">1.2</span> im Bereich der Karte und besondere Ereignisse in angrenzenden Bereichen. Download als <a id="events-csv-link" href="link" download="events.csv">CSV-Datei</a>.
|
||||||
|
</p>
|
||||||
|
<p class="table-caption">
|
||||||
|
<span id="events-type">Symbole:</span>
|
||||||
|
</p>
|
||||||
|
<p class="table-caption">
|
||||||
|
Reverse Geolocation courtesy of <a href="http://photon.komoot.de/" target="_blank">Photon by Komoot</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- Stations -->
|
<!-- Stations -->
|
||||||
<div class="tab" id="stationstab">
|
<div class="tab" id="stationstab">
|
||||||
<div class="pager stationspager" id="stationspager">
|
<div class="pager stationspager" id="stationspager">
|
||||||
<img src="first.png" class="stationsfirst" alt="First" />
|
<img src="external/first.png" class="stationsfirst" alt="First" />
|
||||||
<img src="prev.png" class="stationsprev" alt="Prev" />
|
<img src="external/prev.png" class="stationsprev" alt="Prev" />
|
||||||
<span class="stationspagedisplay"></span>
|
<span class="stationspagedisplay"></span>
|
||||||
<img src="next.png" class="stationsnext" alt="Next" />
|
<img src="external/next.png" class="stationsnext" alt="Next" />
|
||||||
<img src="last.png" class="stationslast" alt="Last" />
|
<img src="external/last.png" class="stationslast" alt="Last" />
|
||||||
<select class="stationspagesize" title="Select page size">
|
<select class="stationspagesize" title="Select page size">
|
||||||
<option value="5">5</option>
|
<option value="5">5</option>
|
||||||
<option value="10">10</option>
|
<option value="10">10</option>
|
||||||
@@ -114,8 +143,8 @@
|
|||||||
<colgroup>
|
<colgroup>
|
||||||
<col width="77" />
|
<col width="77" />
|
||||||
<col/>
|
<col/>
|
||||||
<col width="77" />
|
<col width="77" align="char" char="." />
|
||||||
<col width="77" />
|
<col width="77" align="char" char="." />
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -128,12 +157,29 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<p class="table-caption">Download als <a id="stations-csv-link" href="link" download="stations.csv">CSV-Datei</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- More -->
|
<!-- More -->
|
||||||
<div class="tab" id="moretab"></div>
|
<div class="tab" id="moretab"><!--include virtual="more.html.de" --></div>
|
||||||
<!-- Info -->
|
<!-- Info -->
|
||||||
<div class="tab" id="infotab"></div>
|
<div class="tab" id="infotab">
|
||||||
|
<div id="infoaccordion">
|
||||||
|
<h3 class="aheader">Navigation / Links</h3>
|
||||||
|
<!--#include virtual="info.inc.de" -->
|
||||||
|
<h3 class="aheader">Copyright / Lizenz</h3>
|
||||||
|
<!--#include virtual="copyright.inc.de" -->
|
||||||
|
<h3 class="aheader">Impressum</h3>
|
||||||
|
<!--#include virtual="impressum.inc.de" -->
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="rublogo"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-Universität Bochum" title="Ruhr-Universität Bochum"/></div>
|
<!-- Logo -->
|
||||||
|
<div class="rublogo"><a href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-Universität Bochum" title="Ruhr-Universität Bochum" border="0"/></a></div>
|
||||||
|
<!-- Map -->
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
<div id="spinner" class="spinner" style="display:none;"><img id="img-spinner" src="spinner.gif" alt="Loading"/><br />Loading ...</div>
|
||||||
</body>
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
|
||||||
|
<!-- $Id$ -->
|
||||||
|
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
||||||
|
<title>RUB SeisObs - Event and Station Map</title>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Style definitions -->
|
||||||
|
<link rel="stylesheet" href="main.css" />
|
||||||
|
<!-- link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" / -->
|
||||||
|
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css" />
|
||||||
|
<link rel="stylesheet" href="external/theme.blue.css"/>
|
||||||
|
<link rel="stylesheet" href="external/jquery.tablesorter.pager.css" />
|
||||||
|
<link rel="stylesheet" href="external/leaflet.css" />
|
||||||
|
<!-- link rel="stylesheet" href="external/css/dvf.css" type="text/css" media="screen" / -->
|
||||||
|
<link rel="stylesheet" href="external/css/leaflet.label.css" type="text/css" media="screen" />
|
||||||
|
<link rel="stylesheet" href="external/easyPrint.css"/>
|
||||||
|
|
||||||
|
<!-- jQuery & jQueryUI -->
|
||||||
|
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
|
||||||
|
<script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
|
||||||
|
|
||||||
|
<!-- Localtime & sprintf -->
|
||||||
|
<script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="external/sprintf.min.js"></script>
|
||||||
|
|
||||||
|
<!-- Tablesorter: required -->
|
||||||
|
<script type="text/javascript" src="external/jquery.tablesorter.min.js"></script>
|
||||||
|
<script type="text/javascript" src="external/jquery.tablesorter.widgets.min.js"></script>
|
||||||
|
<script type="text/javascript" src="external/widget-pager.js"></script>
|
||||||
|
<!-- script type="text/javascript" src="external/jquery.tablesorter.pager.min.js"></script -->
|
||||||
|
<!-- script type="text/javascript" src="external/widget-scroller.js"></script -->
|
||||||
|
|
||||||
|
<!-- Leaflet -->
|
||||||
|
<script type="text/javascript" src="external/leaflet.js"></script>
|
||||||
|
<script type="text/javascript" src="external/TileLayer.Grayscale.js"></script>
|
||||||
|
<script type="text/javascript" src="external/leaflet-dvf.markers.min.js"></script>
|
||||||
|
<script type="text/javascript" src="external/leaflet.label.js"></script>
|
||||||
|
<script src="external/jQuery.print.js"></script>
|
||||||
|
<script src="external/leaflet.easyPrint.js"></script>
|
||||||
|
|
||||||
|
<script src="https://open.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script>
|
||||||
|
<!-- <script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script> -->
|
||||||
|
|
||||||
|
<!-- Map, Events & Stations -->
|
||||||
|
<script type="text/javascript" src="misc.js"></script>
|
||||||
|
<script type="text/javascript" src="geolocation.js"></script>
|
||||||
|
<script type="text/javascript" src="specialevents.js"></script>
|
||||||
|
<script type="text/javascript" src="map.js.en"></script>
|
||||||
|
<script type="text/javascript" src="events.js.en"></script>
|
||||||
|
<script type="text/javascript" src="stations.js.en"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<!-- noscript -->
|
||||||
|
<noscript>
|
||||||
|
<div class="noscript">
|
||||||
|
<div class="noscriptcontent">
|
||||||
|
<h2>JavaScript disabled!</h2>
|
||||||
|
<p>This page requires JavaScript to work. Please enable JavaScript.</p>
|
||||||
|
<h2>Kein JavaScript verfügbar!</h2>
|
||||||
|
<p>Diese Seite benötigt JavaScript. Bitte schalten Sie JavaScript ein.</p>
|
||||||
|
<h2>Impressum</h2>
|
||||||
|
<!--#include virtual="impressum.inc.de" -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
<!-- Tabs -->
|
||||||
|
<div class="info" id="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><a href="#eventstab"><span>Events</span></a></li>
|
||||||
|
<li><a href="#stationstab"><span>Stations</span></a></li>
|
||||||
|
<li><a href="#moretab"><span>More</span></a></li>
|
||||||
|
<li class="infotab"><a href="#infotab"><span>Info</span></a></li>
|
||||||
|
</ul>
|
||||||
|
<!-- Ereignisse -->
|
||||||
|
<div class="tab" id="eventstab">
|
||||||
|
<div class="pager events" id="eventspager">
|
||||||
|
<img src="external/first.png" class="first" alt="First" />
|
||||||
|
<img src="external/prev.png" class="prev" alt="Prev" />
|
||||||
|
<span class="pagedisplay"></span>
|
||||||
|
<img src="external/next.png" class="next" alt="Next" />
|
||||||
|
<img src="external/last.png" class="last" alt="Last" />
|
||||||
|
<select class="pagesize" title="Select page size">
|
||||||
|
<option value="5">5</option>
|
||||||
|
<option value="10">10</option>
|
||||||
|
<option value="15">15</option>
|
||||||
|
<option value="20">20</option>
|
||||||
|
<option value="25">25</option>
|
||||||
|
<option value="30">30</option>
|
||||||
|
<option value="35">35</option>
|
||||||
|
</select>
|
||||||
|
<select class="gotoPage" title="Select page number"></select>
|
||||||
|
</div>
|
||||||
|
<table class="tablesorter" id="eventstable">
|
||||||
|
<colgroup>
|
||||||
|
<col width="85" />
|
||||||
|
<col width="50" />
|
||||||
|
<col width="50" />
|
||||||
|
<col />
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Time</th>
|
||||||
|
<th>Mag.</th>
|
||||||
|
<th>Place</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="table-caption">
|
||||||
|
Events of the last <span id="events-timespan">180</span> days with magnitude <span id="events-minmag">1.2</span> or larger in the area of the map and special events in adjacents regions. Download as <a id="events-csv-link" href="link" download="events.csv">CSV file</a>.
|
||||||
|
</p>
|
||||||
|
<p class="table-caption">
|
||||||
|
<span id="events-type">Symbols:</span>
|
||||||
|
</p>
|
||||||
|
<p class="table-caption">
|
||||||
|
Reverse Geolocation courtesy of <a href="http://photon.komoot.de/" target="_blank">Photon by Komoot</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<!-- Stations -->
|
||||||
|
<div class="tab" id="stationstab">
|
||||||
|
<div class="pager stationspager" id="stationspager">
|
||||||
|
<img src="external/first.png" class="stationsfirst" alt="First" />
|
||||||
|
<img src="external/prev.png" class="stationsprev" alt="Prev" />
|
||||||
|
<span class="stationspagedisplay"></span>
|
||||||
|
<img src="external/next.png" class="stationsnext" alt="Next" />
|
||||||
|
<img src="external/last.png" class="stationslast" alt="Last" />
|
||||||
|
<select class="stationspagesize" title="Select page size">
|
||||||
|
<option value="5">5</option>
|
||||||
|
<option value="10">10</option>
|
||||||
|
<option value="15">15</option>
|
||||||
|
<option value="20">20</option>
|
||||||
|
<option value="25">25</option>
|
||||||
|
<option value="30">30</option>
|
||||||
|
<option value="35">35</option>
|
||||||
|
</select>
|
||||||
|
<select class="stationsgotoPage" title="Select page number"></select>
|
||||||
|
</div>
|
||||||
|
<table class="tablesorter" id="stationstable">
|
||||||
|
<colgroup>
|
||||||
|
<col width="77" />
|
||||||
|
<col/>
|
||||||
|
<col width="100" align="char" char="." />
|
||||||
|
<col width="100" align="char" char="." />
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Network</th>
|
||||||
|
<th>Station</th>
|
||||||
|
<th>Latitude [°]</th>
|
||||||
|
<th>Longitude [°]</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="table-caption">Download as <a id="stations-csv-link" href="link" download="stations.csv">CSV file</a>.</p>
|
||||||
|
</div>
|
||||||
|
<!-- More -->
|
||||||
|
<div class="tab" id="moretab"><!--include virtual="more.html.de" --></div>
|
||||||
|
<!-- Info -->
|
||||||
|
<div class="tab" id="infotab">
|
||||||
|
<div id="infoaccordion">
|
||||||
|
<h3 class="aheader">Navigation / Links</h3>
|
||||||
|
<!--#include virtual="info.inc.de" -->
|
||||||
|
<h3 class="aheader">Copyright / License</h3>
|
||||||
|
<!--#include virtual="copyright.inc.de" -->
|
||||||
|
<h3 class="aheader">Imprint</h3>
|
||||||
|
<!--#include virtual="impressum.inc.de" -->
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Logo -->
|
||||||
|
<div class="rublogo"><a href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-University Bochum" title="Ruhr-University Bochum" border="0"/></a></div>
|
||||||
|
<!-- Map -->
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
<div id="spinner" class="spinner" style="display:none;"><img id="img-spinner" src="spinner.gif" alt="Loading"/><br />Loading ...</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<div class="accordioncontent">
|
||||||
|
<h4>Navigation zu den Internetseiten</h4>
|
||||||
|
<ul>
|
||||||
|
<li>des <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs">Seismologisches Observatorium</a><br /> der Ruhr-Universität Bochum</li>
|
||||||
|
<li>der <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seismology">Arbeitsgruppe Seismologie</a></li>
|
||||||
|
<li>des <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de">Instituts für Geologie, Mineralogie und Geophysik</a></li>
|
||||||
|
<li>der <a class="intern" href="http://www.rub.de">Ruhr-Universität Bochum</a></li>
|
||||||
|
</ul>
|
||||||
|
<h4>Informationen zu Erdbeben</h4>
|
||||||
|
<ul>
|
||||||
|
<li>in <a class="extern" target="_blank" href="http://www.gd.nrw.de/a_beben.php">NRW</a> (<a class="extern" target="_blank" href="http://www.gd.nrw.de">Geologischer Dienst NRW</a>)</li>
|
||||||
|
<li>in <a class="extern" target="_blank" href="http://www.bgr.bund.de/DE/Themen/Erdbeben-Gefaehrdungsanalysen/Seismologie/Seismologie/Seis-Online/Liste_D_1Jahr/li_d_1jahr_node.html">Deutschland</a> (<a class="extern" target="_blank" href="http://www.bgr.bund.de">BGR Hannover</a>)</li>
|
||||||
|
<li>in <a class="extern" target="_blank" href="http://www.emsc-csem.org">Europa / Mittelmeerraum</a> (<a class="extern" target="_blank" href="http://www.emsc-csem.org">EMSC</a>)</li>
|
||||||
|
<li><a class="extern" target="_blank" href="http://geofon.gfz-potsdam.de/eqinfo/seismon/globmon.php">weltweit</a> (<a class="extern" target="_blank" href="http://geofon.gfz-potsdam.de">GEOFON, GFZ Potsdam</a>)</li>
|
||||||
|
<li><a class="extern" target="_blank" href="http://earthquake.usgs.gov/earthquakes/map/">weltweit</a> (<a class="extern" target="_blank" href="http://earthquake.usgs.gov/">USGS</a>)</li>
|
||||||
|
</ul>
|
||||||
|
<h4>Informationen zum Steinkohlenabbau in NRW</h4>
|
||||||
|
<ul>
|
||||||
|
<li>Homepage der <a class="extern" target="_blank" href="http://www.rag.de">RAG</a></li>
|
||||||
|
<li><a class="extern" target="_blank" href="http://www.bid.rag.de">Bürgerinformationssystem</a> der RAG</li>
|
||||||
|
</div>
|
||||||
@@ -13,6 +13,20 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
}
|
}
|
||||||
|
div.noscript {
|
||||||
|
z-index: 20000;
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
top: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 200%;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
div.noscriptcontent {
|
||||||
|
z-index: 20010;
|
||||||
|
margin: 45px;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
div.info {
|
div.info {
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -38,6 +52,12 @@
|
|||||||
background: rgb(255, 255, 255);
|
background: rgb(255, 255, 255);
|
||||||
background: rgba(25, 255, 255, 0.95);
|
background: rgba(25, 255, 255, 0.95);
|
||||||
}
|
}
|
||||||
|
div.accordioncontent {
|
||||||
|
z-index: 10010;
|
||||||
|
margin: 0px!important;
|
||||||
|
padding: 5px!important;
|
||||||
|
font: sans-serif;
|
||||||
|
}
|
||||||
div.rublogo {
|
div.rublogo {
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -64,4 +84,19 @@
|
|||||||
td.ar {
|
td.ar {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
p.table-caption {
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
|
div.spinner {
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -64px; /* half width of the spinner gif */
|
||||||
|
margin-top: -8px; /* half height of the spinner gif */
|
||||||
|
text-align:center;
|
||||||
|
z-index: 19000;
|
||||||
|
overflow: auto;
|
||||||
|
width: 128px; /* width of the spinner gif */
|
||||||
|
height: 40px; /*hight of the spinner gif +2px to fix IE8 issue */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,117 +1,107 @@
|
|||||||
/* toggles visibility of filtered markers
|
/**********************************************************************
|
||||||
* only events in the event list are shown */
|
* map.js *
|
||||||
function toggleFilteredMarkers() {
|
* script for map specific functions and setup *
|
||||||
// show all shown events in map
|
**********************************************************************/
|
||||||
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
|
|
||||||
if ( $(this).attr("eventid") ) {
|
|
||||||
eventTable[$(this).attr("eventid")].setStyle({opacity: 1, strokeOpacity: 1, fillOpacity: eventMarkerOpacity});
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
// hide filtered events in map
|
/* License
|
||||||
$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() {
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
if ( $(this).attr("eventid") ) {
|
|
||||||
eventTable[$(this).attr("eventid")].setStyle({opacity: 0, strokeOpacity: 0, fillOpacity: 0});
|
|
||||||
};
|
|
||||||
});
|
|
||||||
highlightFirstEvent();
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Highlight the first event of the event list on the map if no
|
This program is free software: you can redistribute it and/or modify it
|
||||||
* other event is selected */
|
under the terms of the GNU General Public License as published by the Free
|
||||||
function highlightFirstEvent() {
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
var highlightStyle = {
|
any later version.
|
||||||
color: 'red',
|
|
||||||
fillColor: '#f03',
|
|
||||||
};
|
|
||||||
var normalStyle = {
|
|
||||||
fillColor: "#FFF500",
|
|
||||||
color: "#FFF500"
|
|
||||||
};
|
|
||||||
$("#eventstable a.map-link").each( function() {
|
|
||||||
if ( $(this).attr("eventid") ) {
|
|
||||||
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
|
|
||||||
$(this).removeClass('first');
|
|
||||||
$(this).text('Karte');
|
|
||||||
};
|
|
||||||
});
|
|
||||||
$("#eventstable > tbody > tr:not(.filtered)").first().find("a.map-link").each(function() {
|
|
||||||
if ( $(this).attr("eventid") ) {
|
|
||||||
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
|
|
||||||
$(this).addClass('first');
|
|
||||||
$(this).text('Karte (rot)');
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function highlightEvent( id ) {
|
This program is distributed in the hope that it will be useful, but
|
||||||
var highlightStyle = {
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
color: 'red',
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
fillColor: '#f03',
|
for more details.
|
||||||
};
|
|
||||||
var normalStyle = {
|
You should have received a copy of the GNU General Public License along
|
||||||
fillColor: "#FFF500",
|
with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
color: "#FFF500"
|
|
||||||
};
|
$Id$
|
||||||
$("#eventstable > tbody > tr:not(.filtered)").find("a.map-link").each( function() {
|
*/
|
||||||
if ( $(this).attr("eventid") ) {
|
|
||||||
if ( $(this).attr("eventid") == id ) {
|
|
||||||
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
|
|
||||||
$(this).addClass('first');
|
|
||||||
$(this).text('Karte (rot)');
|
|
||||||
} else {
|
|
||||||
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
|
|
||||||
$(this).removeClass('first');
|
|
||||||
$(this).text('Karte');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* add station marker */
|
/* add station marker */
|
||||||
function addStationMarker(id, lat, lng) {
|
function addStationMarker(id, lat, lng, station) {
|
||||||
var a = 0.0025,
|
var marker = L.triangleMarker(L.latLng(lat, lng),
|
||||||
b = Math.sqrt(3)*a,
|
|
||||||
a = a * Math.cos(lat*Math.PI/180);
|
|
||||||
var corners = [L.latLng(lat+2*a, lng), L.latLng(lat-a, lng+b), L.latLng(lat-a, lng-b)];
|
|
||||||
var marker = L.polygon(corners,
|
|
||||||
{
|
{
|
||||||
fillColor: "#1C771C",
|
gradient: true,
|
||||||
color: "#1C771C",
|
fillColor: config['station']['markerColor'],
|
||||||
|
fillOpacity: config['station']['markerOpacity'],
|
||||||
|
color: config['station']['markerColor'],
|
||||||
weight: 1,
|
weight: 1,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
fillOpacity: stationMarkerOpacity,
|
radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'],
|
||||||
className: id+' stationMarker',
|
className: id+' stationMarker',
|
||||||
}).addTo(stationLayer);
|
});
|
||||||
|
marker.bindLabel('Station '+station);
|
||||||
|
stationLayer.addLayer(marker);
|
||||||
stationTable[id] = marker;
|
stationTable[id] = marker;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* add event marker */
|
/* add event marker */
|
||||||
function addEventMarker(id, lat, lng, mag) {
|
function addEventMarker(id, lat, lng, mag, type) {
|
||||||
var markerOptions = {
|
if ( eventTable[id] ) {
|
||||||
fillColor: "#FFF500",
|
return eventTable[id];
|
||||||
color: "#FFF500",
|
} else {
|
||||||
weight: 1,
|
var markerOptions = {
|
||||||
opacity: 1,
|
gradient: true,
|
||||||
fillOpacity: eventMarkerOpacity,
|
dropShadow: false,
|
||||||
className: id+' eventMarker',
|
fillColor: config['event']['markerColor'],
|
||||||
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
color: config['event']['markerColor'],
|
||||||
|
weight: 0,
|
||||||
|
opacity: 1,
|
||||||
|
className: id+' eventMarker',
|
||||||
|
radius: mag2radius(mag)
|
||||||
|
};
|
||||||
|
var marker;
|
||||||
|
switch ( type ) {
|
||||||
|
case 'earthquake':
|
||||||
|
marker = L.starMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
break;
|
||||||
|
case 'nuclear explosion':
|
||||||
|
markerOptions['numberOfSides'] = 4;
|
||||||
|
markerOptions['radius'] = 2.0*markerOptions['radius'];
|
||||||
|
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
|
||||||
|
marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
break;
|
||||||
|
case 'explosion':
|
||||||
|
markerOptions['numberOfSides'] = 6;
|
||||||
|
markerOptions['radius'] = 2.0*markerOptions['radius'];
|
||||||
|
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
|
||||||
|
marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
break;
|
||||||
|
case 'quarry blast':
|
||||||
|
case 'controlled explosion':
|
||||||
|
markerOptions['numberOfPoints'] = 7;
|
||||||
|
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
|
||||||
|
marker = L.starMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
marker = L.circleMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
};
|
||||||
|
eventLayer.addLayer(marker);
|
||||||
|
eventTable[id] = marker;
|
||||||
|
return marker;
|
||||||
};
|
};
|
||||||
var marker = L.circle(L.latLng(lat, lng), mag2radius(mag), markerOptions).addTo(eventLayer);
|
|
||||||
eventTable[id] = marker;
|
|
||||||
return marker;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* handle to show events on map */
|
/* handle to show events on map */
|
||||||
function initMapLink() {
|
function initMapLink() {
|
||||||
|
$("#eventstable > tbody > tr > td > a.map-link").off('click');
|
||||||
$("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){
|
$("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){
|
||||||
var highlightStyle = {
|
var highlightStyle = {
|
||||||
color: 'red',
|
color: config['event']['markerColorH'],
|
||||||
fillColor: '#f03',
|
fillColor: config['event']['markerColorH'],
|
||||||
|
fillOpacity: 1,
|
||||||
className: $(this).attr('eventid')
|
className: $(this).attr('eventid')
|
||||||
}
|
}
|
||||||
var normalStyle = {
|
var normalStyle = {
|
||||||
fillColor: "#FFF500",
|
fillColor: config['event']['markerColor'],
|
||||||
color: "#FFF500"
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
color: config['event']['markerColor']
|
||||||
};
|
};
|
||||||
// mark currently selected link and remove class selected from all other links
|
// mark currently selected link and remove class selected from all other links
|
||||||
// set everything to normal state
|
// set everything to normal state
|
||||||
@@ -129,64 +119,128 @@ function initMapLink() {
|
|||||||
if ( $(this).hasClass('selected') ) {
|
if ( $(this).hasClass('selected') ) {
|
||||||
$(this).removeClass('selected');
|
$(this).removeClass('selected');
|
||||||
$(this).text('Karte');
|
$(this).text('Karte');
|
||||||
|
map.setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
|
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
|
||||||
map.setView(mapCentreDefault, zoomDefault);
|
|
||||||
highlightFirstEvent();
|
highlightFirstEvent();
|
||||||
// unselected -> selected
|
// unselected -> selected
|
||||||
} else {
|
} else {
|
||||||
$(this).addClass('selected');
|
$(this).addClass('selected');
|
||||||
$(this).text('im Fokus (rot)');
|
$(this).text('im Fokus (rot)');
|
||||||
eventTable[$(this).attr('eventid')].setStyle(highlightStyle);
|
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), config['map']['zoomFocus']);
|
||||||
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), zoomFocus);
|
eventTable[$(this).attr('eventid')].setStyle(highlightStyle)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************
|
/**********************************************************************
|
||||||
* document ready *
|
* document ready *
|
||||||
******************/
|
**********************************************************************/
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// create a map in the "map" div, set the view to a given place and zoom
|
// create a map in the "map" div, set the view to a given place and zoom
|
||||||
map = L.map('map', { zoomControl: false }).setView(mapCentreDefault, zoomDefault);
|
|
||||||
new L.Control.Zoom({ position: 'topright' }).addTo(map);
|
|
||||||
|
|
||||||
// add MapQuestOSM tile layer
|
// create baselayer
|
||||||
// L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
switch ( config['map']['baselayer'] ) {
|
||||||
L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
case 'osmde': // add OpenStreetMap.DE tile layer
|
||||||
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
|
||||||
{
|
{
|
||||||
subdomains: '1234',
|
attribution: '© <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
|
||||||
detectRetina: true,
|
|
||||||
attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
|
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
break;
|
||||||
// add ESRI Grayscale World Map (neither city nor road names)
|
case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names)
|
||||||
/* L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
|
||||||
{
|
{
|
||||||
attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ',
|
attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ',
|
||||||
maxZoom: 16
|
maxZoom: 16
|
||||||
}).addTo(map); */
|
}).addTo(map);
|
||||||
|
break;
|
||||||
|
case 'aerial': // add ESRI WordImagery tile layer
|
||||||
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
|
||||||
|
{
|
||||||
|
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
|
||||||
|
}).addTo(map);
|
||||||
|
break;
|
||||||
|
case 'komoot': // add OpenStreetMap.DE tile layer
|
||||||
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
L.tileLayer('//www.komoot.de/tiles/{s}/{z}/{x}/{y}.png',
|
||||||
|
{
|
||||||
|
attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.komoot.de/">Komoot</a>',
|
||||||
|
}).addTo(map);
|
||||||
|
break;
|
||||||
|
case 'mapquestgray': // add MapQuestOSM tile layer
|
||||||
|
null;
|
||||||
|
// map = L.map('map', { zoomControl: false, worldCopyJump: true, layers: mapLayer }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
// L.tileLayer.grayscale('https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
||||||
|
// {
|
||||||
|
// subdomains: '1234',
|
||||||
|
// detectRetina: true,
|
||||||
|
// attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
|
||||||
|
//}).addTo(map);
|
||||||
|
//break;
|
||||||
|
case 'mapquest': // add MapQuestOSM tile layer
|
||||||
|
null;
|
||||||
|
default:
|
||||||
|
var mapLayer = MQ.mapLayer();
|
||||||
|
map = L.map('map', {
|
||||||
|
zoomControl: false,
|
||||||
|
worldCopyJump: true,
|
||||||
|
layers: mapLayer,
|
||||||
|
}).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
//L.tileLayer('https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
||||||
|
//{
|
||||||
|
//subdomains: '1234',
|
||||||
|
//detectRetina: true,
|
||||||
|
//attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
|
||||||
|
//}).addTo(map);
|
||||||
|
};
|
||||||
|
|
||||||
// read in stations
|
// add controls
|
||||||
stationLayer = L.geoJson().addTo(map);
|
new L.Control.Zoom({ position: 'topright' }).addTo(map);
|
||||||
|
new L.control.scale({position: 'bottomright', imperial: false}).addTo(map);
|
||||||
|
|
||||||
// read in events, process filter
|
// create station and event layer
|
||||||
eventLayer = L.geoJson().addTo(map);
|
// stationLayer = L.geoJson().addTo(map);
|
||||||
|
stationLayer = new L.MarkerGroup().addTo(map);
|
||||||
|
eventLayer = new L.MarkerGroup().addTo(map);
|
||||||
|
|
||||||
|
// load events
|
||||||
|
ajaxLoadEvents('', '', '', 'events.xml');
|
||||||
ajaxLoadEvents();
|
ajaxLoadEvents();
|
||||||
|
specialEvents.map(function(id) {
|
||||||
|
ajaxLoadEvents('', '', id)
|
||||||
|
});
|
||||||
toggleFilteredMarkers();
|
toggleFilteredMarkers();
|
||||||
|
|
||||||
// bind popupopen event
|
// bind popupopen event
|
||||||
map.on('popupopen', function() {
|
map.on('popupopen', function() {
|
||||||
// convert date/time to localtime
|
// convert date/time to localtime
|
||||||
$("div.leaflet-popup span.utctime").each(function(){$(this).addClass("localtime").removeClass("utctime");$.localtime.formatObject($(this), "dd.MM.yyyy - HH:mm")});
|
$("div.leaflet-popup span.utctime").each(function(){$(this).addClass("localtime").removeClass("utctime");$.localtime.formatObject($(this), "dd.MM.yyyy - HH:mm")});
|
||||||
var eventid = $("div.leaflet-popup h3").attr("eventid");
|
openMarkerID = $("div.leaflet-popup h3").attr("eventid");
|
||||||
if ( eventid ) {
|
if ( openMarkerID ) {
|
||||||
// highlight event in table
|
|
||||||
highlightEvent(eventid);
|
|
||||||
// update city in popup
|
// update city in popup
|
||||||
$("div.leaflet-popup h3").text(geolocationTable[eventid]);
|
$("div.leaflet-popup h3").text(geolocationTable[openMarkerID]);
|
||||||
|
// highlight event in table and show details
|
||||||
|
// highlightEvent(eventid);
|
||||||
|
$('#eventstable > tbody > tr > td > a.toggle').each(function() {
|
||||||
|
if ( $(this).attr('eventid') == openMarkerID ) {
|
||||||
|
$(this)[0].click();
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
map.on('popupclose', function() {
|
||||||
|
$('#eventstable > tbody > tr > td > a.toggle').each(function() {
|
||||||
|
if ( $(this).attr('eventid') == openMarkerID ) {
|
||||||
|
$(this)[0].click();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// print icon
|
||||||
|
L.easyPrint().addTo(map);
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
* map.js *
|
||||||
|
* script for map specific functions and setup *
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
/* License
|
||||||
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* add station marker */
|
||||||
|
function addStationMarker(id, lat, lng, station) {
|
||||||
|
var marker = L.triangleMarker(L.latLng(lat, lng),
|
||||||
|
{
|
||||||
|
gradient: true,
|
||||||
|
fillColor: config['station']['markerColor'],
|
||||||
|
fillOpacity: config['station']['markerOpacity'],
|
||||||
|
color: config['station']['markerColor'],
|
||||||
|
weight: 1,
|
||||||
|
opacity: 1,
|
||||||
|
radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'],
|
||||||
|
className: id+' stationMarker',
|
||||||
|
});
|
||||||
|
marker.bindLabel('Station '+station);
|
||||||
|
stationLayer.addLayer(marker);
|
||||||
|
stationTable[id] = marker;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* add event marker */
|
||||||
|
function addEventMarker(id, lat, lng, mag, type) {
|
||||||
|
if ( eventTable[id] ) {
|
||||||
|
return eventTable[id];
|
||||||
|
} else {
|
||||||
|
var markerOptions = {
|
||||||
|
gradient: true,
|
||||||
|
dropShadow: false,
|
||||||
|
fillColor: config['event']['markerColor'],
|
||||||
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
color: config['event']['markerColor'],
|
||||||
|
weight: 0,
|
||||||
|
opacity: 1,
|
||||||
|
className: id+' eventMarker',
|
||||||
|
radius: mag2radius(mag)
|
||||||
|
};
|
||||||
|
var marker;
|
||||||
|
switch ( type ) {
|
||||||
|
case 'earthquake':
|
||||||
|
marker = L.starMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
break;
|
||||||
|
case 'nuclear explosion':
|
||||||
|
markerOptions['numberOfSides'] = 4;
|
||||||
|
markerOptions['radius'] = 2.0*markerOptions['radius'];
|
||||||
|
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
|
||||||
|
marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
break;
|
||||||
|
case 'explosion':
|
||||||
|
markerOptions['numberOfSides'] = 6;
|
||||||
|
markerOptions['radius'] = 2.0*markerOptions['radius'];
|
||||||
|
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
|
||||||
|
marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
break;
|
||||||
|
case 'quarry blast':
|
||||||
|
case 'controlled explosion':
|
||||||
|
markerOptions['numberOfPoints'] = 7;
|
||||||
|
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
|
||||||
|
marker = L.starMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
marker = L.circleMarker(L.latLng(lat, lng), markerOptions);
|
||||||
|
};
|
||||||
|
eventLayer.addLayer(marker);
|
||||||
|
eventTable[id] = marker;
|
||||||
|
return marker;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* handle to show events on map */
|
||||||
|
function initMapLink() {
|
||||||
|
$("#eventstable > tbody > tr > td > a.map-link").off('click');
|
||||||
|
$("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){
|
||||||
|
var highlightStyle = {
|
||||||
|
color: config['event']['markerColorH'],
|
||||||
|
fillColor: config['event']['markerColorH'],
|
||||||
|
fillOpacity: 1,
|
||||||
|
className: $(this).attr('eventid')
|
||||||
|
}
|
||||||
|
var normalStyle = {
|
||||||
|
fillColor: config['event']['markerColor'],
|
||||||
|
fillOpacity: config['event']['markerOpacity'],
|
||||||
|
color: config['event']['markerColor']
|
||||||
|
};
|
||||||
|
// mark currently selected link and remove class selected from all other links
|
||||||
|
// set everything to normal state
|
||||||
|
$(this).addClass('selected-now');
|
||||||
|
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link:not(.selected-now)").each(function(){
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
$(this).text('Karte');
|
||||||
|
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
|
||||||
|
});
|
||||||
|
// switch event of first row to normalStyle if it is not the selected one
|
||||||
|
( $(this).hasClass('first') ) ? null : eventTable[$("#eventstable > tbody > tr:not(.filtered)").first().find("a.map-link").attr("eventid")].setStyle(normalStyle);
|
||||||
|
$(this).each(function(){
|
||||||
|
$(this).removeClass('selected-now');
|
||||||
|
// selected -> unselected
|
||||||
|
if ( $(this).hasClass('selected') ) {
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
$(this).text('Karte');
|
||||||
|
map.setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
|
||||||
|
highlightFirstEvent();
|
||||||
|
// unselected -> selected
|
||||||
|
} else {
|
||||||
|
$(this).addClass('selected');
|
||||||
|
$(this).text('at focus (red)');
|
||||||
|
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), config['map']['zoomFocus']);
|
||||||
|
eventTable[$(this).attr('eventid')].setStyle(highlightStyle)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* document ready *
|
||||||
|
**********************************************************************/
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
// create a map in the "map" div, set the view to a given place and zoom
|
||||||
|
|
||||||
|
|
||||||
|
// create baselayer
|
||||||
|
switch ( config['map']['baselayer'] ) {
|
||||||
|
case 'osmde': // add OpenStreetMap.DE tile layer
|
||||||
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
|
||||||
|
{
|
||||||
|
attribution: '© <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
|
||||||
|
}).addTo(map);
|
||||||
|
break;
|
||||||
|
case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names)
|
||||||
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
|
||||||
|
{
|
||||||
|
attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ',
|
||||||
|
maxZoom: 16
|
||||||
|
}).addTo(map);
|
||||||
|
break;
|
||||||
|
case 'aerial': // add ESRI WordImagery tile layer
|
||||||
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
|
||||||
|
{
|
||||||
|
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
|
||||||
|
}).addTo(map);
|
||||||
|
break;
|
||||||
|
case 'komoot': // add OpenStreetMap.DE tile layer
|
||||||
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
L.tileLayer('//www.komoot.de/tiles/{s}/{z}/{x}/{y}.png',
|
||||||
|
{
|
||||||
|
attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.komoot.de/">Komoot</a>',
|
||||||
|
}).addTo(map);
|
||||||
|
break;
|
||||||
|
case 'mapquestgray': // add MapQuestOSM tile layer
|
||||||
|
null;
|
||||||
|
// map = L.map('map', { zoomControl: false, worldCopyJump: true, layers: mapLayer }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
// L.tileLayer.grayscale('https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
||||||
|
// {
|
||||||
|
// subdomains: '1234',
|
||||||
|
// detectRetina: true,
|
||||||
|
// attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
|
||||||
|
//}).addTo(map);
|
||||||
|
//break;
|
||||||
|
case 'mapquest': // add MapQuestOSM tile layer
|
||||||
|
null;
|
||||||
|
default:
|
||||||
|
var mapLayer = MQ.mapLayer();
|
||||||
|
map = L.map('map', {
|
||||||
|
zoomControl: false,
|
||||||
|
worldCopyJump: true,
|
||||||
|
layers: mapLayer,
|
||||||
|
}).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
|
//L.tileLayer('https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
||||||
|
//{
|
||||||
|
//subdomains: '1234',
|
||||||
|
//detectRetina: true,
|
||||||
|
//attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
|
||||||
|
//}).addTo(map);
|
||||||
|
};
|
||||||
|
// add controls
|
||||||
|
new L.Control.Zoom({ position: 'topright' }).addTo(map);
|
||||||
|
new L.control.scale({position: 'bottomright', imperial: false}).addTo(map);
|
||||||
|
|
||||||
|
// create station and event layer
|
||||||
|
// stationLayer = L.geoJson().addTo(map);
|
||||||
|
stationLayer = new L.MarkerGroup().addTo(map);
|
||||||
|
eventLayer = new L.MarkerGroup().addTo(map);
|
||||||
|
|
||||||
|
// load events
|
||||||
|
ajaxLoadEvents('', '', '', 'events.xml');
|
||||||
|
ajaxLoadEvents();
|
||||||
|
specialEvents.map(function(id) {
|
||||||
|
ajaxLoadEvents('', '', id)
|
||||||
|
});
|
||||||
|
toggleFilteredMarkers();
|
||||||
|
|
||||||
|
// bind popupopen event
|
||||||
|
map.on('popupopen', function() {
|
||||||
|
// convert date/time to localtime
|
||||||
|
$("div.leaflet-popup span.utctime").each(function(){$(this).addClass("localtime").removeClass("utctime");$.localtime.formatObject($(this), "dd.MM.yyyy - HH:mm")});
|
||||||
|
openMarkerID = $("div.leaflet-popup h3").attr("eventid");
|
||||||
|
if ( openMarkerID ) {
|
||||||
|
// update city in popup
|
||||||
|
$("div.leaflet-popup h3").text(geolocationTable[openMarkerID]);
|
||||||
|
// highlight event in table and show details
|
||||||
|
// highlightEvent(eventid);
|
||||||
|
$('#eventstable > tbody > tr > td > a.toggle').each(function() {
|
||||||
|
if ( $(this).attr('eventid') == openMarkerID ) {
|
||||||
|
$(this)[0].click();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
map.on('popupclose', function() {
|
||||||
|
$('#eventstable > tbody > tr > td > a.toggle').each(function() {
|
||||||
|
if ( $(this).attr('eventid') == openMarkerID ) {
|
||||||
|
$(this)[0].click();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// print icon
|
||||||
|
L.easyPrint().addTo(map);
|
||||||
|
});
|
||||||
@@ -1,23 +1,38 @@
|
|||||||
// calculate marker radius from magnitude, both formulas have equal radii at mag=1.2
|
/**********************************************************************
|
||||||
|
* misc.js *
|
||||||
|
* script for unspecific functions and setup *
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
/* License
|
||||||
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* calculate marker radius from magnitude
|
||||||
|
* both formulas have equal radii at mag=1.2 */
|
||||||
function mag2radius(mag) {
|
function mag2radius(mag) {
|
||||||
return 400*mag; // radius proportional to magagnitude
|
return 3*mag; // radius proportional to magagnitude
|
||||||
// return 8.104*Math.pow(30,mag) // radius proportional to energy
|
// return 8.104*Math.pow(30,mag) // radius proportional to energy
|
||||||
};
|
};
|
||||||
|
|
||||||
// set height of eventlist div
|
/* set height of eventlist div */
|
||||||
function sleep(milliseconds) {
|
|
||||||
var start = new Date().getTime();
|
|
||||||
for (var i = 0; i < 1e7; i++) {
|
|
||||||
if ((new Date().getTime() - start) > milliseconds){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function setInfoHeight() {
|
function setInfoHeight() {
|
||||||
var height = $('div.map').height() - 36;
|
var height = $('div.map').height() - 36;
|
||||||
$('div.info').height(height);
|
$('div.info').height(height);
|
||||||
//$('.tab').height(height-80);
|
|
||||||
//$('#eventtable').height(height-100);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* get region and regionID of a location */
|
/* get region and regionID of a location */
|
||||||
@@ -51,36 +66,159 @@ function getLocation(lat, lng) {
|
|||||||
return [ region, regionID ];
|
return [ region, regionID ];
|
||||||
};
|
};
|
||||||
|
|
||||||
// window resize
|
/* window resize */
|
||||||
$( window ).resize(function() {
|
$( window ).resize(function() {
|
||||||
setInfoHeight();
|
setInfoHeight();
|
||||||
});
|
});
|
||||||
|
|
||||||
// create global vars
|
/* parseQueryString */
|
||||||
var map
|
function parseQueryString() {
|
||||||
|
var query = (window.location.search || '?').substr(1),
|
||||||
|
map = {};
|
||||||
|
query.replace(/([^&=]+)=?([^&]*)(?:&+|$)/g, function(match, key, value) {
|
||||||
|
key.toLowerCase();
|
||||||
|
(map[key] = map[key] || []).push(value);
|
||||||
|
});
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* create global vars */
|
||||||
|
var map;
|
||||||
|
var openMarkerID;
|
||||||
var eventTable = {};
|
var eventTable = {};
|
||||||
var geolocationTable = {};
|
|
||||||
var eventDetails = {};
|
var eventDetails = {};
|
||||||
var stationTable = {};
|
var stationTable = {};
|
||||||
var eventMarkerOpacity = 0.3;
|
var config = {
|
||||||
var stationMarkerOpacity = 0.5;
|
ajax: {
|
||||||
var zoomFocus = 12;
|
timeout: 20000, // 20 seconds
|
||||||
var zoomDefault = 9;
|
eventURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query',
|
||||||
var mapCentreDefault = [51.85, 7.0];
|
dlsvURL: 'dlsv',
|
||||||
var minMag = 1.2;
|
mseedURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/dataselect/1/query',
|
||||||
|
stationURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query',
|
||||||
|
nominatimURL: 'https://photon.komoot.de/reverse',
|
||||||
|
timespan: 180,
|
||||||
|
},
|
||||||
|
event: {
|
||||||
|
evaluationBlacklist: ['automatic', 'preliminary', 'rejected'],
|
||||||
|
markerOpacity: 0.4,
|
||||||
|
markerColor: 'blue',
|
||||||
|
markerColorH: 'red',
|
||||||
|
minMag: 1.2,
|
||||||
|
minMagDelta: 0.1,
|
||||||
|
typeWhitelist: ['earthquake', 'induced or triggered event', 'controlled explosion'],
|
||||||
|
// typeWhitelist: ['earthquake', 'induced or triggered event', 'controlled explosion', 'nuclear explosion'],
|
||||||
|
// typeWhitelist: ['earthquake', 'induced or triggered event'],
|
||||||
|
},
|
||||||
|
map: {
|
||||||
|
zoomDefault: 9,
|
||||||
|
zoomFocus: 12,
|
||||||
|
centerDefault: [51.85, 7.0],
|
||||||
|
timespan: 180,
|
||||||
|
latlngDelta: 0.1,
|
||||||
|
},
|
||||||
|
station: {
|
||||||
|
markerColor: 'darkgreen',
|
||||||
|
markerOpacity: 1,
|
||||||
|
markerSize: {
|
||||||
|
defaultSize: 8,
|
||||||
|
GE_IBBN: 10,
|
||||||
|
GR_BUG: 10,
|
||||||
|
GR_KAST: 10,
|
||||||
|
NL_HGN: 3,
|
||||||
|
NL_OPLO: 3,
|
||||||
|
NL_VKB: 3,
|
||||||
|
NL_WIT: 3,
|
||||||
|
NL_WTSB: 3,
|
||||||
|
},
|
||||||
|
networkBlacklist: ['NL', 'X5', '1A', 'AM'],
|
||||||
|
stationBlacklist: ['RN_WEA2', 'RN_ACN', 'RN_BHE', 'RN_ENT', 'RN_GSH', 'RN_HES', 'RN_JCKS', 'RN_LOH',
|
||||||
|
'RN_OLF', 'RN_PLH', 'RN_RWB', 'RN_SOR', 'RN_TDN', 'RN_WBS',
|
||||||
|
'RN_HAM1', 'RN_HAM2', 'RN_HAM3', 'RN_HAM4', 'RN_HAM5', 'RN_HAM6', 'RN_HAM7', 'RN_HAM8', 'RN_HAM9',
|
||||||
|
'RN_HAM10', 'RN_HAM11', 'RN_HAM12', 'RN_HAM13', 'RN_HAM14', 'RN_HAM15', 'RN_HAM16', 'RN_HAM17'],
|
||||||
|
},
|
||||||
|
tab: {
|
||||||
|
active: 0,
|
||||||
|
disabled: [2],
|
||||||
|
max: 4,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
var networkURL = {
|
||||||
|
GE: 'http://dx.doi.org/10.14470/TR560404',
|
||||||
|
GR: 'http://www.bgr.bund.de/DE/Themen/Erdbeben-Gefaehrdungsanalysen/Seismologie/Seismologie/Seismometer_Stationen/Stationsnetze/d_stationsnetz_node.html',
|
||||||
|
NH: 'http://www.gd.nrw.de/gg_le.htm',
|
||||||
|
NL: 'http://www.knmi.nl/seismologie/seismisch_network_knmi3.html',
|
||||||
|
RN: 'https://doi.org/10.7914/SN/RN',
|
||||||
|
YD: 'https://doi.org/10.7914/SN/YD_2020',
|
||||||
|
};
|
||||||
|
var networkText = {
|
||||||
|
GE: '<a href="'+networkURL['GE']+'" target="_blank">GEOFON Seismic Network</a> - Deutsches GeoForschungsZentrum GFZ',
|
||||||
|
GR: '<a href="'+networkURL['GR']+'" target="_blank">German Regional Seismic Network</a>, BGR Hannover',
|
||||||
|
NH: '<a href="'+networkURL['NH']+'" target="_blank">Geologischer Dienst NRW</a>, Krefeld',
|
||||||
|
NL: '<a href="'+networkURL['NL']+'" target="_blank">Netherlands Seismic Network</a>, The Netherlands',
|
||||||
|
RN: '<a href="'+networkURL['RN']+'" target="_blank">RuhrNet - Ruhr-University Bochum, Germany</a>',
|
||||||
|
YD: '<a href="'+networkURL['YD']+'" target="_blank">FloodRisk Seismic Network</a>',
|
||||||
|
};
|
||||||
|
var bochumStation = ['BUG', 'IBBN', 'KERA', 'KARP'];
|
||||||
|
|
||||||
// run when ready
|
// FIX: firefox has no console
|
||||||
|
if (typeof console == "undefined") var console = { log: function() {} };
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* document ready *
|
||||||
|
**********************************************************************/
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
// parse query string
|
||||||
|
var parameters = parseQueryString();
|
||||||
|
if ( parameters['baselayer'] ) {
|
||||||
|
config['map']['baselayer'] = parameters['baselayer'][0];
|
||||||
|
};
|
||||||
|
if ( Number(parameters['lat']) && Number(parameters['lon']) ) {
|
||||||
|
config['map']['centerDefault'] = [Number(parameters['lat']), Number(parameters['lon'])];
|
||||||
|
};
|
||||||
|
if ( Number(parameters['minmag']) ) {
|
||||||
|
config['event']['minMag'] = Number(parameters['minmag']);
|
||||||
|
};
|
||||||
|
if ( parameters['eventcolor'] ) {
|
||||||
|
config['event']['markerColor'] = parameters['eventcolor'];
|
||||||
|
};
|
||||||
|
if ( parameters['eventcolorh'] ) {
|
||||||
|
config['event']['markerColorH'] = parameters['eventcolorh'];
|
||||||
|
};
|
||||||
|
if ( parameters['stationcolor'] ) {
|
||||||
|
config['station']['markerColor'] = parameters['stationcolor'];
|
||||||
|
};
|
||||||
|
if ( Number(parameters['timespan']) ) {
|
||||||
|
config['map']['timespan'] = Number(parameters['timespan']);
|
||||||
|
};
|
||||||
|
if ( Number(parameters['tab']) ) {
|
||||||
|
if ( Number(parameters['tab']) < config['tab']['max'] ) {
|
||||||
|
config['tab']['active'] = Number(parameters['tab']);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// AJAX setup
|
// AJAX setup
|
||||||
$.ajaxSetup({timeout: 15000}); // 15 seconds
|
$.ajaxSetup({timeout: config['ajax']['timeout']});
|
||||||
|
|
||||||
// adjust height of infocontainer
|
// adjust height of infocontainer
|
||||||
setInfoHeight();
|
setInfoHeight();
|
||||||
// create tabs
|
|
||||||
var tabOptions = {
|
|
||||||
active: 0,
|
|
||||||
disabled: [2, 3],
|
|
||||||
};
|
|
||||||
$('#tabs').tabs(tabOptions);
|
|
||||||
// $('.ui-tabs-nav').sortable();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// create tabs
|
||||||
|
$('#tabs').tabs({
|
||||||
|
active: config['tab']['active'],
|
||||||
|
disabled: config['tab']['disabled'],
|
||||||
|
activate: function( event, ui ) { ui['newPanel'].find('table').trigger("update", [true]); },
|
||||||
|
});
|
||||||
|
// create accordions
|
||||||
|
$( '#infoaccordion' ).accordion({
|
||||||
|
active: 0,
|
||||||
|
header: 'h3.aheader',
|
||||||
|
heightStyle: 'content',
|
||||||
|
animate: 200,
|
||||||
|
});
|
||||||
|
// spinner
|
||||||
|
$(document).bind("ajaxSend", function() {
|
||||||
|
$("#spinner").show();
|
||||||
|
}).bind("ajaxStop", function() {
|
||||||
|
$("#spinner").hide();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Das seismologische Netz der Ruhr-Universität besteht aus 13 Stationen. Zwei breitbandige Stationen (BUG und IBBN) sind gleichzeitig Bestandteil des Deutschen Seismologischen Regionalnetzes (GRSN). Sie befinden sich in der Nähe der Ruhr-Universität in einem stillgelegten Stollen der Zeche Klosterbusch bzw. bei Ibbenbüren. Weitere Außenstationen gibt es bei Rheinberg (BRHE) und Hünxe (ZERL, westliches Ruhrgebiet), bei Haltern (BAVN, nörldiches Ruhrgebiet) und Hamm (HMES, östliches Ruhrgebiet). In Ibbenbüren ergänzen die kurzperiodischen Stationen IBBE und IBBS das Stationsnetz. Im Bereich der Ruhr-Universität werden weiterhin 5 kurzperiodische Stationen (BTEZ, BSHA, BKLB, BHOF, BULI) betrieben, die zur Ortung von Ereignissen im Ruhrgebiet verwendet werden. Das von den Seismometern registrierte Messsignal wird an den Stationen digitalisiert und kontinuierlich an die Auswertezentrale an der Ruhr-Universität Bochum übertragen.
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
var specialEvents = [
|
||||||
|
//'bug2014ytlk', // Vechta 3.0
|
||||||
|
//'bug2014wjwx', // Haltern 3.6
|
||||||
|
//'bug2014ldts', // Darmstadt
|
||||||
|
//'bug2014kowj', // Vogtland 5.0
|
||||||
|
//'bug2014jptq', // Seeheim-Jugenheim
|
||||||
|
//'bug2014infb', // Troisdorf
|
||||||
|
//'bug2014ilxd', // Bassum
|
||||||
|
//'bug2014gfzw', // Darmstadt
|
||||||
|
//'bug2014datb', // Groningen
|
||||||
|
// 'bug2013yvko', // Haltern 3.4
|
||||||
|
// 'bug2015fdpy', // Darmstadt 3.0
|
||||||
|
// 'bug2016ajgm', // CTBT violation North Korea
|
||||||
|
// 'bug2016cqkd', // Taunusstein 2.5
|
||||||
|
// 'bug2016hdae', // Aldenhoven 2.6
|
||||||
|
// 'bug2016hdaj', // Aldenhoven 2.4
|
||||||
|
// 'bug2016kkrq', // Bottrop 3.3
|
||||||
|
// 'bug2016qphy', // Central Italy 6.1
|
||||||
|
// 'bug2016rslt', // CTBT violation North Korea
|
||||||
|
// 'bug2016ueqo', // Darmstadt 2.4
|
||||||
|
// 'bug2016ufpi', // Darmstadt 3.0
|
||||||
|
// 'bug2016vico', // Central Italy 6.5
|
||||||
|
// 'bug2016vrnc', // Nörvenich 3.2
|
||||||
|
// 'bug2016zawb', // St Goar 3.2
|
||||||
|
// 'bug2017iyhl', // Hürtgenwald 2.1
|
||||||
|
// 'bug2017omwg', // Brühl 2.3
|
||||||
|
// 'bug2017rfxe', // CTBT violation North Korea 6.1
|
||||||
|
// 'bug2017rjvq', // Dreieich / Hessen 2.6
|
||||||
|
// 'bug2017vxmm', // Brühl / Hürth 3.1
|
||||||
|
// 'bug2018nyax' // Ochtendung 2.7
|
||||||
|
// 'bug2019cxga', // Ochtendung 3.0
|
||||||
|
// 'bug2019czbt', // Ochtendung 2.9
|
||||||
|
// 'bug2019fura', // Sprengung Duisburg-Hochheide (Weißer Riese) 2.0
|
||||||
|
// 'bug2019yeij', // Tektonisch, Hambach 2.2
|
||||||
|
'bug2020fqxf' // Meckenheim, 2.5
|
||||||
|
];
|
||||||
|
After Width: | Height: | Size: 3.9 KiB |
@@ -1,48 +1,110 @@
|
|||||||
// Load the stations using ajax
|
/**********************************************************************
|
||||||
function loadStations(stime, etime) {
|
* stations.js *
|
||||||
|
* script for station specific functions and setup *
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
/* License
|
||||||
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Load the stations using ajax */
|
||||||
|
function loadStations(station, stime, etime) {
|
||||||
var mapBounds = map.getBounds();
|
var mapBounds = map.getBounds();
|
||||||
var N = mapBounds.getNorth();
|
var N = mapBounds.getNorth();
|
||||||
var E = mapBounds.getEast();
|
var E = mapBounds.getEast();
|
||||||
var S = mapBounds.getSouth();
|
var S = mapBounds.getSouth();
|
||||||
var W = mapBounds.getWest();
|
var W = mapBounds.getWest();
|
||||||
var d = 0.1;
|
|
||||||
var url = "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query";
|
|
||||||
if ( !stime ) {
|
if ( !stime ) {
|
||||||
var stime = new Date();
|
var stime = new Date();
|
||||||
stime.setDate(stime.getDate()-180);
|
stime.setDate(stime.getDate()-config['map']['timespan']);
|
||||||
};
|
};
|
||||||
if ( !etime ) {
|
if ( !etime ) {
|
||||||
var etime = new Date();
|
var etime = new Date();
|
||||||
etime.setDate(etime.getDate()+1);
|
etime.setDate(etime.getDate()+1);
|
||||||
};
|
};
|
||||||
var request_data = {
|
if ( !station ) {
|
||||||
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
var request_data = {
|
||||||
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
||||||
minlat: S-d,
|
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
||||||
maxlat: N+d,
|
level: 'station',
|
||||||
minlon: W-d,
|
minlat: S-config['map']['latlngDelta'],
|
||||||
maxlon: E+d,
|
maxlat: N+config['map']['latlngDelta'],
|
||||||
|
minlon: W-config['map']['latlngDelta'],
|
||||||
|
maxlon: E+config['map']['latlngDelta'],
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
var request_data = {
|
||||||
|
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
||||||
|
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
||||||
|
level: 'channel',
|
||||||
|
station: station,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: url,
|
url: config['ajax']['stationURL'],
|
||||||
dataType: "xml",
|
dataType: "xml",
|
||||||
data: request_data,
|
data: request_data,
|
||||||
success: function (xml) {
|
success: function (xml) {
|
||||||
$(xml).find('Network').each(function () {
|
$(xml).find('Network').each(function () {
|
||||||
var network = $(this).attr('code');
|
var network = $(this).attr('code');
|
||||||
$(this).find('Station').each(function () {
|
if ( $.inArray(network, config['station']['networkBlacklist'])<0 ) {
|
||||||
var station = $(this).attr('code'),
|
$(this).find('Station').each(function () {
|
||||||
lat = $(this).find('Latitude').text(),
|
var station = $(this).attr('code'),
|
||||||
lng = $(this).find('Longitude').text(),
|
lat = $(this).find('Latitude:first').text(),
|
||||||
stationID = network+'.'+station;
|
lng = $(this).find('Longitude:first').text(),
|
||||||
if ( !stationTable[stationID] ) { // && N >= lat && S <= lat && W<= lng && E >= lng
|
stationID = network+'_'+station,
|
||||||
var row = sprintf('<tr><td>%s</td><td>%s</td><td class="ar">%7.4f</td><td class="ar">%7.4f</td></tr>' , network, station, Number(lat), Number(lng));
|
stationText = network+'.'+station;
|
||||||
var r = $(row);
|
if ( !stationTable[stationID] && $.inArray(stationID, config['station']['stationBlacklist']) <0 ) {
|
||||||
$('#stationstable tbody').append(r);
|
// general station info (1st line)
|
||||||
addStationMarker(stationID, Number(lat), Number(lng));
|
var row = sprintf('<tr><td><a href="#" class="toggle">%s</a></td><td><a href="#" class="toggle">%s</a></td><td class="ar">%7.4f</td><td class="ar">%7.4f</td></tr>' , network, station, Number(lat), Number(lng));
|
||||||
};
|
// setting up network details (2nd line)
|
||||||
});
|
row += sprintf('<tr class="tablesorter-childRow station-details"><td colspan="4">%s', networkText[network] || '');
|
||||||
|
row += ( $.inArray(station, bochumStation)+1 ) ? '<br /><em>Betreiber:</em> Ruhr-Universität Bochum</td></tr>' : '</td></tr>' ;
|
||||||
|
if ( network == 'RN' || network == 'Z3' || network == '1A' || network == 'YD' || $.inArray(station, bochumStation)+1 ) {
|
||||||
|
// setting up station details (3rd line)
|
||||||
|
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">';
|
||||||
|
row += stationDetails(station, network, lat, lng, stationID, stationText, $(this));
|
||||||
|
row += '</td></tr>';
|
||||||
|
// setting up download links (4th line)
|
||||||
|
var URL, fdsnxmlURL, fdsnxmlRespURL, sc3mlURL, sc3mlRespURL, dlsvURL;
|
||||||
|
URL = sprintf('%s?network=%s&station=%s', config['ajax']['stationURL'], network, station);
|
||||||
|
fdsnxmlURL = URL + '&level=station&format=xml';
|
||||||
|
fdsnxmlRespURL = URL + '&level=response&format=xml';
|
||||||
|
sc3mlURL = URL + '&level=station&format=sc3ml';
|
||||||
|
sc3mlRespURL = URL + '&level=response&format=sc3ml';
|
||||||
|
dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase());
|
||||||
|
row += '<tr class="tablesorter-childRow station-download"><td colspan="4">'
|
||||||
|
+ sprintf('Download details: <a download="%s.xml" href="%s" target="_blank">FDSNxml</a> or <a download="%s.sc3" href="%s" target="_blank">SC3ml</a><br /> ', stationID, fdsnxmlURL, stationID, sc3mlURL)
|
||||||
|
+ sprintf('Response files: <a download="%s_response.xml" href="%s" target="_blank">FDSNxml</a>, <a download="%s_response.sc3" href="%s" target="_blank">SC3ml</a> ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL)
|
||||||
|
+ sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase())
|
||||||
|
+ '</td></tr>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">Kontaktieren Sie den ';
|
||||||
|
row += ( networkURL[network.toUpperCase()] ) ? '<a href="'+networkURL[network.toUpperCase()]+'" target="_blank">Netzwerkkoordinator</a>' : 'Netzwerkkoordinator';
|
||||||
|
row += ' für weitere Details.</td></tr>';
|
||||||
|
};
|
||||||
|
$('#stationstable tbody').append(row);
|
||||||
|
addStationMarker(stationID, Number(lat), Number(lng), stationText.toUpperCase());
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
@@ -53,10 +115,46 @@ function loadStations(stime, etime) {
|
|||||||
$("#stationstable").trigger("sorton", [sort]);
|
$("#stationstable").trigger("sorton", [sort]);
|
||||||
$("#stationstable > tbody > tr:even").addClass("odd");
|
$("#stationstable > tbody > tr:even").addClass("odd");
|
||||||
$("#stationstable > tbody > tr:odd").addClass("even");
|
$("#stationstable > tbody > tr:odd").addClass("even");
|
||||||
|
stationLayer.bringToFront();
|
||||||
|
},
|
||||||
|
error: function( jqxhr, textStatus, error ) {
|
||||||
|
var err = textStatus + ", " + error;
|
||||||
|
console.log( "Request Failed: " + err );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// create stations csv download link
|
||||||
|
var request_data = {
|
||||||
|
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
||||||
|
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
||||||
|
level: 'station',
|
||||||
|
minlat: S-config['map']['latlngDelta'],
|
||||||
|
maxlat: N+config['map']['latlngDelta'],
|
||||||
|
minlon: W-config['map']['latlngDelta'],
|
||||||
|
maxlon: E+config['map']['latlngDelta'],
|
||||||
|
format: 'text',
|
||||||
|
};
|
||||||
|
$('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* format station Details */
|
||||||
|
function stationDetails(station, network, lat, lng, stationId, stationText, stationObject) {
|
||||||
|
var output;
|
||||||
|
var elevation = stationObject.find('Elevation:first').text();
|
||||||
|
var name = stationObject.find('Site > Name').text();
|
||||||
|
output = '<pre>'
|
||||||
|
+ name + '<br />'
|
||||||
|
+ 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN<br />';
|
||||||
|
stationObject.find('Channel').each(function() {
|
||||||
|
var code = $(this).attr('code');
|
||||||
|
var sensor = $(this).find('Sensor > Type').text().split(',')[0];
|
||||||
|
var sampleRate = $(this).find('SampleRate').text();
|
||||||
|
output += '<br />Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor;
|
||||||
|
});
|
||||||
|
output += '</pre>';
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* initStationTable */
|
||||||
function initStationTable() {
|
function initStationTable() {
|
||||||
// tablesorter for station list
|
// tablesorter for station list
|
||||||
$("#stationstable").tablesorter(
|
$("#stationstable").tablesorter(
|
||||||
@@ -85,7 +183,7 @@ function initStationTable() {
|
|||||||
// css class names of pager arrows
|
// css class names of pager arrows
|
||||||
pager_css: {
|
pager_css: {
|
||||||
container : 'stations-tablesorter-pager',
|
container : 'stations-tablesorter-pager',
|
||||||
errorRow : 'tablesorter-errorRow', // error information row (don't include period at beginning)
|
errorRow : 'stations-tablesorter-errorRow', // error information row (don't include period at beginning)
|
||||||
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
|
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
|
||||||
},
|
},
|
||||||
// jQuery pager selectors
|
// jQuery pager selectors
|
||||||
@@ -101,7 +199,7 @@ function initStationTable() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
filter_childRows : true,
|
filter_childRows : true,
|
||||||
filter_cssFilter : 'tablesorter-filter',
|
filter_cssFilter : 'stations-tablesorter-filter',
|
||||||
filter_startsWith : false,
|
filter_startsWith : false,
|
||||||
filter_ignoreCase : true,
|
filter_ignoreCase : true,
|
||||||
scroller_height: $('div.map').height() - 250,
|
scroller_height: $('div.map').height() - 250,
|
||||||
@@ -112,7 +210,57 @@ function initStationTable() {
|
|||||||
showProcessing: true,
|
showProcessing: true,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// hide child rows
|
||||||
|
$('#stationstable > tbody > tr.tablesorter-childRow > td').hide();
|
||||||
|
// update map after filtering
|
||||||
|
// $('#stationsstable').bind('filterEnd', function(){
|
||||||
|
// toggleFilteredMarkers();
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* document ready *
|
||||||
|
**********************************************************************/
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
loadStations();
|
loadStations();
|
||||||
|
loadStations('A100A');
|
||||||
|
loadStations('A101B');
|
||||||
|
loadStations('A102A');
|
||||||
|
loadStations('A103A');
|
||||||
|
loadStations('A103B');
|
||||||
|
loadStations('A104A');
|
||||||
|
loadStations('A104B');
|
||||||
|
loadStations('A105A');
|
||||||
|
loadStations('A106B');
|
||||||
|
loadStations('A107C');
|
||||||
|
loadStations('A108A');
|
||||||
|
loadStations('A109A');
|
||||||
|
// loadStations('KERA');
|
||||||
|
// loadStations('KARP');
|
||||||
|
// show / hide station info
|
||||||
|
$('#stationstable').delegate('.toggle', 'click' , function(){
|
||||||
|
// toggle visibility of selected row
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
|
||||||
|
// mark currently selected row and remove class selected from all other rows
|
||||||
|
// hide other rows
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
|
||||||
|
$(this).closest('tbody').find('td.selected').each(function(){
|
||||||
|
if ( ! $(this).hasClass('selected-now') ) {
|
||||||
|
$(this).hide();
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').each(function(){
|
||||||
|
$(this).removeClass('selected-now');
|
||||||
|
var selected = $(this).hasClass('selected');
|
||||||
|
if ( selected ) {
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
//highlightFirstEvent();
|
||||||
|
} else {
|
||||||
|
$(this).addClass('selected');
|
||||||
|
//toggleHighlightStation($(this).attr('stationid'));
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,266 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
* stations.js *
|
||||||
|
* script for station specific functions and setup *
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
/* License
|
||||||
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Load the stations using ajax */
|
||||||
|
function loadStations(station, stime, etime) {
|
||||||
|
var mapBounds = map.getBounds();
|
||||||
|
var N = mapBounds.getNorth();
|
||||||
|
var E = mapBounds.getEast();
|
||||||
|
var S = mapBounds.getSouth();
|
||||||
|
var W = mapBounds.getWest();
|
||||||
|
if ( !stime ) {
|
||||||
|
var stime = new Date();
|
||||||
|
stime.setDate(stime.getDate()-config['map']['timespan']);
|
||||||
|
};
|
||||||
|
if ( !etime ) {
|
||||||
|
var etime = new Date();
|
||||||
|
etime.setDate(etime.getDate()+1);
|
||||||
|
};
|
||||||
|
if ( !station ) {
|
||||||
|
var request_data = {
|
||||||
|
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
||||||
|
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
||||||
|
level: 'station',
|
||||||
|
minlat: S-config['map']['latlngDelta'],
|
||||||
|
maxlat: N+config['map']['latlngDelta'],
|
||||||
|
minlon: W-config['map']['latlngDelta'],
|
||||||
|
maxlon: E+config['map']['latlngDelta'],
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
var request_data = {
|
||||||
|
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
||||||
|
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
||||||
|
level: 'channel',
|
||||||
|
station: station,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: config['ajax']['stationURL'],
|
||||||
|
dataType: "xml",
|
||||||
|
data: request_data,
|
||||||
|
success: function (xml) {
|
||||||
|
$(xml).find('Network').each(function () {
|
||||||
|
var network = $(this).attr('code');
|
||||||
|
if ( $.inArray(network, config['station']['networkBlacklist'])<0 ) {
|
||||||
|
$(this).find('Station').each(function () {
|
||||||
|
var station = $(this).attr('code'),
|
||||||
|
lat = $(this).find('Latitude:first').text(),
|
||||||
|
lng = $(this).find('Longitude:first').text(),
|
||||||
|
stationID = network+'_'+station,
|
||||||
|
stationText = network+'.'+station;
|
||||||
|
if ( !stationTable[stationID] && $.inArray(stationID, config['station']['stationBlacklist']) <0 ) {
|
||||||
|
// general station info (1st line)
|
||||||
|
var row = sprintf('<tr><td><a href="#" class="toggle">%s</a></td><td><a href="#" class="toggle">%s</a></td><td class="ar">%7.4f</td><td class="ar">%7.4f</td></tr>' , network, station, Number(lat), Number(lng));
|
||||||
|
// setting up network details (2nd line)
|
||||||
|
row += sprintf('<tr class="tablesorter-childRow station-details"><td colspan="4">%s', networkText[network] || '');
|
||||||
|
row += ( $.inArray(station, bochumStation)+1 ) ? '<br /><em>Operator:</em> Ruhr-University Bochum, Germany</td></tr>' : '</td></tr>' ;
|
||||||
|
if ( network == 'RN' || network == 'Z3' || network == '1A' || network == 'YD' || $.inArray(station, bochumStation)+1 ) {
|
||||||
|
// setting up station details (3rd line)
|
||||||
|
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">';
|
||||||
|
row += stationDetails(station, network, lat, lng, stationID, stationText, $(this));
|
||||||
|
row += '</td></tr>';
|
||||||
|
// setting up download links (4th line)
|
||||||
|
var URL, fdsnxmlURL, fdsnxmlRespURL, sc3mlURL, sc3mlRespURL, dlsvURL;
|
||||||
|
URL = sprintf('%s?network=%s&station=%s', config['ajax']['stationURL'], network, station);
|
||||||
|
fdsnxmlURL = URL + '&level=station&format=xml';
|
||||||
|
fdsnxmlRespURL = URL + '&level=response&format=xml';
|
||||||
|
sc3mlURL = URL + '&level=station&format=sc3ml';
|
||||||
|
sc3mlRespURL = URL + '&level=response&format=sc3ml';
|
||||||
|
dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase());
|
||||||
|
row += '<tr class="tablesorter-childRow station-download"><td colspan="4">'
|
||||||
|
+ sprintf('Download details: <a download="%s.xml" href="%s" target="_blank">FDSNxml</a> or <a download="%s.sc3" href="%s" target="_blank">SC3ml</a><br /> ', stationID, fdsnxmlURL, stationID, sc3mlURL)
|
||||||
|
+ sprintf('Response files: <a download="%s_response.xml" href="%s" target="_blank">FDSNxml</a>, <a download="%s_response.sc3" href="%s" target="_blank">SC3ml</a> ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL)
|
||||||
|
+ sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase())
|
||||||
|
+ '</td></tr>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">Kontaktieren Sie den ';
|
||||||
|
row += ( networkURL[network.toUpperCase()] ) ? '<a href="'+networkURL[network.toUpperCase()]+'" target="_blank">Netzwerkkoordinator</a>' : 'Netzwerkkoordinator';
|
||||||
|
row += ' für weitere Details.</td></tr>';
|
||||||
|
};
|
||||||
|
$('#stationstable tbody').append(row);
|
||||||
|
addStationMarker(stationID, Number(lat), Number(lng), stationText.toUpperCase());
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
initStationTable();
|
||||||
|
var sort = [[0,0],[1,0]];
|
||||||
|
$("#stationstable").trigger("update", [true]);
|
||||||
|
$("#stationstable").trigger("updateCache");
|
||||||
|
$("#stationstable").trigger("sorton", [sort]);
|
||||||
|
$("#stationstable > tbody > tr:even").addClass("odd");
|
||||||
|
$("#stationstable > tbody > tr:odd").addClass("even");
|
||||||
|
stationLayer.bringToFront();
|
||||||
|
},
|
||||||
|
error: function( jqxhr, textStatus, error ) {
|
||||||
|
var err = textStatus + ", " + error;
|
||||||
|
console.log( "Request Failed: " + err );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// create stations csv download link
|
||||||
|
var request_data = {
|
||||||
|
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
|
||||||
|
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
|
||||||
|
level: 'station',
|
||||||
|
minlat: S-config['map']['latlngDelta'],
|
||||||
|
maxlat: N+config['map']['latlngDelta'],
|
||||||
|
minlon: W-config['map']['latlngDelta'],
|
||||||
|
maxlon: E+config['map']['latlngDelta'],
|
||||||
|
format: 'text',
|
||||||
|
};
|
||||||
|
$('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data));
|
||||||
|
};
|
||||||
|
|
||||||
|
/* format station Details */
|
||||||
|
function stationDetails(station, network, lat, lng, stationId, stationText, stationObject) {
|
||||||
|
var output;
|
||||||
|
var elevation = stationObject.find('Elevation:first').text();
|
||||||
|
var name = stationObject.find('Site > Name').text();
|
||||||
|
output = '<pre>'
|
||||||
|
+ name + '<br />'
|
||||||
|
+ 'Position: ' + lat + '°N ' + lng + '°E, height: ' + elevation + ' m a.s.l.<br />';
|
||||||
|
stationObject.find('Channel').each(function() {
|
||||||
|
var code = $(this).attr('code');
|
||||||
|
var sensor = $(this).find('Sensor > Type').text().split(',')[0];
|
||||||
|
var sampleRate = $(this).find('SampleRate').text();
|
||||||
|
output += '<br />Channel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor;
|
||||||
|
});
|
||||||
|
output += '</pre>';
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* initStationTable */
|
||||||
|
function initStationTable() {
|
||||||
|
// tablesorter for station list
|
||||||
|
$("#stationstable").tablesorter(
|
||||||
|
{
|
||||||
|
theme : 'blue',
|
||||||
|
cssChildRow: "tablesorter-childRow", // this is the default setting
|
||||||
|
widgets: ["uitheme", "zebra", "filter", "pager"], // initialize zebra and filter widgets, "scroller"
|
||||||
|
widgetOptions: {
|
||||||
|
// output default: '{page}/{totalPages}'
|
||||||
|
// possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
|
||||||
|
pager_output: '# {startRow} - {endRow} ({totalRows}) | page {page} ({totalPages})',
|
||||||
|
// apply disabled classname to the pager arrows when the rows at either extreme is visible
|
||||||
|
pager_updateArrows: true,
|
||||||
|
// starting page of the pager (zero based index)
|
||||||
|
pager_startPage: 0,
|
||||||
|
// Number of visible rows
|
||||||
|
pager_size: 35,
|
||||||
|
// Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js)
|
||||||
|
pager_savePages: true,
|
||||||
|
// if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
|
||||||
|
// table row set to a height to compensate; default is false
|
||||||
|
pager_fixedHeight: false,
|
||||||
|
// remove rows from the table to speed up the sort of large tables.
|
||||||
|
// setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
|
||||||
|
pager_removeRows: false,
|
||||||
|
// css class names of pager arrows
|
||||||
|
pager_css: {
|
||||||
|
container : 'stations-tablesorter-pager',
|
||||||
|
errorRow : 'stations-tablesorter-errorRow', // error information row (don't include period at beginning)
|
||||||
|
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
|
||||||
|
},
|
||||||
|
// jQuery pager selectors
|
||||||
|
pager_selectors: {
|
||||||
|
container : '.stationspager', // target the pager markup (wrapper)
|
||||||
|
first : '.stationsfirst', // go to first page arrow
|
||||||
|
prev : '.stationsprev', // previous page arrow
|
||||||
|
next : '.stationsnext', // next page arrow
|
||||||
|
last : '.stationslast', // go to last page arrow
|
||||||
|
goto : '.stationsgotoPage', // go to page selector - select dropdown that sets the current page
|
||||||
|
pageDisplay : '.stationspagedisplay', // location of where the "output" is displayed
|
||||||
|
pageSize : '.stationspagesize' // page size selector - select dropdown that sets the "size" option
|
||||||
|
},
|
||||||
|
|
||||||
|
filter_childRows : true,
|
||||||
|
filter_cssFilter : 'stations-tablesorter-filter',
|
||||||
|
filter_startsWith : false,
|
||||||
|
filter_ignoreCase : true,
|
||||||
|
scroller_height: $('div.map').height() - 250,
|
||||||
|
scroller_barWidth: 10,
|
||||||
|
scroller_jumpToHeader: false,
|
||||||
|
sortList: "[[0,0], [1,0]]",
|
||||||
|
resort: true,
|
||||||
|
showProcessing: true,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// hide child rows
|
||||||
|
$('#stationstable > tbody > tr.tablesorter-childRow > td').hide();
|
||||||
|
// update map after filtering
|
||||||
|
// $('#stationsstable').bind('filterEnd', function(){
|
||||||
|
// toggleFilteredMarkers();
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* document ready *
|
||||||
|
**********************************************************************/
|
||||||
|
$(document).ready(function() {
|
||||||
|
loadStations();
|
||||||
|
loadStations('A100A');
|
||||||
|
loadStations('A101B');
|
||||||
|
loadStations('A102A');
|
||||||
|
loadStations('A103A');
|
||||||
|
loadStations('A103B');
|
||||||
|
loadStations('A104A');
|
||||||
|
loadStations('A104B');
|
||||||
|
loadStations('A105A');
|
||||||
|
loadStations('A106B');
|
||||||
|
loadStations('A107C');
|
||||||
|
loadStations('A108A');
|
||||||
|
loadStations('A109A');
|
||||||
|
// loadStations('KERA');
|
||||||
|
// loadStations('KARP');
|
||||||
|
// show / hide station info
|
||||||
|
$('#stationstable').delegate('.toggle', 'click' , function(){
|
||||||
|
// toggle visibility of selected row
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
|
||||||
|
// mark currently selected row and remove class selected from all other rows
|
||||||
|
// hide other rows
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
|
||||||
|
$(this).closest('tbody').find('td.selected').each(function(){
|
||||||
|
if ( ! $(this).hasClass('selected-now') ) {
|
||||||
|
$(this).hide();
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').each(function(){
|
||||||
|
$(this).removeClass('selected-now');
|
||||||
|
var selected = $(this).hasClass('selected');
|
||||||
|
if ( selected ) {
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
//highlightFirstEvent();
|
||||||
|
} else {
|
||||||
|
$(this).addClass('selected');
|
||||||
|
//toggleHighlightStation($(this).attr('stationid'));
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||