[search] Honor original onResults callback.

This commit is contained in:
Yuri Gorshenin 2016-07-15 16:17:33 +03:00
parent 9c128b3a9f
commit 06a0e70e38
2 changed files with 10 additions and 5 deletions

View file

@ -1067,20 +1067,23 @@ void Framework::StartInteractiveSearch(search::SearchParams const & params)
{
using namespace search;
auto const originalOnResults = params.m_onResults;
m_lastInteractiveSearchParams = params;
m_lastInteractiveSearchParams.SetForceSearch(false);
m_lastInteractiveSearchParams.SetMode(search::Mode::Viewport);
m_lastInteractiveSearchParams.SetSuggestsEnabled(false);
m_lastInteractiveSearchParams.m_onResults = [this](Results const & results)
{
m_lastInteractiveSearchParams.m_onResults = [this, originalOnResults](Results const & results) {
if (!results.IsEndMarker())
{
GetPlatform().RunOnGuiThread([this, results]()
{
GetPlatform().RunOnGuiThread([this, results]() {
if (IsInteractiveSearchActive())
FillSearchResultsMarks(results);
});
}
if (originalOnResults)
originalOnResults(results);
};
UpdateUserViewportChanged();
}

View file

@ -8,7 +8,9 @@
namespace search
{
SearchParams::SearchParams()
: m_searchRadiusM(-1.0)
: m_lat(0.0)
, m_lon(0.0)
, m_searchRadiusM(-1.0)
, m_mode(Mode::Everywhere)
, m_forceSearch(false)
, m_validPos(false)