定位到了我所在的地方,是在右边那个箭头那里,但是为什么导航的起始点却在左边那里??
我是有一个按钮,点击这个按钮后使用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];
}
}