[ios, macos] rename style spec properties

This commit is contained in:
Fredrik Karlsson
2016-11-21 14:32:05 +01:00
parent 4096544188
commit 17db5210bf
23 changed files with 1048 additions and 1026 deletions

View File

@@ -4,11 +4,20 @@ const fs = require('fs');
const ejs = require('ejs');
const _ = require('lodash');
const colorParser = require('csscolorparser');
const spec = _.merge(require('mapbox-gl-style-spec').latest, require('./style-spec-overrides-v8.json'));
const cocoaConventions = require('./style-spec-cocoa-conventions-v8.json');
let spec = _.merge(require('mapbox-gl-style-spec').latest, require('./style-spec-overrides-v8.json'));
const prefix = 'MGL';
const suffix = 'StyleLayer';
// Rename properties and keep `original` for use with setters and getters
_.forOwn(cocoaConventions, function (properties, kind) {
_.forOwn(properties, function (newName, oldName) {
spec[kind][newName] = spec[kind][oldName];
spec[kind][newName].original = oldName;
delete spec[kind][oldName];
})
});
global.camelize = function (str) {
return str.replace(/(?:^|-)(.)/g, function (_, x) {
return x.toUpperCase();
@@ -212,6 +221,10 @@ global.propertyDefault = function (property, layerType) {
return 'an `MGLStyleValue` object containing ' + describeValue(property.default, property, layerType);
};
global.originalPropertyName = function (property) {
return property.original || property.name;
}
global.propertyType = function (property) {
switch (property.type) {
case 'boolean':
@@ -321,8 +334,8 @@ const layers = Object.keys(spec.layer.type.values).map((type) => {
return {
type: type,
layoutProperties: layoutProperties,
paintProperties: paintProperties,
layoutProperties: _.sortBy(layoutProperties, ['name']),
paintProperties: _.sortBy(paintProperties, ['name']),
layoutPropertiesByName: spec[`layout_${type}`],
paintPropertiesByName: spec[`paint_${type}`],
};

View File

@@ -0,0 +1,9 @@
{
"layout_symbol": {
"icon-image": "icon-image-name"
},
"paint_raster": {
"raster-brightness-min": "minimum-raster-brightness",
"raster-brightness-max": "maximum-raster-brightness"
}
}

View File

@@ -38,11 +38,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *backgroundColor;
#endif
/**
Name of image in style images to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *backgroundPattern;
/**
The opacity at which the background will be drawn.
@@ -50,6 +45,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *backgroundOpacity;
/**
Name of image in style images to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *backgroundPattern;
@end
NS_ASSUME_NONNULL_END

View File

@@ -70,16 +70,6 @@
return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
- (void)setBackgroundPattern:(MGLStyleValue<NSString *> *)backgroundPattern {
auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(backgroundPattern);
_rawLayer->setBackgroundPattern(mbglValue);
}
- (MGLStyleValue<NSString *> *)backgroundPattern {
auto propertyValue = _rawLayer->getBackgroundPattern() ?: _rawLayer->getDefaultBackgroundPattern();
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
- (void)setBackgroundOpacity:(MGLStyleValue<NSNumber *> *)backgroundOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(backgroundOpacity);
_rawLayer->setBackgroundOpacity(mbglValue);
@@ -90,5 +80,15 @@
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setBackgroundPattern:(MGLStyleValue<NSString *> *)backgroundPattern {
auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(backgroundPattern);
_rawLayer->setBackgroundPattern(mbglValue);
}
- (MGLStyleValue<NSString *> *)backgroundPattern {
auto propertyValue = _rawLayer->getBackgroundPattern() ?: _rawLayer->getDefaultBackgroundPattern();
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
@end

View File

@@ -6,22 +6,6 @@
NS_ASSUME_NONNULL_BEGIN
/**
Controls the translation reference point.
Values of this type are used in the `circleTranslateAnchor` property of `MGLCircleStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLCircleTranslateAnchor) {
/**
The circle is translated relative to the map.
*/
MGLCircleTranslateAnchorMap,
/**
The circle is translated relative to the viewport.
*/
MGLCircleTranslateAnchorViewport,
};
/**
Controls the scaling behavior of the circle when the map is pitched.
@@ -38,6 +22,22 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) {
MGLCirclePitchScaleViewport,
};
/**
Controls the translation reference point.
Values of this type are used in the `circleTranslateAnchor` property of `MGLCircleStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLCircleTranslateAnchor) {
/**
The circle is translated relative to the map.
*/
MGLCircleTranslateAnchorMap,
/**
The circle is translated relative to the viewport.
*/
MGLCircleTranslateAnchorViewport,
};
/**
A circle layer which allows customization of styling properties at runtime. You may
instantiate a new circle layer to add to a map style or you may query an
@@ -49,13 +49,11 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) {
#pragma mark - Accessing the Paint Attributes
/**
Circle radius.
This property is measured in points.
Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `5`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleRadius;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleBlur;
#if TARGET_OS_IPHONE
/**
@@ -73,13 +71,6 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) {
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *circleColor;
#endif
/**
Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleBlur;
/**
The opacity at which the circle will be drawn.
@@ -87,6 +78,22 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleOpacity;
/**
Controls the scaling behavior of the circle when the map is pitched.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLCirclePitchScaleMap`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *circlePitchScale;
/**
Circle radius.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `5`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleRadius;
/**
The geometry's offset.
@@ -105,13 +112,6 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *circleTranslateAnchor;
/**
Controls the scaling behavior of the circle when the map is pitched.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLCirclePitchScaleMap`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *circlePitchScale;
@end
NS_ASSUME_NONNULL_END

View File

@@ -11,16 +11,16 @@
#include <mbgl/style/layers/circle_layer.hpp>
namespace mbgl {
MBGL_DEFINE_ENUM(MGLCircleTranslateAnchor, {
{ MGLCircleTranslateAnchorMap, "map" },
{ MGLCircleTranslateAnchorViewport, "viewport" },
});
MBGL_DEFINE_ENUM(MGLCirclePitchScale, {
{ MGLCirclePitchScaleMap, "map" },
{ MGLCirclePitchScaleViewport, "viewport" },
});
MBGL_DEFINE_ENUM(MGLCircleTranslateAnchor, {
{ MGLCircleTranslateAnchorMap, "map" },
{ MGLCircleTranslateAnchorViewport, "viewport" },
});
}
@interface MGLCircleStyleLayer ()
@@ -92,13 +92,13 @@ namespace mbgl {
#pragma mark - Accessing the Paint Attributes
- (void)setCircleRadius:(MGLStyleValue<NSNumber *> *)circleRadius {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(circleRadius);
_rawLayer->setCircleRadius(mbglValue);
- (void)setCircleBlur:(MGLStyleValue<NSNumber *> *)circleBlur {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(circleBlur);
_rawLayer->setCircleBlur(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)circleRadius {
auto propertyValue = _rawLayer->getCircleRadius() ?: _rawLayer->getDefaultCircleRadius();
- (MGLStyleValue<NSNumber *> *)circleBlur {
auto propertyValue = _rawLayer->getCircleBlur() ?: _rawLayer->getDefaultCircleBlur();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
@@ -112,16 +112,6 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
- (void)setCircleBlur:(MGLStyleValue<NSNumber *> *)circleBlur {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(circleBlur);
_rawLayer->setCircleBlur(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)circleBlur {
auto propertyValue = _rawLayer->getCircleBlur() ?: _rawLayer->getDefaultCircleBlur();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setCircleOpacity:(MGLStyleValue<NSNumber *> *)circleOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(circleOpacity);
_rawLayer->setCircleOpacity(mbglValue);
@@ -132,6 +122,26 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setCirclePitchScale:(MGLStyleValue<NSValue *> *)circlePitchScale {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCirclePitchScale>().toEnumPropertyValue(circlePitchScale);
_rawLayer->setCirclePitchScale(mbglValue);
}
- (MGLStyleValue<NSValue *> *)circlePitchScale {
auto propertyValue = _rawLayer->getCirclePitchScale() ?: _rawLayer->getDefaultCirclePitchScale();
return MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCirclePitchScale>().toEnumStyleValue(propertyValue);
}
- (void)setCircleRadius:(MGLStyleValue<NSNumber *> *)circleRadius {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(circleRadius);
_rawLayer->setCircleRadius(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)circleRadius {
auto propertyValue = _rawLayer->getCircleRadius() ?: _rawLayer->getDefaultCircleRadius();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setCircleTranslate:(MGLStyleValue<NSValue *> *)circleTranslate {
auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(circleTranslate);
_rawLayer->setCircleTranslate(mbglValue);
@@ -152,15 +162,5 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLCircleTranslateAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setCirclePitchScale:(MGLStyleValue<NSValue *> *)circlePitchScale {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCirclePitchScale>().toEnumPropertyValue(circlePitchScale);
_rawLayer->setCirclePitchScale(mbglValue);
}
- (MGLStyleValue<NSValue *> *)circlePitchScale {
auto propertyValue = _rawLayer->getCirclePitchScale() ?: _rawLayer->getDefaultCirclePitchScale();
return MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCirclePitchScale>().toEnumStyleValue(propertyValue);
}
@end

View File

@@ -39,13 +39,6 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *fillAntialias;
/**
The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1pt stroke around the fill, if the stroke is used.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *fillOpacity;
#if TARGET_OS_IPHONE
/**
The color of the filled part of this layer.
@@ -66,6 +59,13 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *fillColor;
#endif
/**
The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1pt stroke around the fill, if the stroke is used.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *fillOpacity;
/**
The outline color of the fill. Matches the value of `fillColor` if unspecified.
@@ -73,6 +73,11 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *fillOutlineColor;
/**
Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *fillPattern;
/**
The geometry's offset.
@@ -91,11 +96,6 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *fillTranslateAnchor;
/**
Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *fillPattern;
@end
NS_ASSUME_NONNULL_END

View File

@@ -97,16 +97,6 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setFillOpacity:(MGLStyleValue<NSNumber *> *)fillOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(fillOpacity);
_rawLayer->setFillOpacity(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)fillOpacity {
auto propertyValue = _rawLayer->getFillOpacity() ?: _rawLayer->getDefaultFillOpacity();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setFillColor:(MGLStyleValue<MGLColor *> *)fillColor {
auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(fillColor);
_rawLayer->setFillColor(mbglValue);
@@ -117,6 +107,16 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
- (void)setFillOpacity:(MGLStyleValue<NSNumber *> *)fillOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(fillOpacity);
_rawLayer->setFillOpacity(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)fillOpacity {
auto propertyValue = _rawLayer->getFillOpacity() ?: _rawLayer->getDefaultFillOpacity();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setFillOutlineColor:(MGLStyleValue<MGLColor *> *)fillOutlineColor {
auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(fillOutlineColor);
_rawLayer->setFillOutlineColor(mbglValue);
@@ -127,6 +127,16 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
- (void)setFillPattern:(MGLStyleValue<NSString *> *)fillPattern {
auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(fillPattern);
_rawLayer->setFillPattern(mbglValue);
}
- (MGLStyleValue<NSString *> *)fillPattern {
auto propertyValue = _rawLayer->getFillPattern() ?: _rawLayer->getDefaultFillPattern();
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
- (void)setFillTranslate:(MGLStyleValue<NSValue *> *)fillTranslate {
auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(fillTranslate);
_rawLayer->setFillTranslate(mbglValue);
@@ -147,15 +157,5 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillTranslateAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setFillPattern:(MGLStyleValue<NSString *> *)fillPattern {
auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(fillPattern);
_rawLayer->setFillPattern(mbglValue);
}
- (MGLStyleValue<NSString *> *)fillPattern {
auto propertyValue = _rawLayer->getFillPattern() ?: _rawLayer->getDefaultFillPattern();
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
@end

View File

@@ -107,11 +107,13 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) {
#pragma mark - Accessing the Paint Attributes
/**
The opacity at which the line will be drawn.
Blur applied to the line, in points.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineOpacity;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineBlur;
#if TARGET_OS_IPHONE
/**
@@ -133,6 +135,45 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *lineColor;
#endif
/**
Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to points, multiply the length by the current line width.
This property is measured in line widths.
This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSArray<NSNumber *> *> *lineDasharray;
/**
Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineGapWidth;
/**
The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineOffset;
/**
The opacity at which the line will be drawn.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineOpacity;
/**
Name of image in style images to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *linePattern;
/**
The geometry's offset.
@@ -160,47 +201,6 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineWidth;
/**
Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineGapWidth;
/**
The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineOffset;
/**
Blur applied to the line, in points.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineBlur;
/**
Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to points, multiply the length by the current line width.
This property is measured in line widths.
This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSArray<NSNumber *> *> *lineDasharray;
/**
Name of image in style images to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *linePattern;
@end
NS_ASSUME_NONNULL_END

View File

@@ -141,13 +141,13 @@ namespace mbgl {
#pragma mark - Accessing the Paint Attributes
- (void)setLineOpacity:(MGLStyleValue<NSNumber *> *)lineOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineOpacity);
_rawLayer->setLineOpacity(mbglValue);
- (void)setLineBlur:(MGLStyleValue<NSNumber *> *)lineBlur {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineBlur);
_rawLayer->setLineBlur(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)lineOpacity {
auto propertyValue = _rawLayer->getLineOpacity() ?: _rawLayer->getDefaultLineOpacity();
- (MGLStyleValue<NSNumber *> *)lineBlur {
auto propertyValue = _rawLayer->getLineBlur() ?: _rawLayer->getDefaultLineBlur();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
@@ -161,6 +161,56 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
- (void)setLineDasharray:(MGLStyleValue<NSArray<NSNumber *> *> *)lineDasharray {
auto mbglValue = MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toPropertyValue(lineDasharray);
_rawLayer->setLineDasharray(mbglValue);
}
- (MGLStyleValue<NSArray<NSNumber *> *> *)lineDasharray {
auto propertyValue = _rawLayer->getLineDasharray() ?: _rawLayer->getDefaultLineDasharray();
return MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toStyleValue(propertyValue);
}
- (void)setLineGapWidth:(MGLStyleValue<NSNumber *> *)lineGapWidth {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineGapWidth);
_rawLayer->setLineGapWidth(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)lineGapWidth {
auto propertyValue = _rawLayer->getLineGapWidth() ?: _rawLayer->getDefaultLineGapWidth();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setLineOffset:(MGLStyleValue<NSNumber *> *)lineOffset {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineOffset);
_rawLayer->setLineOffset(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)lineOffset {
auto propertyValue = _rawLayer->getLineOffset() ?: _rawLayer->getDefaultLineOffset();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setLineOpacity:(MGLStyleValue<NSNumber *> *)lineOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineOpacity);
_rawLayer->setLineOpacity(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)lineOpacity {
auto propertyValue = _rawLayer->getLineOpacity() ?: _rawLayer->getDefaultLineOpacity();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setLinePattern:(MGLStyleValue<NSString *> *)linePattern {
auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(linePattern);
_rawLayer->setLinePattern(mbglValue);
}
- (MGLStyleValue<NSString *> *)linePattern {
auto propertyValue = _rawLayer->getLinePattern() ?: _rawLayer->getDefaultLinePattern();
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
- (void)setLineTranslate:(MGLStyleValue<NSValue *> *)lineTranslate {
auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(lineTranslate);
_rawLayer->setLineTranslate(mbglValue);
@@ -191,55 +241,5 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setLineGapWidth:(MGLStyleValue<NSNumber *> *)lineGapWidth {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineGapWidth);
_rawLayer->setLineGapWidth(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)lineGapWidth {
auto propertyValue = _rawLayer->getLineGapWidth() ?: _rawLayer->getDefaultLineGapWidth();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setLineOffset:(MGLStyleValue<NSNumber *> *)lineOffset {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineOffset);
_rawLayer->setLineOffset(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)lineOffset {
auto propertyValue = _rawLayer->getLineOffset() ?: _rawLayer->getDefaultLineOffset();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setLineBlur:(MGLStyleValue<NSNumber *> *)lineBlur {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineBlur);
_rawLayer->setLineBlur(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)lineBlur {
auto propertyValue = _rawLayer->getLineBlur() ?: _rawLayer->getDefaultLineBlur();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setLineDasharray:(MGLStyleValue<NSArray<NSNumber *> *> *)lineDasharray {
auto mbglValue = MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toPropertyValue(lineDasharray);
_rawLayer->setLineDasharray(mbglValue);
}
- (MGLStyleValue<NSArray<NSNumber *> *> *)lineDasharray {
auto propertyValue = _rawLayer->getLineDasharray() ?: _rawLayer->getDefaultLineDasharray();
return MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toStyleValue(propertyValue);
}
- (void)setLinePattern:(MGLStyleValue<NSString *> *)linePattern {
auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(linePattern);
_rawLayer->setLinePattern(mbglValue);
}
- (MGLStyleValue<NSString *> *)linePattern {
auto propertyValue = _rawLayer->getLinePattern() ?: _rawLayer->getDefaultLinePattern();
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
@end

View File

@@ -17,41 +17,18 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Accessing the Paint Attributes
/**
The opacity at which the image will be drawn.
Increase or reduce the brightness of the image. The value is the maximum brightness.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterOpacity;
/**
Rotates hues around the color wheel.
This property is measured in degrees.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterHueRotate;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *maximumRasterBrightness;
/**
Increase or reduce the brightness of the image. The value is the minimum brightness.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterBrightnessMin;
/**
Increase or reduce the brightness of the image. The value is the maximum brightness.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterBrightnessMax;
/**
Increase or reduce the saturation of the image.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterSaturation;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *minimumRasterBrightness;
/**
Increase or reduce the contrast of the image.
@@ -69,6 +46,29 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterFadeDuration;
/**
Rotates hues around the color wheel.
This property is measured in degrees.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterHueRotate;
/**
The opacity at which the image will be drawn.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterOpacity;
/**
Increase or reduce the saturation of the image.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterSaturation;
@end
NS_ASSUME_NONNULL_END

View File

@@ -59,53 +59,23 @@
#pragma mark - Accessing the Paint Attributes
- (void)setRasterOpacity:(MGLStyleValue<NSNumber *> *)rasterOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterOpacity);
_rawLayer->setRasterOpacity(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)rasterOpacity {
auto propertyValue = _rawLayer->getRasterOpacity() ?: _rawLayer->getDefaultRasterOpacity();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterHueRotate:(MGLStyleValue<NSNumber *> *)rasterHueRotate {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterHueRotate);
_rawLayer->setRasterHueRotate(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)rasterHueRotate {
auto propertyValue = _rawLayer->getRasterHueRotate() ?: _rawLayer->getDefaultRasterHueRotate();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterBrightnessMin:(MGLStyleValue<NSNumber *> *)rasterBrightnessMin {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterBrightnessMin);
_rawLayer->setRasterBrightnessMin(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)rasterBrightnessMin {
auto propertyValue = _rawLayer->getRasterBrightnessMin() ?: _rawLayer->getDefaultRasterBrightnessMin();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterBrightnessMax:(MGLStyleValue<NSNumber *> *)rasterBrightnessMax {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterBrightnessMax);
- (void)setMaximumRasterBrightness:(MGLStyleValue<NSNumber *> *)maximumRasterBrightness {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(maximumRasterBrightness);
_rawLayer->setRasterBrightnessMax(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)rasterBrightnessMax {
- (MGLStyleValue<NSNumber *> *)maximumRasterBrightness {
auto propertyValue = _rawLayer->getRasterBrightnessMax() ?: _rawLayer->getDefaultRasterBrightnessMax();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterSaturation:(MGLStyleValue<NSNumber *> *)rasterSaturation {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterSaturation);
_rawLayer->setRasterSaturation(mbglValue);
- (void)setMinimumRasterBrightness:(MGLStyleValue<NSNumber *> *)minimumRasterBrightness {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(minimumRasterBrightness);
_rawLayer->setRasterBrightnessMin(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)rasterSaturation {
auto propertyValue = _rawLayer->getRasterSaturation() ?: _rawLayer->getDefaultRasterSaturation();
- (MGLStyleValue<NSNumber *> *)minimumRasterBrightness {
auto propertyValue = _rawLayer->getRasterBrightnessMin() ?: _rawLayer->getDefaultRasterBrightnessMin();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
@@ -129,5 +99,35 @@
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterHueRotate:(MGLStyleValue<NSNumber *> *)rasterHueRotate {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterHueRotate);
_rawLayer->setRasterHueRotate(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)rasterHueRotate {
auto propertyValue = _rawLayer->getRasterHueRotate() ?: _rawLayer->getDefaultRasterHueRotate();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterOpacity:(MGLStyleValue<NSNumber *> *)rasterOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterOpacity);
_rawLayer->setRasterOpacity(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)rasterOpacity {
auto propertyValue = _rawLayer->getRasterOpacity() ?: _rawLayer->getDefaultRasterOpacity();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterSaturation:(MGLStyleValue<NSNumber *> *)rasterSaturation {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterSaturation);
_rawLayer->setRasterSaturation(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)rasterSaturation {
auto propertyValue = _rawLayer->getRasterSaturation() ?: _rawLayer->getDefaultRasterSaturation();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
@end

View File

@@ -21,9 +21,9 @@ namespace mbgl {
<% if (layoutProperties.length) { -%>
<% for (const property of layoutProperties) { -%>
<% if (property.type == "enum") { -%>
MBGL_DEFINE_ENUM(MGL<%- camelize(property.name) %>, {
MBGL_DEFINE_ENUM(MGL<%- camelize(originalPropertyName(property)) %>, {
<% for (const value in property.values) { -%>
{ MGL<%- camelize(property.name) %><%- camelize(value) %>, "<%-value%>" },
{ MGL<%- camelize(originalPropertyName(property)) %><%- camelize(value) %>, "<%-value%>" },
<% } -%>
});
@@ -33,9 +33,9 @@ namespace mbgl {
<% if (paintProperties.length) { -%>
<% for (const property of paintProperties) { -%>
<% if (property.type == "enum") { -%>
MBGL_DEFINE_ENUM(MGL<%- camelize(property.name) %>, {
MBGL_DEFINE_ENUM(MGL<%- camelize(originalPropertyName(property)) %>, {
<% for (const value in property.values) { -%>
{ MGL<%- camelize(property.name) %><%- camelize(value) %>, "<%-value%>" },
{ MGL<%- camelize(originalPropertyName(property)) %><%- camelize(value) %>, "<%-value%>" },
<% } -%>
});
@@ -133,18 +133,18 @@ namespace mbgl {
<% for (const property of layoutProperties) { -%>
- (void)set<%- camelize(property.name) %>:(MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
<% if (property.type == "enum") { -%>
auto mbglValue = MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumPropertyValue(<%- objCName(property) %>);
_rawLayer->set<%- camelize(property.name) %>(mbglValue);
auto mbglValue = MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(originalPropertyName(property)) %>>().toEnumPropertyValue(<%- objCName(property) %>);
_rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue);
<% } else { -%>
auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue(<%- objCName(property) %>);
_rawLayer->set<%- camelize(property.name) %>(mbglValue);
_rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue);
<% } -%>
}
- (MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
auto propertyValue = _rawLayer->get<%- camelize(property.name) %>() ?: _rawLayer->getDefault<%- camelize(property.name) %>();
auto propertyValue = _rawLayer->get<%- camelize(originalPropertyName(property)) %>() ?: _rawLayer->getDefault<%- camelize(originalPropertyName(property)) %>();
<% if (property.type == "enum") { -%>
return MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumStyleValue(propertyValue);
return MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(originalPropertyName(property)) %>>().toEnumStyleValue(propertyValue);
<% } else { -%>
return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue);
<% } -%>
@@ -158,18 +158,18 @@ namespace mbgl {
<% for (const property of paintProperties) { -%>
- (void)set<%- camelize(property.name) %>:(MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
<% if (property.type == "enum") { -%>
auto mbglValue = MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumPropertyValue(<%- objCName(property) %>);
_rawLayer->set<%- camelize(property.name) %>(mbglValue);
auto mbglValue = MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(originalPropertyName(property)) %>>().toEnumPropertyValue(<%- objCName(property) %>);
_rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue);
<% } else { -%>
auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue(<%- objCName(property) %>);
_rawLayer->set<%- camelize(property.name) %>(mbglValue);
_rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue);
<% } -%>
}
- (MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
auto propertyValue = _rawLayer->get<%- camelize(property.name) %>() ?: _rawLayer->getDefault<%- camelize(property.name) %>();
auto propertyValue = _rawLayer->get<%- camelize(originalPropertyName(property)) %>() ?: _rawLayer->getDefault<%- camelize(originalPropertyName(property)) %>();
<% if (property.type == "enum") { -%>
return MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumStyleValue(propertyValue);
return MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(originalPropertyName(property)) %>>().toEnumStyleValue(propertyValue);
<% } else { -%>
return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue);
<% } -%>

View File

@@ -6,22 +6,6 @@
NS_ASSUME_NONNULL_BEGIN
/**
Label placement relative to its geometry.
Values of this type are used in the `symbolPlacement` property of `MGLSymbolStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLSymbolPlacement) {
/**
The label is placed at the point where the geometry is located.
*/
MGLSymbolPlacementPoint,
/**
The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.
*/
MGLSymbolPlacementLine,
};
/**
In combination with `symbolPlacement`, determines the rotation behavior of icons.
@@ -67,63 +51,19 @@ typedef NS_ENUM(NSUInteger, MGLIconTextFit) {
};
/**
Orientation of text when map is pitched.
Label placement relative to its geometry.
Values of this type are used in the `textPitchAlignment` property of `MGLSymbolStyleLayer`.
Values of this type are used in the `symbolPlacement` property of `MGLSymbolStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLTextPitchAlignment) {
typedef NS_ENUM(NSUInteger, MGLSymbolPlacement) {
/**
The text is aligned to the plane of the map.
The label is placed at the point where the geometry is located.
*/
MGLTextPitchAlignmentMap,
MGLSymbolPlacementPoint,
/**
The text is aligned to the plane of the viewport.
The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.
*/
MGLTextPitchAlignmentViewport,
/**
Automatically matches the value of `textRotationAlignment`.
*/
MGLTextPitchAlignmentAuto,
};
/**
In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
Values of this type are used in the `textRotationAlignment` property of `MGLSymbolStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLTextRotationAlignment) {
/**
When `symbolPlacement` is set to `MGLSymbolPlacementPoint`, aligns text east-west. When `symbolPlacement` is set to `MGLSymbolPlacementLine`, aligns text x-axes with the line.
*/
MGLTextRotationAlignmentMap,
/**
Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbolPlacement`.
*/
MGLTextRotationAlignmentViewport,
/**
When `symbolPlacement` is set to `MGLSymbolPlacementPoint`, this is equivalent to `MGLTextRotationAlignmentViewport`. When `symbolPlacement` is set to `MGLSymbolPlacementLine`, this is equivalent to `MGLTextRotationAlignmentMap`.
*/
MGLTextRotationAlignmentAuto,
};
/**
Text justification options.
Values of this type are used in the `textJustify` property of `MGLSymbolStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLTextJustify) {
/**
The text is aligned to the left.
*/
MGLTextJustifyLeft,
/**
The text is centered.
*/
MGLTextJustifyCenter,
/**
The text is aligned to the right.
*/
MGLTextJustifyRight,
MGLSymbolPlacementLine,
};
/**
@@ -170,6 +110,66 @@ typedef NS_ENUM(NSUInteger, MGLTextAnchor) {
MGLTextAnchorBottomRight,
};
/**
Text justification options.
Values of this type are used in the `textJustify` property of `MGLSymbolStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLTextJustify) {
/**
The text is aligned to the left.
*/
MGLTextJustifyLeft,
/**
The text is centered.
*/
MGLTextJustifyCenter,
/**
The text is aligned to the right.
*/
MGLTextJustifyRight,
};
/**
Orientation of text when map is pitched.
Values of this type are used in the `textPitchAlignment` property of `MGLSymbolStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLTextPitchAlignment) {
/**
The text is aligned to the plane of the map.
*/
MGLTextPitchAlignmentMap,
/**
The text is aligned to the plane of the viewport.
*/
MGLTextPitchAlignmentViewport,
/**
Automatically matches the value of `textRotationAlignment`.
*/
MGLTextPitchAlignmentAuto,
};
/**
In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
Values of this type are used in the `textRotationAlignment` property of `MGLSymbolStyleLayer`.
*/
typedef NS_ENUM(NSUInteger, MGLTextRotationAlignment) {
/**
When `symbolPlacement` is set to `MGLSymbolPlacementPoint`, aligns text east-west. When `symbolPlacement` is set to `MGLSymbolPlacementLine`, aligns text x-axes with the line.
*/
MGLTextRotationAlignmentMap,
/**
Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbolPlacement`.
*/
MGLTextRotationAlignmentViewport,
/**
When `symbolPlacement` is set to `MGLSymbolPlacementPoint`, this is equivalent to `MGLTextRotationAlignmentViewport`. When `symbolPlacement` is set to `MGLSymbolPlacementLine`, this is equivalent to `MGLTextRotationAlignmentMap`.
*/
MGLTextRotationAlignmentAuto,
};
/**
Specifies how to capitalize text.
@@ -232,31 +232,6 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
#pragma mark - Accessing the Layout Attributes
/**
Label placement relative to its geometry.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementPoint`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *symbolPlacement;
/**
Distance between two symbol anchors.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `250`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolSpacing;
/**
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `NO`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolAvoidEdges;
/**
If true, the icon will be visible even if it collides with other previously drawn symbols.
@@ -275,6 +250,29 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconIgnorePlacement;
/**
A string with {tokens} replaced, referencing the data property to pull from.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *iconImageName;
/**
If true, the icon may be flipped to prevent it from being rendered upside-down.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `NO`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`, and `iconRotationAlignment` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLIconRotationAlignmentMap`, and `symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconKeepUpright;
/**
Offset distance of icon from its anchor.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing a `CGVector` struct set to 0 from the left and 0 from the top. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconOffset;
/**
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
@@ -284,6 +282,28 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOptional;
/**
Size of the additional area around the icon bounding box used for detecting symbol collisions.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `2`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconPadding;
/**
Rotates the icon clockwise.
This property is measured in degrees.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconRotate;
/**
In combination with `symbolPlacement`, determines the rotation behavior of icons.
@@ -323,67 +343,47 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTextFitPadding;
/**
A string with {tokens} replaced, referencing the data property to pull from.
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `NO`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *iconImage;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolAvoidEdges;
/**
Rotates the icon clockwise.
This property is measured in degrees.
Label placement relative to its geometry.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementPoint`. Set this property to `nil` to reset it to the default value.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconRotate;
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *symbolPlacement;
/**
Size of the additional area around the icon bounding box used for detecting symbol collisions.
Distance between two symbol anchors.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `2`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `250`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
This property is only applied to the style if `symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconPadding;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolSpacing;
/**
If true, the icon may be flipped to prevent it from being rendered upside-down.
If true, the text will be visible even if it collides with other previously drawn symbols.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `NO`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`, and `iconRotationAlignment` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLIconRotationAlignmentMap`, and `symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconKeepUpright;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textAllowOverlap;
/**
Offset distance of icon from its anchor.
Part of the text placed closest to the anchor.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing a `CGVector` struct set to 0 from the left and 0 from the top. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconOffset;
/**
Orientation of text when map is pitched.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextPitchAlignmentAuto`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextAnchorCenter`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textPitchAlignment;
/**
In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextRotationAlignmentAuto`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textRotationAlignment;
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textAnchor;
/**
Value to use for a text label. Feature properties are specified using tokens like {field_name}.
@@ -402,37 +402,31 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<NSArray<NSString *> *> *textFont;
/**
Font size.
This property is measured in points.
If true, other symbols can be visible even if they collide with the text.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `16`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `NO`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textSize;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textIgnorePlacement;
/**
The maximum line width for text wrapping.
This property is measured in ems.
Text justification options.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `10`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextJustifyCenter`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textMaxWidth;
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textJustify;
/**
Text leading value for multi-line text.
This property is measured in ems.
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1.2`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `YES`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
This property is only applied to the style if `textField` is non-`nil`, and `textRotationAlignment` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextRotationAlignmentMap`, and `symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLineHeight;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textKeepUpright;
/**
Text tracking amount.
@@ -446,22 +440,15 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLetterSpacing;
/**
Text justification options.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextJustifyCenter`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textJustify;
Text leading value for multi-line text.
/**
Part of the text placed closest to the anchor.
This property is measured in ems.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextAnchorCenter`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1.2`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textAnchor;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLineHeight;
/**
Maximum angle change between adjacent characters.
@@ -475,44 +462,15 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textMaxAngle;
/**
Rotates the text clockwise.
The maximum line width for text wrapping.
This property is measured in degrees.
This property is measured in ems.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `10`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textRotate;
/**
Size of the additional area around the text bounding box used for detecting symbol collisions.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `2`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textPadding;
/**
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `YES`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`, and `textRotationAlignment` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextRotationAlignmentMap`, and `symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textKeepUpright;
/**
Specifies how to capitalize text.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextTransformNone`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTransform;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textMaxWidth;
/**
Offset distance of text from its anchor.
@@ -525,24 +483,6 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textOffset;
/**
If true, the text will be visible even if it collides with other previously drawn symbols.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `NO`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textAllowOverlap;
/**
If true, other symbols can be visible even if they collide with the text.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `NO`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textIgnorePlacement;
/**
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
@@ -552,16 +492,67 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOptional;
#pragma mark - Accessing the Paint Attributes
/**
Size of the additional area around the text bounding box used for detecting symbol collisions.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `2`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textPadding;
/**
The opacity at which the icon will be drawn.
Orientation of text when map is pitched.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextPitchAlignmentAuto`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOpacity;
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textPitchAlignment;
/**
Rotates the text clockwise.
This property is measured in degrees.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textRotate;
/**
In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextRotationAlignmentAuto`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textRotationAlignment;
/**
Font size.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `16`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textSize;
/**
Specifies how to capitalize text.
The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextTransformNone`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTransform;
#pragma mark - Accessing the Paint Attributes
#if TARGET_OS_IPHONE
/**
@@ -583,6 +574,17 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *iconColor;
#endif
/**
Fade out the halo towards the outside.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloBlur;
#if TARGET_OS_IPHONE
/**
The color of the icon's halo. Icon halos can only be used with SDF icons.
@@ -615,15 +617,13 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloWidth;
/**
Fade out the halo towards the outside.
This property is measured in points.
The opacity at which the icon will be drawn.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloBlur;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOpacity;
/**
Distance that the icon's anchor is moved from its original placement.
@@ -645,15 +645,6 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTranslateAnchor;
/**
The opacity at which the text will be drawn.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOpacity;
#if TARGET_OS_IPHONE
/**
The color with which the text will be drawn.
@@ -674,6 +665,17 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *textColor;
#endif
/**
The halo's fadeout distance towards the outside.
This property is measured in points.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloBlur;
#if TARGET_OS_IPHONE
/**
The color of the text's halo, which helps it stand out from backgrounds.
@@ -706,15 +708,13 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloWidth;
/**
The halo's fadeout distance towards the outside.
This property is measured in points.
The opacity at which the text will be drawn.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value.
The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloBlur;
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOpacity;
/**
Distance that the text's anchor is moved from its original placement.

View File

@@ -11,11 +11,6 @@
#include <mbgl/style/layers/symbol_layer.hpp>
namespace mbgl {
MBGL_DEFINE_ENUM(MGLSymbolPlacement, {
{ MGLSymbolPlacementPoint, "point" },
{ MGLSymbolPlacementLine, "line" },
});
MBGL_DEFINE_ENUM(MGLIconRotationAlignment, {
{ MGLIconRotationAlignmentMap, "map" },
{ MGLIconRotationAlignmentViewport, "viewport" },
@@ -29,22 +24,9 @@ namespace mbgl {
{ MGLIconTextFitBoth, "both" },
});
MBGL_DEFINE_ENUM(MGLTextPitchAlignment, {
{ MGLTextPitchAlignmentMap, "map" },
{ MGLTextPitchAlignmentViewport, "viewport" },
{ MGLTextPitchAlignmentAuto, "auto" },
});
MBGL_DEFINE_ENUM(MGLTextRotationAlignment, {
{ MGLTextRotationAlignmentMap, "map" },
{ MGLTextRotationAlignmentViewport, "viewport" },
{ MGLTextRotationAlignmentAuto, "auto" },
});
MBGL_DEFINE_ENUM(MGLTextJustify, {
{ MGLTextJustifyLeft, "left" },
{ MGLTextJustifyCenter, "center" },
{ MGLTextJustifyRight, "right" },
MBGL_DEFINE_ENUM(MGLSymbolPlacement, {
{ MGLSymbolPlacementPoint, "point" },
{ MGLSymbolPlacementLine, "line" },
});
MBGL_DEFINE_ENUM(MGLTextAnchor, {
@@ -59,6 +41,24 @@ namespace mbgl {
{ MGLTextAnchorBottomRight, "bottom-right" },
});
MBGL_DEFINE_ENUM(MGLTextJustify, {
{ MGLTextJustifyLeft, "left" },
{ MGLTextJustifyCenter, "center" },
{ MGLTextJustifyRight, "right" },
});
MBGL_DEFINE_ENUM(MGLTextPitchAlignment, {
{ MGLTextPitchAlignmentMap, "map" },
{ MGLTextPitchAlignmentViewport, "viewport" },
{ MGLTextPitchAlignmentAuto, "auto" },
});
MBGL_DEFINE_ENUM(MGLTextRotationAlignment, {
{ MGLTextRotationAlignmentMap, "map" },
{ MGLTextRotationAlignmentViewport, "viewport" },
{ MGLTextRotationAlignmentAuto, "auto" },
});
MBGL_DEFINE_ENUM(MGLTextTransform, {
{ MGLTextTransformNone, "none" },
{ MGLTextTransformUppercase, "uppercase" },
@@ -146,36 +146,6 @@ namespace mbgl {
#pragma mark - Accessing the Layout Attributes
- (void)setSymbolPlacement:(MGLStyleValue<NSValue *> *)symbolPlacement {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *, mbgl::style::SymbolPlacementType, MGLSymbolPlacement>().toEnumPropertyValue(symbolPlacement);
_rawLayer->setSymbolPlacement(mbglValue);
}
- (MGLStyleValue<NSValue *> *)symbolPlacement {
auto propertyValue = _rawLayer->getSymbolPlacement() ?: _rawLayer->getDefaultSymbolPlacement();
return MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *, mbgl::style::SymbolPlacementType, MGLSymbolPlacement>().toEnumStyleValue(propertyValue);
}
- (void)setSymbolSpacing:(MGLStyleValue<NSNumber *> *)symbolSpacing {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(symbolSpacing);
_rawLayer->setSymbolSpacing(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)symbolSpacing {
auto propertyValue = _rawLayer->getSymbolSpacing() ?: _rawLayer->getDefaultSymbolSpacing();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setSymbolAvoidEdges:(MGLStyleValue<NSNumber *> *)symbolAvoidEdges {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(symbolAvoidEdges);
_rawLayer->setSymbolAvoidEdges(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)symbolAvoidEdges {
auto propertyValue = _rawLayer->getSymbolAvoidEdges() ?: _rawLayer->getDefaultSymbolAvoidEdges();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconAllowOverlap:(MGLStyleValue<NSNumber *> *)iconAllowOverlap {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(iconAllowOverlap);
_rawLayer->setIconAllowOverlap(mbglValue);
@@ -196,6 +166,36 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconImageName:(MGLStyleValue<NSString *> *)iconImageName {
auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(iconImageName);
_rawLayer->setIconImage(mbglValue);
}
- (MGLStyleValue<NSString *> *)iconImageName {
auto propertyValue = _rawLayer->getIconImage() ?: _rawLayer->getDefaultIconImage();
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
- (void)setIconKeepUpright:(MGLStyleValue<NSNumber *> *)iconKeepUpright {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(iconKeepUpright);
_rawLayer->setIconKeepUpright(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconKeepUpright {
auto propertyValue = _rawLayer->getIconKeepUpright() ?: _rawLayer->getDefaultIconKeepUpright();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconOffset:(MGLStyleValue<NSValue *> *)iconOffset {
auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(iconOffset);
_rawLayer->setIconOffset(mbglValue);
}
- (MGLStyleValue<NSValue *> *)iconOffset {
auto propertyValue = _rawLayer->getIconOffset() ?: _rawLayer->getDefaultIconOffset();
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
- (void)setIconOptional:(MGLStyleValue<NSNumber *> *)iconOptional {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(iconOptional);
_rawLayer->setIconOptional(mbglValue);
@@ -206,6 +206,26 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconPadding:(MGLStyleValue<NSNumber *> *)iconPadding {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconPadding);
_rawLayer->setIconPadding(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconPadding {
auto propertyValue = _rawLayer->getIconPadding() ?: _rawLayer->getDefaultIconPadding();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconRotate:(MGLStyleValue<NSNumber *> *)iconRotate {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconRotate);
_rawLayer->setIconRotate(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconRotate {
auto propertyValue = _rawLayer->getIconRotate() ?: _rawLayer->getDefaultIconRotate();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconRotationAlignment:(MGLStyleValue<NSValue *> *)iconRotationAlignment {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLIconRotationAlignment>().toEnumPropertyValue(iconRotationAlignment);
_rawLayer->setIconRotationAlignment(mbglValue);
@@ -246,74 +266,54 @@ namespace mbgl {
return MGLStyleValueTransformer<std::array<float, 4>, NSValue *>().toStyleValue(propertyValue);
}
- (void)setIconImage:(MGLStyleValue<NSString *> *)iconImage {
auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(iconImage);
_rawLayer->setIconImage(mbglValue);
- (void)setSymbolAvoidEdges:(MGLStyleValue<NSNumber *> *)symbolAvoidEdges {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(symbolAvoidEdges);
_rawLayer->setSymbolAvoidEdges(mbglValue);
}
- (MGLStyleValue<NSString *> *)iconImage {
auto propertyValue = _rawLayer->getIconImage() ?: _rawLayer->getDefaultIconImage();
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
- (void)setIconRotate:(MGLStyleValue<NSNumber *> *)iconRotate {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconRotate);
_rawLayer->setIconRotate(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconRotate {
auto propertyValue = _rawLayer->getIconRotate() ?: _rawLayer->getDefaultIconRotate();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconPadding:(MGLStyleValue<NSNumber *> *)iconPadding {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconPadding);
_rawLayer->setIconPadding(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconPadding {
auto propertyValue = _rawLayer->getIconPadding() ?: _rawLayer->getDefaultIconPadding();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconKeepUpright:(MGLStyleValue<NSNumber *> *)iconKeepUpright {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(iconKeepUpright);
_rawLayer->setIconKeepUpright(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconKeepUpright {
auto propertyValue = _rawLayer->getIconKeepUpright() ?: _rawLayer->getDefaultIconKeepUpright();
- (MGLStyleValue<NSNumber *> *)symbolAvoidEdges {
auto propertyValue = _rawLayer->getSymbolAvoidEdges() ?: _rawLayer->getDefaultSymbolAvoidEdges();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconOffset:(MGLStyleValue<NSValue *> *)iconOffset {
auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(iconOffset);
_rawLayer->setIconOffset(mbglValue);
- (void)setSymbolPlacement:(MGLStyleValue<NSValue *> *)symbolPlacement {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *, mbgl::style::SymbolPlacementType, MGLSymbolPlacement>().toEnumPropertyValue(symbolPlacement);
_rawLayer->setSymbolPlacement(mbglValue);
}
- (MGLStyleValue<NSValue *> *)iconOffset {
auto propertyValue = _rawLayer->getIconOffset() ?: _rawLayer->getDefaultIconOffset();
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
- (MGLStyleValue<NSValue *> *)symbolPlacement {
auto propertyValue = _rawLayer->getSymbolPlacement() ?: _rawLayer->getDefaultSymbolPlacement();
return MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *, mbgl::style::SymbolPlacementType, MGLSymbolPlacement>().toEnumStyleValue(propertyValue);
}
- (void)setTextPitchAlignment:(MGLStyleValue<NSValue *> *)textPitchAlignment {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextPitchAlignment>().toEnumPropertyValue(textPitchAlignment);
_rawLayer->setTextPitchAlignment(mbglValue);
- (void)setSymbolSpacing:(MGLStyleValue<NSNumber *> *)symbolSpacing {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(symbolSpacing);
_rawLayer->setSymbolSpacing(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textPitchAlignment {
auto propertyValue = _rawLayer->getTextPitchAlignment() ?: _rawLayer->getDefaultTextPitchAlignment();
return MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextPitchAlignment>().toEnumStyleValue(propertyValue);
- (MGLStyleValue<NSNumber *> *)symbolSpacing {
auto propertyValue = _rawLayer->getSymbolSpacing() ?: _rawLayer->getDefaultSymbolSpacing();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextRotationAlignment:(MGLStyleValue<NSValue *> *)textRotationAlignment {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextRotationAlignment>().toEnumPropertyValue(textRotationAlignment);
_rawLayer->setTextRotationAlignment(mbglValue);
- (void)setTextAllowOverlap:(MGLStyleValue<NSNumber *> *)textAllowOverlap {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textAllowOverlap);
_rawLayer->setTextAllowOverlap(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textRotationAlignment {
auto propertyValue = _rawLayer->getTextRotationAlignment() ?: _rawLayer->getDefaultTextRotationAlignment();
return MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextRotationAlignment>().toEnumStyleValue(propertyValue);
- (MGLStyleValue<NSNumber *> *)textAllowOverlap {
auto propertyValue = _rawLayer->getTextAllowOverlap() ?: _rawLayer->getDefaultTextAllowOverlap();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextAnchor:(MGLStyleValue<NSValue *> *)textAnchor {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextAnchorType, NSValue *, mbgl::style::TextAnchorType, MGLTextAnchor>().toEnumPropertyValue(textAnchor);
_rawLayer->setTextAnchor(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textAnchor {
auto propertyValue = _rawLayer->getTextAnchor() ?: _rawLayer->getDefaultTextAnchor();
return MGLStyleValueTransformer<mbgl::style::TextAnchorType, NSValue *, mbgl::style::TextAnchorType, MGLTextAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setTextField:(MGLStyleValue<NSString *> *)textField {
@@ -336,23 +336,43 @@ namespace mbgl {
return MGLStyleValueTransformer<std::vector<std::string>, NSArray<NSString *> *, std::string>().toStyleValue(propertyValue);
}
- (void)setTextSize:(MGLStyleValue<NSNumber *> *)textSize {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textSize);
_rawLayer->setTextSize(mbglValue);
- (void)setTextIgnorePlacement:(MGLStyleValue<NSNumber *> *)textIgnorePlacement {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textIgnorePlacement);
_rawLayer->setTextIgnorePlacement(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textSize {
auto propertyValue = _rawLayer->getTextSize() ?: _rawLayer->getDefaultTextSize();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
- (MGLStyleValue<NSNumber *> *)textIgnorePlacement {
auto propertyValue = _rawLayer->getTextIgnorePlacement() ?: _rawLayer->getDefaultTextIgnorePlacement();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextMaxWidth:(MGLStyleValue<NSNumber *> *)textMaxWidth {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textMaxWidth);
_rawLayer->setTextMaxWidth(mbglValue);
- (void)setTextJustify:(MGLStyleValue<NSValue *> *)textJustify {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *, mbgl::style::TextJustifyType, MGLTextJustify>().toEnumPropertyValue(textJustify);
_rawLayer->setTextJustify(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textMaxWidth {
auto propertyValue = _rawLayer->getTextMaxWidth() ?: _rawLayer->getDefaultTextMaxWidth();
- (MGLStyleValue<NSValue *> *)textJustify {
auto propertyValue = _rawLayer->getTextJustify() ?: _rawLayer->getDefaultTextJustify();
return MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *, mbgl::style::TextJustifyType, MGLTextJustify>().toEnumStyleValue(propertyValue);
}
- (void)setTextKeepUpright:(MGLStyleValue<NSNumber *> *)textKeepUpright {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textKeepUpright);
_rawLayer->setTextKeepUpright(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textKeepUpright {
auto propertyValue = _rawLayer->getTextKeepUpright() ?: _rawLayer->getDefaultTextKeepUpright();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextLetterSpacing:(MGLStyleValue<NSNumber *> *)textLetterSpacing {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textLetterSpacing);
_rawLayer->setTextLetterSpacing(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textLetterSpacing {
auto propertyValue = _rawLayer->getTextLetterSpacing() ?: _rawLayer->getDefaultTextLetterSpacing();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
@@ -366,36 +386,6 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextLetterSpacing:(MGLStyleValue<NSNumber *> *)textLetterSpacing {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textLetterSpacing);
_rawLayer->setTextLetterSpacing(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textLetterSpacing {
auto propertyValue = _rawLayer->getTextLetterSpacing() ?: _rawLayer->getDefaultTextLetterSpacing();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextJustify:(MGLStyleValue<NSValue *> *)textJustify {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *, mbgl::style::TextJustifyType, MGLTextJustify>().toEnumPropertyValue(textJustify);
_rawLayer->setTextJustify(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textJustify {
auto propertyValue = _rawLayer->getTextJustify() ?: _rawLayer->getDefaultTextJustify();
return MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *, mbgl::style::TextJustifyType, MGLTextJustify>().toEnumStyleValue(propertyValue);
}
- (void)setTextAnchor:(MGLStyleValue<NSValue *> *)textAnchor {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextAnchorType, NSValue *, mbgl::style::TextAnchorType, MGLTextAnchor>().toEnumPropertyValue(textAnchor);
_rawLayer->setTextAnchor(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textAnchor {
auto propertyValue = _rawLayer->getTextAnchor() ?: _rawLayer->getDefaultTextAnchor();
return MGLStyleValueTransformer<mbgl::style::TextAnchorType, NSValue *, mbgl::style::TextAnchorType, MGLTextAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setTextMaxAngle:(MGLStyleValue<NSNumber *> *)textMaxAngle {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textMaxAngle);
_rawLayer->setTextMaxAngle(mbglValue);
@@ -406,46 +396,16 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextRotate:(MGLStyleValue<NSNumber *> *)textRotate {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textRotate);
_rawLayer->setTextRotate(mbglValue);
- (void)setTextMaxWidth:(MGLStyleValue<NSNumber *> *)textMaxWidth {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textMaxWidth);
_rawLayer->setTextMaxWidth(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textRotate {
auto propertyValue = _rawLayer->getTextRotate() ?: _rawLayer->getDefaultTextRotate();
- (MGLStyleValue<NSNumber *> *)textMaxWidth {
auto propertyValue = _rawLayer->getTextMaxWidth() ?: _rawLayer->getDefaultTextMaxWidth();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextPadding:(MGLStyleValue<NSNumber *> *)textPadding {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textPadding);
_rawLayer->setTextPadding(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textPadding {
auto propertyValue = _rawLayer->getTextPadding() ?: _rawLayer->getDefaultTextPadding();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextKeepUpright:(MGLStyleValue<NSNumber *> *)textKeepUpright {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textKeepUpright);
_rawLayer->setTextKeepUpright(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textKeepUpright {
auto propertyValue = _rawLayer->getTextKeepUpright() ?: _rawLayer->getDefaultTextKeepUpright();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextTransform:(MGLStyleValue<NSValue *> *)textTransform {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextTransformType, NSValue *, mbgl::style::TextTransformType, MGLTextTransform>().toEnumPropertyValue(textTransform);
_rawLayer->setTextTransform(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textTransform {
auto propertyValue = _rawLayer->getTextTransform() ?: _rawLayer->getDefaultTextTransform();
return MGLStyleValueTransformer<mbgl::style::TextTransformType, NSValue *, mbgl::style::TextTransformType, MGLTextTransform>().toEnumStyleValue(propertyValue);
}
- (void)setTextOffset:(MGLStyleValue<NSValue *> *)textOffset {
auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(textOffset);
_rawLayer->setTextOffset(mbglValue);
@@ -456,26 +416,6 @@ namespace mbgl {
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
- (void)setTextAllowOverlap:(MGLStyleValue<NSNumber *> *)textAllowOverlap {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textAllowOverlap);
_rawLayer->setTextAllowOverlap(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textAllowOverlap {
auto propertyValue = _rawLayer->getTextAllowOverlap() ?: _rawLayer->getDefaultTextAllowOverlap();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextIgnorePlacement:(MGLStyleValue<NSNumber *> *)textIgnorePlacement {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textIgnorePlacement);
_rawLayer->setTextIgnorePlacement(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textIgnorePlacement {
auto propertyValue = _rawLayer->getTextIgnorePlacement() ?: _rawLayer->getDefaultTextIgnorePlacement();
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextOptional:(MGLStyleValue<NSNumber *> *)textOptional {
auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textOptional);
_rawLayer->setTextOptional(mbglValue);
@@ -486,18 +426,68 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
#pragma mark - Accessing the Paint Attributes
- (void)setIconOpacity:(MGLStyleValue<NSNumber *> *)iconOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconOpacity);
_rawLayer->setIconOpacity(mbglValue);
- (void)setTextPadding:(MGLStyleValue<NSNumber *> *)textPadding {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textPadding);
_rawLayer->setTextPadding(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconOpacity {
auto propertyValue = _rawLayer->getIconOpacity() ?: _rawLayer->getDefaultIconOpacity();
- (MGLStyleValue<NSNumber *> *)textPadding {
auto propertyValue = _rawLayer->getTextPadding() ?: _rawLayer->getDefaultTextPadding();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextPitchAlignment:(MGLStyleValue<NSValue *> *)textPitchAlignment {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextPitchAlignment>().toEnumPropertyValue(textPitchAlignment);
_rawLayer->setTextPitchAlignment(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textPitchAlignment {
auto propertyValue = _rawLayer->getTextPitchAlignment() ?: _rawLayer->getDefaultTextPitchAlignment();
return MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextPitchAlignment>().toEnumStyleValue(propertyValue);
}
- (void)setTextRotate:(MGLStyleValue<NSNumber *> *)textRotate {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textRotate);
_rawLayer->setTextRotate(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textRotate {
auto propertyValue = _rawLayer->getTextRotate() ?: _rawLayer->getDefaultTextRotate();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextRotationAlignment:(MGLStyleValue<NSValue *> *)textRotationAlignment {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextRotationAlignment>().toEnumPropertyValue(textRotationAlignment);
_rawLayer->setTextRotationAlignment(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textRotationAlignment {
auto propertyValue = _rawLayer->getTextRotationAlignment() ?: _rawLayer->getDefaultTextRotationAlignment();
return MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextRotationAlignment>().toEnumStyleValue(propertyValue);
}
- (void)setTextSize:(MGLStyleValue<NSNumber *> *)textSize {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textSize);
_rawLayer->setTextSize(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textSize {
auto propertyValue = _rawLayer->getTextSize() ?: _rawLayer->getDefaultTextSize();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextTransform:(MGLStyleValue<NSValue *> *)textTransform {
auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextTransformType, NSValue *, mbgl::style::TextTransformType, MGLTextTransform>().toEnumPropertyValue(textTransform);
_rawLayer->setTextTransform(mbglValue);
}
- (MGLStyleValue<NSValue *> *)textTransform {
auto propertyValue = _rawLayer->getTextTransform() ?: _rawLayer->getDefaultTextTransform();
return MGLStyleValueTransformer<mbgl::style::TextTransformType, NSValue *, mbgl::style::TextTransformType, MGLTextTransform>().toEnumStyleValue(propertyValue);
}
#pragma mark - Accessing the Paint Attributes
- (void)setIconColor:(MGLStyleValue<MGLColor *> *)iconColor {
auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(iconColor);
_rawLayer->setIconColor(mbglValue);
@@ -508,6 +498,16 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
- (void)setIconHaloBlur:(MGLStyleValue<NSNumber *> *)iconHaloBlur {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconHaloBlur);
_rawLayer->setIconHaloBlur(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconHaloBlur {
auto propertyValue = _rawLayer->getIconHaloBlur() ?: _rawLayer->getDefaultIconHaloBlur();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconHaloColor:(MGLStyleValue<MGLColor *> *)iconHaloColor {
auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(iconHaloColor);
_rawLayer->setIconHaloColor(mbglValue);
@@ -528,13 +528,13 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconHaloBlur:(MGLStyleValue<NSNumber *> *)iconHaloBlur {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconHaloBlur);
_rawLayer->setIconHaloBlur(mbglValue);
- (void)setIconOpacity:(MGLStyleValue<NSNumber *> *)iconOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconOpacity);
_rawLayer->setIconOpacity(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)iconHaloBlur {
auto propertyValue = _rawLayer->getIconHaloBlur() ?: _rawLayer->getDefaultIconHaloBlur();
- (MGLStyleValue<NSNumber *> *)iconOpacity {
auto propertyValue = _rawLayer->getIconOpacity() ?: _rawLayer->getDefaultIconOpacity();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
@@ -558,16 +558,6 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLIconTranslateAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setTextOpacity:(MGLStyleValue<NSNumber *> *)textOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textOpacity);
_rawLayer->setTextOpacity(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textOpacity {
auto propertyValue = _rawLayer->getTextOpacity() ?: _rawLayer->getDefaultTextOpacity();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextColor:(MGLStyleValue<MGLColor *> *)textColor {
auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(textColor);
_rawLayer->setTextColor(mbglValue);
@@ -578,6 +568,16 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
- (void)setTextHaloBlur:(MGLStyleValue<NSNumber *> *)textHaloBlur {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textHaloBlur);
_rawLayer->setTextHaloBlur(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textHaloBlur {
auto propertyValue = _rawLayer->getTextHaloBlur() ?: _rawLayer->getDefaultTextHaloBlur();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextHaloColor:(MGLStyleValue<MGLColor *> *)textHaloColor {
auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(textHaloColor);
_rawLayer->setTextHaloColor(mbglValue);
@@ -598,13 +598,13 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextHaloBlur:(MGLStyleValue<NSNumber *> *)textHaloBlur {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textHaloBlur);
_rawLayer->setTextHaloBlur(mbglValue);
- (void)setTextOpacity:(MGLStyleValue<NSNumber *> *)textOpacity {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textOpacity);
_rawLayer->setTextOpacity(mbglValue);
}
- (MGLStyleValue<NSNumber *> *)textHaloBlur {
auto propertyValue = _rawLayer->getTextHaloBlur() ?: _rawLayer->getDefaultTextHaloBlur();
- (MGLStyleValue<NSNumber *> *)textOpacity {
auto propertyValue = _rawLayer->getTextOpacity() ?: _rawLayer->getDefaultTextOpacity();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}

View File

@@ -45,19 +45,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (readonly) MGLLineJoin MGLLineJoinValue;
/**
Creates a new value object containing the given `MGLSymbolPlacement` enumeration.
@param type The value for the new object.
@return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGLSymbolPlacement:(MGLSymbolPlacement)symbolPlacement;
/**
The `MGLSymbolPlacement` enumeration representation of the value.
*/
@property (readonly) MGLSymbolPlacement MGLSymbolPlacementValue;
/**
Creates a new value object containing the given `MGLIconRotationAlignment` enumeration.
@@ -84,6 +71,45 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (readonly) MGLIconTextFit MGLIconTextFitValue;
/**
Creates a new value object containing the given `MGLSymbolPlacement` enumeration.
@param type The value for the new object.
@return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGLSymbolPlacement:(MGLSymbolPlacement)symbolPlacement;
/**
The `MGLSymbolPlacement` enumeration representation of the value.
*/
@property (readonly) MGLSymbolPlacement MGLSymbolPlacementValue;
/**
Creates a new value object containing the given `MGLTextAnchor` enumeration.
@param type The value for the new object.
@return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGLTextAnchor:(MGLTextAnchor)textAnchor;
/**
The `MGLTextAnchor` enumeration representation of the value.
*/
@property (readonly) MGLTextAnchor MGLTextAnchorValue;
/**
Creates a new value object containing the given `MGLTextJustify` enumeration.
@param type The value for the new object.
@return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGLTextJustify:(MGLTextJustify)textJustify;
/**
The `MGLTextJustify` enumeration representation of the value.
*/
@property (readonly) MGLTextJustify MGLTextJustifyValue;
/**
Creates a new value object containing the given `MGLTextPitchAlignment` enumeration.
@@ -110,32 +136,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (readonly) MGLTextRotationAlignment MGLTextRotationAlignmentValue;
/**
Creates a new value object containing the given `MGLTextJustify` enumeration.
@param type The value for the new object.
@return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGLTextJustify:(MGLTextJustify)textJustify;
/**
The `MGLTextJustify` enumeration representation of the value.
*/
@property (readonly) MGLTextJustify MGLTextJustifyValue;
/**
Creates a new value object containing the given `MGLTextAnchor` enumeration.
@param type The value for the new object.
@return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGLTextAnchor:(MGLTextAnchor)textAnchor;
/**
The `MGLTextAnchor` enumeration representation of the value.
*/
@property (readonly) MGLTextAnchor MGLTextAnchorValue;
/**
Creates a new value object containing the given `MGLTextTransform` enumeration.
@@ -201,19 +201,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (readonly) MGLTextTranslateAnchor MGLTextTranslateAnchorValue;
/**
Creates a new value object containing the given `MGLCircleTranslateAnchor` structure.
@param type The value for the new object.
@return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGLCircleTranslateAnchor:(MGLCircleTranslateAnchor)circleTranslateAnchor;
/**
The `MGLCircleTranslateAnchor` enumeration representation of the value.
*/
@property (readonly) MGLCircleTranslateAnchor MGLCircleTranslateAnchorValue;
/**
Creates a new value object containing the given `MGLCirclePitchScale` structure.
@@ -227,6 +214,19 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (readonly) MGLCirclePitchScale MGLCirclePitchScaleValue;
/**
Creates a new value object containing the given `MGLCircleTranslateAnchor` structure.
@param type The value for the new object.
@return A new value object that contains the style enumeration type.
*/
+ (instancetype)valueWithMGLCircleTranslateAnchor:(MGLCircleTranslateAnchor)circleTranslateAnchor;
/**
The `MGLCircleTranslateAnchor` enumeration representation of the value.
*/
@property (readonly) MGLCircleTranslateAnchor MGLCircleTranslateAnchorValue;
@end
NS_ASSUME_NONNULL_END

