...
|
...
|
@@ -53,6 +53,7 @@ |
|
|
BOOL delegateHasTapOnMarker;
|
|
|
BOOL delegateHasTapOnLabelForMarker;
|
|
|
BOOL delegateHasAfterMapTouch;
|
|
|
BOOL delegateHasDragMarkerPosition;
|
|
|
NSTimer *decelerationTimer;
|
|
|
CGSize decelerationDelta;
|
|
|
@end
|
...
|
...
|
@@ -179,6 +180,8 @@ |
|
|
delegateHasTapOnLabelForMarker = [(NSObject*) delegate respondsToSelector:@selector(tapOnLabelForMarker:onMap:)];
|
|
|
|
|
|
delegateHasAfterMapTouch = [(NSObject*) delegate respondsToSelector: @selector(afterMapTouch:)];
|
|
|
|
|
|
delegateHasDragMarkerPosition = [(NSObject*) delegate respondsToSelector: @selector(dragMarkerPosition: onMap: position:)];
|
|
|
}
|
|
|
|
|
|
- (id<RMMapViewDelegate>) delegate
|
...
|
...
|
@@ -419,7 +422,7 @@ |
|
|
if (delegateHasTapOnMarker) {
|
|
|
[delegate tapOnMarker:(RMMarker*)hit onMap:self];
|
|
|
}
|
|
|
} else if (superlayer != nil && [superlayer isKindOfClass: [RMMarker class]]) {
|
|
|
} else if (superlayer != nil && [superlayer isMemberOfClass: [RMMarker class]]) {
|
|
|
if (delegateHasTapOnLabelForMarker) {
|
|
|
[delegate tapOnLabelForMarker:(RMMarker*)superlayer onMap:self];
|
|
|
}
|
...
|
...
|
@@ -453,22 +456,15 @@ |
|
|
CALayer* hit = [contents.overlay hitTest:[touch locationInView:self]];
|
|
|
// NSLog(@"LAYER of type %@",[hit description]);
|
|
|
|
|
|
if (hit != nil) {
|
|
|
|
|
|
if ([hit isKindOfClass: [RMMarker class]]) {
|
|
|
BOOL delegateShouldMoveMarker = [(NSObject*) delegate respondsToSelector: @selector(mapView: shouldDragMarker: withEvent:)];
|
|
|
if ((delegateShouldMoveMarker && [delegate mapView:self shouldDragMarker:(RMMarker*)hit withEvent:event]) || !delegateShouldMoveMarker) {
|
|
|
if ([(NSObject*) delegate respondsToSelector: @selector(mapView: didDragMarker: withEvent:)]) {
|
|
|
[delegate mapView:self didDragMarker:(RMMarker*)hit withEvent:event];
|
|
|
return;
|
|
|
} else if ([(NSObject*) delegate respondsToSelector: @selector(dragMarkerPosition: onMap: position:)]){
|
|
|
//This else portion only exists to maintain compatability with old versions. SHOULD be removed after .5 tarball
|
|
|
[delegate dragMarkerPosition:(RMMarker*)hit onMap:self position:[[[event allTouches] anyObject]locationInView:self]];
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (hit != nil) {
|
|
|
|
|
|
if ([hit isKindOfClass: [RMMarker class]]) {
|
|
|
if (delegateHasDragMarkerPosition) {
|
|
|
[delegate dragMarkerPosition:(RMMarker*)hit onMap:self position:[[[event allTouches] anyObject]locationInView:self]];
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
RMGestureDetails newGesture = [self getGestureDetails:[event allTouches]];
|
|
|
|
...
|
...
|
|