summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLFillStyleLayer.h
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-04-03 14:25:37 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-04-13 10:33:18 -0700
commitde6c9b35f35f6ec0950529261b207d716c046beb (patch)
treef022e3e09b4f8ffbe7646341f91aa76b8081ff62 /platform/darwin/src/MGLFillStyleLayer.h
parent98d005792b68d0b299f123c1d31e50c72ba91ba8 (diff)
downloadqtlocation-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/MGLFillStyleLayer.h')
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h
index 1f3cfc8af5..89f84185dc 100644
--- a/platform/darwin/src/MGLFillStyleLayer.h
+++ b/platform/darwin/src/MGLFillStyleLayer.h
@@ -52,6 +52,21 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) {
MGL_EXPORT
@interface MGLFillStyleLayer : MGLVectorStyleLayer
+/**
+ Returns a fill style layer initialized with an identifier and source.
+
+ After initializing and configuring the style layer, add it to a map view’s
+ style using the `-[MGLStyle addLayer:]` or
+ `-[MGLStyle insertLayer:belowLayer:]` method.
+
+ @param identifier A string that uniquely identifies the source in the style to
+ which it is added.
+ @param source The source from which to obtain the data to style. If the source
+ has not yet been added to the current style, the behavior is undefined.
+ @return An initialized foreground style layer.
+ */
+- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source NS_DESIGNATED_INITIALIZER;
+
#pragma mark - Accessing the Paint Attributes
/**