Authored by Hal Mueller

undoing r239

... ... @@ -146,7 +146,6 @@
[tileLoader clearLoadedBounds];
[tileLoader updateLoadedImages];
[renderer setFrame:frame];
[overlay correctPositionOfAllSublayers];
}
-(void) dealloc
... ...
... ... @@ -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]];
... ...
... ... @@ -45,13 +45,8 @@
- (void) tapOnMarker: (RMMarker*) marker onMap: (RMMapView*) map;
- (void) tapOnLabelForMarker: (RMMarker*) marker onMap: (RMMapView*) map;
- (BOOL)mapView:(RMMapView *)map shouldDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event;
- (void)mapView:(RMMapView *)map didDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event;
// The following call is deprecated, please use didDragMarker instead
- (void) dragMarkerPosition: (RMMarker*) marker onMap: (RMMapView*)map position:(CGPoint)position;
- (void) afterMapTouch: (RMMapView*) map;
@end
... ...