Skip to content

Commit

Permalink
FlighPlanner: Fix map moving to 0,0 when HomeLocation clicked without…
Browse files Browse the repository at this point in the history
… valid Home Location (#3367)
  • Loading branch information
EosBandi committed Jun 18, 2024
1 parent e49ec4c commit 955c5a6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion GCSViews/FlightPlanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8006,7 +8006,15 @@ private void zoomToMissionToolStripMenuItem_Click(object sender, EventArgs e)

private void zoomToHomeToolStripMenuItem_Click(object sender, EventArgs e)
{
MainMap.Position = MainV2.comPort.MAV.cs.HomeLocation;
if (MainV2.comPort.MAV.cs.HomeLocation.Lat != 0 && MainV2.comPort.MAV.cs.HomeLocation.Lng != 0)
{
MainMap.Position = MainV2.comPort.MAV.cs.HomeLocation;
}
else if (MainV2.comPort.MAV.cs.PlannedHomeLocation.Lat != 0 && MainV2.comPort.MAV.cs.PlannedHomeLocation.Lat != 0)
{
MainMap.Position = MainV2.comPort.MAV.cs.PlannedHomeLocation;
}

if (MainMap.Zoom < 17)
MainMap.Zoom = 17;
}
Expand Down

0 comments on commit 955c5a6

Please sign in to comment.