MGLForegroundStyleLayer
@interface MGLForegroundStyleLayer : MGLStyleLayer
MGLForegroundStyleLayer
is an abstract superclass for style layers whose
content is defined by an MGLSource
object.
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of MGLRasterStyleLayer
and the concrete subclasses of MGLVectorStyleLayer
.
-
Returns a foreground 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.Declaration
Objective-C
- (nonnull instancetype)initWithIdentifier:(nonnull NSString *)identifier source:(nonnull MGLSource *)source;
Swift
init(identifier: String, source: MGLSource)
Parameters
identifier
A string that uniquely identifies the source in the style to which it is added.
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 Value
An initialized foreground style layer.
-
Identifier of the source from which the receiver obtains the data to style.
Declaration
Objective-C
@property (readonly, nonatomic, nullable) NSString *sourceIdentifier;
Swift
var sourceIdentifier: String? { get }