我試圖找到一個點,當我觸摸谷歌地圖的座標,但到目前爲止,我所做的一切都不工作。理想情況下,我希望能夠在點擊地圖時獲取地圖上某個點的座標。之後,我將能夠在該位置放置一針。谷歌地圖:獲取座標
我嘗試過其他的嘗試,如:
- (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
我也有點。失去了,不知道該怎麼做。
最佳, Ĵ