Skip to content

Commit 87b9bba

Browse files
Merge branch 'feature-lookangles'
* feature-lookangles: fixed message showing after stopFollow() with no lock show range in meters when under 10km fix bug parsing coords as int insteado float fully working lookangles small code fixups calculate and display look angles on pan added minibox to display look angles
2 parents ab5322b + 034b835 commit 87b9bba

File tree

6 files changed

+383
-26
lines changed

6 files changed

+383
-26
lines changed

css/main.css

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,44 +46,79 @@ body {
4646
z-index: 49;
4747
}
4848

49-
#timebox {
49+
.slickbox {
5050
z-index: 49;
5151
background-color: #fff;
5252
position: absolute;
53-
top: 7px;
54-
left: 30px;
55-
//margin-left: -145px;
5653
height: 28px;
5754
width: 225px;
5855
border-radius: 20px;
5956
box-shadow: 0 0 5px #888;
6057
font-size: 11px;
6158
}
62-
#timebox svg {
59+
60+
.slickbox svg {
6361
width: 28px;
6462
height: 28px;
6563
}
66-
#timebox svg path {
64+
65+
.slickbox span {
66+
line-height: 14px;
67+
}
68+
69+
.slickbox div {
70+
font-size: 14px;
71+
margin-top: 3px;
72+
width: 180px;
73+
text-align: center;
74+
}
75+
76+
.slickbox svg path {
6777
-webkit-transition: all 0.4s ease-in-out;
6878
-moz-transition: all 0.4s ease-in-out;
6979
-ms-transition: all 0.4s ease-in-out;
7080
-o-transition: all 0.4s ease-in-out;
7181
transition: all 0.4s ease-in-out;
7282
fill: #00a3d3;
7383
}
84+
85+
#timebox {
86+
top: 7px;
87+
left: 30px;
88+
}
89+
90+
#lookanglesbox {
91+
top: 40px;
92+
left: 30px;
93+
}
94+
7495
#timebox.past svg path {
7596
fill: #c00;
7697
}
77-
#timebox span {
78-
line-height: 14px;
79-
}
8098
#timebox .current {
8199
margin-left: 5px;
82100
}
83101
#timebox .local {
84102
margin-left: 15px;
85103
}
86104

105+
.slickbox .azimuth {
106+
margin-left: 9px;
107+
width: 100;
108+
}
109+
.slickbox .bearing {
110+
margin-right: 5px;
111+
width: 60px;
112+
}
113+
.slickbox .elevation {
114+
margin-left: 5px;
115+
width: 100px;
116+
}
117+
.slickbox .range {
118+
margin-right: 5px;
119+
width: 60px;
120+
}
121+
87122
#mapscreen {
88123
float: right;
89124
position: relative;

glyphs/icon-compass.svg

Lines changed: 192 additions & 0 deletions
Loading

glyphs/icon-compass_simple.svg

Lines changed: 29 additions & 0 deletions
Loading

index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,26 @@ <h2>Chase car mode</h2>
237237
</div>
238238
<div id="homebox" style="width:0px;height:0px"></div>
239239
<div id="mapscreen">
240-
<div id="timebox" class="present" style="display: none">
240+
<div id="timebox" class="present slickbox" style="display: none">
241241
<svg width="40" height="40" viewbox="0 0 200 200" version="1.1" class="lfloat">
242242
<path d="M99.812,43.188c-2.77,0-5,2.032-5,4.562v40.875c-4.315,1.97-7.312,6.321-7.312,11.375,0,6.9,5.596,12.5,12.5,12.5,1.05,0,2.06-0.16,3.03-0.41l23.35,23.35c2.23,2.24,5.93,2.13,8.28-0.22s2.42-6.04,0.18-8.28l-23-23c0.42-1.24,0.66-2.56,0.66-3.94,0-5.202-3.17-9.68-7.69-11.562v-40.688c0-2.53-2.23-4.562-4.998-4.562zm-5.906-23c0.031-0.003,0.063,0.002,0.094,0v14.374c0,0.236,0.202,0.438,0.438,0.438h11.122c0.24,0,0.44-0.202,0.44-0.438v-14.343c39.4,2.921,70.86,34.381,73.78,73.781h-14.34c-0.24,0-0.44,0.171-0.44,0.406v11.154c0,0.24,0.2,0.44,0.44,0.44h14.34c-2.92,39.4-34.38,70.86-73.78,73.78v-14.37c0-0.24-0.2-0.41-0.44-0.41h-11.122c-0.236,0-0.438,0.17-0.438,0.41v14.37c-39.4-2.92-70.86-34.38-73.781-73.78h14.343c0.236,0,0.438-0.2,0.438-0.44v-11.154c0-0.235-0.202-0.406-0.438-0.406h-14.343c2.918-39.372,34.33-70.848,73.687-73.812zm6.094-10.188c-49.706,0-90,40.294-90,90,0,49.71,40.294,90,90,90,49.71,0,90-40.29,90-90,0-49.706-40.29-90-90-90zm0-10c55.23,0,100,44.772,100,100,0,55.23-44.77,100-100,100-55.228,0-100-44.77-100-100,0-55.228,44.772-100,100-100z" />
243243
</svg>
244244
<span class="current lfloat">Current: ???</span>
245245
<span class="local lfloat">Local: ???</span>
246246
</div>
247247

