MGLStyleConstantValue

@interface MGLStyleConstantValue <T> : MGLStyleValue<T>

An MGLStyleConstantValue object is a generic container for a style attribute value that remains constant as the zoom level changes. The layout and paint attribute properties of MGLStyleLayer objects can be set to MGLStyleConstantValue objects.

The MGLStyleConstantValue class takes a generic parameter T that indicates the Foundation class being wrapped by this class.

  • Creates and returns an MGLStyleConstantValue object containing a raw value.

    Declaration

    Objective-C

    + (nonnull instancetype)valueWithRawValue:(nonnull T)rawValue;

    Swift

    convenience init(rawValue: T)

    Parameters

    rawValue

    The constant value contained by the object.

    Return Value

    An MGLStyleConstantValue object containing rawValue, which is treated as a constant value.

  • Returns an MGLStyleConstantValue object containing a raw value.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithRawValue:(nonnull T)rawValue;

    Swift

    init(rawValue: T)

    Parameters

    rawValue

    The value contained by the receiver.

    Return Value

    An MGLStyleConstantValue object containing rawValue.

  • The raw value contained by the receiver.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) T _Nonnull rawValue;

    Swift

    var rawValue: T { get set }