fixes #42: allow for simultaneous pan, pinch, and rotate
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <llmr/llmr.hpp>
|
||||
#include <llmr/platform/platform.hpp>
|
||||
|
||||
@interface MBXViewController ()
|
||||
@interface MBXViewController () <UIGestureRecognizerDelegate>
|
||||
|
||||
@property (nonatomic) EAGLContext *context;
|
||||
@property (nonatomic) CGPoint center;
|
||||
@@ -83,6 +83,7 @@ class MBXMapView
|
||||
mapView->init();
|
||||
|
||||
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
|
||||
pan.delegate = self;
|
||||
[self.view addGestureRecognizer:pan];
|
||||
|
||||
UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTapGesture:)];
|
||||
@@ -105,9 +106,11 @@ class MBXMapView
|
||||
[self.view addGestureRecognizer:threeFingerLongPress];
|
||||
|
||||
UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
|
||||
pinch.delegate = self;
|
||||
[self.view addGestureRecognizer:pinch];
|
||||
|
||||
UIRotationGestureRecognizer *rotate = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(handleRotateGesture:)];
|
||||
rotate.delegate = self;
|
||||
[self.view addGestureRecognizer:rotate];
|
||||
}
|
||||
|
||||
@@ -209,6 +212,11 @@ class MBXMapView
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
CADisplayLink *displayLink;
|
||||
MBXMapView *mapView;
|
||||
NSOperationQueue *queue;
|
||||
|
||||
Reference in New Issue
Block a user