• An MGLStyleValue object is a generic container for a style attribute value. The layout and paint attribute properties of MGLStyleLayer can be set to MGLStyleValue objects.

    The MGLStyleValue class itself represents a class cluster. Under the hood, a particular MGLStyleValue object may be either an MGLConstantStyleValue to represent a constant value or one of the concrete subclasses of MGLStyleFunction to represent a value function. Do not initialize an MGLStyleValue object directly; instead, use one of the class factory methods to create an MGLStyleValue object.

    The MGLStyleValue class takes a generic parameter T that indicates the Foundation class being wrapped by this class. Common values for T include:

    • NSNumber (for Boolean values and floating-point numbers)
    • NSValue (for CGVector, NSEdgeInsets, UIEdgeInsets, and enumerations)
    • NSString
    • NSColor or UIColor
    • NSArray
    See more



    @interface MGLStyleValue <T> : NSObject


    class MGLStyleValue<T> : NSObject where T : AnyObject