如何在我的应用中自动缩放我的userLocation上的地图? 我有以下代码zomm在地图上,但我必须放大userLocation和下面的代码放大总是非洲?放大用户位置
MKCoordinateRegion zoomIn = mapView.region;
zoomIn.span.latitudeDelta *= 0.2;
zoomIn.span.longitudeDelta *= 0.2;
zoomIn.center.latitude = mapView.userLocation.location.coordinate.latitude;
zoomIn.center.longitude = mapView.userLocation.location.coordinate.longitude;
[mapView setRegion:zoomIn animated:YES];
为了新手的利益:有时当它工作正常时,它可能仍然从大西洋离开非洲海岸,因为你在模拟器中运行它,位置(在调试下)设置为无 – aremvee 2014-09-25 12:23:51