From 17db5210bf60171ee7dbc15de77fdea53b8f0d4d Mon Sep 17 00:00:00 2001 From: Fredrik Karlsson Date: Mon, 21 Nov 2016 14:32:05 +0100 Subject: [PATCH] [ios, macos] rename style spec properties --- .../darwin/scripts/generate-style-code.js | 21 +- .../style-spec-cocoa-conventions-v8.json | 9 + platform/darwin/src/MGLBackgroundStyleLayer.h | 10 +- .../darwin/src/MGLBackgroundStyleLayer.mm | 20 +- platform/darwin/src/MGLCircleStyleLayer.h | 70 +-- platform/darwin/src/MGLCircleStyleLayer.mm | 60 +-- platform/darwin/src/MGLFillStyleLayer.h | 24 +- platform/darwin/src/MGLFillStyleLayer.mm | 40 +- platform/darwin/src/MGLLineStyleLayer.h | 88 ++-- platform/darwin/src/MGLLineStyleLayer.mm | 110 ++--- platform/darwin/src/MGLRasterStyleLayer.h | 52 +- platform/darwin/src/MGLRasterStyleLayer.mm | 76 +-- platform/darwin/src/MGLStyleLayer.mm.ejs | 28 +- platform/darwin/src/MGLSymbolStyleLayer.h | 464 +++++++++--------- platform/darwin/src/MGLSymbolStyleLayer.mm | 454 ++++++++--------- .../NSValue+MGLStyleEnumAttributeAdditions.h | 104 ++-- .../NSValue+MGLStyleEnumAttributeAdditions.mm | 80 +-- .../test/MGLBackgroundStyleLayerTests.m | 8 +- .../darwin/test/MGLCircleStyleLayerTests.m | 26 +- platform/darwin/test/MGLFillStyleLayerTests.m | 16 +- platform/darwin/test/MGLLineStyleLayerTests.m | 48 +- .../darwin/test/MGLRasterStyleLayerTests.m | 40 +- .../darwin/test/MGLSymbolStyleLayerTests.m | 226 ++++----- 23 files changed, 1048 insertions(+), 1026 deletions(-) create mode 100644 platform/darwin/scripts/style-spec-cocoa-conventions-v8.json diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index 9090bb40e..b5689dca3 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -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}`], }; diff --git a/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json b/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json new file mode 100644 index 000000000..e37598406 --- /dev/null +++ b/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json @@ -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" + } +} \ No newline at end of file diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.h b/platform/darwin/src/MGLBackgroundStyleLayer.h index a70383cc9..656e104bb 100644 --- a/platform/darwin/src/MGLBackgroundStyleLayer.h +++ b/platform/darwin/src/MGLBackgroundStyleLayer.h @@ -38,11 +38,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, null_resettable) MGLStyleValue *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 *backgroundPattern; - /** The opacity at which the background will be drawn. @@ -50,6 +45,11 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, null_resettable) MGLStyleValue *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 *backgroundPattern; + @end NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/darwin/src/MGLBackgroundStyleLayer.mm index 6e30a20c9..59aa06910 100644 --- a/platform/darwin/src/MGLBackgroundStyleLayer.mm +++ b/platform/darwin/src/MGLBackgroundStyleLayer.mm @@ -70,16 +70,6 @@ return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setBackgroundPattern:(MGLStyleValue *)backgroundPattern { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(backgroundPattern); - _rawLayer->setBackgroundPattern(mbglValue); -} - -- (MGLStyleValue *)backgroundPattern { - auto propertyValue = _rawLayer->getBackgroundPattern() ?: _rawLayer->getDefaultBackgroundPattern(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - - (void)setBackgroundOpacity:(MGLStyleValue *)backgroundOpacity { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(backgroundOpacity); _rawLayer->setBackgroundOpacity(mbglValue); @@ -90,5 +80,15 @@ return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setBackgroundPattern:(MGLStyleValue *)backgroundPattern { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(backgroundPattern); + _rawLayer->setBackgroundPattern(mbglValue); +} + +- (MGLStyleValue *)backgroundPattern { + auto propertyValue = _rawLayer->getBackgroundPattern() ?: _rawLayer->getDefaultBackgroundPattern(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + @end diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h index da7076e7d..2d88a664b 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/darwin/src/MGLCircleStyleLayer.h @@ -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 *circleRadius; +@property (nonatomic, null_resettable) MGLStyleValue *circleBlur; #if TARGET_OS_IPHONE /** @@ -73,13 +71,6 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) { @property (nonatomic, null_resettable) MGLStyleValue *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 *circleBlur; - /** The opacity at which the circle will be drawn. @@ -87,6 +78,22 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) { */ @property (nonatomic, null_resettable) MGLStyleValue *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 *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 *circleRadius; + /** The geometry's offset. @@ -105,13 +112,6 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) { */ @property (nonatomic, null_resettable) MGLStyleValue *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 *circlePitchScale; - @end NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLCircleStyleLayer.mm b/platform/darwin/src/MGLCircleStyleLayer.mm index aca8ff028..1c903ab00 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.mm +++ b/platform/darwin/src/MGLCircleStyleLayer.mm @@ -11,16 +11,16 @@ #include 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 *)circleRadius { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(circleRadius); - _rawLayer->setCircleRadius(mbglValue); +- (void)setCircleBlur:(MGLStyleValue *)circleBlur { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(circleBlur); + _rawLayer->setCircleBlur(mbglValue); } -- (MGLStyleValue *)circleRadius { - auto propertyValue = _rawLayer->getCircleRadius() ?: _rawLayer->getDefaultCircleRadius(); +- (MGLStyleValue *)circleBlur { + auto propertyValue = _rawLayer->getCircleBlur() ?: _rawLayer->getDefaultCircleBlur(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } @@ -112,16 +112,6 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setCircleBlur:(MGLStyleValue *)circleBlur { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(circleBlur); - _rawLayer->setCircleBlur(mbglValue); -} - -- (MGLStyleValue *)circleBlur { - auto propertyValue = _rawLayer->getCircleBlur() ?: _rawLayer->getDefaultCircleBlur(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - - (void)setCircleOpacity:(MGLStyleValue *)circleOpacity { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(circleOpacity); _rawLayer->setCircleOpacity(mbglValue); @@ -132,6 +122,26 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setCirclePitchScale:(MGLStyleValue *)circlePitchScale { + auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(circlePitchScale); + _rawLayer->setCirclePitchScale(mbglValue); +} + +- (MGLStyleValue *)circlePitchScale { + auto propertyValue = _rawLayer->getCirclePitchScale() ?: _rawLayer->getDefaultCirclePitchScale(); + return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); +} + +- (void)setCircleRadius:(MGLStyleValue *)circleRadius { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(circleRadius); + _rawLayer->setCircleRadius(mbglValue); +} + +- (MGLStyleValue *)circleRadius { + auto propertyValue = _rawLayer->getCircleRadius() ?: _rawLayer->getDefaultCircleRadius(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + - (void)setCircleTranslate:(MGLStyleValue *)circleTranslate { auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(circleTranslate); _rawLayer->setCircleTranslate(mbglValue); @@ -152,15 +162,5 @@ namespace mbgl { return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } -- (void)setCirclePitchScale:(MGLStyleValue *)circlePitchScale { - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(circlePitchScale); - _rawLayer->setCirclePitchScale(mbglValue); -} - -- (MGLStyleValue *)circlePitchScale { - auto propertyValue = _rawLayer->getCirclePitchScale() ?: _rawLayer->getDefaultCirclePitchScale(); - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); -} - @end diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 799fa380c..9bbda26ce 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -39,13 +39,6 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { */ @property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *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 *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 *fillPattern; + /** The geometry's offset. @@ -91,11 +96,6 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { */ @property (nonatomic, null_resettable) MGLStyleValue *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 *fillPattern; - @end NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm index d670fd31e..6f9c68f21 100644 --- a/platform/darwin/src/MGLFillStyleLayer.mm +++ b/platform/darwin/src/MGLFillStyleLayer.mm @@ -97,16 +97,6 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setFillOpacity:(MGLStyleValue *)fillOpacity { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillOpacity); - _rawLayer->setFillOpacity(mbglValue); -} - -- (MGLStyleValue *)fillOpacity { - auto propertyValue = _rawLayer->getFillOpacity() ?: _rawLayer->getDefaultFillOpacity(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - - (void)setFillColor:(MGLStyleValue *)fillColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillColor); _rawLayer->setFillColor(mbglValue); @@ -117,6 +107,16 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setFillOpacity:(MGLStyleValue *)fillOpacity { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillOpacity); + _rawLayer->setFillOpacity(mbglValue); +} + +- (MGLStyleValue *)fillOpacity { + auto propertyValue = _rawLayer->getFillOpacity() ?: _rawLayer->getDefaultFillOpacity(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + - (void)setFillOutlineColor:(MGLStyleValue *)fillOutlineColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillOutlineColor); _rawLayer->setFillOutlineColor(mbglValue); @@ -127,6 +127,16 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setFillPattern:(MGLStyleValue *)fillPattern { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillPattern); + _rawLayer->setFillPattern(mbglValue); +} + +- (MGLStyleValue *)fillPattern { + auto propertyValue = _rawLayer->getFillPattern() ?: _rawLayer->getDefaultFillPattern(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + - (void)setFillTranslate:(MGLStyleValue *)fillTranslate { auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(fillTranslate); _rawLayer->setFillTranslate(mbglValue); @@ -147,15 +157,5 @@ namespace mbgl { return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } -- (void)setFillPattern:(MGLStyleValue *)fillPattern { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillPattern); - _rawLayer->setFillPattern(mbglValue); -} - -- (MGLStyleValue *)fillPattern { - auto propertyValue = _rawLayer->getFillPattern() ?: _rawLayer->getDefaultFillPattern(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - @end diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h index 68b0a73a2..74d8f7bfe 100644 --- a/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/darwin/src/MGLLineStyleLayer.h @@ -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 *lineOpacity; +@property (nonatomic, null_resettable) MGLStyleValue *lineBlur; #if TARGET_OS_IPHONE /** @@ -133,6 +135,45 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) { @property (nonatomic, null_resettable) MGLStyleValue *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 *> *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 *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 *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 *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 *linePattern; + /** The geometry's offset. @@ -160,47 +201,6 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) { */ @property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *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 *> *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 *linePattern; - @end NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLLineStyleLayer.mm b/platform/darwin/src/MGLLineStyleLayer.mm index 34c58aa49..c37d1b659 100644 --- a/platform/darwin/src/MGLLineStyleLayer.mm +++ b/platform/darwin/src/MGLLineStyleLayer.mm @@ -141,13 +141,13 @@ namespace mbgl { #pragma mark - Accessing the Paint Attributes -- (void)setLineOpacity:(MGLStyleValue *)lineOpacity { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(lineOpacity); - _rawLayer->setLineOpacity(mbglValue); +- (void)setLineBlur:(MGLStyleValue *)lineBlur { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(lineBlur); + _rawLayer->setLineBlur(mbglValue); } -- (MGLStyleValue *)lineOpacity { - auto propertyValue = _rawLayer->getLineOpacity() ?: _rawLayer->getDefaultLineOpacity(); +- (MGLStyleValue *)lineBlur { + auto propertyValue = _rawLayer->getLineBlur() ?: _rawLayer->getDefaultLineBlur(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } @@ -161,6 +161,56 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setLineDasharray:(MGLStyleValue *> *)lineDasharray { + auto mbglValue = MGLStyleValueTransformer, NSArray *, float>().toPropertyValue(lineDasharray); + _rawLayer->setLineDasharray(mbglValue); +} + +- (MGLStyleValue *> *)lineDasharray { + auto propertyValue = _rawLayer->getLineDasharray() ?: _rawLayer->getDefaultLineDasharray(); + return MGLStyleValueTransformer, NSArray *, float>().toStyleValue(propertyValue); +} + +- (void)setLineGapWidth:(MGLStyleValue *)lineGapWidth { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(lineGapWidth); + _rawLayer->setLineGapWidth(mbglValue); +} + +- (MGLStyleValue *)lineGapWidth { + auto propertyValue = _rawLayer->getLineGapWidth() ?: _rawLayer->getDefaultLineGapWidth(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setLineOffset:(MGLStyleValue *)lineOffset { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(lineOffset); + _rawLayer->setLineOffset(mbglValue); +} + +- (MGLStyleValue *)lineOffset { + auto propertyValue = _rawLayer->getLineOffset() ?: _rawLayer->getDefaultLineOffset(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setLineOpacity:(MGLStyleValue *)lineOpacity { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(lineOpacity); + _rawLayer->setLineOpacity(mbglValue); +} + +- (MGLStyleValue *)lineOpacity { + auto propertyValue = _rawLayer->getLineOpacity() ?: _rawLayer->getDefaultLineOpacity(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setLinePattern:(MGLStyleValue *)linePattern { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(linePattern); + _rawLayer->setLinePattern(mbglValue); +} + +- (MGLStyleValue *)linePattern { + auto propertyValue = _rawLayer->getLinePattern() ?: _rawLayer->getDefaultLinePattern(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + - (void)setLineTranslate:(MGLStyleValue *)lineTranslate { auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(lineTranslate); _rawLayer->setLineTranslate(mbglValue); @@ -191,55 +241,5 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setLineGapWidth:(MGLStyleValue *)lineGapWidth { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(lineGapWidth); - _rawLayer->setLineGapWidth(mbglValue); -} - -- (MGLStyleValue *)lineGapWidth { - auto propertyValue = _rawLayer->getLineGapWidth() ?: _rawLayer->getDefaultLineGapWidth(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setLineOffset:(MGLStyleValue *)lineOffset { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(lineOffset); - _rawLayer->setLineOffset(mbglValue); -} - -- (MGLStyleValue *)lineOffset { - auto propertyValue = _rawLayer->getLineOffset() ?: _rawLayer->getDefaultLineOffset(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setLineBlur:(MGLStyleValue *)lineBlur { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(lineBlur); - _rawLayer->setLineBlur(mbglValue); -} - -- (MGLStyleValue *)lineBlur { - auto propertyValue = _rawLayer->getLineBlur() ?: _rawLayer->getDefaultLineBlur(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setLineDasharray:(MGLStyleValue *> *)lineDasharray { - auto mbglValue = MGLStyleValueTransformer, NSArray *, float>().toPropertyValue(lineDasharray); - _rawLayer->setLineDasharray(mbglValue); -} - -- (MGLStyleValue *> *)lineDasharray { - auto propertyValue = _rawLayer->getLineDasharray() ?: _rawLayer->getDefaultLineDasharray(); - return MGLStyleValueTransformer, NSArray *, float>().toStyleValue(propertyValue); -} - -- (void)setLinePattern:(MGLStyleValue *)linePattern { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(linePattern); - _rawLayer->setLinePattern(mbglValue); -} - -- (MGLStyleValue *)linePattern { - auto propertyValue = _rawLayer->getLinePattern() ?: _rawLayer->getDefaultLinePattern(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - @end diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h index afae85001..68b187a90 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/darwin/src/MGLRasterStyleLayer.h @@ -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 *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 *rasterHueRotate; +@property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *rasterSaturation; +@property (nonatomic, null_resettable) MGLStyleValue *minimumRasterBrightness; /** Increase or reduce the contrast of the image. @@ -69,6 +46,29 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *rasterSaturation; + @end NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm index 49dc261be..cd1d135ff 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.mm +++ b/platform/darwin/src/MGLRasterStyleLayer.mm @@ -59,53 +59,23 @@ #pragma mark - Accessing the Paint Attributes -- (void)setRasterOpacity:(MGLStyleValue *)rasterOpacity { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterOpacity); - _rawLayer->setRasterOpacity(mbglValue); -} - -- (MGLStyleValue *)rasterOpacity { - auto propertyValue = _rawLayer->getRasterOpacity() ?: _rawLayer->getDefaultRasterOpacity(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setRasterHueRotate:(MGLStyleValue *)rasterHueRotate { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterHueRotate); - _rawLayer->setRasterHueRotate(mbglValue); -} - -- (MGLStyleValue *)rasterHueRotate { - auto propertyValue = _rawLayer->getRasterHueRotate() ?: _rawLayer->getDefaultRasterHueRotate(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setRasterBrightnessMin:(MGLStyleValue *)rasterBrightnessMin { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterBrightnessMin); - _rawLayer->setRasterBrightnessMin(mbglValue); -} - -- (MGLStyleValue *)rasterBrightnessMin { - auto propertyValue = _rawLayer->getRasterBrightnessMin() ?: _rawLayer->getDefaultRasterBrightnessMin(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setRasterBrightnessMax:(MGLStyleValue *)rasterBrightnessMax { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterBrightnessMax); +- (void)setMaximumRasterBrightness:(MGLStyleValue *)maximumRasterBrightness { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(maximumRasterBrightness); _rawLayer->setRasterBrightnessMax(mbglValue); } -- (MGLStyleValue *)rasterBrightnessMax { +- (MGLStyleValue *)maximumRasterBrightness { auto propertyValue = _rawLayer->getRasterBrightnessMax() ?: _rawLayer->getDefaultRasterBrightnessMax(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setRasterSaturation:(MGLStyleValue *)rasterSaturation { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterSaturation); - _rawLayer->setRasterSaturation(mbglValue); +- (void)setMinimumRasterBrightness:(MGLStyleValue *)minimumRasterBrightness { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(minimumRasterBrightness); + _rawLayer->setRasterBrightnessMin(mbglValue); } -- (MGLStyleValue *)rasterSaturation { - auto propertyValue = _rawLayer->getRasterSaturation() ?: _rawLayer->getDefaultRasterSaturation(); +- (MGLStyleValue *)minimumRasterBrightness { + auto propertyValue = _rawLayer->getRasterBrightnessMin() ?: _rawLayer->getDefaultRasterBrightnessMin(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } @@ -129,5 +99,35 @@ return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setRasterHueRotate:(MGLStyleValue *)rasterHueRotate { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterHueRotate); + _rawLayer->setRasterHueRotate(mbglValue); +} + +- (MGLStyleValue *)rasterHueRotate { + auto propertyValue = _rawLayer->getRasterHueRotate() ?: _rawLayer->getDefaultRasterHueRotate(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setRasterOpacity:(MGLStyleValue *)rasterOpacity { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterOpacity); + _rawLayer->setRasterOpacity(mbglValue); +} + +- (MGLStyleValue *)rasterOpacity { + auto propertyValue = _rawLayer->getRasterOpacity() ?: _rawLayer->getDefaultRasterOpacity(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setRasterSaturation:(MGLStyleValue *)rasterSaturation { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterSaturation); + _rawLayer->setRasterSaturation(mbglValue); +} + +- (MGLStyleValue *)rasterSaturation { + auto propertyValue = _rawLayer->getRasterSaturation() ?: _rawLayer->getDefaultRasterSaturation(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + @end diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs index 8febd69a2..ae90b67d3 100644 --- a/platform/darwin/src/MGLStyleLayer.mm.ejs +++ b/platform/darwin/src/MGLStyleLayer.mm.ejs @@ -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, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumPropertyValue(<%- objCName(property) %>); - _rawLayer->set<%- camelize(property.name) %>(mbglValue); + auto mbglValue = MGLStyleValueTransformer, 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, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumStyleValue(propertyValue); + return MGLStyleValueTransformer, 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, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumPropertyValue(<%- objCName(property) %>); - _rawLayer->set<%- camelize(property.name) %>(mbglValue); + auto mbglValue = MGLStyleValueTransformer, 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, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumStyleValue(propertyValue); + return MGLStyleValueTransformer, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(originalPropertyName(property)) %>>().toEnumStyleValue(propertyValue); <% } else { -%> return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue); <% } -%> diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index dc0cd236c..dbb966b4e 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -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 *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 *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 *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 *iconIgnorePlacement; +/** + A string with {tokens} replaced, referencing the data property to pull from. + */ +@property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *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 *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 *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 *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 *iconImage; +@property (nonatomic, null_resettable) MGLStyleValue *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 *iconRotate; +@property (nonatomic, null_resettable) MGLStyleValue *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 *iconPadding; +@property (nonatomic, null_resettable) MGLStyleValue *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 *iconKeepUpright; +@property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *textRotationAlignment; +@property (nonatomic, null_resettable) MGLStyleValue *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 *> *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 *textSize; +@property (nonatomic, null_resettable) MGLStyleValue *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 *textMaxWidth; +@property (nonatomic, null_resettable) MGLStyleValue *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 *textLineHeight; +@property (nonatomic, null_resettable) MGLStyleValue *textKeepUpright; /** Text tracking amount. @@ -446,22 +440,15 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) { @property (nonatomic, null_resettable) MGLStyleValue *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 *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 *textAnchor; +@property (nonatomic, null_resettable) MGLStyleValue *textLineHeight; /** Maximum angle change between adjacent characters. @@ -475,44 +462,15 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) { @property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *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 *textTransform; +@property (nonatomic, null_resettable) MGLStyleValue *textMaxWidth; /** Offset distance of text from its anchor. @@ -525,24 +483,6 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) { */ @property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *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 *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 *iconOpacity; +@property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *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 *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 *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 *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 *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 *iconHaloBlur; +@property (nonatomic, null_resettable) MGLStyleValue *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 *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 *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 *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 *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 *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 *textHaloBlur; +@property (nonatomic, null_resettable) MGLStyleValue *textOpacity; /** Distance that the text's anchor is moved from its original placement. diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm index 0acc36d2d..3e5834f7b 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -11,11 +11,6 @@ #include 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 *)symbolPlacement { - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(symbolPlacement); - _rawLayer->setSymbolPlacement(mbglValue); -} - -- (MGLStyleValue *)symbolPlacement { - auto propertyValue = _rawLayer->getSymbolPlacement() ?: _rawLayer->getDefaultSymbolPlacement(); - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); -} - -- (void)setSymbolSpacing:(MGLStyleValue *)symbolSpacing { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(symbolSpacing); - _rawLayer->setSymbolSpacing(mbglValue); -} - -- (MGLStyleValue *)symbolSpacing { - auto propertyValue = _rawLayer->getSymbolSpacing() ?: _rawLayer->getDefaultSymbolSpacing(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setSymbolAvoidEdges:(MGLStyleValue *)symbolAvoidEdges { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(symbolAvoidEdges); - _rawLayer->setSymbolAvoidEdges(mbglValue); -} - -- (MGLStyleValue *)symbolAvoidEdges { - auto propertyValue = _rawLayer->getSymbolAvoidEdges() ?: _rawLayer->getDefaultSymbolAvoidEdges(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - - (void)setIconAllowOverlap:(MGLStyleValue *)iconAllowOverlap { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconAllowOverlap); _rawLayer->setIconAllowOverlap(mbglValue); @@ -196,6 +166,36 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setIconImageName:(MGLStyleValue *)iconImageName { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconImageName); + _rawLayer->setIconImage(mbglValue); +} + +- (MGLStyleValue *)iconImageName { + auto propertyValue = _rawLayer->getIconImage() ?: _rawLayer->getDefaultIconImage(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setIconKeepUpright:(MGLStyleValue *)iconKeepUpright { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconKeepUpright); + _rawLayer->setIconKeepUpright(mbglValue); +} + +- (MGLStyleValue *)iconKeepUpright { + auto propertyValue = _rawLayer->getIconKeepUpright() ?: _rawLayer->getDefaultIconKeepUpright(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setIconOffset:(MGLStyleValue *)iconOffset { + auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(iconOffset); + _rawLayer->setIconOffset(mbglValue); +} + +- (MGLStyleValue *)iconOffset { + auto propertyValue = _rawLayer->getIconOffset() ?: _rawLayer->getDefaultIconOffset(); + return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); +} + - (void)setIconOptional:(MGLStyleValue *)iconOptional { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconOptional); _rawLayer->setIconOptional(mbglValue); @@ -206,6 +206,26 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setIconPadding:(MGLStyleValue *)iconPadding { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconPadding); + _rawLayer->setIconPadding(mbglValue); +} + +- (MGLStyleValue *)iconPadding { + auto propertyValue = _rawLayer->getIconPadding() ?: _rawLayer->getDefaultIconPadding(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setIconRotate:(MGLStyleValue *)iconRotate { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconRotate); + _rawLayer->setIconRotate(mbglValue); +} + +- (MGLStyleValue *)iconRotate { + auto propertyValue = _rawLayer->getIconRotate() ?: _rawLayer->getDefaultIconRotate(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + - (void)setIconRotationAlignment:(MGLStyleValue *)iconRotationAlignment { auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(iconRotationAlignment); _rawLayer->setIconRotationAlignment(mbglValue); @@ -246,74 +266,54 @@ namespace mbgl { return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } -- (void)setIconImage:(MGLStyleValue *)iconImage { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconImage); - _rawLayer->setIconImage(mbglValue); +- (void)setSymbolAvoidEdges:(MGLStyleValue *)symbolAvoidEdges { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(symbolAvoidEdges); + _rawLayer->setSymbolAvoidEdges(mbglValue); } -- (MGLStyleValue *)iconImage { - auto propertyValue = _rawLayer->getIconImage() ?: _rawLayer->getDefaultIconImage(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setIconRotate:(MGLStyleValue *)iconRotate { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconRotate); - _rawLayer->setIconRotate(mbglValue); -} - -- (MGLStyleValue *)iconRotate { - auto propertyValue = _rawLayer->getIconRotate() ?: _rawLayer->getDefaultIconRotate(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setIconPadding:(MGLStyleValue *)iconPadding { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconPadding); - _rawLayer->setIconPadding(mbglValue); -} - -- (MGLStyleValue *)iconPadding { - auto propertyValue = _rawLayer->getIconPadding() ?: _rawLayer->getDefaultIconPadding(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setIconKeepUpright:(MGLStyleValue *)iconKeepUpright { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconKeepUpright); - _rawLayer->setIconKeepUpright(mbglValue); -} - -- (MGLStyleValue *)iconKeepUpright { - auto propertyValue = _rawLayer->getIconKeepUpright() ?: _rawLayer->getDefaultIconKeepUpright(); +- (MGLStyleValue *)symbolAvoidEdges { + auto propertyValue = _rawLayer->getSymbolAvoidEdges() ?: _rawLayer->getDefaultSymbolAvoidEdges(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setIconOffset:(MGLStyleValue *)iconOffset { - auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(iconOffset); - _rawLayer->setIconOffset(mbglValue); +- (void)setSymbolPlacement:(MGLStyleValue *)symbolPlacement { + auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(symbolPlacement); + _rawLayer->setSymbolPlacement(mbglValue); } -- (MGLStyleValue *)iconOffset { - auto propertyValue = _rawLayer->getIconOffset() ?: _rawLayer->getDefaultIconOffset(); - return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); +- (MGLStyleValue *)symbolPlacement { + auto propertyValue = _rawLayer->getSymbolPlacement() ?: _rawLayer->getDefaultSymbolPlacement(); + return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } -- (void)setTextPitchAlignment:(MGLStyleValue *)textPitchAlignment { - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textPitchAlignment); - _rawLayer->setTextPitchAlignment(mbglValue); +- (void)setSymbolSpacing:(MGLStyleValue *)symbolSpacing { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(symbolSpacing); + _rawLayer->setSymbolSpacing(mbglValue); } -- (MGLStyleValue *)textPitchAlignment { - auto propertyValue = _rawLayer->getTextPitchAlignment() ?: _rawLayer->getDefaultTextPitchAlignment(); - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); +- (MGLStyleValue *)symbolSpacing { + auto propertyValue = _rawLayer->getSymbolSpacing() ?: _rawLayer->getDefaultSymbolSpacing(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setTextRotationAlignment:(MGLStyleValue *)textRotationAlignment { - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textRotationAlignment); - _rawLayer->setTextRotationAlignment(mbglValue); +- (void)setTextAllowOverlap:(MGLStyleValue *)textAllowOverlap { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textAllowOverlap); + _rawLayer->setTextAllowOverlap(mbglValue); } -- (MGLStyleValue *)textRotationAlignment { - auto propertyValue = _rawLayer->getTextRotationAlignment() ?: _rawLayer->getDefaultTextRotationAlignment(); - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); +- (MGLStyleValue *)textAllowOverlap { + auto propertyValue = _rawLayer->getTextAllowOverlap() ?: _rawLayer->getDefaultTextAllowOverlap(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setTextAnchor:(MGLStyleValue *)textAnchor { + auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textAnchor); + _rawLayer->setTextAnchor(mbglValue); +} + +- (MGLStyleValue *)textAnchor { + auto propertyValue = _rawLayer->getTextAnchor() ?: _rawLayer->getDefaultTextAnchor(); + return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextField:(MGLStyleValue *)textField { @@ -336,23 +336,43 @@ namespace mbgl { return MGLStyleValueTransformer, NSArray *, std::string>().toStyleValue(propertyValue); } -- (void)setTextSize:(MGLStyleValue *)textSize { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textSize); - _rawLayer->setTextSize(mbglValue); +- (void)setTextIgnorePlacement:(MGLStyleValue *)textIgnorePlacement { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textIgnorePlacement); + _rawLayer->setTextIgnorePlacement(mbglValue); } -- (MGLStyleValue *)textSize { - auto propertyValue = _rawLayer->getTextSize() ?: _rawLayer->getDefaultTextSize(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); +- (MGLStyleValue *)textIgnorePlacement { + auto propertyValue = _rawLayer->getTextIgnorePlacement() ?: _rawLayer->getDefaultTextIgnorePlacement(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setTextMaxWidth:(MGLStyleValue *)textMaxWidth { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textMaxWidth); - _rawLayer->setTextMaxWidth(mbglValue); +- (void)setTextJustify:(MGLStyleValue *)textJustify { + auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textJustify); + _rawLayer->setTextJustify(mbglValue); } -- (MGLStyleValue *)textMaxWidth { - auto propertyValue = _rawLayer->getTextMaxWidth() ?: _rawLayer->getDefaultTextMaxWidth(); +- (MGLStyleValue *)textJustify { + auto propertyValue = _rawLayer->getTextJustify() ?: _rawLayer->getDefaultTextJustify(); + return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); +} + +- (void)setTextKeepUpright:(MGLStyleValue *)textKeepUpright { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textKeepUpright); + _rawLayer->setTextKeepUpright(mbglValue); +} + +- (MGLStyleValue *)textKeepUpright { + auto propertyValue = _rawLayer->getTextKeepUpright() ?: _rawLayer->getDefaultTextKeepUpright(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setTextLetterSpacing:(MGLStyleValue *)textLetterSpacing { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textLetterSpacing); + _rawLayer->setTextLetterSpacing(mbglValue); +} + +- (MGLStyleValue *)textLetterSpacing { + auto propertyValue = _rawLayer->getTextLetterSpacing() ?: _rawLayer->getDefaultTextLetterSpacing(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } @@ -366,36 +386,6 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setTextLetterSpacing:(MGLStyleValue *)textLetterSpacing { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textLetterSpacing); - _rawLayer->setTextLetterSpacing(mbglValue); -} - -- (MGLStyleValue *)textLetterSpacing { - auto propertyValue = _rawLayer->getTextLetterSpacing() ?: _rawLayer->getDefaultTextLetterSpacing(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setTextJustify:(MGLStyleValue *)textJustify { - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textJustify); - _rawLayer->setTextJustify(mbglValue); -} - -- (MGLStyleValue *)textJustify { - auto propertyValue = _rawLayer->getTextJustify() ?: _rawLayer->getDefaultTextJustify(); - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); -} - -- (void)setTextAnchor:(MGLStyleValue *)textAnchor { - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textAnchor); - _rawLayer->setTextAnchor(mbglValue); -} - -- (MGLStyleValue *)textAnchor { - auto propertyValue = _rawLayer->getTextAnchor() ?: _rawLayer->getDefaultTextAnchor(); - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); -} - - (void)setTextMaxAngle:(MGLStyleValue *)textMaxAngle { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textMaxAngle); _rawLayer->setTextMaxAngle(mbglValue); @@ -406,46 +396,16 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setTextRotate:(MGLStyleValue *)textRotate { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textRotate); - _rawLayer->setTextRotate(mbglValue); +- (void)setTextMaxWidth:(MGLStyleValue *)textMaxWidth { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textMaxWidth); + _rawLayer->setTextMaxWidth(mbglValue); } -- (MGLStyleValue *)textRotate { - auto propertyValue = _rawLayer->getTextRotate() ?: _rawLayer->getDefaultTextRotate(); +- (MGLStyleValue *)textMaxWidth { + auto propertyValue = _rawLayer->getTextMaxWidth() ?: _rawLayer->getDefaultTextMaxWidth(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setTextPadding:(MGLStyleValue *)textPadding { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textPadding); - _rawLayer->setTextPadding(mbglValue); -} - -- (MGLStyleValue *)textPadding { - auto propertyValue = _rawLayer->getTextPadding() ?: _rawLayer->getDefaultTextPadding(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setTextKeepUpright:(MGLStyleValue *)textKeepUpright { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textKeepUpright); - _rawLayer->setTextKeepUpright(mbglValue); -} - -- (MGLStyleValue *)textKeepUpright { - auto propertyValue = _rawLayer->getTextKeepUpright() ?: _rawLayer->getDefaultTextKeepUpright(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setTextTransform:(MGLStyleValue *)textTransform { - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textTransform); - _rawLayer->setTextTransform(mbglValue); -} - -- (MGLStyleValue *)textTransform { - auto propertyValue = _rawLayer->getTextTransform() ?: _rawLayer->getDefaultTextTransform(); - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); -} - - (void)setTextOffset:(MGLStyleValue *)textOffset { auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(textOffset); _rawLayer->setTextOffset(mbglValue); @@ -456,26 +416,6 @@ namespace mbgl { return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } -- (void)setTextAllowOverlap:(MGLStyleValue *)textAllowOverlap { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textAllowOverlap); - _rawLayer->setTextAllowOverlap(mbglValue); -} - -- (MGLStyleValue *)textAllowOverlap { - auto propertyValue = _rawLayer->getTextAllowOverlap() ?: _rawLayer->getDefaultTextAllowOverlap(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - -- (void)setTextIgnorePlacement:(MGLStyleValue *)textIgnorePlacement { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textIgnorePlacement); - _rawLayer->setTextIgnorePlacement(mbglValue); -} - -- (MGLStyleValue *)textIgnorePlacement { - auto propertyValue = _rawLayer->getTextIgnorePlacement() ?: _rawLayer->getDefaultTextIgnorePlacement(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - - (void)setTextOptional:(MGLStyleValue *)textOptional { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textOptional); _rawLayer->setTextOptional(mbglValue); @@ -486,18 +426,68 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } -#pragma mark - Accessing the Paint Attributes - -- (void)setIconOpacity:(MGLStyleValue *)iconOpacity { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconOpacity); - _rawLayer->setIconOpacity(mbglValue); +- (void)setTextPadding:(MGLStyleValue *)textPadding { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textPadding); + _rawLayer->setTextPadding(mbglValue); } -- (MGLStyleValue *)iconOpacity { - auto propertyValue = _rawLayer->getIconOpacity() ?: _rawLayer->getDefaultIconOpacity(); +- (MGLStyleValue *)textPadding { + auto propertyValue = _rawLayer->getTextPadding() ?: _rawLayer->getDefaultTextPadding(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setTextPitchAlignment:(MGLStyleValue *)textPitchAlignment { + auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textPitchAlignment); + _rawLayer->setTextPitchAlignment(mbglValue); +} + +- (MGLStyleValue *)textPitchAlignment { + auto propertyValue = _rawLayer->getTextPitchAlignment() ?: _rawLayer->getDefaultTextPitchAlignment(); + return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); +} + +- (void)setTextRotate:(MGLStyleValue *)textRotate { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textRotate); + _rawLayer->setTextRotate(mbglValue); +} + +- (MGLStyleValue *)textRotate { + auto propertyValue = _rawLayer->getTextRotate() ?: _rawLayer->getDefaultTextRotate(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setTextRotationAlignment:(MGLStyleValue *)textRotationAlignment { + auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textRotationAlignment); + _rawLayer->setTextRotationAlignment(mbglValue); +} + +- (MGLStyleValue *)textRotationAlignment { + auto propertyValue = _rawLayer->getTextRotationAlignment() ?: _rawLayer->getDefaultTextRotationAlignment(); + return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); +} + +- (void)setTextSize:(MGLStyleValue *)textSize { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textSize); + _rawLayer->setTextSize(mbglValue); +} + +- (MGLStyleValue *)textSize { + auto propertyValue = _rawLayer->getTextSize() ?: _rawLayer->getDefaultTextSize(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + +- (void)setTextTransform:(MGLStyleValue *)textTransform { + auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textTransform); + _rawLayer->setTextTransform(mbglValue); +} + +- (MGLStyleValue *)textTransform { + auto propertyValue = _rawLayer->getTextTransform() ?: _rawLayer->getDefaultTextTransform(); + return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); +} + +#pragma mark - Accessing the Paint Attributes + - (void)setIconColor:(MGLStyleValue *)iconColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconColor); _rawLayer->setIconColor(mbglValue); @@ -508,6 +498,16 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setIconHaloBlur:(MGLStyleValue *)iconHaloBlur { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloBlur); + _rawLayer->setIconHaloBlur(mbglValue); +} + +- (MGLStyleValue *)iconHaloBlur { + auto propertyValue = _rawLayer->getIconHaloBlur() ?: _rawLayer->getDefaultIconHaloBlur(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + - (void)setIconHaloColor:(MGLStyleValue *)iconHaloColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloColor); _rawLayer->setIconHaloColor(mbglValue); @@ -528,13 +528,13 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setIconHaloBlur:(MGLStyleValue *)iconHaloBlur { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloBlur); - _rawLayer->setIconHaloBlur(mbglValue); +- (void)setIconOpacity:(MGLStyleValue *)iconOpacity { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconOpacity); + _rawLayer->setIconOpacity(mbglValue); } -- (MGLStyleValue *)iconHaloBlur { - auto propertyValue = _rawLayer->getIconHaloBlur() ?: _rawLayer->getDefaultIconHaloBlur(); +- (MGLStyleValue *)iconOpacity { + auto propertyValue = _rawLayer->getIconOpacity() ?: _rawLayer->getDefaultIconOpacity(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } @@ -558,16 +558,6 @@ namespace mbgl { return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } -- (void)setTextOpacity:(MGLStyleValue *)textOpacity { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textOpacity); - _rawLayer->setTextOpacity(mbglValue); -} - -- (MGLStyleValue *)textOpacity { - auto propertyValue = _rawLayer->getTextOpacity() ?: _rawLayer->getDefaultTextOpacity(); - return MGLStyleValueTransformer().toStyleValue(propertyValue); -} - - (void)setTextColor:(MGLStyleValue *)textColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textColor); _rawLayer->setTextColor(mbglValue); @@ -578,6 +568,16 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } +- (void)setTextHaloBlur:(MGLStyleValue *)textHaloBlur { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloBlur); + _rawLayer->setTextHaloBlur(mbglValue); +} + +- (MGLStyleValue *)textHaloBlur { + auto propertyValue = _rawLayer->getTextHaloBlur() ?: _rawLayer->getDefaultTextHaloBlur(); + return MGLStyleValueTransformer().toStyleValue(propertyValue); +} + - (void)setTextHaloColor:(MGLStyleValue *)textHaloColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloColor); _rawLayer->setTextHaloColor(mbglValue); @@ -598,13 +598,13 @@ namespace mbgl { return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setTextHaloBlur:(MGLStyleValue *)textHaloBlur { - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloBlur); - _rawLayer->setTextHaloBlur(mbglValue); +- (void)setTextOpacity:(MGLStyleValue *)textOpacity { + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textOpacity); + _rawLayer->setTextOpacity(mbglValue); } -- (MGLStyleValue *)textHaloBlur { - auto propertyValue = _rawLayer->getTextHaloBlur() ?: _rawLayer->getDefaultTextHaloBlur(); +- (MGLStyleValue *)textOpacity { + auto propertyValue = _rawLayer->getTextOpacity() ?: _rawLayer->getDefaultTextOpacity(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } diff --git a/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.h b/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.h index 835b22b02..8aa07b2a0 100644 --- a/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.h +++ b/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.h @@ -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 diff --git a/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.mm b/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.mm index b6a64a785..89f0c07a5 100644 --- a/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.mm +++ b/platform/darwin/src/NSValue+MGLStyleEnumAttributeAdditions.mm @@ -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 diff --git a/platform/darwin/test/MGLBackgroundStyleLayerTests.m b/platform/darwin/test/MGLBackgroundStyleLayerTests.m index 2681b773a..09bed7665 100644 --- a/platform/darwin/test/MGLBackgroundStyleLayerTests.m +++ b/platform/darwin/test/MGLBackgroundStyleLayerTests.m @@ -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 diff --git a/platform/darwin/test/MGLCircleStyleLayerTests.m b/platform/darwin/test/MGLCircleStyleLayerTests.m index 54ba8be6c..432d3ffa7 100644 --- a/platform/darwin/test/MGLCircleStyleLayerTests.m +++ b/platform/darwin/test/MGLCircleStyleLayerTests.m @@ -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 diff --git a/platform/darwin/test/MGLFillStyleLayerTests.m b/platform/darwin/test/MGLFillStyleLayerTests.m index 7b3120790..87846302e 100644 --- a/platform/darwin/test/MGLFillStyleLayerTests.m +++ b/platform/darwin/test/MGLFillStyleLayerTests.m @@ -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 diff --git a/platform/darwin/test/MGLLineStyleLayerTests.m b/platform/darwin/test/MGLLineStyleLayerTests.m index 801bc12ff..95983b1f5 100644 --- a/platform/darwin/test/MGLLineStyleLayerTests.m +++ b/platform/darwin/test/MGLLineStyleLayerTests.m @@ -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 diff --git a/platform/darwin/test/MGLRasterStyleLayerTests.m b/platform/darwin/test/MGLRasterStyleLayerTests.m index f68f6d328..84fd0fe3e 100644 --- a/platform/darwin/test/MGLRasterStyleLayerTests.m +++ b/platform/darwin/test/MGLRasterStyleLayerTests.m @@ -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 diff --git a/platform/darwin/test/MGLSymbolStyleLayerTests.m b/platform/darwin/test/MGLSymbolStyleLayerTests.m index f60ae7c2a..e77c4f6f3 100644 --- a/platform/darwin/test/MGLSymbolStyleLayerTests.m +++ b/platform/darwin/test/MGLSymbolStyleLayerTests.m @@ -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)]); }