Skip to content
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

Concat longitude and latitude and add location url on Setup tab #3491

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2714,12 +2714,6 @@
"gpsAltitude": {
"message": "Altitude:"
},
"gpsLat": {
"message": "Latitude:"
},
"gpsLon": {
"message": "Longitude:"
},
"gpsHeading": {
"message": "Heading:"
},
Expand Down
13 changes: 6 additions & 7 deletions src/js/tabs/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ setup.initialize = function (callback) {
arming_disable_flags_e = $('.arming-disable-flags'),
gpsFix_e = $('.GPS_info span.colorToggle'),
gpsSats_e = $('.gpsSats'),
gpsLat_e = $('.gpsLat'),
gpsLon_e = $('.gpsLon'),
roll_e = $('dd.roll'),
pitch_e = $('dd.pitch'),
heading_e = $('dd.heading'),
Expand Down Expand Up @@ -428,14 +426,15 @@ setup.initialize = function (callback) {
}

// GPS info is acquired in the background using update_live_status() in serial_backend.js

gpsFix_e.text(FC.GPS_DATA.fix ? i18n.getMessage('gpsFixTrue') : i18n.getMessage('gpsFixFalse'));
gpsFix_e.toggleClass('ready', FC.GPS_DATA.fix != 0);

const gspUnitText = i18n.getMessage('gpsPositionUnit');
gpsSats_e.text(FC.GPS_DATA.numSat);
gpsLat_e.text(`${(FC.GPS_DATA.lat / 10000000).toFixed(4)} ${gspUnitText}`);
gpsLon_e.text(`${(FC.GPS_DATA.lon / 10000000).toFixed(4)} ${gspUnitText}`);

const lat = FC.GPS_DATA.lat / 10000000;
const lon = FC.GPS_DATA.lon / 10000000;
const url = `https://maps.google.com/?q=${lat},${lon}`;
const gpsUnitText = i18n.getMessage('gpsPositionUnit');
$('.GPS_info td.latLon a').prop('href', url).text(`${lat.toFixed(4)} ${gpsUnitText} / ${lon.toFixed(4)} ${gpsUnitText}`);
}

function get_fast_data() {
Expand Down
8 changes: 2 additions & 6 deletions src/tabs/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,8 @@
<td class="gpsSats"></td>
</tr>
<tr>
<td i18n="gpsLat"></td>
<td class="gpsLat"></td>
</tr>
<tr class="noboarder">
<td i18n="gpsLon"></td>
<td class="gpsLon"></td>
<td i18n="gpsLatLon"></td>
<td class="latLon"><a href="#" target="_blank">0.0000 deg</a></td>
HThuren marked this conversation as resolved.
Show resolved Hide resolved
</tr>
</tbody>
</table>
Expand Down