248+
<div id="lookanglesbox" class="slickbox" style="display: none">
249+
<svg width="40" height="40" viewbox="0 0 200 200" version="1.1" class="lfloat">
250+
<path d="M100,0c-55.228,0-100,44.772-100,100,0,55.23,44.772,100,100,100,55.23,0,100-44.77,100-100,0-55.228-44.77-100-100-100zm0,10c49.71,0,90,40.294,90,90,0,49.71-40.29,90-90,90-49.706,0-90-40.29-90-90,0-49.706,40.294-90,90-90zm-2.062,10c-43.229,1.095-77.938,36.508-77.938,80,0,44.18,35.817,80,80,80,44.18,0,80-35.82,80-80,0-44.183-35.82-80-80-80-0.69,0-1.376-0.017-2.062,0zm-14.219,9.469h7.969l16.092,27.187,0.16-0.031v-27.156h7.97v39.812h-7.97l-16.065-27.187h-0.187v27.187h-7.969v-39.812zm16.281,44.593l6.94,19,19,6.938-19,6.94-6.94,19-6.938-19-19-6.94,19-6.938,6.938-19zm-72.781,5.876h7.812l5.719,27.252,0.156,0.03,7.469-27.282h5.875l7.531,27.282h0.157l5.687-27.282h7.813l-9.313,39.812h-7.406l-7.313-26.281h-0.156l-7.312,26.281h-7.407l-9.312-39.812zm107.75,0h27.22v6.156h-19.25v10h16.5v6.156h-16.5v11.37h19.28v6.13h-27.25v-39.812zm-34.56,51.502c4.37,0,7.93,1.17,10.68,3.5,2.76,2.32,4.09,5.18,4,8.59l-0.06,0.16h-7.75c0-1.84-0.61-3.33-1.84-4.47s-2.97-1.69-5.19-1.69c-2.133,0-3.771,0.46-4.938,1.41-1.166,0.95-1.75,2.18-1.75,3.65,0,1.35,0.627,2.45,1.876,3.32,1.248,0.86,3.406,1.78,6.472,2.75,4.39,1.22,7.7,2.83,9.97,4.84,2.26,2.01,3.4,4.64,3.4,7.91,0,3.41-1.34,6.09-4.03,8.06s-6.24,2.94-10.66,2.94c-4.335,0-8.113-1.11-11.34-3.35-3.227-2.23-4.81-5.38-4.719-9.4l0.063-0.16h7.75c0,2.37,0.738,4.12,2.187,5.22s3.474,1.66,6.059,1.66c2.17,0,3.82-0.46,4.97-1.35s1.72-2.1,1.72-3.59c0-1.53-0.54-2.76-1.62-3.69-1.09-0.93-2.98-1.8-5.691-2.63-4.74-1.36-8.326-2.99-10.75-4.87-2.425-1.88-3.657-4.42-3.657-7.69,0-3.26,1.408-5.93,4.188-8s6.336-3.12,10.66-3.12z" />
251+
</svg>
252+
<span class="azimuth lfloat" style="display: none">Azimuth: 360.0000</span>
253+
<span class="bearing rfloat" style="display: none">0° N</span>
254+
<span class="elevation lfloat" style="display: none">Elevation: 90.0000</span>
255+
<span class="range rfloat" style="display: none">10000 km</span>
256+
<div class="nopos lfloat" style="display: none">No position available</div>
257+
<div class="nofollow lfloat" style="display: none">No vehicle selected</div>
258+
</div>
259+
248260
<div id="map"></div>
249261

250262
<div id="telemetry_graph" style="display: none">

js/app.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ var positionUpdateHandle = function(position) {
214214
GPS_ts = parseInt(position.timestamp/1000);
215215
$('#cc_timestamp').text('just now');
216216

217+
// update look angles once we get position
218+
if(follow_vehicle > -1) { update_lookangles(follow_vehicle); }
219+
217220
if(CHASE_enabled) {
218221
ChaseCar.updatePosition(callsign, position);
219222
CHASE_timer = (new Date()).getTime() + 15000;
@@ -597,11 +600,11 @@ $(window).ready(function() {
597600
// The position is displayed in top right corner of the screen
598601
// This should be very handly for in the field tracking
599602
//setTimeout(function() {updateCurrentPosition(50.27533, 3.335166);}, 5000);
600-
if(navigator.geolocation && is_mobile && !embed.enabled) {
603+
if(navigator.geolocation) {
601604
// if we have geolocation services, show the locate me button
602605
// the button pants the map to the user current location
603-
$("#locate-me,.chasecar").show();
604-
$("#locate-me").click(function() {
606+
if(is_mobile && !embed.enabled) $(".chasecar").show();
607+
$("#locate-me").show().click(function() {
605608
if(map && currentPosition) {
606609
// disable following of vehicles
607610
stopFollow();

0 commit comments

Comments
 (0)