diff --git a/.gitignore b/.gitignore index 4d34de5..b45e439 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,44 @@ -scripts/events.xml -scripts/geolocation.js +## Visual Studio Code +# Visual Studio Code files +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +## MacOS / OSX +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +## Project Files wsgi/.idea www/dlsv www/event.xml @@ -7,9 +46,7 @@ www/events.xml www/geolocation.js www/geolocationTable.js www/stations.xml - -.vscode/settings.json - www/index.html - www/favicon.ico +scripts/*.json +scripts/*.xml diff --git a/scripts/fetchEvents.sh b/scripts/fetchEvents.sh new file mode 100755 index 0000000..0848b87 --- /dev/null +++ b/scripts/fetchEvents.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# get starting date +# find gdate or date command ( OSX: brew install coreutils) +# the date command on OSX is not compatible to the linux date command +datecmd=$((which gdate || which date )| grep bin) +STIME="${1:-$(${datecmd} -d 6-month-ago +%Y-%m-%d)}" +STIME="${STIME:-$(date +%Y-%m-%d)}" + +# get output filename +OUTPUT="${2:--}" + +# fetch events +curl -s -o ${OUTPUT} "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=${STIME}&minlat=50.0&maxlat=53.0&minlon=4.0&maxlon=10.0&minmag=0.7" diff --git a/scripts/mkEvents.csh b/scripts/mkEvents.csh deleted file mode 100755 index 46f6cd4..0000000 --- a/scripts/mkEvents.csh +++ /dev/null @@ -1,4 +0,0 @@ -#!/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" diff --git a/scripts/mkGeolocationTable.py b/scripts/mkGeolocationTable.py index c8ec850..a0a1d3f 100755 --- a/scripts/mkGeolocationTable.py +++ b/scripts/mkGeolocationTable.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # -*- coding: utf-8 -*- ''' @@ -8,12 +8,12 @@ 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 + The script should be updated regularly 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 + curl -s "https://fdsnws.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 + Copyright 2020-2021 Kasper D. Fischer 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 @@ -27,30 +27,32 @@ 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 + ## imports + + # XML ElementTree 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 + + # json 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'} + # sys stdin + from sys import stdin - def simple_warning(message, category, filename, lineno, file=None, line=None): - return 'Warning: %s\n' % (message) - warnings.formatwarning = simple_warning + # geopy + from geopy.geocoders import Photon + from geopy.extra.rate_limiter import RateLimiter + from geopy.exc import GeocoderServiceError + + ## constants + URL = 'https://photon.komoot.io/reverse?lon={lng:.3f}&lat={lat:.3f}&limit=5' + NAMESPACES = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7', + 'qml': 'http://quakeml.org/xmlns/bed/1.2'} # try loading the file geolocationTable = {} @@ -61,67 +63,93 @@ def mkGeolocationTable(file=''): geolocationTable = JSON.loads(jsonfileContent) except: geolocationTable = {} - warnings.warn('Could not parse file %s' %file) + logging.warning('Could not parse file %s' %file) # parse event.xml DOM = ET.parse(stdin).getroot() geolocator = Photon() + reverse_geolocate = RateLimiter(geolocator.reverse, min_delay_seconds=1) # iterate over all events - for event in DOM.iterfind('qml:eventParameters/qml:event', namespaces): + count = 0 + for event in DOM.iterfind('qml:eventParameters/qml:event', NAMESPACES): + count += 1 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 + lat = float(event.find('./qml:origin/qml:latitude/qml:value', NAMESPACES).text) + lng = float(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)) + logging.warning('Skipping cached event {id}'.format(id=publicID)) elif evaluationMode == 'automatic': - warnings.warn('Skipping automatic event %s' %(publicID)) + logging.warning('Skipping automatic event {id}'.format(id=publicID)) else: + logging.info('Processing event {id}'.format(id=publicID)) try: - location = geolocator.reverse("{lat}, {lng}".format(lat=lat, lng=lng)) - except: - warnings.warn('Reverse Geolocation failed. Skipping event.') - sleep(1.1) + locations = reverse_geolocate("{lat:.3f}, {lng:.3f}".format(lat=lat, lng=lng),exactly_one=False,limit=5) + except GeocoderServiceError: + logging.warning('Reverse Geolocation failed. Skipping event.') continue place = [] - try: - place = location.raw['properties']['city'] - except KeyError: + for location in locations: try: - place = location.raw['properties']['town'] + place = location.raw['properties']['city'] except KeyError: try: - place = location.raw['properties']['village'] + place = location.raw['properties']['town'] except KeyError: try: - place = location.raw['properties']['county'] + place = location.raw['properties']['village'] 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)) + try: + place = location.raw['properties']['county'] + except KeyError: + logging.debug('Could not extract city for event {id} at {lat:.3f} N / {lng:.3f} E (Service: {url}), trying next returned result' + .format(id=publicID, lat=lat, lng=lng, url=URL.format(lat=lat,lng=lng))) + logging.debug(location.raw) + if not place: + logging.critical('Could not extract city for event {id} at {lat:.3f} N / {lng:.3f} E (Service: {url})' + .format(id=publicID, lat=lat, lng=lng, url=URL.format(lat=lat,lng=lng))) geolocationTable[publicID] = place - sleep(1.1) # dump json - print 'var geolocationTable = '+JSON.dumps(geolocationTable, sort_keys=True)+';' + print('var geolocationTable = {0};'.format(JSON.dumps(geolocationTable, sort_keys=True))) + logging.info("processed %d events", count) # __main__ if __name__ == "__main__": - def printline(line): - print line + # use module logging + import logging # parse arguments import argparse - versionText = '$Revision$ ($Date$, $Author$)'.replace('$', '').replace(':','') + versionText = 'r20211017 (2021-10-17)' parser = argparse.ArgumentParser( - description='Reverese geocoding lookup of events in xml format (stdin).', + description='Reverse geocoding lookup of events in xml format (stdin).', epilog=versionText) - parser.add_argument('-v', '-V', '--version', action='version', - version=versionText) + parser.add_argument('-V', '--version', action='version', version=versionText, + help="show version") parser.add_argument('-f', '--file', action='store', dest='file', help='read in JSON file containing old output.') + group = parser.add_mutually_exclusive_group() + group.add_argument("-v", "--verbose", action="store_true", + help="increase output verbosity") + group.add_argument("-q", "--quiet", action="store_true", + help="disable output") + group.add_argument("-d", "--debug", action="store_true", + help="show debugging output", + ) cla = parser.parse_args() + # set logging level + if cla.quiet: + logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.ERROR) + elif cla.verbose: + logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) + elif cla.debug: + logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG) + else: + logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.WARN) + # call mkGeolocationTable(...) mkGeolocationTable(file=cla.file) diff --git a/www/events.js b/www/events.js index a830721..6645b6a 100644 --- a/www/events.js +++ b/www/events.js @@ -4,7 +4,7 @@ **********************************************************************/ /* License - Copyright 2020 Kasper D. Fischer + Copyright 2020-2021 Kasper D. Fischer 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 @@ -19,7 +19,7 @@ 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$ + Version r20211017 (2021-10-17) */ /* adding row(s) to a table and format date strings afterwards */ diff --git a/www/events.js.en b/www/events.js.en index 4793bb6..e05c575 100644 --- a/www/events.js.en +++ b/www/events.js.en @@ -4,7 +4,7 @@ **********************************************************************/ /* License - Copyright 2020 Kasper D. Fischer + Copyright 2020-2021 Kasper D. Fischer 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 @@ -19,7 +19,7 @@ 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$ + Version r20211017 (2021-10-17) */ /* adding row(s) to a table and format date strings afterwards */ diff --git a/www/external/TileLayer.Grayscale.js b/www/external/TileLayer.Grayscale.js deleted file mode 100644 index 1dae67c..0000000 --- a/www/external/TileLayer.Grayscale.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover. - */ - -L.TileLayer.Grayscale = L.TileLayer.extend({ - options: { - quotaRed: 21, - quotaGreen: 71, - quotaBlue: 8, - quotaDividerTune: 0, - quotaDivider: function() { - return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune; - } - }, - - initialize: function (url, options) { - options = options || {} - options.crossOrigin = true; - L.TileLayer.prototype.initialize.call(this, url, options); - - this.on('tileload', function(e) { - this._makeGrayscale(e.tile); - }); - }, - - _createTile: function () { - var tile = L.TileLayer.prototype._createTile.call(this); - tile.crossOrigin = "Anonymous"; - return tile; - }, - - _makeGrayscale: function (img) { - if (img.getAttribute('data-grayscaled')) - return; - - img.crossOrigin = ''; - var canvas = document.createElement("canvas"); - canvas.width = img.width; - canvas.height = img.height; - var ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0); - - var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height); - var pix = imgd.data; - for (var i = 0, n = pix.length; i < n; i += 4) { - pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider(); - } - ctx.putImageData(imgd, 0, 0); - img.setAttribute('data-grayscaled', true); - img.src = canvas.toDataURL(); - } -}); - -L.tileLayer.grayscale = function (url, options) { - return new L.TileLayer.Grayscale(url, options); -}; diff --git a/www/external/easyPrint/easyPrint.css b/www/external/easyPrint/easyPrint.css index 177e148..65523ea 100644 --- a/www/external/easyPrint/easyPrint.css +++ b/www/external/easyPrint/easyPrint.css @@ -1,20 +1,16 @@ -.leaflet-control-easyPrint a { - background:#fff url(print.png) no-repeat 5px; +.leaflet-control-easyPrint-button a { + background:#fff url(external/easyPrint/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 { +//@media print { + html {padding: 0px!important;} + .leaflet-control-easyPrint-button{display: none!important;} +} + +//#map { width: 1200; height: 800; } diff --git a/www/external/sprintf.min.js b/www/external/sprintf.min.js deleted file mode 100644 index a3196b8..0000000 --- a/www/external/sprintf.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! sprintf-js v1.1.2 | Copyright (c) 2007-present, Alexandru Mărășteanu | BSD-3-Clause */ -!function(){"use strict";var g={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function y(e){return function(e,t){var r,n,i,s,a,o,p,c,l,u=1,f=e.length,d="";for(n=0;n>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}g.json.test(s.type)?d+=r:(!g.number.test(s.type)||c&&!s.sign?l="":(l=c?"+":"-",r=r.toString().replace(g.sign,"")),o=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",p=s.width-(l+r).length,a=s.width&&0= 0\n }\n\n switch (ph.type) {\n case 'b':\n arg = parseInt(arg, 10).toString(2)\n break\n case 'c':\n arg = String.fromCharCode(parseInt(arg, 10))\n break\n case 'd':\n case 'i':\n arg = parseInt(arg, 10)\n break\n case 'j':\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\n break\n case 'e':\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\n break\n case 'f':\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\n break\n case 'g':\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\n break\n case 'o':\n arg = (parseInt(arg, 10) >>> 0).toString(8)\n break\n case 's':\n arg = String(arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 't':\n arg = String(!!arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'T':\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'u':\n arg = parseInt(arg, 10) >>> 0\n break\n case 'v':\n arg = arg.valueOf()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'x':\n arg = (parseInt(arg, 10) >>> 0).toString(16)\n break\n case 'X':\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\n break\n }\n if (re.json.test(ph.type)) {\n output += arg\n }\n else {\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\n sign = is_positive ? '+' : '-'\n arg = arg.toString().replace(re.sign, '')\n }\n else {\n sign = ''\n }\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\n pad_length = ph.width - (sign + arg).length\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n }\n }\n }\n return output\n }\n\n var sprintf_cache = Object.create(null)\n\n function sprintf_parse(fmt) {\n if (sprintf_cache[fmt]) {\n return sprintf_cache[fmt]\n }\n\n var _fmt = fmt, match, parse_tree = [], arg_names = 0\n while (_fmt) {\n if ((match = re.text.exec(_fmt)) !== null) {\n parse_tree.push(match[0])\n }\n else if ((match = re.modulo.exec(_fmt)) !== null) {\n parse_tree.push('%')\n }\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1\n var field_list = [], replacement_field = match[2], field_match = []\n if ((field_match = re.key.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n }\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n match[2] = field_list\n }\n else {\n arg_names |= 2\n }\n if (arg_names === 3) {\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\n }\n\n parse_tree.push(\n {\n placeholder: match[0],\n param_no: match[1],\n keys: match[2],\n sign: match[3],\n pad_char: match[4],\n align: match[5],\n width: match[6],\n precision: match[7],\n type: match[8]\n }\n )\n }\n else {\n throw new SyntaxError('[sprintf] unexpected placeholder')\n }\n _fmt = _fmt.substring(match[0].length)\n }\n return sprintf_cache[fmt] = parse_tree\n }\n\n /**\n * export to either browser or node.js\n */\n /* eslint-disable quote-props */\n if (typeof exports !== 'undefined') {\n exports['sprintf'] = sprintf\n exports['vsprintf'] = vsprintf\n }\n if (typeof window !== 'undefined') {\n window['sprintf'] = sprintf\n window['vsprintf'] = vsprintf\n\n if (typeof define === 'function' && define['amd']) {\n define(function() {\n return {\n 'sprintf': sprintf,\n 'vsprintf': vsprintf\n }\n })\n }\n }\n /* eslint-enable quote-props */\n}(); // eslint-disable-line\n"]} \ No newline at end of file diff --git a/www/index.html.de b/www/index.html.de index bf2da40..4cbf734 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -13,16 +13,15 @@ - - - + - + + @@ -33,10 +32,9 @@ - - - + + @@ -156,20 +154,19 @@

