双击并放大谷歌地图ios

时间:2012-08-27 08:04:39

标签: ios google-maps zooming pinch

有两种委托方法可以改变地图区域:
     - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
     - (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)动画
我的问题是: 有没有办法检测地图区域是从双击或缩放更改?

1 个答案:

答案 0 :(得分:0)

您可以使用手势识别器检测双击:

UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc]
                         initWithTarget:self action:@selector(handleDoubleTap:)];
recognizer.numberOfTapsRequired = 2;
[self addGestureRecognizer:recognizer];

并使用UIPinchGestureRecognizer

对缩放缩放执行相同操作