打开谷歌地图巴士方向 [英] open google maps to bus directions
问题描述
NSString * urlString => 我知道您可以通过执行下列操作来打开Google地图应用程序, @ http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
但是有一个参数可以自动切换到总线方向吗? Apple的开发者文档似乎没有提及任何有关它的内容:
$ b From > 所以你的网址: 成为: I realise that you can open the google maps app ready for directions by doing something like this: But is there a parameter I can add to automatically switch to bus directions? Apple's developer document doesn't seem to mention anything about it: From MapKiWiki: dirflg Route type: So your URL: Becomes: N.B. The data supporting public transit route types are not always available. I tried the area you used in your sample (London, Birmingham) and found it was not supported. 这篇关于打开谷歌地图巴士方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
路线寻找模式。 b路线查找模式。
方向。
>
NSString * urlString = @http:// maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK;
NSString * urlString = @http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK&dirflg=r;
N.B。支持公共交通路线类型的数据并不总是可用的。我尝试了您在样本中使用的区域(伦敦,伯明翰),发现它不被支持。NSString* urlString = @"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
NSString* urlString = @"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK";
NSString* urlString = @"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK&dirflg=r";