Skip to content

Commit bd7d203

Browse files
fully working lookangles
1 parent 9a40a57 commit bd7d203

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

css/main.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ body {
6666
line-height: 14px;
6767
}
6868

69+
.slickbox div {
70+
font-size: 14px;
71+
margin-top: 3px;
72+
width: 180px;
73+
text-align: center;
74+
}
75+
6976
.slickbox svg path {
7077
-webkit-transition: all 0.4s ease-in-out;
7178
-moz-transition: all 0.4s ease-in-out;

index.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,12 @@ <h2>Chase car mode</h2>
249249
<svg width="40" height="40" viewbox="0 0 200 200" version="1.1" class="lfloat">
250250
<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" />
251251
</svg>
252-
<span class="azimuth lfloat">Azimuth: 360.0000</span>
253-
<span class="bearing rfloat">0° N</span>
254-
<span class="elevation lfloat">Elevation: 90.0000</span>
255-
<span class="range rfloat">10000 km</span>
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>
256258
</div>
257259

258260
<div id="map"></div>

js/app.js

Lines changed: 3 additions & 0 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;

js/tracker.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ function calculate_lookangles(a, b) {
132132
}
133133

134134
function update_lookangles(idx) {
135+
if(GPS_ts == null) { return; }
136+
else if($("#lookanglesbox span").first().is(":hidden")) {
137+
$("#lookanglesbox div").hide().parent().find("span").show();
138+
}
139+
135140
var a = {lat: GPS_lat, lon: GPS_lon, alt: GPS_alt};
136141

137142
var xref = vehicles[idx].curr_position;
@@ -203,7 +208,11 @@ function load() {
203208

204209
// animate lookanglesbox, delayed start by 300ms
205210
$("#lookanglesbox").delay(200).fadeIn(500,"easeOut").animate({width:origW},400,"easeOut", function() {
206-
$("#lookanglesbox span").fadeIn(500, "easeOut");
211+
if(GPS_ts == null) {
212+
$("#lookanglesbox .nopos").fadeIn(500, "easeOut");
213+
} else if($("#lookanglesbox span:first").is(":hidden")) {
214+
$("#lookanglesbox .nofollow").fadeIn(500, "easeOut");
215+
}
207216
});
208217
}, 500);
209218

@@ -365,6 +374,9 @@ function stopFollow() {
365374
// reset nite overlay
366375
nite.setDate(null);
367376
nite.refresh();
377+
378+
// update lookangles box
379+
$("#lookanglesbox span").hide().parent().find(".nofollow").show();
368380
}
369381
}
370382

0 commit comments

Comments
 (0)