ios - 高德地图 有时候返回的地理位置比较慢
PHPz
PHPz 2017-04-18 09:50:51
0
1
1097

这个是高德地图的回调方法
-(void)mapView:(MAMapView )mapView didUpdateUserLocation:(MAUserLocation )userLocation
updatingLocation:(BOOL)updatingLocation
{

if(updatingLocation)
{
        self.lat = userLocation.coordinate.latitude;
        self.lon = userLocation.coordinate.longitude;

}
[self.locationManager requestLocationWithReGeocode:YES completionBlock:^(CLLocation *location, AMapLocationReGeocode *regeocode, NSError *error) {
    
    if (regeocode)
    {
        // NSLog(@"reGeocode:%@%@",regeocode, regeocode.formattedAddress);//地理位置
        formattedAddress =regeocode.formattedAddress;
        NSString *str = regeocode.number;
        NSString *address = [regeocode.street stringByAppendingString:str];
        label2.text = address;
    }
}];
   

}

PHPz
PHPz

学习是最好的投资!

全員に返信(1)
小葫芦

ついに解決しました
このメソッドは必要ありません
__weak WaiQinqiandaoViewController *weakSelf = self;

リーリー
いいねを押す +0
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート