[ios] Allow annotation views to be flattened (#5067)
* [ios] wip flatten annotation view * [ios] wip flatten annotation view * [ios] naming conventions * [ios] removed unused property
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#import "MGLAnnotationView.h"
|
||||
#import "MGLAnnotationView_Private.h"
|
||||
#import "MGLMapView.h"
|
||||
|
||||
@interface MGLAnnotationView ()
|
||||
|
||||
@property (nonatomic) id<MGLAnnotation> annotation;
|
||||
@property (nonatomic, readwrite, nullable) NSString *reuseIdentifier;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLAnnotationView
|
||||
@@ -34,10 +34,26 @@
|
||||
}
|
||||
|
||||
- (void)setCenter:(CGPoint)center
|
||||
{
|
||||
[self setCenter:center pitch:0];
|
||||
}
|
||||
|
||||
- (void)setCenter:(CGPoint)center pitch:(CGFloat)pitch
|
||||
{
|
||||
center.x += _centerOffset.dx;
|
||||
center.y += _centerOffset.dy;
|
||||
|
||||
[super setCenter:center];
|
||||
|
||||
if (_flat) {
|
||||
[self updatePitch:pitch];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updatePitch:(CGFloat)pitch
|
||||
{
|
||||
CATransform3D t = CATransform3DRotate(CATransform3DIdentity, MGLRadiansFromDegrees(pitch), 1.0, 0, 0);
|
||||
self.layer.transform = t;
|
||||
}
|
||||
|
||||
- (id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event
|
||||
|
||||
Reference in New Issue
Block a user