o Added the enabled flag to RMAnnotation
Showing
7 changed files
with
10 additions
and
10 deletions
@@ -39,6 +39,7 @@ | @@ -39,6 +39,7 @@ | ||
39 | RMProjectedPoint projectedLocation; | 39 | RMProjectedPoint projectedLocation; |
40 | RMProjectedRect projectedBoundingBox; | 40 | RMProjectedRect projectedBoundingBox; |
41 | BOOL hasBoundingBox; | 41 | BOOL hasBoundingBox; |
42 | + BOOL enabled; | ||
42 | 43 | ||
43 | RMMapLayer *layer; | 44 | RMMapLayer *layer; |
44 | RMQuadTreeNode *quadTreeNode; | 45 | RMQuadTreeNode *quadTreeNode; |
@@ -62,6 +63,7 @@ | @@ -62,6 +63,7 @@ | ||
62 | @property (nonatomic, assign) RMProjectedPoint projectedLocation; // in projected meters | 63 | @property (nonatomic, assign) RMProjectedPoint projectedLocation; // in projected meters |
63 | @property (nonatomic, assign) RMProjectedRect projectedBoundingBox; | 64 | @property (nonatomic, assign) RMProjectedRect projectedBoundingBox; |
64 | @property (nonatomic, assign) BOOL hasBoundingBox; | 65 | @property (nonatomic, assign) BOOL hasBoundingBox; |
66 | +@property (nonatomic, assign) BOOL enabled; | ||
65 | 67 | ||
66 | // RMMarker, RMPath, whatever you return in your delegate method mapView:layerForAnnotation: | 68 | // RMMarker, RMPath, whatever you return in your delegate method mapView:layerForAnnotation: |
67 | @property (nonatomic, retain) RMMapLayer *layer; | 69 | @property (nonatomic, retain) RMMapLayer *layer; |
@@ -48,6 +48,7 @@ | @@ -48,6 +48,7 @@ | ||
48 | @synthesize projectedLocation; | 48 | @synthesize projectedLocation; |
49 | @synthesize projectedBoundingBox; | 49 | @synthesize projectedBoundingBox; |
50 | @synthesize hasBoundingBox; | 50 | @synthesize hasBoundingBox; |
51 | +@synthesize enabled; | ||
51 | @synthesize position; | 52 | @synthesize position; |
52 | @synthesize layer; | 53 | @synthesize layer; |
53 | @synthesize quadTreeNode; | 54 | @synthesize quadTreeNode; |
@@ -73,6 +74,7 @@ | @@ -73,6 +74,7 @@ | ||
73 | self.annotationIcon = nil; | 74 | self.annotationIcon = nil; |
74 | self.anchorPoint = CGPointZero; | 75 | self.anchorPoint = CGPointZero; |
75 | self.hasBoundingBox = NO; | 76 | self.hasBoundingBox = NO; |
77 | + self.enabled = YES; | ||
76 | 78 | ||
77 | return self; | 79 | return self; |
78 | } | 80 | } |
@@ -40,7 +40,6 @@ | @@ -40,7 +40,6 @@ | ||
40 | RMProjectedPoint projectedLocation; | 40 | RMProjectedPoint projectedLocation; |
41 | 41 | ||
42 | BOOL enableDragging; | 42 | BOOL enableDragging; |
43 | - BOOL enableRotation; | ||
44 | 43 | ||
45 | /// provided for storage of arbitrary user data | 44 | /// provided for storage of arbitrary user data |
46 | id userInfo; | 45 | id userInfo; |
@@ -49,7 +48,6 @@ | @@ -49,7 +48,6 @@ | ||
49 | @property (nonatomic, assign) RMAnnotation *annotation; | 48 | @property (nonatomic, assign) RMAnnotation *annotation; |
50 | @property (nonatomic, assign) RMProjectedPoint projectedLocation; | 49 | @property (nonatomic, assign) RMProjectedPoint projectedLocation; |
51 | @property (nonatomic, assign) BOOL enableDragging; | 50 | @property (nonatomic, assign) BOOL enableDragging; |
52 | -@property (nonatomic, assign) BOOL enableRotation; | ||
53 | @property (nonatomic, retain) id userInfo; | 51 | @property (nonatomic, retain) id userInfo; |
54 | 52 | ||
55 | @end | 53 | @end |
@@ -33,7 +33,6 @@ | @@ -33,7 +33,6 @@ | ||
33 | @synthesize annotation; | 33 | @synthesize annotation; |
34 | @synthesize projectedLocation; | 34 | @synthesize projectedLocation; |
35 | @synthesize enableDragging; | 35 | @synthesize enableDragging; |
36 | -@synthesize enableRotation; | ||
37 | @synthesize userInfo; | 36 | @synthesize userInfo; |
38 | 37 | ||
39 | - (id)init | 38 | - (id)init |
@@ -43,7 +42,6 @@ | @@ -43,7 +42,6 @@ | ||
43 | 42 | ||
44 | self.annotation = nil; | 43 | self.annotation = nil; |
45 | self.enableDragging = YES; | 44 | self.enableDragging = YES; |
46 | - self.enableRotation = YES; | ||
47 | 45 | ||
48 | return self; | 46 | return self; |
49 | } | 47 | } |
@@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
8 | 8 | ||
9 | #import "RMMapOverlayView.h" | 9 | #import "RMMapOverlayView.h" |
10 | #import "RMMarker.h" | 10 | #import "RMMarker.h" |
11 | +#import "RMAnnotation.h" | ||
11 | #import "RMPixel.h" | 12 | #import "RMPixel.h" |
12 | 13 | ||
13 | @interface RMMapOverlayView () | 14 | @interface RMMapOverlayView () |
@@ -86,7 +87,7 @@ | @@ -86,7 +87,7 @@ | ||
86 | return NO; | 87 | return NO; |
87 | } | 88 | } |
88 | 89 | ||
89 | - return YES; | 90 | + return ((RMMarker *)hit).annotation.enabled; |
90 | } | 91 | } |
91 | 92 | ||
92 | - (void)handleSingleTap:(UIGestureRecognizer *)recognizer | 93 | - (void)handleSingleTap:(UIGestureRecognizer *)recognizer |
@@ -950,7 +950,7 @@ | @@ -950,7 +950,7 @@ | ||
950 | 950 | ||
951 | - (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView tapOnAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint | 951 | - (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView tapOnAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint |
952 | { | 952 | { |
953 | - if (_delegateHasTapOnAnnotation) { | 953 | + if (_delegateHasTapOnAnnotation && anAnnotation) { |
954 | [delegate tapOnAnnotation:anAnnotation onMap:self]; | 954 | [delegate tapOnAnnotation:anAnnotation onMap:self]; |
955 | } else { | 955 | } else { |
956 | if (_delegateHasSingleTapOnMap) | 956 | if (_delegateHasSingleTapOnMap) |
@@ -960,7 +960,7 @@ | @@ -960,7 +960,7 @@ | ||
960 | 960 | ||
961 | - (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView doubleTapOnAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint | 961 | - (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView doubleTapOnAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint |
962 | { | 962 | { |
963 | - if (_delegateHasDoubleTapOnAnnotation) { | 963 | + if (_delegateHasDoubleTapOnAnnotation && anAnnotation) { |
964 | [delegate doubleTapOnAnnotation:anAnnotation onMap:self]; | 964 | [delegate doubleTapOnAnnotation:anAnnotation onMap:self]; |
965 | } else { | 965 | } else { |
966 | [self zoomInToNextNativeZoomAt:aPoint animated:YES]; | 966 | [self zoomInToNextNativeZoomAt:aPoint animated:YES]; |
@@ -972,7 +972,7 @@ | @@ -972,7 +972,7 @@ | ||
972 | 972 | ||
973 | - (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView tapOnLabelForAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint | 973 | - (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView tapOnLabelForAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint |
974 | { | 974 | { |
975 | - if (_delegateHasTapOnLabelForAnnotation) { | 975 | + if (_delegateHasTapOnLabelForAnnotation && anAnnotation) { |
976 | [delegate tapOnLabelForAnnotation:anAnnotation onMap:self]; | 976 | [delegate tapOnLabelForAnnotation:anAnnotation onMap:self]; |
977 | } else { | 977 | } else { |
978 | if (_delegateHasSingleTapOnMap) | 978 | if (_delegateHasSingleTapOnMap) |
@@ -982,7 +982,7 @@ | @@ -982,7 +982,7 @@ | ||
982 | 982 | ||
983 | - (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView doubleTapOnLabelForAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint | 983 | - (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView doubleTapOnLabelForAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint |
984 | { | 984 | { |
985 | - if (_delegateHasDoubleTapOnLabelForAnnotation) | 985 | + if (_delegateHasDoubleTapOnLabelForAnnotation && anAnnotation) |
986 | [delegate doubleTapOnLabelForAnnotation:anAnnotation onMap:self]; | 986 | [delegate doubleTapOnLabelForAnnotation:anAnnotation onMap:self]; |
987 | else { | 987 | else { |
988 | [self zoomInToNextNativeZoomAt:aPoint animated:YES]; | 988 | [self zoomInToNextNativeZoomAt:aPoint animated:YES]; |
-
Please register or login to post a comment