File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -68,21 +68,22 @@ var loadComplete = function(e) {
6868}
6969
7070var hysplit = { } ;
71+ var hysplit_data = { } ;
7172var 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 }
You can’t perform that action at this time.
0 commit comments