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 <y@maps.me>2017-11-01 18:05:33 +0300
committermpimenov <mpimenov@users.noreply.github.com>2017-11-01 18:23:24 +0300
commitd96212bc1f904b7b08342121cb009377e15f6d79 (patch)
treeb4fa8e3041a5deff77527fa8b8727f4fbfbebd68
parent4604db2aaefa24854ef3100a1f2aa59502418fd6 (diff)
[search] Fixed dancing search results.
-rw-r--r--android/jni/com/mapswithme/maps/MapManager.cpp1
-rw-r--r--map/framework.cpp11
-rw-r--r--map/framework.hpp2
3 files changed, 8 insertions, 6 deletions
diff --git a/android/jni/com/mapswithme/maps/MapManager.cpp b/android/jni/com/mapswithme/maps/MapManager.cpp
index 03a0efe283..8c2c98ddae 100644
--- a/android/jni/com/mapswithme/maps/MapManager.cpp
+++ b/android/jni/com/mapswithme/maps/MapManager.cpp
@@ -4,6 +4,7 @@
#include "coding/internal/file_data.hpp"
+#include "storage/country_info_getter.hpp"
#include "storage/storage.hpp"
#include "storage/storage_helpers.hpp"
diff --git a/map/framework.cpp b/map/framework.cpp
index 11cb3d01fa..973bd1af6a 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -285,6 +285,8 @@ void Framework::OnViewportChanged(ScreenBase const & screen)
{
m_currentModelView = screen;
+ auto const forceSearchInViewport = !m_isViewportInitialized;
+
if (!m_isViewportInitialized)
{
m_isViewportInitialized = true;
@@ -300,7 +302,7 @@ void Framework::OnViewportChanged(ScreenBase const & screen)
}
}
- PokeSearchInViewport();
+ PokeSearchInViewport(forceSearchInViewport);
m_trafficManager.UpdateViewport(m_currentModelView);
m_localAdsManager.UpdateViewport(m_currentModelView);
@@ -1326,16 +1328,15 @@ void Framework::SetCurrentCountryChangedListener(TCurrentCountryChanged const &
m_lastReportedCountry = kInvalidCountryId;
}
-void Framework::PokeSearchInViewport()
+void Framework::PokeSearchInViewport(bool forceSearch)
{
if (!m_isViewportInitialized || !IsViewportSearchActive())
return;
- auto & intent = m_searchIntents[static_cast<size_t>(search::Mode::Viewport)];
- auto & params = intent.m_params;
+ auto params = m_searchIntents[static_cast<size_t>(search::Mode::Viewport)].m_params;
SetViewportIfPossible(params);
SetCurrentPositionIfPossible(params);
- Search(intent);
+ Search(params, forceSearch);
}
bool Framework::SearchEverywhere(search::EverywhereSearchParams const & params)
diff --git a/map/framework.hpp b/map/framework.hpp
index c0f3a104b2..4c1777de74 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -557,7 +557,7 @@ public:
// When search in viewport is active or delayed, restarts search in
// viewport.
- void PokeSearchInViewport();
+ void PokeSearchInViewport(bool forceSearch = true);
// Search everywhere.
bool SearchEverywhere(search::EverywhereSearchParams const & params);