Merge.
This commit is contained in:
commit
11fcdbb305
Notes:
subgit
2018-03-07 17:58:53 +01:00
r643 www/branches/life
@ -69,7 +69,6 @@ function ajaxLoadEvents(stime, etime) {
|
||||
if ( etime ) {
|
||||
request_data['endtime'] = sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate());
|
||||
};
|
||||
console.log(request_data);
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: config['ajax']['eventURL'],
|
||||
|
@ -30,8 +30,8 @@ function addStationMarker(id, lat, lng) {
|
||||
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",
|
||||
color: "#1C771C",
|
||||
fillColor: config['station']['markerColor'],
|
||||
color: config['station']['markerColor'],
|
||||
weight: 1,
|
||||
opacity: 1,
|
||||
fillOpacity: config['station']['markerOpacity'],
|
||||
|
34
www/misc.js
34
www/misc.js
@ -71,6 +71,17 @@ $( window ).resize(function() {
|
||||
setInfoHeight();
|
||||
});
|
||||
|
||||
/* parseQueryString */
|
||||
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;
|
||||
@ -89,8 +100,8 @@ var config = {
|
||||
event: {
|
||||
evaluationBlacklist: ['automatic', 'preliminary', 'rejected'],
|
||||
markerOpacity: 0.3,
|
||||
markerColor: '#FFD500',
|
||||
markerColorH: '#FF0000',
|
||||
markerColor: 'blue',
|
||||
markerColorH: 'red',
|
||||
minMag: 1.2,
|
||||
minMagDelta: 0.1,
|
||||
typeWhitelist: ['earthquake', 'induced or triggered event'],
|
||||
@ -103,6 +114,7 @@ var config = {
|
||||
latlngDelta: 0.1,
|
||||
},
|
||||
station: {
|
||||
markerColor: 'darkgreen',
|
||||
markerOpacity: 0.5,
|
||||
},
|
||||
};
|
||||
@ -111,6 +123,24 @@ var config = {
|
||||
* document ready *
|
||||
**********************************************************************/
|
||||
$(document).ready(function() {
|
||||
// parse query string
|
||||
var parameters = parseQueryString();
|
||||
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']);
|
||||
};
|
||||
|
||||
// AJAX setup
|
||||
$.ajaxSetup({timeout: config['ajax']['timeout']});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user