View File

@@ -25,16 +25,6 @@
return value;
}
+ (NSValue *)valueWithMGLSymbolPlacement:(MGLSymbolPlacement)symbolPlacement {
return [NSValue value:&symbolPlacement withObjCType:@encode(MGLSymbolPlacement)];
}
- (MGLSymbolPlacement)MGLSymbolPlacementValue {
MGLSymbolPlacement value;
[self getValue:&value];
return value;
}
+ (NSValue *)valueWithMGLIconRotationAlignment:(MGLIconRotationAlignment)iconRotationAlignment {
return [NSValue value:&iconRotationAlignment withObjCType:@encode(MGLIconRotationAlignment)];
}
@@ -55,6 +45,36 @@
return value;
}
+ (NSValue *)valueWithMGLSymbolPlacement:(MGLSymbolPlacement)symbolPlacement {
return [NSValue value:&symbolPlacement withObjCType:@encode(MGLSymbolPlacement)];
}
- (MGLSymbolPlacement)MGLSymbolPlacementValue {
MGLSymbolPlacement value;
[self getValue:&value];
return value;
}
+ (NSValue *)valueWithMGLTextAnchor:(MGLTextAnchor)textAnchor {
return [NSValue value:&textAnchor withObjCType:@encode(MGLTextAnchor)];
}
- (MGLTextAnchor)MGLTextAnchorValue {
MGLTextAnchor value;
[self getValue:&value];
return value;
}
+ (NSValue *)valueWithMGLTextJustify:(MGLTextJustify)textJustify {
return [NSValue value:&textJustify withObjCType:@encode(MGLTextJustify)];
}
- (MGLTextJustify)MGLTextJustifyValue {
MGLTextJustify value;
[self getValue:&value];
return value;
}
+ (NSValue *)valueWithMGLTextPitchAlignment:(MGLTextPitchAlignment)textPitchAlignment {
return [NSValue value:&textPitchAlignment withObjCType:@encode(MGLTextPitchAlignment)];
}
@@ -75,26 +95,6 @@
return value;
}
+ (NSValue *)valueWithMGLTextJustify:(MGLTextJustify)textJustify {
return [NSValue value:&textJustify withObjCType:@encode(MGLTextJustify)];
}
- (MGLTextJustify)MGLTextJustifyValue {
MGLTextJustify value;
[self getValue:&value];
return value;
}
+ (NSValue *)valueWithMGLTextAnchor:(MGLTextAnchor)textAnchor {
return [NSValue value:&textAnchor withObjCType:@encode(MGLTextAnchor)];
}
- (MGLTextAnchor)MGLTextAnchorValue {
MGLTextAnchor value;
[self getValue:&value];
return value;
}
+ (NSValue *)valueWithMGLTextTransform:(MGLTextTransform)textTransform {
return [NSValue value:&textTransform withObjCType:@encode(MGLTextTransform)];
}
@@ -145,16 +145,6 @@ return [NSValue value:&textTranslateAnchor withObjCType:@encode(MGLTextTranslate
return value;
}
+ (NSValue *)valueWithMGLCircleTranslateAnchor:(MGLCircleTranslateAnchor)circleTranslateAnchor {
return [NSValue value:&circleTranslateAnchor withObjCType:@encode(MGLCircleTranslateAnchor)];
}
- (MGLCircleTranslateAnchor)MGLCircleTranslateAnchorValue {
MGLCircleTranslateAnchor value;
[self getValue:&value];
return value;
}
+ (NSValue *)valueWithMGLCirclePitchScale:(MGLCirclePitchScale)circlePitchScale {
return [NSValue value:&circlePitchScale withObjCType:@encode(MGLCirclePitchScale)];
}
@@ -165,5 +155,15 @@ return [NSValue value:&circlePitchScale withObjCType:@encode(MGLCirclePitchScale
return value;
}
+ (NSValue *)valueWithMGLCircleTranslateAnchor:(MGLCircleTranslateAnchor)circleTranslateAnchor {
return [NSValue value:&circleTranslateAnchor withObjCType:@encode(MGLCircleTranslateAnchor)];
}
- (MGLCircleTranslateAnchor)MGLCircleTranslateAnchorValue {
MGLCircleTranslateAnchor value;
[self getValue:&value];
return value;
}
@end

View File

@@ -13,22 +13,22 @@
[self.mapView.style addLayer:layer];
layer.backgroundColor = [MGLRuntimeStylingHelper testColor];
layer.backgroundPattern = [MGLRuntimeStylingHelper testString];
layer.backgroundOpacity = [MGLRuntimeStylingHelper testNumber];
layer.backgroundPattern = [MGLRuntimeStylingHelper testString];
MGLBackgroundStyleLayer *gLayer = (MGLBackgroundStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLBackgroundStyleLayer class]]);
XCTAssertEqualObjects(gLayer.backgroundColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.backgroundPattern, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.backgroundOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.backgroundPattern, [MGLRuntimeStylingHelper testString]);
layer.backgroundColor = [MGLRuntimeStylingHelper testColorFunction];
layer.backgroundPattern = [MGLRuntimeStylingHelper testStringFunction];
layer.backgroundOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.backgroundPattern = [MGLRuntimeStylingHelper testStringFunction];
XCTAssertEqualObjects(gLayer.backgroundColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.backgroundPattern, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.backgroundOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.backgroundPattern, [MGLRuntimeStylingHelper testStringFunction]);
}
@end

