简体   繁体   English

使用iOS7 MapKit路由路线

[英]Route Directions with iOS7 MapKit

I need to include routes in my app. 我需要在我的应用中添加路线。 Native apple MKDirection works well, but only on iOS7. 本地苹果MKDirection效果很好,但仅在iOS7上有效。 I would like my app to work both on iOS6 and iOS7. 我希望我的应用程序可同时在iOS6和iOS7上运行。

Then I tried to implement Google routes (Google Maps API) on my iOS application by this tutorial. 然后,我尝试通过教程在iOS应用程序中实现Google路线(Google Maps API)。

Here is my result: 这是我的结果:

地图截图

Why is the route not following the roads? 为什么这条路不走这条路?

您也可以使用此API支持iOS 6。

You can use Google Direction API extract the Overview polyline string decode it and plot as an image with ContextRef on apple map and for iOS7 we can try to check the device version and if its iOS7 we can use latest iOS7 MKDirection API to plot the route map from one location to another location. 您可以使用Google Direction API提取“概述”折线字符串并将其解码,然后使用ContextRef在苹果地图上绘制为图像,对于iOS7,我们可以尝试检查设备版本,如果是iOS7,我们可以使用最新的iOS7 MKDirection API绘制路线图从一个位置到另一位置。 I found a very good tutorial for this please find the link below : MKDirection Tutorial 我为此找到了一个很好的教程,请找到下面的链接: MKDirection教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM