概述
- (void)viewDidLoad { NSLog(@"进入GRailwayController.m的viewDidLoad方法"); [super viewDidLoad]; zoomLevel = 3.0f;//启动BMKMapManager bmkMapManager = [[BMKMapManager alloc]init]; BOOL ret = [bmkMapManager start:@"2772BD5CAFF652491F65707D6D5E9ABEBF3639CC" generalDelegate:self]; if (!ret) { NSLog(@"manager start faile d!"); } //创建一张百度地图 _mapView = [[BMKMapView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)]; _mapView.delegate = self; [webView addSubview:_mapView]; mapCenterLat = 35.91039f; mapCenterLon = 116.89017f; [self setMapCenter]; //初始化自定义的气泡view bubbleView = [[KYBubbleView alloc] initWithFrame:CGRectMake(0, 0, 160, 40)]; bubbleView.hidden = YES; dataArray = [[NSMutableArray alloc] initWithCapacity:10]; }
-(void)setMapCenter //设置地图的中心位置 { mapCenterCoordinate.latitude = mapCenterLat; mapCenterCoordinate.longitude = mapCenterLon; [_mapView setRegion:BMKCoordinateRegionMake(mapCenterCoordinate,BMKCoordinateSpanMake(zoomLevel,zoomLevel))]; NSLog(@"=========%f,%f,%f",mapCenterLat,mapCenterLon,zoomLevel); }
转载于:https://www.cnblogs.com/ygm900/archive/2013/05/22/3092642.html
最后
以上就是默默期待为你收集整理的设置 百度地图 的显示的地图中心 和缩放级别的全部内容,希望文章能够帮你解决设置 百度地图 的显示的地图中心 和缩放级别所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复