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

Commit

Permalink
[ios, macos] style and styleURL depend on one another
Browse files Browse the repository at this point in the history
  • Loading branch information
1ec5 committed Aug 20, 2016
1 parent 7834552 commit 6f19b2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,13 @@ - (instancetype)initWithCoder:(nonnull NSCoder *)decoder
return self;
}

+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyle {
return [NSSet setWithObject:@"styleURL"];
}

+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyleURL
{
return [NSSet setWithObjects:@"styleURL__", nil];
return [NSSet setWithObjects:@"styleURL__", @"style", nil];
}

- (nonnull NSURL *)styleURL
Expand Down
8 changes: 8 additions & 0 deletions platform/macos/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,14 @@ - (void)setDelegate:(id<MGLMapViewDelegate>)delegate {

#pragma mark Style

+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyle {
return [NSSet setWithObject:@"styleURL"];
}

+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyleURL {
return [NSSet setWithObject:@"style"];
}

- (nonnull NSURL *)styleURL {
NSString *styleURLString = @(_mbglMap->getStyleURL().c_str()).mgl_stringOrNilIfEmpty;
return styleURLString ? [NSURL URLWithString:styleURLString] : [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion];
Expand Down

0 comments on commit 6f19b2f

Please sign in to comment.