tags:

views:

255

answers:

0

I have mapkit view and other view as subview of map. I need to catch double click on other view and allow to move and zoom(by pinching) map view. How i can do it?I must to subclass of MKMapVeiw and override touchesBegan?

@class GridOverlay;
@interface MapView : MKMapView {
GridOverlay *overlay;//This view must catch double click his touchesBegan method never call also
}
-(void)setOverlay:(GridOverlay*)_overlay;
@end

@implementation MapView
-(void)setOverlay:(GridOverlay*)_overlay {
    overlay=_overlay;
    [self addSubview:overlay];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    NSLog(@"Map touch");//This code never call, that i touch map on iphone
}
@end

And add to view in view controller

overlay = [[GridOverlay alloc] initWithFrame:map.bounds];


[map setZoomEnabled:YES];
[map addSubview:overlay];

map.userInteractionEnabled=YES;