tweak tweak

This commit is contained in:
Matthias Wirth
2020-12-21 20:16:08 +01:00
parent 8571de3987
commit 8fbdb26cac
3 changed files with 26 additions and 12 deletions

View File

@@ -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();
}