changeset 226:d151536c9d3d gmap2

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 15 Mar 2014 15:13:40 +0200
parents fcb19418d28e
children 7c1cd542b2d2
files markers.js
diffstat 1 files changed, 7 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/markers.js	Sat Mar 15 14:37:45 2014 +0200
+++ b/markers.js	Sat Mar 15 15:13:40 2014 +0200
@@ -239,14 +239,10 @@
   var n = 0;
   for (var i = 0; i < pmapContinents.length; i++)
   {
-    var q = pmapContinents[i];
-    if (q != null)
-    {
-      var c = q[0];
-      str += "<span id=\"sp"+c+"\"><a href=\"javascript:pmapToggleVisContinent('"+c+"')\">"+c+"</a></span>\n";
-      if (n == 2) str += "<br />\n";
-      n++;
-    }
+    var c = pmapContinents[i][0];
+    str += "<span id=\"sp"+c+"\"><a href=\"javascript:pmapToggleVisContinent('"+c+"')\">"+c+"</a></span>\n";
+    if (n == 2) str += "<br />\n";
+    n++;
   }	
 
   str += "<span id=\"spall_c\"><a href=\"javascript:pmapToggleVisContinent('all_c')\">All</a></span>\n";
@@ -323,11 +319,7 @@
   if (c == "all_c")
   {
     for (var i = 0; i < pmapContinents.length; i++)
-    {
-      var q = pmapContinents[i];
-      if (q != null)
-        pmapSetVisState(q[0], show);
-    }
+      pmapSetVisState(pmapContinents[i][0], show);
   }
 }
 
@@ -353,21 +345,8 @@
 
   if (c != "all_c")
   {
-    for (var i = 0; i < pmapContinents.length; i++)
-    {
-      var q = pmapContinents[i];
-      if (q != null)
-      {
-        if (markerVisStates[pmapMarkerInfo[i][0]])
-        first = true;
-      }
-    }
-
-    if (first)
-    {
-      pmapSetVisContinent("all_c", false);
-      pmapSetVisContinent(c, true);
-    }
+    pmapSetVisContinent("all_c", false);
+    pmapSetVisContinent(c, true);
   }
 
   if (!first)