百度地图的集成(转载)

如何快速集成百度地图:

注册百度开发者帐号=》创建应用=》下载SDK=》集成开发=》测试应用=》发布应用

1、注册百度开发者账号

百度账号注册地址:https://passport.baidu.com/v2/?reg®Type=1&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F,如果你已经有百度账号可以跳过这步。

登录后,进入开发者中心,注册成为百度开发者,http://developer.baidu.com/user/info?u=http://lbsyun.baidu.com/apiconsole/key?from=developer,填写好个人信息,提交。

2、创建新应用

在使用百度地图SDK之前需要先获取百度地图移动版开发密钥。

百度地图iOS SDK开发密钥的申请地址为:http://lbsyun.baidu.com/apiconsole/key。

点击以上网址进入API控制台,选择创建应用,填写应用信息:

确认后创建完成,可以在我的应用终看到应用的ak:

3、下载IOS SDK

百度地图iOS SDK的下载地址:http://developer.baidu.com/map/sdkiosdev-download.htm

进入后可以下载全部功能,也可以根据自己需要选择模块选择下载:

4、集成开发

1)新建一个工程

2)添加百度SDK和静态库

解压下载后的iOS SDK压缩包将压缩包内的inc文件夹和mapapi.bundle文件拷贝到工程目录下。

接下来根据模拟器和真机两种环境选择使用静态库文件:

如果用的真机,就导入iphoneos文件夹内的libbaidumapapi.a文件到工程,如果用的模拟器,就导入iphonesimulator文件夹内的libbaidumapapi.a文件到工程。

引入如下图所示的framework:

3)导入头文件,初始化并启动百度地图

首先在工程的.pch文件中导入头文件,并宏定义APPKEY:

1.#import"BMapKit.h"

2.#define APPKEY @"9D6E6FFvXskzZge2GuwXWsRi"

在Appdelegate.h中添加代码如下,必须property  BMKMapManager,不然无法启动地图服务:

_mapManager = [[BMKMapManageralloc] init ];

BOOLret = [_mapManagerstart:APPKEYgeneralDelegate:nil];

if(!ret) {

NSLog(@"启动失败");

}

4)创建BMKMapView,显示百度地图视图

#import<UIKit/UIKit.h>

@interfaceBaseMapViewController : UIViewController

@property (nonatomic, strong) BMKMapView *mapView;

@end

在.m文件

- (void)viewDidLoad

{

 //这里的frame请根据手机分辨率动态设置     self.mapView.frame = CGRectMake(0, 0, 320, 460-44);

self.mapView.delegate = self;

[self.viewaddSubview:self.mapView];

}

- (void)viewWillAppear:(BOOL)animated

{

[_mapViewviewWillAppear];

_mapView.delegate = self;// 此处记得不用的时候需要置nil,否则影响内存的释放

}

- (void)viewWillDisappear:(BOOL)animated

{

[_mapViewviewWillDisappear];

_mapView.delegate = nil;// 不用时,置nil

}

5)更改地图显示方式

switch(index) {

case0:{

//设置地图显示类型,有四种标准地图、实时路况、卫星地图、同时打开实时路况和卫星地图

self.mapView.mapType = BMKMapTypeStandard;

break;

}

case1:{

self.mapView.mapType = BMKMapTypeTrafficOn;

break;

}

case2:{

self.mapView.mapType = BMKMapTypeSatellite;

break;

}

default:{

self.mapView.mapType = BMKMapTypeTrafficAndSatellite;

break;

}

}

6)添加地图标注

首先设置标注的基本属性

在.h文件描述一下

@property (nonatomic, strong) BMKPointAnnotation *annotation;

在.m文件

self.annotation = [BMKPointAnnotationnew];

CLLocationCoordinate2Dcoor;

coor.latitude = 39.911447;

coor.longitude = 116.406026;

//设置标注的坐标

self.annotation.coordinate = coor;