View File

@@ -16,41 +16,41 @@
MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
layer.circleRadius = [MGLRuntimeStylingHelper testNumber];
layer.circleColor = [MGLRuntimeStylingHelper testColor];
layer.circleBlur = [MGLRuntimeStylingHelper testNumber];
layer.circleColor = [MGLRuntimeStylingHelper testColor];
layer.circleOpacity = [MGLRuntimeStylingHelper testNumber];
layer.circlePitchScale = [MGLRuntimeStylingHelper testEnum:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)];
layer.circleRadius = [MGLRuntimeStylingHelper testNumber];
layer.circleTranslate = [MGLRuntimeStylingHelper testOffset];
layer.circleTranslateAnchor = [MGLRuntimeStylingHelper testEnum:MGLCircleTranslateAnchorViewport type:@encode(MGLCircleTranslateAnchor)];
layer.circlePitchScale = [MGLRuntimeStylingHelper testEnum:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)];
MGLCircleStyleLayer *gLayer = (MGLCircleStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLCircleStyleLayer class]]);
XCTAssertEqualObjects(gLayer.circleRadius, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.circleColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.circleBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.circleColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.circleOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.circlePitchScale isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.circlePitchScale, [MGLRuntimeStylingHelper testEnum:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)]);
XCTAssertEqualObjects(gLayer.circleRadius, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.circleTranslate, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.circleTranslateAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.circleTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLCircleTranslateAnchorViewport type:@encode(MGLCircleTranslateAnchor)]);
XCTAssert([gLayer.circlePitchScale isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.circlePitchScale, [MGLRuntimeStylingHelper testEnum:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)]);
layer.circleRadius = [MGLRuntimeStylingHelper testNumberFunction];
layer.circleColor = [MGLRuntimeStylingHelper testColorFunction];
layer.circleBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.circleColor = [MGLRuntimeStylingHelper testColorFunction];
layer.circleOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.circlePitchScale = [MGLRuntimeStylingHelper testEnumFunction:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)];
layer.circleRadius = [MGLRuntimeStylingHelper testNumberFunction];
layer.circleTranslate = [MGLRuntimeStylingHelper testOffsetFunction];
layer.circleTranslateAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLCircleTranslateAnchorViewport type:@encode(MGLCircleTranslateAnchor)];
layer.circlePitchScale = [MGLRuntimeStylingHelper testEnumFunction:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)];
XCTAssertEqualObjects(gLayer.circleRadius, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.circleColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.circleBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.circleColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.circleOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.circlePitchScale, [MGLRuntimeStylingHelper testEnumFunction:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)]);
XCTAssertEqualObjects(gLayer.circleRadius, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.circleTranslate, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.circleTranslateAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLCircleTranslateAnchorViewport type:@encode(MGLCircleTranslateAnchor)]);
XCTAssertEqualObjects(gLayer.circlePitchScale, [MGLRuntimeStylingHelper testEnumFunction:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)]);
}
@end

