///滚动显示自定义区域
- (void)CenterWithCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated
{
/*
CLLocationCoordinate2D theCenter;
MACoordinateRegion theRegin;
theCenter.latitude = coordinate.latitude;
theCenter.longitude = coordinate.longitude;
theRegin.center = theCenter;
MACoordinateSpan theSpan;
theSpan.latitudeDelta = 0.05;
theSpan.longitudeDelta = 0.05;
theRegin.span = theSpan;
[self.mapView setRegion:theRegin];
[self.mapView regionThatFits:theRegin];
*/
CLLocationCoordinate2D currentCoordinate = coordinate;
//设置显示区域 1 无缩放
// [self.mapView setCenterCoordinate:currentCoordinate animated:YES];
//设置显示区域 2
MACoordinateSpan span = {0.05, 0.05}; //显示范围精度
MACoordinateRegion region = {currentCoordinate, span}; //显示区域
[self.mapView setRegion:region animated:animated];
}
滚动显示自定义区域(高德地图)
最新推荐文章于 2023-09-22 15:45:00 发布