iOS.定位服务与地图应用.05.跟踪用户位置变化
2014-06-22 10:51
691 查看
#import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface T20140621000000ViewController : UIViewController<MKMapViewDelegate> @property (weak, nonatomic) IBOutlet MKMapView *mapView; @end
#import "T20140621000000ViewController.h" @interface T20140621000000ViewController () @end @implementation T20140621000000ViewController - (void)viewDidLoad { [super viewDidLoad]; if ([CLLocationManager locationServicesEnabled]) { _mapView.mapType = MKMapTypeStandard; _mapView.delegate = self; _mapView.showsUserLocation = YES; [_mapView setUserTrackingMode:MKUserTrackingModeFollow animated:YES]; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } #pragma mark - #pragma mark Map View Delegate Methods - (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation { _mapView.centerCoordinate = userLocation.location.coordinate; } - (void)mapViewDidFailLoadingMap:(MKMapView *)theMapView withError:(NSError *)error { NSLog(@"error : %@",[error description]); } @end
相关文章推荐
- IOS学习之——地图2 跟踪用户位置变化
- (android地图开发) 基于百度Lbs服务定位用户的当前位置
- IOS应用开发中的tips - MKMapView之设置地图以用户当前位置为中心
- iOS.定位服务与地图应用.06.调用iOS苹果地图
- iOS.定位服务与地图应用.02.地理信息反编码
- 判断一个坐标点是否在一个无规则的多边形内 (iOS定位服务与地图应用开发:高德地图开发)
- iOS 6 开发---开发定位服务的App-在地图上标注位置
- ios 地图与定位(用户位置)
- iOS.定位服务与地图应用.07.调用谷歌Web地图
- iOS.定位服务与地图应用.03.地理信息编码查询
- iOS.定位服务与地图应用.01.定位服务编程
- iOS.定位服务与地图应用.04.使用iOS苹果地图
- IOS之地图和定位应用开发
- IOS 地图定位,标记位置,获取经纬度,MKMapView的使用
- IOS之地图和定位应用开发
- 百度地图API应用之——利用定位SDK和地图SDK来进行定位和显示当前位置
- iOS之地图和定位应用开发
- ios 里如何判断当前应用的定位服务是否可用
- IOS 地图位置定位
- Google地图推出实时定位跟踪服务Google Latitude 外遇的克星