View File

@@ -17,39 +17,39 @@
[self.mapView.style addLayer:layer];
layer.fillAntialias = [MGLRuntimeStylingHelper testBool];
layer.fillOpacity = [MGLRuntimeStylingHelper testNumber];
layer.fillColor = [MGLRuntimeStylingHelper testColor];
layer.fillOpacity = [MGLRuntimeStylingHelper testNumber];
layer.fillOutlineColor = [MGLRuntimeStylingHelper testColor];
layer.fillPattern = [MGLRuntimeStylingHelper testString];
layer.fillTranslate = [MGLRuntimeStylingHelper testOffset];
layer.fillTranslateAnchor = [MGLRuntimeStylingHelper testEnum:MGLFillTranslateAnchorViewport type:@encode(MGLFillTranslateAnchor)];
layer.fillPattern = [MGLRuntimeStylingHelper testString];
MGLFillStyleLayer *gLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLFillStyleLayer class]]);
XCTAssertEqualObjects(gLayer.fillAntialias, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.fillOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.fillColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.fillOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.fillOutlineColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.fillPattern, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.fillTranslate, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.fillTranslateAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.fillTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLFillTranslateAnchorViewport type:@encode(MGLFillTranslateAnchor)]);
XCTAssertEqualObjects(gLayer.fillPattern, [MGLRuntimeStylingHelper testString]);
layer.fillAntialias = [MGLRuntimeStylingHelper testBoolFunction];
layer.fillOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.fillColor = [MGLRuntimeStylingHelper testColorFunction];
layer.fillOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.fillOutlineColor = [MGLRuntimeStylingHelper testColorFunction];
layer.fillPattern = [MGLRuntimeStylingHelper testStringFunction];
layer.fillTranslate = [MGLRuntimeStylingHelper testOffsetFunction];
layer.fillTranslateAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLFillTranslateAnchorViewport type:@encode(MGLFillTranslateAnchor)];
layer.fillPattern = [MGLRuntimeStylingHelper testStringFunction];
XCTAssertEqualObjects(gLayer.fillAntialias, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.fillOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.fillColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.fillOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.fillOutlineColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.fillPattern, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.fillTranslate, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.fillTranslateAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLFillTranslateAnchorViewport type:@encode(MGLFillTranslateAnchor)]);
XCTAssertEqualObjects(gLayer.fillPattern, [MGLRuntimeStylingHelper testStringFunction]);
}
@end

