高德地图---显示、定位、逆编码

2017-12-08  本文已影响274人  一笑wangx

[AMapServices sharedServices].apiKey = @"80985a4a5ea3794dd8155f9a4973526b";

pragma mark - 创建地图

-(void)createMap{

///初始化地图
self.mapView = [[MAMapView alloc] initWithFrame:CGRectMake(0, self.topView.bottom, SCREENWIDTH, SCREENHEIGHT - self.topView.bottom)];
self.mapView.showsCompass = NO; // 隐藏指南针
self.mapView.showsScale = NO; // 隐藏比例尺
self.mapView.language = MAMapLanguageZhCN;
self.mapView.mapType = MAMapTypeStandard;
self.mapView.zoomLevel = 17;
self.mapView.delegate = self;
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
self.mapView.showsUserLocation = YES;
self.mapView.userTrackingMode = MKUserTrackingModeFollow;
///把地图添加至view
[self.view addSubview:self.mapView];

}
// MARK: - 开始定位

上一篇下一篇

猜你喜欢

热点阅读