ios - 百度地图SDK:.framework形式的开发包
高洛峰
高洛峰 2017-04-17 17:59:58
0
1
408

注:百度地图iOS SDK向广大开发者提供了配置更简单的 .framework形式的开发包。自v2.9.0起,百度地图iOS SDK将不再提供 .a形式的开发包。

.framework的怎么用,官网上看不懂。
http://lbsyun.baidu.com/index.php?title=iossdk/theupdatelog

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

répondre à tous(1)
PHPzhong

Suite à l'opération officielle, cela n'a pas abouti. Voici mon expérience réussie il y a un mois, veuillez vous référer à :
Supposons que vous ayez déjà un compte de développement et que la candidature ait été approuvée.
1. Personnalisez et téléchargez le package de base SDK de Baidu Map. Après la décompression, copiez BaiduMapAPI_*.framework dans le répertoire racine du dossier du projet.
2. Propriétés du projet, phases de construction >
Lier le binaire aux bibliothèques, ajouter :

BaiduMapAPI_Base.framework;
BaiduMapAPI_Map.framework; 
CoreGraphics.framework;
CoreLocation.framework;
CoreTelephony.framework; 
Security.framework; 
SystemConfiguration.framework; 
OpenGLES.framework; 
QuartzCore.framework; 
libsqlite3.0.tbd; 
libstdc++.6.0.9.tbd;

3. Propriétés du projet, paramètres de construction >
3.1 Cette étape ne suit pas la documentation officielle de Baidu, laissez "Selon le type de fichier" inchangé
3.2 Liaison >

4. Cliquez avec le bouton droit sur le menu "Ajouter des fichiers à", ajoutez le fichier mapapi.bundle au projet :

BaiduMapAPI_Map.framework/Resources/mapapi.bundle

5. Modifiez Info.plist et ajoutez :

5.1 accès https

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
Identifiant du bundle 5.2 :

<key>CFBundleDisplayName</key>
<string>HelloBaiduMap</string>
6.Code :

//
//  AppDelegate.h
//  HelloBaiduMap
//
//  Created by Jeffrey Zhang on 16/3/25.
//  Copyright © 2016年 Jeffrey Zhang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <BaiduMapAPI_Base/BMKBaseComponent.h>//引入base相关所有的头文件
#import <BaiduMapAPI_Map/BMKMapComponent.h>//引入地图功能所有的头文件
//#import <BaiduMapAPI_Map/BMKMapView.h>//只引入所需的单个头文件
@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) BMKMapManager *mapManager;


@end



//
//  AppDelegate.m
//  HelloBaiduMap
//
//  Created by Jeffrey Zhang on 16/3/25.
//  Copyright © 2016年 Jeffrey Zhang. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    _mapManager = [[BMKMapManager alloc]init];
    // 如果要关注网络及授权验证事件,请设定   在此处输入您的授权Key , generalDelegate参数
    BOOL ret = [_mapManager start:@"8CxxxxxxxxxxxxxxxxxxxxL"  generalDelegate:nil];
    if (!ret) {
        NSLog(@"manager start failed!");
    }
    
    return YES;
}

//
//  ViewController.m
//  HelloBaiduMap 
//
//  Created by Jeffrey Zhang on 16/3/25.
//  Copyright © 2016年 Jeffrey Zhang. All rights reserved.
//

#import "ViewController.h"

#import <BaiduMapAPI_Base/BMKBaseComponent.h>//引入base相关所有的头文件
#import <BaiduMapAPI_Map/BMKMapComponent.h>//引入地图功能所有的头文件


@interface ViewController ()

@end

@implementation ViewController

-(void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    BMKMapView *mapView = [[BMKMapView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
 
    self.view = mapView;
}
[FAQ]

Échec du démarrage du gestionnaire : le nom d'affichage du bundle doit être ajouté à info.plist

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal