diff --git a/www/events.js b/www/events.js index 7a234b2..5725eba 100644 --- a/www/events.js +++ b/www/events.js @@ -109,8 +109,8 @@ function ajaxLoadEvents(stime, etime, id, target) { var location // get location, try this in order: // regional map name, given value, cached value, or nominatim lookup - location = ( getLocation(lat, lng)[0] || $(this).find('description > text').text() ); - location = ( geolocationTable[id] || getGeolocation(id, lat, lng) ); + 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() ); // create table row: Date, Time, Mag, Location if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) { // general event info (1st line) diff --git a/www/stations.js b/www/stations.js index e6295b2..561c694 100644 --- a/www/stations.js +++ b/www/stations.js @@ -40,7 +40,7 @@ function loadStations(stime, etime) { 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', + level: 'channel', minlat: S-config['map']['latlngDelta'], maxlat: N+config['map']['latlngDelta'], minlon: W-config['map']['latlngDelta'], @@ -57,8 +57,8 @@ function loadStations(stime, etime) { if ( $.inArray(network, config['station']['networkBlacklist'])<0 ) { $(this).find('Station').each(function () { var station = $(this).attr('code'), - lat = $(this).find('Latitude').text(), - lng = $(this).find('Longitude').text(), + lat = $(this).find('Latitude:first').text(), + lng = $(this).find('Longitude:first').text(), stationID = network+'_'+station, stationText = network+'.'+station; if ( !stationTable[stationID] ) { @@ -69,7 +69,9 @@ function loadStations(stime, etime) { row += ( $.inArray(station, bochumStation)+1 ) ? '
Betreiber: Ruhr-Universität Bochum' : '' ; if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) { // setting up station details (3rd line) - row += 'not implemented'; + row += ''; + row += stationDetails(station, network, lat, lng, stationID, stationText, $(this)); + row += ''; // 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); @@ -116,6 +118,24 @@ function loadStations(stime, etime) { $('#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 = '
'
+		+ name + '
' + + 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN
'; + 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 += '
Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor; + }); + output += '
'; + return output; +}; + /* initStationTable */ function initStationTable() { // tablesorter for station list