地图的使用
来源:互联网 发布:上国际学校的利弊知乎 编辑:程序博客网 时间:2024/04/28 07:15
<pre name="code" class="objc">
#import "ViewController.h"#import <MapKit/MapKit.h>@interface ViewController ()<MKMapViewDelegate>@property(nonatomic, retain)MKMapView *map;@property(nonatomic, retain)CLGeocoder *geocoder;@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.map = [[MKMapView alloc]initWithFrame:self.view.frame]; self.map.delegate = self; self.map.showsUserLocation = YES; [self.view addSubview:self.map]; self.geocoder = [[CLGeocoder alloc]init]; [self.geocoder geocodeAddressString:@"黑石礁汽车站,大连市,辽宁省" completionHandler:^(NSArray *placemarks, NSError *error) { MKPlacemark *placemark = [[MKPlacemark alloc]initWithPlacemark:[placemarks lastObject]]; [self.map addAnnotation:placemark]; [self.map setRegion:MKCoordinateRegionMake(self.map.centerCoordinate, MKCoordinateSpanMake(0.01f, 0.0f)) animated:YES]; }];}-(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation{ mapView.centerCoordinate = userLocation.coordinate;//中心点的坐标为用户坐标}
0 0
- 地图的使用 GoogleMapAPI
- google地图的使用
- 地图编辑器的使用
- 使用地图的意义
- google地图的使用
- TiledMap地图的使用
- 地图的使用
- 系统地图的使用
- iOS地图的使用
- MAP地图的使用
- 百度地图的使用
- 地图的使用
- 地图的使用(定位)
- 地图的基础使用
- 地图的使用-King
- 地图的使用详解
- 安卓高德地图的使用
- 安卓高德地图的使用
- Apache karaf端口配置
- android.database.sqlite.databaseobjectnotclosedexception:应用程序没有关闭的光标或数据库对象
- Win8系统设置WiFi热点的方法
- 如何使用Ping命令检查不能联网的原因
- IOS 多线程
- 地图的使用
- 浅谈核方法
- 什么是3G无线上网
- p2v
- VS2010 对象或库文件“*.lib”是使用比创建其他对象所用编译器旧的编译器创建的
- 孕妇可以吃哪些休闲食品
- Github 初尝试
- Matlab Tips
- MySQL多主机复制 (MMM)