View File

@@ -20,16 +20,16 @@
layer.lineJoin = [MGLRuntimeStylingHelper testEnum:MGLLineJoinMiter type:@encode(MGLLineJoin)];
layer.lineMiterLimit = [MGLRuntimeStylingHelper testNumber];
layer.lineRoundLimit = [MGLRuntimeStylingHelper testNumber];
layer.lineOpacity = [MGLRuntimeStylingHelper testNumber];
layer.lineBlur = [MGLRuntimeStylingHelper testNumber];
layer.lineColor = [MGLRuntimeStylingHelper testColor];
layer.lineDasharray = [MGLRuntimeStylingHelper testDashArray];
layer.lineGapWidth = [MGLRuntimeStylingHelper testNumber];
layer.lineOffset = [MGLRuntimeStylingHelper testNumber];
layer.lineOpacity = [MGLRuntimeStylingHelper testNumber];
layer.linePattern = [MGLRuntimeStylingHelper testString];
layer.lineTranslate = [MGLRuntimeStylingHelper testOffset];
layer.lineTranslateAnchor = [MGLRuntimeStylingHelper testEnum:MGLLineTranslateAnchorViewport type:@encode(MGLLineTranslateAnchor)];
layer.lineWidth = [MGLRuntimeStylingHelper testNumber];
layer.lineGapWidth = [MGLRuntimeStylingHelper testNumber];
layer.lineOffset = [MGLRuntimeStylingHelper testNumber];
layer.lineBlur = [MGLRuntimeStylingHelper testNumber];
layer.lineDasharray = [MGLRuntimeStylingHelper testDashArray];
layer.linePattern = [MGLRuntimeStylingHelper testString];
MGLLineStyleLayer *gLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLLineStyleLayer class]]);
@@ -39,47 +39,47 @@
XCTAssertEqualObjects(gLayer.lineJoin, [MGLRuntimeStylingHelper testEnum:MGLLineJoinMiter type:@encode(MGLLineJoin)]);
XCTAssertEqualObjects(gLayer.lineMiterLimit, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineRoundLimit, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.lineDasharray, [MGLRuntimeStylingHelper testDashArray]);
XCTAssertEqualObjects(gLayer.lineGapWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineOffset, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.linePattern, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.lineTranslate, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.lineTranslateAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.lineTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLLineTranslateAnchorViewport type:@encode(MGLLineTranslateAnchor)]);
XCTAssertEqualObjects(gLayer.lineWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineGapWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineOffset, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineDasharray, [MGLRuntimeStylingHelper testDashArray]);
XCTAssertEqualObjects(gLayer.linePattern, [MGLRuntimeStylingHelper testString]);
layer.lineCap = [MGLRuntimeStylingHelper testEnumFunction:MGLLineCapSquare type:@encode(MGLLineCap)];
layer.lineJoin = [MGLRuntimeStylingHelper testEnumFunction:MGLLineJoinMiter type:@encode(MGLLineJoin)];
layer.lineMiterLimit = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineRoundLimit = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineColor = [MGLRuntimeStylingHelper testColorFunction];
layer.lineDasharray = [MGLRuntimeStylingHelper testDashArrayFunction];
layer.lineGapWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineOffset = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.linePattern = [MGLRuntimeStylingHelper testStringFunction];
layer.lineTranslate = [MGLRuntimeStylingHelper testOffsetFunction];
layer.lineTranslateAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLLineTranslateAnchorViewport type:@encode(MGLLineTranslateAnchor)];
layer.lineWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineGapWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineOffset = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineDasharray = [MGLRuntimeStylingHelper testDashArrayFunction];
layer.linePattern = [MGLRuntimeStylingHelper testStringFunction];
XCTAssertEqualObjects(gLayer.lineCap, [MGLRuntimeStylingHelper testEnumFunction:MGLLineCapSquare type:@encode(MGLLineCap)]);
XCTAssertEqualObjects(gLayer.lineJoin, [MGLRuntimeStylingHelper testEnumFunction:MGLLineJoinMiter type:@encode(MGLLineJoin)]);
XCTAssertEqualObjects(gLayer.lineMiterLimit, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineRoundLimit, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.lineDasharray, [MGLRuntimeStylingHelper testDashArrayFunction]);
XCTAssertEqualObjects(gLayer.lineGapWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineOffset, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.linePattern, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.lineTranslate, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.lineTranslateAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLLineTranslateAnchorViewport type:@encode(MGLLineTranslateAnchor)]);
XCTAssertEqualObjects(gLayer.lineWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineGapWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineOffset, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineDasharray, [MGLRuntimeStylingHelper testDashArrayFunction]);
XCTAssertEqualObjects(gLayer.linePattern, [MGLRuntimeStylingHelper testStringFunction]);
}
@end

