ios 百度地图定位先定位到几内亚湾,再到当前位置

问题描述

我在集成百度地图和定位的时候,定位会先定位到几内亚湾再回到但前位置,虽然能定位但用户体验太差不知道则么解决了!

问题出现的环境背景及自己尝试过哪些方法

不知道怎么而解决了

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)

 _locationManager                                    = [[BMKLocationManager alloc] init]; //初始化实例
    _locationManager.delegate                           = self;                              //设置delegate
    _locationManager.coordinateType                     = BMKLocationCoordinateTypeBMK09LL;  //设置返回位置的坐标系类型
    _locationManager.distanceFilter                     = kCLDistanceFilterNone;             //设置距离过滤参数
    [_locationManager startUpdatingHeading];
    _locationManager.desiredAccuracy                    = kCLLocationAccuracyBest; //设置预期精度参数
    _locationManager.activityType = CLActivityTypeAutomotiveNavigation;            //设置应用位置类型
    _locationManager.pausesLocationUpdatesAutomatically = NO;                      //设置是否自动停止位置更新
    _locationManager.allowsBackgroundLocationUpdates    = YES;                     //设置是否允许后台定位
    _locationManager.locationTimeout                    = 10;                      //设置位置获取超时时间
    _locationManager.reGeocodeTimeout                   = 10;                      //设置获取地址信息超时时间
    [_locationManager setLocatingWithReGeocode:YES];                               //如果需要持续定位返回地址信息(需要联网),请设置如下:
    [_locationManager startUpdatingLocation];
// 定位SDK中,位置变更的回调 //接收位置更新   实时更新位置
- (void)BMKLocationManager:(BMKLocationManager *)manager
         didUpdateLocation:(BMKLocation *)location
                   orError:(NSError *)error {
    if (error) {
        return;
    }
    if (!location) {
        return;
    }
    if (!self.userLocation) {
        self.userLocation = [[BMKUserLocation alloc] init];
    }
    
    self.userLocation.location = location.location;
    [_showLuShuMapView updateLocationData:self.userLocation];
}

你期待的结果是什么?实际看到的错误信息又是什么?

阅读 4.2k
1 个回答
新手上路,请多包涵

延迟0.23 [self.view addSubview:self.mapView]; 可以规避

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题