EDIT:
As @Anna Karenina made me realize, I was using MKPinAnnotationView instead of MKAnnotationView. Apparently MKPinAnnotation has a baked in centerOffset, that is the reason behind the strange behaviour.
THE ORIGINAL ANSWER:
For anyone having the same issue, this seems to be a bug in iOS7.
Workaround:
Subclass MKAnnotationView
and overwrite the setter method
for the centerOffset
property.
Nothing new in the .h header file, and this is how the .m implementation file should look like:
#import "MyAnnotationView.h"
@implementation MyAnnotationView
@synthesize centerOffset = _centerOffset;
-(id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)setCenterOffset:(CGPoint)centerOffset {
_centerOffset = centerOffset;
}
@end
Don't miss the @synthesize
part on the top!