Skip to content

Commit

Permalink
Merge pull request #3806 from mstepanov/timob-12152-30x
Browse files Browse the repository at this point in the history
[TIMOB-12152] iOS: remove unneeded code in TiMaps
  • Loading branch information
vishalduggal committed Jan 28, 2013
2 parents a1b4fde + 39e1a1b commit 082655b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
4 changes: 0 additions & 4 deletions iphone/Classes/TiMapView.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
CFMutableDictionaryRef mapLine2View; // MKPolyline(route line) -> MKPolylineView(route view)
CFMutableDictionaryRef mapName2Line; // NSString(name) -> MKPolyline(route line)

// Click detection
id<MKAnnotation> hitAnnotation;
BOOL hitSelect;
BOOL manualSelect;
}

@property (nonatomic, readonly) CLLocationDegrees longitudeDelta;
Expand Down
32 changes: 0 additions & 32 deletions iphone/Classes/TiMapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ -(void)setAnnotations_:(id)value

-(void)setSelectedAnnotation:(id<MKAnnotation>)annotation
{
hitAnnotation = annotation;
hitSelect = NO;
manualSelect = YES;
[[self map] selectAnnotation:annotation animated:animate];
}

Expand All @@ -229,9 +226,6 @@ -(void)selectAnnotation:(id)args

if (args == nil) {
for (id<MKAnnotation> annotation in [[self map] selectedAnnotations]) {
hitAnnotation = annotation;
hitSelect = NO;
manualSelect = YES;
[[self map] deselectAnnotation:annotation animated:animate];
}
return;
Expand Down Expand Up @@ -506,10 +500,6 @@ - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)o
return (MKOverlayView *)CFDictionaryGetValue(mapLine2View, overlay);
}

- (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated
{
}

- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
{
region = [mapView region];
Expand Down Expand Up @@ -651,8 +641,6 @@ - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *
BOOL isSelected = [view isSelected];
MKAnnotationView<TiMapAnnotation> *ann = (MKAnnotationView<TiMapAnnotation> *)view;
[self fireClickEvent:view source:isSelected?@"pin":[ann lastHitName]];
manualSelect = NO;
hitSelect = NO;
return;
}
}
Expand All @@ -662,8 +650,6 @@ - (void)mapView:(MKMapView *)mapView didDeselectAnnotationView:(MKAnnotationView
BOOL isSelected = [view isSelected];
MKAnnotationView<TiMapAnnotation> *ann = (MKAnnotationView<TiMapAnnotation> *)view;
[self fireClickEvent:view source:isSelected?@"pin":[ann lastHitName]];
manualSelect = NO;
hitSelect = NO;
return;
}
}
Expand Down Expand Up @@ -806,24 +792,6 @@ - (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views
return result;
}

-(UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView* result = [super hitTest:point withEvent:event];
if (result != nil) {
// OK, we hit something - if the result is an annotation... (3.2+)
if ([result isKindOfClass:[MKAnnotationView class]]) {
hitAnnotation = [(MKAnnotationView*)result annotation];
} else {
hitAnnotation = nil;
}
} else {
hitAnnotation = nil;
}
hitSelect = YES;
manualSelect = NO;
return result;
}

#pragma mark Event generation

- (void)fireClickEvent:(MKAnnotationView *) pinview source:(NSString *)source
Expand Down

0 comments on commit 082655b

Please sign in to comment.