我有一个地图视图里面有一个落地大头针,我想做的是显示一条从用户当前位置到落地大头针的路线。
我已经找过了,但是没有找到,如果有人知道怎么做,请帮帮忙吧?:)
提前谢谢。
发布于 2013-04-27 20:02:04
试试看...
您可以使用两种方法来完成此操作:
CLLocationCoordinate2D start = { c_lat, c_long };
CLLocationCoordinate2D destination = { [[dic valueForKey:@"business_lat"]doubleValue], [[dic valueForKey:@"business_long"]doubleValue] };
NSString *googleMapsURLString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f&",start.latitude, start.longitude, destination.latitude, destination.longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapsURLString]];
2.
使用谷歌API
请检查两个位置之间绘制路线的this
在API中,只需要传入源名称和目的名称即可
希望我能帮上忙。
https://stackoverflow.com/questions/16251847
复制相似问题