Clean up config.js a bit, support configuring page name and site name.

This commit is contained in:
Oliver Jowett 2015-01-22 14:33:42 +00:00
parent b78b28d95f
commit 6daf116b40
3 changed files with 27 additions and 24 deletions

View file

@ -14,12 +14,20 @@ Metric = false; // true or false
// -- Map settings ---------------------------------------- // -- Map settings ----------------------------------------
// These settings are overridden by any position information // These settings are overridden by any position information
// provided by dump1090 itself // provided by dump1090 itself. All positions are in decimal
// The Latitude and Longitude in decimal format // degrees.
CONST_CENTERLAT = 45.0;
CONST_CENTERLON = 9.0; // Default center of the map.
DefaultCenterLat = 45.0;
DefaultCenterLon = 9.0;
// The google maps zoom level, 0 - 16, lower is further out // The google maps zoom level, 0 - 16, lower is further out
CONST_ZOOMLVL = 7; DefaultZoomLvl = 7;
SiteShow = false; // true to show a center marker
SiteLat = 45.0; // position of the marker
SiteLon = 9.0;
SiteName = "My Radar Site"; // tooltip of the marker
// -- Marker settings ------------------------------------- // -- Marker settings -------------------------------------
// The default marker color // The default marker color
@ -27,18 +35,13 @@ MarkerColor = "rgb(127, 127, 127)";
SelectedColor = "rgb(225, 225, 225)"; SelectedColor = "rgb(225, 225, 225)";
StaleColor = "rgb(190, 190, 190)"; StaleColor = "rgb(190, 190, 190)";
// -- Site Settings ---------------------------------------
// These settings are overridden by any position information
// provided by dump1090 itself
SiteShow = false; // true or false
// The Latitude and Longitude in decimal format
SiteLat = 45.0;
SiteLon = 9.0;
SiteCircles = true; // true or false (Only shown if SiteShow is true) SiteCircles = true; // true to show circles (only shown if the center marker is shown)
// In nautical miles or km (depending settings value 'Metric') // In nautical miles or km (depending settings value 'Metric')
SiteCirclesDistances = new Array(100,150,200); SiteCirclesDistances = new Array(100,150,200);
// Show the clocks at the top of the righthand pane? You can disable the clocks if you want here
// You can disable the clocks if you want here:
ShowClocks = true; ShowClocks = true;
// Controls page title, righthand pane when nothing is selected
PageName = "DUMP1090";

View file

@ -52,16 +52,16 @@
<table width="100%"> <table width="100%">
<tr class="infoblock_heading"> <tr class="infoblock_heading">
<td> <td>
<b>DUMP1090</b> <b id="infoblock_name">DUMP1090</b>
</td> </td>
<td align="right"> <td align="right">
<span id="dump1090_version"></span> <a href="https://github.com/mutability/dump1090" id="dump1090_version" target="_blank"></span>
</td> </td>
</tr> </tr>
<tr class="infoblock_body"> <tr class="infoblock_body">
<td width="55%">&nbsp;</td> <td>&nbsp;</td>
<td width="45%" align="right"><a href="https://github.com/mutability/dump1090" target="_blank">[GitHub]</a></td> <td>&nbsp;</td>
</tr> </tr>
<tr class="infoblock_body dim"> <tr class="infoblock_body dim">

View file

@ -14,10 +14,6 @@ var SpecialSquawks = {
}; };
// Get current map settings // Get current map settings
var DefaultCenterLat = CONST_CENTERLAT;
var DefaultCenterLon = CONST_CENTERLON;
var DefaultZoomLvl = CONST_ZOOMLVL;
var CenterLat, CenterLon, ZoomLvl; var CenterLat, CenterLon, ZoomLvl;
var Dump1090Version = "unknown version"; var Dump1090Version = "unknown version";
@ -142,6 +138,10 @@ function fetchData() {
var PositionHistorySize = 0; var PositionHistorySize = 0;
function initialize() { function initialize() {
// Set page basics
$("head title").text(PageName);
$("#infoblock_name").text(PageName);
PlaneRowTemplate = document.getElementById("plane_row_template"); PlaneRowTemplate = document.getElementById("plane_row_template");
if (!ShowClocks) { if (!ShowClocks) {
@ -440,7 +440,7 @@ function initialize_map() {
position: SitePosition, position: SitePosition,
map: GoogleMap, map: GoogleMap,
icon: markerImage, icon: markerImage,
title: 'My Radar Site', title: SiteName,
zIndex: -99999 zIndex: -99999
}); });