Pergunta

I'm trying to setRegion, but when i set the region, the map freeze and I can't move the map...

here is my code

 -(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];
}
Foi útil?

Solução

I have solved this problem... I did a view in map add...I remove this and it works! Thx all

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top