Authored by Justin R. Miller

fixes #99: recognize annotation gestures on user location dot, too

... ... @@ -81,11 +81,21 @@
if ([annotation.annotationType isEqualToString:kRMTrackingHaloAnnotationTypeName])
_trackingHaloAnnotation = annotation;
_userLocationAnnotation.layer.hidden = _accuracyCircleAnnotation.layer.hidden = _trackingHaloAnnotation.layer.hidden = YES;
// here we hide the accuracy circle & tracking halo to exclude from hit
// testing, as well as be sure to show the user location (even if in
// heading mode) to ensure hits on it
//
BOOL flag = _userLocationAnnotation.layer.isHidden;
_userLocationAnnotation.layer.hidden = NO;
_accuracyCircleAnnotation.layer.hidden = _trackingHaloAnnotation.layer.hidden = YES;
CALayer *hit = [self.layer hitTest:point];
_userLocationAnnotation.layer.hidden = _accuracyCircleAnnotation.layer.hidden = _trackingHaloAnnotation.layer.hidden = NO;
_userLocationAnnotation.layer.hidden = flag;
_accuracyCircleAnnotation.layer.hidden = _trackingHaloAnnotation.layer.hidden = NO;
return hit;
}
... ...
... ... @@ -21,21 +21,19 @@
if ( ! (self = [super initWithMapView:aMapView coordinate:aCoordinate andTitle:aTitle]))
return nil;
layer = [[RMMarker alloc] initWithUIImage:[UIImage imageNamed:@"TrackingDot.png"]];
self.layer = [[[RMMarker alloc] initWithUIImage:[UIImage imageNamed:@"TrackingDot.png"]] autorelease];
layer.zPosition = -MAXFLOAT + 2;
self.layer.zPosition = -MAXFLOAT + 2;
annotationType = [kRMUserLocationAnnotationTypeName retain];
self.annotationType = kRMUserLocationAnnotationTypeName;
clusteringEnabled = NO;
self.clusteringEnabled = NO;
return self;
}
- (void)dealloc
{
[layer release]; layer = nil;
[annotationType release]; annotationType = nil;
[location release]; location = nil;
[heading release]; heading = nil;
[super dealloc];
... ...