Skip to content

Commit 95bf2e8

Browse files
committed
Merge branch 'hide_horizon'
2 parents 3c60049 + 3e5a100 commit 95bf2e8

File tree

3 files changed

+58
-7
lines changed

3 files changed

+58
-7
lines changed

index.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
<link rel="apple-touch-icon" sizes="144x144" href="img/apple-touch-icon.png" />
1717
<link rel="fluid-icon" href="img/fluidicon.png" title="Mobile Tracker" />
1818
<link rel="icon" type="image/x-icon" href="favicon.ico" />
19+
1920
<!--
2021
<link rel="stylesheet" href="css/base.css"/>
2122
<link rel="stylesheet" href="css/skeleton.css"/>
2223
<link rel="stylesheet" href="css/layout.css"/>
2324
<link rel="stylesheet" href="css/habitat-font.css"/>
2425
<link rel="stylesheet" href="css/main.css"/>
2526
-->
27+
2628
<link rel="stylesheet" href="css/mobile.css"/>
2729
</head>
2830
<body>
@@ -154,6 +156,13 @@ <h2><i class="icon-settings rfloat"></i>Settings</h2>
154156
<input type="checkbox" id="opt_hilight_vehicle">
155157
</div>
156158
</div>
159+
<div class="row option">
160+
<span><b>Hide Horizon Rings</b></span>
161+
<div class="switch off" id="sw_hide_horizon">
162+
<span class="thumb"></span>
163+
<input type="checkbox" id="opt_hide_horizon">
164+
</div>
165+
</div>
157166
<h4>Overlays</h4>
158167
<hr/>
159168
<div class="row option">
@@ -304,15 +313,16 @@ <h2>Chase car mode</h2>
304313
</div>
305314
<script src="https://maps.google.com/maps/api/js?v=3.31&libraries=map,common,controls,util,marker,onion,kml,ga,infowindow,stats,poly,overlay,weather,weather_impl,geometry&language=en_us&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg" type="text/javascript"></script>
306315
<script type="text/javascript" language="javascript" src="js/mobile.js"></script>
307-
<!--
316+
<!--
308317
<script type="text/javascript" language="javascript" src="js/gmaps_extentions.js"></script>
309318
<script type="text/javascript" language="javascript" src="js/jquery-1.12.4-min.js"></script>
310319
<script type="text/javascript" language="javascript" src="js/chasecar.lib.js"></script>
311320
<script type="text/javascript" language="javascript" src="js/iscroll.js"></script>
312321
<script type="text/javascript" language="javascript" src="js/nite-overlay.js"></script>
313322
<script type="text/javascript" language="javascript" src="js/tracker.js"></script>
314323
<script type="text/javascript" language="javascript" src="js/app.js"></script>
315-
-->
324+
-->
325+
316326
<script type="text/javascript">
317327

318328
var _gaq = _gaq || [];

js/app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ $(window).ready(function() {
785785
"#sw_hide_receivers",
786786
"#sw_hide_timebox",
787787
"#sw_hilight_vehicle",
788+
'#sw_hide_horizon',
788789
"#sw_nowelcome",
789790
"#sw_interpolate",
790791
];
@@ -845,6 +846,14 @@ $(window).ready(function() {
845846
$('#lookanglesbox').css({top:'40px'});
846847
}
847848
break;
849+
case "opt_hide_horizon":
850+
if(on) {
851+
hideHorizonRings();
852+
}
853+
else {
854+
showHorizonRings();
855+
}
856+
break;
848857
case "opt_layers_aprs":
849858
if(on) map.overlayMapTypes.setAt("1", overlayAPRS);
850859
else map.overlayMapTypes.setAt("1", null);

js/tracker.js

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ var modeList = [
4444
// "Position",
4545
"1 hour",
4646
"6 hours",
47+
"12 hours",
4748
"1 day",
4849
"3 days",
4950
"All",
@@ -1684,10 +1685,13 @@ function addPosition(position) {
16841685
};
16851686
} else {
16861687
vehicle.marker.shadow.setVisible(true);
1687-
vehicle.horizon_circle.setVisible(true);
1688-
vehicle.horizon_circle.label.set('visible', true);
1689-
vehicle.subhorizon_circle.setVisible(true);
1690-
vehicle.subhorizon_circle.label.set('visible', true);
1688+
1689+
if(offline.get('opt_hide_horizon') == false){
1690+
vehicle.horizon_circle.setVisible(true);
1691+
vehicle.horizon_circle.label.set('visible', true);
1692+
vehicle.subhorizon_circle.setVisible(true);
1693+
vehicle.subhorizon_circle.label.set('visible', true);
1694+
}
16911695

16921696
if(mode == "parachute") {
16931697
img = {
@@ -1713,7 +1717,6 @@ function addPosition(position) {
17131717
};
17141718

17151719
// Add landing marker if the payload provides a predicted landing position.
1716-
// TODO: Only create this if the lat/lon are not zero.
17171720
if (position.data.hasOwnProperty('pred_lat') && position.data.hasOwnProperty('pred_lon')){
17181721
// Only create the marker if the pred lat/lon are not zero (as will be the case during ascent).
17191722
if ((position.data.pred_lat !== 0.0) && (position.data.pred_lon !== 0.0)){
@@ -1820,6 +1823,13 @@ function addPosition(position) {
18201823
google.maps.event.addListener(subhorizon_circle, 'center_changed', refresh_func);
18211824
google.maps.event.addListener(subhorizon_circle, 'radius_changed', refresh_func);
18221825

1826+
if(offline.get("opt_hide_horizon")){
1827+
horizon_circle.setVisible(false);
1828+
horizon_circle.label.set('visible', false);
1829+
subhorizon_circle.setVisible(false);
1830+
subhorizon_circle.label.set('visible', false);
1831+
}
1832+
18231833
marker.setAltitude(0);
18241834
polyline_visible = true;
18251835
polyline = [
@@ -2808,6 +2818,28 @@ function refreshUI() {
28082818
if(follow_vehicle !== null) update_lookangles(follow_vehicle);
28092819
}
28102820

2821+
2822+
function hideHorizonRings(){
2823+
for(var vcallsign in vehicles) {
2824+
if(vehicles[vcallsign].vehicle_type == "balloon"){
2825+
vehicles[vcallsign].horizon_circle.setVisible(false);
2826+
vehicles[vcallsign].horizon_circle.label.set('visible', false);
2827+
vehicles[vcallsign].subhorizon_circle.setVisible(false);
2828+
vehicles[vcallsign].subhorizon_circle.label.set('visible', false);
2829+
}
2830+
}
2831+
}
2832+
function showHorizonRings(){
2833+
for(var vcallsign in vehicles) {
2834+
if(vehicles[vcallsign].vehicle_type == "balloon"){
2835+
vehicles[vcallsign].horizon_circle.setVisible(true);
2836+
vehicles[vcallsign].horizon_circle.label.set('visible', true);
2837+
vehicles[vcallsign].subhorizon_circle.setVisible(true);
2838+
vehicles[vcallsign].subhorizon_circle.label.set('visible', true);
2839+
}
2840+
}
2841+
}
2842+
28112843
var ssdv = {};
28122844
var status = "";
28132845
var bs_idx = 0;

0 commit comments

Comments
 (0)