从ios中的json获取位置的绘制路径表单

从ios中的json获取位置的绘制路径表单,ios,iphone,objective-c,google-maps,Ios,Iphone,Objective C,Google Maps,如何绘制从一个位置到另一个位置的路径是从ios中的web服务获取的?您可以使用以下代码在两个位置之间绘制线。您需要传递SADD(源地址)坐标和daddr(目标地址)坐标 NSString *googleMapUrlString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%f,%f&daddr=%@,%@", mapView.userLocation.coordinate.latitude, mapView.u

如何绘制从一个位置到另一个位置的路径是从ios中的web服务获取的?

您可以使用以下代码在两个位置之间绘制线。您需要传递SADD(源地址)坐标和daddr(目标地址)坐标

NSString *googleMapUrlString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%f,%f&daddr=%@,%@", mapView.userLocation.coordinate.latitude, mapView.userLocation.coordinate.longitude, destinationLatitude, destinationLongtitude];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapUrlString]];
但它将重定向到Safari浏览器


希望它能帮助您..

如何绘制从当前位置到目的地的路径,或者如何给出一些清晰的细节在您尝试编写代码后,解释您遇到的问题。