I have a function that 'centers' the view between all annotations, that was taken from a kind coder here on SO: https://stackoverflow.com/a/7200744/1497534
Everything works fine, until you have annotations very far away from each other. One can place an annotation in San Francisco and Central China, and it works fine. The function that centers the view will place you in Europe, because the zoom level is maxed. That behavior is what I want.
However, if you place an icon in San Francisco, and in Japan, the app crashes with this exception:
Invalid Region
<center:+39.84104733, +8.77916614 span:+178.18954061, +450.00000000>
Also note, that this only happens in portrait mode. Landscape can handle everything.
Is this because it is trying to zoom more than the mapkit can zoom?
Does it have to do with how the annotations are initially loaded, and then dequeued with dequeueWithReuseIdentifier? I have this in viewWillAppear:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(createAnnotations:) name:@"CreateAnnotations" object:nil];
I've hit a brick wall and would love some feedback.