//标题

self.annotation.title = @"北京";

//副标题

self.annotation.subtitle = @"这个annotation可以拖拽";

[self.mapViewaddAnnotation:self.annotation];

详细设置标注,以下方法是SDK自带的,方法内容需要自己写

- (BMKAnnotationView *)mapView:(BMKMapView *)mapViewviewForAnnotation:(id)annotation{

if([annotation isKindOfClass:[BMKPointAnnotationclass]]) {

BMKPinAnnotationView *newAnnotationView = [[BMKPinAnnotationViewalloc]initWithAnnotation:annotationreuseIdentifier:@"myAnnotation"];

newAnnotationView.pinColor = BMKPinAnnotationColorGreen;

//动画效果

newAnnotationView.animatesDrop = YES;

//可以拖拽

newAnnotationView.draggable = YES;

//3D效果

newAnnotationView.enabled3D = YES;

returnnewAnnotationView;

}

returnnil;

}

在不用标注的时候,把它从视图上移除

- (void)viewDidDisappear:(BOOL)animated

{

[superviewDidDisappear:animated];

if(self.annotation!=nil) {

[self.mapViewremoveAnnotation:self.annotation];

}

}

7)POI兴趣点检索

百度地图SDK提供了三种POI搜索(周边、区域、城市内搜索),搜索方式都类似,下面以周边搜索做个示例。

在.h文件:

#import"BaseMapViewController.h"

@interfacePoiViewController : BaseMapViewController

@property (nonatomic, strong) BMKPoiSearch *searcher;

@end

在.m文件

- (void)viewDidLoad

{

[superviewDidLoad];

self.searcher = [BMKPoiSearchnew];

self.searcher.delegate = self;

//搜索周边

BMKNearbySearchOption *option = [BMKNearbySearchOptionnew];

//搜索周边时的中心点坐标

option.location = CLLocationCoordinate2DMake(39.911447, 116.406026);

//搜索的关键字

option.keyword = @"肯德基";

BOOLflag = [self.searcherpoiSearchNearBy:option];

if(!flag) {

NSLog(@"周边检索失败");

}

}

搜索到结果之后的代理方法

- (void)onGetPoiResult:(BMKPoiSearch *)searcher result:(BMKPoiResult *)poiResulterrorCode:(BMKSearchErrorCode)errorCode{

//在添加标注前把以前的标注都移除掉

NSMutableArray *poiAnnotations = [NSMutableArrayarrayWithCapacity:poiResult.poiInfoList.count];

[self.mapViewremoveAnnotations:poiAnnotations];

if(errorCode == BMK_SEARCH_NO_ERROR) {

NSLog(@"找到结果");

for(inti = 0; i

BMKPoiInfo *info = [poiResult.poiInfoListobjectAtIndex:i];

BMKPointAnnotation *pointAnnotation = [BMKPointAnnotationnew];

pointAnnotation.coordinate = info.pt;

pointAnnotation.title = info.name;

pointAnnotation.subtitle = [NSStringstringWithFormat:@"%@%@",info.city,info.address];

[poiAnnotationsaddObject:pointAnnotation];

//设置第一个搜索到的兴趣点为中心点

if(i==0) {

self.mapView.centerCoordinate = info.pt;

}

}

[self.mapViewaddAnnotations:poiAnnotations];

}elseif (errorCode == BMK_SEARCH_AMBIGUOUS_KEYWORD){

NSLog(@"起始点有歧义,有相同名字的别的城市:%@",poiResult.cityList);

}else{

NSLog(@"未找到结果");

}

}

- (void)viewWillDisappear:(BOOL)animated

{

[superviewWillDisappear:animated];

NSArray *array = [NSArrayarrayWithArray:self.mapView.annotations];

[self.mapViewremoveAnnotations:array];

self.searcher.delegate = nil;//不用的时候代理取消

}

8)路径规划

