From 32ffa663dedbf16e691f8f15bd49ea53eb9464a7 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:37:42 +0100 Subject: [PATCH 1/2] fix safehome lat/lon edits --- tabs/mission_control.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tabs/mission_control.js b/tabs/mission_control.js index 2161416c..0579292d 100644 --- a/tabs/mission_control.js +++ b/tabs/mission_control.js @@ -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(); @@ -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(); @@ -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. From 11c1bc5763809c6097859303e0ba73233713efb2 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:49:11 +0100 Subject: [PATCH 2/2] Update mission_control.js --- tabs/mission_control.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tabs/mission_control.js b/tabs/mission_control.js index 0579292d..c4454eec 100644 --- a/tabs/mission_control.js +++ b/tabs/mission_control.js @@ -4154,7 +4154,6 @@ 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.