Permalink
Browse files

Merge pull request #161 from dguerri/master

Adds tapOnLabelForMarker:onMap:onLayer: method to RMMapViewDelegate protocol.
  • Loading branch information...
2 parents 98ef489 + 8dc7517 commit e42ae379279cd2e365875eaaa8f1d089e50e8ff0 @michaeltyson michaeltyson committed Feb 21, 2012
Showing with 9 additions and 0 deletions.
  1. +1 −0 MapView/Map/RMMapView.h
  2. +7 −0 MapView/Map/RMMapView.m
  3. +1 −0 MapView/Map/RMMapViewDelegate.h
View
1 MapView/Map/RMMapView.h
@@ -139,6 +139,7 @@ typedef struct {
BOOL _delegateHasSingleTapOnMap;
BOOL _delegateHasTapOnMarker;
BOOL _delegateHasTapOnLabelForMarker;
+ BOOL _delegateHasTapOnLabelForMarkerOnLayer;
BOOL _delegateHasAfterMapTouch;
BOOL _delegateHasShouldDragMarker;
BOOL _delegateHasDidDragMarker;
View
7 MapView/Map/RMMapView.m
@@ -193,6 +193,7 @@ - (void) setDelegate: (id<RMMapViewDelegate>) _delegate
_delegateHasTapOnMarker = [(NSObject*) delegate respondsToSelector:@selector(tapOnMarker:onMap:)];
_delegateHasTapOnLabelForMarker = [(NSObject*) delegate respondsToSelector:@selector(tapOnLabelForMarker:onMap:)];
+ _delegateHasTapOnLabelForMarkerOnLayer = [(NSObject*) delegate respondsToSelector:@selector(tapOnLabelForMarker:onMap:onLayer:)];
_delegateHasAfterMapTouch = [(NSObject*) delegate respondsToSelector: @selector(afterMapTouch:)];
@@ -586,10 +587,16 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
if (_delegateHasTapOnLabelForMarker) {
[delegate tapOnLabelForMarker:(RMMarker*)superlayer onMap:self];
}
+ if (_delegateHasTapOnLabelForMarkerOnLayer) {
+ [delegate tapOnLabelForMarker:(RMMarker*)superlayer onMap:self onLayer:hit];
+ }
} else if ([superlayer superlayer] != nil && [[superlayer superlayer] isKindOfClass: [RMMarker class]]) {
if (_delegateHasTapOnLabelForMarker) {
[delegate tapOnLabelForMarker:(RMMarker*)[superlayer superlayer] onMap:self];
}
+ if (_delegateHasTapOnLabelForMarkerOnLayer) {
+ [delegate tapOnLabelForMarker:(RMMarker*)[superlayer superlayer] onMap:self onLayer:hit];
+ }
} else if (_delegateHasSingleTapOnMap) {
[delegate singleTapOnMap: self At: [touch locationInView:self]];
}
View
1 MapView/Map/RMMapViewDelegate.h
@@ -57,6 +57,7 @@
- (void) tapOnMarker: (RMMarker*) marker onMap: (RMMapView*) map;
- (void) tapOnLabelForMarker: (RMMarker*) marker onMap: (RMMapView*) map;
+- (void) tapOnLabelForMarker: (RMMarker*) marker onMap: (RMMapView*) map onLayer:(CALayer *)layer;
- (BOOL) mapView:(RMMapView *)map shouldDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event;
- (void) mapView:(RMMapView *)map didDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event;

0 comments on commit e42ae37

Please sign in to comment.