MGLBackgroundStyleLayer

@interface MGLBackgroundStyleLayer : MGLStyleLayer

A map style’s background layer is the bottommost layer and is used to style a color or pattern to show below all other map features. You can query an MGLMapView for its style and obtain the background layer using the -[MGLStyle layerWithIdentifier:] method and passing background for the identifier.

  • The color with which the background will be drawn.

    The default value of this property is an MGLStyleValue object containing UIColor.blackColor. Set this property to nil to reset it to the default value.

    This property is only applied to the style if backgroundPattern is set to nil. Otherwise, it is ignored.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, null_resettable)
        MGLStyleValue<UIColor *> *backgroundColor;

    Swift

    var backgroundColor: MGLStyleValue
  • Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, …, 512).

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, null_resettable)
        MGLStyleValue<NSString *> *backgroundPattern;

    Swift

    var backgroundPattern: MGLStyleValue
  • The opacity at which the background will be drawn.

    The default value of this property is an MGLStyleValue object containing an NSNumber object containing the float 1. Set this property to nil to reset it to the default value.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, null_resettable)
        MGLStyleValue<NSNumber *> *backgroundOpacity;

    Swift

    var backgroundOpacity: MGLStyleValue