Skip to content

Commit

Permalink
fix safehome lat/lon edits
Browse files Browse the repository at this point in the history
  • Loading branch information
mmosca committed Jan 21, 2025
1 parent 7c95d72 commit 32ffa66
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tabs/mission_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -3224,8 +3224,8 @@ TABS.mission_control.initialize = function (callback) {
});

$('#safehomeLatitude').on('change', event => {
if (selectedFwApproachSh) {
selectedFwApproachSh.setLat(Math.round(Number($(event.currentTarget).val()) * 1e7));
if (selectedSafehome && selectedFwApproachSh) {
selectedSafehome.setLat(Math.round(Number($(event.currentTarget).val()) * 1e7));
renderSafeHomeOptions();
cleanSafehomeLayers();
renderSafehomesOnMap();
Expand All @@ -3234,8 +3234,8 @@ TABS.mission_control.initialize = function (callback) {


$('#safehomeLongitude').on('change', event => {
if (selectedFwApproachSh) {
selectedFwApproachSh.setLon(Math.round(Number($(event.currentTarget).val()) * 1e7));
if (selectedSafehome && selectedFwApproachSh) {
selectedSafehome.setLon(Math.round(Number($(event.currentTarget).val()) * 1e7));
renderSafeHomeOptions();
cleanSafehomeLayers();
renderSafehomesOnMap();
Expand Down Expand Up @@ -4154,6 +4154,7 @@ TABS.mission_control.initialize = function (callback) {
function updateSelectedShAndFwAp(index) {
selectedSafehome = FC.SAFEHOMES.get()[index];
selectedFwApproachSh = FC.FW_APPROACH.get()[index];
console.log("Select safe home/approach: " + index)
}

/* resetAltitude = true : For selected WPs only. Changes WP Altitude value back to previous value if setting below ground level.
Expand Down

0 comments on commit 32ffa66

Please sign in to comment.