forked from organicmaps/organicmaps
[iOS] poi tap new logic
This commit is contained in:
parent
4dcb4e6b18
commit
04dde61af9
1 changed files with 7 additions and 11 deletions
|
@ -289,12 +289,18 @@
|
|||
|
||||
- (void) processMapClickAtPoint:(CGPoint)point longClick:(BOOL)isLongClick
|
||||
{
|
||||
BOOL wasBalloonDisplayed;
|
||||
if (m_balloonView.isDisplayed)
|
||||
{
|
||||
[m_balloonView hide];
|
||||
wasBalloonDisplayed = YES;
|
||||
// if (!isLongClick)
|
||||
// return;
|
||||
}
|
||||
else
|
||||
{
|
||||
wasBalloonDisplayed = NO;
|
||||
}
|
||||
|
||||
// Try to check if we've clicked on bookmark
|
||||
Framework & f = GetFramework();
|
||||
|
@ -312,7 +318,7 @@
|
|||
// Check if we've clicked on visible POI
|
||||
Framework::AddressInfo addrInfo;
|
||||
m2::PointD pxPivot;
|
||||
if (f.GetVisiblePOI(pxClicked, pxPivot, addrInfo))
|
||||
if (!wasBalloonDisplayed && f.GetVisiblePOI(pxClicked, pxPivot, addrInfo))
|
||||
{
|
||||
m2::PointD const gPivot = f.PtoG(pxPivot);
|
||||
m_balloonView.globalPosition = CGPointMake(gPivot.x, gPivot.y);
|
||||
|
@ -343,16 +349,6 @@
|
|||
[m_balloonView showInView:self.view atPoint:[(EAGLView *)self.view globalPoint2ViewPoint:m_balloonView.globalPosition]];
|
||||
}
|
||||
|
||||
- (void) onSingleTap:(NSValue *)point
|
||||
{
|
||||
[self processMapClickAtPoint:[point CGPointValue] longClick:NO];
|
||||
}
|
||||
|
||||
- (void) onLongTap:(NSValue *)point
|
||||
{
|
||||
[self processMapClickAtPoint:[point CGPointValue] longClick:YES];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[m_balloonView release];
|
||||
|
|
Loading…
Add table
Reference in a new issue