Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Gorshenin <mipt.vi002@gmail.com>2017-03-14 17:22:09 +0300
committerGitHub <noreply@github.com>2017-03-14 17:22:09 +0300
commit86986738f655917d740c20900812ce604511bb6a (patch)
treeeded6b82912e8adb19fd5168d1b24478afc89149 /map/framework.cpp
parent9dd44224ff8fc923381a143159fb9edc06f57095 (diff)
parent94112b4fc7169a24811d2a0241c45fd726cc7553 (diff)
Merge pull request #5594 from darina/change-style-debug-command
Added debug commands for changing map style.
Diffstat (limited to 'map/framework.cpp')
-rw-r--r--map/framework.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index 1b4961de69..6094a12a64 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -1394,6 +1394,9 @@ string Framework::GetCountryName(m2::PointD const & pt) const
bool Framework::Search(search::SearchParams const & params)
{
+ if (ParseDrapeDebugCommand(params.m_query))
+ return false;
+
auto const mode = params.m_mode;
auto & intent = m_searchIntents[static_cast<size_t>(mode)];
@@ -2868,6 +2871,29 @@ uint32_t GetBestType(FeatureType const & ft)
}
}
+bool Framework::ParseDrapeDebugCommand(std::string const & query)
+{
+ MapStyle desiredStyle = MapStyleCount;
+ if (query == "?dark" || query == "mapstyle:dark")
+ desiredStyle = MapStyleDark;
+ else if (query == "?light" || query == "mapstyle:light")
+ desiredStyle = MapStyleClear;
+ else if (query == "?vdark" || query == "mapstyle:vehicle_dark")
+ desiredStyle = MapStyleVehicleDark;
+ else if (query == "?vlight" || query == "mapstyle:vehicle_light")
+ desiredStyle = MapStyleVehicleClear;
+ else
+ return false;
+
+#if defined(OMIM_OS_ANDROID)
+ MarkMapStyle(desiredStyle);
+#else
+ SetMapStyle(desiredStyle);
+#endif
+
+ return true;
+}
+
bool Framework::ParseEditorDebugCommand(search::SearchParams const & params)
{
if (params.m_query == "?edits")