您的位置:首页 > 其它

<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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: