iOS百度地图配置,定位,显示,地理编码,POI检索,路径规划

来源:互联网 时间:2017-01-22


第一步:去百度地图首页下载SDK http://lbsyun.baidu.com/index.php?title=iossdk/sdkiosdev-download


下载好SDK后,导入.framework包. 还需要有一个后缀为.mm的文件.改viewController即可.


第二步: 引入所需的系统库


添加方式:在Xcode的Project -> Active Target ->Build Phases ->Link Binary With Libraries,添加这几个系统库即可。


CoreLocation.framework和QuartzCore.framework、OpenGLES.framework、SystemConfiguration.framework、CoreGraphics.framework、Security.framework、libsqlite3.0.tbd(xcode7以前为 libsqlite3.0.dylib)、CoreTelephony.framework 、libstdc++.6.0.9.tbd(xcode7以前为libstdc++.6.0.9.dylib)。


第三步: 环境配置 在TARGETS->Build Settings->Other Linker Flags 中添加-ObjC


第四步: 引入mapapi.bundle资源文件


从BaiduMapAPI_Map.framework||Resources文件中选择mapapi.bundle文件 这几个文件一定要手动拖入到工程中, 不可按照百度地图的方式去弄. 否则报错


第五步: 一些相关配置和注意事项


1.由于iOS9改用更安全的https,为了能够在iOS9中正常使用地图SDK,请在"Info.plist"中进行如下配置,否则影响SDK的使用。NSAppTransportSecurityNSAllowsArbitraryLoads


2.如果在iOS9中使用了调起百度地图客户端功能,必须在"Info.plist"中进行如下配置,否则不能调起百度地图客户端。LSApplicationQueriesSchemesbaidumap


3.自iOS SDK v2.5.0起,为了对iOS8的定位能力做兼容,做了相应的修改,开发者在使用过程中注意事项如下: 需要在info.plist里添加(以下二选一,两个都添加默认使用NSLocationWhenInUseUsageDescription):NSLocationWhenInUseUsageDescription ,允许在前台使用时获取GPS的描述NSLocationAlwaysUsageDescription ,允许永久使用GPS的描述


4.在使用Xcode6进行SDK开发过程中,需要在info.plist中添加:Bundle display name ,且其值不能为空(Xcode6新建的项目没有此配置,若没有会造成manager start failed)


如果总是提示没有Bundle display name,那就把他删除了, 然后再设置一下(遇到过两次这样的情况了) 或者检查一下注册应用是的Boundle ID和获得的Key和工程中的Boundle ID 和key 是否一样


这样配置好了后,下面就开始写代码了
在AppDelegate.m文件中的代码


#define BMK_KEY @"7blfqtWzKxQaxSBmXZC8sGyTDtpYbQ06"//百度地图的key
#import "AppDelegate.h"
#import <BaiduMapAPI_Base/BMKBaseComponent.h>//引入base相关所有的头文件
@interface AppDelegate ()
@property (nonatomic, strong)BMKMapManager *mapManager;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
_mapManager = [BMKMapManager new];
BOOL ret = [_mapManager start:BMK_KEY generalDelegate:nil];
if (!ret)
{
NSLog(@"启动失败");
}
else
{
NSLog(@"百度地图启动成功");
}
return YES;
}

新建了一个控制器
.h代码


#import <UIKit/UIKit.h>
@interface WXQBMKViewViewController : UIViewController
@end

.m代码


