|
@@ -53,6 +53,7 @@ |
|
@@ -53,6 +53,7 @@ |
53
|
BOOL delegateHasTapOnMarker;
|
53
|
BOOL delegateHasTapOnMarker;
|
54
|
BOOL delegateHasTapOnLabelForMarker;
|
54
|
BOOL delegateHasTapOnLabelForMarker;
|
55
|
BOOL delegateHasAfterMapTouch;
|
55
|
BOOL delegateHasAfterMapTouch;
|
|
|
56
|
+ BOOL delegateHasDragMarkerPosition;
|
56
|
NSTimer *decelerationTimer;
|
57
|
NSTimer *decelerationTimer;
|
57
|
CGSize decelerationDelta;
|
58
|
CGSize decelerationDelta;
|
58
|
@end
|
59
|
@end
|
|
@@ -179,6 +180,8 @@ |
|
@@ -179,6 +180,8 @@ |
179
|
delegateHasTapOnLabelForMarker = [(NSObject*) delegate respondsToSelector:@selector(tapOnLabelForMarker:onMap:)];
|
180
|
delegateHasTapOnLabelForMarker = [(NSObject*) delegate respondsToSelector:@selector(tapOnLabelForMarker:onMap:)];
|
180
|
|
181
|
|
181
|
delegateHasAfterMapTouch = [(NSObject*) delegate respondsToSelector: @selector(afterMapTouch:)];
|
182
|
delegateHasAfterMapTouch = [(NSObject*) delegate respondsToSelector: @selector(afterMapTouch:)];
|
|
|
183
|
+
|
|
|
184
|
+ delegateHasDragMarkerPosition = [(NSObject*) delegate respondsToSelector: @selector(dragMarkerPosition: onMap: position:)];
|
182
|
}
|
185
|
}
|
183
|
|
186
|
|
184
|
- (id<RMMapViewDelegate>) delegate
|
187
|
- (id<RMMapViewDelegate>) delegate
|
|
@@ -419,7 +422,7 @@ |
|
@@ -419,7 +422,7 @@ |
419
|
if (delegateHasTapOnMarker) {
|
422
|
if (delegateHasTapOnMarker) {
|
420
|
[delegate tapOnMarker:(RMMarker*)hit onMap:self];
|
423
|
[delegate tapOnMarker:(RMMarker*)hit onMap:self];
|
421
|
}
|
424
|
}
|
422
|
- } else if (superlayer != nil && [superlayer isKindOfClass: [RMMarker class]]) {
|
425
|
+ } else if (superlayer != nil && [superlayer isMemberOfClass: [RMMarker class]]) {
|
423
|
if (delegateHasTapOnLabelForMarker) {
|
426
|
if (delegateHasTapOnLabelForMarker) {
|
424
|
[delegate tapOnLabelForMarker:(RMMarker*)superlayer onMap:self];
|
427
|
[delegate tapOnLabelForMarker:(RMMarker*)superlayer onMap:self];
|
425
|
}
|
428
|
}
|
|
@@ -453,22 +456,15 @@ |
|
@@ -453,22 +456,15 @@ |
453
|
CALayer* hit = [contents.overlay hitTest:[touch locationInView:self]];
|
456
|
CALayer* hit = [contents.overlay hitTest:[touch locationInView:self]];
|
454
|
// NSLog(@"LAYER of type %@",[hit description]);
|
457
|
// NSLog(@"LAYER of type %@",[hit description]);
|
455
|
|
458
|
|
456
|
- if (hit != nil) {
|
|
|
457
|
-
|
|
|
458
|
- if ([hit isKindOfClass: [RMMarker class]]) {
|
|
|
459
|
- BOOL delegateShouldMoveMarker = [(NSObject*) delegate respondsToSelector: @selector(mapView: shouldDragMarker: withEvent:)];
|
|
|
460
|
- if ((delegateShouldMoveMarker && [delegate mapView:self shouldDragMarker:(RMMarker*)hit withEvent:event]) || !delegateShouldMoveMarker) {
|
|
|
461
|
- if ([(NSObject*) delegate respondsToSelector: @selector(mapView: didDragMarker: withEvent:)]) {
|
|
|
462
|
- [delegate mapView:self didDragMarker:(RMMarker*)hit withEvent:event];
|
|
|
463
|
- return;
|
|
|
464
|
- } else if ([(NSObject*) delegate respondsToSelector: @selector(dragMarkerPosition: onMap: position:)]){
|
|
|
465
|
- //This else portion only exists to maintain compatability with old versions. SHOULD be removed after .5 tarball
|
|
|
466
|
- [delegate dragMarkerPosition:(RMMarker*)hit onMap:self position:[[[event allTouches] anyObject]locationInView:self]];
|
|
|
467
|
- return;
|
|
|
468
|
- }
|
|
|
469
|
- }
|
|
|
470
|
- }
|
|
|
471
|
- }
|
459
|
+ if (hit != nil) {
|
|
|
460
|
+
|
|
|
461
|
+ if ([hit isKindOfClass: [RMMarker class]]) {
|
|
|
462
|
+ if (delegateHasDragMarkerPosition) {
|
|
|
463
|
+ [delegate dragMarkerPosition:(RMMarker*)hit onMap:self position:[[[event allTouches] anyObject]locationInView:self]];
|
|
|
464
|
+ return;
|
|
|
465
|
+ }
|
|
|
466
|
+ }
|
|
|
467
|
+ }
|
472
|
|
468
|
|
473
|
RMGestureDetails newGesture = [self getGestureDetails:[event allTouches]];
|
469
|
RMGestureDetails newGesture = [self getGestureDetails:[event allTouches]];
|
474
|
|
470
|
|