diff --git a/html/images/sprites003.png b/html/images/sprites003.png index 8c8db509..7ab8f633 100644 Binary files a/html/images/sprites003.png and b/html/images/sprites003.png differ diff --git a/html/index.html b/html/index.html index 4fb02d5d..34b02f4b 100644 --- a/html/index.html +++ b/html/index.html @@ -889,8 +889,6 @@
- - @@ -914,5 +912,7 @@ + + diff --git a/html/script.js b/html/script.js index 4e01ddd6..22a2bf9d 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(); }