Always reposition the annotation view using the standard -setCenter: setter, fixing KVO compliance for the center key path and making the view behave more like a normal view. -setCenter: updates the transform by side effect, and it always starts from the identity transform to avoid surprises. To apply a custom transform on an annotation view, make sure to apply it in -mapView:didFinishLoadingFrame:fullyRendered: based on the existing transform.
17 lines
364 B
Objective-C
17 lines
364 B
Objective-C
#import "MGLAnnotationView.h"
|
|
#import "MGLAnnotation.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@class MGLMapView;
|
|
|
|
@interface MGLAnnotationView (Private)
|
|
|
|
@property (nonatomic, readwrite, nullable) NSString *reuseIdentifier;
|
|
@property (nonatomic, readwrite, nullable) id <MGLAnnotation> annotation;
|
|
@property (nonatomic, weak) MGLMapView *mapView;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|