百度地图初始化失败

最近接手的项目用到百度地图,在跳转带有百度地图的控制器时会出现莫名其妙的状态: push不过去。
检查了良久,以为没有开启百度地图,然后又调用了

[self.locationService startUserLocationService];

结果还是不行,后来发现BMKRouteSearch初始化不成功

self.routesearch = [[BMKRouteSearch alloc]init];

或者BMKMapView初始化不成功

self.mapView = [[BMKMapView alloc] init];

初始化不成功,每次都卡初始化在这里。
查看了百度地图的例子把在delegate里面初始化BMKMapManager

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   _mapManager = [[BMKMapManager alloc]init];  
  BOOL ret = [_mapManager start:@"你的百度appkey" generalDelegate:self];    
    if (!ret) {    
        KTLogDebug(@"manager start failed!");   
    }  
     
    return YES;  
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容