forked from organicmaps/organicmaps
PR fixes
This commit is contained in:
parent
389d00224b
commit
3b61add6ed
2 changed files with 8 additions and 7 deletions
|
@ -2326,14 +2326,16 @@ RouterType Framework::GetBestRouter(m2::PointD const & startPoint, m2::PointD co
|
|||
return RouterType::Pedestrian;
|
||||
else
|
||||
{
|
||||
// Return on short calls the vehicle router flag only if we are already have routing files.
|
||||
// Return on a short distance the vehicle router flag only if we are already have routing files.
|
||||
auto countryFileGetter = [this](m2::PointD const & p)
|
||||
{
|
||||
return GetSearchEngine()->GetCountryFile(p);
|
||||
};
|
||||
if (!OsrmRouter::CheckRoutingAbility(startPoint, finalPoint, countryFileGetter,
|
||||
&m_model.GetIndex()))
|
||||
{
|
||||
return RouterType::Pedestrian;
|
||||
}
|
||||
}
|
||||
}
|
||||
return RouterType::Vehicle;
|
||||
|
|
|
@ -335,13 +335,12 @@ private:
|
|||
} // namespace
|
||||
|
||||
// static
|
||||
bool OsrmRouter::CheckRoutingAbility(m2::PointD const & startPoint,
|
||||
m2::PointD const & finalPoint,
|
||||
TCountryFileFn const & countryFileFn, Index * index)
|
||||
bool OsrmRouter::CheckRoutingAbility(m2::PointD const & startPoint, m2::PointD const & finalPoint,
|
||||
TCountryFileFn const & countryFileFn, Index * index)
|
||||
{
|
||||
RoutingIndexManager manager(countryFileFn, index);
|
||||
return manager.GetMappingByPoint(startPoint)->IsValid() &&
|
||||
manager.GetMappingByPoint(finalPoint)->IsValid();
|
||||
RoutingIndexManager manager(countryFileFn, index);
|
||||
return manager.GetMappingByPoint(startPoint)->IsValid() &&
|
||||
manager.GetMappingByPoint(finalPoint)->IsValid();
|
||||
}
|
||||
|
||||
OsrmRouter::OsrmRouter(Index * index, TCountryFileFn const & countryFileFn)
|
||||
|
|
Loading…
Add table
Reference in a new issue