路径规划有三种类型(公交、驾车、步行),使用方式都类似,下面以驾车做个示例。

在.h文件

#import"BaseMapViewController.h"

@interfaceWayPointViewController : BaseMapViewController

@property (nonatomic, strong) BMKRouteSearch *routeSearch;

@end

在.m文件

- (void)viewDidLoad

{

[superviewDidLoad];

self.routeSearch = [BMKRouteSearchnew];

self.routeSearch.delegate = self;

//线路起点信息

BMKPlanNode *start = [BMKPlanNodenew];

start.name = @"天安门";

start.cityName = @"北京市";

//终点信息

BMKPlanNode *end = [BMKPlanNodenew];

end.name = @"百度大厦";

end.cityName = @"北京市";

//途经点信息

BMKPlanNode *wayPoint1 = [BMKPlanNodenew];

wayPoint1.cityName = @"北京市";

wayPoint1.name = @"东直门";

NSMutableArray *array = [NSMutableArraynew];

[arrayaddObject:wayPoint1];

//驾车查询

BMKDrivingRoutePlanOption *drivePlan = [[BMKDrivingRoutePlanOptionalloc]init];

drivePlan.from = start;

drivePlan.to = end;

drivePlan.wayPointsArray = array;

BOOLflag = [self.routeSearchdrivingSearch:drivePlan];

if(!flag) {

NSLog(@"公交检索发送失败");

}

}

//根据搜索返回的结果绘制折线

- (void)onGetDrivingRouteResult:(BMKRouteSearch *)searcher result:(BMKDrivingRouteResult *)result errorCode:(BMKSearchErrorCode)error

{

//移除地图的标注和覆盖物

NSArray *array = [NSArrayarrayWithArray:self.mapView.annotations];

[self.mapViewremoveAnnotations:array];

array = [NSArrayarrayWithArray:self.mapView.overlays];

[self.mapViewremoveAnnotations:array];

if(error == BMK_SEARCH_NO_ERROR) {

BMKDrivingRouteLine *plan = [result.routesobjectAtIndex:0];

intsize = plan.steps.count;

//轨迹点

CLLocationCoordinate2DpolylineCoords[size];

for(inti=0 ;i

BMKDrivingStep *drivingStep = [plan.stepsobjectAtIndex:i];

//添加annotation节点

BMKPointAnnotation* item = [BMKPointAnnotationnew];

item.coordinate = drivingStep.entrace.location;

polylineCoords[i]= drivingStep.entrace.location;

item.title = drivingStep.entraceInstruction;

[self.mapViewaddAnnotation:item];

// 添加起点标注

if(i==0) {

item.title = @"起点";

[self.mapViewselectAnnotation:itemanimated:YES];

}

// 添加起点标注

if(i==size-1){

item.title = @"终点";

}

}

//绘制折线

BMKPolyline* polyLine = [BMKPolylinepolylineWithCoordinates:polylineCoordscount:size];

[self.mapViewaddOverlay:polyLine];

}

}

//定义折线样式

- (BMKOverlayView*)mapView:(BMKMapView *)map viewForOverlay:(id)overlay

{

if([overlay isKindOfClass:[BMKPolylineclass]]) {

BMKPolylineView* polylineView = [[BMKPolylineViewalloc] initWithOverlay:overlay];

polylineView.fillColor = [UIColorblackColor];

polylineView.strokeColor = [UIColorblueColor];

polylineView.lineWidth = 6.0f;

returnpolylineView;

}

returnnil;

}

- (void)viewDidDisappear:(BOOL)animated

{

[superviewDidDisappear:animated];

NSArray *array = [NSArrayarrayWithArray:self.mapView.annotations];

[self.mapViewremoveAnnotations:array];

array = [NSArrayarrayWithArray:self.mapView.overlays];

[self.mapViewremoveAnnotations:array];

self.routeSearch.delegate = nil;//不用的时候代理取消

}

9)地图定位

在.h文件