View File

@@ -16,39 +16,39 @@
MGLRasterStyleLayer *layer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
layer.rasterOpacity = [MGLRuntimeStylingHelper testNumber];
layer.rasterHueRotate = [MGLRuntimeStylingHelper testNumber];
layer.rasterBrightnessMin = [MGLRuntimeStylingHelper testNumber];
layer.rasterBrightnessMax = [MGLRuntimeStylingHelper testNumber];
layer.rasterSaturation = [MGLRuntimeStylingHelper testNumber];
layer.maximumRasterBrightness = [MGLRuntimeStylingHelper testNumber];
layer.minimumRasterBrightness = [MGLRuntimeStylingHelper testNumber];
layer.rasterContrast = [MGLRuntimeStylingHelper testNumber];
layer.rasterFadeDuration = [MGLRuntimeStylingHelper testNumber];
layer.rasterHueRotate = [MGLRuntimeStylingHelper testNumber];
layer.rasterOpacity = [MGLRuntimeStylingHelper testNumber];
layer.rasterSaturation = [MGLRuntimeStylingHelper testNumber];
MGLRasterStyleLayer *gLayer = (MGLRasterStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLRasterStyleLayer class]]);
XCTAssertEqualObjects(gLayer.rasterOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterHueRotate, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterBrightnessMin, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterBrightnessMax, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterSaturation, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.maximumRasterBrightness, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.minimumRasterBrightness, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterContrast, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterFadeDuration, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterHueRotate, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterSaturation, [MGLRuntimeStylingHelper testNumber]);
layer.rasterOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterHueRotate = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterBrightnessMin = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterBrightnessMax = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterSaturation = [MGLRuntimeStylingHelper testNumberFunction];
layer.maximumRasterBrightness = [MGLRuntimeStylingHelper testNumberFunction];
layer.minimumRasterBrightness = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterContrast = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterFadeDuration = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterHueRotate = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterSaturation = [MGLRuntimeStylingHelper testNumberFunction];
XCTAssertEqualObjects(gLayer.rasterOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterHueRotate, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterBrightnessMin, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterBrightnessMax, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterSaturation, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.maximumRasterBrightness, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.minimumRasterBrightness, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterContrast, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterFadeDuration, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterHueRotate, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterSaturation, [MGLRuntimeStylingHelper testNumberFunction]);
}
@end

