forked from organicmaps/organicmaps
[search] Honor original onResults callback.
This commit is contained in:
parent
9c128b3a9f
commit
06a0e70e38
2 changed files with 10 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue