diff --git a/tabs/gps.css b/tabs/gps.css index 16344066..8097096b 100644 --- a/tabs/gps.css +++ b/tabs/gps.css @@ -36,4 +36,10 @@ border-bottom: 1px solid silver; background-color: #ececec; + } + .tab-gps a { + font-weight: bold; + } + .tab-gps a:hover { + text-decoration: underline; } \ No newline at end of file diff --git a/tabs/gps.html b/tabs/gps.html index a9b2a146..5134d37e 100644 --- a/tabs/gps.html +++ b/tabs/gps.html @@ -12,11 +12,11 @@ Latitude: - 0.0000 deg + 0.0000 deg Longitude: - 0.0000 deg + 0.0000 deg Speed: diff --git a/tabs/gps.js b/tabs/gps.js index be0d25f5..499f1d95 100644 --- a/tabs/gps.js +++ b/tabs/gps.js @@ -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) ? 'True' : 'False'); $('.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');