Authored by Hal Mueller

undoing r239

@@ -146,7 +146,6 @@ @@ -146,7 +146,6 @@
146 [tileLoader clearLoadedBounds]; 146 [tileLoader clearLoadedBounds];
147 [tileLoader updateLoadedImages]; 147 [tileLoader updateLoadedImages];
148 [renderer setFrame:frame]; 148 [renderer setFrame:frame];
149 - [overlay correctPositionOfAllSublayers];  
150 } 149 }
151 150
152 -(void) dealloc 151 -(void) dealloc
@@ -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
@@ -45,13 +45,8 @@ @@ -45,13 +45,8 @@
45 45
46 - (void) tapOnMarker: (RMMarker*) marker onMap: (RMMapView*) map; 46 - (void) tapOnMarker: (RMMarker*) marker onMap: (RMMapView*) map;
47 - (void) tapOnLabelForMarker: (RMMarker*) marker onMap: (RMMapView*) map; 47 - (void) tapOnLabelForMarker: (RMMarker*) marker onMap: (RMMapView*) map;
48 -- (BOOL)mapView:(RMMapView *)map shouldDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event;  
49 -- (void)mapView:(RMMapView *)map didDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event;  
50 -  
51 -// The following call is deprecated, please use didDragMarker instead  
52 - (void) dragMarkerPosition: (RMMarker*) marker onMap: (RMMapView*)map position:(CGPoint)position; 48 - (void) dragMarkerPosition: (RMMarker*) marker onMap: (RMMapView*)map position:(CGPoint)position;
53 49
54 -  
55 - (void) afterMapTouch: (RMMapView*) map; 50 - (void) afterMapTouch: (RMMapView*) map;
56 51
57 @end 52 @end