Skip to content

Commit 5f8ec9a

Browse files
updated hysplit logic due to backend changes
1 parent 52078f0 commit 5f8ec9a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

js/app.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,22 @@ var loadComplete = function(e) {
6868
}
6969

7070
var hysplit = {};
71+
var hysplit_data = {};
7172
var refresh_hysplit = function() {
7273
$.getJSON("http://spacenear.us/tracker/datanew.php?type=hysplit&format=json", function(data) {
7374
var refresh = false;
7475

7576
for(var k in data) {
76-
if(k in hysplit) {
77+
if(k in hysplit_data) {
7778
// if the jobid is the same, skip to next one
78-
if(hysplit[k].jobid == data[k]) continue;
79+
if(hysplit_data[k].jobid == data[k].jobid) continue;
7980

8081
// otherwise update the url
81-
hysplit[k].setUrl("http://ready.arl.noaa.gov/hypubout/HYSPLITtraj_" + data[k] + ".kmz");
82-
hysplit[k].jobid = data[k];
82+
hysplit_data[k] = data[k];
83+
hysplit[k].setUrl(hysplit_data[k].url_kmz);
8384
} else {
84-
hysplit[k] = new google.maps.KmlLayer({url:"http://ready.arl.noaa.gov/hypubout/HYSPLITtraj_" + data[k] + ".kmz", preserveViewport:true });
85-
hysplit[k].jobid = data[k];
85+
hysplit_data[k] = data[k];
86+
hysplit[k] = new google.maps.KmlLayer({url: hysplit_data[k].url_kmz, preserveViewport:true });
8687
refresh = true;
8788
}
8889
}

0 commit comments

Comments
 (0)