列出关键几点:
1. 百度上注册开发者账号,申请app AK,下载sdk
2. 加入sdk文件到代码中
3. appDelegate 中注册:
1)首先 #import"BMapKit.h"
2)didFinishLaunchingWithOptions方法中加入下面代码
// 要使用百度地图,请先启动BaiduMapManager
_mapManager = [[BMKMapManageralloc]init];
BOOL ret = [_mapManagerstart:@"mG6DBmXxsgFjc4CMB3ruX7Gr"generalDelegate:self];
if (!ret) {
NSLog(@"baidu map api: ---------- ------manager start failed!");
}
3)applicationWillResignActive方法中加入下面代码
[BMKMapViewwillBackGround];//百度地图api