As discussed on the mailing list, make the 'nearest' GPS command use scratch lat/lon as the search origin if they are valid.
This commit is contained in:
parent
c453d1a0cc
commit
35cb89626e
1 changed files with 7 additions and 2 deletions
|
@ -1428,10 +1428,15 @@ void GPS::loadNearest()
|
|||
int limitCount = _scratchNode->getIntValue("max-results", 1);
|
||||
double cutoffDistance = _scratchNode->getDoubleValue("cutoff-nm", 400.0);
|
||||
|
||||
SGGeod searchPos = _indicated_pos;
|
||||
if (isScratchPositionValid()) {
|
||||
searchPos = _scratchPos;
|
||||
}
|
||||
|
||||
clearScratch(); // clear now, regardless of whether we find a match or not
|
||||
|
||||
_searchResults =
|
||||
FGPositioned::findClosestN(_indicated_pos, limitCount, cutoffDistance, f.get());
|
||||
FGPositioned::findClosestN(searchPos, limitCount, cutoffDistance, f.get());
|
||||
_searchResultsCached = true;
|
||||
_searchResultIndex = 0;
|
||||
_searchIsRoute = false;
|
||||
|
|
Loading…
Reference in a new issue