Merge.
This commit is contained in:
parent
43178d916e
commit
14d988b0b4
Notes:
subgit
2018-03-07 17:58:51 +01:00
r633 www/branches/life
@ -87,12 +87,9 @@ function ajaxLoadEvents(stime, etime) {
|
|||||||
var location
|
var location
|
||||||
// try to use location with reverse geolocation lookup (nominatim), check cache first
|
// try to use location with reverse geolocation lookup (nominatim), check cache first
|
||||||
// use getLocation if it fails or description -> text if it also fails
|
// use getLocation if it fails or description -> text if it also fails
|
||||||
if ( geolocationTable[id] ) {
|
( location = geolocationTable[id] ) ? null : location = getGeolocation(id, lat, lng);
|
||||||
location = geolocationTable[id];
|
( location ) ? null : location = getLocation(lat, lng)[0];
|
||||||
} else {
|
( location ) ? null : $(this).find('description > text').text();
|
||||||
location = getGeolocation(id, lat, lng);
|
|
||||||
( 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] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) {
|
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)
|
// general event info (1st line)
|
||||||
|
23
www/map.js
23
www/map.js
@ -106,6 +106,7 @@ $(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, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
|
||||||
new L.Control.Zoom({ position: 'topright' }).addTo(map);
|
new L.Control.Zoom({ position: 'topright' }).addTo(map);
|
||||||
|
new L.control.scale({position: 'bottomright', imperial: false}).addTo(map);
|
||||||
|
|
||||||
// add MapQuestOSM tile layer
|
// add MapQuestOSM tile layer
|
||||||
// L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
// L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
|
||||||
@ -135,12 +136,24 @@ $(document).ready(function() {
|
|||||||
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();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -73,6 +73,7 @@ $( window ).resize(function() {
|
|||||||
|
|
||||||
/* create global vars */
|
/* create global vars */
|
||||||
var map;
|
var map;
|
||||||
|
var openMarkerID;
|
||||||
var eventTable = {};
|
var eventTable = {};
|
||||||
var eventDetails = {};
|
var eventDetails = {};
|
||||||
var stationTable = {};
|
var stationTable = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user