@@ -81,8 +81,8 @@ var modeList = [
8181 "1d" ,
8282 "3d"
8383] ;
84- var modeDefault = "3h " ;
85- var modeDefaultMobile = "1h " ;
84+ var modeDefault = "1d " ;
85+ var modeDefaultMobile = "1d " ;
8686
8787// order of map elements
8888var Z_RANGE = 1 ;
@@ -483,6 +483,8 @@ function clean_refresh(text, force, history_step) {
483483 if ( text == wvar . mode && ! force ) return false ;
484484 stopAjax ( ) ;
485485
486+ live_data_buffer . positions . position = [ ] ;
487+
486488 if ( clientActive ) {
487489 clientActive = false ;
488490 if ( ! document . getElementById ( "stTimer" ) . classList . contains ( 'friendly-dtime' ) ) {
@@ -492,6 +494,18 @@ function clean_refresh(text, force, history_step) {
492494 $ ( "#stText" ) . text ( "" ) ;
493495 }
494496
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+
495509 // reset mode if, invalid mode is specified
496510 if ( modeList . indexOf ( text ) == - 1 ) text = ( is_mobile ) ? modeDefaultMobile : modeDefault ;
497511
@@ -590,7 +604,7 @@ function load() {
590604 onAdd : function ( map ) {
591605 var div = L . DomUtil . create ( 'div' ) ;
592606
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>' ;
594608 div . innerHTML . onload = setTimeValue ( ) ;
595609
596610 return div ;
@@ -826,8 +840,7 @@ function habitat_data(jsondata, alternative) {
826840 "spam" : true ,
827841 "battery_millivolts" : true ,
828842 "temperature_internal_x10" : true ,
829- "uplink_rssi_raw" : true ,
830- "comment" : true
843+ "uplink_rssi_raw" : true
831844 } ;
832845
833846 var suffixes = globalSuffixes ;
@@ -1376,7 +1389,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
13761389 '<img class="' + ( ( vehicle . vehicle_type == "car" ) ?'car' :'' ) + '" src="' + image + '" />' +
13771390 '<span class="vbutton path ' + ( ( vehicle . polyline_visible ) ? 'active' : '' ) + '" data-vcallsign="' + vcallsign + '"' + ' style="top:' + ( vehicle . image_src_size [ 1 ] + 55 ) + 'px">Path</span>' +
13781391 ( ( 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>' : '' ) +
13801393 '<div class="left">' +
13811394 '<dl>' ;
13821395 //mobile
@@ -1388,7 +1401,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
13881401 '<img class="' + ( ( vehicle . vehicle_type == "car" ) ?'car' :'' ) + '" src="' + image + '" />' +
13891402 '<span class="vbutton path ' + ( ( vehicle . polyline_visible ) ? 'active' : '' ) + '" data-vcallsign="' + vcallsign + '"' + ' style="top:55px">Path</span>' +
13901403 ( ( 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>' : '' ) +
13921405 '<div class="left">' +
13931406 '<dl>' ;
13941407 var b = '</dl>' +
0 commit comments