Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 9a7bfd2

Browse files
committed
[ios] Rename and various optimizations
1 parent 402f61d commit 9a7bfd2

File tree

5 files changed

+138
-125
lines changed

5 files changed

+138
-125
lines changed

platform/ios/ios.xcodeproj/project.pbxproj

+8-8
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
3557F7B21E1D27D300CCA5E6 /* MGLDistanceFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3557F7AF1E1D27D300CCA5E6 /* MGLDistanceFormatter.m */; };
8282
35599DED1D46F14E0048254D /* MGLStyleValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35599DEA1D46F14E0048254D /* MGLStyleValue.mm */; };
8383
35599DEE1D46F14E0048254D /* MGLStyleValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35599DEA1D46F14E0048254D /* MGLStyleValue.mm */; };
84-
355AE0011E9281DA00F3939D /* MGLScaleBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 355ADFFC1E9281DA00F3939D /* MGLScaleBarView.m */; };
85-
355AE0021E9281DA00F3939D /* MGLScaleBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 355ADFFC1E9281DA00F3939D /* MGLScaleBarView.m */; };
84+
355AE0011E9281DA00F3939D /* MGLScaleBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 355ADFFC1E9281DA00F3939D /* MGLScaleBar.mm */; };
85+
355AE0021E9281DA00F3939D /* MGLScaleBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 355ADFFC1E9281DA00F3939D /* MGLScaleBar.mm */; };
8686
3566C7661D4A77BA008152BC /* MGLShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7641D4A77BA008152BC /* MGLShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
8787
3566C7671D4A77BA008152BC /* MGLShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7641D4A77BA008152BC /* MGLShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
8888
3566C7681D4A77BA008152BC /* MGLShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C7651D4A77BA008152BC /* MGLShapeSource.mm */; };
@@ -578,8 +578,8 @@
578578
3557F7AE1E1D27D300CCA5E6 /* MGLDistanceFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLDistanceFormatter.h; sourceTree = "<group>"; };
579579
3557F7AF1E1D27D300CCA5E6 /* MGLDistanceFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLDistanceFormatter.m; sourceTree = "<group>"; };
580580
35599DEA1D46F14E0048254D /* MGLStyleValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleValue.mm; sourceTree = "<group>"; };
581-
355ADFFB1E9281DA00F3939D /* MGLScaleBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLScaleBarView.h; sourceTree = "<group>"; };
582-
355ADFFC1E9281DA00F3939D /* MGLScaleBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLScaleBarView.m; sourceTree = "<group>"; };
581+
355ADFFB1E9281DA00F3939D /* MGLScaleBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLScaleBar.h; sourceTree = "<group>"; };
582+
355ADFFC1E9281DA00F3939D /* MGLScaleBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLScaleBar.mm; sourceTree = "<group>"; };
583583
3566C7641D4A77BA008152BC /* MGLShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeSource.h; sourceTree = "<group>"; };
584584
3566C7651D4A77BA008152BC /* MGLShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShapeSource.mm; sourceTree = "<group>"; };
585585
3566C76A1D4A8DFA008152BC /* MGLRasterSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterSource.h; sourceTree = "<group>"; };
@@ -1036,8 +1036,8 @@
10361036
355ADFF91E9281C300F3939D /* Views */ = {
10371037
isa = PBXGroup;
10381038
children = (
1039-
355ADFFB1E9281DA00F3939D /* MGLScaleBarView.h */,
1040-
355ADFFC1E9281DA00F3939D /* MGLScaleBarView.m */,
1039+
355ADFFB1E9281DA00F3939D /* MGLScaleBar.h */,
1040+
355ADFFC1E9281DA00F3939D /* MGLScaleBar.mm */,
10411041
);
10421042
name = Views;
10431043
sourceTree = "<group>";
@@ -2191,7 +2191,7 @@
21912191
DA88482B1CBAFA6200AB86E3 /* MGLTypes.m in Sources */,
21922192
4018B1C71CDC287F00F666AF /* MGLAnnotationView.mm in Sources */,
21932193
404C26E41D89B877000AA13D /* MGLTileSource.mm in Sources */,
2194-
355AE0011E9281DA00F3939D /* MGLScaleBarView.m in Sources */,
2194+
355AE0011E9281DA00F3939D /* MGLScaleBar.mm in Sources */,
21952195
DA88481D1CBAFA6200AB86E3 /* MGLMapCamera.mm in Sources */,
21962196
DA8848261CBAFA6200AB86E3 /* MGLPolygon.mm in Sources */,
21972197
35B82BFA1D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm in Sources */,
@@ -2270,7 +2270,7 @@
22702270
DAA4E4321CBB730400178DFB /* MGLMapView.mm in Sources */,
22712271
DAA4E41E1CBB730400178DFB /* MGLMapCamera.mm in Sources */,
22722272
404C26E51D89B877000AA13D /* MGLTileSource.mm in Sources */,
2273-
355AE0021E9281DA00F3939D /* MGLScaleBarView.m in Sources */,
2273+
355AE0021E9281DA00F3939D /* MGLScaleBar.mm in Sources */,
22742274
4018B1C81CDC287F00F666AF /* MGLAnnotationView.mm in Sources */,
22752275
DAA4E4341CBB730400178DFB /* MGLFaux3DUserLocationAnnotationView.m in Sources */,
22762276
35B82BFB1D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm in Sources */,

platform/ios/src/MGLMapView.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ IB_DESIGNABLE
232232
when the interaction stops. The scale bar is positioned in the upper-left
233233
corner.
234234
*/
235-
@property (nonatomic, readonly) UIView *scaleBarView;
235+
@property (nonatomic, readonly) UIView *scaleBar;
236236

237237
/**
238238
A control indicating the map’s direction and allowing the user to manipulate

platform/ios/src/MGLMapView.mm

+17-17
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#import "MGLUserLocation_Private.h"
5555
#import "MGLAnnotationImage_Private.h"
5656
#import "MGLAnnotationView_Private.h"
57-
#import "MGLScaleBarView.h"
57+
#import "MGLScaleBar.h"
5858
#import "MGLStyle_Private.h"
5959
#import "MGLStyleLayer_Private.h"
6060
#import "MGLMapboxEvents.h"
@@ -232,8 +232,8 @@ @interface MGLMapView () <UIGestureRecognizerDelegate,
232232
@property (nonatomic) EAGLContext *context;
233233
@property (nonatomic) GLKView *glView;
234234
@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;
237237
@property (nonatomic, readwrite) UIImageView *compassView;
238238
@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *compassViewConstraints;
239239
@property (nonatomic, readwrite) UIImageView *logoView;
@@ -502,10 +502,10 @@ - (void)commonInit
502502

503503
// setup scale control
504504
//
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];
509509

510510
// setup interaction
511511
//
@@ -786,28 +786,28 @@ - (void)updateConstraints
786786
{
787787
// scale control
788788
//
789-
[self removeConstraints:self.scaleControlViewConstraints];
790-
[self.scaleControlViewConstraints removeAllObjects];
789+
[self removeConstraints:self.scaleBarConstraints];
790+
[self.scaleBarConstraints removeAllObjects];
791791

792-
[self.scaleControlViewConstraints addObject:
793-
[NSLayoutConstraint constraintWithItem:self.scaleBarView
792+
[self.scaleBarConstraints addObject:
793+
[NSLayoutConstraint constraintWithItem:self.scaleBar
794794
attribute:NSLayoutAttributeTop
795795
relatedBy:NSLayoutRelationEqual
796796
toItem:self
797797
attribute:NSLayoutAttributeTop
798798
multiplier:1
799799
constant:5+self.contentInset.top]];
800800

801-
[self.scaleControlViewConstraints addObject:
802-
[NSLayoutConstraint constraintWithItem:self.scaleBarView
801+
[self.scaleBarConstraints addObject:
802+
[NSLayoutConstraint constraintWithItem:self.scaleBar
803803
attribute:NSLayoutAttributeLeading
804804
relatedBy:NSLayoutRelationEqual
805805
toItem:self
806806
attribute:NSLayoutAttributeLeading
807807
multiplier:1
808808
constant:8 + self.contentInset.left]];
809809

810-
[self addConstraints:self.scaleControlViewConstraints];
810+
[self addConstraints:self.scaleBarConstraints];
811811

812812
// compass
813813
//
@@ -4805,8 +4805,8 @@ - (void)cameraIsChanging {
48054805

48064806
[self updateCompass];
48074807

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]];
48104810
}
48114811

48124812
if ([self.delegate respondsToSelector:@selector(mapViewRegionIsChanging:)])
@@ -5199,7 +5199,7 @@ - (CGPoint)userLocationAnnotationViewCenter
51995199

52005200
- (void)notifyScaleBarGestureDidEnd
52015201
{
5202-
[(MGLScaleBarView *)self.scaleBarView fadeOut];
5202+
[(MGLScaleBar *)self.scaleBar fadeOut];
52035203
}
52045204

52055205
- (void)updateCompass

platform/ios/src/MGLScaleBarView.h platform/ios/src/MGLScaleBar.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#import <UIKit/UIKit.h>
22
#import <CoreLocation/CoreLocation.h>
33

4-
@interface MGLScaleBarView : UIView
4+
@interface MGLScaleBar : UIView
55

66
// Sets the scale and fades in the scale bar
77
@property (nonatomic, assign) CLLocationDistance metersPerPoint;

0 commit comments

Comments
 (0)