Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MKMapView refresh after pin moves

A custom AnnotationView is updated with new coordinates. But the problem is that it visually updates only after some manipulations with MKMapView, e.g. zooming or moving. What should I do to manually update visual position on a map?

PS. I've tried to change region to current map's region. But it does change zoom. It's strange.

[mapView setRegion:[mapView region] animated:YES];
like image 474
slatvick Avatar asked Jul 27 '09 19:07

slatvick


1 Answers

I am a little shoked after hours of research. The answer is just:

[mapView setCenterCoordinate:mapView.region.center animated:NO];

Do not ask me why, but it updates a mapview and it's what i was need.

like image 165
slatvick Avatar answered Oct 23 '22 03:10

slatvick