问题描述
- 高德导航功能的起始点怎么和定位的位置不一致?
-
定位到了我所在的地方,是在右边那个箭头那里,但是为什么导航的起始点却在左边那里??
我是有一个按钮,点击这个按钮后使用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]; } }
解决方案
试着打开手机上的GPS,可能是定位不精确
解决方案二:
就是你的定位与高德的不符合,或者模式是开车的?这两个问题你check
时间: 2024-09-16 16:40:19