From 6bf2f2b54b3b71d1a7cf3592342f866f525b2a7d Mon Sep 17 00:00:00 2001 From: terribl Date: Thu, 23 May 2013 10:36:04 +0300 Subject: [PATCH] Added global settings and untrackedDeveloperSettings.js-file. untrackedDeveloperSettings.js Create file and add line `var developerSettings = true;` on top of it. After that some settings can be overwritten with deleloper's flavour. -- Example File w/o line numbers -- var developerSettings = true; var CONST_CENTERLAT = 60.0; // 45.0 var CONST_CENTERLON = 20.0; // 9.0 var CONST_ZOOMLVL = 6; //5 -- End of Example File -- modified: .gitignore modified: public_html/gmap.html modified: public_html/script.js --- .gitignore | 1 + public_html/script.js | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index bba68c8..fd84bc3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ frames.js *~ *.rej *.orig +public_html/untrackedDeveloperSettings.js diff --git a/public_html/script.js b/public_html/script.js index 0ac1f3f..74a2aca 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -1,7 +1,14 @@ +// "Constant" variables - Since there is no constants in make sure +// not to change these CONST_ variables. +var CONST_CENTERLAT = 45.0; // 45.0 +var CONST_CENTERLON = 9.0; // 9.0 +var CONST_ZOOMLVL = 5; //5 + +// Global variables var Map = null; -var CenterLat = 45.0; -var CenterLon = 9.0; -var ZoomLvl = 5; +var CenterLat = CONST_CENTERLAT; +var CenterLon = CONST_CENTERLON; +var ZoomLvl = CONST_ZOOMLVL; var Planes = {}; var PlanesOnMap = 0; var PlanesOnGrid = 0; @@ -385,12 +392,12 @@ function toggleSettings() { } function resetMap() { - localStorage['CenterLat'] = 45.0; - localStorage['CenterLon'] = 9.0; - localStorage['ZoomLvl'] = 5; - CenterLat = 45.0; - CenterLon = 9.0; - ZoomLvl = 5; + localStorage['CenterLat'] = CONST_CENTERLAT; + localStorage['CenterLon'] = CONST_CENTERLON; + localStorage['ZoomLvl'] = CONST_ZOOMLVL; + CenterLat = CONST_CENTERLAT; + CenterLon = CONST_CENTERLON; + ZoomLvl = CONST_ZOOMLVL; Map.setZoom(parseInt(localStorage['ZoomLvl'])); Map.setCenter(new google.maps.LatLng(parseFloat(localStorage['CenterLat']), parseFloat(localStorage['CenterLon'])));