MGLBackgroundStyleLayer


@interface MGLBackgroundStyleLayer : MGLStyleLayer

An MGLBackgroundStyleLayer is a style layer that covers the entire map. Use a background style layer to configure a color or pattern to show below all other map content. If the style’s other layers use the Mapbox Streets source, the background style layer is responsible for drawing land, whereas the oceans and other bodies of water are drawn by MGLFillStyleLayer objects.

A background style layer is typically the bottommost layer in a style, because it covers the entire map and can occlude any layers below it. You can therefore access it by getting the last item in the MGLStyle.layers array.

If the background style layer is transparent or omitted from the style, any portion of the map view that does not show another style layer is transparent.

  • Returns a background style layer initialized with an identifier.

    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;

    Swift

    init(identifier: String)

    Parameters

    identifier

    A string that uniquely identifies the source in the style to which it is added.