MGLStyleLayer
@interface MGLStyleLayer : NSObject
MGLStyleLayer
is an abstract base class for style layers. A style layer
manages the layout and appearance of content at a specific z-index in a style.
An MGLStyle
object consists of one or more MGLStyleLayer
objects.
Each style layer defined by the style JSON file is represented at runtime by an
MGLStyleLayer
object, which you can use to refine the map’s appearance. You
can also add and remove style layers dynamically.
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of
MGLBackgroundStyleLayer
and the concrete subclasses of
MGLForegroundStyleLayer
.
Do not add MGLStyleLayer
objects to the style
property of a MGLMapView
before
-mapView:didFinishLoadingStyle:
is called.
-
A string that uniquely identifies the style layer in the style to which it is added.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSString *_Nonnull identifier;
Swift
var identifier: String { get }
-
Whether this layer is displayed. A value of
NO
hides the layer.Declaration
Objective-C
@property (getter=isVisible, assign, readwrite, nonatomic) BOOL visible;
Swift
var isVisible: Bool { get set }
-
The maximum zoom level at which the layer gets parsed and appears. This value is a floating-point number.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) float maximumZoomLevel;
Swift
var maximumZoomLevel: Float { get set }
-
The minimum zoom level at which the layer gets parsed and appears. This value is a floating-point number.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) float minimumZoomLevel;
Swift
var minimumZoomLevel: Float { get set }