Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
<link rel="apple-touch-icon" sizes="144x144" href="img/apple-touch-icon.png" />
<link rel="fluid-icon" href="img/fluidicon.png" title="Mobile Tracker" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />

<!--
<link rel="stylesheet" href="css/base.css"/>
<link rel="stylesheet" href="css/skeleton.css"/>
<link rel="stylesheet" href="css/layout.css"/>
<link rel="stylesheet" href="css/habitat-font.css"/>
<link rel="stylesheet" href="css/main.css"/>
-->

<link rel="stylesheet" href="css/mobile.css"/>
</head>
<body>
Expand Down Expand Up @@ -154,6 +156,13 @@ <h2><i class="icon-settings rfloat"></i>Settings</h2>
<input type="checkbox" id="opt_hilight_vehicle">
</div>
</div>
<div class="row option">
<span><b>Hide Horizon Rings</b></span>
<div class="switch off" id="sw_hide_horizon">
<span class="thumb"></span>
<input type="checkbox" id="opt_hide_horizon">
</div>
</div>
<h4>Overlays</h4>
<hr/>
<div class="row option">
Expand Down Expand Up @@ -304,15 +313,16 @@ <h2>Chase car mode</h2>
</div>
<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>
<script type="text/javascript" language="javascript" src="js/mobile.js"></script>
<!--
<!--
<script type="text/javascript" language="javascript" src="js/gmaps_extentions.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery-1.12.4-min.js"></script>
<script type="text/javascript" language="javascript" src="js/chasecar.lib.js"></script>
<script type="text/javascript" language="javascript" src="js/iscroll.js"></script>
<script type="text/javascript" language="javascript" src="js/nite-overlay.js"></script>
<script type="text/javascript" language="javascript" src="js/tracker.js"></script>
<script type="text/javascript" language="javascript" src="js/app.js"></script>
-->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of these

-->

<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
9 changes: 9 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ $(window).ready(function() {
"#sw_hide_receivers",
"#sw_hide_timebox",
"#sw_hilight_vehicle",
'#sw_hide_horizon',
"#sw_nowelcome",
"#sw_interpolate",
];
Expand Down Expand Up @@ -845,6 +846,14 @@ $(window).ready(function() {
$('#lookanglesbox').css({top:'40px'});
}
break;
case "opt_hide_horizon":
if(on) {
hideHorizonRings();
}
else {
showHorizonRings();
}
break;
case "opt_layers_aprs":
if(on) map.overlayMapTypes.setAt("1", overlayAPRS);
else map.overlayMapTypes.setAt("1", null);
Expand Down
42 changes: 37 additions & 5 deletions js/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var modeList = [
// "Position",
"1 hour",
"6 hours",
"12 hours",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get a consistent experience on mobile, this list needs to be at most 6 entries, and entries need to match the backend code. It doesn't automatically handle arbitrary intervals

"1 day",
"3 days",
"All",
Expand Down Expand Up @@ -1679,10 +1680,13 @@ function addPosition(position) {
};
} else {
vehicle.marker.shadow.setVisible(true);
vehicle.horizon_circle.setVisible(true);
vehicle.horizon_circle.label.set('visible', true);
vehicle.subhorizon_circle.setVisible(true);
vehicle.subhorizon_circle.label.set('visible', true);

if(offline.get('opt_hide_horizon') == false){
vehicle.horizon_circle.setVisible(true);
vehicle.horizon_circle.label.set('visible', true);
vehicle.subhorizon_circle.setVisible(true);
vehicle.subhorizon_circle.label.set('visible', true);
}

if(mode == "parachute") {
img = {
Expand All @@ -1708,7 +1712,6 @@ function addPosition(position) {
};

// Add landing marker if the payload provides a predicted landing position.
// TODO: Only create this if the lat/lon are not zero.
if (position.data.hasOwnProperty('pred_lat') && position.data.hasOwnProperty('pred_lon')){
// Only create the marker if the pred lat/lon are not zero (as will be the case during ascent).
if ((position.data.pred_lat !== 0.0) && (position.data.pred_lon !== 0.0)){
Expand Down Expand Up @@ -1815,6 +1818,13 @@ function addPosition(position) {
google.maps.event.addListener(subhorizon_circle, 'center_changed', refresh_func);
google.maps.event.addListener(subhorizon_circle, 'radius_changed', refresh_func);

if(offline.get("opt_hide_horizon")){
horizon_circle.setVisible(false);
horizon_circle.label.set('visible', false);
subhorizon_circle.setVisible(false);
subhorizon_circle.label.set('visible', false);
}

marker.setAltitude(0);
polyline_visible = true;
polyline = [
Expand Down Expand Up @@ -2803,6 +2813,28 @@ function refreshUI() {
if(follow_vehicle !== null) update_lookangles(follow_vehicle);
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we combine these into a single function to hide/show the rings via a parameter for a single vehicle, and adjust other code to use it. There are two cases above when adding the position where you can simply reuse that new function

function hideHorizonRings(){
for(var vcallsign in vehicles) {
if(vehicles[vcallsign].vehicle_type == "balloon"){
vehicles[vcallsign].horizon_circle.setVisible(false);
vehicles[vcallsign].horizon_circle.label.set('visible', false);
vehicles[vcallsign].subhorizon_circle.setVisible(false);
vehicles[vcallsign].subhorizon_circle.label.set('visible', false);
}
}
}
function showHorizonRings(){
for(var vcallsign in vehicles) {
if(vehicles[vcallsign].vehicle_type == "balloon"){
vehicles[vcallsign].horizon_circle.setVisible(true);
vehicles[vcallsign].horizon_circle.label.set('visible', true);
vehicles[vcallsign].subhorizon_circle.setVisible(true);
vehicles[vcallsign].subhorizon_circle.label.set('visible', true);
}
}
}

var ssdv = {};
var status = "";
var bs_idx = 0;
Expand Down