2013-02-19 1 views
0

을 열지 않고 directionscurrent location에서 내 앱의 다른 대상으로 표시해야합니다. 이것은 MapKit framework과 관련이 있습니까? 이것에 대한 해결책은 UIWebviews을 사용하지만, 나는 mapview을 사용하여이를 수행하려고합니다.iPhone지도 앱을 열지 않고도 앱의지도 뷰 내부에 방향을 표시하십시오.

+0

http://stackoverflow.com/questions/12883016/draw-a-path-between-two-coordinates-in-mapview-ios 당신은 호출하여 오버레이를 사용하여 경로를 그릴 수 – Rushabh

+0

google api apple지도는 Google과 같은 API를 제공하지 않으므로 Google지도처럼 사과지도에 경로가 표시됩니다. 오버레이를 사용함으로써 우리는 그것을 달성 할 수 있습니다. – 08442

+0

https://github.com/gimenete/iOS-boilerplate 다운로드하고 DirectionsExample.m에서 URL을 찾을 수 있습니다. [NSString stringWithFormat : @ "http://maps.google.com/maps?output= dragdir & saddr = % @ & daddr = % @ & hl = % @ ", saddr, daddr, [[NSLocale currentLocale] localeIdentifier]]; 이것을 통해 방향을 그릴 수 있습니다 – 08442

답변

0

google map api를 사용하여 시작점과 정지 점 위도 및 경도를 추가하여 Google에서 폴리 라인을 가져옵니다. this은 API 링크입니다.

http://maps.googleapis.com/maps/api/directions/json?origin=starting_address&destination=destination_address&sensor=false 

그리고 참조

이 mapkit의 문서를 참조 폴리 라인을 만들려면 및 GitHub의에서이 프로젝트 :

는 그리고 이것은 API URL입니다. nvpolyline, route-me, mapLines, MapKit-Route-Directions

관련 문제