#import"BaseMapViewController.h"

@interfaceUserLocationViewController : BaseMapViewController

@property (nonatomic, strong)BMKLocationService *localService;

@end

在.m文件

self.localService = [BMKLocationServicenew];

self.localService.delegate = self;

[self.localServicestartUserLocationService];

//改变地图定位样式的时候必须先关闭图层,改变样式后再打开

//关闭显示的定位图层

self.mapView .showsUserLocation = NO;

switch(index) {

case0:{

//三种定位模式:普通、跟随、罗盘

self.mapView.userTrackingMode = BMKUserTrackingModeNone;

break;

}

case1:{

self.mapView.userTrackingMode = BMKUserTrackingModeFollowWithHeading;

break;

}

default:{

self.mapView.userTrackingMode = BMKUserTrackingModeFollow;

break;

}

}

//打开显示的定位图层

self.mapView .showsUserLocation = YES;

10)短串分享

短串分享是在用户搜索查询后得到的每一个地理位置结果会对应一个短连接,用户可以通过短信等方式分享给别人。当用户受到分享的短串后,点击短串可以打开百度地图客户端或手机浏览器进行查看。

定义几个属性用来存放搜素的数据

//名称

NSString* geoName;

//地址

NSString* addr;

//坐标

CLLocationCoordinate2Dpt;

//短串

NSString* shortUrl;

//分享字符串

NSString* showmeg;

首先初始化对象,并发起一个搜索

self.shareSearch = [BMKShareURLSearchnew];

self.shareSearch.delegate = self;

self.poiSearch = [BMKPoiSearchnew];

self.poiSearch.delegate = self;

BMKNearbySearchOption *option = [BMKNearbySearchOptionnew];

option.pageIndex = 0;

option.pageCapacity = 10;

option.location = CLLocationCoordinate2DMake(39.911447, 116.406026);

option.keyword = @"肯德基";

BOOLflag = [self.poiSearchpoiSearchNearBy:option];

if(!flag) {

NSLog(@"周边检索失败");

}

搜索成功后,处理数据,获取要分享的url,发起分享

- (void)onGetPoiResult:(BMKPoiSearch *)searcher result:(BMKPoiResult *)poiResulterrorCode:(BMKSearchErrorCode)errorCode{

if(errorCode == BMK_SEARCH_NO_ERROR) {

for(inti = 0; i

BMKPoiInfo *info = [poiResult.poiInfoListobjectAtIndex:i];

BMKPointAnnotation *pointAnnotation = [BMKPointAnnotationnew];

pointAnnotation.coordinate = info.pt;

pointAnnotation.title = info.name;

pointAnnotation.subtitle = [NSStringstringWithFormat:@"%@%@",info.city,info.address];

[poiAnnotationsaddObject:pointAnnotation];

if(i==0) {

self.mapView.centerCoordinate = info.pt;

geoName = info.name;

addr = info.address;

pt = info.pt;

BMKPoiDetailShareURLOption *option = [BMKPoiDetailShareURLOptionnew];

option.uid = info.uid;

BOOLflag = [self.shareSearchrequestPoiDetailShareURL:option];

if(!flag) {

NSLog(@"详情url检索发送失败");

}}}}}

处理分享的方法

-(void)onGetPoiDetailShareURLResult:(BMKShareURLSearch *)searcher result:(BMKShareURLResult *)result errorCode:(BMKSearchErrorCode)error

{

shortUrl = result.url;

if(error == BMK_SEARCH_NO_ERROR)

{

showmeg = [NSStringstringWithFormat:@"这里是:%@\r\n%@\r\n%@",geoName,addr,shortUrl];

UIAlertView *myAlertView = [[UIAlertViewalloc] initWithTitle:@"短串分享"message:showmegdelegate:selfcancelButtonTitle:nilotherButtonTitles:@"分享",@"取消",nil];

myAlertView.tag = 1000;

[myAlertViewshow];

}}

