hide copyright field as well, but make sure it's shown when we change maps and might...
[lantea.git] / js / map.js
index 48b1128ac66cfee0d651977b763dab9fab98da49..dd3b57379dba2eddae10e8efe3647ecc80ec9138 100644 (file)
--- a/js/map.js
+++ b/js/map.js
@@ -145,6 +145,7 @@ function resizeAndDraw() {
   gCanvas.width = canvasWidth;
   gCanvas.height = canvasHeight;
   drawMap();
   gCanvas.width = canvasWidth;
   gCanvas.height = canvasHeight;
   drawMap();
+  showUI();
 }
 
 function zoomIn() {
 }
 
 function zoomIn() {
@@ -186,6 +187,7 @@ function setMapStyle() {
     gTiles = {};
     document.getElementById("copyright").innerHTML =
         gMapStyles[gActiveMap].copyright;
     gTiles = {};
     document.getElementById("copyright").innerHTML =
         gMapStyles[gActiveMap].copyright;
+    showUI();
     drawMap();
   }
 }
     drawMap();
   }
 }
@@ -265,7 +267,7 @@ function drawMap() {
   // Go through all the tiles we want.
   // If any of them aren't loaded or being loaded, do so.
   for (var x = Math.floor(xMin / size); x < Math.ceil(xMax / size); x++) {
   // Go through all the tiles we want.
   // If any of them aren't loaded or being loaded, do so.
   for (var x = Math.floor(xMin / size); x < Math.ceil(xMax / size); x++) {
-    for (var y = Math.floor(yMin / size); y < Math.ceil(yMax / size); y++) {
+    for (var y = Math.floor(yMin / size); y < Math.ceil(yMax / size); y++) { // slow script warnings on the tablet appear here!
       var xoff = (x * size - xMin) / gZoomFactor;
       var yoff = (y * size - yMin) / gZoomFactor;
       var tileKey = encodeIndex(x, y, gPos.z);
       var xoff = (x * size - xMin) / gZoomFactor;
       var yoff = (y * size - yMin) / gZoomFactor;
       var tileKey = encodeIndex(x, y, gPos.z);
@@ -369,6 +371,7 @@ var mapEvHandler = {
         }
         gLastMouseX = x;
         gLastMouseY = y;
         }
         gLastMouseX = x;
         gLastMouseY = y;
+        showUI();
         break;
       case "mousemove":
       case "touchmove":
         break;
       case "mousemove":
       case "touchmove":
@@ -380,6 +383,7 @@ var mapEvHandler = {
           gPos.x -= dX * gZoomFactor;
           gPos.y -= dY * gZoomFactor;
           drawMap();
           gPos.x -= dX * gZoomFactor;
           gPos.y -= dY * gZoomFactor;
           drawMap();
+          showUI();
         }
         gLastMouseX = x;
         gLastMouseY = y;
         }
         gLastMouseX = x;
         gLastMouseY = y;
@@ -387,6 +391,7 @@ var mapEvHandler = {
       case "mouseup":
       case "touchend":
         gDragging = false;
       case "mouseup":
       case "touchend":
         gDragging = false;
+        showUI();
         break;
       case "mouseout":
       case "touchcancel":
         break;
       case "mouseout":
       case "touchcancel":