// Created by 张建 on 17/5/9.
// Copyright © 2017年 zhangjian. All rights reserved.
#import "ViewController.h"
@interface ViewController ()<BMKMapViewDelegate, BMKLocationServiceDelegate, BMKGeoCodeSearchDelegate>
{
//地图
BMKMapView* _mapView;
//定位
BMKLocationService* _locService;
BMKGeoCodeSearch *_geocodesearch; //地理编码主类,用来查询、返回结果信息
BMKPointAnnotation *_pointAnnotation;
CLLocationCoordinate2D coord;
NSString *address;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
//添加地图
[self addBaiduMap];
_geocodesearch = [[BMKGeoCodeSearch alloc] init];
// _geocodesearch.delegate = self;
//开始定位
[self startLocation];
}
- (void)addBaiduMap{
_mapView = [[BMKMapView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
_mapView.mapType = BMKMapTypeStandard;//设置地图为空白类型
_mapView.showsUserLocation = YES;//是否显示定位图层(即我的位置的小圆点)
[_mapView setZoomLevel:19.0];
// _mapView.userTrackingMode = BMKUserTrackingModeFollow;
[self.view addSubview:_mapView];
//去除百度地图定位后的蓝色圆圈和定位蓝点(精度圈)
BMKLocationViewDisplayParam *displayParam = [[BMKLocationViewDisplayParam alloc]init];
displayParam.isAccuracyCircleShow = false;//