我试图找到一个点,当我触摸谷歌地图的坐标,但到目前为止,我所做的一切都不工作。理想情况下,我希望能够在点击地图时获取地图上某个点的坐标。之后,我将能够在该位置放置一针。谷歌地图:获取坐标
我尝试过其他的尝试,如:
- (void)longpressToGetLocation:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.state != UIGestureRecognizerStateBegan)
return;
CGPoint touchPoint = [gestureRecognizer locationInView:self.mapView];
CLLocationCoordinate2D location =
[self.mapView convertPoint:touchPointtoCoordinateFromView:self.mapView];
NSLog(@"Location found from Map: %f %f",location.latitude,location.longitude);
}
,但这不会工作,我得到了一个错误说 “为GMSMapView中没有明显的@interface声明选择convertpoint tocoordinatefromview
我也有点。失去了,不知道该怎么做。
最佳, Ĵ