Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;“当前位置”;在iPhone Maps.app上_Iphone_Api_Maps - Fatal编程技术网

&引用;“当前位置”;在iPhone 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]] 问题是我没有找到当前位置。

我正在使用此代码从我的应用程序运行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]]

问题是我没有找到当前位置。 我想要这样的东西:

 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。这不是我想要的,但它是唯一有效的!!(我说的是第一个)