diff options
Diffstat (limited to 'platform/ios/app')
-rw-r--r-- | platform/ios/app/MBXAnnotationView.h | 3 | ||||
-rw-r--r-- | platform/ios/app/MBXAnnotationView.m | 20 | ||||
-rw-r--r-- | platform/ios/app/MBXViewController.m | 10 |
3 files changed, 8 insertions, 25 deletions
diff --git a/platform/ios/app/MBXAnnotationView.h b/platform/ios/app/MBXAnnotationView.h index 78dfe17699..5337ffae57 100644 --- a/platform/ios/app/MBXAnnotationView.h +++ b/platform/ios/app/MBXAnnotationView.h @@ -1,7 +1,4 @@ #import <Mapbox/Mapbox.h> @interface MBXAnnotationView : MGLAnnotationView - -@property (nonatomic) UIColor *centerColor; - @end diff --git a/platform/ios/app/MBXAnnotationView.m b/platform/ios/app/MBXAnnotationView.m index 82af15314a..61f9b1c047 100644 --- a/platform/ios/app/MBXAnnotationView.m +++ b/platform/ios/app/MBXAnnotationView.m @@ -1,28 +1,16 @@ #import "MBXAnnotationView.h" @interface MBXAnnotationView () - -@property (nonatomic) UIView *centerView; - @end @implementation MBXAnnotationView - (void)layoutSubviews { [super layoutSubviews]; - if (!self.centerView) { - self.backgroundColor = [UIColor blueColor]; - self.centerView = [[UIView alloc] initWithFrame:CGRectInset(self.bounds, 1.0, 1.0)]; - self.centerView.backgroundColor = self.centerColor; - [self addSubview:self.centerView]; - } -} - -- (void)setCenterColor:(UIColor *)centerColor { - if (![_centerColor isEqual:centerColor]) { - _centerColor = centerColor; - self.centerView.backgroundColor = centerColor; - } + + self.layer.borderColor = [UIColor blueColor].CGColor; + self.layer.borderWidth = 1; + self.layer.cornerRadius = 2; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index ed312e87a2..3fdd88fad8 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -587,22 +587,20 @@ static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXVie { annotationView = [[MBXAnnotationView alloc] initWithReuseIdentifier:MBXViewControllerAnnotationViewReuseIdentifer]; annotationView.frame = CGRectMake(0, 0, 10, 10); - annotationView.centerColor = [UIColor whiteColor]; - + annotationView.backgroundColor = [UIColor whiteColor]; + // uncomment to make the annotation view draggable // also note that having two long press gesture recognizers on overlapping views (`self.view` & `annotationView`) will cause weird behaviour // comment out the pin dropping functionality in the handleLongPress: method in this class to make draggable annotation views play nice annotationView.draggable = YES; - - + // uncomment to force annotation view to maintain a constant size when the map is tilted // by default, annotation views will shrink and grow as the move towards and away from the // horizon. Relatedly, annotations backed by GL sprites ONLY scale with viewing distance currently. // annotationView.scalesWithViewingDistance = NO; - } else { // orange indicates that the annotation view was reused - annotationView.centerColor = [UIColor orangeColor]; + annotationView.backgroundColor = [UIColor orangeColor]; } return annotationView; } |