Authored by Davigoli

Issue 26: exposing decelerationFactor

@@ -36,6 +36,7 @@ typedef struct { @@ -36,6 +36,7 @@ typedef struct {
36 BOOL enableDragging; 36 BOOL enableDragging;
37 BOOL enableZoom; 37 BOOL enableZoom;
38 RMGestureDetails lastGesture; 38 RMGestureDetails lastGesture;
  39 + float decelerationFactor;
39 } 40 }
40 41
41 // Any other functions you need to manipulate the mapyou can access through this 42 // Any other functions you need to manipulate the mapyou can access through this
@@ -47,6 +48,7 @@ typedef struct { @@ -47,6 +48,7 @@ typedef struct {
47 // do not retain the delegate so you can let the corresponding controller implement the 48 // do not retain the delegate so you can let the corresponding controller implement the
48 // delegate without circular references 49 // delegate without circular references
49 @property (assign) id<RMMapViewDelegate> delegate; 50 @property (assign) id<RMMapViewDelegate> delegate;
  51 +@property (readwrite) float decelerationFactor;
50 52
51 - (id)initWithFrame:(CGRect)frame WithLocation:(CLLocationCoordinate2D)latlong; 53 - (id)initWithFrame:(CGRect)frame WithLocation:(CLLocationCoordinate2D)latlong;
52 54
@@ -40,6 +40,7 @@ @@ -40,6 +40,7 @@
40 @end 40 @end
41 41
42 @implementation RMMapView 42 @implementation RMMapView
  43 +@synthesize decelerationFactor;
43 44
44 -(void) initValues:(CLLocationCoordinate2D)latlong 45 -(void) initValues:(CLLocationCoordinate2D)latlong
45 { 46 {
@@ -54,6 +55,7 @@ @@ -54,6 +55,7 @@
54 55
55 enableDragging = YES; 56 enableDragging = YES;
56 enableZoom = YES; 57 enableZoom = YES;
  58 + decelerationFactor = 0.88f;
57 59
58 // [self recalculateImageSet]; 60 // [self recalculateImageSet];
59 61
@@ -493,8 +495,8 @@ @@ -493,8 +495,8 @@
493 // avoid calling delegate methods? design call here 495 // avoid calling delegate methods? design call here
494 [contents moveBy:decelerationDelta]; 496 [contents moveBy:decelerationDelta];
495 497
496 - decelerationDelta.width *= 0.99f;  
497 - decelerationDelta.height *= 0.99f; 498 + decelerationDelta.width *= [self decelerationFactor];
  499 + decelerationDelta.height *= [self decelerationFactor];
498 } 500 }
499 501
500 - (void)stopDeceleration { 502 - (void)stopDeceleration {