Baidu map SDK developer web site: lbsyun.baidu.com/index.php?t…

Request key (security code): The project name and bundle ID are required

Address: lbsyun.baidu.com/apiconsole/…

Two Matters needing attention

2 The project must have at least one. Mm source file (You can rename any file with a. M suffix to.mm)

Drag in the ObjectC++ forbaidumapbuild.mm file

3 Add -objc to Xcode’s Project -> Edit Active Target -> Build Setting -> Other Linker Flags

4 since V3.2.0, Baidu Map iOS SDK fully supports HTTPS, requiring developers to import third-party OpenSSL static libraries: libssl.a and libcrypto. A (SDK made package stored in thirdlib directory)

5 add: Bundle display name to info.plist, and its value cannot be empty (Xcode6 does not have this configuration, otherwise it will cause Manager start failed)

Configure the development environment

1. Import. Framework packages as needed: add baidumapapi_map. framework and so on to the project.

2. Import the required system libraries

. In your Xcode project introduction CoreLocation framework and QuartzCore framework, OpenGLES.. Framework, SystemConfiguration framework, CoreGraphics. F Ramework, security.framework, libsqlite3.0.tbd (formerly libsqlite3.0.dylib), CoreTelephony. Framework , libstdc++.6.0.9. TBD (xcode7 was libstdc++.6.0.9.dylib).

3. Introduce the required third-party OpenSSL libraries:

Add penssl static libraries to support HTTPS: libssl.a and libcrypto.a (SDK package stored in thirdlib directory) add method: Click the “+” button in the TARGETS->Build Phases-> Link Binary With Libaries, click the “Add Other” button in the popup window, select libssl.a and libcrypto

4 Environment Configuration

Add -objc to TARGETS->Build Settings->Other Linker Flags.

5 Import the mapapi.bundle resource file

Method: Right-click the project name and choose Add Files to “Project name”… , from BaiduMapAPI_Map framework | | Resources file selection mapapi. The bundle file, then select “Copy items if men” check box, click the “Add” button to Add a resource file to the project.

Four Hello BaiduMap

1. Import it to the appdelegate. m file

#import <BaiduMapAPI_Map/ bmkmapComponent. h>// import all header files for map functionality

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    _mapManager = [[BMKMapManager alloc] init];
    BOOL ret = [_mapManager start:@"vV8OMTGeLEPt6Uzbd7TVFm5KGawekzVp"  generalDelegate:nil];
    if(! ret) { NSLog(@"manager start failed!");
    }
    return YES;
}
Copy the code

2. Add the BMKMapView creation code to your viewController. m file