From 261b6161f2554520781d33183b8560613ef184ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Sat, 18 Apr 2015 23:01:42 -0700 Subject: Cancel animations on touch down Cancel any map animations as soon as a finger is set upon the screen. Fixes #1258. --- platform/ios/MGLMapView.mm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'platform') diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 5acf04ef79..1b50146a67 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -647,6 +647,15 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr; #pragma clang diagnostic pop +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + (void)touches; + (void)event; + mbglMap->cancelTransitions(); + mbglMap->setGestureInProgress(false); + self.animatingGesture = NO; +} + - (void)handlePanGesture:(UIPanGestureRecognizer *)pan { if ( ! self.isScrollEnabled) return; -- cgit v1.2.1