我可以使用地图套件显示两点之间的行驶轨迹吗?
我是否理解正确:
从我的应用程序打开谷歌地图需要关闭该应用程序才能显示谷歌地图应用程序? 例如这样做: NSString* urlString = @"http://maps.google. com/maps?saddr=伦敦+UK&daddr=伯明翰+UK"; [[UIApplication共享应用程序] openURL:[NSURL URLWithString: urlString]];
会关闭我的应用程序吗?
那么如何使用地图套件显示两点之间的行驶轨迹呢?
谢谢-
尼尔。
Did I understand correctly:
Opening google maps from my App demands closing that App in order to display google maps App?
e.g doing so:
NSString* urlString = @"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
will close my App?
So how can I display a driving track between two points using the map kit?
Thanks-
Nir.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MapKit 不提供方向。我认为这是因为谷歌与其地图数据提供商之间的许可协议。
显示方向的最简单方法确实是打开地图 URL。您理解正确,这将关闭您的应用程序并打开地图应用程序。从用户的角度来看,关闭应用程序以显示地图可能是正确的做法。
如果您必须在不离开应用程序的情况下在地图上显示路线,则必须自己构建它。您可以使用自定义视图将路线渲染为一个或多个注释。不幸的是,您的应用程序必须自行查找路线信息(或使用第三方库)。
MapKit does not give directions. I think this is because of the licence agreement between Google and their map data providers.
The easiest way to show directions is indeed to open the map URL. You understand correctly, this will close your app and open the Maps application. Closing your app to show Maps may be the right thing to do from your users' points of view.
If you must have directions on your map without leaving your application, you'll have to build it yourself. You could render the route as one or more annotations with custom views. Unfortunately, your app will have to find the route information on its own (or use a third party library).