1. 程式人生 > >IOS百度地圖定位總結

IOS百度地圖定位總結

#pragma mark 註冊百度地圖 
- (void)reguestBaiduMap 
{ 
    // 要使用百度地圖,請先啟動BaiduMapManager 
    mapManager = [[BMKMapManager alloc]init]; 
    BOOL ret = [mapManager start:@"3Fo6RpUAQzxT2Cdtg6vKelpV" generalDelegate:self]; 
 
    if (!ret) { 
        NSLog(@"啟動失敗!"); 
    }else{ 
        NSLog(@"啟動成功!"); 
    } 
} 


#pragma mark 百度地圖註冊回撥
 
- (void)onGetNetworkState:(int)iError 
{ 
    if (0 == iError) { 
        NSLog(@"聯網成功"); 
    } 
    else{ 
        NSLog(@"onGetNetworkState %d",iError); 
    } 
} 

- (void)onGetPermissionState:(int)iError 
{ 
    if (0 == iError) { 
        NSLog(@"授權成功"); 
    } 
    else { 
        NSLog(@"onGetPermissionState %d",iError);