#import "WXQBMKViewViewController.h"
#import <BaiduMapAPI_Map/BMKMapComponent.h>//引入地图功能所有的头文件
#import <BaiduMapAPI_Location/BMKLocationComponent.h>//引入定位功能所有的头文件
@interface WXQBMKViewViewController ()<BMKMapViewDelegate,BMKLocationServiceDelegate>
@property (nonatomic, strong)BMKMapView *mapView; //百度地图视图
@property (nonatomic, strong)BMKLocationService*locService; // 定位
@end
@implementation WXQBMKViewViewController
#pragma mark ----视图将要出现,将要消失方法
- (void)viewWillAppear:(BOOL)animated
{
[_mapView viewWillAppear];
_mapView.delegate = self; // 此处记得不用的时候需要置nil,否则影响内存的释放
}
- (void)viewWillDisappear:(BOOL)animated
{
[_mapView viewWillDisappear];
_mapView.delegate = nil; // 不用时,置nil
}
#pragma mark ----加载视图
- (void)viewDidLoad
{
[super viewDidLoad];
self.view = self.mapView;
[self.locService startUserLocationService]; //开启定位
}
#pragma mark ----BMK_LocationDelegate
/**
*定位失败后,会调用此函数
*@param error 错误号
*/
- (void)didFailToLocateUserWithError:(NSError *)error
{
NSLog(@"地图定位失败======%@",error);
}
//实现相关delegate 处理位置信息更新
//处理方向变更信息
- (void)didUpdateUserHeading:(BMKUserLocation *)userLocation
{
NSLog(@"heading = %@",userLocation.heading);
}
//处理位置坐标更新
- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
{
NSLog(@"didUpdateUserLocation lat %f,long %f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude);
//更新一次地图的位置 (只执行一次)
if ((userLocation.location.coordinate.latitude != 0 || userLocation.location.coordinate.longitude != 0))
{
[self.mapView updateLocationData:userLocation];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// 设置屏幕中心点
BMKCoordinateRegion region;
region.center.latitude = userLocation.location.coordinate.latitude;
region.center.longitude = userLocation.location.coordinate.longitude;
self.mapView.region = region;
});
}
[self.locService stopUserLocationService];//关闭坐标更新
}
#pragma mark ----BMKMapViewDelegate
- (BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id<BMKAnnotation>)annotation
{
if ([annotation isKindOfClass:[BMKPointAnnotation class]]) {
//添加大头针标注
BMKPinAnnotationView *newAnnotationView = [[BMKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"myAnnotation"];
newAnnotationView.pinColor = BMKPinAnnotationColorPurple;
newAnnotationView.animatesDrop = YES;// 设置该标注点动画显示
return newAnnotationView;
}
return nil;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark ----懒加载
//地图
- (BMKMapView *)mapView
{
if (!_mapView) {
_mapView = [[BMKMapView alloc] initWithFrame:self.view.frame];
[_mapView setZoomEnabled:YES];
[_mapView setZoomLevel:18];//放大级别,3-19
_mapView.showMapScaleBar = YES;//比例尺
_mapView.mapScaleBarPosition = CGPointMake(10,_mapView.frame.size.height-45);//比例尺的位置
_mapView.showsUserLocation=YES;//显示当前设备的位置
// _mapView.userTrackingMode = BMKUserTrackingModeFollow;//定位跟随模式
[_mapView setMapType:BMKMapTypeStandard];//地图的样式(标准地图)
}
return _mapView;
}
//地图定位
- (BMKLocationService *)locService
{
if (!_locService)
{
_locService = [[BMKLocationService alloc] init];
_locService.delegate = self;
}
return _locService;
}

这样就可以定位以及显示了.


下面这个是在定位的基础上加了反向地理编码
.m代码


#import <UIKit/UIKit.h>
@interface WXQBMKGeoCodeViewController : UIViewController
@end

.h代码


#import "WXQBMKGeoCodeViewController.h"
#import <BaiduMapAPI_Map/BMKMapComponent.h>//引入地图功能所有的头文件
#import <BaiduMapAPI_Location/BMKLocationComponent.h>//引入定位功能所有的头文件
#import <BaiduMapAPI_Search/BMKSearchComponent.h>//引入检索功能所有的头文件
@interface WXQBMKGeoCodeViewController ()<BMKMapViewDelegate,BMKLocationServiceDelegate,BMKGeoCodeSearchDelegate>
@property (nonatomic, strong)BMKMapView *mapView; //百度地图视图
@property (nonatomic, strong)BMKLocationService*locService; // 定位
@property (nonatomic, strong) BMKGeoCodeSearch *geocodesearch; //检索对象
@end
@implementation WXQBMKGeoCodeViewController

#pragma mark ----视图将要出现,将要消息方法
- (void)viewWillAppear:(BOOL)animated
{
[_mapView viewWillAppear];
_mapView.delegate = self; // 此处记得不用的时候需要置nil,否则影响内存的释放
}
- (void)viewWillDisappear:(BOOL)animated
{
[_mapView viewWillDisappear];
_mapView.delegate = nil; // 不用时,置nil
_geocodesearch.delegate = nil;
}
#pragma mark ----加载视图
- (void)viewDidLoad
{
[super viewDidLoad];
self.view = self.mapView;
[self.locService startUserLocationService]; //开启定位
}
#pragma mark ----BMK_LocationDelegate
/**
*定位失败后,会调用此函数
*@param error 错误号
*/
- (void)didFailToLocateUserWithError:(NSError *)error
{
NSLog(@"地图定位失败======%@",error);
}
//实现相关delegate 处理位置信息更新
//处理方向变更信息
- (void)didUpdateUserHeading:(BMKUserLocation *)userLocation
{
NSLog(@"heading = %@",userLocation.heading);
}
//处理位置坐标更新
- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
{
NSLog(@"didUpdateUserLocation lat %f,long %f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude);
//更新一次地图的位置 (只执行一次)
if ((userLocation.location.coordinate.latitude != 0 || userLocation.location.coordinate.longitude != 0))
{
[self.mapView updateLocationData:userLocation];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// 设置屏幕中心点
BMKCoordinateRegion region;
region.center.latitude = userLocation.location.coordinate.latitude;
region.center.longitude = userLocation.location.coordinate.longitude;
self.mapView.region = region;
//反向地理编码
NSString *latitude = [NSString stringWithFormat:@"%f",userLocation.location.coordinate.latitude];
NSString *longitude = [NSString stringWithFormat:@"%f",userLocation.location.coordinate.longitude];
[self reverseGeoCodeWithLatitude:latitude withLongitude:longitude];
});
}
[self.locService stopUserLocationService];//关闭坐标更新
}
#pragma mark ----反向地理编码
- (void)reverseGeoCodeWithLatitude:(NSString *)latitude withLongitude:(NSString *)longitude
{
CLLocationCoordinate2D coor;
coor.latitude = [latitude doubleValue];
coor.longitude = [longitude doubleValue];
BMKReverseGeoCodeOption *reverseGeocodeSearchOption = [[BMKReverseGeoCodeOption alloc] init];
reverseGeocodeSearchOption.reverseGeoPoint = coor;
BOOL flag = [self.geocodesearch reverseGeoCode:reverseGeocodeSearchOption];;
if (flag)
{
NSLog(@"反地理编码成功");//可注释
}
else
{
NSLog(@"反地理编码失败");//可注释
}
}
#pragma mark -BMKGeoCodeSearchDelegate
//根据 经纬度 获取 地区信息
- (void)onGetReverseGeoCodeResult:(BMKGeoCodeSearch *)searcher result:(BMKReverseGeoCodeResult *)result errorCode:(BMKSearchErrorCode)error
{
if (error == BMK_SEARCH_NO_ERROR)
{
NSString *address = result.address;
// result.addressDetail ///层次化地址信息
NSLog(@"我的位置在 %@",address);
}
else
{
NSLog(@"未找到结果 %u",error);
}
}
#pragma mark ----BMKMapViewDelegate
- (BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id<BMKAnnotation>)annotation
{
if ([annotation isKindOfClass:[BMKPointAnnotation class]]) {
//添加大头针标注
BMKPinAnnotationView *newAnnotationView = [[BMKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"myAnnotation"];
newAnnotationView.pinColor = BMKPinAnnotationColorPurple;
newAnnotationView.animatesDrop = YES;// 设置该标注点动画显示
return newAnnotationView;
}
return nil;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark ----懒加载
//地图
- (BMKMapView *)mapView
{
if (!_mapView) {
_mapView = [[BMKMapView alloc] initWithFrame:self.view.frame];
[_mapView setZoomEnabled:YES];
[_mapView setZoomLevel:18];//放大级别,3-19
_mapView.showMapScaleBar = YES;//比例尺
_mapView.mapScaleBarPosition = CGPointMake(10,_mapView.frame.size.height-45);//比例尺的位置
_mapView.showsUserLocation=YES;//显示当前设备的位置
// _mapView.userTrackingMode = BMKUserTrackingModeFollow;//定位跟随模式
[_mapView setMapType:BMKMapTypeStandard];//地图的样式(标准地图)
}
return _mapView;
}
//地图定位
- (BMKLocationService *)locService
{
if (!_locService)
{
_locService = [[BMKLocationService alloc] init];
_locService.delegate = self;
}
return _locService;
}
//检索对象
- (BMKGeoCodeSearch *)geocodesearch
{
if (!_geocodesearch)
{
_geocodesearch = [[BMKGeoCodeSearch alloc] init];
_geocodesearch.delegate = self;
}
return _geocodesearch;
}
@end

完善了一下代码, Poi检索后传值给上一个界面,在项目总正好遇到
.h


#import <UIKit/UIKit.h>
@interface WXQBMKPoiViewController : UIViewController
@end

.m


#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height
#define S_WIDTH 320.00*[UIScreen mainScreen].bounds.size.width
#define S_HEIGHT 480.00*[UIScreen mainScreen].bounds.size.height
#import "WXQBMKPoiViewController.h"
#import "ViewController.h"
#import <BaiduMapAPI_Map/BMKMapComponent.h>//引入地图功能所有的头文件
#import <BaiduMapAPI_Location/BMKLocationComponent.h>//引入定位功能所有的头文件
#import <BaiduMapAPI_Search/BMKSearchComponent.h>//引入检索功能所有的头文件
#import <CoreLocation/CoreLocation.h>//系统定位文件
static const int pageIndex = 0; //Poi检索页码
static const int pageCapacity = 10; //每页个数
NSString *const city = @"石家庄"; //Poi检索城市
@interface WXQBMKPoiViewController ()<BMKMapViewDelegate,BMKLocationServiceDelegate,BMKGeoCodeSearchDelegate,BMKPoiSearchDelegate,UITextFieldDelegate,UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong)BMKMapView *mapView; //百度地图视图
@property (nonatomic, strong)BMKLocationService*locService; // 定位
@property (nonatomic, strong)BMKGeoCodeSearch *geocodesearch; //地理编码对象
@property (nonatomic, strong)BMKPoiSearch *searcher; //检索
@property (nonatomic, strong)UITableView *poiTableView; //显示位置表格
@property (nonatomic, strong)NSMutableArray *nameArray; //接收检索名字的数组
@property (nonatomic, strong)NSMutableArray *addressArray; //接收检索地址的数组
@end
@implementation WXQBMKPoiViewController
#pragma mark ----视图将要出现,将要消息方法
- (void)viewWillAppear:(BOOL)animated
{
[_mapView viewWillAppear];
_mapView.delegate = self; // 此处记得不用的时候需要置nil,否则影响内存的释放
}
- (void)viewWillDisappear:(BOOL)animated
{
[_mapView viewWillDisappear];
_mapView.delegate = nil; // 不用时,置nil
_geocodesearch.delegate = nil;
_searcher.delegate = nil;
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self addView];
}
#pragma mark ----加载视图
- (void)addView
{
//初始化数组
self.nameArray = [[NSMutableArray alloc] init];
self.addressArray = [[NSMutableArray alloc] init];
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.mapView];
UITextField *textField = [[UITextField alloc] init];
textField.placeholder = @"请在这里输入要搜索的地址";
textField.backgroundColor = [UIColor whiteColor];
textField.delegate = self;
textField.frame = CGRectMake(10, 10, WIDTH - 20, 35/S_HEIGHT);
[self.view addSubview:textField];
[self.view addSubview:self.poiTableView];
[self.locService startUserLocationService]; //开启定位
}
//触摸屏幕
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
[self.view endEditing:YES];
}
#pragma mark ----textFieldDelegate 在这里调用Poi检索
- (void)textFieldDidEndEditing:(UITextField *)textField
{
[self poiSearchWithKeyword:textField.text];
}
#pragma mark ----BMK_LocationDelegate
/**
*定位失败后,会调用此函数
*@param error 错误号
*/
- (void)didFailToLocateUserWithError:(NSError *)error
{
NSLog(@"地图定位失败======%@",error);
}
//实现相关delegate 处理位置信息更新
//处理方向变更信息
- (void)didUpdateUserHeading:(BMKUserLocation *)userLocation
{
NSLog(@"heading = %@",userLocation.heading);
}
//处理位置坐标更新
- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
{
NSLog(@"didUpdateUserLocation lat %f,long %f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude);
//更新一次地图的位置 (只执行一次)
if ((userLocation.location.coordinate.latitude != 0 || userLocation.location.coordinate.longitude != 0))
{
[self.mapView updateLocationData:userLocation];
// 设置屏幕中心点
BMKCoordinateRegion region;
region.center.latitude = userLocation.location.coordinate.latitude;
region.center.longitude = userLocation.location.coordinate.longitude;
// region.span = BMKCoordinateSpan(0.02f,0.02f);
BMKCoordinateRegion adjustedRegion = [_mapView regionThatFits:region];
[self.mapView setRegion:adjustedRegion animated:YES];
// self.mapView.region = region;
//反向地理编码
NSString *latitude = [NSString stringWithFormat:@"%f",userLocation.location.coordinate.latitude];
NSString *longitude = [NSString stringWithFormat:@"%f",userLocation.location.coordinate.longitude];
[self reverseGeoCodeWithLatitude:latitude withLongitude:longitude];
// static dispatch_once_t onceToken;
// dispatch_once(&onceToken, ^{
//
// }); 不能这么使用, 这样的话pop出这个页面再进来不会走这个方法了
}
[self.locService stopUserLocationService];//关闭坐标更新
}
#pragma mark ----反向地理编码
- (void)reverseGeoCodeWithLatitude:(NSString *)latitude withLongitude:(NSString *)longitude
{
CLLocationCoordinate2D coor;
coor.latitude = [latitude doubleValue];
coor.longitude = [longitude doubleValue];
BMKReverseGeoCodeOption *reverseGeocodeSearchOption = [[BMKReverseGeoCodeOption alloc] init];
reverseGeocodeSearchOption.reverseGeoPoint = coor;
BOOL flag = [self.geocodesearch reverseGeoCode:reverseGeocodeSearchOption];;
if (flag)
{
NSLog(@"反地理编码成功");//可注释
}
else
{
NSLog(@"反地理编码失败");//可注释
}
}
#pragma mark ----Poi检索
- (void)poiSearchWithKeyword:(NSString *)keyword
{
BMKCitySearchOption *citySearchOption = [[BMKCitySearchOption alloc] init];
citySearchOption.pageIndex = pageIndex;//当前页码
citySearchOption.pageCapacity = pageCapacity;//每页个数
citySearchOption.city = city;
citySearchOption.keyword = keyword;//关键字
BOOL flag = [self.searcher poiSearchInCity:citySearchOption];
if(flag)
{
NSLog(@"周边检索发送成功");
}
else
{
NSLog(@"周边检索发送失败");
}
}
#pragma mark ----BMKPoiSearchDelegate
//实现PoiSearchDeleage处理回调结果
- (void)onGetPoiResult:(BMKPoiSearch*)searcher result:(BMKPoiResult*)poiResultList errorCode:(BMKSearchErrorCode)error
{
// NSArray *allArray = [NSArray arrayWithArray:self.mapView.annotations];
[self.mapView removeAnnotations:self.mapView.annotations];//清除屏幕中所有的annotation
if (error == BMK_SEARCH_NO_ERROR) {
// NSLog(@"检索搜索结果 == %@",poiResultList.poiInfoList);
NSLog(@"检索结果");
[self.nameArray removeAllObjects]; //把所有的对象移除
[self.addressArray removeAllObjects];
NSMutableArray *poiArray = [[NSMutableArray alloc] init];
for (BMKPoiInfo *poiInfo in poiResultList.poiInfoList)
{
NSLog(@"%@ %@ %@ %@ %@ %@ %d %f %f",poiInfo.name,poiInfo.uid,poiInfo.address,poiInfo.city,poiInfo.phone,poiInfo.postcode,poiInfo.epoitype,poiInfo.pt.latitude,poiInfo.pt.longitude);
BMKPointAnnotation *item = [[BMKPointAnnotation alloc] init];//表示一个点的对象
item.coordinate = poiInfo.pt;//把检索到的经纬度赋值给点
item.title = poiInfo.name; //赋值标题名称
[poiArray addObject:item];
[self.nameArray addObject:poiInfo.name];
[self.addressArray addObject:poiInfo.address];
}
[self.mapView addAnnotations:poiArray];//给地图添加大头针模型
[self.mapView showAnnotations:poiArray animated:YES];//显示地图标注
[self.poiTableView reloadData];//刷新表格
}
else if (error == BMK_SEARCH_AMBIGUOUS_KEYWORD){
//当在设置城市未找到结果,但在其他城市找到结果时,回调建议检索城市列表
// result.cityList;
NSLog(@"起始点有歧义");
} else {
NSLog(@"抱歉,未找到结果 %u",error);
}
}
#pragma mark ----BMKGeoCodeSearchDelegate
//根据 经纬度 获取 地区信息
- (void)onGetReverseGeoCodeResult:(BMKGeoCodeSearch *)searcher result:(BMKReverseGeoCodeResult *)result errorCode:(BMKSearchErrorCode)error
{
if (error == BMK_SEARCH_NO_ERROR)
{
NSString *address = result.address;
// result.addressDetail ///层次化地址信息
NSLog(@"我的位置在 %@",address);
}
else
{
NSLog(@"未找到结果 %u",error);
}
}
#pragma mark ----BMKMapViewDelegate
- (BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id<BMKAnnotation>)annotation
{
if ([annotation isKindOfClass:[BMKPointAnnotation class]]) {
//添加大头针标注
BMKPinAnnotationView *newAnnotationView = [[BMKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"myAnnotation"];
newAnnotationView.pinColor = BMKPinAnnotationColorPurple;
newAnnotationView.animatesDrop = YES;// 设置该标注点动画显示
return newAnnotationView;
}
return nil;
}
//点击地图空白处调用的接口
- (void)mapView:(BMKMapView *)mapView onClickedMapBlank:(CLLocationCoordinate2D)coordinate
{
[self.view endEditing:YES];
}
#pragma mark ----UITableViewDelegate,UITableViewDataSource
//单元格
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellString = @"cellString";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellString];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellString];
}
cell.textLabel.text = self.nameArray[indexPath.row];
cell.detailTextLabel.text = self.addressArray[indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
//每组个数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.nameArray.count;
}
//点击单元格触发的事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[[NSUserDefaults standardUserDefaults] setValue:self.nameArray[indexPath.row] forKey:@"addressString"];
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark ----懒加载
//地图
- (BMKMapView *)mapView
{
if (!_mapView) {
_mapView = [[BMKMapView alloc] initWithFrame:CGRectMake(0, 50/S_WIDTH, WIDTH, 200/S_HEIGHT)];
// [_mapView setZoomEnabled:YES];
// [_mapView setZoomLevel:15];//放大级别,3-19
_mapView.showMapScaleBar = YES;//比例尺
_mapView.mapScaleBarPosition = CGPointMake(10,_mapView.frame.size.height-45);//比例尺的位置
_mapView.showsUserLocation = YES;//显示当前设备的位置
// _mapView.userTrackingMode = BMKUserTrackingModeFollow;//定位跟随模式
[_mapView setMapType:BMKMapTypeStandard];//地图的样式(标准地图)
}
return _mapView;
}
//地图定位
- (BMKLocationService *)locService
{
if (!_locService)
{
_locService = [[BMKLocationService alloc] init];
_locService.delegate = self;
}
return _locService;
}
//地理编码对象
- (BMKGeoCodeSearch *)geocodesearch
{
if (!_geocodesearch)
{
_geocodesearch = [[BMKGeoCodeSearch alloc] init];
_geocodesearch.delegate = self;
}
return _geocodesearch;
}
//检索对象
- (BMKPoiSearch *)searcher
{
if (!_searcher)
{
_searcher = [[BMKPoiSearch alloc] init];
_searcher.delegate = self;
}
return _searcher;
}
//表格
- (UITableView *)poiTableView
{
if (!_poiTableView)
{
self.poiTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 250/S_HEIGHT, WIDTH, 170/S_HEIGHT) style:UITableViewStylePlain];
self.poiTableView.delegate = self;
self.poiTableView.dataSource = self;
}
return _poiTableView;
}

