for_2012 2013-04-28 05:51 采纳率: 0%
浏览 2094
已采纳

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

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

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

  • 写回答

2条回答

  • gaoXxxing 2013-04-28 07:10
    关注

    可以提供给你两种方法:

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