MGLStyleValue
@interface MGLStyleValue <T> : NSObject
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 MGLStyleConstantValue to
represent a constant value or an 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(forCGVector,NSEdgeInsets,UIEdgeInsets, and enumerations)NSStringNSColororUIColorNSArray
-
Creates and returns an
MGLStyleConstantValueobject containing a raw value.Declaration
Objective-C
+ (nonnull instancetype)valueWithRawValue:(nonnull T)rawValue;Swift
convenience init(rawValue: T)Parameters
rawValueThe constant value contained by the object.
Return Value
An
MGLStyleConstantValueobject containingrawValue, which is treated as a constant value. -
Creates and returns an
MGLStyleFunctionobject representing a linear zoom level function with any number of stops.Declaration
Objective-C
+ (nonnull instancetype)valueWithStops: (nonnull NSDictionary<NSNumber *, MGLStyleValue<T> *> *)stops;Swift
convenience init(stops: [NSNumber : MGLStyleValueParameters
stopsA dictionary associating zoom levels with style values.
Return Value
An
MGLStyleFunctionobject with the given stops. -
Creates and returns an
MGLStyleFunctionobject representing a zoom level function with an exponential interpolation base and any number of stops.Declaration
Objective-C
+ (nonnull instancetype) valueWithInterpolationBase:(CGFloat)interpolationBase stops:(nonnull NSDictionary<NSNumber *, MGLStyleValue<T> *> *)stops;Swift
convenience init(interpolationBase: CGFloat, stops: [NSNumber : MGLStyleValueParameters
interpolationBaseThe exponential base of the interpolation curve.
stopsA dictionary associating zoom levels with style values.
Return Value
An
MGLStyleFunctionobject with the given interpolation base and stops.
Install in Dash
MGLStyleValue Class Reference