+ (void)navigationToMapAppFromCurrentToBranch:(BranchInfo *)info {
NSString* urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%@&daddr=%@,%@",[BranchLocatorGlobal currentLocationStringForCurrentLanguage] , info.lat, info.lon];
NSString* urlString2 = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL* url = [[NSURL alloc]initWithString:urlString2];
[[UIApplication sharedApplication] openURL:url];
}
关于参数:
在ios下,对于saddr可以指定为"Current%20Location",这样可以指定Map使用本机的地址。
但是这个功能有个bug,参见:
http://www.martip.net/blog/localized-current-location-string-for-iphone-apps
posted on 2012-12-29 11:12 佳为好友 阅读(123) 评论(0) 编辑 收藏 引用 所属分类: UI