0

我正在尝试设置区域,但是当我设置区域时,地图冻结并且我无法移动地图...

这是我的代码

 -(void) configurarZoomDoMapaComLatitude:(double)latitude eLongitude:(double)longitude {
_myMapView.userInteractionEnabled = YES;
CLLocation *localizacao = [[CLLocation alloc]initWithLatitude:latitude longitude:longitude]; //regiao de ref. (usar localizacao atual)
double miles = 0.5; // quanto menor, mais próximo
double scalingFactor = ABS( (cos(2 * M_PI * localizacao.coordinate.latitude / 360.0) ));

MKCoordinateSpan span;
span.latitudeDelta = miles/69.0;
span.longitudeDelta = miles/(scalingFactor * 69.0);

MKCoordinateRegion region;
region.span = span;
region.center = localizacao.coordinate;
[_myMapView setRegion:region animated:YES];
}
4

1 回答 1

-3

我已经解决了这个问题......我在地图添加中做了一个视图......我删除了它并且它有效!谢谢大家

于 2013-02-21T16:34:21.363 回答