From 78ea7b0397f8c05eb4ec2caeab841f80b3a72666 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 20 May 2014 12:27:07 +0000 Subject: [PATCH] Added column for type information in eventstable. --- www/events.js | 39 +++++++++++++++++++++++++++++++++++---- www/index.html.de | 6 +++++- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/www/events.js b/www/events.js index a4f3659..e60d8cf 100644 --- a/www/events.js +++ b/www/events.js @@ -106,6 +106,17 @@ function ajaxLoadEvents(stime, etime, id, target) { var evaluationMode = $(this).find('evaluationMode').text(); var evaluationStatus = $(this).find('evaluationStatus').text(); var type = $(this).find('type').last().text(); + var typeId; + switch ( type ) { + case 'earthquake': + typeId = 'EQ'; + break; + case 'quarry blast': + typeId = 'QB'; + break; + default: + typeId = 'IE'; + }; var location // get location, try this in order: // regional map name, given value, cached value, or nominatim lookup @@ -119,10 +130,11 @@ function ajaxLoadEvents(stime, etime, id, target) { + ''+otime.split('.')[0]+'Z' + sprintf('%.1f', Number(mag)) + ''+location+'Karte' + + ''+typeId+'' + ''; // setting up event details (2nd line) row += '' - + 'Daten werden geladen ...'; + + 'Daten werden geladen ...'; // 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); @@ -130,7 +142,7 @@ function ajaxLoadEvents(stime, etime, id, target) { 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 += '' - + '' + + '' + sprintf('Download QuakeML or miniSEED', xmlurl, mseedurl) + ''; // add row to table @@ -248,16 +260,17 @@ function ajaxLoadEventInfo(id) { /* toggles visibility of filtered markers * only events in the event list are shown */ function toggleFilteredMarkers() { + console.log('toggleFilteredMarkers'); // 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: config['event']['markerOpacity']}); + 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") ) { - eventTable[$(this).attr("eventid")].setStyle({opacity: 0, strokeOpacity: 0, fillOpacity: 0}); + map.removeLayer(eventTable[$(this).attr("eventid")]); }; }); highlightFirstEvent(); @@ -394,4 +407,22 @@ $(document).ready(function() { }); 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; + switch ( type ) { + case 'earthquake': + typetext = 'EQ - tektonisches Erdbeben'; + break; + case 'induced or triggered event': + typetext = 'IE - (bergbau-)induziertes Ereignis'; + break; + case 'quarry blast': + typetext = 'QB - Steinbruchsprengung'; + break; + }; + $("#events-type").append(' '+typetext); + }); }); diff --git a/www/index.html.de b/www/index.html.de index 580e3c8..f363da1 100644 --- a/www/index.html.de +++ b/www/index.html.de @@ -56,6 +56,7 @@
+

Ereignisse der letzten 180 Tage ab Magnitude 1.2

First Prev @@ -79,6 +80,7 @@ + @@ -86,12 +88,14 @@ Zeit Mag. Ort + Typ -

Nominatim Search Courtesy of MapQuest Mapquest Logo

+

Typ:
+ Nominatim Search Courtesy of MapQuest Mapquest Logo