好了, 百度地图的简单实用完成了.该弄一下别的东西了


最近写的项目中又用到了线路规划这个功能,所以又稍微研究了一下.话不多说,直接上代码,代码复制就可以使用
.h


//
// WXQBMKPathPlanningViewController.h
// BMKDemo
//
// Created by 吴晓群 on 16/9/10.
// Copyright © 2016年 qunBadBoy. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WXQBMKPathPlanningViewController : UIViewController
@end

.m


//
// WXQBMKPathPlanningViewController.m
// BMKDemo
//
// Created by 吴晓群 on 16/9/10.
// Copyright © 2016年 qunBadBoy. All rights reserved.
//
#import "WXQBMKPathPlanningViewController.h"
#import <BaiduMapAPI_Map/BMKMapComponent.h> //引入地图功能所有的头文件
#import <BaiduMapAPI_Location/BMKLocationComponent.h> //引入定位功能所有的头文件
#import <BaiduMapAPI_Search/BMKSearchComponent.h> //引入检索功能所有的头文件
#import <BaiduMapAPI_Utils/BMKUtilsComponent.h>//引入计算工具所有的头文件

#define MYBUNDLE_NAME @ "mapapi.bundle"
#define MYBUNDLE_PATH [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: MYBUNDLE_NAME]
#define MYBUNDLE [NSBundle bundleWithPath: MYBUNDLE_PATH]
@interface RouteAnnotation : BMKPointAnnotation
{
int _type; ///<0:起点 1:终点 2:公交 3:地铁 4:驾乘 5:途经点
int _degree;
}
@property (nonatomic) int type;
@property (nonatomic) int degree;
@end
@implementation RouteAnnotation
@synthesize type = _type;
@synthesize degree = _degree;
@end
@interface WXQBMKPathPlanningViewController ()<BMKMapViewDelegate,BMKLocationServiceDelegate,BMKRouteSearchDelegate,BMKGeoCodeSearchDelegate>
@property (nonatomic, strong)BMKMapView *mapView; //百度地图视图
@property (nonatomic, strong)BMKLocationService*locService; //定位
@property (nonatomic, strong)BMKRouteSearch *searcher; //路径规划
@property (nonatomic, strong)BMKGeoCodeSearch *geocodesearch; //检索对象
@property (nonatomic)CLLocationCoordinate2D fromCoor; //位置
@end
@implementation WXQBMKPathPlanningViewController
#pragma mark ----视图将要出现,将要消息方法
- (void)viewWillAppear:(BOOL)animated
{
[_mapView viewWillAppear];
_mapView.delegate = self; // 此处记得不用的时候需要置nil,否则影响内存的释放
}
- (void)viewWillDisappear:(BOOL)animated
{
[_mapView viewWillDisappear];
_mapView.delegate = nil; // 不用时,置nil
_geocodesearch.delegate = nil;
_searcher.delegate = nil;
}
#pragma mark ----加载视图
- (void)viewDidLoad
{
[super viewDidLoad];
self.view = self.mapView;
[self.locService startUserLocationService]; //开启定位
}
#pragma mark ----BMK_LocationDelegate
/**
*定位失败后,会调用此函数
*@param error 错误号
*/
- (void)didFailToLocateUserWithError:(NSError *)error
{
NSLog(@"地图定位失败======%@",error);
}
//实现相关delegate 处理位置信息更新
//处理方向变更信息
- (void)didUpdateUserHeading:(BMKUserLocation *)userLocation
{
NSLog(@"heading = %@",userLocation.heading);
}
//处理位置坐标更新
- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
{
NSLog(@"didUpdateUserLocation lat %f,long %f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude);
//更新一次地图的位置 (只执行一次)
if ((userLocation.location.coordinate.latitude != 0 || userLocation.location.coordinate.longitude != 0))
{
[self.mapView updateLocationData:userLocation];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// 设置屏幕中心点
BMKCoordinateRegion region;
region.center.latitude = userLocation.location.coordinate.latitude;
region.center.longitude = userLocation.location.coordinate.longitude;
self.mapView.region = region;
self.fromCoor = CLLocationCoordinate2DMake(userLocation.location.coordinate.latitude, userLocation.location.coordinate.longitude);
[self geoCodeWithAddress:@"天安门"];
// //反向地理编码
// NSString *latitude = [NSString stringWithFormat:@"%f",userLocation.location.coordinate.latitude];
// NSString *longitude = [NSString stringWithFormat:@"%f",userLocation.location.coordinate.longitude];
// [self reverseGeoCodeWithLatitude:latitude withLongitude:longitude];
});
}
[self.locService stopUserLocationService];//关闭坐标更新
}
//#pragma mark ----反向地理编码
//- (void)reverseGeoCodeWithLatitude:(NSString *)latitude withLongitude:(NSString *)longitude
//{
// CLLocationCoordinate2D coor;
// coor.latitude = [latitude doubleValue];
// coor.longitude = [longitude doubleValue];
//
// BMKReverseGeoCodeOption *reverseGeocodeSearchOption = [[BMKReverseGeoCodeOption alloc] init];
// reverseGeocodeSearchOption.reverseGeoPoint = coor;
// BOOL flag = [self.geocodesearch reverseGeoCode:reverseGeocodeSearchOption];;
// if (flag)
// {
// NSLog(@"反地理编码成功");//可注释
// }
// else
// {
// NSLog(@"反地理编码失败");//可注释
// }
//}
#pragma mark ----地理编码
- (void)geoCodeWithAddress:(NSString *)address
{
BMKGeoCodeSearchOption *geoCodeSearchOption = [[BMKGeoCodeSearchOption alloc]init];
geoCodeSearchOption.city= @"北京";
geoCodeSearchOption.address = address;
BOOL flag = [self.geocodesearch geoCode:geoCodeSearchOption];
if(flag)
{
NSLog(@"geo检索发送成功");
}
else
{
NSLog(@"geo检索发送失败");
}
}
#pragma mark -- 地图路径规划
/**
* 步行路径规划
*
* @param fromPoint 出发位置
* @param toPoint 到点
*/
-(void)walkSearchFrom:(CLLocationCoordinate2D)fromPoint to:(CLLocationCoordinate2D)toPoint
{
BMKPlanNode* start = [[BMKPlanNode alloc]init];
start.pt = fromPoint;
BMKPlanNode* end = [[BMKPlanNode alloc]init];
end.pt = toPoint;
BMKWalkingRoutePlanOption *walkingRouteSearchOption = [[BMKWalkingRoutePlanOption alloc]init];
walkingRouteSearchOption.from = start;
walkingRouteSearchOption.to = end;
BOOL flag = [self.searcher walkingSearch:walkingRouteSearchOption];
if(flag)
{
NSLog(@"walk检索发送成功");
}
else
{
NSLog(@"walk检索发送失败");
}
}
/**
* 驾车路径规划
*
* @param fromPoint 出发位置
* @param toPoint 到点
*/
-(void)driveSearchFrom:(CLLocationCoordinate2D)fromPoint to:(CLLocationCoordinate2D)toPoint
{
BMKPlanNode* start = [[BMKPlanNode alloc]init];
start.pt = fromPoint;
BMKPlanNode* end = [[BMKPlanNode alloc]init];
end.pt = toPoint;
BMKDrivingRoutePlanOption *drivingRouteSearchOption = [[BMKDrivingRoutePlanOption alloc]init];
drivingRouteSearchOption.from = start;
drivingRouteSearchOption.to = end;
drivingRouteSearchOption.drivingRequestTrafficType = BMK_DRIVING_REQUEST_TRAFFICE_TYPE_NONE;//不获取路况信息
BOOL flag = [self.searcher drivingSearch:drivingRouteSearchOption];
if(flag)
{
NSLog(@"car检索发送成功");
}
else
{
NSLog(@"car检索发送失败");
}
}

