diff --git a/html/images/sprites003.png b/html/images/sprites003.png index 8c8db5091..7ab8f6333 100644 Binary files a/html/images/sprites003.png and b/html/images/sprites003.png differ diff --git a/html/script.js b/html/script.js index 4e01ddd61..22a2bf9d8 100644 --- a/html/script.js +++ b/html/script.js @@ -376,6 +376,26 @@ function fetchData() { clearTimeout(refreshId); triggerMapRefresh++; + if (firstFetch) { + firstFetch = false; + if (uuid) { + const ext = myExtent(OLMap.getView().calculateExtent(size)); + let jump = true; + for (let i = 0; i < PlanesOrdered.length; ++i) { + const plane = PlanesOrdered[i]; + if (plane.visible && inView(plane.position, ext)) { + jump = false; + break; + } + } + if (jump) { + followRandomPlane(); + deselectAllPlanes(); + OLMap.getView().setZoom(6); + } + } + checkRefresh(); + } checkMovement(); if (globeIndex) @@ -395,15 +415,6 @@ function fetchData() { StaleReceiverCount = 0; $("#update_error").css('display','none'); } - - if (firstFetch) { - firstFetch = false; - if (uuid) { - followRandomPlane(); - deselectAllPlanes(); - OLMap.getView().setZoom(6); - } - } }); req.fail(function(jqxhr, status, error) { @@ -1234,6 +1245,7 @@ function startPage() { setTimeout(TAR.planeMan.refresh, 5000); drawUpintheair(); + mapRefresh(); } // @@ -3468,8 +3480,10 @@ function onJump(e) { if (coords) { OLMap.getView().setCenter(ol.proj.fromLonLat([coords[1], coords[0]])); - if (ZoomLvl >= 7) + if (ZoomLvl >= 7) { + pendingFetches = 0; fetchData(); + } refreshFilter(); }