判断如果设备可以发送短信,则发送分享

- (void)alertView:(UIAlertView *)alertViewclickedButtonAtIndex:(NSInteger)buttonIndex

{

if(alertView.tag ==1000 )

{

if(buttonIndex == 0)

{

Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));

if(messageClass != nil) {

if([messageClasscanSendText]) {

MFMessageComposeViewController *picker = [[MFMessageComposeViewControlleralloc] init];

picker.messageComposeDelegate = self;

picker.body = [NSStringstringWithFormat:@"%@",showmeg];

[selfpresentModalViewController:pickeranimated:YES];

}else{

UIAlertView *myAlertView = [[UIAlertViewalloc] initWithTitle:@"当前设备无法发送短信"message:nildelegate:selfcancelButtonTitle:nilotherButtonTitles:@"确定",nil];

[myAlertViewshow];

}}}}}

11)调启导航

调启导航分为两种:百度地图客户端和Web导航。

首先要配置info.plist,自定义一个URL Scheme和APP绑定,选择工程Targets》Info》URL Types,点击+号添加一个url type。

如图所示:

下面开始编写代码,

#defineMAPScheme @"

baidumapsdk://mapsdk.baidu.com

"

@property (nonatomic, strong)BMKNaviPara *para;

//判读是否能打开百度地图客户端

- (BOOL)canOpenBaiDuMap

{

return[[UIApplicationsharedApplication] canOpenURL:[NSURLURLWithString:MAPScheme]];

}

- (void)viewDidLoad

{

[superviewDidLoad];

self.para = [BMKNaviParanew];

BOOLflag = [selfcanOpenBaiDuMap];

if(flag) {

//使用百度地图客户端导航

self.para.naviType = BMK_NAVI_TYPE_NATIVE;

//初始化终点节点

BMKPlanNode* end = [BMKPlanNodenew];

//指定终点经纬度

CLLocationCoordinate2D coor2;

coor2.latitude = 116.3956;

coor2.longitude = 39.90868;

end.pt = coor2;

//指定终点名称

end.name = @"北京市天安门";

//指定终点

self.para.endPoint = end;

//指定返回自定义scheme,具体定义方法请参考常见问题

self.para.appScheme = MAPScheme;

//调启百度地图客户端导航

[BMKNavigationopenBaiduMapNavigation:self.para];

}else{

//使用WEB导航

self.para.naviType = BMK_NAVI_TYPE_WEB;

//初始化起点节点

BMKPlanNode* start = [BMKPlanNodenew];

//指定起点经纬度

CLLocationCoordinate2D coor1;

coor1.latitude = 116.204;

coor1.longitude = 39.90868;

start.pt = coor1;

//指定起点名称

start.name = @"西直门";

//指定起点

self.para.startPoint = start;

//初始化终点节点

BMKPlanNode* end = [BMKPlanNodenew];

CLLocationCoordinate2D coor2;

coor2.latitude = 116.3956;

coor2.longitude = 39.90868;

end.pt = coor2;

self.para.endPoint = end;

//指定终点名称

end.name = @"北京市天安门";

//指定调启导航的app名称

self.para.appName = @"BaiDuMap";

//调启web导航

[BMKNavigationopenBaiduMapNavigation:self.para];

}

}

主要功能

实时路况:

卫星地图:

地图标注:

功能特色

兴趣点搜索:

路径规划:

短串分享:

DEMO展示

部分测试DEMO展示:

#import"ShareUrlViewController.h"

#import

#import

@interfaceShareUrlViewController ()

{

//名称

NSString* geoName;

//地址

NSString* addr;

//坐标

CLLocationCoordinate2Dpt;

//短串

NSString* shortUrl;

//分享字符串

NSString* showmeg;

}

@end

@implementationShareUrlViewController

