我有地图视图,它设置为放大用户当前位置。问题是,如果用户在查看地图时更改位置,则会放大回当前位置。这使得我无法使用我计划要做的功能。我将在地图上有多个引脚,但如果位置发生变化,用户将无法查看所有这些引脚。即使当我的设备坐在我的桌子上时,位置也会不断变化,因此地图始终将用户从他们正在查看的地图的任何部分带回到其当前位置的缩放视图。有没有人有任何想法呢?放大当前位置在地图视图
- (void)foundLocation:(CLLocation *)loc
{
CLLocationCoordinate2D coord = [loc coordinate];
// Zoom the region to this location
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(coord, 250, 250);
[worldView setRegion:region animated:YES];
[activityIndicator stopAnimating];
[locationManager stopUpdatingLocation];
}
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
CLLocationCoordinate2D loc = [userLocation coordinate];
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(loc, 250, 250);
[worldView setRegion:region animated:YES];
}
停止移动第一事件后的地图......你应该在获取用户位置后定位地图。如果您需要帮助,请显示您如何定位它的代码。 – iwasrobbed 2013-05-03 22:51:06