0

我在我的代码中使用pod 'BaiduMapKit'配置百度地图并在视图中显示地图。如何在百度地图中的当前位置设置标记并更改相机位置?

// 现在我解决了如何设置标记但实际上我的相机位置没有移动。

- (void)viewDidLoad {
           [super viewDidLoad];
           anotation = [[BMKPointAnnotation alloc]init];
           CLLocationCoordinate2D coor;

           coor.latitude  = 22.2593;
           coor.longitude  = 70.7777;
           anotation.coordinate = coor;
           anotation.title  = @"this is rajkot";
           [mapView addAnnotation:anotation];
           mapView.delegate = self;

     }
4

2 回答 2

2
CLLocationCoordinate2D coor;
coor.latitude  = 22.2593;
coor.longitude  = 70.7777;
mapView.centerCoordinate = coor

试试这个来换相机

于 2017-03-21T09:34:48.487 回答
1

给你

- (void)viewDidLoad {
       [super viewDidLoad];

       anotation = [[BMKPointAnnotation alloc]init];
       CLLocationCoordinate2D coor;
       coor.latitude  = 22.2593;
       coor.longitude  = 70.7777;
       anotation.coordinate = coor;
       anotation.title  = @"this is rajkot";
       [mapView addAnnotation:anotation];
       mapView.centerCoordinate = coor;
       mapView.delegate = self;
 }
于 2017-04-19T11:51:32.400 回答