Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.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
Google maps 使用地图应用程序iOS生成步行方向_Google Maps_Ios_Map Directions - Fatal编程技术网

Google maps 使用地图应用程序iOS生成步行方向

Google maps 使用地图应用程序iOS生成步行方向,google-maps,ios,map-directions,Google Maps,Ios,Map Directions,到目前为止,我已使用以下代码从我的应用程序成功地使用地图应用程序生成方向: NSString *formattedGroceryAddress = [[NSString stringWithFormat:@"%@",((EnhancedUIActionSheet *)actionSheet).grocery.address] stringByReplacingOccurrencesOfString:@" " withString:@"+"]; NSString *routeString = [N

到目前为止,我已使用以下代码从我的应用程序成功地使用地图应用程序生成方向:

NSString *formattedGroceryAddress = [[NSString stringWithFormat:@"%@",((EnhancedUIActionSheet *)actionSheet).grocery.address] stringByReplacingOccurrencesOfString:@" " withString:@"+"];
NSString *routeString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%@",localDataHelper.userLocation.coordinate.latitude,localDataHelper.userLocation.coordinate.longitude,formattedGroceryAddress];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:routeString]];
它将打开地图应用程序,其中包含相应的驾驶方向。问题是,我想在默认情况下打开带有行走方向的地图。也许我可以在请求中传递另一个参数来实现这一点

有人知道怎么做吗


谢谢

好吧,我想在问之前我应该找得更好

您可以将dirflg=w添加到请求中,它将以步行模式启动地图应用程序

这很有趣,因为苹果公司说他们只支持几个谷歌地图参数,不包括这个参数,但它实际上似乎起作用了

有关谷歌地图参数的更多信息:

有关iOS应用程序的地图链接的更多信息:

hey bro。。这个链接对我很有用,但现在我遇到了一个问题,我无法从我调用地图应用程序的地方返回到我的应用程序。知道吗?这是一个苹果文档的工作url