@@ -81,8 +81,8 @@ var modeList = [
81
81
"1d" ,
82
82
"3d"
83
83
] ;
84
- var modeDefault = "3h " ;
85
- var modeDefaultMobile = "1h " ;
84
+ var modeDefault = "1d " ;
85
+ var modeDefaultMobile = "1d " ;
86
86
87
87
// order of map elements
88
88
var Z_RANGE = 1 ;
@@ -483,6 +483,8 @@ function clean_refresh(text, force, history_step) {
483
483
if ( text == wvar . mode && ! force ) return false ;
484
484
stopAjax ( ) ;
485
485
486
+ live_data_buffer . positions . position = [ ] ;
487
+
486
488
if ( clientActive ) {
487
489
clientActive = false ;
488
490
if ( ! document . getElementById ( "stTimer" ) . classList . contains ( 'friendly-dtime' ) ) {
@@ -492,6 +494,18 @@ function clean_refresh(text, force, history_step) {
492
494
$ ( "#stText" ) . text ( "" ) ;
493
495
}
494
496
497
+ try {
498
+ client . unsubscribe ( clientTopic ) ;
499
+ if ( wvar . query && sondePrefix . indexOf ( wvar . query ) == - 1 ) {
500
+ var topic = "amateur/" + wvar . query ;
501
+ client . subscribe ( topic ) ;
502
+ clientTopic = topic ;
503
+ } else {
504
+ client . subscribe ( "amateur/#" ) ;
505
+ clientTopic = "amateur/#" ;
506
+ }
507
+ } catch ( err ) { }
508
+
495
509
// reset mode if, invalid mode is specified
496
510
if ( modeList . indexOf ( text ) == - 1 ) text = ( is_mobile ) ? modeDefaultMobile : modeDefault ;
497
511
@@ -590,7 +604,7 @@ function load() {
590
604
onAdd : function ( map ) {
591
605
var div = L . DomUtil . create ( 'div' ) ;
592
606
593
- div . innerHTML = '<select name="timeperiod" id="timeperiod" style="width:auto !important;height:30px;" onchange="clean_refresh(this.value)"><option value="1h">1 hour</option><option value="3h" selected="selected" >3 hours</option><option value="6h">6 hours</option><option value="12h">12 hours</option><option value="1d">1 day</option><option value="3d">3 days</option></select>' ;
607
+ div . innerHTML = '<select name="timeperiod" id="timeperiod" style="width:auto !important;height:30px;" onchange="clean_refresh(this.value)"><option value="0">Live Only</option><option value=" 1h">1 hour</option><option value="3h">3 hours</option><option value="6h">6 hours</option><option value="12h">12 hours</option><option value="1d" selected="selected ">1 day</option><option value="3d">3 days</option></select>' ;
594
608
div . innerHTML . onload = setTimeValue ( ) ;
595
609
596
610
return div ;
@@ -826,8 +840,7 @@ function habitat_data(jsondata, alternative) {
826
840
"spam" : true ,
827
841
"battery_millivolts" : true ,
828
842
"temperature_internal_x10" : true ,
829
- "uplink_rssi_raw" : true ,
830
- "comment" : true
843
+ "uplink_rssi_raw" : true
831
844
} ;
832
845
833
846
var suffixes = globalSuffixes ;
@@ -1376,7 +1389,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
1376
1389
'<img class="' + ( ( vehicle . vehicle_type == "car" ) ?'car' :'' ) + '" src="' + image + '" />' +
1377
1390
'<span class="vbutton path ' + ( ( vehicle . polyline_visible ) ? 'active' : '' ) + '" data-vcallsign="' + vcallsign + '"' + ' style="top:' + ( vehicle . image_src_size [ 1 ] + 55 ) + 'px">Path</span>' +
1378
1391
( ( vehicle . vehicle_type != "car" ) ? '<span class="sbutton" onclick="shareVehicle(\'' + vcallsign + '\')" style="top:' + ( vehicle . image_src_size [ 1 ] + 85 ) + 'px">Share</span>' : '' ) +
1379
- ( ( vehicle . vehicle_type != "car" && newPosition . gps_alt > 1000 && vehicle . ascent_rate < 1 ) ? '<span class="sbutton hysplit ' + ( ( vehicle . prediction_hysplit_visible ) ? 'active' : '' ) + '" data-vcallsign="' + vcallsign + '" style="top:' + ( vehicle . image_src_size [ 1 ] + 115 ) + 'px">Hysplit </span>' : '' ) +
1392
+ ( ( vehicle . vehicle_type != "car" && newPosition . gps_alt > 1000 && vehicle . ascent_rate < 1 ) ? '<span class="sbutton hysplit ' + ( ( vehicle . prediction_hysplit_visible ) ? 'active' : '' ) + '" data-vcallsign="' + vcallsign + '" style="top:' + ( vehicle . image_src_size [ 1 ] + 115 ) + 'px">Float </span>' : '' ) +
1380
1393
'<div class="left">' +
1381
1394
'<dl>' ;
1382
1395
//mobile
@@ -1388,7 +1401,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
1388
1401
'<img class="' + ( ( vehicle . vehicle_type == "car" ) ?'car' :'' ) + '" src="' + image + '" />' +
1389
1402
'<span class="vbutton path ' + ( ( vehicle . polyline_visible ) ? 'active' : '' ) + '" data-vcallsign="' + vcallsign + '"' + ' style="top:55px">Path</span>' +
1390
1403
( ( vehicle . vehicle_type != "car" ) ? '<span class="sbutton" onclick="shareVehicle(\'' + vcallsign + '\')" style="top:85px">Share</span>' : '' ) +
1391
- ( ( vehicle . vehicle_type != "car" && newPosition . gps_alt > 1000 && vehicle . ascent_rate < 1 ) ? '<span class="sbutton hysplit ' + ( ( vehicle . prediction_hysplit_visible ) ? 'active' : '' ) + '" data-vcallsign="' + vcallsign + '" style="top:115px">Hysplit </span>' : '' ) +
1404
+ ( ( vehicle . vehicle_type != "car" && newPosition . gps_alt > 1000 && vehicle . ascent_rate < 1 ) ? '<span class="sbutton hysplit ' + ( ( vehicle . prediction_hysplit_visible ) ? 'active' : '' ) + '" data-vcallsign="' + vcallsign + '" style="top:115px">Float </span>' : '' ) +
1392
1405
'<div class="left">' +
1393
1406
'<dl>' ;
1394
1407
var b = '</dl>' +
0 commit comments