forked from organicmaps/organicmaps
[search] Introduce GetFeatureViewport().
This commit is contained in:
parent
739cea51ca
commit
76516bb7f5
4 changed files with 21 additions and 1 deletions
6
indexer/feature_rect.cpp
Normal file
6
indexer/feature_rect.cpp
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include "feature_rect.hpp"
|
||||
|
||||
m2::RectD feature::GetFeatureViewport(FeatureType const & feature)
|
||||
{
|
||||
return feature.GetLimitRect(-1);
|
||||
}
|
11
indexer/feature_rect.hpp
Normal file
11
indexer/feature_rect.hpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#pragma once
|
||||
#include "feature.hpp"
|
||||
#include "../geometry/rect2d.hpp"
|
||||
|
||||
namespace feature
|
||||
{
|
||||
|
||||
// Get viewport to show given feature. Used in search.
|
||||
m2::RectD GetFeatureViewport(FeatureType const & feature);
|
||||
|
||||
} // namespace feature
|
|
@ -29,6 +29,7 @@ SOURCES += \
|
|||
geometry_serialization.cpp \
|
||||
tesselator.cpp \
|
||||
feature_data.cpp \
|
||||
feature_rect.cpp \
|
||||
|
||||
HEADERS += \
|
||||
feature.hpp \
|
||||
|
@ -62,3 +63,4 @@ HEADERS += \
|
|||
tesselator.hpp \
|
||||
tesselator_decl.hpp \
|
||||
feature_data.hpp \
|
||||
feature_rect.hpp \
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "intermediate_result.hpp"
|
||||
#include "../indexer/feature_rect.hpp"
|
||||
#include "../indexer/feature_visibility.hpp"
|
||||
#include "../base/string_utils.hpp"
|
||||
|
||||
|
@ -10,7 +11,7 @@ namespace impl
|
|||
IntermediateResult::IntermediateResult(FeatureType const & feature,
|
||||
string const & displayName,
|
||||
int matchPenalty)
|
||||
: m_str(displayName), m_rect(feature.GetLimitRect(-1)), m_matchPenalty(matchPenalty),
|
||||
: m_str(displayName), m_rect(feature::GetFeatureViewport(feature)), m_matchPenalty(matchPenalty),
|
||||
m_minDrawZoomLevel(feature::MinDrawableScaleForFeature(feature))
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue