【发布时间】:2012-04-19 19:50:11
【问题描述】:
我必须获得路由方向,即我提供的两个位置之间的所有经纬度位置。 我知道下面的代码适用于此并在响应中提供 js 文件。但此代码仅在两个提供的位置不远时才有效。但是如果到目前为止假设在印度和澳大利亚之间有两个位置,那么这将是行不通的,并且在 js 文件中没有给出任何内容。 我的代码如下。
[NSString* str1 = [NSString stringWithFormat:@"%f,%f", loc1.latitude, loc1.longitude\];
NSString* str2 = [NSString stringWithFormat:@"%f,%f", loc2.latitude, loc2.longitude\];
NSString* urlStr = [NSString stringWithFormat:@"http://maps.google.com/maps?output=dragdir&saddr=%@&daddr=%@&output=dragdir", str1, str2\];]
我应该怎么做,或者我遗漏了任何东西或需要任何过滤。请帮助我。
-提前感谢
【问题讨论】:
-
当然不行。只有当两个距离不被海隔开时才会起作用。
-
在你的情况下,印度和澳大利亚之间没有直接的道路,所以它不会工作。
标签: iphone objective-c ios google-maps google-maps-api-3