Authored by Thomas Rasch

o Added the enableBouncing property (now defaults to NO) which enables/disables …

…the bouncing effect on the map view (fixes #43)
... ... @@ -103,6 +103,7 @@ typedef enum {
// View properties
@property (nonatomic, assign) BOOL enableDragging;
@property (nonatomic, assign) BOOL enableBouncing;
@property (nonatomic, assign) RMMapDecelerationMode decelerationMode;
@property (nonatomic, assign) CLLocationCoordinate2D centerCoordinate;
... ...
... ... @@ -102,6 +102,8 @@
float _lastZoom;
CGPoint _lastContentOffset, _accumulatedDelta;
BOOL _mapScrollViewIsZooming;
BOOL _enableDragging, _enableBouncing;
}
@synthesize decelerationMode;
... ... @@ -124,7 +126,8 @@
minZoomLevel:(float)minZoomLevel
backgroundImage:(UIImage *)backgroundImage
{
_constrainMovement = NO;
_constrainMovement = _enableBouncing = NO;
_enableDragging = YES;
self.backgroundColor = [UIColor grayColor];
... ... @@ -952,6 +955,9 @@
mapScrollView.showsVerticalScrollIndicator = NO;
mapScrollView.showsHorizontalScrollIndicator = NO;
mapScrollView.scrollsToTop = NO;
mapScrollView.scrollEnabled = _enableDragging;
mapScrollView.bounces = _enableBouncing;
mapScrollView.bouncesZoom = _enableBouncing;
mapScrollView.contentSize = contentSize;
mapScrollView.minimumZoomScale = exp2f([self minZoom]);
mapScrollView.maximumZoomScale = exp2f([self maxZoom]);
... ... @@ -1478,14 +1484,27 @@
- (BOOL)enableDragging
{
return mapScrollView.scrollEnabled;
return _enableDragging;
}
- (void)setEnableDragging:(BOOL)enableDragging
{
_enableDragging = enableDragging;
mapScrollView.scrollEnabled = enableDragging;
}
- (BOOL)enableBouncing
{
return _enableBouncing;
}
- (void)setEnableBouncing:(BOOL)enableBouncing
{
_enableBouncing = enableBouncing;
mapScrollView.bounces = enableBouncing;
mapScrollView.bouncesZoom = enableBouncing;
}
- (void)setAdjustTilesForRetinaDisplay:(BOOL)doAdjustTilesForRetinaDisplay
{
if (adjustTilesForRetinaDisplay == doAdjustTilesForRetinaDisplay)
... ...