大佬教程收集整理的这篇文章主要介绍了iphone – iOS编程中的中心地图,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我的教育猜测解决方案:我们检测用户是否放大或缩小,在没有放大或缩小检测三秒后,我们开始关注用户:).你的帮助会很棒:)
- (void)LOCATIOnManager:(CLLOCATIOnManager *)manager didupdateToLOCATIOn:(CLLOCATIOn *)newLOCATIOn fromLOCATIOn:(CLLOCATIOn *)oldLOCATIOn { MKCoordinateRegion userLOCATIOn = MKCoordinateRegionMakeWithDistance(newLOCATIOn.coordinate,1500.0,1500.0); [mapView setRegion:userLOCATIOn animated:YES]; }
#import <MapKit/MapKit.h> @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; MKMapView *mapView = [[MKMapView alloc] initWithFrame:self.view.frame]; //Always center the dot and zoom in to an apropriate zoom level when position changes [mapView setUserTrackingMode:MKUserTrackingModeFollow]; //don't let the user drag around the the map -> just zooming enabled [mapView setScrollEnabled:NO]; [self.view addSubview:mapView]; }
那么应用程序看起来像这样:
有关更多信息,请阅读Apple文档:
http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapView_Class/MKMapView/MKMapView.html
以上是大佬教程为你收集整理的iphone – iOS编程中的中心地图全部内容,希望文章能够帮你解决iphone – iOS编程中的中心地图所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。