- (BMKAnnotationView *)mapView:(BMKMapView *)mapViewviewForAnnotation:(id)annotation{

if([annotation isKindOfClass:[BMKPointAnnotationclass]]) {

BMKPinAnnotationView *newAnnotationView = [[BMKPinAnnotationViewalloc]initWithAnnotation:annotationreuseIdentifier:@"myAnnotation"];

newAnnotationView.pinColor = BMKPinAnnotationColorGreen;

//动画效果

newAnnotationView.animatesDrop = YES;

//3D效果

newAnnotationView.enabled3D = YES;

//单击弹出泡泡,默认是YES

//newAnnotationView.canShowCallout = YES;

returnnewAnnotationView;

}

returnnil;

}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

self = [superinitWithNibName:nibNameOrNilbundle:nibBundleOrNil];

if(self) {

// Custom initialization

}

returnself;

}

- (void)viewDidLoad

{

[superviewDidLoad];

self.shareSearch = [BMKShareURLSearchnew];

self.shareSearch.delegate = self;

self.poiSearch = [BMKPoiSearchnew];

self.poiSearch.delegate = self;

BMKNearbySearchOption *option = [BMKNearbySearchOptionnew];

option.pageIndex = 0;

option.pageCapacity = 10;

option.location = CLLocationCoordinate2DMake(39.911447, 116.406026);

option.keyword = @"肯德基";

BOOLflag = [self.poiSearchpoiSearchNearBy:option];

if(!flag) {

NSLog(@"周边检索失败");

}

}

- (void)onGetPoiResult:(BMKPoiSearch *)searcher result:(BMKPoiResult *)poiResulterrorCode:(BMKSearchErrorCode)errorCode{

NSMutableArray *poiAnnotations = [NSMutableArrayarrayWithCapacity:poiResult.poiInfoList.count];

//移除地图的标注和覆盖物

NSArray *array = [NSArrayarrayWithArray:self.mapView.annotations];

[self.mapViewremoveAnnotations:array];

if(errorCode == BMK_SEARCH_NO_ERROR) {

NSLog(@"找到结果");

for(inti = 0; i

BMKPoiInfo *info = [poiResult.poiInfoListobjectAtIndex:i];

BMKPointAnnotation *pointAnnotation = [BMKPointAnnotationnew];

pointAnnotation.coordinate = info.pt;

pointAnnotation.title = info.name;

pointAnnotation.subtitle = [NSStringstringWithFormat:@"%@%@",info.city,info.address];

[poiAnnotationsaddObject:pointAnnotation];

if(i==0) {

self.mapView.centerCoordinate = info.pt;

geoName = info.name;

addr = info.address;

pt = info.pt;

BMKPoiDetailShareURLOption *option = [BMKPoiDetailShareURLOptionnew];

option.uid = info.uid;

BOOLflag = [self.shareSearchrequestPoiDetailShareURL:option];

if(!flag) {

NSLog(@"详情url检索发送失败");

}

}

}

[self.mapViewaddAnnotations:poiAnnotations];

[self.mapViewselectAnnotation:[poiAnnotationsobjectAtIndex:0] animated:YES];

}elseif (errorCode == BMK_SEARCH_AMBIGUOUS_KEYWORD){

NSLog(@"起始点有歧义,有相同名字的别的城市:%@",poiResult.cityList);

}else{

NSLog(@"未找到结果");

}

}

- (void)onGetPoiDetailShareURLResult:(BMKShareURLSearch *)searcher result:(BMKShareURLResult *)result errorCode:(BMKSearchErrorCode)error

{

shortUrl = result.url;

if(error == BMK_SEARCH_NO_ERROR)

{

showmeg = [NSStringstringWithFormat:@"这里是:%@\r\n%@\r\n%@",geoName,addr,shortUrl];

UIAlertView *myAlertView = [[UIAlertViewalloc] initWithTitle:@"短串分享"message:showmegdelegate:selfcancelButtonTitle:nilotherButtonTitles:@"分享",@"取消",nil];

myAlertView.tag = 1000;

[myAlertViewshow];

}

}

