开发者社区> 问答> 正文

从当前位置到指定位置的导航

地图视图带有一个大头针图形。想要实现在 用户当前位置 到 大头针指向的位置 画一条路线。

但是不知道应该从哪儿开始?我搜索了很多结果也没弄出来。谢谢您的帮助。给指出一个方向也可以。

展开
收起
爵霸 2016-03-23 10:49:29 1798 0
1 条回答
写回答
取消 提交回答
  • 可以提供给你两种方法:

    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

    2019-07-17 19:10:30
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载