如何在我的当前位置设置标记并在百度地图中更改相机位置(objective c)
how to set marker at my current location and change camera position in Baidu Map (objective c)
我在我的代码中使用 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;
}
CLLocationCoordinate2D coor;
coor.latitude = 22.2593;
coor.longitude = 70.7777;
mapView.centerCoordinate = coor
试试这个来改变相机
给你
- (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;
}
我在我的代码中使用 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;
}
CLLocationCoordinate2D coor;
coor.latitude = 22.2593;
coor.longitude = 70.7777;
mapView.centerCoordinate = coor
试试这个来改变相机
给你
- (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;
}