diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-03 14:25:37 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-13 10:33:18 -0700 |
commit | de6c9b35f35f6ec0950529261b207d716c046beb (patch) | |
tree | f022e3e09b4f8ffbe7646341f91aa76b8081ff62 /platform/darwin/src/MGLForegroundStyleLayer.m | |
parent | 98d005792b68d0b299f123c1d31e50c72ba91ba8 (diff) | |
download | qtlocation-mapboxgl-de6c9b35f35f6ec0950529261b207d716c046beb.tar.gz |
[darwin] Simplify MGLStyleLayer initialization and pointer management
Similarly to the previous commit, introduce `-[MGLStyleLayer initWithPendingLayer:]`, allowing the base class to track the owned `_pendingSource` pointer and implement `-addToMapView:` and `-removeFromMapView:` without any casts.
Fixes an issue where `-[MGLStyle layerFromMBGLLayer:]` would wind up creating layers whose `_rawLayer` and `_pendingLayer` held different values.
Diffstat (limited to 'platform/darwin/src/MGLForegroundStyleLayer.m')
-rw-r--r-- | platform/darwin/src/MGLForegroundStyleLayer.m | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/platform/darwin/src/MGLForegroundStyleLayer.m b/platform/darwin/src/MGLForegroundStyleLayer.m deleted file mode 100644 index b7a0379af2..0000000000 --- a/platform/darwin/src/MGLForegroundStyleLayer.m +++ /dev/null @@ -1,20 +0,0 @@ -#import "MGLForegroundStyleLayer.h" -#import "MGLSource.h" - -@implementation MGLForegroundStyleLayer - -- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { - if (self = [super initWithIdentifier:identifier]) { - _sourceIdentifier = source.identifier; - } - return self; -} - -- (NSString *)description { - return [NSString stringWithFormat: - @"<%@: %p; identifier = %@; sourceIdentifier = %@; visible = %@>", - NSStringFromClass([self class]), (void *)self, self.identifier, - self.sourceIdentifier, self.visible ? @"YES" : @"NO"]; -} - -@end |