forked from organicmaps/organicmaps
Bookmark and POI founder method added
This commit is contained in:
parent
82ed42ba10
commit
6f011e1112
2 changed files with 26 additions and 0 deletions
|
@ -1502,6 +1502,23 @@ bool Framework::GetVisiblePOI(m2::PointD const & pxPoint, m2::PointD & pxPivot,
|
|||
return false;
|
||||
}
|
||||
|
||||
Framework::BookmarkOrPoi Framework::GetBookmarkOrPoi(m2::PointD const & pxPoint, m2::PointD & pxPivot, AddressInfo & info, BookmarkAndCategory & bmCat)
|
||||
{
|
||||
bmCat = GetBookmark(pxPoint);
|
||||
if (IsValid(bmCat))
|
||||
return Framework::BOOKMARK;
|
||||
if (GetVisiblePOI(pxPoint, pxPivot, info))
|
||||
{
|
||||
//We need almost the exact position of the bookmark, parameter 0.1 resolves the error in 2 pixels
|
||||
bmCat = GetBookmark(pxPivot, 0.1);
|
||||
if (IsValid(bmCat))
|
||||
return Framework::BOOKMARK;
|
||||
else
|
||||
return Framework::POI;
|
||||
}
|
||||
return Framework::NOTHING_FOUND;
|
||||
}
|
||||
|
||||
Animator & Framework::GetAnimator()
|
||||
{
|
||||
return m_animator;
|
||||
|
|
|
@ -346,6 +346,15 @@ private:
|
|||
public:
|
||||
bool GetVisiblePOI(m2::PointD const & pxPoint, m2::PointD & pxPivot, AddressInfo & info) const;
|
||||
|
||||
enum BookmarkOrPoi
|
||||
{
|
||||
NOTHING_FOUND = 0,
|
||||
BOOKMARK = 1,
|
||||
POI = 2
|
||||
};
|
||||
|
||||
BookmarkOrPoi GetBookmarkOrPoi(m2::PointD const & pxPoint, m2::PointD & pxPivot, AddressInfo & info, BookmarkAndCategory & bmCat);
|
||||
|
||||
virtual void BeginPaint(shared_ptr<PaintEvent> const & e);
|
||||
/// Function for calling from platform dependent-paint function.
|
||||
virtual void DoPaint(shared_ptr<PaintEvent> const & e);
|
||||
|
|
Loading…
Add table
Reference in a new issue