diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2015-04-02 15:41:29 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-04-03 12:40:51 -0700 |
commit | 2916ae2735bd46cdd87f32c0ab3efb5651ea8998 (patch) | |
tree | 653c773713d2785d7d455f7f24be78013012d322 /platform | |
parent | 836de8bc1c9ebbe86e0b20cf11291ef449faccfd (diff) | |
download | qtlocation-mapboxgl-2916ae2735bd46cdd87f32c0ab3efb5651ea8998.tar.gz |
formatting & docs changes
Ran this through `./ios/docs/install_docs.sh` to double-check things.
* Less-specific initializers above more-specific per Apple convention.
* Shores up `accessToken` docs as property, not a method.
* Edited comments for consistency and/or to keep them out of the docs.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/MGLMapView.mm | 23 | ||||
-rw-r--r-- | platform/ios/NSString+MGLAdditions.h | 2 |
2 files changed, 14 insertions, 11 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 2ad9db6882..63ed8e11a8 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -91,7 +91,8 @@ static NSURL *MGLURLForBundledStyleNamed(NSString *styleName) @end -@implementation MGLMapView { +@implementation MGLMapView +{ BOOL _isTargetingInterfaceBuilder; CLLocationDegrees _pendingLatitude; CLLocationDegrees _pendingLongitude; @@ -168,7 +169,8 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr; [MGLMapboxEvents setToken:accessToken.mgl_stringOrNilIfEmpty]; } -+ (NSSet *)keyPathsForValuesAffectingStyleURL { ++ (NSSet *)keyPathsForValuesAffectingStyleURL +{ return [NSSet setWithObjects:@"mapID", @"accessToken", nil]; } @@ -180,10 +182,7 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr; - (void)setStyleURL:(NSURL *)styleURL { - if ( _isTargetingInterfaceBuilder ) - { - return; - } + if (_isTargetingInterfaceBuilder) return; if ( ! styleURL) { @@ -245,7 +244,8 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr; // load extensions // - dispatch_once(&loadGLExtensions, ^{ + dispatch_once(&loadGLExtensions, ^ + { const std::string extensions = (char *)glGetString(GL_EXTENSIONS); using namespace mbgl; @@ -1319,16 +1319,19 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng) return [NSArray arrayWithArray:_bundledStyleURLs]; } -+ (NSSet *)keyPathsForValuesAffectingMapID { ++ (NSSet *)keyPathsForValuesAffectingMapID +{ return [NSSet setWithObjects:@"styleURL", @"accessToken", nil]; } -- (NSString *)mapID { +- (NSString *)mapID +{ NSURL *styleURL = self.styleURL; return [styleURL.scheme isEqualToString:@"mapbox"] ? styleURL.host.mgl_stringOrNilIfEmpty : nil; } -- (void)setMapID:(NSString *)mapID { +- (void)setMapID:(NSString *)mapID +{ self.styleURL = [NSURL URLWithString:[NSString stringWithFormat:@"mapbox://%@", mapID]]; } diff --git a/platform/ios/NSString+MGLAdditions.h b/platform/ios/NSString+MGLAdditions.h index 263cfc8cb7..913f1cacda 100644 --- a/platform/ios/NSString+MGLAdditions.h +++ b/platform/ios/NSString+MGLAdditions.h @@ -2,7 +2,7 @@ @interface NSString (MGLAdditions) -/// Returns the receiver if non-empty or \c nil if empty. +/** Returns the receiver if non-empty or nil if empty. */ - (NSString *)mgl_stringOrNilIfEmpty; @end |