diff --git a/defines.hpp b/defines.hpp index 765fc73c52..c545b279d5 100644 --- a/defines.hpp +++ b/defines.hpp @@ -32,6 +32,7 @@ //Secret word to unlock experimental features in production builds #define ROUTING_SECRET_UNLOCKING_WORD "?ariadna" +#define ROUTING_SECRET_LOCKING_WORD "?minos" #define READY_FILE_EXTENSION ".ready" #define RESUME_FILE_EXTENSION ".resume3" diff --git a/map/framework.cpp b/map/framework.cpp index 80fccd0e66..fd147fd9da 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -276,11 +276,14 @@ Framework::Framework() m_storage.Init(bind(&Framework::UpdateAfterDownload, this, _1, _2)); LOG(LDEBUG, ("Storage initialized")); +#ifdef DEBUG m_routingSession.SetRouter(unique_ptr(new AStarRouter(&m_model.GetIndex()))); - /*m_routingSession.SetRouter(new OsrmRouter(&m_model.GetIndex(), [this] (m2::PointD const & pt) +#else + m_routingSession.SetRouter(unique_ptr(new OsrmRouter(&m_model.GetIndex(), [this] (m2::PointD const & pt) { return GetSearchEngine()->GetCountryFile(pt); - }));*/ + }))); +#endif LOG(LDEBUG, ("Routing engine initialized")); LOG(LINFO, ("System languages:", languages::GetPreferred())); @@ -1234,10 +1237,19 @@ bool Framework::Search(search::SearchParams const & params) { if (params.m_query == ROUTING_SECRET_UNLOCKING_WORD) { - LOG(LINFO, ("Cross mwm routing mode enabled")); - m_routingSession.ActivateAdditionalFeatures(); + LOG(LINFO, ("Pedestrian routing mode enabled")); + //m_routingSession.ActivateAdditionalFeatures(); + m_routingSession.SetRouter(unique_ptr(new AStarRouter(&m_model.GetIndex()))); return false; } + if (params.m_query == ROUTING_SECRET_LOCKING_WORD) + { + m_routingSession.SetRouter(unique_ptr(new OsrmRouter(&m_model.GetIndex(), [this] (m2::PointD const & pt) + { + return GetSearchEngine()->GetCountryFile(pt); + }))); + LOG(LINFO, ("Vehicle routing mode enabled")); + } #ifdef FIXED_LOCATION search::SearchParams rParams(params); if (params.IsValidPosition())