Skip to content

Commit 83bda69

Browse files
implemented hysplit
1 parent 438a15b commit 83bda69

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

css/main.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,34 @@ header > div {
366366
position: relative;
367367
z-index: 4;
368368
}
369+
#main .row .data .hysplit {
370+
position: absolute;
371+
background-color: #fff;
372+
right: 5px;
373+
top: 150px;
374+
padding-left: 3px;
375+
padding-right: 3px;
376+
font-size: 10px;
377+
border-radius: 5px;
378+
border: 1px solid #ccc;
379+
cursor: pointer;
380+
z-index: 5;
381+
}
382+
383+
#main .row .data .hysplit.active {
384+
background-color: #33b5e5;
385+
border: 1px solid #33b5e5;
386+
color: #fff;
387+
}
388+
389+
#main .row .data .hysplit:hover {
390+
border: 1px solid #5E5E5E;
391+
}
392+
393+
#main .portrait .row .data .hysplit {
394+
display: none;
395+
}
396+
369397
#main .row .data img {
370398
position: absolute;
371399
z-index: 2;

js/app.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ var loadComplete = function(e) {
6161
$('#loading .complete').stop(true,true).animate({width: 200}, {complete: trackerInit });
6262
}
6363

64+
var hysplit = {};
65+
6466
// loads the tracker interface
6567
function trackerInit() {
6668
$('#loading,#settingsbox,#aboutbox,#chasebox').hide(); // welcome screen
@@ -73,6 +75,13 @@ function trackerInit() {
7375
if(!is_mobile) {
7476
$.getScript("js/init_plot.js", function() { checkSize(); if(!map) load(); });
7577
if(embed.graph) $('#telemetry_graph').attr('style','');
78+
79+
// fetch hysplit jobs
80+
$.getJSON("http://spacenear.us/tracker/hysplit.json", function(data) {
81+
for(var k in data) {
82+
hysplit[k] = new google.maps.KmlLayer("http://ready.arl.noaa.gov/hypubout/HYSPLITtraj_" + data[k] + ".kmz");
83+
}
84+
});
7685
return;
7786
}
7887
checkSize();
@@ -350,6 +359,21 @@ $(window).ready(function() {
350359
// expand graph on startup, if nessary
351360
if(embed.graph_expanded) $('#telemetry_graph .graph_label').click();
352361

362+
// hysplit button
363+
$("#main").on('click','.row .data .hysplit', function() {
364+
var elm = $(this);
365+
var name = vehicle_names[elm.attr('data-index')]
366+
367+
if(elm.hasClass("active")) {
368+
elm.removeClass('active');
369+
hysplit[name].setMap(null);
370+
}
371+
else {
372+
elm.addClass('active');
373+
hysplit[name].setMap(map);
374+
}
375+
});
376+
353377
// reset nite-overlay and timebox when mouse goes out of the graph box
354378
$("#telemetry_graph").on('mouseout','.holder', function() {
355379
nite.setDate(null);

js/tracker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ function updateVehicleInfo(index, newPosition) {
623623
+ '<i class="arrow"></i></div>'
624624
+ '<div class="data">'
625625
+ '<img class="'+((vehicle.vehicle_type=="car")?'car':'')+'" src="'+image+'" />'
626+
+ ((vehicle_names[index] in hysplit) ? '<span class="hysplit '+((hysplit[vehicle_names[index]].getMap()) ? 'active' : '')+'" data-index="'+index+'">HYSPLIT</span>' : '')
626627
+ '<div class="left">'
627628
+ '<dl>';
628629
// end

0 commit comments

Comments
 (0)