gCanvas.addEventListener("touchcancel", mapEvHandler, false);
gCanvas.addEventListener("touchleave", mapEvHandler, false);
+ // XXX deprecated? see https://groups.google.com/forum/?fromgroups#!topic/mozilla.dev.planning/kuhrORubaRY[1-25]
gCanvas.addEventListener("DOMMouseScroll", mapEvHandler, false);
gCanvas.addEventListener("mousewheel", mapEvHandler, false);
gCanvas.width = canvasWidth;
gCanvas.height = canvasHeight;
drawMap();
+ showUI();
}
function zoomIn() {
if (mapSel.selectedIndex >= 0 && gActiveMap != mapSel.value) {
gActiveMap = mapSel.value;
gTiles = {};
+ document.getElementById("copyright").innerHTML =
+ gMapStyles[gActiveMap].copyright;
+ showUI();
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++) {
- 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);
}
gLastMouseX = x;
gLastMouseY = y;
+ showUI();
break;
case "mousemove":
case "touchmove":
gPos.x -= dX * gZoomFactor;
gPos.y -= dY * gZoomFactor;
drawMap();
+ showUI();
}
gLastMouseX = x;
gLastMouseY = y;
case "mouseup":
case "touchend":
gDragging = false;
+ showUI();
break;
case "mouseout":
case "touchcancel":