&引用;“当前位置”;在iPhone Maps.app上
我正在使用此代码从我的应用程序运行maps.app&引用;“当前位置”;在iPhone Maps.app上,iphone,api,maps,Iphone,Api,Maps,我正在使用此代码从我的应用程序运行maps.app NSString* urlStr = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f", s_lat, s_long, d_lat, d_long]; [[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlStr]] 问题是我没有找到当前位置。
NSString* urlStr = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f", s_lat, s_long, d_lat, d_long];
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlStr]]
问题是我没有找到当前位置。
我想要这样的东西:
poi1.url = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=Current Location&daddr=%f,%f",lat,lon];
您是否尝试过在位置数据后附加标签
http://maps.google.com/maps?q=37.771008,+-122.41175+(You+can+insert+your+text+here)&iwloc=A&hl=en
编辑:别忘了正确编码你的URL
NSURL* url = [[NSURL alloc] initWithString:[addr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
你为什么不尝试在你的应用程序中展示一个地图视图呢?因为我使用的是第三方sdk和它的allow me only url。这不是我想要的,但它是唯一有效的!!(我说的是第一个)