X-Git-Url: https://git-public.kairo.at//?a=blobdiff_plain;f=js%2Fmap.js;h=926177646f9a2f525f293d423fc3cf521eeef1a4;hb=bb752fc4f4a183177fe8ac6ea3e5bf6e061a9bb4;hp=024eaf4e655b9a9f34df5e227070bfc87678b716;hpb=d7310ee2c8b72539147c6879be811a960fd2938a;p=lantea.git diff --git a/js/map.js b/js/map.js index 024eaf4..9261776 100644 --- a/js/map.js +++ b/js/map.js @@ -125,13 +125,15 @@ function loadPrefs(aEvent) { document.getElementById("copyright").innerHTML = gMapStyles[gMap.activeMap].copyright; + console.log("Init loading tile..."); gLoadingTile = new Image(); - gLoadingTile.src = "style/loading.png"; gLoadingTile.onload = function() { - console.log("Loading Tile loaded."); + console.log("Loading tile loaded."); var throwEv = new CustomEvent("prefload-done"); gAction.dispatchEvent(throwEv); }; + console.log("Set loading tile..."); + gLoadingTile.src = "style/loading.png"; } } else { @@ -476,8 +478,8 @@ var gMap = { y: Math.ceil((gMap.pos.y + gMap.baseDim.ht / 2) / gMap.baseDim.tsize) + 1, z: gMap.pos.z}); console.log("In range: " + tMin.x + "," + tMin.y + "," + tMin.z + " - " + tMax.x + "," + tMax.y + "," + tMax.z); - for (aTileKey in gMap.glTextures) { - var keyMatches = aTileKey.match(/([^:]+)::(\d+),(\d+),(\d+)/); + for (var tileKey in gMap.glTextures) { + var keyMatches = tileKey.match(/([^:]+)::(\d+),(\d+),(\d+)/); if (keyMatches && keyMatches[1] != "loading") { var txData = { style: keyMatches[1], @@ -504,8 +506,8 @@ var gMap = { } if (delTx) { // Delete texture from GL and from the array we are holding. - gMap.gl.deleteTexture(gMap.glTextures[aTileKey]); - delete gMap.glTextures[aTileKey]; + gMap.gl.deleteTexture(gMap.glTextures[tileKey]); + delete gMap.glTextures[tileKey]; } } }