iOS开发中的地图开发

显示地图:

1、导入头文件  

#import <MapKit/MapKit.h>

  如果同时需要用户定位的话还需要

#import <CoreLocation/CoreLocation.h

 

2.显示用户当前位置

// 1.用CLLocationManager开启用户定位
// 2. mapView显示用户位置
    mapView.showsUserLocation = YES; 
// 3.开启用户定位
    [self.locationManager startUpdatingLocation];

 

posted @ 2017-05-23 10:31  harry_h  阅读(160)  评论(0编辑  收藏  举报