注:百度地图iOS SDK向广大开发者提供了配置更简单的 .framework形式的开发包。自v2.9.0起,百度地图iOS SDK将不再提供 .a形式的开发包。
.framework的怎么用,官网上看不懂。
http://lbsyun.baidu.com/index.php?title=iossdk/theupdatelog
PHPz2017-04-17 18:01:58
按照官方操作,沒有成功過,以下是我一個月前的成功經驗,請參考:
假設你已經有了開發帳號,應用申請也審核通過。
1.自訂下載baidu地圖的基礎套件sdk,解壓縮後,拷貝 BaiduMapAPI_*.framework 到專案資料夾根目錄。
2.項目屬性,Build Phases >
Link binary with libraries, 加入:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
3.項目屬性,Build Settings >
3.1 這一步驟沒有按baidu官方文件做,保持」According to File Type"不變
3.2 Linking > Other Linker Flags,加入 -ObjC
4.右鍵選單”add files to”, 新增mapapi.bundle檔案到專案:
BaiduMapAPI_Map.framework/Resources/mapapi.bundle
5.修改Info.plist, 加入:
5.1 https的訪問
1 2 3 4 5 6 |
|
5.2 bundle identifier:
1 2 3 |
|
6.代碼:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
[常見問題]
manager start failed : info.plist 中必須加入 Bundle display name