////////////////////////////////////////////////////////////////////////////
GPS::GPS ( SGPropertyNode *node) :
+ _selectedCourse(0.0),
_dataValid(false),
_lastPosValid(false),
_mode("init"),
if (_dataValid && (_mode == "init")) {
// allow a realistic delay in the future, here
SG_LOG(SG_INSTR, SG_INFO, "GPS initialisation complete");
+
+ _selectedCourse = _config.getExternalCourse();
+
if (_route_active_node->getBoolValue()) {
// GPS init with active route
SG_LOG(SG_INSTR, SG_INFO, "GPS init with active route");
string sty(_scratchNode->getStringValue("type"));
_searchType = FGPositioned::typeFromName(sty);
_searchQuery = _scratchNode->getStringValue("query");
+ if (_searchQuery.empty()) {
+ SG_LOG(SG_INSTR, SG_WARN, "empty GPS search query");
+ clearScratch();
+ return;
+ }
+
_searchExact = _scratchNode->getBoolValue("exact", true);
_searchOrderByRange = _scratchNode->getBoolValue("order-by-distance", true);
_searchResultIndex = 0;