peterchen149 2015-10-12 06:46 采纳率: 0%
浏览 1934

高德导航功能的起始点怎么和定位的位置不一致?

定位到了我所在的地方,是在右边那个箭头那里,但是为什么导航的起始点却在左边那里??
我是有一个按钮,点击这个按钮后使用ios自带的定位功能定位,得到的经纬度,再根据这个经纬度调用高德的导航

 -(void)locate{
    if ([CLLocationManager locationServicesEnabled]) {
        if(!self.myLocation){

            self.myLocation = [[CLLocationManager alloc]init];
            self.myLocation.delegate = self;
            [self.myLocation setDesiredAccuracy:kCLLocationAccuracyHundredMeters];
            if (SYSTEMVERSION >= 8.0) {
                [self.myLocation requestAlwaysAuthorization];
            }
            if ([CLLocationManager authorizationStatus]== kCLAuthorizationStatusAuthorized || [CLLocationManager authorizationStatus]== kCLAuthorizationStatusAuthorizedAlways || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse) {
                [self.myLocation startUpdatingLocation];
            }
        }

    }else{
        [Util showAlertView"请开启定位:设置 > 隐私 > 位置 > 定位服务"];
    }
}

-(void)locationManagerCLLocationManager *)manager didUpdateLocationsNSArray *)locations{
    if (locations.count > 0) {
        [self.myLocation stopUpdatingLocation];
        CLLocation *currentL = [locations lastObject];
        self.startLatitude = currentL.coordinate.latitude;
        self.startLongitude = currentL.coordinate.longitude ;
        [self beginNavWithStartLatitude:self.startLatitude startLongitude:self.startLongitude endLatitude:self.endLatitude endLongitude:self.endLongitude];
    }
}
  • 写回答

2条回答 默认 最新

  • qq_31950049 2015-10-12 06:50
    关注

    试着打开手机上的GPS,可能是定位不精确

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器