Skip to content

Commit d33ac21

Browse files
refresh UI when new hysplit is available
1 parent c9d3bd6 commit d33ac21

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ var loadComplete = function(e) {
6464
var hysplit = {};
6565
var refresh_hysplit = function() {
6666
$.getJSON("http://spacenear.us/tracker/datanew.php?type=hysplit&format=json", function(data) {
67+
var refresh = false;
68+
6769
for(var k in data) {
6870
if(k in hysplit) {
6971
// if the jobid is the same, skip to next one
@@ -75,8 +77,11 @@ var refresh_hysplit = function() {
7577
} else {
7678
hysplit[k] = new google.maps.KmlLayer({url:"http://ready.arl.noaa.gov/hypubout/HYSPLITtraj_" + data[k] + ".kmz", preserveViewport:true });
7779
hysplit[k].jobid = data[k];
80+
refresh = true;
7881
}
7982
}
83+
84+
if(refresh) refreshUI();
8085
});
8186
}
8287

0 commit comments

Comments
 (0)