View File

@@ -16,211 +16,211 @@
MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
layer.symbolPlacement = [MGLRuntimeStylingHelper testEnum:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)];
layer.symbolSpacing = [MGLRuntimeStylingHelper testNumber];
layer.symbolAvoidEdges = [MGLRuntimeStylingHelper testBool];
layer.iconAllowOverlap = [MGLRuntimeStylingHelper testBool];
layer.iconIgnorePlacement = [MGLRuntimeStylingHelper testBool];
layer.iconImageName = [MGLRuntimeStylingHelper testString];
layer.iconKeepUpright = [MGLRuntimeStylingHelper testBool];
layer.iconOffset = [MGLRuntimeStylingHelper testOffset];
layer.iconOptional = [MGLRuntimeStylingHelper testBool];
layer.iconPadding = [MGLRuntimeStylingHelper testNumber];
layer.iconRotate = [MGLRuntimeStylingHelper testNumber];
layer.iconRotationAlignment = [MGLRuntimeStylingHelper testEnum:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)];
layer.iconSize = [MGLRuntimeStylingHelper testNumber];
layer.iconTextFit = [MGLRuntimeStylingHelper testEnum:MGLIconTextFitBoth type:@encode(MGLIconTextFit)];
layer.iconTextFitPadding = [MGLRuntimeStylingHelper testPadding];
layer.iconImage = [MGLRuntimeStylingHelper testString];
layer.iconRotate = [MGLRuntimeStylingHelper testNumber];
layer.iconPadding = [MGLRuntimeStylingHelper testNumber];
layer.iconKeepUpright = [MGLRuntimeStylingHelper testBool];
layer.iconOffset = [MGLRuntimeStylingHelper testOffset];
layer.textPitchAlignment = [MGLRuntimeStylingHelper testEnum:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)];
layer.textRotationAlignment = [MGLRuntimeStylingHelper testEnum:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)];
layer.symbolAvoidEdges = [MGLRuntimeStylingHelper testBool];
layer.symbolPlacement = [MGLRuntimeStylingHelper testEnum:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)];
layer.symbolSpacing = [MGLRuntimeStylingHelper testNumber];
layer.textAllowOverlap = [MGLRuntimeStylingHelper testBool];
layer.textAnchor = [MGLRuntimeStylingHelper testEnum:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)];
layer.textField = [MGLRuntimeStylingHelper testString];
layer.textFont = [MGLRuntimeStylingHelper testFont];
layer.textSize = [MGLRuntimeStylingHelper testNumber];
layer.textMaxWidth = [MGLRuntimeStylingHelper testNumber];
layer.textLineHeight = [MGLRuntimeStylingHelper testNumber];
layer.textLetterSpacing = [MGLRuntimeStylingHelper testNumber];
layer.textJustify = [MGLRuntimeStylingHelper testEnum:MGLTextJustifyRight type:@encode(MGLTextJustify)];
layer.textAnchor = [MGLRuntimeStylingHelper testEnum:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)];
layer.textMaxAngle = [MGLRuntimeStylingHelper testNumber];
layer.textRotate = [MGLRuntimeStylingHelper testNumber];
layer.textPadding = [MGLRuntimeStylingHelper testNumber];
layer.textKeepUpright = [MGLRuntimeStylingHelper testBool];
layer.textTransform = [MGLRuntimeStylingHelper testEnum:MGLTextTransformLowercase type:@encode(MGLTextTransform)];
layer.textOffset = [MGLRuntimeStylingHelper testOffset];
layer.textAllowOverlap = [MGLRuntimeStylingHelper testBool];
layer.textIgnorePlacement = [MGLRuntimeStylingHelper testBool];
layer.textJustify = [MGLRuntimeStylingHelper testEnum:MGLTextJustifyRight type:@encode(MGLTextJustify)];
layer.textKeepUpright = [MGLRuntimeStylingHelper testBool];
layer.textLetterSpacing = [MGLRuntimeStylingHelper testNumber];
layer.textLineHeight = [MGLRuntimeStylingHelper testNumber];
layer.textMaxAngle = [MGLRuntimeStylingHelper testNumber];
layer.textMaxWidth = [MGLRuntimeStylingHelper testNumber];
layer.textOffset = [MGLRuntimeStylingHelper testOffset];
layer.textOptional = [MGLRuntimeStylingHelper testBool];
layer.iconOpacity = [MGLRuntimeStylingHelper testNumber];
layer.textPadding = [MGLRuntimeStylingHelper testNumber];
layer.textPitchAlignment = [MGLRuntimeStylingHelper testEnum:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)];
layer.textRotate = [MGLRuntimeStylingHelper testNumber];
layer.textRotationAlignment = [MGLRuntimeStylingHelper testEnum:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)];
layer.textSize = [MGLRuntimeStylingHelper testNumber];
layer.textTransform = [MGLRuntimeStylingHelper testEnum:MGLTextTransformLowercase type:@encode(MGLTextTransform)];
layer.iconColor = [MGLRuntimeStylingHelper testColor];
layer.iconHaloBlur = [MGLRuntimeStylingHelper testNumber];
layer.iconHaloColor = [MGLRuntimeStylingHelper testColor];
layer.iconHaloWidth = [MGLRuntimeStylingHelper testNumber];
layer.iconHaloBlur = [MGLRuntimeStylingHelper testNumber];
layer.iconOpacity = [MGLRuntimeStylingHelper testNumber];
layer.iconTranslate = [MGLRuntimeStylingHelper testOffset];
layer.iconTranslateAnchor = [MGLRuntimeStylingHelper testEnum:MGLIconTranslateAnchorViewport type:@encode(MGLIconTranslateAnchor)];
layer.textOpacity = [MGLRuntimeStylingHelper testNumber];
layer.textColor = [MGLRuntimeStylingHelper testColor];
layer.textHaloBlur = [MGLRuntimeStylingHelper testNumber];
layer.textHaloColor = [MGLRuntimeStylingHelper testColor];
layer.textHaloWidth = [MGLRuntimeStylingHelper testNumber];
layer.textHaloBlur = [MGLRuntimeStylingHelper testNumber];
layer.textOpacity = [MGLRuntimeStylingHelper testNumber];
layer.textTranslate = [MGLRuntimeStylingHelper testOffset];
layer.textTranslateAnchor = [MGLRuntimeStylingHelper testEnum:MGLTextTranslateAnchorViewport type:@encode(MGLTextTranslateAnchor)];
MGLSymbolStyleLayer *gLayer = (MGLSymbolStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLSymbolStyleLayer class]]);
XCTAssert([gLayer.symbolPlacement isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.symbolPlacement, [MGLRuntimeStylingHelper testEnum:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)]);
XCTAssertEqualObjects(gLayer.symbolSpacing, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.symbolAvoidEdges, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconAllowOverlap, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconIgnorePlacement, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconImageName, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.iconKeepUpright, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconOffset, [MGLRuntimeStylingHelper testOffset]);
XCTAssertEqualObjects(gLayer.iconOptional, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconPadding, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconRotate, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.iconRotationAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.iconRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)]);
XCTAssertEqualObjects(gLayer.iconSize, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.iconTextFit isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnum:MGLIconTextFitBoth type:@encode(MGLIconTextFit)]);
XCTAssertEqualObjects(gLayer.iconTextFitPadding, [MGLRuntimeStylingHelper testPadding]);
XCTAssertEqualObjects(gLayer.iconImage, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.iconRotate, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconPadding, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconKeepUpright, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconOffset, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.textPitchAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textPitchAlignment, [MGLRuntimeStylingHelper testEnum:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)]);
XCTAssert([gLayer.textRotationAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)]);
XCTAssertEqualObjects(gLayer.textField, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.textFont, [MGLRuntimeStylingHelper testFont]);
XCTAssertEqualObjects(gLayer.textSize, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textMaxWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textLineHeight, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textLetterSpacing, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.textJustify isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textJustify, [MGLRuntimeStylingHelper testEnum:MGLTextJustifyRight type:@encode(MGLTextJustify)]);
XCTAssertEqualObjects(gLayer.symbolAvoidEdges, [MGLRuntimeStylingHelper testBool]);
XCTAssert([gLayer.symbolPlacement isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.symbolPlacement, [MGLRuntimeStylingHelper testEnum:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)]);
XCTAssertEqualObjects(gLayer.symbolSpacing, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textAllowOverlap, [MGLRuntimeStylingHelper testBool]);
XCTAssert([gLayer.textAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textAnchor, [MGLRuntimeStylingHelper testEnum:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)]);
XCTAssertEqualObjects(gLayer.textMaxAngle, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textRotate, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textPadding, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textField, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.textFont, [MGLRuntimeStylingHelper testFont]);
XCTAssertEqualObjects(gLayer.textIgnorePlacement, [MGLRuntimeStylingHelper testBool]);
XCTAssert([gLayer.textJustify isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textJustify, [MGLRuntimeStylingHelper testEnum:MGLTextJustifyRight type:@encode(MGLTextJustify)]);
XCTAssertEqualObjects(gLayer.textKeepUpright, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.textLetterSpacing, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textLineHeight, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textMaxAngle, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textMaxWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textOffset, [MGLRuntimeStylingHelper testOffset]);
XCTAssertEqualObjects(gLayer.textOptional, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.textPadding, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.textPitchAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textPitchAlignment, [MGLRuntimeStylingHelper testEnum:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)]);
XCTAssertEqualObjects(gLayer.textRotate, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.textRotationAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)]);
XCTAssertEqualObjects(gLayer.textSize, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.textTransform isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textTransform, [MGLRuntimeStylingHelper testEnum:MGLTextTransformLowercase type:@encode(MGLTextTransform)]);
XCTAssertEqualObjects(gLayer.textOffset, [MGLRuntimeStylingHelper testOffset]);
XCTAssertEqualObjects(gLayer.textAllowOverlap, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.textIgnorePlacement, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.textOptional, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.iconHaloBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconHaloColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.iconHaloWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconHaloBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconTranslate, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.iconTranslateAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.iconTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLIconTranslateAnchorViewport type:@encode(MGLIconTranslateAnchor)]);
XCTAssertEqualObjects(gLayer.textOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.textHaloBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textHaloColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.textHaloWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textHaloBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textTranslate, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.textTranslateAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLTextTranslateAnchorViewport type:@encode(MGLTextTranslateAnchor)]);
layer.symbolPlacement = [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)];
layer.symbolSpacing = [MGLRuntimeStylingHelper testNumberFunction];
layer.symbolAvoidEdges = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconAllowOverlap = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconIgnorePlacement = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconImageName = [MGLRuntimeStylingHelper testStringFunction];
layer.iconKeepUpright = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconOffset = [MGLRuntimeStylingHelper testOffsetFunction];
layer.iconOptional = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconPadding = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconRotate = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconRotationAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)];
layer.iconSize = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconTextFit = [MGLRuntimeStylingHelper testEnumFunction:MGLIconTextFitBoth type:@encode(MGLIconTextFit)];
layer.iconTextFitPadding = [MGLRuntimeStylingHelper testPaddingFunction];
layer.iconImage = [MGLRuntimeStylingHelper testStringFunction];
layer.iconRotate = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconPadding = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconKeepUpright = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconOffset = [MGLRuntimeStylingHelper testOffsetFunction];
layer.textPitchAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)];
layer.textRotationAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)];
layer.symbolAvoidEdges = [MGLRuntimeStylingHelper testBoolFunction];
layer.symbolPlacement = [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)];
layer.symbolSpacing = [MGLRuntimeStylingHelper testNumberFunction];
layer.textAllowOverlap = [MGLRuntimeStylingHelper testBoolFunction];
layer.textAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)];
layer.textField = [MGLRuntimeStylingHelper testStringFunction];
layer.textFont = [MGLRuntimeStylingHelper testFontFunction];
layer.textSize = [MGLRuntimeStylingHelper testNumberFunction];
layer.textMaxWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.textLineHeight = [MGLRuntimeStylingHelper testNumberFunction];
layer.textLetterSpacing = [MGLRuntimeStylingHelper testNumberFunction];
layer.textJustify = [MGLRuntimeStylingHelper testEnumFunction:MGLTextJustifyRight type:@encode(MGLTextJustify)];
layer.textAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)];
layer.textMaxAngle = [MGLRuntimeStylingHelper testNumberFunction];
layer.textRotate = [MGLRuntimeStylingHelper testNumberFunction];
layer.textPadding = [MGLRuntimeStylingHelper testNumberFunction];
layer.textKeepUpright = [MGLRuntimeStylingHelper testBoolFunction];
layer.textTransform = [MGLRuntimeStylingHelper testEnumFunction:MGLTextTransformLowercase type:@encode(MGLTextTransform)];
layer.textOffset = [MGLRuntimeStylingHelper testOffsetFunction];
layer.textAllowOverlap = [MGLRuntimeStylingHelper testBoolFunction];
layer.textIgnorePlacement = [MGLRuntimeStylingHelper testBoolFunction];
layer.textJustify = [MGLRuntimeStylingHelper testEnumFunction:MGLTextJustifyRight type:@encode(MGLTextJustify)];
layer.textKeepUpright = [MGLRuntimeStylingHelper testBoolFunction];
layer.textLetterSpacing = [MGLRuntimeStylingHelper testNumberFunction];
layer.textLineHeight = [MGLRuntimeStylingHelper testNumberFunction];
layer.textMaxAngle = [MGLRuntimeStylingHelper testNumberFunction];
layer.textMaxWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.textOffset = [MGLRuntimeStylingHelper testOffsetFunction];
layer.textOptional = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.textPadding = [MGLRuntimeStylingHelper testNumberFunction];
layer.textPitchAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)];
layer.textRotate = [MGLRuntimeStylingHelper testNumberFunction];
layer.textRotationAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)];
layer.textSize = [MGLRuntimeStylingHelper testNumberFunction];
layer.textTransform = [MGLRuntimeStylingHelper testEnumFunction:MGLTextTransformLowercase type:@encode(MGLTextTransform)];
layer.iconColor = [MGLRuntimeStylingHelper testColorFunction];
layer.iconHaloBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconHaloColor = [MGLRuntimeStylingHelper testColorFunction];
layer.iconHaloWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconHaloBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconTranslate = [MGLRuntimeStylingHelper testOffsetFunction];
layer.iconTranslateAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLIconTranslateAnchorViewport type:@encode(MGLIconTranslateAnchor)];
layer.textOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.textColor = [MGLRuntimeStylingHelper testColorFunction];
layer.textHaloBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.textHaloColor = [MGLRuntimeStylingHelper testColorFunction];
layer.textHaloWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.textHaloBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.textOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.textTranslate = [MGLRuntimeStylingHelper testOffsetFunction];
layer.textTranslateAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLTextTranslateAnchorViewport type:@encode(MGLTextTranslateAnchor)];
XCTAssertEqualObjects(gLayer.symbolPlacement, [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)]);
XCTAssertEqualObjects(gLayer.symbolSpacing, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.symbolAvoidEdges, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconAllowOverlap, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconIgnorePlacement, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconImageName, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.iconKeepUpright, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconOffset, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.iconOptional, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconPadding, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconRotate, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconRotationAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)]);
XCTAssertEqualObjects(gLayer.iconSize, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnumFunction:MGLIconTextFitBoth type:@encode(MGLIconTextFit)]);
XCTAssertEqualObjects(gLayer.iconTextFitPadding, [MGLRuntimeStylingHelper testPaddingFunction]);
XCTAssertEqualObjects(gLayer.iconImage, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.iconRotate, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconPadding, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconKeepUpright, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconOffset, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.textPitchAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)]);
XCTAssertEqualObjects(gLayer.textRotationAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)]);
XCTAssertEqualObjects(gLayer.symbolAvoidEdges, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.symbolPlacement, [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)]);
XCTAssertEqualObjects(gLayer.symbolSpacing, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textAllowOverlap, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.textAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)]);
XCTAssertEqualObjects(gLayer.textField, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.textFont, [MGLRuntimeStylingHelper testFontFunction]);
XCTAssertEqualObjects(gLayer.textSize, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textMaxWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textLineHeight, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textLetterSpacing, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textJustify, [MGLRuntimeStylingHelper testEnumFunction:MGLTextJustifyRight type:@encode(MGLTextJustify)]);
XCTAssertEqualObjects(gLayer.textAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)]);
XCTAssertEqualObjects(gLayer.textMaxAngle, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textRotate, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textPadding, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textKeepUpright, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.textTransform, [MGLRuntimeStylingHelper testEnumFunction:MGLTextTransformLowercase type:@encode(MGLTextTransform)]);
XCTAssertEqualObjects(gLayer.textOffset, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.textAllowOverlap, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.textIgnorePlacement, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.textJustify, [MGLRuntimeStylingHelper testEnumFunction:MGLTextJustifyRight type:@encode(MGLTextJustify)]);
XCTAssertEqualObjects(gLayer.textKeepUpright, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.textLetterSpacing, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textLineHeight, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textMaxAngle, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textMaxWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textOffset, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.textOptional, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textPadding, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textPitchAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)]);
XCTAssertEqualObjects(gLayer.textRotate, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textRotationAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)]);
XCTAssertEqualObjects(gLayer.textSize, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textTransform, [MGLRuntimeStylingHelper testEnumFunction:MGLTextTransformLowercase type:@encode(MGLTextTransform)]);
XCTAssertEqualObjects(gLayer.iconColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.iconHaloBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconHaloColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.iconHaloWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconHaloBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconTranslate, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.iconTranslateAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLIconTranslateAnchorViewport type:@encode(MGLIconTranslateAnchor)]);
XCTAssertEqualObjects(gLayer.textOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.textHaloBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textHaloColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.textHaloWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textHaloBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textTranslate, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.textTranslateAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLTextTranslateAnchorViewport type:@encode(MGLTextTranslateAnchor)]);
}