地图视图带有一个大头针图形。想要实现在 用户当前位置 到 大头针指向的位置 画一条路线。
但是不知道应该从哪儿开始?我搜索了很多结果也没弄出来。谢谢您的帮助。给指出一个方向也可以。
地图视图带有一个大头针图形。想要实现在 用户当前位置 到 大头针指向的位置 画一条路线。
但是不知道应该从哪儿开始?我搜索了很多结果也没弄出来。谢谢您的帮助。给指出一个方向也可以。
可以提供给你两种方法:
1.
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