#pragma mark -BMKGeoCodeSearchDelegate
////根据 经纬度 获取 地区信息 反向地理编码
//- (void)onGetReverseGeoCodeResult:(BMKGeoCodeSearch *)searcher result:(BMKReverseGeoCodeResult *)result errorCode:(BMKSearchErrorCode)error
//{
// if (error == BMK_SEARCH_NO_ERROR)
// {
// NSString *address = result.address;
// // result.addressDetail ///层次化地址信息
// NSLog(@"我的位置在 %@",address);
// }
// else
// {
// NSLog(@"未找到结果 %u",error);
// }
//}

//实现Deleage处理回调结果
//接收正向编码结果
- (void)onGetGeoCodeResult:(BMKGeoCodeSearch *)searcher result:(BMKGeoCodeResult *)result errorCode:(BMKSearchErrorCode)error
{
if (error == BMK_SEARCH_NO_ERROR)
{
//在此处理正常结果
NSLog(@"经纬度是 === %.2f %.2f",result.location.latitude, result.location.longitude);
// [self driveSearchFrom:self.fromCoor to:result.location];
[self walkSearchFrom:self.fromCoor to:result.location];
}
else
{
NSLog(@"抱歉,未找到结果");
}
}

//#pragma mark ----BMKMapViewDelegate
//- (BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id<BMKAnnotation>)annotation
//{
// if ([annotation isKindOfClass:[BMKPointAnnotation class]]) {
// //添加大头针标注
// BMKPinAnnotationView *newAnnotationView = [[BMKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"myAnnotation"];
// newAnnotationView.pinColor = BMKPinAnnotationColorPurple;
// newAnnotationView.animatesDrop = YES;// 设置该标注点动画显示
// return newAnnotationView;
// }
// return nil;
//}
#pragma mark -- BMKRouteSearchDelegate
- (void)onGetDrivingRouteResult:(BMKRouteSearch*)searcher result:(BMKDrivingRouteResult*)result errorCode:(BMKSearchErrorCode)error
{
NSArray* array = [NSArray arrayWithArray:self.mapView.annotations];
[self.mapView removeAnnotations:array];
array = [NSArray arrayWithArray:self.mapView.overlays];
[self.mapView removeOverlays:array];
if (error == BMK_SEARCH_NO_ERROR) {
BMKDrivingRouteLine* plan = (BMKDrivingRouteLine*)[result.routes objectAtIndex:0];
// 计算路线方案中的路段数目
NSInteger size = [plan.steps count];
int planPointCounts = 0;
for (int i = 0; i < size; i++) {
BMKDrivingStep* transitStep = [plan.steps objectAtIndex:i];
if(i==0){
RouteAnnotation* item = [[RouteAnnotation alloc]init];
item.coordinate = plan.starting.location;
item.title = @"起点";
item.type = 0;
[self.mapView addAnnotation:item]; // 添加起点标注
}else if(i==size-1){
RouteAnnotation* item = [[RouteAnnotation alloc]init];
item.coordinate = plan.terminal.location;
item.title = @"终点";
item.type = 1;
[self.mapView addAnnotation:item]; // 添加起点标注
}
// //添加annotation节点
// RouteAnnotation* item = [[RouteAnnotation alloc]init];
// item.coordinate = transitStep.entrace.location;
// item.title = transitStep.entraceInstruction;
// item.degree = transitStep.direction * 30;
// item.type = 4;
// [mapView addAnnotation:item];
//轨迹点总数累计
planPointCounts += transitStep.pointsCount;
}
// 添加途经点
// if (plan.wayPoints) {
// for (BMKPlanNode* tempNode in plan.wayPoints) {
// RouteAnnotation* item = [[RouteAnnotation alloc]init];
// item = [[RouteAnnotation alloc]init];
// item.coordinate = tempNode.pt;
// item.type = 5;
// item.title = tempNode.name;
// [mapView addAnnotation:item];
// }
// }
//轨迹点
BMKMapPoint * temppoints = new BMKMapPoint[planPointCounts];
int i = 0;
for (int j = 0; j < size; j++) {
BMKDrivingStep* transitStep = [plan.steps objectAtIndex:j];
int k=0;
for(k=0;k<transitStep.pointsCount;k++) {
temppoints[i].x = transitStep.points[k].x;
temppoints[i].y = transitStep.points[k].y;
i++;
}
}
// 通过points构建BMKPolyline
BMKPolyline* polyLine = [BMKPolyline polylineWithPoints:temppoints count:planPointCounts];
[self.mapView addOverlay:polyLine]; // 添加路线overlay
delete []temppoints;
[self mapViewFitPolyLine:polyLine];
}
}
- (void)onGetWalkingRouteResult:(BMKRouteSearch*)searcher result:(BMKWalkingRouteResult*)result errorCode:(BMKSearchErrorCode)error
{
NSArray* array = [NSArray arrayWithArray:self.mapView.annotations];
[self.mapView removeAnnotations:array];
array = [NSArray arrayWithArray:self.mapView.overlays];
[self.mapView removeOverlays:array];
if (error == BMK_SEARCH_NO_ERROR) {
BMKWalkingRouteLine* plan = (BMKWalkingRouteLine*)[result.routes objectAtIndex:0];
NSInteger size = [plan.steps count];
int planPointCounts = 0;
for (int i = 0; i < size; i++) {
BMKWalkingStep* transitStep = [plan.steps objectAtIndex:i];
if(i==0){
RouteAnnotation* item = [[RouteAnnotation alloc]init];
item.coordinate = plan.starting.location;
item.title = @"起点";
item.type = 0;
[self.mapView addAnnotation:item]; // 添加起点标注
}else if(i==size-1){
RouteAnnotation* item = [[RouteAnnotation alloc]init];
item.coordinate = plan.terminal.location;
item.title = @"终点";
item.type = 1;
[self.mapView addAnnotation:item]; // 添加起点标注
}
// //添加annotation节点
// RouteAnnotation* item = [[RouteAnnotation alloc]init];
// item.coordinate = transitStep.entrace.location;
// item.title = transitStep.entraceInstruction;
// item.degree = transitStep.direction * 30;
// item.type = 4;
// [mapView addAnnotation:item];
//轨迹点总数累计
planPointCounts += transitStep.pointsCount;
}
//轨迹点
BMKMapPoint * temppoints = new BMKMapPoint[planPointCounts];
int i = 0;
for (int j = 0; j < size; j++) {
BMKWalkingStep* transitStep = [plan.steps objectAtIndex:j];
int k=0;
for(k=0;k<transitStep.pointsCount;k++) {
temppoints[i].x = transitStep.points[k].x;
temppoints[i].y = transitStep.points[k].y;
i++;
}
}
// 通过points构建BMKPolyline
BMKPolyline* polyLine = [BMKPolyline polylineWithPoints:temppoints count:planPointCounts];
[self.mapView addOverlay:polyLine]; // 添加路线overlay
delete []temppoints;
[self mapViewFitPolyLine:polyLine];
}
}
//根据polyline设置地图范围
- (void)mapViewFitPolyLine:(BMKPolyline *) polyLine {
CGFloat ltX, ltY, rbX, rbY;
if (polyLine.pointCount < 1) {
return;
}
BMKMapPoint pt = polyLine.points[0];
ltX = pt.x, ltY = pt.y;
rbX = pt.x, rbY = pt.y;
for (int i = 1; i < polyLine.pointCount; i++) {
BMKMapPoint pt = polyLine.points[i];
if (pt.x < ltX) {
ltX = pt.x;
}
if (pt.x > rbX) {
rbX = pt.x;
}
if (pt.y > ltY) {
ltY = pt.y;
}
if (pt.y < rbY) {
rbY = pt.y;
}
}
BMKMapRect rect;
rect.origin = BMKMapPointMake(ltX , ltY);
rect.size = BMKMapSizeMake(rbX - ltX, rbY - ltY);
[self.mapView setVisibleMapRect:rect];
self.mapView.zoomLevel = self.mapView.zoomLevel - 0.3;
}
#pragma mark - BMKMapViewDelegate
- (BMKOverlayView*)mapView:(BMKMapView *)map viewForOverlay:(id<BMKOverlay>)overlay
{
if ([overlay isKindOfClass:[BMKPolyline class]]) {
BMKPolylineView* polylineView = [[BMKPolylineView alloc] initWithOverlay:overlay];
polylineView.fillColor = [[UIColor alloc] initWithRed:0 green:1 blue:1 alpha:1];
polylineView.strokeColor = [[UIColor alloc] initWithRed:0 green:0 blue:1 alpha:0.7];
polylineView.lineWidth = 3.0;
return polylineView;
}
return nil;
}
- (BMKAnnotationView *)mapView:(BMKMapView *)mapview viewForAnnotation:(id <BMKAnnotation>)annotation
{
if ([annotation.title isEqualToString:@"起点"])
{
NSLog(@"起点标注");
}
else if ([annotation.title isEqualToString:@"终点"])
{
NSLog(@"终点标注");
}
// if ([annotation isMemberOfClass:[RouteAnnotation class]])
// {
// return [self getRouteAnnotationView:self.mapView viewForAnnotation:(RouteAnnotation*)annotation];
// }
// else if ([annotation isMemberOfClass:[BMKPointAnnotation class]]) {
//
//
// BMKPinAnnotationView *newAnnotationView = [[BMKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"myAnnotation"];
// newAnnotationView.pinColor = BMKPinAnnotationColorPurple;
// newAnnotationView.animatesDrop = YES;// 设置该标注点动画显示
// newAnnotationView.annotation=annotation;
// newAnnotationView.image = [UIImage imageNamed:@"zuobiaotubiao"]; //把大头针换成别的图片
//
//
//
// // UIView *popView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 60)];
// // //设置弹出气泡图片
// // UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"wenzi"]];
// // image.frame = CGRectMake(0, 0, 100, 60);
// // [popView addSubview:image];
// // //自定义显示的内容
// // UILabel *driverName = [[UILabel alloc]initWithFrame:CGRectMake(0, 3, 100, 20)];
// // driverName.text = @"张XX师傅";
// // driverName.backgroundColor = [UIColor clearColor];
// // driverName.font = [UIFont systemFontOfSize:14];
// // driverName.textColor = [UIColor whiteColor];
// // driverName.textAlignment = NSTextAlignmentCenter;
// // [popView addSubview:driverName];
// //
// // UILabel *carName = [[UILabel alloc]initWithFrame:CGRectMake(0, 25, 100, 20)];
// // carName.text = @"京A123456";
// // carName.backgroundColor = [UIColor clearColor];
// // carName.font = [UIFont systemFontOfSize:14];
// // carName.textColor = [UIColor whiteColor];
// // carName.textAlignment = NSTextAlignmentCenter;
// // [popView addSubview:carName];
// // BMKActionPaopaoView *pView = [[BMKActionPaopaoView alloc]initWithCustomView:popView];
// // pView.frame = CGRectMake(0, 0, 100, 60);
// // ((BMKPinAnnotationView*)newAnnotationView).paopaoView = nil;
// // ((BMKPinAnnotationView*)newAnnotationView).paopaoView = pView;
// return newAnnotationView;
// }

return nil;
}
#pragma mark -- 获取起始、终点的标注View
- (BMKAnnotationView*)getRouteAnnotationView:(BMKMapView *)mapview viewForAnnotation:(RouteAnnotation*)routeAnnotation
{
BMKAnnotationView* view = nil;
switch (routeAnnotation.type) {
case 0:
{
view = [mapview dequeueReusableAnnotationViewWithIdentifier:@"start_node"];
if (view == nil) {
view = [[BMKAnnotationView alloc]initWithAnnotation:routeAnnotation reuseIdentifier:@"start_node"];
view.image = [UIImage imageWithContentsOfFile:[self getMyBundlePath1:@"images/icon_nav_start.png"]];
view.centerOffset = CGPointMake(0, -(view.frame.size.height * 0.5));
view.canShowCallout = TRUE;
}
view.annotation = routeAnnotation;
}
break;
case 1:
{
view = [mapview dequeueReusableAnnotationViewWithIdentifier:@"end_node"];
if (view == nil) {
view = [[BMKAnnotationView alloc]initWithAnnotation:routeAnnotation reuseIdentifier:@"end_node"];
view.image = [UIImage imageWithContentsOfFile:[self getMyBundlePath1:@"images/icon_nav_end.png"]];
view.centerOffset = CGPointMake(0, -(view.frame.size.height * 0.5));
view.canShowCallout = TRUE;
}
view.annotation = routeAnnotation;
}
break;
default:
break;
}
return view;
}
#pragma mark - 获取图片路径
- (NSString*)getMyBundlePath1:(NSString *)filename
{
NSBundle * libBundle = MYBUNDLE;
if ( libBundle && filename ){
NSString * s=[[libBundle resourcePath ] stringByAppendingPathComponent : filename];
return s;
}
return nil ;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispoself.mapViewse of any resources that can be recreated.
}
#pragma mark ----懒加载
//地图
- (BMKMapView *)mapView
{
if (!_mapView) {
_mapView = [[BMKMapView alloc] initWithFrame:self.view.frame];
[_mapView setZoomEnabled:YES];
[_mapView setZoomLevel:18];//放大级别,3-19
_mapView.showMapScaleBar = YES;//比例尺
_mapView.mapScaleBarPosition = CGPointMake(10,_mapView.frame.size.height-45);//比例尺的位置
_mapView.showsUserLocation=YES;//显示当前设备的位置
// _mapView.userTrackingMode = BMKUserTrackingModeFollow;//定位跟随模式
[_mapView setMapType:BMKMapTypeStandard];//地图的样式(标准地图)
}
return _mapView;
}
//地图定位
- (BMKLocationService *)locService
{
if (!_locService)
{
_locService = [[BMKLocationService alloc] init];
_locService.delegate = self;
}
return _locService;
}
//检索对象
- (BMKGeoCodeSearch *)geocodesearch
{
if (!_geocodesearch)
{
_geocodesearch = [[BMKGeoCodeSearch alloc] init];
_geocodesearch.delegate = self;
}
return _geocodesearch;
}
//路径规划对象
- (BMKRouteSearch *)searcher
{
if (!_searcher)
{
_searcher = [[BMKRouteSearch alloc] init];
_searcher.delegate = self;
}
return _searcher;
}
@end



相关阅读:
Top