给地图添加点击手势后, 在点击方法里实现
-
(void)tapPress:(UIGestureRecognizer*)gestureRecognizer {
CGPoint touchPoint = [gestureRecognizer locationInView:_mapView];//这里touchPoint是点击的某点在地图控件中的位置
CLLocationCoordinate2D touchMapCoordinate =
[_mapView convertPoint:touchPoint toCoordinateFromView:_mapView];//这里touchMapCoordinate就是该点的经纬度了
NSLog(@"点击的位置是 %f,%f,中心点:%f,%f",touchMapCoordinate.latitude,touchMapCoordinate.longitude,self.centerCoordinate2D.latitude,self.centerCoordinate2D.longitude);
}