|
54 | 54 | #import "MGLUserLocation_Private.h"
|
55 | 55 | #import "MGLAnnotationImage_Private.h"
|
56 | 56 | #import "MGLAnnotationView_Private.h"
|
57 |
| -#import "MGLScaleBarView.h" |
| 57 | +#import "MGLScaleBar.h" |
58 | 58 | #import "MGLStyle_Private.h"
|
59 | 59 | #import "MGLStyleLayer_Private.h"
|
60 | 60 | #import "MGLMapboxEvents.h"
|
@@ -232,8 +232,8 @@ @interface MGLMapView () <UIGestureRecognizerDelegate,
|
232 | 232 | @property (nonatomic) EAGLContext *context;
|
233 | 233 | @property (nonatomic) GLKView *glView;
|
234 | 234 | @property (nonatomic) UIImageView *glSnapshotView;
|
235 |
| -@property (nonatomic, readwrite) MGLScaleBarView *scaleBarView; |
236 |
| -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *scaleControlViewConstraints; |
| 235 | +@property (nonatomic, readwrite) MGLScaleBar *scaleBar; |
| 236 | +@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *scaleBarConstraints; |
237 | 237 | @property (nonatomic, readwrite) UIImageView *compassView;
|
238 | 238 | @property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *compassViewConstraints;
|
239 | 239 | @property (nonatomic, readwrite) UIImageView *logoView;
|
@@ -502,10 +502,10 @@ - (void)commonInit
|
502 | 502 |
|
503 | 503 | // setup scale control
|
504 | 504 | //
|
505 |
| - _scaleBarView = [[MGLScaleBarView alloc] init]; |
506 |
| - _scaleBarView.translatesAutoresizingMaskIntoConstraints = NO; |
507 |
| - [self addSubview:_scaleBarView]; |
508 |
| - _scaleControlViewConstraints = [NSMutableArray array]; |
| 505 | + _scaleBar = [[MGLScaleBar alloc] init]; |
| 506 | + _scaleBar.translatesAutoresizingMaskIntoConstraints = NO; |
| 507 | + [self addSubview:_scaleBar]; |
| 508 | + _scaleBarConstraints = [NSMutableArray array]; |
509 | 509 |
|
510 | 510 | // setup interaction
|
511 | 511 | //
|
@@ -786,28 +786,28 @@ - (void)updateConstraints
|
786 | 786 | {
|
787 | 787 | // scale control
|
788 | 788 | //
|
789 |
| - [self removeConstraints:self.scaleControlViewConstraints]; |
790 |
| - [self.scaleControlViewConstraints removeAllObjects]; |
| 789 | + [self removeConstraints:self.scaleBarConstraints]; |
| 790 | + [self.scaleBarConstraints removeAllObjects]; |
791 | 791 |
|
792 |
| - [self.scaleControlViewConstraints addObject: |
793 |
| - [NSLayoutConstraint constraintWithItem:self.scaleBarView |
| 792 | + [self.scaleBarConstraints addObject: |
| 793 | + [NSLayoutConstraint constraintWithItem:self.scaleBar |
794 | 794 | attribute:NSLayoutAttributeTop
|
795 | 795 | relatedBy:NSLayoutRelationEqual
|
796 | 796 | toItem:self
|
797 | 797 | attribute:NSLayoutAttributeTop
|
798 | 798 | multiplier:1
|
799 | 799 | constant:5+self.contentInset.top]];
|
800 | 800 |
|
801 |
| - [self.scaleControlViewConstraints addObject: |
802 |
| - [NSLayoutConstraint constraintWithItem:self.scaleBarView |
| 801 | + [self.scaleBarConstraints addObject: |
| 802 | + [NSLayoutConstraint constraintWithItem:self.scaleBar |
803 | 803 | attribute:NSLayoutAttributeLeading
|
804 | 804 | relatedBy:NSLayoutRelationEqual
|
805 | 805 | toItem:self
|
806 | 806 | attribute:NSLayoutAttributeLeading
|
807 | 807 | multiplier:1
|
808 | 808 | constant:8 + self.contentInset.left]];
|
809 | 809 |
|
810 |
| - [self addConstraints:self.scaleControlViewConstraints]; |
| 810 | + [self addConstraints:self.scaleBarConstraints]; |
811 | 811 |
|
812 | 812 | // compass
|
813 | 813 | //
|
@@ -4805,8 +4805,8 @@ - (void)cameraIsChanging {
|
4805 | 4805 |
|
4806 | 4806 | [self updateCompass];
|
4807 | 4807 |
|
4808 |
| - if (!self.scaleBarView.hidden) { |
4809 |
| - [(MGLScaleBarView *)self.scaleBarView setMetersPerPoint:[self metersPerPointAtLatitude:self.centerCoordinate.latitude]]; |
| 4808 | + if (!self.scaleBar.hidden) { |
| 4809 | + [(MGLScaleBar *)self.scaleBar setMetersPerPoint:[self metersPerPointAtLatitude:self.centerCoordinate.latitude]]; |
4810 | 4810 | }
|
4811 | 4811 |
|
4812 | 4812 | if ([self.delegate respondsToSelector:@selector(mapViewRegionIsChanging:)])
|
@@ -5199,7 +5199,7 @@ - (CGPoint)userLocationAnnotationViewCenter
|
5199 | 5199 |
|
5200 | 5200 | - (void)notifyScaleBarGestureDidEnd
|
5201 | 5201 | {
|
5202 |
| - [(MGLScaleBarView *)self.scaleBarView fadeOut]; |
| 5202 | + [(MGLScaleBar *)self.scaleBar fadeOut]; |
5203 | 5203 | }
|
5204 | 5204 |
|
5205 | 5205 | - (void)updateCompass
|
|
0 commit comments