forked from organicmaps/organicmaps
New getter for visible features.
TODO: Refactor existing getters to a common interface.
This commit is contained in:
parent
571fb4bf73
commit
ac79b63b69
2 changed files with 19 additions and 0 deletions
|
@ -1627,6 +1627,23 @@ bool Framework::GetVisiblePOI(m2::PointD const & glbPoint, search::AddressInfo &
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Framework::GetVisiblePOI(m2::PointD const & ptMercator, FeatureType & outPOI) const
|
||||
{
|
||||
ASSERT(m_drapeEngine != nullptr, ());
|
||||
FeatureID const fid = m_drapeEngine->GetVisiblePOI(ptMercator);
|
||||
if (!fid.IsValid())
|
||||
return false;
|
||||
|
||||
// Note: all parse methods should be called with guard alive.
|
||||
Index::FeaturesLoaderGuard guard(m_model.GetIndex(), fid.m_mwmId);
|
||||
guard.GetFeatureByIndex(fid.m_index, outPOI);
|
||||
outPOI.ParseHeader2();
|
||||
outPOI.ParseGeometry(FeatureType::BEST_GEOMETRY);
|
||||
outPOI.ParseTriangles(FeatureType::BEST_GEOMETRY);
|
||||
outPOI.ParseMetadata();
|
||||
return true;
|
||||
}
|
||||
|
||||
m2::PointD Framework::GetVisiblePOI(FeatureID const & id, search::AddressInfo & info, feature::Metadata & metadata) const
|
||||
{
|
||||
ASSERT(id.IsValid(), ());
|
||||
|
|
|
@ -486,6 +486,8 @@ private:
|
|||
|
||||
public:
|
||||
bool GetVisiblePOI(m2::PointD const & glbPoint, search::AddressInfo & info, feature::Metadata & metadata) const;
|
||||
// TODO(AlexZ): Refactor similar getters to share common interface.
|
||||
bool GetVisiblePOI(m2::PointD const & ptMercator, FeatureType & outPOI) const;
|
||||
m2::PointD GetVisiblePOI(FeatureID const & id, search::AddressInfo & info, feature::Metadata & metadata) const;
|
||||
void FindClosestPOIMetadata(m2::PointD const & pt, feature::Metadata & metadata) const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue