我怎样才能在我的MKMapView中获得更细粒度的跨度

我正在使用MKMapView,我正在像这样初始化:

homeLocation.latitude = 42.033126; homeLocation.longitude = -70.168621; [self.mapView setCenterCoordinate:homeLocation animated:NO]; MKCoordinateRegion viewRegion; viewRegion.center = homeLocation; viewRegion.span = MKCoordinateSpanMake(1.7, 1.7); [self.mapView setRegion:[self.mapView regionThatFits:viewRegion] animated:NO]; 

这是我的应用程序

在这里输入图像说明

这很好,除了我的应用程序,我需要让它缩小一点点。 但是当我尝试这个:

 viewRegion.span = MKCoordinateSpanMake(1.8, 1.8); // use span of 1.8, not 1.7 

我得到这个:

在这里输入图像说明

这是放大的出路。 如果我看看MKMapView的区域,纬度是3.54981,经度是3.51562。

我怎样才能将我的跨度设置为1.7和3.5之间的值? 我很乐意为这个特定的应用程序打2.25。

注意:mapview缩放放大到我想要的任何跨度。

MKCoordinateSpanMake使用度,1度约为69英里。 如果您想要更精细的设置,请改用MKCoordinateRegionMakeWithDistance。

 CLLocationCoordinate2D homeLocation; homeLocation.latitude = 42.033126; homeLocation.longitude = -70.168621; [self.mapView setCenterCoordinate:homeLocation animated:NO]; MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance( homeLocation, 200000, 200000); // 200000 meter is approximately 1.8 degree [self.mapView setRegion:[self.mapView regionThatFits:viewRegion] animated:NO]; 

你在设备上试过了吗? 有时我对设备上的缩放比在模拟器上有更多的控制。