mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 17:55:24 +03:00
Concat longitude and latitude and add location url on Setup tab (#3491)
This commit is contained in:
parent
25447aef55
commit
532a672047
3 changed files with 8 additions and 19 deletions
|
@ -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'),
|
||||
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue