发布网友 发布时间:2022-04-20 05:08
共1个回答
热心网友 时间:2023-08-31 06:25
显示到当前定位位置
-(void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
{
NSLog(@"当前位置%f,%f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude);
[_mapView updateLocationData:userLocation];
_mapView.centerCoordinate = userLocation.location.coordinate;
CLLocationCoordinate2D loc = [userLocation.location coordinate];
//放大地图到自身的经纬度位置。
BMKCoordinateRegion viewRegion = BMKCoordinateRegionMake(loc, BMKCoordinateSpanMake(0.02f,0.02f));
BMKCoordinateRegion adjustedRegion = [_mapView regionThatFits:viewRegion];
[_mapView setRegion:adjustedRegion animated:YES];
}