refs #186: don't begin tap gesture zooms in/out if at max/min zoom
Showing
1 changed file
with
24 additions
and
18 deletions
@@ -1561,21 +1561,24 @@ | @@ -1561,21 +1561,24 @@ | ||
1561 | 1561 | ||
1562 | - (void)doubleTapAtPoint:(CGPoint)aPoint | 1562 | - (void)doubleTapAtPoint:(CGPoint)aPoint |
1563 | { | 1563 | { |
1564 | - [self registerZoomEventByUser:YES]; | ||
1565 | - | ||
1566 | - if (self.zoomingInPivotsAroundCenter) | ||
1567 | - { | ||
1568 | - [self zoomInToNextNativeZoomAt:[self convertPoint:self.center fromView:self.superview] animated:YES]; | ||
1569 | - } | ||
1570 | - else if (self.userTrackingMode != RMUserTrackingModeNone && fabsf(aPoint.x - [self coordinateToPixel:self.userLocation.location.coordinate].x) < 75 && fabsf(aPoint.y - [self coordinateToPixel:self.userLocation.location.coordinate].y) < 75) | 1564 | + if (self.zoom < self.maxZoom) |
1571 | { | 1565 | { |
1572 | - [self zoomInToNextNativeZoomAt:[self coordinateToPixel:self.userLocation.location.coordinate] animated:YES]; | ||
1573 | - } | ||
1574 | - else | ||
1575 | - { | ||
1576 | - [self registerMoveEventByUser:YES]; | 1566 | + [self registerZoomEventByUser:YES]; |
1577 | 1567 | ||
1578 | - [self zoomInToNextNativeZoomAt:aPoint animated:YES]; | 1568 | + if (self.zoomingInPivotsAroundCenter) |
1569 | + { | ||
1570 | + [self zoomInToNextNativeZoomAt:[self convertPoint:self.center fromView:self.superview] animated:YES]; | ||
1571 | + } | ||
1572 | + else if (self.userTrackingMode != RMUserTrackingModeNone && fabsf(aPoint.x - [self coordinateToPixel:self.userLocation.location.coordinate].x) < 75 && fabsf(aPoint.y - [self coordinateToPixel:self.userLocation.location.coordinate].y) < 75) | ||
1573 | + { | ||
1574 | + [self zoomInToNextNativeZoomAt:[self coordinateToPixel:self.userLocation.location.coordinate] animated:YES]; | ||
1575 | + } | ||
1576 | + else | ||
1577 | + { | ||
1578 | + [self registerMoveEventByUser:YES]; | ||
1579 | + | ||
1580 | + [self zoomInToNextNativeZoomAt:aPoint animated:YES]; | ||
1581 | + } | ||
1579 | } | 1582 | } |
1580 | 1583 | ||
1581 | if (_delegateHasDoubleTapOnMap) | 1584 | if (_delegateHasDoubleTapOnMap) |
@@ -1615,14 +1618,17 @@ | @@ -1615,14 +1618,17 @@ | ||
1615 | 1618 | ||
1616 | - (void)handleTwoFingerSingleTap:(UIGestureRecognizer *)recognizer | 1619 | - (void)handleTwoFingerSingleTap:(UIGestureRecognizer *)recognizer |
1617 | { | 1620 | { |
1618 | - [self registerZoomEventByUser:YES]; | 1621 | + if (self.zoom > self.minZoom) |
1622 | + { | ||
1623 | + [self registerZoomEventByUser:YES]; | ||
1619 | 1624 | ||
1620 | - CGPoint centerPoint = [self convertPoint:self.center fromView:self.superview]; | 1625 | + CGPoint centerPoint = [self convertPoint:self.center fromView:self.superview]; |
1621 | 1626 | ||
1622 | - if (self.userTrackingMode != RMUserTrackingModeNone) | ||
1623 | - centerPoint = [self coordinateToPixel:self.userLocation.location.coordinate]; | 1627 | + if (self.userTrackingMode != RMUserTrackingModeNone) |
1628 | + centerPoint = [self coordinateToPixel:self.userLocation.location.coordinate]; | ||
1624 | 1629 | ||
1625 | - [self zoomOutToNextNativeZoomAt:centerPoint animated:YES]; | 1630 | + [self zoomOutToNextNativeZoomAt:centerPoint animated:YES]; |
1631 | + } | ||
1626 | 1632 | ||
1627 | if (_delegateHasSingleTapTwoFingersOnMap) | 1633 | if (_delegateHasSingleTapTwoFingersOnMap) |
1628 | [_delegate singleTapTwoFingersOnMap:self at:[recognizer locationInView:self]]; | 1634 | [_delegate singleTapTwoFingersOnMap:self at:[recognizer locationInView:self]]; |
-
Please register or login to post a comment