MGLStyleFunction
@interface MGLStyleFunction <T> : MGLStyleValue<T>
An MGLStyleFunction is a is an abstract superclass for functions that are
defined by an MGLCameraStyleFunction, MGLSourceStyleFunction, or
MGLCompositeStyleFunction object.
Create instances of MGLCameraStyleFunction, MGLSourceStyleFunction, and
MGLCompositeStyleFunction in order to use MGLStyleFunction‘s methods. Do
not create instances of MGLStyleFunction directly, and do not create your
own subclasses of this class.
The MGLStyleFunction class takes a generic parameter T that indicates the
Foundation class being wrapped by this class.
-
Creates and returns an
MGLCameraStyleFunctionobject representing a camera function with a linear interpolation curve.Note
Do not create function instances using this method unless it is required for backwards compatiblity with your application code.
Declaration
Objective-C
+ (nonnull instancetype)functionWithStops: (nonnull NSDictionary<NSNumber *, MGLStyleValue<T> *> *)stops;Swift
convenience init(stops: [NSNumber : MGLStyleValueParameters
stopsA dictionary associating zoom levels with style values.
Return Value
An
MGLCameraStyleFunctionobject with the given stops. -
Creates and returns an
MGLCameraStyleFunctionobject representing a camera function with an interpolation curve controlled by the provided interpolation base.Note
Do not create function instances using this method unless it is required for backwards compatiblity with your application code.
Declaration
Objective-C
+ (nonnull instancetype) functionWithInterpolationBase:(CGFloat)interpolationBase stops:(nonnull NSDictionary<NSNumber *, MGLStyleValue<T> *> *)stops;Parameters
interpolationBaseThe exponential base of the interpolation curve.
stopsA dictionary associating zoom levels with style values.
Return Value
An
MGLCameraStyleFunctionobject with the given interpolation base and stops.
-
Returns an
MGLStyleFunctionobject representing a camera function. If the function is set as a style layer property value, it will be interpreted as a camera function with an interpolation curve controlled by the provided interpolation base.Note
Do not create instances of
MGLStyleFunctionunless it is required for backwards compatiblity with your application code. You should create and use instances ofMGLCameraStyleFunctionto specify how properties will be visualized at different zoom levels.Declaration
Objective-C
- (nonnull instancetype) initWithInterpolationBase:(CGFloat)interpolationBase stops: (nonnull NSDictionary<NSNumber *, MGLStyleValue<T> *> *) stops;Swift
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.
-
The modes used to interpolate property values between map zoom level changes or over a range of feature attribute values.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) MGLInterpolationMode interpolationMode;Swift
var interpolationMode: MGLInterpolationMode { get set } -
A dictionary associating zoom levels with style values.
Declaration
Objective-C
@property (readwrite, copy, nonatomic, nullable) NSDictionary *stops;Swift
var stops: [AnyHashable : Any]? { get set } -
The exponential interpolation base of the function’s interpolation curve.
Note
This property specifies the exponential base of the interpolation curve ofMGLCameraStyleFunctionandMGLSourceStyleFunctionfunctions that use aMGLInterpolationModeExponentialinterpolationMode. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic) CGFloat interpolationBase;Swift
var interpolationBase: CGFloat { get set }
Install in Dash
MGLStyleFunction Class Reference