您的位置:首页 > 移动开发 > IOS开发

iOS初始化一个高德地图大概需要多少东西

2016-05-11 10:43 681 查看
- (MAMapView *)mapView{
if (!_mapView) {
[MAMapServices sharedServices].apiKey = GaoDeKey;

_mapView = [[MAMapView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds))];
_mapView.delegate = self;
_mapView.showTraffic=YES;
_mapView.showsScale=NO;
_mapView.showsCompass=NO;
_mapView.showsUserLocation=YES;
_mapView.centerCoordinate = _mapView.userLocation.location.coordinate;
_mapView.userTrackingMode = MAUserTrackingModeFollow;
float zoomLevel = 0.01;
MACoordinateRegion region = MACoordinateRegionMake(_mapView.userLocation.location.coordinate,
MACoordinateSpanMake(zoomLevel, zoomLevel));

region.center = _mapView.userLocation.location.coordinate;
[self.mapView setRegion:region];

}
return _mapView;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: