MGLCompositeStyleFunction


@interface MGLCompositeStyleFunction <T> : MGLStyleFunction<T>

An MGLCompositeStyleFunction is a value function defining a style value that changes with the feature attributes at each map zoom level. The layout and paint attribute properties of an MGLStyleLayer object can be set to MGLCompositeStyleFunction objects. Use composite functions to allow the appearance of a map feature to change with both its attributes and the map zoom level.

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

  • A string that specifies the feature attribute key whose value be used as the function input.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull attributeName;

    Swift

    var attributeName: String { get set }
  • A dictionary associating attribute values with style values.

    Each of the function’s stops is represented by one key-value pair in the dictionary. Each key in the dictionary is an NSNumber object containing a floating-point zoom level. Each value in the dictionary is an inner nested dictionary. Each key in the nested dictionary is an object representing a feature attribute key or interpolation stop. Each value in the nested dictionary is an MGLStyleValue object containing the value to use when the function is given the associated attribute key. An MGLStyleFunction object may not be used recursively as a value inside the nested dictionary.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic)
        NSDictionary<id, NSDictionary<id, MGLStyleValue<T> *> *> *_Nonnull stops;

    Swift

    var stops: [AnyHashable : [AnyHashable : MGLStyleValue<T>]] { get set }
  • An MGLStyleValue object containing the default value to use when there is no input to provide to the function.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable)
        MGLStyleValue<T> *defaultValue;

    Swift

    var defaultValue: MGLStyleValue<T>? { get set }