Skip to content

Commit aca936e

Browse files
Merge branch 'beta', LOS lines + css tweaks
6a400f9 - increased map size in portrait mode 6733091 - fix css bug, cause by my+vim; f392993 9d3eec3 - added LOS lines from selected balloon to receivers
2 parents 8a89cc8 + 6a400f9 commit aca936e

File tree

3 files changed

+59
-8
lines changed

3 files changed

+59
-8
lines changed

css/main.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ header .search form input[type='submit'] {
435435
position: absolute;
436436
z-index: 2;
437437
bottom: 40%;
438-
right: 25%;
438+
right: 30%;
439439
opacity: 0.6;
440440
width: 46px;
441441
height: 84px;
@@ -740,7 +740,7 @@ header .search form input[type='submit'] {
740740
height: 225px;
741741
}
742742
#main {
743-
height: 180px;
743+
height: 150px;
744744
}
745745
#main .data {
746746
height: 140px;
@@ -749,17 +749,16 @@ header .search form input[type='submit'] {
749749
float: left;
750750
width: 65%;
751751
padding-left: 5px;
752-
padding-right: 20px;
753752
}
754753
#main .data .right {
755754
float: right;
756755
padding-right: 10px;
757-
width: 20%;
756+
width: 25%;
758757
}
759758
#main .data dl > dt {
760759
color: #000;
761-
l120ne-height: 11px;
762-
margin-top: 15px;
760+
line-height: 11px;
761+
margin-top: 7px;
763762
font-weight: bold;
764763
font-size: 14px;
765764
}

js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ function checkSize() {
314314
$('#main').width(sw);
315315
} else { // portrait mode
316316
//if(h < 420) h = 420;
317-
var mh = (wvar.vlist) ? 180 : 0;
317+
var mh = (wvar.vlist) ? 150 : 0;
318318

319319
$('body,#loading').height(h);
320320
$('#map,#mapscreen').height(h-hh-5-mh);

js/tracker.js

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,51 @@ function updateZoom() {
681681
}
682682
}
683683

684+
var los_polylines = [];
685+
686+
function drawLOSPaths(vcallsign) {
687+
los_polylines.forEach(function(polyline) {
688+
polyline.setMap(null);
689+
});
690+
los_polylines = [];
691+
692+
if(offline.get('opt_hide_receivers')) return;
693+
694+
var vehicle = vehicles[vcallsign];
695+
696+
if(vehicle === undefined || vehicle.vehicle_type !== "balloon") return;
697+
698+
var callsigns = vehicle.curr_position.callsign.split(',');
699+
700+
callsigns.forEach(function(callsign) {
701+
callsign = callsign.trim(' ');
702+
703+
var r_index = receiver_names.indexOf(callsign);
704+
705+
if(r_index === -1) return;
706+
707+
var path = [
708+
vehicle.marker_shadow.getPosition(),
709+
receivers[r_index].marker.getPosition(),
710+
];
711+
712+
var p = new google.maps.Polyline({
713+
map: map,
714+
path: path,
715+
zIndex: Z_PATH,
716+
strokeColor: '#0F0',
717+
strokeOpacity: 0.8,
718+
strokeWeight: 3,
719+
clickable: true,
720+
draggable: false,
721+
geodesic: true
722+
});
723+
p.path_length = google.maps.geometry.spherical.computeDistanceBetween(path[0], path[1]);
724+
los_polylines.push(p);
725+
google.maps.event.addListener(p, 'click', mapInfoBox_handle_prediction_path);
726+
});
727+
}
728+
684729
function focusVehicle(vcallsign, ignoreOpt) {
685730
if(!offline.get('opt_hilight_vehicle') && ignoreOpt === undefined) return;
686731

@@ -723,6 +768,9 @@ function stopFollow(no_data_reset) {
723768
if(plot) plot = $.plot(plot_holder, {}, plot_options);
724769
updateGraph(null, true);
725770

771+
// clear LOS lines
772+
drawLOSPaths(null);
773+
726774
// update lookangles box
727775
if(GPS_ts !== null) $("#lookanglesbox span").hide().parent().find(".nofollow").show();
728776

@@ -755,6 +803,7 @@ function followVehicle(vcallsign, noPan, force) {
755803
$("#main .vehicle"+vehicles[vcallsign].uuid).addClass("follow");
756804

757805
updateGraph(vcallsign, true);
806+
drawLOSPaths(vcallsign);
758807
}
759808

760809
if(should_pan) {
@@ -929,7 +978,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
929978
'</div>' + // left
930979
'<div class="right">' +
931980
'<dl>' +
932-
((vehicle.vehicle_type == "car") ? '' : '<dt>'+ascent_text+' '+hrate_text+'</dt><dd>rate v|h</dd>') +
981+
((vehicle.vehicle_type == "car") ? '' : '<dt>'+ascent_text+'<br/>'+hrate_text+'</dt><dd>rate v|h</dd>') +
933982
'<dt>'+text_alt+'</dt><dd>altitude</dd>' +
934983
'<dt>'+text_alt_max+'</dt><dd>max alt</dd>' +
935984
'';
@@ -2521,6 +2570,8 @@ function updateReceivers(r) {
25212570
receiver_names.splice(i,1);
25222571
}
25232572
}
2573+
2574+
if(follow_vehicle !== null) drawLOSPaths(follow_vehicle);
25242575
}
25252576

25262577
function updatePredictions(r) {
@@ -2637,6 +2688,7 @@ function update(response) {
26372688

26382689
if(listScroll) listScroll.refresh();
26392690
if(zoomed_in && follow_vehicle == vcallsign && !manual_pan) panTo(follow_vehicle);
2691+
if(follow_vehicle == vcallsign) drawLOSPaths(vcallsign);
26402692
}
26412693

26422694
// step to the next callsign

0 commit comments

Comments
 (0)