add tracking
[lantea.git] / js / ui.js
index 74ea52115a812755d228aa88cd1f70a5ca5854ba..0171e274e35508352a68a64d2ab5c9d3bebc52be 100644 (file)
--- a/js/ui.js
+++ b/js/ui.js
  *
  * ***** END LICENSE BLOCK ***** */
 
+window.onload = function() {
+  var mSel = document.getElementById("mapSelector");
+  for (var mapStyle in gMapStyles) {
+    var opt = document.createElement("option");
+    opt.value = mapStyle;
+    opt.text = gMapStyles[mapStyle].name;
+    mSel.add(opt, null);
+  }
 
+  initMap();
+  resizeAndDraw();
+  startTracking();
+}
+
+window.onresize = function() {
+  resizeAndDraw();
+}
+
+function toggleSettings() {
+  var fs = document.getElementById("settings");
+  if (fs.style.display != "block") {
+    fs.style.display = "block";
+  }
+  else {
+    fs.style.display = "none";
+  }
+}