Download als CSV-Datei.

-
+
+

Text wird geladen ...

+

Navigation / Links

- +

Text wird geladen ...

Copyright / Lizenz

- +

Impressum

- -
-
-
- +

Text wird geladen ...

+
diff --git a/www/index.html.en b/www/index.html.en index e84bc27..3d0df3c 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -13,16 +13,15 @@ - - - + - + + @@ -33,10 +32,9 @@ - - - + + @@ -156,20 +154,19 @@

Download as CSV file.

-
+
+

Text loading ...

+

Navigation / Links

- -

Copyright / License

- +

Text loading ...

+

Copyright / Lizenz

+

Imprint

- -
-
-
- +

Text loading ...

+
diff --git a/www/info.inc.de b/www/info.inc.de index 2b6c14b..dff3607 100644 --- a/www/info.inc.de +++ b/www/info.inc.de @@ -18,4 +18,5 @@ diff --git a/www/map.js b/www/map.js index 076e8e4..d277ea4 100644 --- a/www/map.js +++ b/www/map.js @@ -4,7 +4,7 @@ **********************************************************************/ /* License - Copyright 2020 Kasper D. Fischer + Copyright 2020-2021 Kasper D. Fischer 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 @@ -19,7 +19,7 @@ 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$ + Version r20211017 (2021-10-17) */ /* add station marker */ @@ -140,39 +140,27 @@ function initMapLink() { $(document).ready(function() { // create a map in the "map" div, set the view to a given place and zoom + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); // create baselayer switch ( config['map']['baselayer'] ) { 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); + L.tileLayer.provider('Esri.WorldGrayCanvas').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); + L.tileLayer.provider('Esri.WorldImagery').addTo(map); + break; + case 'opentopo': // add OpenTopoMap tile layer + L.tileLayer.provider('OpenTopoMap').addTo(map); break; - case 'opentopo': // add OpenTopoMap tile layer https://opentopomap.org/ - map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', - { - attribution: 'Kartendaten: © OpenStreetMap contributors, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA)' - }).addTo(map); - break; case 'osmde': // add OpenStreetMap.DE tile layer, default - null; - default: - 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: '© OpenStreetMap contributors, CC-BY-SA', - }).addTo(map); + L.tileLayer.provider('OpenStreetMap.DE').addTo(map); + break; + case 'mapnik': // add OpenStreetMap.Mapni tile layer + L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); + break; + default: // use OpenStreetMap.DE as default + L.tileLayer.provider(config['map']['baselayer']).addTo(map); }; // add controls @@ -218,5 +206,8 @@ $(document).ready(function() { }); // print icon - L.easyPrint().addTo(map); + L.control.browserPrint({ + title: 'print map', + position: 'topright', + }).addTo(map); }); diff --git a/www/map.js.en b/www/map.js.en index 0b008e2..bd11add 100644 --- a/www/map.js.en +++ b/www/map.js.en @@ -4,7 +4,7 @@ **********************************************************************/ /* License - Copyright 2020 Kasper D. Fischer + Copyright 2020-2021 Kasper D. Fischer 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 @@ -19,7 +19,7 @@ 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$ + Version r20211017 (2021-10-17) */ /* add station marker */ @@ -140,39 +140,27 @@ function initMapLink() { $(document).ready(function() { // create a map in the "map" div, set the view to a given place and zoom + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); // create baselayer switch ( config['map']['baselayer'] ) { 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); + L.tileLayer.provider('Esri.WorldGrayCanvas').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); + L.tileLayer.provider('Esri.WorldImagery').addTo(map); + break; + case 'opentopo': // add OpenTopoMap tile layer + L.tileLayer.provider('OpenTopoMap').addTo(map); break; - case 'opentopo': // add OpenTopoMap tile layer https://opentopomap.org/ - map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', - { - attribution: 'Kartendaten: © OpenStreetMap contributors, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA)' - }).addTo(map); - break; case 'osmde': // add OpenStreetMap.DE tile layer, default - null; - default: - 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: '© OpenStreetMap contributors, CC-BY-SA', - }).addTo(map); + L.tileLayer.provider('OpenStreetMap.DE').addTo(map); + break; + case 'mapnik': // add OpenStreetMap.Mapni tile layer + L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); + break; + default: // use OpenStreetMap.DE as default + L.tileLayer.provider(config['map']['baselayer']).addTo(map); }; // add controls @@ -218,5 +206,8 @@ $(document).ready(function() { }); // print icon - L.easyPrint().addTo(map); + L.control.browserPrint({ + title: 'print map', + position: 'topright', + }).addTo(map); }); diff --git a/www/misc.js b/www/misc.js index 420f1fd..7a0922a 100644 --- a/www/misc.js +++ b/www/misc.js @@ -4,7 +4,7 @@ **********************************************************************/ /* License - Copyright 2020 Kasper D. Fischer + Copyright 2020-2021 Kasper D. Fischer 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 @@ -19,7 +19,7 @@ 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$ + Version r20211017 (2021-10-17) */ /* calculate marker radius from magnitude @@ -113,6 +113,7 @@ var config = { centerDefault: [51.85, 7.0], timespan: 180, latlngDelta: 0.1, + baselayer: 'OpenStreetMap.DE', }, station: { markerColor: 'darkgreen', @@ -136,7 +137,7 @@ var config = { }, tab: { active: 0, - disabled: [2], + // disabled: [2], max: 4, }, }; @@ -222,4 +223,24 @@ $(document).ready(function() { }).on("ajaxStop", function() { $("#spinner").hide(); }); + + // load more tab content + $.get("more_de.md", function( data ) { + var converter = new showdown.Converter(); + $('.more_de').html(converter.makeHtml(data)); + }); + $.get("more_en.md", function( data ) { + var converter = new showdown.Converter(); + $('.more_en').html(converter.makeHtml(data)); + }); + // load info tab content + $.get("info.inc.de", function( data ) { + $('.info_de, .info_en').html(data); + }); + $.get("copyright.inc.de", function( data ) { + $('.copyright_de, .copyright_en').html(data); + }); + $.get("impressum.inc.de", function( data ) { + $('.imprint_de, .imprint_en').html(data); + }); }); diff --git a/www/more.inc.de b/www/more.inc.de deleted file mode 100644 index bb1dfa7..0000000 --- a/www/more.inc.de +++ /dev/null @@ -1 +0,0 @@ -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. \ No newline at end of file diff --git a/www/more_de.md b/www/more_de.md new file mode 100644 index 0000000..2fd0d90 --- /dev/null +++ b/www/more_de.md @@ -0,0 +1,9 @@ +# Seismologisches Observatorium +## Stationsnetz + +Das seismologische Observatorium der Ruhr-Universität Bochum betreibt mehrere seismologische Stationen im Ruhrgebiet, im Raum Ibbenbüren und im Alpenvorland. 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. + +## Seismologische Netzwerke +### RuhrNet (RN) +### FloodRisk (YD) +### AlpArray (Z3) \ No newline at end of file diff --git a/www/more_en.md b/www/more_en.md new file mode 100644 index 0000000..a3d6304 --- /dev/null +++ b/www/more_en.md @@ -0,0 +1,9 @@ +# Seismological Observatory +## Station Network + +The seismological observatory of the Ruhr-University Bochum (Germany) maintains several seismolocical stations in the Ruhr area, around Ibbenbueren and in the foreland of the Alps. Two broadband stations (BUG and IBBN) are also part of the German Regional Seismological Network (GRSN). These are located near the Ruhr-University in an abandoned coal mine and near the city of Ibbenbueren. + +## Seismological Networks +### RuhrNet (RN) +### FloodRisk (YD) +### AlpArray (Z3) \ No newline at end of file diff --git a/www/stations.js b/www/stations.js index 92876bd..65463ca 100644 --- a/www/stations.js +++ b/www/stations.js @@ -4,7 +4,7 @@ **********************************************************************/ /* License - Copyright 2020 Kasper D. Fischer + Copyright 2020-2021 Kasper D. Fischer 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 @@ -19,7 +19,7 @@ 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$ + Version r20211017 (2021-10-17) */ /* Load the stations using ajax */ diff --git a/www/stations.js.en b/www/stations.js.en index f185b3f..413207f 100644 --- a/www/stations.js.en +++ b/www/stations.js.en @@ -4,7 +4,7 @@ **********************************************************************/ /* License - Copyright 2020 Kasper D. Fischer + Copyright 2020-2021 Kasper D. Fischer 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 @@ -19,7 +19,7 @@ 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$ + Version r20211017 (2021-10-17) */ /* Load the stations using ajax */