- (void)alertView:(UIAlertView *)alertViewclickedButtonAtIndex:(NSInteger)buttonIndex

{

if(alertView.tag ==1000 )

{

if(buttonIndex == 0)

{

Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));

if(messageClass != nil) {

if([messageClasscanSendText]) {

MFMessageComposeViewController *picker = [[MFMessageComposeViewControlleralloc] init];

picker.messageComposeDelegate = self;

picker.body = [NSStringstringWithFormat:@"%@",showmeg];

[selfpresentModalViewController:pickeranimated:YES];

}else{

UIAlertView *myAlertView = [[UIAlertViewalloc] initWithTitle:@"当前设备无法发送短信"message:nildelegate:selfcancelButtonTitle:nilotherButtonTitles:@"确定",nil];

[myAlertViewshow];

}}}}}

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller

didFinishWithResult:(MessageComposeResult)result

{

switch(result) {

caseMessageComposeResultCancelled://用户自己取消,不用提醒

break;

caseMessageComposeResultSent://后续可能不能够成功发送,所以暂时不提醒

break;

caseMessageComposeResultFailed: NSLog(@"短信发送失败");

break;

default:  NSLog(@"短信没有发送");

break;

}

[selfdismissModalViewControllerAnimated:YES];

}

-(void)viewWillDisappear:(BOOL)animated {

[superviewWillDisappear:animated];

NSArray *array = [NSArrayarrayWithArray:self.mapView.annotations];

[self.mapViewremoveAnnotations:array];

self.poiSearch.delegate = nil;

self.shareSearch.delegate = nil;

}

测试日志

周边兴趣点搜索:

遇到问题

1.刚开始开启百度服务的时候,一直无法显示百度地图图层,笔者确定了APPKEY正确,keyStatus也返回的是0,但就是无法显示。

最后确定出错原因在ARC,在开启ARC的项目中,BMKMapManager一定要在头文件里面声明属性。

2.在使用调起百度导航的时候需要配置URL

scheme并使用,在代码中需要设置appScheme,笔者按照URL

Schemes+”://”+Identifier的方式拼接字符串,发现不能调启。原因是Identifier拼接的时候要反向写,比

如”com.baidu.mapsdk”要改写成”mapsdk.baidu.com”。

上手难易

百度地图上手难度一般,需要掌握面向对象的开发模式,按照百度SDK提供的相关接口调用方法。代理实现返回的功能则需要开发者自己去定义。

开发文档

关于百度地图iOS SDK的开发文档,请参考链接:

http://developer.baidu.com/map/sdk-ios.htm

对于想使用API开发更丰富功能的开发者话,请参考SDK的类文档:

http://developer.baidu.com/map/ios_refer/html/annotated.html

此服务评测版权归DevStore所有,禁止转载,申请升级为特约评测员才可进行测评立即申请

声明:DevStore评测内容都是基于专业评测人员/开发者通过真实的测试之后得出的数据,服务版本实时都在更新,所以评测并不一定

是此服务的最新版本,但我们会秉承公正专业精准的态度,对开发者负责,同时欢迎大家监督和建议,如对评测内容有异议,请提交纠错,由专业的评测团队再次评

测,我们会尽最大努力为大家提供更贴心的服务。

DevStore_全球首家第三方开发者服务商店,最精准的服务对比、最专业的服务评测、最及时的行业动态,为开发者挑选服务提供最全面的参考和专业分析,加入DevStore,从此告别熬夜加班,你也可以这么帅!搜索微信号:DevStore

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,651评论 6 501
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,468评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,931评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,218评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,234评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,198评论 1 299
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,084评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,926评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,341评论 1 311
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,563评论 2 333
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,731评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,430评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,036评论 3 326
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,676评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,829评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,743评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,629评论 2 354

推荐阅读更多精彩内容