Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render altitude chart even when custom altitude colors are used #79

Closed
wants to merge 14 commits into from
Closed
Prev Previous commit
Next Next commit
some hacks to make adsbexchange globe page load faster
  • Loading branch information
wiedehopf authored and vkirienko committed Oct 27, 2020
commit cfaf6407aa20223367e2b04f4499beb4601d24b5
34 changes: 22 additions & 12 deletions html/early.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,28 @@ function lDateString(date) {
return string;
}

// get configuration json files, will be used in initialize function
let get_receiver_defer = $.ajax({ url: 'data/receiver.json',
cache: false,
dataType: 'json',
timeout: 5000,
});
let test_chunk_defer = $.ajax({
url:'chunks/chunks.json',
cache: false,
dataType: 'json',
timeout: 4000,
});
let get_receiver_defer;
let test_chunk_defer;

if (!window.location.href.match(/globe.*adsbexchange.com/)) {
// get configuration json files, will be used in initialize function
get_receiver_defer = $.ajax({ url: 'data/receiver.json',
cache: false,
datatype: 'json',
timeout: 10000,
});
test_chunk_defer = $.ajax({
url:'chunks/chunks.json',
datatype: 'json',
timeout: 4000,
});
} else {
console.log("Using adsbexchange fast-path load!");
let data = JSON.parse('{"refresh":1000,"history":1,"dbServer":true,"binCraft":true,"globeIndexGrid":10,"globeIndexSpecialTiles":[{"south":60,"east":150,"north":90,"west":-130},{"south":10,"east":-130,"north":90,"west":150},{"south":50,"east":-70,"north":60,"west":-130},{"south":40,"east":-100,"north":50,"west":-130},{"south":40,"east":50,"north":60,"west":20},{"south":30,"east":90,"north":60,"west":50},{"south":30,"east":120,"north":60,"west":90},{"south":30,"east":150,"north":60,"west":120},{"south":10,"east":70,"north":30,"west":50},{"south":10,"east":90,"north":30,"west":70},{"south":10,"east":110,"north":30,"west":90},{"south":10,"east":150,"north":30,"west":110},{"south":-90,"east":110,"north":10,"west":-40},{"south":-90,"east":160,"north":10,"west":110},{"south":-90,"east":-90,"north":10,"west":160},{"south":-10,"east":-40,"north":10,"west":-90},{"south":-90,"east":-40,"north":-10,"west":-90},{"south":10,"east":-90,"north":30,"west":-130},{"south":10,"east":-70,"north":20,"west":-90},{"south":10,"east":30,"north":40,"west":-10},{"south":10,"east":50,"north":40,"west":30},{"south":10,"east":-10,"north":60,"west":-70}],"version":"adsbexchange-backend"}');
get_receiver_defer = $.Deferred().resolve(data);
test_chunk_defer = $.Deferred().reject();
}

$.getJSON(databaseFolder + "/icao_aircraft_types.js").done(function(typeLookupData) {
_aircraft_type_cache = typeLookupData;
});
Expand Down