iOS driving directions in iOS6

最后都变了- 提交于 2019-12-23 03:14:53

问题


I have been searching all around about how to integrate driving directions into MKMapView within my application. Is the only way to open the Apple Maps program and go from there, or is their a way of integrating within your own app. If not, I will probably go with google maps as soon as I can get an API key.


回答1:


If you mean getting the same views for driving direction (a.k.a. turn-by-turn navigation) as the Apple Maps application, then no... as far as I know, there is no library for that (if not 3rd party). However, as you mentioned, you can open apple maps or google maps giving the directions to the application and initiate such a function.

Also, good to know: If there would be such a build-in functionality in iOS6 (which, again I don't believe there is) its good to know it doesn't exist in pre-iOS6. Meaning it won't work on earlier devices. (hence you need to build a fall-back solution if you want to support those devices as well).

More information on iOS turn-by-turn: http://developer.apple.com/library/ios/#releasenotes/General/WhatsNewIniPhoneOS/Articles/iOS6.html

Quote from that page (which makes me believe turn-by-turn is not supported in the API's):

... Apps that offer routing information, such as turn-by-turn navigation services, can now register as a routing app and make those services available to the entire system.

The documentation search page doesn't give much more info either: http://developer.apple.com/library/ios/search/?q=turn-by-turn

For more information on how to open the maps app, check the answer here: https://stackoverflow.com/a/12789896/406677

So bottom line, you need to either create your own turn-by-turn navigation... or link to an existing application giving such support.

I hope that answered your question.



来源:https://stackoverflow.com/questions/13997388/ios-driving-directions-in-ios6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!