diff --git a/locales/en/messages.json b/locales/en/messages.json index 163a47e8..8022ab80 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -2957,9 +2957,13 @@ "gpsAltitude": { "message": "Altitude:" }, - "gpsLatLon": { - "message": "Current Latitude / Longitude:", - "description": "Show GPS position - Latitude / Longitude" + "gpsLatitude": { + "message": "Latitude:", + "description": "Show GPS position - Latitude" + }, + "gpsLongitude": { + "message": "Longitude:", + "description": "Show GPS position - Longitude" }, "gpsHeading": { "message": "Heading IMU / GPS:", diff --git a/src/js/VirtualFC.js b/src/js/VirtualFC.js index 10e983ee..26e1a3a5 100644 --- a/src/js/VirtualFC.js +++ b/src/js/VirtualFC.js @@ -321,8 +321,8 @@ const VirtualFC = { const sampleGpsData = { fix: 2, numSat: 10, - lat: 474919409, - lon: 190539766, + latitude: 474919409, + longitude: 190539766, alt: 0, speed: 0, ground_course: 1337, diff --git a/src/js/fc.js b/src/js/fc.js index b3fe4623..bf7a71a6 100644 --- a/src/js/fc.js +++ b/src/js/fc.js @@ -342,8 +342,8 @@ const FC = { this.GPS_DATA = { fix: 0, numSat: 0, - lat: 0, - lon: 0, + latitude: 0, + longitude: 0, alt: 0, speed: 0, ground_course: 0, diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index f34cb744..38a01ae6 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -309,8 +309,8 @@ MspHelper.prototype.process_data = function (dataHandler) { case MSPCodes.MSP_RAW_GPS: FC.GPS_DATA.fix = data.readU8(); FC.GPS_DATA.numSat = data.readU8(); - FC.GPS_DATA.lat = data.read32(); - FC.GPS_DATA.lon = data.read32(); + FC.GPS_DATA.latitude = data.read32(); + FC.GPS_DATA.longitude = data.read32(); FC.GPS_DATA.alt = data.readU16(); FC.GPS_DATA.speed = data.readU16(); FC.GPS_DATA.ground_course = data.readU16(); diff --git a/src/js/tabs/gps.js b/src/js/tabs/gps.js index 9d1024cd..5336ced9 100644 --- a/src/js/tabs/gps.js +++ b/src/js/tabs/gps.js @@ -334,9 +334,9 @@ gps.initialize = async function (callback) { } function update_ui() { - const lat = FC.GPS_DATA.lat / 10000000; - const lon = FC.GPS_DATA.lon / 10000000; - const url = `https://maps.google.com/?q=${lat},${lon}`; + const latitude = FC.GPS_DATA.latitude / 10000000; + const longitude = FC.GPS_DATA.longitude / 10000000; + const url = `https://maps.google.com/?q=${latitude},${longitude}`; const imuHeadingDegrees = FC.SENSOR_DATA.kinematics[2]; // Convert to radians and add 180 degrees to make icon point in the right direction const imuHeadingRadians = ((imuHeadingDegrees + 180) * Math.PI) / 180; @@ -353,9 +353,12 @@ gps.initialize = async function (callback) { const gpsUnitText = i18n.getMessage("gpsPositionUnit"); $(".GPS_info td.alt").text(`${alt} m`); - $(".GPS_info td.latLon a") + $(".GPS_info td.latitude a") .prop("href", url) - .text(`${lat.toFixed(6)} / ${lon.toFixed(6)} ${gpsUnitText}`); + .text(`${latitude.toFixed(6)} ${gpsUnitText}`); + $(".GPS_info td.longitude a") + .prop("href", url) + .text(`${longitude.toFixed(6)} ${gpsUnitText}`); $(".GPS_info td.heading").text(`${imuHeadingDegrees.toFixed(0)} / ${gpsHeading.toFixed(0)} ${gpsUnitText}`); $(".GPS_info td.speed").text(`${FC.GPS_DATA.speed} cm/s`); $(".GPS_info td.sats").text(FC.GPS_DATA.numSat); @@ -384,12 +387,12 @@ gps.initialize = async function (callback) { if (ispConnected()) { $("#connect").hide(); - gpsFoundPosition = !!(lon && lat); + gpsFoundPosition = !!(longitude && latitude); if (gpsFoundPosition) { (hasMag ? iconStyleMag : iconStyleGPS).getImage().setRotation(imuHeadingRadians); iconFeature.setStyle(hasMag ? iconStyleMag : iconStyleGPS); - const center = fromLonLat([lon, lat]); + const center = fromLonLat([longitude, latitude]); mapView.setCenter(center); iconGeometry.setCoordinates(center); } else { diff --git a/src/js/tabs/setup.js b/src/js/tabs/setup.js index af80fb27..fa15264d 100644 --- a/src/js/tabs/setup.js +++ b/src/js/tabs/setup.js @@ -524,13 +524,16 @@ setup.initialize = function (callback) { gpsFix_e.toggleClass("ready", FC.GPS_DATA.fix != 0); gpsSats_e.text(FC.GPS_DATA.numSat); - const lat = FC.GPS_DATA.lat / 10000000; - const lon = FC.GPS_DATA.lon / 10000000; - const url = `https://maps.google.com/?q=${lat},${lon}`; + const latitude = FC.GPS_DATA.latitude / 10000000; + const longitude = FC.GPS_DATA.longitude / 10000000; + const url = `https://maps.google.com/?q=${latitude},${longitude}`; const gpsUnitText = i18n.getMessage("gpsPositionUnit"); - $(".GPS_info td.latLon a") + $(".GPS_info td.latitude a") .prop("href", url) - .text(`${lat.toFixed(4)} / ${lon.toFixed(4)} ${gpsUnitText}`); + .text(`${latitude.toFixed(4)} ${gpsUnitText}`); + $(".GPS_info td.longitude a") + .prop("href", url) + .text(`${longitude.toFixed(4)} ${gpsUnitText}`); } function get_fast_data() { diff --git a/src/tabs/gps.html b/src/tabs/gps.html index 6a49c81e..a75b0b06 100755 --- a/src/tabs/gps.html +++ b/src/tabs/gps.html @@ -114,8 +114,12 @@ - - 0.0000 deg + + 0.0000 deg + + + + 0.0000 deg diff --git a/src/tabs/setup.html b/src/tabs/setup.html index 234a76e0..c6675b29 100644 --- a/src/tabs/setup.html +++ b/src/tabs/setup.html @@ -112,8 +112,12 @@ - - 0.0000 deg + + 0.0000 deg + + + + 0.0000 deg