From 9274b0f0f84ae0e18f16d6b1f45a2fe167749c0e Mon Sep 17 00:00:00 2001 From: PCigales <58741513+PCigales@users.noreply.github.com> Date: Fri, 14 Jan 2022 18:10:20 +0100 Subject: [PATCH] Small adjustment --- GPXTweaker.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/GPXTweaker.py b/GPXTweaker.py index 8fb782c..8f55558 100644 --- a/GPXTweaker.py +++ b/GPXTweaker.py @@ -8672,21 +8672,19 @@ class GPXTweakerWebInterfaceServer(): ' }\r\n' \ ' async function add_row_tile() {\r\n' \ ' let row = crow;\r\n' \ - ' if ((row - tminrow) * ncol <= ltiles + ##TILEMAXPENDING##) {\r\n' \ - ' for (let col=tmincol; col<=tmaxcol; col++) {\r\n' \ - ' let tile = new Image();\r\n' \ - ' tile.crossOrigin = "anonymous";\r\n' \ - ' tile.onload = (e) => {tload_cb(e.target, row, col);};\r\n' \ - ' tile.onerror = (e) => {terr_cb();};\r\n' \ - ' tile.src = "http://" + location.hostname + ":" + (portmin + (row + col) % (portmax + 1 - portmin)).toString() + ##TILEPATH##;\r\n' \ - ' }\r\n' \ - ' if (crow < tmaxrow) {\r\n' \ - ' crow++;\r\n' \ - ' setTimeout(add_row_tile, 1);\r\n' \ - ' }\r\n' \ - ' } else {\r\n' \ + ' if ((row - tminrow) * ncol > ltiles + ##TILEMAXPENDING##) {\r\n' \ ' let prom = new Promise(function(resolve, reject) {prom_res = resolve;});\r\n' \ ' await prom;\r\n' \ + ' }\r\n' \ + ' for (let col=tmincol; col<=tmaxcol; col++) {\r\n' \ + ' let tile = new Image();\r\n' \ + ' tile.crossOrigin = "anonymous";\r\n' \ + ' tile.onload = (e) => {tload_cb(e.target, row, col);};\r\n' \ + ' tile.onerror = (e) => {terr_cb();};\r\n' \ + ' tile.src = "http://" + location.hostname + ":" + (portmin + (row + col) % (portmax + 1 - portmin)).toString() + ##TILEPATH##;\r\n' \ + ' }\r\n' \ + ' if (crow < tmaxrow) {\r\n' \ + ' crow++;\r\n' \ ' add_row_tile();\r\n' \ ' }\r\n' \ ' }\r\n' \