lat/lon values in gps tab are now gmap links

10.3.x-maintenance
cTn 2014-05-06 02:08:55 +02:00
parent 94e0808c0f
commit c3aa3a3fab
3 changed files with 14 additions and 4 deletions

View File

@ -37,3 +37,9 @@
border-bottom: 1px solid silver;
background-color: #ececec;
}
.tab-gps a {
font-weight: bold;
}
.tab-gps a:hover {
text-decoration: underline;
}

View File

@ -12,11 +12,11 @@
</tr>
<tr>
<td>Latitude:</td>
<td class="lat">0.0000 deg</td>
<td class="lat"><a href="#" target="_blank">0.0000 deg</a></td>
</tr>
<tr>
<td>Longitude:</td>
<td class="lon">0.0000 deg</td>
<td class="lon"><a href="#" target="_blank">0.0000 deg</a></td>
</tr>
<tr>
<td>Speed:</td>

View File

@ -18,10 +18,14 @@ function tab_initialize_gps () {
}
function update_ui() {
var lat = GPS_DATA.lat / 100000000;
var lon = GPS_DATA.lon / 100000000;
var url = 'https://maps.google.com/?q=' + lat + ',' + lon;
$('.GPS_info td.fix').html((GPS_DATA.fix) ? '<span style="color: green">True</span>' : '<span style="color: red">False</span>');
$('.GPS_info td.alt').text(GPS_DATA.alt + ' m');
$('.GPS_info td.lat').text((GPS_DATA.lat / 10000000).toFixed(4) + ' deg');
$('.GPS_info td.lon').text((GPS_DATA.lon / 10000000).toFixed(4) + ' deg');
$('.GPS_info td.lat a').prop('href', url).text(lat.toFixed(4) + ' deg');
$('.GPS_info td.lon a').prop('href', url).text(lon.toFixed(4) + ' deg');
$('.GPS_info td.speed').text(GPS_DATA.speed + ' cm/s');
$('.GPS_info td.sats').text(GPS_DATA.numSat);
$('.GPS_info td.distToHome').text(GPS_DATA.distanceToHome + ' m');