将 TapGesture 添加到您的地图视图并按照以下代码操作
-(void)didTouchMap:(UITapGestureRecognizer*)tapGesure {
CGPoint touchPoint = [tapGesure locationInView:selectLocationMapView];
CLLocationCoordinate2D coord= [selectLocationMapView convertPoint:touchPoint toCoordinateFromView:selectLocationMapView];
NSLog(@"lat %f",coord.latitude);
NSLog(@"long %f",coord.longitude);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1749 次 |
| 最近记录: |