Authored by Thomas Rasch

o Added the enabled flag to RMAnnotation

... ... @@ -39,6 +39,7 @@
RMProjectedPoint projectedLocation;
RMProjectedRect projectedBoundingBox;
BOOL hasBoundingBox;
BOOL enabled;
RMMapLayer *layer;
RMQuadTreeNode *quadTreeNode;
... ... @@ -62,6 +63,7 @@
@property (nonatomic, assign) RMProjectedPoint projectedLocation; // in projected meters
@property (nonatomic, assign) RMProjectedRect projectedBoundingBox;
@property (nonatomic, assign) BOOL hasBoundingBox;
@property (nonatomic, assign) BOOL enabled;
// RMMarker, RMPath, whatever you return in your delegate method mapView:layerForAnnotation:
@property (nonatomic, retain) RMMapLayer *layer;
... ...
... ... @@ -48,6 +48,7 @@
@synthesize projectedLocation;
@synthesize projectedBoundingBox;
@synthesize hasBoundingBox;
@synthesize enabled;
@synthesize position;
@synthesize layer;
@synthesize quadTreeNode;
... ... @@ -73,6 +74,7 @@
self.annotationIcon = nil;
self.anchorPoint = CGPointZero;
self.hasBoundingBox = NO;
self.enabled = YES;
return self;
}
... ...
... ... @@ -63,7 +63,6 @@
scaleLineWidth = NO;
enableDragging = YES;
enableRotation = YES;
circlePath = NULL;
[self updateCirclePath];
... ...
... ... @@ -40,7 +40,6 @@
RMProjectedPoint projectedLocation;
BOOL enableDragging;
BOOL enableRotation;
/// provided for storage of arbitrary user data
id userInfo;
... ... @@ -49,7 +48,6 @@
@property (nonatomic, assign) RMAnnotation *annotation;
@property (nonatomic, assign) RMProjectedPoint projectedLocation;
@property (nonatomic, assign) BOOL enableDragging;
@property (nonatomic, assign) BOOL enableRotation;
@property (nonatomic, retain) id userInfo;
@end
... ...
... ... @@ -33,7 +33,6 @@
@synthesize annotation;
@synthesize projectedLocation;
@synthesize enableDragging;
@synthesize enableRotation;
@synthesize userInfo;
- (id)init
... ... @@ -43,7 +42,6 @@
self.annotation = nil;
self.enableDragging = YES;
self.enableRotation = YES;
return self;
}
... ...
... ... @@ -8,6 +8,7 @@
#import "RMMapOverlayView.h"
#import "RMMarker.h"
#import "RMAnnotation.h"
#import "RMPixel.h"
@interface RMMapOverlayView ()
... ... @@ -86,7 +87,7 @@
return NO;
}
return YES;
return ((RMMarker *)hit).annotation.enabled;
}
- (void)handleSingleTap:(UIGestureRecognizer *)recognizer
... ...
... ... @@ -950,7 +950,7 @@
- (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView tapOnAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint
{
if (_delegateHasTapOnAnnotation) {
if (_delegateHasTapOnAnnotation && anAnnotation) {
[delegate tapOnAnnotation:anAnnotation onMap:self];
} else {
if (_delegateHasSingleTapOnMap)
... ... @@ -960,7 +960,7 @@
- (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView doubleTapOnAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint
{
if (_delegateHasDoubleTapOnAnnotation) {
if (_delegateHasDoubleTapOnAnnotation && anAnnotation) {
[delegate doubleTapOnAnnotation:anAnnotation onMap:self];
} else {
[self zoomInToNextNativeZoomAt:aPoint animated:YES];
... ... @@ -972,7 +972,7 @@
- (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView tapOnLabelForAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint
{
if (_delegateHasTapOnLabelForAnnotation) {
if (_delegateHasTapOnLabelForAnnotation && anAnnotation) {
[delegate tapOnLabelForAnnotation:anAnnotation onMap:self];
} else {
if (_delegateHasSingleTapOnMap)
... ... @@ -982,7 +982,7 @@
- (void)mapOverlayView:(RMMapOverlayView *)aMapOverlayView doubleTapOnLabelForAnnotation:(RMAnnotation *)anAnnotation atPoint:(CGPoint)aPoint
{
if (_delegateHasDoubleTapOnLabelForAnnotation)
if (_delegateHasDoubleTapOnLabelForAnnotation && anAnnotation)
[delegate doubleTapOnLabelForAnnotation:anAnnotation onMap:self];
else {
[self zoomInToNextNativeZoomAt:aPoint animated:YES];
... ...