-
Notifications
You must be signed in to change notification settings - Fork 49
Add option to hide horizon rings. #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
7450182
f24664e
f387a31
41dc13a
1758886
fa73afc
c2936a7
561980e
3e5a100
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ var modeList = [ | |
| // "Position", | ||
| "1 hour", | ||
| "6 hours", | ||
| "12 hours", | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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", | ||
|
|
@@ -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 = { | ||
|
|
@@ -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)){ | ||
|
|
@@ -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 = [ | ||
|
|
@@ -2803,6 +2813,28 @@ function refreshUI() { | |
| if(follow_vehicle !== null) update_lookangles(follow_vehicle); | ||
| } | ||
|
|
||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of these