Skip to content

Commit

Permalink
tweak tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Dec 21, 2020
1 parent 8571de3 commit 64a0c1b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
Binary file modified html/images/sprites003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 24 additions & 10 deletions html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand Down Expand Up @@ -1234,6 +1245,7 @@ function startPage() {
setTimeout(TAR.planeMan.refresh, 5000);

drawUpintheair();
mapRefresh();
}

//
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 64a0c1b

Please sign in to comment.