8
터치 이벤트에서 좌표를 잡으려고합니다. 나는 잡을 수 있지만 확대/축소에 큰 숫자가있는 경우이 함수를 넣을 때줌 터치로 포인트 터치보기
newCoord = [mapView convertPoint:location toCoordinateFromView:mapView],
좌표가 잘못되었습니다. 내가 무엇을 할 수 있을지?
내 코드 :
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:touch.view];
NSLog(@"locationTOUCH:%f,%f", location.x,location.y);
CLLocationCoordinate2D newCoord;
newCoord = [mapView convertPoint:location toCoordinateFromView:mapView];
NSLog(@"coordinate-%f,%f", newCoord.latitude,newCoord.longitude);
에
을 변경하여 수정되어야 추측에는 요? UIGestureRecognizer를 사용하여 맵에서 터치를 감지하는 것이 좋습니다. [이 답변] (http://stackoverflow.com/questions/4317810/how-to-capture-tap-gesture-on-mkmapview/4318835#4318835)을 참조하십시오. 그 대답은지도의 제스처 인식기를 방해하지 않으려면 shouldRecognizeSimultaneouslyWithGestureRecognizer에서도 예를 반환해야 함을 언급하지 않습니다. – Anna