<MapKit/MapKit.h>
2016-06-14 22:46
155 查看
//*********************************创建地图视图8步骤***********************************************
1,代理<MKMapViewDelegate>
2.地理编码属性
@property (nonatomic, strong) CLGeocoder *geocoder;
3,地图视图属性
@property (nonatomic, strong) MKMapView *mapView;
4,位置管理属性
@property (nonatomic, strong) CLLocationManager *manager;
5,创建地图视图
_mapView =[ [MKMapView alloc] initWithFrame:[UIScreen mainScreen].bounds];
6,创建位置管理者
_manager = [CLLocationManager new];
//iOS8以后
7,[self.manager requestWhenInUseAuthorization];//询问用户是否同意定位
//假设用户同意
8,self.mapView.userTrackingMode = MKUserTrackingModeFollow;
//设置代理
9,self.mapView.delegate = self;
1,代理<MKMapViewDelegate>
2.地理编码属性
@property (nonatomic, strong) CLGeocoder *geocoder;
3,地图视图属性
@property (nonatomic, strong) MKMapView *mapView;
4,位置管理属性
@property (nonatomic, strong) CLLocationManager *manager;
5,创建地图视图
_mapView =[ [MKMapView alloc] initWithFrame:[UIScreen mainScreen].bounds];
6,创建位置管理者
_manager = [CLLocationManager new];
//iOS8以后
7,[self.manager requestWhenInUseAuthorization];//询问用户是否同意定位
//假设用户同意
8,self.mapView.userTrackingMode = MKUserTrackingModeFollow;
//设置代理
9,self.mapView.delegate = self;
相关文章推荐
- word 批量修改文档中的图片大小
- 常用居中方法记录
- c#创建目录和文件
- 中介者模式(Mediator Pattern)
- Uboot 2014.07 makefile分析
- 类似QQ、微信、微博的WeiBoLayout
- 软件工程课总结
- Deep Learning(深度学习)学习笔记整理系列之(六)AutoEncoder自动编码器
- ubuntu搭建ssh服务器,实现ssh免密码登录
- 堆和栈的区别
- Linux - 管道
- 转:成功的背后!(给所有IT人)
- 联合union
- 事后诸葛亮会议 未完成版
- NSArray使用小结
- AC-DC模块使用中 L N PE 与工作地的安全距离
- leetcode 198. House Robber
- Linux Heartbeat 安装与配置总结
- 二叉树交换左右节点
- unity时间使用