summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/darwin/scripts/generate-style-code.js141
-rw-r--r--platform/darwin/src/MGLBackgroundStyleLayer.h16
-rw-r--r--platform/darwin/src/MGLBackgroundStyleLayer.mm32
-rw-r--r--platform/darwin/src/MGLCircleStyleLayer.h34
-rw-r--r--platform/darwin/src/MGLCircleStyleLayer.mm72
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.h32
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.mm72
-rw-r--r--platform/darwin/src/MGLLineStyleLayer.h63
-rw-r--r--platform/darwin/src/MGLLineStyleLayer.mm134
-rw-r--r--platform/darwin/src/MGLRasterStyleLayer.h30
-rw-r--r--platform/darwin/src/MGLRasterStyleLayer.mm72
-rw-r--r--platform/darwin/src/MGLStyleAttribute.h25
-rw-r--r--platform/darwin/src/MGLStyleAttribute.mm112
-rw-r--r--platform/darwin/src/MGLStyleAttributeFunction.mm309
-rw-r--r--platform/darwin/src/MGLStyleAttributeValue.h5
-rw-r--r--platform/darwin/src/MGLStyleAttributeValue_Private.h24
-rw-r--r--platform/darwin/src/MGLStyleLayer.h.ejs6
-rw-r--r--platform/darwin/src/MGLStyleLayer.mm.ejs22
-rw-r--r--platform/darwin/src/MGLStyleLayer_Private.h18
-rw-r--r--platform/darwin/src/MGLStyleValue.h (renamed from platform/darwin/src/MGLStyleAttributeFunction.h)17
-rw-r--r--platform/darwin/src/MGLStyleValue.mm71
-rw-r--r--platform/darwin/src/MGLStyleValue_Private.h (renamed from platform/darwin/src/MGLStyleAttributeFunction_Private.h)90
-rw-r--r--platform/darwin/src/MGLSymbolStyleLayer.h218
-rw-r--r--platform/darwin/src/MGLSymbolStyleLayer.mm482
-rw-r--r--platform/darwin/src/NSArray+MGLStyleAttributeAdditions.h7
-rw-r--r--platform/darwin/src/NSArray+MGLStyleAttributeAdditions.mm36
-rw-r--r--platform/darwin/src/NSArray+MGLStyleAttributeAdditions_Private.h9
-rw-r--r--platform/darwin/src/NSColor+MGLStyleAttributeAdditions.h7
-rw-r--r--platform/darwin/src/NSColor+MGLStyleAttributeAdditions.m5
-rw-r--r--platform/darwin/src/NSColor+MGLStyleAttributeAdditions_Private.h9
-rw-r--r--platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.h7
-rw-r--r--platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm22
-rw-r--r--platform/darwin/src/NSNumber+MGLStyleAttributeAdditions_Private.h13
-rw-r--r--platform/darwin/src/NSString+MGLStyleAttributeAdditions.h7
-rw-r--r--platform/darwin/src/NSString+MGLStyleAttributeAdditions.mm17
-rw-r--r--platform/darwin/src/NSString+MGLStyleAttributeAdditions_Private.h11
-rw-r--r--platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h10
-rw-r--r--platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm19
-rw-r--r--platform/darwin/src/NSValue+MGLStyleAttributeAdditions_Private.h15
-rw-r--r--platform/darwin/src/UIColor+MGLStyleAttributeAdditions_Private.h9
-rw-r--r--platform/darwin/test/MGLCircleStyleLayerTests.m6
-rw-r--r--platform/darwin/test/MGLFillStyleLayerTests.m3
-rw-r--r--platform/darwin/test/MGLLineStyleLayerTests.m9
-rw-r--r--platform/darwin/test/MGLRuntimeStylingHelper.h38
-rw-r--r--platform/darwin/test/MGLRuntimeStylingHelper.m120
-rw-r--r--platform/darwin/test/MGLSymbolStyleLayerTests.m30
-rw-r--r--platform/ios/app/MBXViewController.m72
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj142
-rw-r--r--platform/ios/src/Mapbox.h8
-rw-r--r--platform/ios/src/UIColor+MGLAdditions.mm3
-rw-r--r--platform/ios/src/UIColor+MGLStyleAttributeAdditions.h7
-rw-r--r--platform/ios/src/UIColor+MGLStyleAttributeAdditions.mm14
-rw-r--r--platform/macos/app/MapDocument.m13
-rw-r--r--platform/macos/macos.xcodeproj/project.pbxproj110
-rw-r--r--platform/macos/src/Mapbox.h8
55 files changed, 1073 insertions, 1810 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 0c8b704e91..4bcfe54d32 100644
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -44,7 +44,8 @@ global.testGetterImplementation = function (property, layerType, isFunction) {
if (isFunction) {
return `XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`;
}
- return `XCTAssert([(NSValue *)gLayer.${objCName(property)} isEqualToValue:${value}], @"%@ is not equal to %@", gLayer.${objCName(property)}, ${value});`;
+ return `XCTAssert([gLayer.${objCName(property)} isKindOfClass:[MGLStyleConstantValue class]]);
+ XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`;
}
return `XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`;
}
@@ -129,7 +130,7 @@ global.propertyReqs = function (property, layoutPropertiesByName, type) {
return '`' + camelizeWithLeadingLowercase(req['!']) + '` is set to `nil`';
} else {
let name = Object.keys(req)[0];
- return '`' + camelizeWithLeadingLowercase(name) + '` is set to ' + describeValue(req[name], layoutPropertiesByName[name], type);
+ return '`' + camelizeWithLeadingLowercase(name) + '` is set to an `MGLStyleValue` object containing ' + describeValue(req[name], layoutPropertiesByName[name], type);
}
}).join(', and ') + '. Otherwise, it is ignored.';
};
@@ -204,109 +205,93 @@ global.describeValue = function (value, property, layerType) {
};
global.propertyDefault = function (property, layerType) {
- return describeValue(property.default, property, layerType);
+ return 'an `MGLStyleValue` object containing ' + describeValue(property.default, property, layerType);
};
-global.propertyType = function (property, _private) {
- return _private ? `id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>` : `id <MGLStyleAttributeValue>`;
-};
-
-global.initLayer = function (layerType) {
- if (layerType == "background") {
- return `_layer = new mbgl::style::${camelize(layerType)}Layer(identifier.UTF8String);`
- } else {
- return `_layer = new mbgl::style::${camelize(layerType)}Layer(identifier.UTF8String, source.identifier.UTF8String);`
- }
-}
-
-global.setSourceLayer = function() {
- return `_layer->setSourceLayer(sourceLayer.UTF8String);`
-}
-
-global.setterImplementation = function(property, layerType) {
- let implementation = '';
+global.propertyType = function (property) {
switch (property.type) {
case 'boolean':
- implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_boolPropertyValue);`;
- break;
+ return 'NSNumber *';
case 'number':
- implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_floatPropertyValue);`;
- break;
+ return 'NSNumber *';
case 'string':
- implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_stringPropertyValue);`;
- break;
+ return 'NSString *';
case 'enum':
- let objCType = global.objCType(layerType, property.name);
- implementation = `MGLSetEnumProperty(${objCName(property)}, ${camelize(property.name)}, ${mbglType(property)}, ${objCType});`;
- break;
+ return 'NSValue *';
case 'color':
- implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_colorPropertyValue);`;
- break;
+ return 'MGLColor *';
case 'array':
- implementation = arraySetterImplementation(property);
- break;
- default: throw new Error(`unknown type for ${property.name}`)
- }
- return implementation;
-}
-
-global.mbglType = function(property) {
- let mbglType = camelize(property.name) + 'Type';
- if (/-translate-anchor$/.test(property.name)) {
- mbglType = 'TranslateAnchorType';
- }
- if (/-(rotation|pitch)-alignment$/.test(property.name)) {
- mbglType = 'AlignmentType';
+ switch (arrayType(property)) {
+ case 'dasharray':
+ return 'NSArray<NSNumber *> *';
+ case 'font':
+ return 'NSArray<NSString *> *';
+ case 'padding':
+ return 'NSValue *';
+ case 'offset':
+ case 'translate':
+ return 'NSValue *';
+ default:
+ throw new Error(`unknown array type for ${property.name}`);
+ }
+ default:
+ throw new Error(`unknown type for ${property.name}`);
}
- return mbglType;
-}
-
-global.arraySetterImplementation = function(property) {
- return `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_${convertedType(property)}PropertyValue);`;
-}
+};
-global.styleAttributeFactory = function (property, layerType) {
+global.valueTransformerArguments = function (property) {
+ let objCType = propertyType(property);
switch (property.type) {
case 'boolean':
- return 'mbgl_boolWithPropertyValueBool';
+ return ['bool', objCType];
case 'number':
- return 'mbgl_numberWithPropertyValueNumber';
+ return ['float', objCType];
case 'string':
- return 'mbgl_stringWithPropertyValueString';
+ return ['std::string', objCType];
case 'enum':
- throw new Error('Use MGLGetEnumProperty() for enums.');
+ return [`mbgl::style::${mbglType(property)}`, objCType];
case 'color':
- return 'mbgl_colorWithPropertyValueColor';
+ return ['mbgl::Color', objCType];
case 'array':
- return `mbgl_${convertedType(property)}WithPropertyValue${camelize(convertedType(property))}`;
+ switch (arrayType(property)) {
+ case 'dasharray':
+ return ['std::vector<float>', objCType, 'float'];
+ case 'font':
+ return ['std::vector<std::string>', objCType, 'std::string'];
+ case 'padding':
+ return ['std::array<float, 4>', objCType];
+ case 'offset':
+ case 'translate':
+ return ['std::array<float, 2>', objCType];
+ default:
+ throw new Error(`unknown array type for ${property.name}`);
+ }
default:
throw new Error(`unknown type for ${property.name}`);
}
};
-global.getterImplementation = function(property, layerType) {
- if (property.type === 'enum') {
- let objCType = global.objCType(layerType, property.name);
- return `MGLGetEnumProperty(${camelize(property.name)}, ${mbglType(property)}, ${objCType});`;
+global.initLayer = function (layerType) {
+ if (layerType == "background") {
+ return `_layer = new mbgl::style::${camelize(layerType)}Layer(identifier.UTF8String);`
+ } else {
+ return `_layer = new mbgl::style::${camelize(layerType)}Layer(identifier.UTF8String, source.identifier.UTF8String);`
}
- let rawValue = `self.layer->get${camelize(property.name)}() ?: self.layer->getDefault${camelize(property.name)}()`;
- return `return [MGLStyleAttribute ${styleAttributeFactory(property, layerType)}:${rawValue}];`;
}
-global.convertedType = function(property) {
- switch (arrayType(property)) {
- case 'dasharray':
- return 'numberArray';
- case 'font':
- return 'stringArray';
- case 'padding':
- return 'padding';
- case 'offset':
- case 'translate':
- return 'offset';
- default:
- throw new Error(`unknown array type for ${property.name}`);
+global.setSourceLayer = function() {
+ return `_layer->setSourceLayer(sourceLayer.UTF8String);`
+}
+
+global.mbglType = function(property) {
+ let mbglType = camelize(property.name) + 'Type';
+ if (/-translate-anchor$/.test(property.name)) {
+ mbglType = 'TranslateAnchorType';
}
+ if (/-(rotation|pitch)-alignment$/.test(property.name)) {
+ mbglType = 'AlignmentType';
+ }
+ return mbglType;
}
const layerH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.h.ejs', 'utf8'), { strict: true });
diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.h b/platform/darwin/src/MGLBackgroundStyleLayer.h
index 1a4c64dedf..1c167fc91c 100644
--- a/platform/darwin/src/MGLBackgroundStyleLayer.h
+++ b/platform/darwin/src/MGLBackgroundStyleLayer.h
@@ -1,7 +1,7 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue.h"
#import "MGLStyleLayer.h"
NS_ASSUME_NONNULL_BEGIN
@@ -22,33 +22,33 @@ NS_ASSUME_NONNULL_BEGIN
/**
The color with which the background will be drawn.
- The default value of this property is `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `backgroundPattern` is set to `nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> backgroundColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *backgroundColor;
#else
/**
The color with which the background will be drawn.
- The default value of this property is `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `backgroundPattern` is set to `nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> backgroundColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *backgroundColor;
#endif
/**
Name of image in sprite 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) id <MGLStyleAttributeValue> backgroundPattern;
+@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *backgroundPattern;
/**
The opacity at which the background will be drawn.
- The default value of this property is 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 `1`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> backgroundOpacity;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *backgroundOpacity;
@end
diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/darwin/src/MGLBackgroundStyleLayer.mm
index 032aa196ee..33a105e5d5 100644
--- a/platform/darwin/src/MGLBackgroundStyleLayer.mm
+++ b/platform/darwin/src/MGLBackgroundStyleLayer.mm
@@ -4,7 +4,7 @@
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue_Private.h"
#import "MGLBackgroundStyleLayer.h"
#include <mbgl/style/layers/background_layer.hpp>
@@ -27,28 +27,34 @@
#pragma mark - Accessing the Paint Attributes
-- (void)setBackgroundColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundColor {
- self.layer->setBackgroundColor(backgroundColor.mbgl_colorPropertyValue);
+- (void)setBackgroundColor:(MGLStyleValue<MGLColor *> *)backgroundColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(backgroundColor);
+ self.layer->setBackgroundColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)backgroundColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getBackgroundColor() ?: self.layer->getDefaultBackgroundColor()];
+- (MGLStyleValue<MGLColor *> *)backgroundColor {
+ auto propertyValue = self.layer->getBackgroundColor() ?: self.layer->getDefaultBackgroundColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setBackgroundPattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundPattern {
- self.layer->setBackgroundPattern(backgroundPattern.mbgl_stringPropertyValue);
+- (void)setBackgroundPattern:(MGLStyleValue<NSString *> *)backgroundPattern {
+ auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(backgroundPattern);
+ self.layer->setBackgroundPattern(mbglValue);
}
-- (id <MGLStyleAttributeValue>)backgroundPattern {
- return [MGLStyleAttribute mbgl_stringWithPropertyValueString:self.layer->getBackgroundPattern() ?: self.layer->getDefaultBackgroundPattern()];
+- (MGLStyleValue<NSString *> *)backgroundPattern {
+ auto propertyValue = self.layer->getBackgroundPattern() ?: self.layer->getDefaultBackgroundPattern();
+ return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
-- (void)setBackgroundOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundOpacity {
- self.layer->setBackgroundOpacity(backgroundOpacity.mbgl_floatPropertyValue);
+- (void)setBackgroundOpacity:(MGLStyleValue<NSNumber *> *)backgroundOpacity {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(backgroundOpacity);
+ self.layer->setBackgroundOpacity(mbglValue);
}
-- (id <MGLStyleAttributeValue>)backgroundOpacity {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getBackgroundOpacity() ?: self.layer->getDefaultBackgroundOpacity()];
+- (MGLStyleValue<NSNumber *> *)backgroundOpacity {
+ auto propertyValue = self.layer->getBackgroundOpacity() ?: self.layer->getDefaultBackgroundOpacity();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
@end
diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h
index 9a45f7280c..6006250cdf 100644
--- a/platform/darwin/src/MGLCircleStyleLayer.h
+++ b/platform/darwin/src/MGLCircleStyleLayer.h
@@ -1,7 +1,7 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue.h"
#import "MGLVectorStyleLayer.h"
NS_ASSUME_NONNULL_BEGIN
@@ -53,64 +53,64 @@ typedef NS_ENUM(NSUInteger, MGLCirclePitchScale) {
This property is measured in points.
- The default value of this property is 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 `5`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleRadius;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleRadius;
#if TARGET_OS_IPHONE
/**
The fill color of the circle.
- The default value of this property is `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *circleColor;
#else
/**
The fill color of the circle.
- The default value of this property is `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *circleColor;
#endif
/**
Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
- The default value of this property is an `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 `0`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleBlur;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleBlur;
/**
The opacity at which the circle will be drawn.
- The default value of this property is 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 `1`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleOpacity;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleOpacity;
/**
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
This property is measured in points.
- The default value of this property is an `NSValue` object containing a `CGVector` struct set to 0 points from the left and 0 points from the top. 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 a `CGVector` struct set to 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleTranslate;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *circleTranslate;
/**
Controls the translation reference point.
- The default value of this property is an `NSValue` object containing `MGLCircleTranslateAnchorMap`. 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 `MGLCircleTranslateAnchorMap`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `circleTranslate` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleTranslateAnchor;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *circleTranslateAnchor;
/**
Controls the scaling behavior of the circle when the map is pitched.
- The default value of this property is an `NSValue` object containing `MGLCirclePitchScaleMap`. 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 `MGLCirclePitchScaleMap`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circlePitchScale;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *circlePitchScale;
@end
diff --git a/platform/darwin/src/MGLCircleStyleLayer.mm b/platform/darwin/src/MGLCircleStyleLayer.mm
index 31fa795d54..8fe97a0537 100644
--- a/platform/darwin/src/MGLCircleStyleLayer.mm
+++ b/platform/darwin/src/MGLCircleStyleLayer.mm
@@ -4,7 +4,7 @@
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue_Private.h"
#import "MGLCircleStyleLayer.h"
#include <mbgl/style/layers/circle_layer.hpp>
@@ -48,60 +48,74 @@
#pragma mark - Accessing the Paint Attributes
-- (void)setCircleRadius:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleRadius {
- self.layer->setCircleRadius(circleRadius.mbgl_floatPropertyValue);
+- (void)setCircleRadius:(MGLStyleValue<NSNumber *> *)circleRadius {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(circleRadius);
+ self.layer->setCircleRadius(mbglValue);
}
-- (id <MGLStyleAttributeValue>)circleRadius {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getCircleRadius() ?: self.layer->getDefaultCircleRadius()];
+- (MGLStyleValue<NSNumber *> *)circleRadius {
+ auto propertyValue = self.layer->getCircleRadius() ?: self.layer->getDefaultCircleRadius();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setCircleColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleColor {
- self.layer->setCircleColor(circleColor.mbgl_colorPropertyValue);
+- (void)setCircleColor:(MGLStyleValue<MGLColor *> *)circleColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(circleColor);
+ self.layer->setCircleColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)circleColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getCircleColor() ?: self.layer->getDefaultCircleColor()];
+- (MGLStyleValue<MGLColor *> *)circleColor {
+ auto propertyValue = self.layer->getCircleColor() ?: self.layer->getDefaultCircleColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setCircleBlur:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleBlur {
- self.layer->setCircleBlur(circleBlur.mbgl_floatPropertyValue);
+- (void)setCircleBlur:(MGLStyleValue<NSNumber *> *)circleBlur {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(circleBlur);
+ self.layer->setCircleBlur(mbglValue);
}
-- (id <MGLStyleAttributeValue>)circleBlur {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getCircleBlur() ?: self.layer->getDefaultCircleBlur()];
+- (MGLStyleValue<NSNumber *> *)circleBlur {
+ auto propertyValue = self.layer->getCircleBlur() ?: self.layer->getDefaultCircleBlur();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setCircleOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleOpacity {
- self.layer->setCircleOpacity(circleOpacity.mbgl_floatPropertyValue);
+- (void)setCircleOpacity:(MGLStyleValue<NSNumber *> *)circleOpacity {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(circleOpacity);
+ self.layer->setCircleOpacity(mbglValue);
}
-- (id <MGLStyleAttributeValue>)circleOpacity {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getCircleOpacity() ?: self.layer->getDefaultCircleOpacity()];
+- (MGLStyleValue<NSNumber *> *)circleOpacity {
+ auto propertyValue = self.layer->getCircleOpacity() ?: self.layer->getDefaultCircleOpacity();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setCircleTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleTranslate {
- self.layer->setCircleTranslate(circleTranslate.mbgl_offsetPropertyValue);
+- (void)setCircleTranslate:(MGLStyleValue<NSValue *> *)circleTranslate {
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(circleTranslate);
+ self.layer->setCircleTranslate(mbglValue);
}
-- (id <MGLStyleAttributeValue>)circleTranslate {
- return [MGLStyleAttribute mbgl_offsetWithPropertyValueOffset:self.layer->getCircleTranslate() ?: self.layer->getDefaultCircleTranslate()];
+- (MGLStyleValue<NSValue *> *)circleTranslate {
+ auto propertyValue = self.layer->getCircleTranslate() ?: self.layer->getDefaultCircleTranslate();
+ return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setCircleTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleTranslateAnchor {
- MGLSetEnumProperty(circleTranslateAnchor, CircleTranslateAnchor, TranslateAnchorType, MGLCircleTranslateAnchor);
+- (void)setCircleTranslateAnchor:(MGLStyleValue<NSValue *> *)circleTranslateAnchor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toPropertyValue(circleTranslateAnchor);
+ self.layer->setCircleTranslateAnchor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)circleTranslateAnchor {
- MGLGetEnumProperty(CircleTranslateAnchor, TranslateAnchorType, MGLCircleTranslateAnchor);
+- (MGLStyleValue<NSValue *> *)circleTranslateAnchor {
+ auto propertyValue = self.layer->getCircleTranslateAnchor() ?: self.layer->getDefaultCircleTranslateAnchor();
+ return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setCirclePitchScale:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circlePitchScale {
- MGLSetEnumProperty(circlePitchScale, CirclePitchScale, CirclePitchScaleType, MGLCirclePitchScale);
+- (void)setCirclePitchScale:(MGLStyleValue<NSValue *> *)circlePitchScale {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *>().toPropertyValue(circlePitchScale);
+ self.layer->setCirclePitchScale(mbglValue);
}
-- (id <MGLStyleAttributeValue>)circlePitchScale {
- MGLGetEnumProperty(CirclePitchScale, CirclePitchScaleType, MGLCirclePitchScale);
+- (MGLStyleValue<NSValue *> *)circlePitchScale {
+ auto propertyValue = self.layer->getCirclePitchScale() ?: self.layer->getDefaultCirclePitchScale();
+ return MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *>().toStyleValue(propertyValue);
}
@end
diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h
index d9ce1abace..712bfea998 100644
--- a/platform/darwin/src/MGLFillStyleLayer.h
+++ b/platform/darwin/src/MGLFillStyleLayer.h
@@ -1,7 +1,7 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue.h"
#import "MGLVectorStyleLayer.h"
NS_ASSUME_NONNULL_BEGIN
@@ -35,66 +35,66 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) {
/**
Whether or not the fill should be antialiased.
- The default value of this property is an `NSNumber` object containing `YES`. 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.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillAntialias;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *fillAntialias;
/**
The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1pt stroke around the fill, if the stroke is used.
- The default value of this property is an `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 `1`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillOpacity;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *fillOpacity;
#if TARGET_OS_IPHONE
/**
The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1pt stroke, if it is used.
- The default value of this property is `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `fillPattern` is set to `nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *fillColor;
#else
/**
The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1pt stroke, if it is used.
- The default value of this property is `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `fillPattern` is set to `nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *fillColor;
#endif
/**
The outline color of the fill. Matches the value of `fillColor` if unspecified.
- This property is only applied to the style if `fillPattern` is set to `nil`, and `fillAntialias` is set to an `NSNumber` object containing `YES`. Otherwise, it is ignored.
+ This property is only applied to the style if `fillPattern` is set to `nil`, and `fillAntialias` is set to an `MGLStyleValue` object containing an `NSNumber` object containing `YES`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillOutlineColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *fillOutlineColor;
/**
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
This property is measured in points.
- The default value of this property is an `NSValue` object containing a `CGVector` struct set to 0 points from the left and 0 points from the top. 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 a `CGVector` struct set to 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillTranslate;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *fillTranslate;
/**
Controls the translation reference point.
- The default value of this property is an `NSValue` object containing `MGLFillTranslateAnchorMap`. 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 `MGLFillTranslateAnchorMap`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `fillTranslate` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillTranslateAnchor;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *fillTranslateAnchor;
/**
Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillPattern;
+@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *fillPattern;
@end
diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm
index a2320f4fda..e16e3b2652 100644
--- a/platform/darwin/src/MGLFillStyleLayer.mm
+++ b/platform/darwin/src/MGLFillStyleLayer.mm
@@ -4,7 +4,7 @@
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue_Private.h"
#import "MGLFillStyleLayer.h"
#include <mbgl/style/layers/fill_layer.hpp>
@@ -48,60 +48,74 @@
#pragma mark - Accessing the Paint Attributes
-- (void)setFillAntialias:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillAntialias {
- self.layer->setFillAntialias(fillAntialias.mbgl_boolPropertyValue);
+- (void)setFillAntialias:(MGLStyleValue<NSNumber *> *)fillAntialias {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(fillAntialias);
+ self.layer->setFillAntialias(mbglValue);
}
-- (id <MGLStyleAttributeValue>)fillAntialias {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getFillAntialias() ?: self.layer->getDefaultFillAntialias()];
+- (MGLStyleValue<NSNumber *> *)fillAntialias {
+ auto propertyValue = self.layer->getFillAntialias() ?: self.layer->getDefaultFillAntialias();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setFillOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillOpacity {
- self.layer->setFillOpacity(fillOpacity.mbgl_floatPropertyValue);
+- (void)setFillOpacity:(MGLStyleValue<NSNumber *> *)fillOpacity {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(fillOpacity);
+ self.layer->setFillOpacity(mbglValue);
}
-- (id <MGLStyleAttributeValue>)fillOpacity {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getFillOpacity() ?: self.layer->getDefaultFillOpacity()];
+- (MGLStyleValue<NSNumber *> *)fillOpacity {
+ auto propertyValue = self.layer->getFillOpacity() ?: self.layer->getDefaultFillOpacity();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setFillColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillColor {
- self.layer->setFillColor(fillColor.mbgl_colorPropertyValue);
+- (void)setFillColor:(MGLStyleValue<MGLColor *> *)fillColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(fillColor);
+ self.layer->setFillColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)fillColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getFillColor() ?: self.layer->getDefaultFillColor()];
+- (MGLStyleValue<MGLColor *> *)fillColor {
+ auto propertyValue = self.layer->getFillColor() ?: self.layer->getDefaultFillColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setFillOutlineColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillOutlineColor {
- self.layer->setFillOutlineColor(fillOutlineColor.mbgl_colorPropertyValue);
+- (void)setFillOutlineColor:(MGLStyleValue<MGLColor *> *)fillOutlineColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(fillOutlineColor);
+ self.layer->setFillOutlineColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)fillOutlineColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getFillOutlineColor() ?: self.layer->getDefaultFillOutlineColor()];
+- (MGLStyleValue<MGLColor *> *)fillOutlineColor {
+ auto propertyValue = self.layer->getFillOutlineColor() ?: self.layer->getDefaultFillOutlineColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setFillTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillTranslate {
- self.layer->setFillTranslate(fillTranslate.mbgl_offsetPropertyValue);
+- (void)setFillTranslate:(MGLStyleValue<NSValue *> *)fillTranslate {
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(fillTranslate);
+ self.layer->setFillTranslate(mbglValue);
}
-- (id <MGLStyleAttributeValue>)fillTranslate {
- return [MGLStyleAttribute mbgl_offsetWithPropertyValueOffset:self.layer->getFillTranslate() ?: self.layer->getDefaultFillTranslate()];
+- (MGLStyleValue<NSValue *> *)fillTranslate {
+ auto propertyValue = self.layer->getFillTranslate() ?: self.layer->getDefaultFillTranslate();
+ return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setFillTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillTranslateAnchor {
- MGLSetEnumProperty(fillTranslateAnchor, FillTranslateAnchor, TranslateAnchorType, MGLFillTranslateAnchor);
+- (void)setFillTranslateAnchor:(MGLStyleValue<NSValue *> *)fillTranslateAnchor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toPropertyValue(fillTranslateAnchor);
+ self.layer->setFillTranslateAnchor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)fillTranslateAnchor {
- MGLGetEnumProperty(FillTranslateAnchor, TranslateAnchorType, MGLFillTranslateAnchor);
+- (MGLStyleValue<NSValue *> *)fillTranslateAnchor {
+ auto propertyValue = self.layer->getFillTranslateAnchor() ?: self.layer->getDefaultFillTranslateAnchor();
+ return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setFillPattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillPattern {
- self.layer->setFillPattern(fillPattern.mbgl_stringPropertyValue);
+- (void)setFillPattern:(MGLStyleValue<NSString *> *)fillPattern {
+ auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(fillPattern);
+ self.layer->setFillPattern(mbglValue);
}
-- (id <MGLStyleAttributeValue>)fillPattern {
- return [MGLStyleAttribute mbgl_stringWithPropertyValueString:self.layer->getFillPattern() ?: self.layer->getDefaultFillPattern()];
+- (MGLStyleValue<NSString *> *)fillPattern {
+ auto propertyValue = self.layer->getFillPattern() ?: self.layer->getDefaultFillPattern();
+ return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
@end
diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h
index cee33e1388..663e927718 100644
--- a/platform/darwin/src/MGLLineStyleLayer.h
+++ b/platform/darwin/src/MGLLineStyleLayer.h
@@ -1,9 +1,8 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue.h"
#import "MGLVectorStyleLayer.h"
-#import "MGLStyleAttributeFunction.h"
NS_ASSUME_NONNULL_BEGIN
@@ -76,62 +75,62 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) {
/**
The display of line endings.
- The default value of this property is an `NSValue` object containing `MGLLineCapButt`. 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 `MGLLineCapButt`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineCap;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *lineCap;
/**
The display of lines when joining.
- The default value of this property is an `NSValue` object containing `MGLLineJoinMiter`. 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 `MGLLineJoinMiter`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) MGLStyleValue <NSValue *> *lineJoin;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *lineJoin;
/**
Used to automatically convert miter joins to bevel joins for sharp angles.
- The default value of this property is 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 `2`. Set this property to `nil` to reset it to the default value.
- This property is only applied to the style if `lineJoin` is set to an `NSValue` object containing `MGLLineJoinMiter`. Otherwise, it is ignored.
+ This property is only applied to the style if `lineJoin` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLLineJoinMiter`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) MGLStyleValue <NSNumber *> *lineMiterLimit;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineMiterLimit;
/**
Used to automatically convert round joins to miter joins for shallow angles.
- The default value of this property is an `NSNumber` object containing the float `1.05`. 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.05`. Set this property to `nil` to reset it to the default value.
- This property is only applied to the style if `lineJoin` is set to an `NSValue` object containing `MGLLineJoinRound`. Otherwise, it is ignored.
+ This property is only applied to the style if `lineJoin` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLLineJoinRound`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineRoundLimit;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineRoundLimit;
#pragma mark - Accessing the Paint Attributes
/**
The opacity at which the line will be drawn.
- The default value of this property is 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 `1`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineOpacity;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineOpacity;
#if TARGET_OS_IPHONE
/**
The color with which the line will be drawn.
- The default value of this property is `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *lineColor;
#else
/**
The color with which the line will be drawn.
- The default value of this property is `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *lineColor;
#endif
/**
@@ -139,54 +138,54 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) {
This property is measured in points.
- The default value of this property is an `NSValue` object containing a `CGVector` struct set to 0 points from the left and 0 points from the top. 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 a `CGVector` struct set to 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineTranslate;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *lineTranslate;
/**
Controls the translation reference point.
- The default value of this property is an `NSValue` object containing `MGLLineTranslateAnchorMap`. 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 `MGLLineTranslateAnchorMap`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `lineTranslate` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineTranslateAnchor;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *lineTranslateAnchor;
/**
Stroke thickness.
This property is measured in points.
- The default value of this property is 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 `1`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineWidth;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineWidth;
/**
Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
This property is measured in points.
- The default value of this property is an `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 `0`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineGapWidth;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineGapWidth;
/**
The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.
This property is measured in points.
- The default value of this property is an `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 `0`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineOffset;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineOffset;
/**
Blur applied to the line, in points.
This property is measured in points.
- The default value of this property is an `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 `0`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineBlur;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *lineBlur;
/**
Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to points, multiply the length by the current line width.
@@ -195,12 +194,12 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslateAnchor) {
This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineDasharray;
+@property (nonatomic, null_resettable) MGLStyleValue<NSArray<NSNumber *> *> *lineDasharray;
/**
Name of image in sprite 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) id <MGLStyleAttributeValue> linePattern;
+@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *linePattern;
@end
diff --git a/platform/darwin/src/MGLLineStyleLayer.mm b/platform/darwin/src/MGLLineStyleLayer.mm
index 2d202290da..57724a0600 100644
--- a/platform/darwin/src/MGLLineStyleLayer.mm
+++ b/platform/darwin/src/MGLLineStyleLayer.mm
@@ -4,7 +4,7 @@
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue_Private.h"
#import "MGLLineStyleLayer.h"
#include <mbgl/style/layers/line_layer.hpp>
@@ -48,122 +48,146 @@
#pragma mark - Accessing the Layout Attributes
-- (void)setLineCap:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineCap {
- MGLSetEnumProperty(lineCap, LineCap, LineCapType, MGLLineCap);
+- (void)setLineCap:(MGLStyleValue<NSValue *> *)lineCap {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::LineCapType, NSValue *>().toPropertyValue(lineCap);
+ self.layer->setLineCap(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineCap {
- MGLGetEnumProperty(LineCap, LineCapType, MGLLineCap);
+- (MGLStyleValue<NSValue *> *)lineCap {
+ auto propertyValue = self.layer->getLineCap() ?: self.layer->getDefaultLineCap();
+ return MGLStyleValueTransformer<mbgl::style::LineCapType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setLineJoin:(MGLStyleValue <NSValue *> *)lineJoin {
- auto propertyValue = MGLStyleValueTransformer<mbgl::style::LineJoinType, NSValue *>().toPropertyValue(lineJoin);
- self.layer->setLineJoin(propertyValue);
+- (void)setLineJoin:(MGLStyleValue<NSValue *> *)lineJoin {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::LineJoinType, NSValue *>().toPropertyValue(lineJoin);
+ self.layer->setLineJoin(mbglValue);
}
-- (MGLStyleValue <NSValue *> *)lineJoin {
+- (MGLStyleValue<NSValue *> *)lineJoin {
auto propertyValue = self.layer->getLineJoin() ?: self.layer->getDefaultLineJoin();
return MGLStyleValueTransformer<mbgl::style::LineJoinType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setLineMiterLimit:(MGLStyleValue <NSNumber *> *)lineMiterLimit {
+- (void)setLineMiterLimit:(MGLStyleValue<NSNumber *> *)lineMiterLimit {
auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineMiterLimit);
self.layer->setLineMiterLimit(mbglValue);
}
-- (MGLStyleValue <NSNumber *> *)lineMiterLimit {
+- (MGLStyleValue<NSNumber *> *)lineMiterLimit {
auto propertyValue = self.layer->getLineMiterLimit() ?: self.layer->getDefaultLineMiterLimit();
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setLineRoundLimit:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineRoundLimit {
- self.layer->setLineRoundLimit(lineRoundLimit.mbgl_floatPropertyValue);
+- (void)setLineRoundLimit:(MGLStyleValue<NSNumber *> *)lineRoundLimit {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineRoundLimit);
+ self.layer->setLineRoundLimit(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineRoundLimit {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getLineRoundLimit() ?: self.layer->getDefaultLineRoundLimit()];
+- (MGLStyleValue<NSNumber *> *)lineRoundLimit {
+ auto propertyValue = self.layer->getLineRoundLimit() ?: self.layer->getDefaultLineRoundLimit();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
#pragma mark - Accessing the Paint Attributes
-- (void)setLineOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineOpacity {
- self.layer->setLineOpacity(lineOpacity.mbgl_floatPropertyValue);
+- (void)setLineOpacity:(MGLStyleValue<NSNumber *> *)lineOpacity {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineOpacity);
+ self.layer->setLineOpacity(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineOpacity {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getLineOpacity() ?: self.layer->getDefaultLineOpacity()];
+- (MGLStyleValue<NSNumber *> *)lineOpacity {
+ auto propertyValue = self.layer->getLineOpacity() ?: self.layer->getDefaultLineOpacity();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setLineColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineColor {
- self.layer->setLineColor(lineColor.mbgl_colorPropertyValue);
+- (void)setLineColor:(MGLStyleValue<MGLColor *> *)lineColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(lineColor);
+ self.layer->setLineColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getLineColor() ?: self.layer->getDefaultLineColor()];
+- (MGLStyleValue<MGLColor *> *)lineColor {
+ auto propertyValue = self.layer->getLineColor() ?: self.layer->getDefaultLineColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setLineTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineTranslate {
- self.layer->setLineTranslate(lineTranslate.mbgl_offsetPropertyValue);
+- (void)setLineTranslate:(MGLStyleValue<NSValue *> *)lineTranslate {
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(lineTranslate);
+ self.layer->setLineTranslate(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineTranslate {
- return [MGLStyleAttribute mbgl_offsetWithPropertyValueOffset:self.layer->getLineTranslate() ?: self.layer->getDefaultLineTranslate()];
+- (MGLStyleValue<NSValue *> *)lineTranslate {
+ auto propertyValue = self.layer->getLineTranslate() ?: self.layer->getDefaultLineTranslate();
+ return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setLineTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineTranslateAnchor {
- MGLSetEnumProperty(lineTranslateAnchor, LineTranslateAnchor, TranslateAnchorType, MGLLineTranslateAnchor);
+- (void)setLineTranslateAnchor:(MGLStyleValue<NSValue *> *)lineTranslateAnchor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toPropertyValue(lineTranslateAnchor);
+ self.layer->setLineTranslateAnchor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineTranslateAnchor {
- MGLGetEnumProperty(LineTranslateAnchor, TranslateAnchorType, MGLLineTranslateAnchor);
+- (MGLStyleValue<NSValue *> *)lineTranslateAnchor {
+ auto propertyValue = self.layer->getLineTranslateAnchor() ?: self.layer->getDefaultLineTranslateAnchor();
+ return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setLineWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineWidth {
- self.layer->setLineWidth(lineWidth.mbgl_floatPropertyValue);
+- (void)setLineWidth:(MGLStyleValue<NSNumber *> *)lineWidth {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineWidth);
+ self.layer->setLineWidth(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineWidth {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getLineWidth() ?: self.layer->getDefaultLineWidth()];
+- (MGLStyleValue<NSNumber *> *)lineWidth {
+ auto propertyValue = self.layer->getLineWidth() ?: self.layer->getDefaultLineWidth();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setLineGapWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineGapWidth {
- self.layer->setLineGapWidth(lineGapWidth.mbgl_floatPropertyValue);
+- (void)setLineGapWidth:(MGLStyleValue<NSNumber *> *)lineGapWidth {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineGapWidth);
+ self.layer->setLineGapWidth(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineGapWidth {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getLineGapWidth() ?: self.layer->getDefaultLineGapWidth()];
+- (MGLStyleValue<NSNumber *> *)lineGapWidth {
+ auto propertyValue = self.layer->getLineGapWidth() ?: self.layer->getDefaultLineGapWidth();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setLineOffset:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineOffset {
- self.layer->setLineOffset(lineOffset.mbgl_floatPropertyValue);
+- (void)setLineOffset:(MGLStyleValue<NSNumber *> *)lineOffset {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineOffset);
+ self.layer->setLineOffset(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineOffset {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getLineOffset() ?: self.layer->getDefaultLineOffset()];
+- (MGLStyleValue<NSNumber *> *)lineOffset {
+ auto propertyValue = self.layer->getLineOffset() ?: self.layer->getDefaultLineOffset();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setLineBlur:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineBlur {
- self.layer->setLineBlur(lineBlur.mbgl_floatPropertyValue);
+- (void)setLineBlur:(MGLStyleValue<NSNumber *> *)lineBlur {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(lineBlur);
+ self.layer->setLineBlur(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineBlur {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getLineBlur() ?: self.layer->getDefaultLineBlur()];
+- (MGLStyleValue<NSNumber *> *)lineBlur {
+ auto propertyValue = self.layer->getLineBlur() ?: self.layer->getDefaultLineBlur();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setLineDasharray:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineDasharray {
- self.layer->setLineDasharray(lineDasharray.mbgl_numberArrayPropertyValue);
+- (void)setLineDasharray:(MGLStyleValue<NSArray<NSNumber *> *> *)lineDasharray {
+ auto mbglValue = MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toPropertyValue(lineDasharray);
+ self.layer->setLineDasharray(mbglValue);
}
-- (id <MGLStyleAttributeValue>)lineDasharray {
- return [MGLStyleAttribute mbgl_numberArrayWithPropertyValueNumberArray:self.layer->getLineDasharray() ?: self.layer->getDefaultLineDasharray()];
+- (MGLStyleValue<NSArray<NSNumber *> *> *)lineDasharray {
+ auto propertyValue = self.layer->getLineDasharray() ?: self.layer->getDefaultLineDasharray();
+ return MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toStyleValue(propertyValue);
}
-- (void)setLinePattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)linePattern {
- self.layer->setLinePattern(linePattern.mbgl_stringPropertyValue);
+- (void)setLinePattern:(MGLStyleValue<NSString *> *)linePattern {
+ auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(linePattern);
+ self.layer->setLinePattern(mbglValue);
}
-- (id <MGLStyleAttributeValue>)linePattern {
- return [MGLStyleAttribute mbgl_stringWithPropertyValueString:self.layer->getLinePattern() ?: self.layer->getDefaultLinePattern()];
+- (MGLStyleValue<NSString *> *)linePattern {
+ auto propertyValue = self.layer->getLinePattern() ?: self.layer->getDefaultLinePattern();
+ return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
@end
diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h
index 90af43c7a1..afae85001e 100644
--- a/platform/darwin/src/MGLRasterStyleLayer.h
+++ b/platform/darwin/src/MGLRasterStyleLayer.h
@@ -1,7 +1,7 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue.h"
#import "MGLForegroundStyleLayer.h"
NS_ASSUME_NONNULL_BEGIN
@@ -19,55 +19,55 @@ NS_ASSUME_NONNULL_BEGIN
/**
The opacity at which the image will be drawn.
- The default value of this property is 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 `1`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterOpacity;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterOpacity;
/**
Rotates hues around the color wheel.
This property is measured in degrees.
- The default value of this property is an `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 `0`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterHueRotate;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterHueRotate;
/**
Increase or reduce the brightness of the image. The value is the minimum brightness.
- The default value of this property is 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 `0`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterBrightnessMin;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterBrightnessMin;
/**
Increase or reduce the brightness of the image. The value is the maximum brightness.
- The default value of this property is an `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 `1`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterBrightnessMax;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterBrightnessMax;
/**
Increase or reduce the saturation of the image.
- The default value of this property is 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 `0`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterSaturation;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterSaturation;
/**
Increase or reduce the contrast of the image.
- The default value of this property is 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 `0`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterContrast;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterContrast;
/**
Fade duration when a new tile is added.
This property is measured in milliseconds.
- The default value of this property is an `NSNumber` object containing the float `300`. 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 `300`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterFadeDuration;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterFadeDuration;
@end
diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm
index 01d3bf2bca..f616e89518 100644
--- a/platform/darwin/src/MGLRasterStyleLayer.mm
+++ b/platform/darwin/src/MGLRasterStyleLayer.mm
@@ -4,7 +4,7 @@
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue_Private.h"
#import "MGLRasterStyleLayer.h"
#include <mbgl/style/layers/raster_layer.hpp>
@@ -27,60 +27,74 @@
#pragma mark - Accessing the Paint Attributes
-- (void)setRasterOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterOpacity {
- self.layer->setRasterOpacity(rasterOpacity.mbgl_floatPropertyValue);
+- (void)setRasterOpacity:(MGLStyleValue<NSNumber *> *)rasterOpacity {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterOpacity);
+ self.layer->setRasterOpacity(mbglValue);
}
-- (id <MGLStyleAttributeValue>)rasterOpacity {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getRasterOpacity() ?: self.layer->getDefaultRasterOpacity()];
+- (MGLStyleValue<NSNumber *> *)rasterOpacity {
+ auto propertyValue = self.layer->getRasterOpacity() ?: self.layer->getDefaultRasterOpacity();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setRasterHueRotate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterHueRotate {
- self.layer->setRasterHueRotate(rasterHueRotate.mbgl_floatPropertyValue);
+- (void)setRasterHueRotate:(MGLStyleValue<NSNumber *> *)rasterHueRotate {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterHueRotate);
+ self.layer->setRasterHueRotate(mbglValue);
}
-- (id <MGLStyleAttributeValue>)rasterHueRotate {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getRasterHueRotate() ?: self.layer->getDefaultRasterHueRotate()];
+- (MGLStyleValue<NSNumber *> *)rasterHueRotate {
+ auto propertyValue = self.layer->getRasterHueRotate() ?: self.layer->getDefaultRasterHueRotate();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setRasterBrightnessMin:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterBrightnessMin {
- self.layer->setRasterBrightnessMin(rasterBrightnessMin.mbgl_floatPropertyValue);
+- (void)setRasterBrightnessMin:(MGLStyleValue<NSNumber *> *)rasterBrightnessMin {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterBrightnessMin);
+ self.layer->setRasterBrightnessMin(mbglValue);
}
-- (id <MGLStyleAttributeValue>)rasterBrightnessMin {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getRasterBrightnessMin() ?: self.layer->getDefaultRasterBrightnessMin()];
+- (MGLStyleValue<NSNumber *> *)rasterBrightnessMin {
+ auto propertyValue = self.layer->getRasterBrightnessMin() ?: self.layer->getDefaultRasterBrightnessMin();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setRasterBrightnessMax:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterBrightnessMax {
- self.layer->setRasterBrightnessMax(rasterBrightnessMax.mbgl_floatPropertyValue);
+- (void)setRasterBrightnessMax:(MGLStyleValue<NSNumber *> *)rasterBrightnessMax {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterBrightnessMax);
+ self.layer->setRasterBrightnessMax(mbglValue);
}
-- (id <MGLStyleAttributeValue>)rasterBrightnessMax {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getRasterBrightnessMax() ?: self.layer->getDefaultRasterBrightnessMax()];
+- (MGLStyleValue<NSNumber *> *)rasterBrightnessMax {
+ auto propertyValue = self.layer->getRasterBrightnessMax() ?: self.layer->getDefaultRasterBrightnessMax();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setRasterSaturation:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterSaturation {
- self.layer->setRasterSaturation(rasterSaturation.mbgl_floatPropertyValue);
+- (void)setRasterSaturation:(MGLStyleValue<NSNumber *> *)rasterSaturation {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterSaturation);
+ self.layer->setRasterSaturation(mbglValue);
}
-- (id <MGLStyleAttributeValue>)rasterSaturation {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getRasterSaturation() ?: self.layer->getDefaultRasterSaturation()];
+- (MGLStyleValue<NSNumber *> *)rasterSaturation {
+ auto propertyValue = self.layer->getRasterSaturation() ?: self.layer->getDefaultRasterSaturation();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setRasterContrast:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterContrast {
- self.layer->setRasterContrast(rasterContrast.mbgl_floatPropertyValue);
+- (void)setRasterContrast:(MGLStyleValue<NSNumber *> *)rasterContrast {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterContrast);
+ self.layer->setRasterContrast(mbglValue);
}
-- (id <MGLStyleAttributeValue>)rasterContrast {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getRasterContrast() ?: self.layer->getDefaultRasterContrast()];
+- (MGLStyleValue<NSNumber *> *)rasterContrast {
+ auto propertyValue = self.layer->getRasterContrast() ?: self.layer->getDefaultRasterContrast();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setRasterFadeDuration:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterFadeDuration {
- self.layer->setRasterFadeDuration(rasterFadeDuration.mbgl_floatPropertyValue);
+- (void)setRasterFadeDuration:(MGLStyleValue<NSNumber *> *)rasterFadeDuration {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(rasterFadeDuration);
+ self.layer->setRasterFadeDuration(mbglValue);
}
-- (id <MGLStyleAttributeValue>)rasterFadeDuration {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getRasterFadeDuration() ?: self.layer->getDefaultRasterFadeDuration()];
+- (MGLStyleValue<NSNumber *> *)rasterFadeDuration {
+ auto propertyValue = self.layer->getRasterFadeDuration() ?: self.layer->getDefaultRasterFadeDuration();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
@end
diff --git a/platform/darwin/src/MGLStyleAttribute.h b/platform/darwin/src/MGLStyleAttribute.h
deleted file mode 100644
index 564f44ad00..0000000000
--- a/platform/darwin/src/MGLStyleAttribute.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue_Private.h"
-
-@interface MGLStyleAttribute : NSObject <MGLStyleAttributeValue>
-
-+ (id <MGLStyleAttributeValue>)mbgl_colorWithPropertyValueColor:(mbgl::style::PropertyValue<mbgl::Color>)property;
-
-+ (id <MGLStyleAttributeValue>)mbgl_numberWithPropertyValueNumber:(mbgl::style::PropertyValue<float>)property;
-
-+ (id <MGLStyleAttributeValue>)mbgl_boolWithPropertyValueBool:(mbgl::style::PropertyValue<bool>)property;
-
-+ (id <MGLStyleAttributeValue>)mbgl_stringWithPropertyValueString:(mbgl::style::PropertyValue<std::string>)property;
-
-+ (id <MGLStyleAttributeValue>)mbgl_offsetWithPropertyValueOffset:(mbgl::style::PropertyValue<std::array<float, 2>>)property;
-
-+ (id <MGLStyleAttributeValue>)mbgl_paddingWithPropertyValuePadding:(mbgl::style::PropertyValue<std::array<float, 4>>)property;
-
-+ (id <MGLStyleAttributeValue>)mbgl_stringArrayWithPropertyValueStringArray:(mbgl::style::PropertyValue<std::vector<std::string>>)property;
-
-+ (id <MGLStyleAttributeValue>)mbgl_numberArrayWithPropertyValueNumberArray:(mbgl::style::PropertyValue<std::vector<float>>)property;
-
-@end
diff --git a/platform/darwin/src/MGLStyleAttribute.mm b/platform/darwin/src/MGLStyleAttribute.mm
deleted file mode 100644
index 9e3c22914b..0000000000
--- a/platform/darwin/src/MGLStyleAttribute.mm
+++ /dev/null
@@ -1,112 +0,0 @@
-#import "MGLStyleAttribute.h"
-
-#import "MGLStyleAttributeValue_Private.h"
-#import "MGLStyleAttributeFunction_Private.h"
-#import "NSValue+MGLStyleAttributeAdditions_Private.h"
-
-@interface MGLStyleAttribute()
-@end
-
-@implementation MGLStyleAttribute
-
-+ (id<MGLStyleAttributeValue>)mbgl_colorWithPropertyValueColor:(mbgl::style::PropertyValue<mbgl::Color>)property
-{
- if (property.isConstant()) {
- return [MGLColor mbgl_colorWithColor:property.asConstant()];
- } else if (property.isFunction()) {
- return [MGLStyleAttributeFunction functionWithColorPropertyValue:property.asFunction()];
- } else {
- return nil;
- }
-}
-
-+ (id <MGLStyleAttributeValue>)mbgl_numberWithPropertyValueNumber:(mbgl::style::PropertyValue<float>)property
-{
- if (property.isConstant()) {
- return @(property.asConstant());
- } else if (property.isFunction()) {
- return [MGLStyleAttributeFunction functionWithNumberPropertyValue:property.asFunction()];
- } else {
- return nil;
- }
-}
-
-+ (id<MGLStyleAttributeValue>)mbgl_boolWithPropertyValueBool:(mbgl::style::PropertyValue<bool>)property
-{
- if (property.isConstant()) {
- return @(property.asConstant());
- } else if (property.isFunction()) {
- return [MGLStyleAttributeFunction functionWithBoolPropertyValue:property.asFunction()];
- } else {
- return nil;
- }
-}
-
-+ (id<MGLStyleAttributeValue>)mbgl_stringWithPropertyValueString:(mbgl::style::PropertyValue<std::string>)property
-{
- if (property.isConstant()) {
- return @(property.asConstant().c_str());
- } else if (property.isFunction()) {
- return [MGLStyleAttributeFunction functionWithStringPropertyValue:property.asFunction()];
- } else {
- return nil;
- }
-}
-
-+ (id<MGLStyleAttributeValue>)mbgl_offsetWithPropertyValueOffset:(mbgl::style::PropertyValue<std::array<float, 2> >)property
-{
- if (property.isConstant()) {
- auto offset = property.asConstant();
- return [NSValue mgl_valueWithOffsetArray:offset];
- } else if (property.isFunction()) {
- return [MGLStyleAttributeFunction functionWithOffsetPropertyValue:property.asFunction()];
- } else {
- return nil;
- }
-}
-
-+ (id<MGLStyleAttributeValue>)mbgl_paddingWithPropertyValuePadding:(mbgl::style::PropertyValue<std::array<float, 4> >)property
-{
- if (property.isConstant()) {
- auto padding = property.asConstant();
- return [NSValue mgl_valueWithPaddingArray:padding];
- } else if (property.isFunction()) {
- return [MGLStyleAttributeFunction functionWithPaddingPropertyValue:property.asFunction()];
- } else {
- return nil;
- }
-}
-
-+ (id<MGLStyleAttributeValue>)mbgl_stringArrayWithPropertyValueStringArray:(mbgl::style::PropertyValue<std::vector<std::string> >)property
-{
- if (property.isConstant()) {
- auto strings = property.asConstant();
- NSMutableArray *convertedStrings = [[NSMutableArray alloc] initWithCapacity:strings.size()];
- for (auto string : strings) {
- [convertedStrings addObject:@(string.c_str())];
- }
- return convertedStrings;
- } else if (property.isFunction()) {
- return [MGLStyleAttributeFunction functionWithStringArrayPropertyValue:property.asFunction()];
- } else {
- return nil;
- }
-}
-
-+ (id<MGLStyleAttributeValue>)mbgl_numberArrayWithPropertyValueNumberArray:(mbgl::style::PropertyValue<std::vector<float> >)property
-{
- if (property.isConstant()) {
- auto numbers = property.asConstant();
- NSMutableArray *convertedNumbers = [NSMutableArray arrayWithCapacity:numbers.size()];
- for (auto number : numbers) {
- [convertedNumbers addObject:@(number)];
- }
- return convertedNumbers;
- } else if (property.isFunction()) {
- return [MGLStyleAttributeFunction functionWithNumberArrayPropertyValue:property.asFunction()];
- } else {
- return nil;
- }
-}
-
-@end
diff --git a/platform/darwin/src/MGLStyleAttributeFunction.mm b/platform/darwin/src/MGLStyleAttributeFunction.mm
deleted file mode 100644
index 337e299127..0000000000
--- a/platform/darwin/src/MGLStyleAttributeFunction.mm
+++ /dev/null
@@ -1,309 +0,0 @@
-#import "MGLStyleAttributeFunction.h"
-
-#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue_Private.h"
-#import "MGLStyleAttributeFunction_Private.h"
-
-@implementation MGLStyleValue
-
-+ (instancetype)valueWithRawValue:(id)rawValue {
- return [MGLStyleConstantValue valueWithRawValue:rawValue];
-}
-
-+ (instancetype)valueWithBase:(CGFloat)base stops:(NSDictionary *)stops {
- return [MGLStyleFunction functionWithBase:base stops:stops];
-}
-
-+ (instancetype)valueWithStops:(NSDictionary *)stops {
- return [MGLStyleFunction functionWithStops:stops];
-}
-
-@end
-
-@implementation MGLStyleConstantValue
-
-+ (instancetype)valueWithRawValue:(id)rawValue {
- return [[self alloc] initWithRawValue:rawValue];
-}
-
-- (instancetype)initWithRawValue:(id)rawValue {
- if (self = [super init]) {
- _rawValue = rawValue;
- }
- return self;
-}
-
-@end
-
-@implementation MGLStyleFunction
-
-+ (instancetype)functionWithBase:(CGFloat)base stops:(NSDictionary *)stops {
- return [[self alloc] initWithBase:base stops:stops];
-}
-
-+ (instancetype)functionWithStops:(NSDictionary *)stops {
- return [[self alloc] initWithBase:1 stops:stops];
-}
-
-- (instancetype)init {
- if (self = [super init]) {
- _base = 1;
- }
- return self;
-}
-
-- (instancetype)initWithBase:(CGFloat)base stops:(NSDictionary *)stops {
- if (self = [self init]) {
- _base = base;
- _stops = stops;
- }
- return self;
-}
-
-@end
-
-
-
-
-
-@interface MGLStyleAttributeFunction() <MGLStyleAttributeValue_Private>
-@end
-
-@implementation MGLStyleAttributeFunction
-
-- (instancetype)init
-{
- if (self = [super init]) {
- _base = @1;
- }
- return self;
-}
-
-- (BOOL)isFunction
-{
- return YES;
-}
-
-- (mbgl::style::PropertyValue<mbgl::Color>)mbgl_colorPropertyValue
-{
- __block std::vector<std::pair<float, mbgl::Color>> stops;
- [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, MGLColor * _Nonnull color, BOOL * _Nonnull stop) {
- NSAssert([color isKindOfClass:[MGLColor class]], @"Stops should be colors");
- stops.emplace_back(zoomKey.floatValue, color.mbgl_color);
- }];
- return mbgl::style::Function<mbgl::Color>({{stops}}, _base.floatValue);
-}
-
-- (mbgl::style::PropertyValue<float>)mbgl_floatPropertyValue
-{
- __block std::vector<std::pair<float, float>> stops;
- [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, NSNumber * _Nonnull number, BOOL * _Nonnull stop) {
- NSAssert([number isKindOfClass:[NSNumber class]], @"Stops should be NSNumbers");
- stops.emplace_back(zoomKey.floatValue, number.floatValue);
- }];
- return mbgl::style::Function<float>({{stops}}, _base.floatValue);
-}
-
-- (mbgl::style::PropertyValue<bool>)mbgl_boolPropertyValue
-{
- __block std::vector<std::pair<float, bool>> stops;
- [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, NSNumber * _Nonnull number, BOOL * _Nonnull stop) {
- NSAssert([number isKindOfClass:[NSNumber class]], @"Stops should be NSNumbers");
- stops.emplace_back(zoomKey.floatValue, number.boolValue);
- }];
- return mbgl::style::Function<bool>({{stops}}, _base.floatValue);
-}
-
-- (mbgl::style::PropertyValue<std::string>)mbgl_stringPropertyValue
-{
- __block std::vector<std::pair<float, std::string>> stops;
- [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, NSString * _Nonnull string, BOOL * _Nonnull stop) {
- NSAssert([string isKindOfClass:[NSString class]], @"Stops should be strings");
- stops.emplace_back(zoomKey.floatValue, string.UTF8String);
- }];
- return mbgl::style::Function<std::string>({{stops}}, _base.floatValue);
-}
-
-- (mbgl::style::PropertyValue<std::vector<std::string> >)mbgl_stringArrayPropertyValue
-{
- __block std::vector<std::pair<float, std::vector<std::string>>> stops;
- [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, NSArray * _Nonnull strings, BOOL * _Nonnull stop) {
- NSAssert([strings isKindOfClass:[NSArray class]], @"Stops should be NSArray");
- std::vector<std::string>convertedStrings;
- for (NSString *string in strings) {
- convertedStrings.emplace_back(string.UTF8String);
- }
- stops.emplace_back(zoomKey.floatValue, convertedStrings);
- }];
- return mbgl::style::Function<std::vector<std::string>>({{stops}}, _base.floatValue);
-}
-
-- (mbgl::style::PropertyValue<std::vector<float> >)mbgl_numberArrayPropertyValue
-{
- __block std::vector<std::pair<float, std::vector<float>>> stops;
- [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, NSArray * _Nonnull numbers, BOOL * _Nonnull stop) {
- NSAssert([numbers isKindOfClass:[NSArray class]], @"Stops should be NSArray");
- std::vector<float>convertedNumbers;
- for (NSNumber *number in numbers) {
- convertedNumbers.emplace_back(number.floatValue);
- }
- stops.emplace_back(zoomKey.floatValue, convertedNumbers);
- }];
- return mbgl::style::Function<std::vector<float>>({{stops}}, _base.floatValue);
-}
-
-- (mbgl::style::PropertyValue<std::array<float, 4> >)mbgl_paddingPropertyValue
-{
- __block std::vector<std::pair<float, std::array<float, 4>>> stops;
- [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, NSValue * _Nonnull padding, BOOL * _Nonnull stop) {
- NSAssert([padding isKindOfClass:[NSValue class]], @"Stops should be NSValue");
- stops.emplace_back(zoomKey.floatValue, padding.mgl_paddingArrayValue);
- }];
- return mbgl::style::Function<std::array<float, 4>>({{stops}}, _base.floatValue);
-}
-
-- (mbgl::style::PropertyValue<std::array<float, 2> >)mbgl_offsetPropertyValue
-{
- __block std::vector<std::pair<float, std::array<float, 2>>> stops;
- [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, NSValue * _Nonnull offset, BOOL * _Nonnull stop) {
- NSAssert([offset isKindOfClass:[NSValue class]], @"Stops should be NSValue");
- stops.emplace_back(zoomKey.floatValue, offset.mgl_offsetArrayValue);
- }];
- return mbgl::style::Function<std::array<float, 2>>({{stops}}, _base.floatValue);
-}
-
-+ (instancetype)functionWithColorPropertyValue:(mbgl::style::Function<mbgl::Color>)property
-{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- auto stops = property.getStops();
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()];
- for (auto stop : stops) {
- convertedStops[@(stop.first)] = [MGLColor mbgl_colorWithColor:stop.second];
- }
- function.base = @(property.getBase());
- function.stops = convertedStops;
- return function;
-}
-
-+ (instancetype)functionWithNumberPropertyValue:(mbgl::style::Function<float>)property
-{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- auto stops = property.getStops();
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()];
- for (auto stop : stops) {
- convertedStops[@(stop.first)] = @(stop.second);
- }
- function.base = @(property.getBase());
- function.stops = convertedStops;
- return function;
-}
-
-+ (instancetype)functionWithBoolPropertyValue:(mbgl::style::Function<bool>)property
-{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- auto stops = property.getStops();
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()];
- for (auto stop : stops) {
- convertedStops[@(stop.first)] = @(stop.second);
- }
- function.base = @(property.getBase());
- function.stops = convertedStops;
- return function;
-}
-
-+ (instancetype)functionWithStringPropertyValue:(mbgl::style::Function<std::string>)property
-{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- auto stops = property.getStops();
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()];
- for (auto stop : stops) {
- convertedStops[@(stop.first)] = @(stop.second.c_str());
- }
- function.base = @(property.getBase());
- function.stops = convertedStops;
- return function;
-}
-
-+ (instancetype)functionWithOffsetPropertyValue:(mbgl::style::Function<std::array<float, 2> >)property
-{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- auto stops = property.getStops();
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()];
- for (auto stop : stops) {
- convertedStops[@(stop.first)] = [NSValue mgl_valueWithOffsetArray:stop.second];
- }
- function.base = @(property.getBase());
- function.stops = convertedStops;
- return function;
-}
-
-+ (instancetype)functionWithPaddingPropertyValue:(mbgl::style::Function<std::array<float, 4> >)property
-{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- auto stops = property.getStops();
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()];
- for (auto stop : stops) {
- convertedStops[@(stop.first)] = [NSValue mgl_valueWithPaddingArray:stop.second];
- }
- function.base = @(property.getBase());
- function.stops = convertedStops;
- return function;
-}
-
-+ (instancetype)functionWithStringArrayPropertyValue:(mbgl::style::Function<std::vector<std::string> >)property
-{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- auto stops = property.getStops();
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()];
- for (auto stop : stops) {
- auto strings = stop.second;
- NSMutableArray *convertedStrings = [NSMutableArray arrayWithCapacity:strings.size()];
- for (auto const& string: strings) {
- [convertedStrings addObject:@(string.c_str())];
- }
- convertedStops[@(stop.first)] = convertedStrings;
- }
- function.base = @(property.getBase());
- function.stops = convertedStops;
- return function;
-}
-
-+ (instancetype)functionWithNumberArrayPropertyValue:(mbgl::style::Function<std::vector<float> >)property
-{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- auto stops = property.getStops();
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()];
- for (auto stop : stops) {
- auto numbers = stop.second;
- NSMutableArray *convertedNumbers = [NSMutableArray arrayWithCapacity:numbers.size()];
- for (auto const& number: numbers) {
- [convertedNumbers addObject:@(number)];
- }
- convertedStops[@(stop.first)] = convertedNumbers;
- }
- function.base = @(property.getBase());
- function.stops = convertedStops;
- return function;
-}
-
-- (NSString *)description
-{
- return [NSString stringWithFormat:@"<%@: %p, base = %@; stops = %@>",
- NSStringFromClass([self class]), (void *)self,
- self.base,
- self.stops];
-}
-
-- (BOOL)isEqual:(MGLStyleAttributeFunction *)other
-{
- return ([other isKindOfClass:[self class]]
- && (other.base == self.base || [other.base isEqualToNumber:self.base])
- && [other.stops isEqualToDictionary:self.stops]);
-}
-
-- (NSUInteger)hash
-{
- return self.base.hash + self.stops.hash;
-}
-
-@end
diff --git a/platform/darwin/src/MGLStyleAttributeValue.h b/platform/darwin/src/MGLStyleAttributeValue.h
deleted file mode 100644
index 00829b0dca..0000000000
--- a/platform/darwin/src/MGLStyleAttributeValue.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#import <Foundation/Foundation.h>
-
-@protocol MGLStyleAttributeValue <NSObject>
-@optional
-@end
diff --git a/platform/darwin/src/MGLStyleAttributeValue_Private.h b/platform/darwin/src/MGLStyleAttributeValue_Private.h
deleted file mode 100644
index 4b8fd1cc01..0000000000
--- a/platform/darwin/src/MGLStyleAttributeValue_Private.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeFunction_Private.h"
-
-#include <array>
-
-@protocol MGLStyleAttributeValue_Private <NSObject>
-- (BOOL)isFunction;
-@optional
-
-// Convert darwin types to mbgl types
-- (mbgl::style::PropertyValue<mbgl::Color>)mbgl_colorPropertyValue;
-- (mbgl::style::PropertyValue<float>)mbgl_floatPropertyValue;
-- (mbgl::style::PropertyValue<bool>)mbgl_boolPropertyValue;
-- (mbgl::style::PropertyValue<std::string>)mbgl_stringPropertyValue;
-- (mbgl::style::PropertyValue<std::array<float, 2>>)mbgl_offsetPropertyValue;
-- (mbgl::style::PropertyValue<std::array<float, 4>>)mbgl_paddingPropertyValue;
-- (mbgl::style::PropertyValue<std::vector<std::string> >)mbgl_stringArrayPropertyValue;
-- (mbgl::style::PropertyValue<std::vector<float> >)mbgl_numberArrayPropertyValue;
-
-// Convert mbgl types to darwin types
-- (id <MGLStyleAttributeValue>)mbgl_colorPropertyValueWith:(mbgl::style::PropertyValue<mbgl::Color>)color;
-
-@end
diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs
index eb799f13be..b97d070b90 100644
--- a/platform/darwin/src/MGLStyleLayer.h.ejs
+++ b/platform/darwin/src/MGLStyleLayer.h.ejs
@@ -8,7 +8,7 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue.h"
#import "MGL<%-
(type === 'background' ? '' :
(type === 'raster' ? 'Foreground' :
@@ -92,7 +92,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(property.name) %>) {
<%- propertyReqs(property, layoutPropertiesByName, type) %>
<% } -%>
*/
-@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>;
+@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) MGLStyleValue<<%- propertyType(property, true) %>> *<%- camelizeWithLeadingLowercase(property.name) %>;
<% } -%>
<% } -%>
@@ -110,7 +110,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(property.name) %>) {
<%- propertyReqs(property, paintPropertiesByName, type) %>
<% } -%>
*/
-@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>;
+@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) MGLStyleValue<<%- propertyType(property, true) %>> *<%- camelizeWithLeadingLowercase(property.name) %>;
<% } -%>
<% } -%>
diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs
index 8d3bba9958..3678e9ec52 100644
--- a/platform/darwin/src/MGLStyleLayer.mm.ejs
+++ b/platform/darwin/src/MGLStyleLayer.mm.ejs
@@ -9,7 +9,7 @@
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue_Private.h"
#import "MGL<%- camelize(type) %>StyleLayer.h"
#include <mbgl/style/layers/<%- type %>_layer.hpp>
@@ -67,12 +67,14 @@
#pragma mark - Accessing the Layout Attributes
<% for (const property of layoutProperties) { -%>
-- (void)set<%- camelize(property.name) %>:(<%- propertyType(property, true, type) %>)<%- objCName(property) %> {
- <%- setterImplementation(property, type) %>
+- (void)set<%- camelize(property.name) %>:(MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
+ auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue(<%- objCName(property) %>);
+ self.layer->set<%- camelize(property.name) %>(mbglValue);
}
-- (<%- propertyType(property, false, type) %>)<%- objCName(property) %> {
- <%- getterImplementation(property, type) %>
+- (MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
+ auto propertyValue = self.layer->get<%- camelize(property.name) %>() ?: self.layer->getDefault<%- camelize(property.name) %>();
+ return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue);
}
<% } -%>
@@ -81,12 +83,14 @@
#pragma mark - Accessing the Paint Attributes
<% for (const property of paintProperties) { -%>
-- (void)set<%- camelize(property.name) %>:(<%- propertyType(property, true, type) %>)<%- objCName(property) %> {
- <%- setterImplementation(property, type) %>
+- (void)set<%- camelize(property.name) %>:(MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
+ auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue(<%- objCName(property) %>);
+ self.layer->set<%- camelize(property.name) %>(mbglValue);
}
-- (<%- propertyType(property, false, type) %>)<%- objCName(property) %> {
- <%- getterImplementation(property, type) %>
+- (MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
+ auto propertyValue = self.layer->get<%- camelize(property.name) %>() ?: self.layer->getDefault<%- camelize(property.name) %>();
+ return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue);
}
<% } -%>
diff --git a/platform/darwin/src/MGLStyleLayer_Private.h b/platform/darwin/src/MGLStyleLayer_Private.h
index a499775a52..5fa01856ea 100644
--- a/platform/darwin/src/MGLStyleLayer_Private.h
+++ b/platform/darwin/src/MGLStyleLayer_Private.h
@@ -1,23 +1,9 @@
#import <Foundation/Foundation.h>
-#include <mbgl/style/layer.hpp>
#import "MGLStyleLayer.h"
-#import "MGLStyleAttribute.h"
-
-#import "NSNumber+MGLStyleAttributeAdditions_Private.h"
-#import "NSArray+MGLStyleAttributeAdditions_Private.h"
-#import "NSString+MGLStyleAttributeAdditions_Private.h"
-#import "NSValue+MGLStyleAttributeAdditions_Private.h"
-#import "MGLStyleAttributeFunction_Private.h"
-#import "MGLStyleAttributeValue_Private.h"
+#import "MGLStyleValue_Private.h"
-#if TARGET_OS_IPHONE
- #import "UIColor+MGLAdditions.h"
- #import "UIColor+MGLStyleAttributeAdditions_Private.h"
-#else
- #import "NSColor+MGLAdditions.h"
- #import "NSColor+MGLStyleAttributeAdditions_Private.h"
-#endif
+#include <mbgl/style/layer.hpp>
@interface MGLStyleLayer (Private)
diff --git a/platform/darwin/src/MGLStyleAttributeFunction.h b/platform/darwin/src/MGLStyleValue.h
index a676a8a715..1f19a5e028 100644
--- a/platform/darwin/src/MGLStyleAttributeFunction.h
+++ b/platform/darwin/src/MGLStyleValue.h
@@ -1,18 +1,5 @@
#import <Foundation/Foundation.h>
-
-#import "MGLTypes.h"
-#import "MGLStyleAttributeValue.h"
-
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface MGLStyleAttributeFunction : NSObject <MGLStyleAttributeValue>
-
-@property (nonatomic, copy) NS_DICTIONARY_OF(NSNumber *, id) *stops;
-
-@property (nonatomic, copy, nullable) NSNumber *base;
-
-@end
+#import <CoreGraphics/CoreGraphics.h>
@interface MGLStyleValue<T> : NSObject
@@ -43,5 +30,3 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSDictionary<NSNumber *, MGLStyleValue<T> *> *stops;
@end
-
-NS_ASSUME_NONNULL_END
diff --git a/platform/darwin/src/MGLStyleValue.mm b/platform/darwin/src/MGLStyleValue.mm
new file mode 100644
index 0000000000..f8d5fd3a5d
--- /dev/null
+++ b/platform/darwin/src/MGLStyleValue.mm
@@ -0,0 +1,71 @@
+#import "MGLStyleValue_Private.h"
+
+@implementation MGLStyleValue
+
++ (instancetype)valueWithRawValue:(id)rawValue {
+ return [MGLStyleConstantValue valueWithRawValue:rawValue];
+}
+
++ (instancetype)valueWithBase:(CGFloat)base stops:(NSDictionary *)stops {
+ return [MGLStyleFunction functionWithBase:base stops:stops];
+}
+
++ (instancetype)valueWithStops:(NSDictionary *)stops {
+ return [MGLStyleFunction functionWithStops:stops];
+}
+
+@end
+
+@implementation MGLStyleConstantValue
+
++ (instancetype)valueWithRawValue:(id)rawValue {
+ return [[self alloc] initWithRawValue:rawValue];
+}
+
+- (instancetype)initWithRawValue:(id)rawValue {
+ if (self = [super init]) {
+ _rawValue = rawValue;
+ }
+ return self;
+}
+
+- (NSString *)description {
+ return [self.rawValue description];
+}
+
+- (BOOL)isEqual:(MGLStyleConstantValue *)other {
+ return [other isKindOfClass:[self class]] && [other.rawValue isEqual:self.rawValue];
+}
+
+- (NSUInteger)hash {
+ return [self.rawValue hash];
+}
+
+@end
+
+@implementation MGLStyleFunction
+
++ (instancetype)functionWithBase:(CGFloat)base stops:(NSDictionary *)stops {
+ return [[self alloc] initWithBase:base stops:stops];
+}
+
++ (instancetype)functionWithStops:(NSDictionary *)stops {
+ return [[self alloc] initWithBase:1 stops:stops];
+}
+
+- (instancetype)init {
+ if (self = [super init]) {
+ _base = 1;
+ }
+ return self;
+}
+
+- (instancetype)initWithBase:(CGFloat)base stops:(NSDictionary *)stops {
+ if (self = [self init]) {
+ _base = base;
+ _stops = stops;
+ }
+ return self;
+}
+
+@end
diff --git a/platform/darwin/src/MGLStyleAttributeFunction_Private.h b/platform/darwin/src/MGLStyleValue_Private.h
index 94a610c62a..e48db02bf1 100644
--- a/platform/darwin/src/MGLStyleAttributeFunction_Private.h
+++ b/platform/darwin/src/MGLStyleValue_Private.h
@@ -1,6 +1,9 @@
-#import "MGLStyleAttributeFunction.h"
+#import <Foundation/Foundation.h>
-#import "NSValue+MGLStyleAttributeAdditions_Private.h"
+#import "MGLStyleValue.h"
+
+#import "NSValue+MGLStyleAttributeAdditions.h"
+#import "MGLTypes.h"
#if TARGET_OS_IPHONE
#import "UIColor+MGLAdditions.h"
@@ -8,82 +11,9 @@
#import "NSColor+MGLAdditions.h"
#endif
-#include <mbgl/util/color.hpp>
-#include <mbgl/util/variant.hpp>
-#include <mbgl/style/function.hpp>
-#include <mbgl/style/property_value.hpp>
-
#include <array>
-#define MGLSetEnumProperty(name, Name, MBGLType, ObjCType) \
- if (name.isFunction) { \
- NSAssert([name isKindOfClass:[MGLStyleAttributeFunction class]], @"" #name @" should be a function"); \
- \
- __block std::vector<std::pair<float, mbgl::style::MBGLType>> stops; \
- [[(MGLStyleAttributeFunction *)name stops] enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull key, NSValue * _Nonnull obj, BOOL * _Nonnull stop) { \
- NSAssert([obj isKindOfClass:[NSValue class]], @"Stops in " #name @" should be NSValues"); \
- ObjCType value; \
- [obj getValue:&value]; \
- stops.emplace_back(key.floatValue, static_cast<mbgl::style::MBGLType>(value)); \
- }]; \
- auto function = mbgl::style::Function<mbgl::style::MBGLType> { \
- stops, \
- [(MGLStyleAttributeFunction *)name base].floatValue, \
- }; \
- self.layer->set##Name(function); \
- } else if (name) { \
- NSAssert([name isKindOfClass:[NSValue class]], @"" #name @"should be an NSValue"); \
- ObjCType value; \
- [(NSValue *)name getValue:&value]; \
- self.layer->set##Name({ static_cast<mbgl::style::MBGLType>(value) }); \
- } else { \
- self.layer->set##Name({}); \
- }
-
-#define MGLGetEnumProperty(Name, MBGLType, ObjCType) \
- const char *type = @encode(ObjCType); \
- mbgl::style::PropertyValue<mbgl::style::MBGLType> property = self.layer->get##Name() ?: self.layer->getDefault##Name(); \
- if (property.isConstant()) { \
- ObjCType value = static_cast<ObjCType>(property.asConstant()); \
- return [NSValue value:&value withObjCType:type]; \
- } else if (property.isFunction()) { \
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init]; \
- auto stops = property.asFunction().getStops(); \
- NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()]; \
- for (auto stop : stops) { \
- ObjCType value = static_cast<ObjCType>(stop.second); \
- convertedStops[@(stop.first)] = [NSValue value:&value withObjCType:type]; \
- } \
- function.base = @(property.asFunction().getBase()); \
- function.stops = convertedStops; \
- return function; \
- } else { \
- return nil; \
- }
-
-@interface MGLStyleAttributeFunction(Private)
-
-+ (instancetype)functionWithColorPropertyValue:(mbgl::style::Function<mbgl::Color>)property;
-
-+ (instancetype)functionWithNumberPropertyValue:(mbgl::style::Function<float>)property;
-
-+ (instancetype)functionWithBoolPropertyValue:(mbgl::style::Function<bool>)property;
-
-+ (instancetype)functionWithStringPropertyValue:(mbgl::style::Function<std::string>)property;
-
-+ (instancetype)functionWithOffsetPropertyValue:(mbgl::style::Function<std::array<float, 2>>)property;
-
-+ (instancetype)functionWithPaddingPropertyValue:(mbgl::style::Function<std::array<float, 4>>)property;
-
-+ (instancetype)functionWithStringArrayPropertyValue:(mbgl::style::Function<std::vector<std::string>>)property;
-
-+ (instancetype)functionWithNumberArrayPropertyValue:(mbgl::style::Function<std::vector<float>>)property;
-
-+ (instancetype)functionWithEnumProperyValue:(mbgl::style::Function<bool>)property type:(const char *)type;
-
-@end
-
-template <typename MBGLType, typename ObjCType>
+template <typename MBGLType, typename ObjCType, typename MBGLElement = MBGLType>
class MGLStyleValueTransformer {
public:
@@ -167,7 +97,7 @@ private:
return [MGLColor mbgl_colorWithColor:mbglStopValue];
}
- ObjCType toMGLRawStyleValue(const std::vector<MBGLType> &mbglStopValue) {
+ ObjCType toMGLRawStyleValue(const std::vector<MBGLElement> &mbglStopValue) {
NSMutableArray *array = [NSMutableArray arrayWithCapacity:mbglStopValue.size()];
for (const auto &mbglElement: mbglStopValue) {
[array addObject:toMGLRawStyleValue(mbglElement)];
@@ -182,7 +112,7 @@ private:
}
void getMBGLValue(NSNumber *rawValue, float &mbglValue) {
- mbglValue = !!rawValue.boolValue;
+ mbglValue = rawValue.floatValue;
}
void getMBGLValue(NSString *rawValue, std::string &mbglValue) {
@@ -209,10 +139,10 @@ private:
mbglValue = rawValue.mbgl_color;
}
- void getMBGLValue(ObjCType rawValue, std::vector<MBGLType> &mbglValue) {
+ void getMBGLValue(ObjCType rawValue, std::vector<MBGLElement> &mbglValue) {
mbglValue.reserve(rawValue.count);
for (id obj in rawValue) {
- MBGLType mbglElement;
+ MBGLElement mbglElement;
getMBGLValue(obj, mbglElement);
mbglValue.push_back(mbglElement);
}
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h
index f8a130d54e..3fcecedca3 100644
--- a/platform/darwin/src/MGLSymbolStyleLayer.h
+++ b/platform/darwin/src/MGLSymbolStyleLayer.h
@@ -1,7 +1,7 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue.h"
#import "MGLVectorStyleLayer.h"
NS_ASSUME_NONNULL_BEGIN
@@ -235,372 +235,372 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
/**
Label placement relative to its geometry.
- The default value of this property is an `NSValue` object containing `MGLSymbolPlacementPoint`. 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 `MGLSymbolPlacementPoint`. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> symbolPlacement;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *symbolPlacement;
/**
Distance between two symbol anchors.
This property is measured in points.
- The default value of this property is an `NSNumber` object containing the float `250`. 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 `symbolPlacement` is set to an `NSValue` object containing `MGLSymbolPlacementLine`. 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) id <MGLStyleAttributeValue> symbolSpacing;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolSpacing;
/**
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.
- The default value of this property is an `NSNumber` object containing `NO`. 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.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> symbolAvoidEdges;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolAvoidEdges;
/**
If true, the icon will be visible even if it collides with other previously drawn symbols.
- The default value of this property is an `NSNumber` object containing `NO`. 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 `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconAllowOverlap;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconAllowOverlap;
/**
If true, other symbols can be visible even if they collide with the icon.
- The default value of this property is an `NSNumber` object containing `NO`. 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 `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconIgnorePlacement;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconIgnorePlacement;
/**
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
- The default value of this property is an `NSNumber` object containing `NO`. 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 `iconImage` is non-`nil`, and `textField` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconOptional;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOptional;
/**
In combination with `symbolPlacement`, determines the rotation behavior of icons.
- The default value of this property is an `NSValue` object containing `MGLIconRotationAlignmentAuto`. 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 `MGLIconRotationAlignmentAuto`. 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) id <MGLStyleAttributeValue> iconRotationAlignment;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconRotationAlignment;
/**
Scale factor for icon. 1 is original size, 3 triples the size.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> iconSize;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconSize;
/**
Scales the icon to fit around the associated text.
- The default value of this property is an `NSValue` object containing `MGLIconTextFitNone`. 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 `MGLIconTextFitNone`. 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 `textField` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTextFit;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTextFit;
/**
Size of the additional area added to dimensions determined by `iconTextFit`, in clockwise order: top, right, bottom, left.
This property is measured in points.
- The default value of this property is an `NSValue` object containing `NSEdgeInsetsZero` or `UIEdgeInsetsZero`. 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 `NSEdgeInsetsZero` or `UIEdgeInsetsZero`. 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 `textField` is non-`nil`, and `iconTextFit` is set to an `NSValue` object containing `MGLIconTextFitBoth`, `MGLIconTextFitWidth`, or `MGLIconTextFitHeight`. Otherwise, it is ignored.
+ This property is only applied to the style if `iconImage` is non-`nil`, and `textField` is non-`nil`, and `iconTextFit` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLIconTextFitBoth`, `MGLIconTextFitWidth`, or `MGLIconTextFitHeight`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTextFitPadding;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTextFitPadding;
/**
A string with {tokens} replaced, referencing the data property to pull from.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconImage;
+@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *iconImage;
/**
Rotates the icon clockwise.
This property is measured in degrees.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> iconRotate;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconRotate;
/**
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 `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 `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) id <MGLStyleAttributeValue> iconPadding;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconPadding;
/**
If true, the icon may be flipped to prevent it from being rendered upside-down.
- The default value of this property is an `NSNumber` object containing `NO`. 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 `iconImage` is non-`nil`, and `iconRotationAlignment` is set to an `NSValue` object containing `MGLIconRotationAlignmentMap`, and `symbolPlacement` is set to an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
+ 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) id <MGLStyleAttributeValue> iconKeepUpright;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconKeepUpright;
/**
Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up.
- The default value of this property is 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.
+ 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) id <MGLStyleAttributeValue> iconOffset;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconOffset;
/**
Orientation of text when map is pitched.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> textPitchAlignment;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textPitchAlignment;
/**
In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
- The default value of this property is an `NSValue` object containing `MGLTextRotationAlignmentAuto`. 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 `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) id <MGLStyleAttributeValue> textRotationAlignment;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textRotationAlignment;
/**
Value to use for a text label. Feature properties are specified using tokens like {field_name}.
- The default value of this property is the string ``. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing the string ``. Set this property to `nil` to reset it to the default value.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textField;
+@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *textField;
/**
Font stack to use for displaying text.
- The default value of this property is the array `Open Sans Regular`, `Arial Unicode MS Regular`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing the array `Open Sans Regular`, `Arial Unicode MS Regular`. 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) id <MGLStyleAttributeValue> textFont;
+@property (nonatomic, null_resettable) MGLStyleValue<NSArray<NSString *> *> *textFont;
/**
Font size.
This property is measured in points.
- The default value of this property is 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 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) id <MGLStyleAttributeValue> textSize;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textSize;
/**
The maximum line width for text wrapping.
This property is measured in ems.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> textMaxWidth;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textMaxWidth;
/**
Text leading value for multi-line text.
This property is measured in ems.
- The default value of this property is 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 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) id <MGLStyleAttributeValue> textLineHeight;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLineHeight;
/**
Text tracking amount.
This property is measured in ems.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> textLetterSpacing;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLetterSpacing;
/**
Text justification options.
- The default value of this property is an `NSValue` object containing `MGLTextJustifyCenter`. 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) id <MGLStyleAttributeValue> textJustify;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textJustify;
/**
Part of the text placed closest to the anchor.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> textAnchor;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textAnchor;
/**
Maximum angle change between adjacent characters.
This property is measured in degrees.
- The default value of this property is an `NSNumber` object containing the float `45`. 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 `45`. 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 `symbolPlacement` is set to an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
+ This property is only applied to the style if `textField` is non-`nil`, and `symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue` object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textMaxAngle;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textMaxAngle;
/**
Rotates the text clockwise.
This property is measured in degrees.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> textRotate;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textRotate;
/**
Size of the additional area around the text bounding box used for detecting symbol collisions.
This property is measured in points.
- The default value of this property is an `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 `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) id <MGLStyleAttributeValue> textPadding;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textPadding;
/**
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
- The default value of this property is an `NSNumber` object containing `YES`. 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`, and `textRotationAlignment` is set to an `NSValue` object containing `MGLTextRotationAlignmentMap`, and `symbolPlacement` is set to an `NSValue` object containing `MGLSymbolPlacementLine`. 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) id <MGLStyleAttributeValue> textKeepUpright;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textKeepUpright;
/**
Specifies how to capitalize text, similar to the CSS `text-transform` property.
- The default value of this property is an `NSValue` object containing `MGLTextTransformNone`. 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 `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) id <MGLStyleAttributeValue> textTransform;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTransform;
/**
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.
This property is measured in ems.
- The default value of this property is an `NSValue` object containing a `CGVector` struct set to 0 ems from the left and 0 ems from the top. 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 a `CGVector` struct set to 0 ems from the left and 0 ems from the top. 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) id <MGLStyleAttributeValue> textOffset;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textOffset;
/**
If true, the text will be visible even if it collides with other previously drawn symbols.
- The default value of this property is an `NSNumber` object containing `NO`. 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) id <MGLStyleAttributeValue> textAllowOverlap;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textAllowOverlap;
/**
If true, other symbols can be visible even if they collide with the text.
- The default value of this property is an `NSNumber` object containing `NO`. 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) id <MGLStyleAttributeValue> textIgnorePlacement;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textIgnorePlacement;
/**
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
- The default value of this property is an `NSNumber` object containing `NO`. 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`, and `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textOptional;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOptional;
#pragma mark - Accessing the Paint Attributes
/**
The opacity at which the icon will be drawn.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> iconOpacity;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOpacity;
#if TARGET_OS_IPHONE
/**
The color of the icon. This can only be used with sdf icons.
- The default value of this property is `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `UIColor.blackColor`. 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) id <MGLStyleAttributeValue> iconColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *iconColor;
#else
/**
The color of the icon. This can only be used with sdf icons.
- The default value of this property is `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `NSColor.blackColor`. 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) id <MGLStyleAttributeValue> iconColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *iconColor;
#endif
#if TARGET_OS_IPHONE
/**
The color of the icon's halo. Icon halos can only be used with SDF icons.
- The default value of this property is `UIColor.clearColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `UIColor.clearColor`. 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) id <MGLStyleAttributeValue> iconHaloColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *iconHaloColor;
#else
/**
The color of the icon's halo. Icon halos can only be used with SDF icons.
- The default value of this property is `NSColor.clearColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `NSColor.clearColor`. 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) id <MGLStyleAttributeValue> iconHaloColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *iconHaloColor;
#endif
/**
@@ -608,90 +608,90 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
This property is measured in points.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> iconHaloWidth;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloWidth;
/**
Fade out the halo towards the outside.
This property is measured in points.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> iconHaloBlur;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloBlur;
/**
Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
This property is measured in points.
- The default value of this property is an `NSValue` object containing a `CGVector` struct set to 0 points from the left and 0 points from the top. 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 a `CGVector` struct set to 0 points from the left and 0 points 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) id <MGLStyleAttributeValue> iconTranslate;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTranslate;
/**
Controls the translation reference point.
- The default value of this property is an `NSValue` object containing `MGLIconTranslateAnchorMap`. 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 `MGLIconTranslateAnchorMap`. 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 `iconTranslate` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTranslateAnchor;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTranslateAnchor;
/**
The opacity at which the text will be drawn.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> textOpacity;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOpacity;
#if TARGET_OS_IPHONE
/**
The color with which the text will be drawn.
- The default value of this property is `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `UIColor.blackColor`. 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) id <MGLStyleAttributeValue> textColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *textColor;
#else
/**
The color with which the text will be drawn.
- The default value of this property is `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `NSColor.blackColor`. 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) id <MGLStyleAttributeValue> textColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *textColor;
#endif
#if TARGET_OS_IPHONE
/**
The color of the text's halo, which helps it stand out from backgrounds.
- The default value of this property is `UIColor.clearColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `UIColor.clearColor`. 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) id <MGLStyleAttributeValue> textHaloColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *textHaloColor;
#else
/**
The color of the text's halo, which helps it stand out from backgrounds.
- The default value of this property is `NSColor.clearColor`. Set this property to `nil` to reset it to the default value.
+ The default value of this property is an `MGLStyleValue` object containing `NSColor.clearColor`. 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) id <MGLStyleAttributeValue> textHaloColor;
+@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *textHaloColor;
#endif
/**
@@ -699,42 +699,42 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslateAnchor) {
This property is measured in points.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> textHaloWidth;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloWidth;
/**
The halo's fadeout distance towards the outside.
This property is measured in points.
- The default value of this property is 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 `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) id <MGLStyleAttributeValue> textHaloBlur;
+@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloBlur;
/**
Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
This property is measured in points.
- The default value of this property is an `NSValue` object containing a `CGVector` struct set to 0 points from the left and 0 points from the top. 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 a `CGVector` struct set to 0 points from the left and 0 points from the top. 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) id <MGLStyleAttributeValue> textTranslate;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTranslate;
/**
Controls the translation reference point.
- The default value of this property is an `NSValue` object containing `MGLTextTranslateAnchorMap`. 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 `MGLTextTranslateAnchorMap`. 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 `textTranslate` is non-`nil`. Otherwise, it is ignored.
*/
-@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textTranslateAnchor;
+@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTranslateAnchor;
@end
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm
index 01ac10f66f..a4c56fe297 100644
--- a/platform/darwin/src/MGLSymbolStyleLayer.mm
+++ b/platform/darwin/src/MGLSymbolStyleLayer.mm
@@ -4,7 +4,7 @@
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue_Private.h"
#import "MGLSymbolStyleLayer.h"
#include <mbgl/style/layers/symbol_layer.hpp>
@@ -48,390 +48,486 @@
#pragma mark - Accessing the Layout Attributes
-- (void)setSymbolPlacement:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)symbolPlacement {
- MGLSetEnumProperty(symbolPlacement, SymbolPlacement, SymbolPlacementType, MGLSymbolPlacement);
+- (void)setSymbolPlacement:(MGLStyleValue<NSValue *> *)symbolPlacement {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *>().toPropertyValue(symbolPlacement);
+ self.layer->setSymbolPlacement(mbglValue);
}
-- (id <MGLStyleAttributeValue>)symbolPlacement {
- MGLGetEnumProperty(SymbolPlacement, SymbolPlacementType, MGLSymbolPlacement);
+- (MGLStyleValue<NSValue *> *)symbolPlacement {
+ auto propertyValue = self.layer->getSymbolPlacement() ?: self.layer->getDefaultSymbolPlacement();
+ return MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setSymbolSpacing:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)symbolSpacing {
- self.layer->setSymbolSpacing(symbolSpacing.mbgl_floatPropertyValue);
+- (void)setSymbolSpacing:(MGLStyleValue<NSNumber *> *)symbolSpacing {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(symbolSpacing);
+ self.layer->setSymbolSpacing(mbglValue);
}
-- (id <MGLStyleAttributeValue>)symbolSpacing {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getSymbolSpacing() ?: self.layer->getDefaultSymbolSpacing()];
+- (MGLStyleValue<NSNumber *> *)symbolSpacing {
+ auto propertyValue = self.layer->getSymbolSpacing() ?: self.layer->getDefaultSymbolSpacing();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setSymbolAvoidEdges:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)symbolAvoidEdges {
- self.layer->setSymbolAvoidEdges(symbolAvoidEdges.mbgl_boolPropertyValue);
+- (void)setSymbolAvoidEdges:(MGLStyleValue<NSNumber *> *)symbolAvoidEdges {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(symbolAvoidEdges);
+ self.layer->setSymbolAvoidEdges(mbglValue);
}
-- (id <MGLStyleAttributeValue>)symbolAvoidEdges {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getSymbolAvoidEdges() ?: self.layer->getDefaultSymbolAvoidEdges()];
+- (MGLStyleValue<NSNumber *> *)symbolAvoidEdges {
+ auto propertyValue = self.layer->getSymbolAvoidEdges() ?: self.layer->getDefaultSymbolAvoidEdges();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconAllowOverlap:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconAllowOverlap {
- self.layer->setIconAllowOverlap(iconAllowOverlap.mbgl_boolPropertyValue);
+- (void)setIconAllowOverlap:(MGLStyleValue<NSNumber *> *)iconAllowOverlap {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(iconAllowOverlap);
+ self.layer->setIconAllowOverlap(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconAllowOverlap {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getIconAllowOverlap() ?: self.layer->getDefaultIconAllowOverlap()];
+- (MGLStyleValue<NSNumber *> *)iconAllowOverlap {
+ auto propertyValue = self.layer->getIconAllowOverlap() ?: self.layer->getDefaultIconAllowOverlap();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconIgnorePlacement:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconIgnorePlacement {
- self.layer->setIconIgnorePlacement(iconIgnorePlacement.mbgl_boolPropertyValue);
+- (void)setIconIgnorePlacement:(MGLStyleValue<NSNumber *> *)iconIgnorePlacement {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(iconIgnorePlacement);
+ self.layer->setIconIgnorePlacement(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconIgnorePlacement {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getIconIgnorePlacement() ?: self.layer->getDefaultIconIgnorePlacement()];
+- (MGLStyleValue<NSNumber *> *)iconIgnorePlacement {
+ auto propertyValue = self.layer->getIconIgnorePlacement() ?: self.layer->getDefaultIconIgnorePlacement();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconOptional:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconOptional {
- self.layer->setIconOptional(iconOptional.mbgl_boolPropertyValue);
+- (void)setIconOptional:(MGLStyleValue<NSNumber *> *)iconOptional {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(iconOptional);
+ self.layer->setIconOptional(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconOptional {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getIconOptional() ?: self.layer->getDefaultIconOptional()];
+- (MGLStyleValue<NSNumber *> *)iconOptional {
+ auto propertyValue = self.layer->getIconOptional() ?: self.layer->getDefaultIconOptional();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconRotationAlignment:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconRotationAlignment {
- MGLSetEnumProperty(iconRotationAlignment, IconRotationAlignment, AlignmentType, MGLIconRotationAlignment);
+- (void)setIconRotationAlignment:(MGLStyleValue<NSValue *> *)iconRotationAlignment {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *>().toPropertyValue(iconRotationAlignment);
+ self.layer->setIconRotationAlignment(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconRotationAlignment {
- MGLGetEnumProperty(IconRotationAlignment, AlignmentType, MGLIconRotationAlignment);
+- (MGLStyleValue<NSValue *> *)iconRotationAlignment {
+ auto propertyValue = self.layer->getIconRotationAlignment() ?: self.layer->getDefaultIconRotationAlignment();
+ return MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setIconSize:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconSize {
- self.layer->setIconSize(iconSize.mbgl_floatPropertyValue);
+- (void)setIconSize:(MGLStyleValue<NSNumber *> *)iconSize {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconSize);
+ self.layer->setIconSize(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconSize {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getIconSize() ?: self.layer->getDefaultIconSize()];
+- (MGLStyleValue<NSNumber *> *)iconSize {
+ auto propertyValue = self.layer->getIconSize() ?: self.layer->getDefaultIconSize();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconTextFit:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconTextFit {
- MGLSetEnumProperty(iconTextFit, IconTextFit, IconTextFitType, MGLIconTextFit);
+- (void)setIconTextFit:(MGLStyleValue<NSValue *> *)iconTextFit {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::IconTextFitType, NSValue *>().toPropertyValue(iconTextFit);
+ self.layer->setIconTextFit(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconTextFit {
- MGLGetEnumProperty(IconTextFit, IconTextFitType, MGLIconTextFit);
+- (MGLStyleValue<NSValue *> *)iconTextFit {
+ auto propertyValue = self.layer->getIconTextFit() ?: self.layer->getDefaultIconTextFit();
+ return MGLStyleValueTransformer<mbgl::style::IconTextFitType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setIconTextFitPadding:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconTextFitPadding {
- self.layer->setIconTextFitPadding(iconTextFitPadding.mbgl_paddingPropertyValue);
+- (void)setIconTextFitPadding:(MGLStyleValue<NSValue *> *)iconTextFitPadding {
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 4>, NSValue *>().toPropertyValue(iconTextFitPadding);
+ self.layer->setIconTextFitPadding(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconTextFitPadding {
- return [MGLStyleAttribute mbgl_paddingWithPropertyValuePadding:self.layer->getIconTextFitPadding() ?: self.layer->getDefaultIconTextFitPadding()];
+- (MGLStyleValue<NSValue *> *)iconTextFitPadding {
+ auto propertyValue = self.layer->getIconTextFitPadding() ?: self.layer->getDefaultIconTextFitPadding();
+ return MGLStyleValueTransformer<std::array<float, 4>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setIconImage:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconImage {
- self.layer->setIconImage(iconImage.mbgl_stringPropertyValue);
+- (void)setIconImage:(MGLStyleValue<NSString *> *)iconImage {
+ auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(iconImage);
+ self.layer->setIconImage(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconImage {
- return [MGLStyleAttribute mbgl_stringWithPropertyValueString:self.layer->getIconImage() ?: self.layer->getDefaultIconImage()];
+- (MGLStyleValue<NSString *> *)iconImage {
+ auto propertyValue = self.layer->getIconImage() ?: self.layer->getDefaultIconImage();
+ return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
-- (void)setIconRotate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconRotate {
- self.layer->setIconRotate(iconRotate.mbgl_floatPropertyValue);
+- (void)setIconRotate:(MGLStyleValue<NSNumber *> *)iconRotate {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconRotate);
+ self.layer->setIconRotate(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconRotate {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getIconRotate() ?: self.layer->getDefaultIconRotate()];
+- (MGLStyleValue<NSNumber *> *)iconRotate {
+ auto propertyValue = self.layer->getIconRotate() ?: self.layer->getDefaultIconRotate();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconPadding:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconPadding {
- self.layer->setIconPadding(iconPadding.mbgl_floatPropertyValue);
+- (void)setIconPadding:(MGLStyleValue<NSNumber *> *)iconPadding {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconPadding);
+ self.layer->setIconPadding(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconPadding {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getIconPadding() ?: self.layer->getDefaultIconPadding()];
+- (MGLStyleValue<NSNumber *> *)iconPadding {
+ auto propertyValue = self.layer->getIconPadding() ?: self.layer->getDefaultIconPadding();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconKeepUpright:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconKeepUpright {
- self.layer->setIconKeepUpright(iconKeepUpright.mbgl_boolPropertyValue);
+- (void)setIconKeepUpright:(MGLStyleValue<NSNumber *> *)iconKeepUpright {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(iconKeepUpright);
+ self.layer->setIconKeepUpright(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconKeepUpright {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getIconKeepUpright() ?: self.layer->getDefaultIconKeepUpright()];
+- (MGLStyleValue<NSNumber *> *)iconKeepUpright {
+ auto propertyValue = self.layer->getIconKeepUpright() ?: self.layer->getDefaultIconKeepUpright();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconOffset:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconOffset {
- self.layer->setIconOffset(iconOffset.mbgl_offsetPropertyValue);
+- (void)setIconOffset:(MGLStyleValue<NSValue *> *)iconOffset {
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(iconOffset);
+ self.layer->setIconOffset(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconOffset {
- return [MGLStyleAttribute mbgl_offsetWithPropertyValueOffset:self.layer->getIconOffset() ?: self.layer->getDefaultIconOffset()];
+- (MGLStyleValue<NSValue *> *)iconOffset {
+ auto propertyValue = self.layer->getIconOffset() ?: self.layer->getDefaultIconOffset();
+ return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextPitchAlignment:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textPitchAlignment {
- MGLSetEnumProperty(textPitchAlignment, TextPitchAlignment, AlignmentType, MGLTextPitchAlignment);
+- (void)setTextPitchAlignment:(MGLStyleValue<NSValue *> *)textPitchAlignment {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *>().toPropertyValue(textPitchAlignment);
+ self.layer->setTextPitchAlignment(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textPitchAlignment {
- MGLGetEnumProperty(TextPitchAlignment, AlignmentType, MGLTextPitchAlignment);
+- (MGLStyleValue<NSValue *> *)textPitchAlignment {
+ auto propertyValue = self.layer->getTextPitchAlignment() ?: self.layer->getDefaultTextPitchAlignment();
+ return MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextRotationAlignment:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textRotationAlignment {
- MGLSetEnumProperty(textRotationAlignment, TextRotationAlignment, AlignmentType, MGLTextRotationAlignment);
+- (void)setTextRotationAlignment:(MGLStyleValue<NSValue *> *)textRotationAlignment {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *>().toPropertyValue(textRotationAlignment);
+ self.layer->setTextRotationAlignment(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textRotationAlignment {
- MGLGetEnumProperty(TextRotationAlignment, AlignmentType, MGLTextRotationAlignment);
+- (MGLStyleValue<NSValue *> *)textRotationAlignment {
+ auto propertyValue = self.layer->getTextRotationAlignment() ?: self.layer->getDefaultTextRotationAlignment();
+ return MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextField:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textField {
- self.layer->setTextField(textField.mbgl_stringPropertyValue);
+- (void)setTextField:(MGLStyleValue<NSString *> *)textField {
+ auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue(textField);
+ self.layer->setTextField(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textField {
- return [MGLStyleAttribute mbgl_stringWithPropertyValueString:self.layer->getTextField() ?: self.layer->getDefaultTextField()];
+- (MGLStyleValue<NSString *> *)textField {
+ auto propertyValue = self.layer->getTextField() ?: self.layer->getDefaultTextField();
+ return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
-- (void)setTextFont:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textFont {
- self.layer->setTextFont(textFont.mbgl_stringArrayPropertyValue);
+- (void)setTextFont:(MGLStyleValue<NSArray<NSString *> *> *)textFont {
+ auto mbglValue = MGLStyleValueTransformer<std::vector<std::string>, NSArray<NSString *> *, std::string>().toPropertyValue(textFont);
+ self.layer->setTextFont(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textFont {
- return [MGLStyleAttribute mbgl_stringArrayWithPropertyValueStringArray:self.layer->getTextFont() ?: self.layer->getDefaultTextFont()];
+- (MGLStyleValue<NSArray<NSString *> *> *)textFont {
+ auto propertyValue = self.layer->getTextFont() ?: self.layer->getDefaultTextFont();
+ return MGLStyleValueTransformer<std::vector<std::string>, NSArray<NSString *> *, std::string>().toStyleValue(propertyValue);
}
-- (void)setTextSize:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textSize {
- self.layer->setTextSize(textSize.mbgl_floatPropertyValue);
+- (void)setTextSize:(MGLStyleValue<NSNumber *> *)textSize {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textSize);
+ self.layer->setTextSize(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textSize {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextSize() ?: self.layer->getDefaultTextSize()];
+- (MGLStyleValue<NSNumber *> *)textSize {
+ auto propertyValue = self.layer->getTextSize() ?: self.layer->getDefaultTextSize();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextMaxWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textMaxWidth {
- self.layer->setTextMaxWidth(textMaxWidth.mbgl_floatPropertyValue);
+- (void)setTextMaxWidth:(MGLStyleValue<NSNumber *> *)textMaxWidth {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textMaxWidth);
+ self.layer->setTextMaxWidth(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textMaxWidth {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextMaxWidth() ?: self.layer->getDefaultTextMaxWidth()];
+- (MGLStyleValue<NSNumber *> *)textMaxWidth {
+ auto propertyValue = self.layer->getTextMaxWidth() ?: self.layer->getDefaultTextMaxWidth();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextLineHeight:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textLineHeight {
- self.layer->setTextLineHeight(textLineHeight.mbgl_floatPropertyValue);
+- (void)setTextLineHeight:(MGLStyleValue<NSNumber *> *)textLineHeight {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textLineHeight);
+ self.layer->setTextLineHeight(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textLineHeight {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextLineHeight() ?: self.layer->getDefaultTextLineHeight()];
+- (MGLStyleValue<NSNumber *> *)textLineHeight {
+ auto propertyValue = self.layer->getTextLineHeight() ?: self.layer->getDefaultTextLineHeight();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextLetterSpacing:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textLetterSpacing {
- self.layer->setTextLetterSpacing(textLetterSpacing.mbgl_floatPropertyValue);
+- (void)setTextLetterSpacing:(MGLStyleValue<NSNumber *> *)textLetterSpacing {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textLetterSpacing);
+ self.layer->setTextLetterSpacing(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textLetterSpacing {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextLetterSpacing() ?: self.layer->getDefaultTextLetterSpacing()];
+- (MGLStyleValue<NSNumber *> *)textLetterSpacing {
+ auto propertyValue = self.layer->getTextLetterSpacing() ?: self.layer->getDefaultTextLetterSpacing();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextJustify:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textJustify {
- MGLSetEnumProperty(textJustify, TextJustify, TextJustifyType, MGLTextJustify);
+- (void)setTextJustify:(MGLStyleValue<NSValue *> *)textJustify {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *>().toPropertyValue(textJustify);
+ self.layer->setTextJustify(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textJustify {
- MGLGetEnumProperty(TextJustify, TextJustifyType, MGLTextJustify);
+- (MGLStyleValue<NSValue *> *)textJustify {
+ auto propertyValue = self.layer->getTextJustify() ?: self.layer->getDefaultTextJustify();
+ return MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textAnchor {
- MGLSetEnumProperty(textAnchor, TextAnchor, TextAnchorType, MGLTextAnchor);
+- (void)setTextAnchor:(MGLStyleValue<NSValue *> *)textAnchor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextAnchorType, NSValue *>().toPropertyValue(textAnchor);
+ self.layer->setTextAnchor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textAnchor {
- MGLGetEnumProperty(TextAnchor, TextAnchorType, MGLTextAnchor);
+- (MGLStyleValue<NSValue *> *)textAnchor {
+ auto propertyValue = self.layer->getTextAnchor() ?: self.layer->getDefaultTextAnchor();
+ return MGLStyleValueTransformer<mbgl::style::TextAnchorType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextMaxAngle:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textMaxAngle {
- self.layer->setTextMaxAngle(textMaxAngle.mbgl_floatPropertyValue);
+- (void)setTextMaxAngle:(MGLStyleValue<NSNumber *> *)textMaxAngle {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textMaxAngle);
+ self.layer->setTextMaxAngle(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textMaxAngle {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextMaxAngle() ?: self.layer->getDefaultTextMaxAngle()];
+- (MGLStyleValue<NSNumber *> *)textMaxAngle {
+ auto propertyValue = self.layer->getTextMaxAngle() ?: self.layer->getDefaultTextMaxAngle();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextRotate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textRotate {
- self.layer->setTextRotate(textRotate.mbgl_floatPropertyValue);
+- (void)setTextRotate:(MGLStyleValue<NSNumber *> *)textRotate {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textRotate);
+ self.layer->setTextRotate(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textRotate {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextRotate() ?: self.layer->getDefaultTextRotate()];
+- (MGLStyleValue<NSNumber *> *)textRotate {
+ auto propertyValue = self.layer->getTextRotate() ?: self.layer->getDefaultTextRotate();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextPadding:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textPadding {
- self.layer->setTextPadding(textPadding.mbgl_floatPropertyValue);
+- (void)setTextPadding:(MGLStyleValue<NSNumber *> *)textPadding {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textPadding);
+ self.layer->setTextPadding(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textPadding {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextPadding() ?: self.layer->getDefaultTextPadding()];
+- (MGLStyleValue<NSNumber *> *)textPadding {
+ auto propertyValue = self.layer->getTextPadding() ?: self.layer->getDefaultTextPadding();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextKeepUpright:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textKeepUpright {
- self.layer->setTextKeepUpright(textKeepUpright.mbgl_boolPropertyValue);
+- (void)setTextKeepUpright:(MGLStyleValue<NSNumber *> *)textKeepUpright {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textKeepUpright);
+ self.layer->setTextKeepUpright(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textKeepUpright {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getTextKeepUpright() ?: self.layer->getDefaultTextKeepUpright()];
+- (MGLStyleValue<NSNumber *> *)textKeepUpright {
+ auto propertyValue = self.layer->getTextKeepUpright() ?: self.layer->getDefaultTextKeepUpright();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextTransform:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textTransform {
- MGLSetEnumProperty(textTransform, TextTransform, TextTransformType, MGLTextTransform);
+- (void)setTextTransform:(MGLStyleValue<NSValue *> *)textTransform {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextTransformType, NSValue *>().toPropertyValue(textTransform);
+ self.layer->setTextTransform(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textTransform {
- MGLGetEnumProperty(TextTransform, TextTransformType, MGLTextTransform);
+- (MGLStyleValue<NSValue *> *)textTransform {
+ auto propertyValue = self.layer->getTextTransform() ?: self.layer->getDefaultTextTransform();
+ return MGLStyleValueTransformer<mbgl::style::TextTransformType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextOffset:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textOffset {
- self.layer->setTextOffset(textOffset.mbgl_offsetPropertyValue);
+- (void)setTextOffset:(MGLStyleValue<NSValue *> *)textOffset {
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(textOffset);
+ self.layer->setTextOffset(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textOffset {
- return [MGLStyleAttribute mbgl_offsetWithPropertyValueOffset:self.layer->getTextOffset() ?: self.layer->getDefaultTextOffset()];
+- (MGLStyleValue<NSValue *> *)textOffset {
+ auto propertyValue = self.layer->getTextOffset() ?: self.layer->getDefaultTextOffset();
+ return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextAllowOverlap:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textAllowOverlap {
- self.layer->setTextAllowOverlap(textAllowOverlap.mbgl_boolPropertyValue);
+- (void)setTextAllowOverlap:(MGLStyleValue<NSNumber *> *)textAllowOverlap {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textAllowOverlap);
+ self.layer->setTextAllowOverlap(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textAllowOverlap {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getTextAllowOverlap() ?: self.layer->getDefaultTextAllowOverlap()];
+- (MGLStyleValue<NSNumber *> *)textAllowOverlap {
+ auto propertyValue = self.layer->getTextAllowOverlap() ?: self.layer->getDefaultTextAllowOverlap();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextIgnorePlacement:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textIgnorePlacement {
- self.layer->setTextIgnorePlacement(textIgnorePlacement.mbgl_boolPropertyValue);
+- (void)setTextIgnorePlacement:(MGLStyleValue<NSNumber *> *)textIgnorePlacement {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textIgnorePlacement);
+ self.layer->setTextIgnorePlacement(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textIgnorePlacement {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getTextIgnorePlacement() ?: self.layer->getDefaultTextIgnorePlacement()];
+- (MGLStyleValue<NSNumber *> *)textIgnorePlacement {
+ auto propertyValue = self.layer->getTextIgnorePlacement() ?: self.layer->getDefaultTextIgnorePlacement();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextOptional:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textOptional {
- self.layer->setTextOptional(textOptional.mbgl_boolPropertyValue);
+- (void)setTextOptional:(MGLStyleValue<NSNumber *> *)textOptional {
+ auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue(textOptional);
+ self.layer->setTextOptional(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textOptional {
- return [MGLStyleAttribute mbgl_boolWithPropertyValueBool:self.layer->getTextOptional() ?: self.layer->getDefaultTextOptional()];
+- (MGLStyleValue<NSNumber *> *)textOptional {
+ auto propertyValue = self.layer->getTextOptional() ?: self.layer->getDefaultTextOptional();
+ return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
#pragma mark - Accessing the Paint Attributes
-- (void)setIconOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconOpacity {
- self.layer->setIconOpacity(iconOpacity.mbgl_floatPropertyValue);
+- (void)setIconOpacity:(MGLStyleValue<NSNumber *> *)iconOpacity {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconOpacity);
+ self.layer->setIconOpacity(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconOpacity {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getIconOpacity() ?: self.layer->getDefaultIconOpacity()];
+- (MGLStyleValue<NSNumber *> *)iconOpacity {
+ auto propertyValue = self.layer->getIconOpacity() ?: self.layer->getDefaultIconOpacity();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconColor {
- self.layer->setIconColor(iconColor.mbgl_colorPropertyValue);
+- (void)setIconColor:(MGLStyleValue<MGLColor *> *)iconColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(iconColor);
+ self.layer->setIconColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getIconColor() ?: self.layer->getDefaultIconColor()];
+- (MGLStyleValue<MGLColor *> *)iconColor {
+ auto propertyValue = self.layer->getIconColor() ?: self.layer->getDefaultIconColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setIconHaloColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconHaloColor {
- self.layer->setIconHaloColor(iconHaloColor.mbgl_colorPropertyValue);
+- (void)setIconHaloColor:(MGLStyleValue<MGLColor *> *)iconHaloColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(iconHaloColor);
+ self.layer->setIconHaloColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconHaloColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getIconHaloColor() ?: self.layer->getDefaultIconHaloColor()];
+- (MGLStyleValue<MGLColor *> *)iconHaloColor {
+ auto propertyValue = self.layer->getIconHaloColor() ?: self.layer->getDefaultIconHaloColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setIconHaloWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconHaloWidth {
- self.layer->setIconHaloWidth(iconHaloWidth.mbgl_floatPropertyValue);
+- (void)setIconHaloWidth:(MGLStyleValue<NSNumber *> *)iconHaloWidth {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconHaloWidth);
+ self.layer->setIconHaloWidth(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconHaloWidth {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getIconHaloWidth() ?: self.layer->getDefaultIconHaloWidth()];
+- (MGLStyleValue<NSNumber *> *)iconHaloWidth {
+ auto propertyValue = self.layer->getIconHaloWidth() ?: self.layer->getDefaultIconHaloWidth();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconHaloBlur:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconHaloBlur {
- self.layer->setIconHaloBlur(iconHaloBlur.mbgl_floatPropertyValue);
+- (void)setIconHaloBlur:(MGLStyleValue<NSNumber *> *)iconHaloBlur {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(iconHaloBlur);
+ self.layer->setIconHaloBlur(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconHaloBlur {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getIconHaloBlur() ?: self.layer->getDefaultIconHaloBlur()];
+- (MGLStyleValue<NSNumber *> *)iconHaloBlur {
+ auto propertyValue = self.layer->getIconHaloBlur() ?: self.layer->getDefaultIconHaloBlur();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setIconTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconTranslate {
- self.layer->setIconTranslate(iconTranslate.mbgl_offsetPropertyValue);
+- (void)setIconTranslate:(MGLStyleValue<NSValue *> *)iconTranslate {
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(iconTranslate);
+ self.layer->setIconTranslate(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconTranslate {
- return [MGLStyleAttribute mbgl_offsetWithPropertyValueOffset:self.layer->getIconTranslate() ?: self.layer->getDefaultIconTranslate()];
+- (MGLStyleValue<NSValue *> *)iconTranslate {
+ auto propertyValue = self.layer->getIconTranslate() ?: self.layer->getDefaultIconTranslate();
+ return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setIconTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconTranslateAnchor {
- MGLSetEnumProperty(iconTranslateAnchor, IconTranslateAnchor, TranslateAnchorType, MGLIconTranslateAnchor);
+- (void)setIconTranslateAnchor:(MGLStyleValue<NSValue *> *)iconTranslateAnchor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toPropertyValue(iconTranslateAnchor);
+ self.layer->setIconTranslateAnchor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)iconTranslateAnchor {
- MGLGetEnumProperty(IconTranslateAnchor, TranslateAnchorType, MGLIconTranslateAnchor);
+- (MGLStyleValue<NSValue *> *)iconTranslateAnchor {
+ auto propertyValue = self.layer->getIconTranslateAnchor() ?: self.layer->getDefaultIconTranslateAnchor();
+ return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textOpacity {
- self.layer->setTextOpacity(textOpacity.mbgl_floatPropertyValue);
+- (void)setTextOpacity:(MGLStyleValue<NSNumber *> *)textOpacity {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textOpacity);
+ self.layer->setTextOpacity(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textOpacity {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextOpacity() ?: self.layer->getDefaultTextOpacity()];
+- (MGLStyleValue<NSNumber *> *)textOpacity {
+ auto propertyValue = self.layer->getTextOpacity() ?: self.layer->getDefaultTextOpacity();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textColor {
- self.layer->setTextColor(textColor.mbgl_colorPropertyValue);
+- (void)setTextColor:(MGLStyleValue<MGLColor *> *)textColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(textColor);
+ self.layer->setTextColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getTextColor() ?: self.layer->getDefaultTextColor()];
+- (MGLStyleValue<MGLColor *> *)textColor {
+ auto propertyValue = self.layer->getTextColor() ?: self.layer->getDefaultTextColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setTextHaloColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textHaloColor {
- self.layer->setTextHaloColor(textHaloColor.mbgl_colorPropertyValue);
+- (void)setTextHaloColor:(MGLStyleValue<MGLColor *> *)textHaloColor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue(textHaloColor);
+ self.layer->setTextHaloColor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textHaloColor {
- return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getTextHaloColor() ?: self.layer->getDefaultTextHaloColor()];
+- (MGLStyleValue<MGLColor *> *)textHaloColor {
+ auto propertyValue = self.layer->getTextHaloColor() ?: self.layer->getDefaultTextHaloColor();
+ return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue(propertyValue);
}
-- (void)setTextHaloWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textHaloWidth {
- self.layer->setTextHaloWidth(textHaloWidth.mbgl_floatPropertyValue);
+- (void)setTextHaloWidth:(MGLStyleValue<NSNumber *> *)textHaloWidth {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textHaloWidth);
+ self.layer->setTextHaloWidth(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textHaloWidth {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextHaloWidth() ?: self.layer->getDefaultTextHaloWidth()];
+- (MGLStyleValue<NSNumber *> *)textHaloWidth {
+ auto propertyValue = self.layer->getTextHaloWidth() ?: self.layer->getDefaultTextHaloWidth();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextHaloBlur:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textHaloBlur {
- self.layer->setTextHaloBlur(textHaloBlur.mbgl_floatPropertyValue);
+- (void)setTextHaloBlur:(MGLStyleValue<NSNumber *> *)textHaloBlur {
+ auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue(textHaloBlur);
+ self.layer->setTextHaloBlur(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textHaloBlur {
- return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getTextHaloBlur() ?: self.layer->getDefaultTextHaloBlur()];
+- (MGLStyleValue<NSNumber *> *)textHaloBlur {
+ auto propertyValue = self.layer->getTextHaloBlur() ?: self.layer->getDefaultTextHaloBlur();
+ return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
-- (void)setTextTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textTranslate {
- self.layer->setTextTranslate(textTranslate.mbgl_offsetPropertyValue);
+- (void)setTextTranslate:(MGLStyleValue<NSValue *> *)textTranslate {
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(textTranslate);
+ self.layer->setTextTranslate(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textTranslate {
- return [MGLStyleAttribute mbgl_offsetWithPropertyValueOffset:self.layer->getTextTranslate() ?: self.layer->getDefaultTextTranslate()];
+- (MGLStyleValue<NSValue *> *)textTranslate {
+ auto propertyValue = self.layer->getTextTranslate() ?: self.layer->getDefaultTextTranslate();
+ return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setTextTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textTranslateAnchor {
- MGLSetEnumProperty(textTranslateAnchor, TextTranslateAnchor, TranslateAnchorType, MGLTextTranslateAnchor);
+- (void)setTextTranslateAnchor:(MGLStyleValue<NSValue *> *)textTranslateAnchor {
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toPropertyValue(textTranslateAnchor);
+ self.layer->setTextTranslateAnchor(mbglValue);
}
-- (id <MGLStyleAttributeValue>)textTranslateAnchor {
- MGLGetEnumProperty(TextTranslateAnchor, TranslateAnchorType, MGLTextTranslateAnchor);
+- (MGLStyleValue<NSValue *> *)textTranslateAnchor {
+ auto propertyValue = self.layer->getTextTranslateAnchor() ?: self.layer->getDefaultTextTranslateAnchor();
+ return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *>().toStyleValue(propertyValue);
}
@end
diff --git a/platform/darwin/src/NSArray+MGLStyleAttributeAdditions.h b/platform/darwin/src/NSArray+MGLStyleAttributeAdditions.h
deleted file mode 100644
index fa5193acf0..0000000000
--- a/platform/darwin/src/NSArray+MGLStyleAttributeAdditions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-
-@interface NSArray (MGLStyleAttributeAdditions) <MGLStyleAttributeValue>
-
-@end
diff --git a/platform/darwin/src/NSArray+MGLStyleAttributeAdditions.mm b/platform/darwin/src/NSArray+MGLStyleAttributeAdditions.mm
deleted file mode 100644
index fb60cf0f72..0000000000
--- a/platform/darwin/src/NSArray+MGLStyleAttributeAdditions.mm
+++ /dev/null
@@ -1,36 +0,0 @@
-#import "NSArray+MGLStyleAttributeAdditions.h"
-
-#import "NSArray+MGLStyleAttributeAdditions_Private.h"
-#import "MGLStyleAttributeValue_Private.h"
-
-#include <array>
-
-@interface NSArray(Private) <MGLStyleAttributeValue_Private>
-@end
-
-@implementation NSArray (MGLStyleAttributeAdditions)
-
-- (mbgl::style::PropertyValue<std::vector<std::string> >)mbgl_stringArrayPropertyValue
-{
- std::vector<std::string>fonts;
-
- for (NSString *font in self) {
- fonts.emplace_back(font.UTF8String);
- }
-
- return {{fonts}};
-}
-
-- (mbgl::style::PropertyValue<std::vector<float> >)mbgl_numberArrayPropertyValue
-{
- std::vector<float>values;
-
- for (NSNumber *n in self) {
- values.emplace_back(n.floatValue);
- }
-
- return {{values}};
-}
-
-
-@end
diff --git a/platform/darwin/src/NSArray+MGLStyleAttributeAdditions_Private.h b/platform/darwin/src/NSArray+MGLStyleAttributeAdditions_Private.h
deleted file mode 100644
index 1be02c01d2..0000000000
--- a/platform/darwin/src/NSArray+MGLStyleAttributeAdditions_Private.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-
-#include <mbgl/style/property_value.hpp>
-
-@interface NSArray (MGLStyleAttributeAdditions_Private) <MGLStyleAttributeValue>
-
-@end
diff --git a/platform/darwin/src/NSColor+MGLStyleAttributeAdditions.h b/platform/darwin/src/NSColor+MGLStyleAttributeAdditions.h
deleted file mode 100644
index 5a4f7af006..0000000000
--- a/platform/darwin/src/NSColor+MGLStyleAttributeAdditions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#import <Cocoa/Cocoa.h>
-
-#import "MGLStyleAttributeValue.h"
-
-@interface NSColor (MGLStyleAttributeAdditions) <MGLStyleAttributeValue>
-
-@end
diff --git a/platform/darwin/src/NSColor+MGLStyleAttributeAdditions.m b/platform/darwin/src/NSColor+MGLStyleAttributeAdditions.m
deleted file mode 100644
index ac330343c8..0000000000
--- a/platform/darwin/src/NSColor+MGLStyleAttributeAdditions.m
+++ /dev/null
@@ -1,5 +0,0 @@
-#import "NSColor+MGLStyleAttributeAdditions.h"
-
-@implementation NSColor (MGLStyleAttributeAdditions)
-
-@end
diff --git a/platform/darwin/src/NSColor+MGLStyleAttributeAdditions_Private.h b/platform/darwin/src/NSColor+MGLStyleAttributeAdditions_Private.h
deleted file mode 100644
index 9a714cbd83..0000000000
--- a/platform/darwin/src/NSColor+MGLStyleAttributeAdditions_Private.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-
-#include <mbgl/style/property_value.hpp>
-
-@interface NSColor (MGLStyleAttributeAdditions_Private) <MGLStyleAttributeValue>
-
-@end
diff --git a/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.h b/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.h
deleted file mode 100644
index 162b5e94f5..0000000000
--- a/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-
-@interface NSNumber (MGLStyleAttributeAdditions) <MGLStyleAttributeValue>
-
-@end
diff --git a/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm b/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm
deleted file mode 100644
index 163105d2fa..0000000000
--- a/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm
+++ /dev/null
@@ -1,22 +0,0 @@
-#import "NSNumber+MGLStyleAttributeAdditions.h"
-
-#include <mbgl/style/property_value.hpp>
-
-@implementation NSNumber (MGLStyleAttributeAdditions)
-
-- (NSNumber *)numberValue
-{
- return self;
-}
-
-- (mbgl::style::PropertyValue<bool>)mbgl_boolPropertyValue
-{
- return mbgl::style::PropertyValue<bool> { !!self.boolValue };
-}
-
-- (mbgl::style::PropertyValue<float>)mbgl_floatPropertyValue
-{
- return mbgl::style::PropertyValue<float> { self.floatValue };
-}
-
-@end
diff --git a/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions_Private.h b/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions_Private.h
deleted file mode 100644
index 73e40bb3ad..0000000000
--- a/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions_Private.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-
-#include <mbgl/style/property_value.hpp>
-
-@interface NSNumber (MGLStyleAttributeAdditions_Private) <MGLStyleAttributeValue>
-
-- (mbgl::style::PropertyValue<bool>)mbgl_booleanPropertyValue;
-
-- (mbgl::style::PropertyValue<float>)mbgl_numberPropertyValue;
-
-@end
diff --git a/platform/darwin/src/NSString+MGLStyleAttributeAdditions.h b/platform/darwin/src/NSString+MGLStyleAttributeAdditions.h
deleted file mode 100644
index 2126335922..0000000000
--- a/platform/darwin/src/NSString+MGLStyleAttributeAdditions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-
-@interface NSString (MGLStyleAttributeAdditions) <MGLStyleAttributeValue>
-
-@end
diff --git a/platform/darwin/src/NSString+MGLStyleAttributeAdditions.mm b/platform/darwin/src/NSString+MGLStyleAttributeAdditions.mm
deleted file mode 100644
index ff88f5501a..0000000000
--- a/platform/darwin/src/NSString+MGLStyleAttributeAdditions.mm
+++ /dev/null
@@ -1,17 +0,0 @@
-#import "NSString+MGLStyleAttributeAdditions.h"
-
-#import "NSString+MGLStyleAttributeAdditions_Private.h"
-
-@implementation NSString (MGLStyleAttributeAdditions)
-
-- (BOOL)isFunction
-{
- return NO;
-}
-
-- (mbgl::style::PropertyValue<std::string>)mbgl_stringPropertyValue
-{
- return mbgl::style::PropertyValue<std::string> {{ self.UTF8String }};
-}
-
-@end
diff --git a/platform/darwin/src/NSString+MGLStyleAttributeAdditions_Private.h b/platform/darwin/src/NSString+MGLStyleAttributeAdditions_Private.h
deleted file mode 100644
index 8e401e2996..0000000000
--- a/platform/darwin/src/NSString+MGLStyleAttributeAdditions_Private.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-
-#include <mbgl/style/property_value.hpp>
-
-@interface NSString (MGLStyleAttributeAdditions_Private) <MGLStyleAttributeValue>
-
-- (mbgl::style::PropertyValue<std::string>)mbgl_stringPropertyValue;
-
-@end
diff --git a/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h b/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h
index 0ee0c78f87..60c1ee4075 100644
--- a/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h
+++ b/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h
@@ -1,7 +1,13 @@
#import <Foundation/Foundation.h>
-#import "MGLStyleAttributeValue.h"
+#include <array>
-@interface NSValue (MGLStyleAttributeValue) <MGLStyleAttributeValue>
+@interface NSValue (MGLStyleAttributeAdditions)
+
++ (instancetype)mgl_valueWithOffsetArray:(std::array<float, 2>)offsetArray;
++ (instancetype)mgl_valueWithPaddingArray:(std::array<float, 4>)paddingArray;
+
+- (std::array<float, 2>)mgl_offsetArrayValue;
+- (std::array<float, 4>)mgl_paddingArrayValue;
@end
diff --git a/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm b/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm
index 83266e7db5..59afe559d7 100644
--- a/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm
+++ b/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm
@@ -1,9 +1,5 @@
#import "NSValue+MGLStyleAttributeAdditions.h"
-#import "NSValue+MGLStyleAttributeAdditions_Private.h"
-
-#include <array>
-
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#define MGLEdgeInsets UIEdgeInsets
@@ -32,16 +28,6 @@
return [NSValue value:&insets withObjCType:@encode(MGLEdgeInsets)];
}
-- (BOOL)isFunction
-{
- return NO;
-}
-
-- (mbgl::style::PropertyValue<std::array<float, 2>>)mbgl_offsetPropertyValue
-{
- return { self.mgl_offsetArrayValue };
-}
-
- (std::array<float, 2>)mgl_offsetArrayValue
{
NSAssert(strcmp(self.objCType, @encode(CGVector)) == 0, @"Value does not represent a CGVector");
@@ -53,11 +39,6 @@
};
}
-- (mbgl::style::PropertyValue<std::array<float, 4>>)mbgl_paddingPropertyValue
-{
- return { self.mgl_paddingArrayValue };
-}
-
- (std::array<float, 4>)mgl_paddingArrayValue
{
NSAssert(strcmp(self.objCType, @encode(MGLEdgeInsets)) == 0, @"Value does not represent an NSEdgeInsets/UIEdgeInsets");
diff --git a/platform/darwin/src/NSValue+MGLStyleAttributeAdditions_Private.h b/platform/darwin/src/NSValue+MGLStyleAttributeAdditions_Private.h
deleted file mode 100644
index 28a9b10908..0000000000
--- a/platform/darwin/src/NSValue+MGLStyleAttributeAdditions_Private.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#import <Foundation/Foundation.h>
-
-#import "MGLStyleAttributeValue.h"
-
-#include <mbgl/style/property_value.hpp>
-
-@interface NSValue (MGLStyleAttributeAdditions_Private) <MGLStyleAttributeValue>
-
-+ (instancetype)mgl_valueWithOffsetArray:(std::array<float, 2>)offsetArray;
-+ (instancetype)mgl_valueWithPaddingArray:(std::array<float, 4>)paddingArray;
-
-- (std::array<float, 2>)mgl_offsetArrayValue;
-- (std::array<float, 4>)mgl_paddingArrayValue;
-
-@end
diff --git a/platform/darwin/src/UIColor+MGLStyleAttributeAdditions_Private.h b/platform/darwin/src/UIColor+MGLStyleAttributeAdditions_Private.h
deleted file mode 100644
index ef886dca5d..0000000000
--- a/platform/darwin/src/UIColor+MGLStyleAttributeAdditions_Private.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#import <UIKit/UIKit.h>
-
-#import "MGLStyleAttributeValue.h"
-
-#include <mbgl/style/property_value.hpp>
-
-@interface UIColor (MGLStyleAttributeAdditions_Private) <MGLStyleAttributeValue>
-
-@end
diff --git a/platform/darwin/test/MGLCircleStyleLayerTests.m b/platform/darwin/test/MGLCircleStyleLayerTests.m
index 995802ff18..54ba8be6c1 100644
--- a/platform/darwin/test/MGLCircleStyleLayerTests.m
+++ b/platform/darwin/test/MGLCircleStyleLayerTests.m
@@ -31,8 +31,10 @@
XCTAssertEqualObjects(gLayer.circleBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.circleOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.circleTranslate, [MGLRuntimeStylingHelper testOffset]);
- XCTAssert([(NSValue *)gLayer.circleTranslateAnchor isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLCircleTranslateAnchorViewport type:@encode(MGLCircleTranslateAnchor)]], @"%@ is not equal to %@", gLayer.circleTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLCircleTranslateAnchorViewport type:@encode(MGLCircleTranslateAnchor)]);
- XCTAssert([(NSValue *)gLayer.circlePitchScale isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)]], @"%@ is not equal to %@", gLayer.circlePitchScale, [MGLRuntimeStylingHelper testEnum:MGLCirclePitchScaleViewport type:@encode(MGLCirclePitchScale)]);
+ 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];
diff --git a/platform/darwin/test/MGLFillStyleLayerTests.m b/platform/darwin/test/MGLFillStyleLayerTests.m
index 21c2a9de40..7b31207902 100644
--- a/platform/darwin/test/MGLFillStyleLayerTests.m
+++ b/platform/darwin/test/MGLFillStyleLayerTests.m
@@ -31,7 +31,8 @@
XCTAssertEqualObjects(gLayer.fillColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.fillOutlineColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.fillTranslate, [MGLRuntimeStylingHelper testOffset]);
- XCTAssert([(NSValue *)gLayer.fillTranslateAnchor isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLFillTranslateAnchorViewport type:@encode(MGLFillTranslateAnchor)]], @"%@ is not equal to %@", gLayer.fillTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLFillTranslateAnchorViewport type:@encode(MGLFillTranslateAnchor)]);
+ XCTAssert([gLayer.fillTranslateAnchor isKindOfClass:[MGLStyleConstantValue class]]);
+ XCTAssertEqualObjects(gLayer.fillTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLFillTranslateAnchorViewport type:@encode(MGLFillTranslateAnchor)]);
XCTAssertEqualObjects(gLayer.fillPattern, [MGLRuntimeStylingHelper testString]);
layer.fillAntialias = [MGLRuntimeStylingHelper testBoolFunction];
diff --git a/platform/darwin/test/MGLLineStyleLayerTests.m b/platform/darwin/test/MGLLineStyleLayerTests.m
index 79f0619f8a..801bc12ff8 100644
--- a/platform/darwin/test/MGLLineStyleLayerTests.m
+++ b/platform/darwin/test/MGLLineStyleLayerTests.m
@@ -33,14 +33,17 @@
MGLLineStyleLayer *gLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLLineStyleLayer class]]);
- XCTAssert([(NSValue *)gLayer.lineCap isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLLineCapSquare type:@encode(MGLLineCap)]], @"%@ is not equal to %@", gLayer.lineCap, [MGLRuntimeStylingHelper testEnum:MGLLineCapSquare type:@encode(MGLLineCap)]);
- XCTAssert([(NSValue *)gLayer.lineJoin isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLLineJoinMiter type:@encode(MGLLineJoin)]], @"%@ is not equal to %@", gLayer.lineJoin, [MGLRuntimeStylingHelper testEnum:MGLLineJoinMiter type:@encode(MGLLineJoin)]);
+ XCTAssert([gLayer.lineCap isKindOfClass:[MGLStyleConstantValue class]]);
+ XCTAssertEqualObjects(gLayer.lineCap, [MGLRuntimeStylingHelper testEnum:MGLLineCapSquare type:@encode(MGLLineCap)]);
+ XCTAssert([gLayer.lineJoin isKindOfClass:[MGLStyleConstantValue class]]);
+ 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.lineColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.lineTranslate, [MGLRuntimeStylingHelper testOffset]);
- XCTAssert([(NSValue *)gLayer.lineTranslateAnchor isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLLineTranslateAnchorViewport type:@encode(MGLLineTranslateAnchor)]], @"%@ is not equal to %@", gLayer.lineTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLLineTranslateAnchorViewport type:@encode(MGLLineTranslateAnchor)]);
+ 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]);
diff --git a/platform/darwin/test/MGLRuntimeStylingHelper.h b/platform/darwin/test/MGLRuntimeStylingHelper.h
index 6626d13901..8857dba9c5 100644
--- a/platform/darwin/test/MGLRuntimeStylingHelper.h
+++ b/platform/darwin/test/MGLRuntimeStylingHelper.h
@@ -1,35 +1,35 @@
#import <Foundation/Foundation.h>
#import "MGLTypes.h"
-#import "MGLStyleAttributeFunction.h"
+#import "MGLStyleValue.h"
@interface MGLRuntimeStylingHelper : NSObject
-+ (NSArray *)testPadding;
-+ (MGLStyleAttributeFunction *)testPaddingFunction;
++ (MGLStyleConstantValue<NSValue *> *)testPadding;
++ (MGLStyleFunction<NSValue *> *)testPaddingFunction;
-+ (NSArray *)testOffset;
-+ (MGLStyleAttributeFunction *)testOffsetFunction;
++ (MGLStyleConstantValue<NSValue *> *)testOffset;
++ (MGLStyleFunction<NSValue *> *)testOffsetFunction;
-+ (NSArray *)testFont;
-+ (MGLStyleAttributeFunction *)testFontFunction;
++ (MGLStyleConstantValue<NSArray<NSString *> *> *)testFont;
++ (MGLStyleFunction<NSArray<NSString *> *> *)testFontFunction;
-+ (NSArray *)testDashArray;
-+ (MGLStyleAttributeFunction *)testDashArrayFunction;
++ (MGLStyleConstantValue<NSArray<NSNumber *> *> *)testDashArray;
++ (MGLStyleFunction<NSArray<NSNumber *> *> *)testDashArrayFunction;
-+ (NSNumber *)testNumber;
-+ (MGLStyleAttributeFunction *)testNumberFunction;
++ (MGLStyleConstantValue<NSNumber *> *)testNumber;
++ (MGLStyleFunction<NSNumber *> *)testNumberFunction;
-+ (NSNumber *)testBool;
-+ (MGLStyleAttributeFunction *)testBoolFunction;
++ (MGLStyleConstantValue<NSNumber *> *)testBool;
++ (MGLStyleFunction<NSNumber *> *)testBoolFunction;
-+ (NSString *)testString;
-+ (MGLStyleAttributeFunction *)testStringFunction;
++ (MGLStyleConstantValue<NSString *> *)testString;
++ (MGLStyleFunction<NSString *> *)testStringFunction;
-+ (MGLColor *)testColor;
-+ (MGLStyleAttributeFunction *)testColorFunction;
++ (MGLStyleConstantValue<MGLColor *> *)testColor;
++ (MGLStyleFunction<MGLColor *> *)testColorFunction;
-+ (NSValue *)testEnum:(NSUInteger)value type:(const char *)type;
-+ (MGLStyleAttributeFunction *)testEnumFunction:(NSUInteger)value type:(const char *)type;
++ (MGLStyleConstantValue<NSValue *> *)testEnum:(NSUInteger)value type:(const char *)type;
++ (MGLStyleFunction<NSValue *> *)testEnumFunction:(NSUInteger)value type:(const char *)type;
@end
diff --git a/platform/darwin/test/MGLRuntimeStylingHelper.m b/platform/darwin/test/MGLRuntimeStylingHelper.m
index 29e80086ec..955c664f2c 100644
--- a/platform/darwin/test/MGLRuntimeStylingHelper.m
+++ b/platform/darwin/test/MGLRuntimeStylingHelper.m
@@ -10,7 +10,7 @@
@implementation MGLRuntimeStylingHelper
-+ (NSValue *)testPadding
++ (MGLStyleConstantValue<NSValue *> *)testPadding
{
MGLEdgeInsets insets = {
.top = 1,
@@ -18,129 +18,105 @@
.bottom = 1,
.right = 1,
};
- return [NSValue value:&insets withObjCType:@encode(MGLEdgeInsets)];
+ return [MGLStyleConstantValue<NSValue *> valueWithRawValue:[NSValue value:&insets withObjCType:@encode(MGLEdgeInsets)]];
}
-+ (MGLStyleAttributeFunction *)testPaddingFunction
++ (MGLStyleFunction<NSValue *> *)testPaddingFunction
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): self.testPadding,
- };
- return function;
+ return [MGLStyleFunction<NSValue *> functionWithStops:@{@(18): self.testPadding}];
}
-+ (NSValue *)testOffset
++ (MGLStyleConstantValue<NSValue *> *)testOffset
{
CGVector vector = CGVectorMake(1, 1);
- return [NSValue value:&vector withObjCType:@encode(CGVector)];
+ return [MGLStyleConstantValue<NSValue *> valueWithRawValue:[NSValue value:&vector withObjCType:@encode(CGVector)]];
}
-+ (MGLStyleAttributeFunction *)testOffsetFunction
++ (MGLStyleFunction<NSValue *> *)testOffsetFunction
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): self.testOffset,
- };
- return function;
+ return [MGLStyleFunction<NSValue *> valueWithStops:@{ @(18): self.testOffset }];
}
-+ (NSArray *)testFont
++ (MGLStyleConstantValue<NSArray<NSString *> *> *)testFont
{
- return @[@"Open Sans Regular", @"Arial Unicode MS Regular"];
+ return [MGLStyleConstantValue<NSArray<NSString *> *> valueWithRawValue:@[@"Open Sans Regular", @"Arial Unicode MS Regular"]];
}
-+ (MGLStyleAttributeFunction *)testFontFunction
++ (MGLStyleFunction<NSArray<NSString *> *> *)testFontFunction
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): self.testFont,
- };
- return function;
+ return [MGLStyleFunction<NSArray<NSString *> *> valueWithStops:@{ @18: self.testFont }];
}
-+ (NSArray *)testDashArray
++ (MGLStyleConstantValue<NSArray<NSNumber *> *> *)testDashArray
{
- return @[@1, @2];
+ return [MGLStyleConstantValue<NSArray<NSNumber *> *> valueWithRawValue:@[@1, @2]];
}
-+ (MGLStyleAttributeFunction *)testDashArrayFunction
++ (MGLStyleFunction<NSArray<NSNumber *> *> *)testDashArrayFunction
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): self.testDashArray,
- };
- return function;
+ return [MGLStyleFunction<NSArray<NSNumber *> *> valueWithStops:@{
+ @18: self.testDashArray,
+ }];
}
-+ (NSNumber *)testNumber
++ (MGLStyleConstantValue<NSNumber *> *)testNumber
{
- return @1;
+ return [MGLStyleConstantValue<NSNumber *> valueWithRawValue:@1];
}
-+ (MGLStyleAttributeFunction *)testNumberFunction
++ (MGLStyleFunction<NSNumber *> *)testNumberFunction
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): self.testNumber,
- };
- return function;
+ return [MGLStyleFunction<NSNumber *> valueWithStops:@{
+ @18: self.testNumber,
+ }];
}
-+ (NSNumber *)testBool
++ (MGLStyleConstantValue<NSNumber *> *)testBool
{
- return @YES;
+ return [MGLStyleConstantValue<NSNumber *> valueWithRawValue:@YES];
}
-+ (MGLStyleAttributeFunction *)testBoolFunction
++ (MGLStyleFunction<NSNumber *> *)testBoolFunction
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): self.testBool,
- };
- return function;
+ return [MGLStyleFunction<NSNumber *> valueWithStops:@{
+ @18: self.testBool,
+ }];
}
-+ (NSString *)testString
++ (MGLStyleConstantValue<NSString *> *)testString
{
- return @"test";
+ return [MGLStyleConstantValue<NSString *> valueWithRawValue:@"test"];
}
-+ (MGLStyleAttributeFunction *)testStringFunction
++ (MGLStyleFunction<NSString *> *)testStringFunction
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): self.testString,
- };
- return function;
+ return [MGLStyleFunction<NSString *> valueWithStops:@{
+ @18: self.testString,
+ }];
}
-+ (MGLColor *)testColor
++ (MGLStyleConstantValue<MGLColor *> *)testColor
{
- return [MGLColor redColor];
+ return [MGLStyleConstantValue<MGLColor *> valueWithRawValue:[MGLColor redColor]];
}
-+ (MGLStyleAttributeFunction *)testColorFunction
++ (MGLStyleFunction<MGLColor *> *)testColorFunction
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): self.testColor,
- };
- return function;
+ return [MGLStyleFunction<MGLColor *> valueWithStops:@{
+ @18: self.testColor,
+ }];
}
-+ (NSValue *)testEnum:(NSUInteger)value type:(const char *)type
++ (MGLStyleConstantValue<NSValue *> *)testEnum:(NSUInteger)value type:(const char *)type
{
- return [NSValue value:&value withObjCType:type];
+ return [MGLStyleConstantValue<NSValue *> valueWithRawValue:[NSValue value:&value withObjCType:type]];
}
-+ (MGLStyleAttributeFunction *)testEnumFunction:(NSUInteger)value type:(const char *)type
++ (MGLStyleFunction<NSValue *> *)testEnumFunction:(NSUInteger)value type:(const char *)type
{
- MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init];
- function.stops = @{
- @(18): [self testEnum:value type:type],
- };
- return function;
+ return [MGLStyleFunction<NSValue *> valueWithStops:@{
+ @18: [self testEnum:value type:type],
+ }];
}
@end
diff --git a/platform/darwin/test/MGLSymbolStyleLayerTests.m b/platform/darwin/test/MGLSymbolStyleLayerTests.m
index 208c30a630..f60ae7c2a8 100644
--- a/platform/darwin/test/MGLSymbolStyleLayerTests.m
+++ b/platform/darwin/test/MGLSymbolStyleLayerTests.m
@@ -67,36 +67,44 @@
MGLSymbolStyleLayer *gLayer = (MGLSymbolStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLSymbolStyleLayer class]]);
- XCTAssert([(NSValue *)gLayer.symbolPlacement isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)]], @"%@ is not equal to %@", gLayer.symbolPlacement, [MGLRuntimeStylingHelper testEnum:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)]);
+ 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.iconOptional, [MGLRuntimeStylingHelper testBool]);
- XCTAssert([(NSValue *)gLayer.iconRotationAlignment isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)]], @"%@ is not equal to %@", gLayer.iconRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)]);
+ XCTAssert([gLayer.iconRotationAlignment isKindOfClass:[MGLStyleConstantValue class]]);
+ XCTAssertEqualObjects(gLayer.iconRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)]);
XCTAssertEqualObjects(gLayer.iconSize, [MGLRuntimeStylingHelper testNumber]);
- XCTAssert([(NSValue *)gLayer.iconTextFit isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLIconTextFitBoth type:@encode(MGLIconTextFit)]], @"%@ is not equal to %@", gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnum:MGLIconTextFitBoth type:@encode(MGLIconTextFit)]);
+ 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([(NSValue *)gLayer.textPitchAlignment isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)]], @"%@ is not equal to %@", gLayer.textPitchAlignment, [MGLRuntimeStylingHelper testEnum:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)]);
- XCTAssert([(NSValue *)gLayer.textRotationAlignment isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)]], @"%@ is not equal to %@", gLayer.textRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)]);
+ 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([(NSValue *)gLayer.textJustify isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLTextJustifyRight type:@encode(MGLTextJustify)]], @"%@ is not equal to %@", gLayer.textJustify, [MGLRuntimeStylingHelper testEnum:MGLTextJustifyRight type:@encode(MGLTextJustify)]);
- XCTAssert([(NSValue *)gLayer.textAnchor isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)]], @"%@ is not equal to %@", gLayer.textAnchor, [MGLRuntimeStylingHelper testEnum:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)]);
+ XCTAssert([gLayer.textJustify isKindOfClass:[MGLStyleConstantValue class]]);
+ XCTAssertEqualObjects(gLayer.textJustify, [MGLRuntimeStylingHelper testEnum:MGLTextJustifyRight type:@encode(MGLTextJustify)]);
+ 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.textKeepUpright, [MGLRuntimeStylingHelper testBool]);
- XCTAssert([(NSValue *)gLayer.textTransform isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLTextTransformLowercase type:@encode(MGLTextTransform)]], @"%@ is not equal to %@", gLayer.textTransform, [MGLRuntimeStylingHelper testEnum:MGLTextTransformLowercase type:@encode(MGLTextTransform)]);
+ 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]);
@@ -107,14 +115,16 @@
XCTAssertEqualObjects(gLayer.iconHaloWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconHaloBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconTranslate, [MGLRuntimeStylingHelper testOffset]);
- XCTAssert([(NSValue *)gLayer.iconTranslateAnchor isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLIconTranslateAnchorViewport type:@encode(MGLIconTranslateAnchor)]], @"%@ is not equal to %@", gLayer.iconTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLIconTranslateAnchorViewport type:@encode(MGLIconTranslateAnchor)]);
+ 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.textHaloColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.textHaloWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textHaloBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textTranslate, [MGLRuntimeStylingHelper testOffset]);
- XCTAssert([(NSValue *)gLayer.textTranslateAnchor isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLTextTranslateAnchorViewport type:@encode(MGLTextTranslateAnchor)]], @"%@ is not equal to %@", gLayer.textTranslateAnchor, [MGLRuntimeStylingHelper testEnum:MGLTextTranslateAnchorViewport type:@encode(MGLTextTranslateAnchor)]);
+ 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];
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 5a0854f6bf..046f602384 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -643,33 +643,36 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
- (void)styleWaterLayer
{
MGLFillStyleLayer *waterLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"water"];
- MGLStyleAttributeFunction *waterColorFunction = [[MGLStyleAttributeFunction alloc] init];
- waterColorFunction.stops = @{@6.0f: [UIColor yellowColor],
- @8.0f: [UIColor blueColor],
- @10.0f: [UIColor redColor],
- @12.0f: [UIColor greenColor],
- @14.0f: [UIColor blueColor]};
+ MGLStyleValue *waterColorFunction = [MGLStyleValue<UIColor *> valueWithStops:@{
+ @6.0f: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor yellowColor]],
+ @8.0f: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor blueColor]],
+ @10.0f: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor redColor]],
+ @12.0f: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor greenColor]],
+ @14.0f: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor blueColor]],
+ }];
waterLayer.fillColor = waterColorFunction;
- MGLStyleAttributeFunction *fillAntialias = [[MGLStyleAttributeFunction alloc] init];
- fillAntialias.stops = @{@11: @YES,
- @12: @NO,
- @13: @YES,
- @14: @NO,
- @15: @YES};
+ MGLStyleValue *fillAntialias = [MGLStyleValue<NSNumber *> valueWithStops:@{
+ @11: [MGLStyleValue<NSNumber *> valueWithRawValue:@YES],
+ @12: [MGLStyleValue<NSNumber *> valueWithRawValue:@NO],
+ @13: [MGLStyleValue<NSNumber *> valueWithRawValue:@YES],
+ @14: [MGLStyleValue<NSNumber *> valueWithRawValue:@NO],
+ @15: [MGLStyleValue<NSNumber *> valueWithRawValue:@YES],
+ }];
waterLayer.fillAntialias = fillAntialias;
}
- (void)styleRoadLayer
{
MGLLineStyleLayer *roadLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"road-primary"];
- roadLayer.lineColor = [UIColor blackColor];
- MGLStyleAttributeFunction *lineWidthFunction = [[MGLStyleAttributeFunction alloc] init];
+ roadLayer.lineColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor blackColor]];
+ MGLStyleValue *lineWidthFunction = [MGLStyleValue<NSNumber *> valueWithStops:@{}];
- MGLStyleAttributeFunction *roadLineColor = [[MGLStyleAttributeFunction alloc] init];
- roadLineColor.stops = @{@10: [UIColor purpleColor],
- @13: [UIColor yellowColor],
- @16: [UIColor cyanColor]};
+ MGLStyleValue *roadLineColor = [MGLStyleValue<UIColor *> valueWithStops:@{
+ @10: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor purpleColor]],
+ @13: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor yellowColor]],
+ @16: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor cyanColor]],
+ }];
roadLayer.lineColor = roadLineColor;
roadLayer.lineWidth = lineWidthFunction;
roadLayer.lineGapWidth = lineWidthFunction;
@@ -686,9 +689,10 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
[self.mapView.style addSource:rasterSource];
MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"my-raster-layer" source:rasterSource];
- MGLStyleAttributeFunction *opacityFunction = [[MGLStyleAttributeFunction alloc] init];
- opacityFunction.stops = @{@20.0f: @1.0f,
- @5.0f: @0.0f};
+ MGLStyleValue *opacityFunction = [MGLStyleValue<NSNumber *> valueWithStops:@{
+ @20.0f: [MGLStyleValue<NSNumber *> valueWithRawValue:@1.0f],
+ @5.0f: [MGLStyleValue<NSNumber *> valueWithRawValue:@0.0f],
+ }];
rasterLayer.rasterOpacity = opacityFunction;
[self.mapView.style addLayer:rasterLayer];
}
@@ -701,26 +705,26 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
[self.mapView.style addSource:source];
MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"test" source:source];
- fillLayer.fillColor = [UIColor purpleColor];
+ fillLayer.fillColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor purpleColor]];
[self.mapView.style addLayer:fillLayer];
}
- (void)styleSymbolLayer
{
MGLSymbolStyleLayer *stateLayer = (MGLSymbolStyleLayer *)[self.mapView.style layerWithIdentifier:@"state-label-lg"];
- stateLayer.textColor = [UIColor redColor];
+ stateLayer.textColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor redColor]];
}
- (void)styleBuildingLayer
{
MGLFillStyleLayer *buildingLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"building"];
- buildingLayer.fillColor = [UIColor blackColor];
+ buildingLayer.fillColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor blackColor]];
}
- (void)styleFerryLayer
{
MGLLineStyleLayer *ferryLineLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"ferry"];
- ferryLineLayer.lineColor = [UIColor redColor];
+ ferryLineLayer.lineColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor redColor]];
}
- (void)removeParkLayer
@@ -744,8 +748,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
statesLayer.predicate = [NSPredicate predicateWithFormat:@"name == 'Texas'"];
// paint properties
- statesLayer.fillColor = [UIColor redColor];
- statesLayer.fillOpacity = @(0.25);
+ statesLayer.fillColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor redColor]];
+ statesLayer.fillOpacity = [MGLStyleValue<NSNumber *> valueWithRawValue:@0.25];
});
}
@@ -764,9 +768,9 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
countiesLayer.predicate = [NSPredicate predicateWithFormat:@"NAME10 == 'Washington'"];
// paint properties
- countiesLayer.lineColor = [UIColor redColor];
- countiesLayer.lineOpacity = @(0.75);
- countiesLayer.lineWidth = @(5);
+ countiesLayer.lineColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor redColor]];
+ countiesLayer.lineOpacity = [MGLStyleValue<NSNumber *> valueWithRawValue:@0.75];
+ countiesLayer.lineWidth = [MGLStyleValue<NSNumber *> valueWithRawValue:@5];
});
}
@@ -785,8 +789,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
regionsLayer.predicate = [NSPredicate predicateWithFormat:@"HRRNUM >= %@ AND HRRNUM < 300", @(200)];
// paint properties
- regionsLayer.fillColor = [UIColor blueColor];
- regionsLayer.fillOpacity = @(0.5);
+ regionsLayer.fillColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor blueColor]];
+ regionsLayer.fillOpacity = [MGLStyleValue<NSNumber *> valueWithRawValue:@0.5];
});
}
@@ -818,8 +822,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
[self.mapView.style addSource:source];
MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:queryLayerID source:source];
- fillLayer.fillColor = [UIColor blueColor];
- fillLayer.fillOpacity = @(0.5);
+ fillLayer.fillColor = [MGLStyleConstantValue<UIColor *> valueWithRawValue:[UIColor blueColor]];
+ fillLayer.fillOpacity = [MGLStyleConstantValue<NSNumber *> valueWithRawValue:@0.5];
[self.mapView.style addLayer:fillLayer];
});
}
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 01e660083c..3c19f5ea41 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -11,34 +11,12 @@
30E578181DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; };
30E578191DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 30E578121DAA7D690050F07E /* UIImage+MGLAdditions.mm */; };
30E5781A1DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 30E578121DAA7D690050F07E /* UIImage+MGLAdditions.mm */; };
- 350098AF1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098AD1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098B01D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098AD1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098B11D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098AE1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.mm */; };
- 350098B21D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098AE1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.mm */; };
350098BB1D480108004B2AF0 /* MGLVectorSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098B91D480108004B2AF0 /* MGLVectorSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
350098BC1D480108004B2AF0 /* MGLVectorSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098B91D480108004B2AF0 /* MGLVectorSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
350098BD1D480108004B2AF0 /* MGLVectorSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098BA1D480108004B2AF0 /* MGLVectorSource.mm */; };
350098BE1D480108004B2AF0 /* MGLVectorSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098BA1D480108004B2AF0 /* MGLVectorSource.mm */; };
- 350098C11D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098BF1D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098C21D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098BF1D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098C31D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098C01D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.mm */; };
- 350098C41D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098C01D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.mm */; };
- 350098C61D48288B004B2AF0 /* NSNumber+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098C51D48288B004B2AF0 /* NSNumber+MGLStyleAttributeAdditions_Private.h */; };
- 350098C71D48288B004B2AF0 /* NSNumber+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098C51D48288B004B2AF0 /* NSNumber+MGLStyleAttributeAdditions_Private.h */; };
- 350098CA1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098C81D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098CB1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098C81D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098CC1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098C91D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.mm */; };
- 350098CD1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098C91D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.mm */; };
- 350098CF1D482E10004B2AF0 /* NSArray+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098CE1D482E10004B2AF0 /* NSArray+MGLStyleAttributeAdditions_Private.h */; };
- 350098D01D482E10004B2AF0 /* NSArray+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098CE1D482E10004B2AF0 /* NSArray+MGLStyleAttributeAdditions_Private.h */; };
- 350098D31D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098D11D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098D41D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098D11D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098D51D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098D21D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.mm */; };
- 350098D61D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098D21D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.mm */; };
- 350098D81D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098D71D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h */; };
- 350098D91D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098D71D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h */; };
- 350098DC1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098DA1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 350098DD1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098DA1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 350098DC1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098DA1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h */; };
+ 350098DD1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 350098DA1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h */; };
350098DE1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098DB1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm */; };
350098DF1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 350098DB1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm */; };
3510FFEA1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFE81D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.h */; };
@@ -70,10 +48,6 @@
35305D481D22AA680007D005 /* NSData+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35305D471D22AA450007D005 /* NSData+MGLAdditions.mm */; };
35305D491D22AA680007D005 /* NSData+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35305D471D22AA450007D005 /* NSData+MGLAdditions.mm */; };
35305D4A1D22AA6A0007D005 /* NSData+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35305D461D22AA450007D005 /* NSData+MGLAdditions.h */; };
- 3534C7921D4BC95400D874A4 /* MGLStyleAttributeFunction_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3534C7911D4BC95400D874A4 /* MGLStyleAttributeFunction_Private.h */; };
- 3534C7931D4BC95400D874A4 /* MGLStyleAttributeFunction_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3534C7911D4BC95400D874A4 /* MGLStyleAttributeFunction_Private.h */; };
- 3534C7951D4BD1D400D874A4 /* MGLStyleAttributeValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3534C7941D4BD1D400D874A4 /* MGLStyleAttributeValue_Private.h */; };
- 3534C7961D4BD1D400D874A4 /* MGLStyleAttributeValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3534C7941D4BD1D400D874A4 /* MGLStyleAttributeValue_Private.h */; };
3538AA1D1D542239008EC33D /* MGLForegroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3538AA1B1D542239008EC33D /* MGLForegroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
3538AA1E1D542239008EC33D /* MGLForegroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3538AA1B1D542239008EC33D /* MGLForegroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
3538AA1F1D542239008EC33D /* MGLForegroundStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.m */; };
@@ -100,14 +74,8 @@
354B83981D2E873E005D9406 /* MGLUserLocationAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 354B83951D2E873E005D9406 /* MGLUserLocationAnnotationView.m */; };
354B83991D2E873E005D9406 /* MGLUserLocationAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 354B83951D2E873E005D9406 /* MGLUserLocationAnnotationView.m */; };
354B839C1D2E9B48005D9406 /* MBXUserLocationAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 354B839B1D2E9B48005D9406 /* MBXUserLocationAnnotationView.m */; };
- 354D42DC1D4919F900F400A1 /* NSValue+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 354D42DB1D4919F900F400A1 /* NSValue+MGLStyleAttributeAdditions_Private.h */; };
- 354D42DD1D4919F900F400A1 /* NSValue+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 354D42DB1D4919F900F400A1 /* NSValue+MGLStyleAttributeAdditions_Private.h */; };
- 35599DEB1D46F14E0048254D /* MGLStyleAttributeFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 35599DE91D46F14E0048254D /* MGLStyleAttributeFunction.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 35599DEC1D46F14E0048254D /* MGLStyleAttributeFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 35599DE91D46F14E0048254D /* MGLStyleAttributeFunction.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 35599DED1D46F14E0048254D /* MGLStyleAttributeFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35599DEA1D46F14E0048254D /* MGLStyleAttributeFunction.mm */; };
- 35599DEE1D46F14E0048254D /* MGLStyleAttributeFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35599DEA1D46F14E0048254D /* MGLStyleAttributeFunction.mm */; };
- 35599DF01D46F3A60048254D /* MGLStyleAttributeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 35599DEF1D46F3A60048254D /* MGLStyleAttributeValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 35599DF11D46F3A60048254D /* MGLStyleAttributeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 35599DEF1D46F3A60048254D /* MGLStyleAttributeValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 35599DED1D46F14E0048254D /* MGLStyleValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35599DEA1D46F14E0048254D /* MGLStyleValue.mm */; };
+ 35599DEE1D46F14E0048254D /* MGLStyleValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35599DEA1D46F14E0048254D /* MGLStyleValue.mm */; };
3566C7661D4A77BA008152BC /* MGLGeoJSONSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7641D4A77BA008152BC /* MGLGeoJSONSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
3566C7671D4A77BA008152BC /* MGLGeoJSONSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7641D4A77BA008152BC /* MGLGeoJSONSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
3566C7681D4A77BA008152BC /* MGLGeoJSONSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C7651D4A77BA008152BC /* MGLGeoJSONSource.mm */; };
@@ -125,12 +93,6 @@
357579891D502B06000B822E /* MGLCircleStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 357579881D502B06000B822E /* MGLCircleStyleLayerTests.m */; };
3575798B1D502B0C000B822E /* MGLBackgroundStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3575798A1D502B0C000B822E /* MGLBackgroundStyleLayerTests.m */; };
3575798E1D502EC7000B822E /* MGLRuntimeStylingHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 3575798D1D502EC7000B822E /* MGLRuntimeStylingHelper.m */; };
- 3593E5211D529C29006D9365 /* MGLStyleAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 3593E51F1D529C29006D9365 /* MGLStyleAttribute.h */; };
- 3593E5221D529C29006D9365 /* MGLStyleAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 3593E51F1D529C29006D9365 /* MGLStyleAttribute.h */; };
- 3593E5231D529C29006D9365 /* MGLStyleAttribute.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3593E5201D529C29006D9365 /* MGLStyleAttribute.mm */; };
- 3593E5241D529C29006D9365 /* MGLStyleAttribute.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3593E5201D529C29006D9365 /* MGLStyleAttribute.mm */; };
- 3593E5261D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3593E5251D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h */; };
- 3593E5271D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3593E5251D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h */; };
359F57461D2FDDA6005217F1 /* MGLUserLocationAnnotationView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 359F57451D2FDBD5005217F1 /* MGLUserLocationAnnotationView_Private.h */; };
35B82BF81D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; };
35B82BF91D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; };
@@ -383,6 +345,10 @@
DAA4E4341CBB730400178DFB /* MGLFaux3DUserLocationAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88484E1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m */; };
DAA4E4351CBB730400178DFB /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488A1CBB037E00AB86E3 /* SMCalloutView.m */; };
DAABF73D1CBC59BB005B1825 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAABF73B1CBC59BB005B1825 /* libmbgl-core.a */; };
+ DAAF722B1DA903C700312FA4 /* MGLStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAF72291DA903C700312FA4 /* MGLStyleValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ DAAF722C1DA903C700312FA4 /* MGLStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAF72291DA903C700312FA4 /* MGLStyleValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ DAAF722D1DA903C700312FA4 /* MGLStyleValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAF722A1DA903C700312FA4 /* MGLStyleValue_Private.h */; };
+ DAAF722E1DA903C700312FA4 /* MGLStyleValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAF722A1DA903C700312FA4 /* MGLStyleValue_Private.h */; };
DABCABAC1CB80692000A7C39 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DABCABAB1CB80692000A7C39 /* main.m */; };
DABCABAF1CB80692000A7C39 /* MBXBenchAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DABCABAE1CB80692000A7C39 /* MBXBenchAppDelegate.m */; };
DABCABB21CB80692000A7C39 /* MBXBenchViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = DABCABB11CB80692000A7C39 /* MBXBenchViewController.mm */; };
@@ -518,19 +484,8 @@
/* Begin PBXFileReference section */
30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+MGLAdditions.h"; path = "src/UIImage+MGLAdditions.h"; sourceTree = SOURCE_ROOT; };
30E578121DAA7D690050F07E /* UIImage+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "UIImage+MGLAdditions.mm"; path = "src/UIImage+MGLAdditions.mm"; sourceTree = SOURCE_ROOT; };
- 350098AD1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+MGLStyleAttributeAdditions.h"; path = "src/UIColor+MGLStyleAttributeAdditions.h"; sourceTree = SOURCE_ROOT; };
- 350098AE1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "UIColor+MGLStyleAttributeAdditions.mm"; path = "src/UIColor+MGLStyleAttributeAdditions.mm"; sourceTree = SOURCE_ROOT; };
350098B91D480108004B2AF0 /* MGLVectorSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorSource.h; sourceTree = "<group>"; };
350098BA1D480108004B2AF0 /* MGLVectorSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLVectorSource.mm; sourceTree = "<group>"; };
- 350098BF1D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNumber+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
- 350098C01D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSNumber+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
- 350098C51D48288B004B2AF0 /* NSNumber+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNumber+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
- 350098C81D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
- 350098C91D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSArray+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
- 350098CE1D482E10004B2AF0 /* NSArray+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
- 350098D11D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
- 350098D21D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSString+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
- 350098D71D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
350098DA1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
350098DB1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSValue+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
3510FFE81D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSComparisonPredicate+MGLAdditions.h"; sourceTree = "<group>"; };
@@ -548,8 +503,6 @@
35136D4B1D4277FC00C20EFD /* MGLSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLSource.mm; sourceTree = "<group>"; };
35305D461D22AA450007D005 /* NSData+MGLAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+MGLAdditions.h"; sourceTree = "<group>"; };
35305D471D22AA450007D005 /* NSData+MGLAdditions.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSData+MGLAdditions.mm"; sourceTree = "<group>"; };
- 3534C7911D4BC95400D874A4 /* MGLStyleAttributeFunction_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttributeFunction_Private.h; sourceTree = "<group>"; };
- 3534C7941D4BD1D400D874A4 /* MGLStyleAttributeValue_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttributeValue_Private.h; sourceTree = "<group>"; };
3538AA1B1D542239008EC33D /* MGLForegroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer.h; sourceTree = "<group>"; };
3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLForegroundStyleLayer.m; sourceTree = "<group>"; };
353933F11D3FB753003F57D7 /* MGLCircleStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCircleStyleLayer.h; sourceTree = "<group>"; };
@@ -565,10 +518,7 @@
354B83951D2E873E005D9406 /* MGLUserLocationAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLUserLocationAnnotationView.m; sourceTree = "<group>"; };
354B839A1D2E9B48005D9406 /* MBXUserLocationAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBXUserLocationAnnotationView.h; sourceTree = "<group>"; };
354B839B1D2E9B48005D9406 /* MBXUserLocationAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBXUserLocationAnnotationView.m; sourceTree = "<group>"; };
- 354D42DB1D4919F900F400A1 /* NSValue+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
- 35599DE91D46F14E0048254D /* MGLStyleAttributeFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttributeFunction.h; sourceTree = "<group>"; };
- 35599DEA1D46F14E0048254D /* MGLStyleAttributeFunction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleAttributeFunction.mm; sourceTree = "<group>"; };
- 35599DEF1D46F3A60048254D /* MGLStyleAttributeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttributeValue.h; sourceTree = "<group>"; };
+ 35599DEA1D46F14E0048254D /* MGLStyleValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleValue.mm; sourceTree = "<group>"; };
3566C7641D4A77BA008152BC /* MGLGeoJSONSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLGeoJSONSource.h; sourceTree = "<group>"; };
3566C7651D4A77BA008152BC /* MGLGeoJSONSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLGeoJSONSource.mm; sourceTree = "<group>"; };
3566C76A1D4A8DFA008152BC /* MGLRasterSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterSource.h; sourceTree = "<group>"; };
@@ -582,9 +532,6 @@
3575798A1D502B0C000B822E /* MGLBackgroundStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLBackgroundStyleLayerTests.m; path = ../../darwin/test/MGLBackgroundStyleLayerTests.m; sourceTree = "<group>"; };
3575798C1D502EC7000B822E /* MGLRuntimeStylingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLRuntimeStylingHelper.h; path = ../../darwin/test/MGLRuntimeStylingHelper.h; sourceTree = "<group>"; };
3575798D1D502EC7000B822E /* MGLRuntimeStylingHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLRuntimeStylingHelper.m; path = ../../darwin/test/MGLRuntimeStylingHelper.m; sourceTree = "<group>"; };
- 3593E51F1D529C29006D9365 /* MGLStyleAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttribute.h; sourceTree = "<group>"; };
- 3593E5201D529C29006D9365 /* MGLStyleAttribute.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleAttribute.mm; sourceTree = "<group>"; };
- 3593E5251D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
359F57451D2FDBD5005217F1 /* MGLUserLocationAnnotationView_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLUserLocationAnnotationView_Private.h; sourceTree = "<group>"; };
35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLAdditions.h"; sourceTree = "<group>"; };
35B82BF71D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSPredicate+MGLAdditions.mm"; sourceTree = "<group>"; };
@@ -781,6 +728,8 @@
DAA4E4061CBB5CBF00178DFB /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
DAA4E4131CBB71D400178DFB /* libMapbox.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMapbox.a; sourceTree = BUILT_PRODUCTS_DIR; };
DAABF73B1CBC59BB005B1825 /* libmbgl-core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libmbgl-core.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ DAAF72291DA903C700312FA4 /* MGLStyleValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleValue.h; sourceTree = "<group>"; };
+ DAAF722A1DA903C700312FA4 /* MGLStyleValue_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleValue_Private.h; sourceTree = "<group>"; };
DABCABA81CB80692000A7C39 /* Bench GL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Bench GL.app"; sourceTree = BUILT_PRODUCTS_DIR; };
DABCABAB1CB80692000A7C39 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
DABCABAD1CB80692000A7C39 /* MBXBenchAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBXBenchAppDelegate.h; sourceTree = "<group>"; };
@@ -909,13 +858,9 @@
35599DB81D46AD7F0048254D /* Categories */,
353933F01D3FB6BA003F57D7 /* Layers */,
35136D491D4277EA00C20EFD /* Sources */,
- 35599DE91D46F14E0048254D /* MGLStyleAttributeFunction.h */,
- 3534C7911D4BC95400D874A4 /* MGLStyleAttributeFunction_Private.h */,
- 35599DEA1D46F14E0048254D /* MGLStyleAttributeFunction.mm */,
- 35599DEF1D46F3A60048254D /* MGLStyleAttributeValue.h */,
- 3534C7941D4BD1D400D874A4 /* MGLStyleAttributeValue_Private.h */,
- 3593E51F1D529C29006D9365 /* MGLStyleAttribute.h */,
- 3593E5201D529C29006D9365 /* MGLStyleAttribute.mm */,
+ DAAF72291DA903C700312FA4 /* MGLStyleValue.h */,
+ DAAF722A1DA903C700312FA4 /* MGLStyleValue_Private.h */,
+ 35599DEA1D46F14E0048254D /* MGLStyleValue.mm */,
);
name = Styling;
sourceTree = "<group>";
@@ -923,20 +868,7 @@
35599DB81D46AD7F0048254D /* Categories */ = {
isa = PBXGroup;
children = (
- 350098AD1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h */,
- 3593E5251D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h */,
- 350098AE1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.mm */,
- 350098BF1D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.h */,
- 350098C51D48288B004B2AF0 /* NSNumber+MGLStyleAttributeAdditions_Private.h */,
- 350098C01D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.mm */,
- 350098C81D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h */,
- 350098CE1D482E10004B2AF0 /* NSArray+MGLStyleAttributeAdditions_Private.h */,
- 350098C91D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.mm */,
- 350098D11D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.h */,
- 350098D71D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h */,
- 350098D21D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.mm */,
350098DA1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h */,
- 354D42DB1D4919F900F400A1 /* NSValue+MGLStyleAttributeAdditions_Private.h */,
350098DB1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm */,
);
name = Categories;
@@ -1454,14 +1386,11 @@
DA8848201CBAFA6200AB86E3 /* MGLOfflinePack_Private.h in Headers */,
DA8847FA1CBAFA5100AB86E3 /* MGLPolyline.h in Headers */,
3566C7711D4A9198008152BC /* MGLSource_Private.h in Headers */,
- 3593E5211D529C29006D9365 /* MGLStyleAttribute.h in Headers */,
- 35599DEB1D46F14E0048254D /* MGLStyleAttributeFunction.h in Headers */,
4018B1C91CDC288A00F666AF /* MGLAnnotationView_Private.h in Headers */,
35E1A4D81D74336F007AA97F /* MGLValueEvaluator.h in Headers */,
DA88482C1CBAFA6200AB86E3 /* NSBundle+MGLAdditions.h in Headers */,
7E016D7E1D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.h in Headers */,
35D13AB71D3D15E300AFB4E0 /* MGLStyleLayer.h in Headers */,
- 354D42DC1D4919F900F400A1 /* NSValue+MGLStyleAttributeAdditions_Private.h in Headers */,
DA88488E1CBB047F00AB86E3 /* reachability.h in Headers */,
40F887701D7A1E58008ECB67 /* MGLGeoJSONSource_Private.h in Headers */,
350098DC1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h in Headers */,
@@ -1471,8 +1400,6 @@
35E0CFE61D3E501500188327 /* MGLStyle_Private.h in Headers */,
3510FFF01D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */,
353AFA141D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */,
- 3593E5261D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h in Headers */,
- 35599DF01D46F3A60048254D /* MGLStyleAttributeValue.h in Headers */,
DA8848531CBAFB9800AB86E3 /* MGLCompactCalloutView.h in Headers */,
DA8847FB1CBAFA5100AB86E3 /* MGLShape.h in Headers */,
353933F51D3FB785003F57D7 /* MGLBackgroundStyleLayer.h in Headers */,
@@ -1486,24 +1413,22 @@
DA88483E1CBAFB8500AB86E3 /* MGLMapView+MGLCustomStyleLayerAdditions.h in Headers */,
40CF6DBB1DAC3C6600A4D18B /* MGLShape_Private.h in Headers */,
4018B1CA1CDC288E00F666AF /* MGLAnnotationView.h in Headers */,
- 350098C61D48288B004B2AF0 /* NSNumber+MGLStyleAttributeAdditions_Private.h in Headers */,
35E79F201D41266300957B9E /* MGLStyleLayer_Private.h in Headers */,
353933FB1D3FB7C0003F57D7 /* MGLRasterStyleLayer.h in Headers */,
DA8847EF1CBAFA5100AB86E3 /* MGLAccountManager.h in Headers */,
DA8848511CBAFB9800AB86E3 /* MGLAPIClient.h in Headers */,
DA35A2C91CCAAAD200E826B2 /* NSValue+MGLAdditions.h in Headers */,
- 350098CF1D482E10004B2AF0 /* NSArray+MGLStyleAttributeAdditions_Private.h in Headers */,
3510FFEA1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.h in Headers */,
DA6408DB1DA4E7D300908C90 /* MGLVectorStyleLayer.h in Headers */,
DD0902AB1DB192A800C5BDCE /* MGLNetworkConfiguration.h in Headers */,
DA8848571CBAFB9800AB86E3 /* MGLMapboxEvents.h in Headers */,
DA8848311CBAFA6200AB86E3 /* NSString+MGLAdditions.h in Headers */,
353933F81D3FB79F003F57D7 /* MGLLineStyleLayer.h in Headers */,
+ DAAF722D1DA903C700312FA4 /* MGLStyleValue_Private.h in Headers */,
DA8847F41CBAFA5100AB86E3 /* MGLOfflinePack.h in Headers */,
DA88482E1CBAFA6200AB86E3 /* NSException+MGLAdditions.h in Headers */,
DA8848551CBAFB9800AB86E3 /* MGLLocationManager.h in Headers */,
408AA8571DAEDA1700022900 /* NSDictionary+MGLAdditions.h in Headers */,
- 350098C11D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.h in Headers */,
DA88483F1CBAFB8500AB86E3 /* MGLUserLocation.h in Headers */,
DA88483D1CBAFB8500AB86E3 /* MGLMapView+IBAdditions.h in Headers */,
DA17BE301CC4BAC300402C41 /* MGLMapView_Private.h in Headers */,
@@ -1514,9 +1439,9 @@
35CE61821D4165D9004F2359 /* UIColor+MGLAdditions.h in Headers */,
35B82BF81D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */,
DA35A29E1CC9E94C00E826B2 /* MGLCoordinateFormatter.h in Headers */,
+ DAAF722B1DA903C700312FA4 /* MGLStyleValue.h in Headers */,
DA8847F71CBAFA5100AB86E3 /* MGLOverlay.h in Headers */,
DA35A2B11CCA141D00E826B2 /* MGLCompassDirectionFormatter.h in Headers */,
- 350098D31D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.h in Headers */,
DA88488B1CBB037E00AB86E3 /* SMCalloutView.h in Headers */,
DA8847FE1CBAFA5100AB86E3 /* MGLTypes.h in Headers */,
DA8847F11CBAFA5100AB86E3 /* MGLGeometry.h in Headers */,
@@ -1531,20 +1456,16 @@
DAD1656C1CF41981001FF4B9 /* MGLFeature.h in Headers */,
40EDA1C01CFE0E0200D9EA68 /* MGLAnnotationContainerView.h in Headers */,
DA88484F1CBAFB9800AB86E3 /* MGLAnnotationImage_Private.h in Headers */,
- 3534C7921D4BC95400D874A4 /* MGLStyleAttributeFunction_Private.h in Headers */,
DA8847F21CBAFA5100AB86E3 /* MGLMapCamera.h in Headers */,
3538AA1D1D542239008EC33D /* MGLForegroundStyleLayer.h in Headers */,
DA8847F51CBAFA5100AB86E3 /* MGLOfflineRegion.h in Headers */,
DA737EE11D056A4E005BDA16 /* MGLMapViewDelegate.h in Headers */,
DA8848851CBB033F00AB86E3 /* FABKitProtocol.h in Headers */,
DA88481B1CBAFA6200AB86E3 /* MGLGeometry_Private.h in Headers */,
- 350098CA1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h in Headers */,
- 350098AF1D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h in Headers */,
3510FFF91D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.h in Headers */,
404C26E71D89C55D000AA13D /* MGLTileSet_Private.h in Headers */,
DA88485C1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.h in Headers */,
DA8848871CBB033F00AB86E3 /* Fabric.h in Headers */,
- 350098D81D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h in Headers */,
35305D4A1D22AA6A0007D005 /* NSData+MGLAdditions.h in Headers */,
359F57461D2FDDA6005217F1 /* MGLUserLocationAnnotationView_Private.h in Headers */,
404C26E21D89B877000AA13D /* MGLTileSet.h in Headers */,
@@ -1553,7 +1474,6 @@
DA88482F1CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h in Headers */,
DA8848601CBAFC2E00AB86E3 /* Mapbox.h in Headers */,
350098BB1D480108004B2AF0 /* MGLVectorSource.h in Headers */,
- 3534C7951D4BD1D400D874A4 /* MGLStyleAttributeValue_Private.h in Headers */,
DA8847F61CBAFA5100AB86E3 /* MGLOfflineStorage.h in Headers */,
DAD1656E1CF41981001FF4B9 /* MGLFeature_Private.h in Headers */,
DA88483C1CBAFB8500AB86E3 /* MGLMapView.h in Headers */,
@@ -1570,12 +1490,9 @@
353933FC1D3FB7C0003F57D7 /* MGLRasterStyleLayer.h in Headers */,
3566C76D1D4A8DFA008152BC /* MGLRasterSource.h in Headers */,
DAED38641D62D0FC00D7640F /* NSURL+MGLAdditions.h in Headers */,
- 35599DEC1D46F14E0048254D /* MGLStyleAttributeFunction.h in Headers */,
DABFB85E1CBE99E500D62B32 /* MGLAnnotation.h in Headers */,
- 350098D01D482E10004B2AF0 /* NSArray+MGLStyleAttributeAdditions_Private.h in Headers */,
DABFB8641CBE99E500D62B32 /* MGLOfflineStorage.h in Headers */,
DAD165791CF4CDFF001FF4B9 /* MGLShapeCollection.h in Headers */,
- 350098D41D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.h in Headers */,
3566C7671D4A77BA008152BC /* MGLGeoJSONSource.h in Headers */,
DA35A29F1CC9E94C00E826B2 /* MGLCoordinateFormatter.h in Headers */,
DABFB8711CBE9A0F00D62B32 /* MGLMapView+MGLCustomStyleLayerAdditions.h in Headers */,
@@ -1587,38 +1504,30 @@
DABFB8721CBE9A0F00D62B32 /* MGLUserLocation.h in Headers */,
3566C7721D4A9198008152BC /* MGLSource_Private.h in Headers */,
353933FF1D3FB7DD003F57D7 /* MGLSymbolStyleLayer.h in Headers */,
+ DAAF722E1DA903C700312FA4 /* MGLStyleValue_Private.h in Headers */,
DABFB8661CBE99E500D62B32 /* MGLPointAnnotation.h in Headers */,
- 35599DF11D46F3A60048254D /* MGLStyleAttributeValue.h in Headers */,
DABFB8621CBE99E500D62B32 /* MGLOfflinePack.h in Headers */,
DAD1656D1CF41981001FF4B9 /* MGLFeature.h in Headers */,
DA17BE311CC4BDAA00402C41 /* MGLMapView_Private.h in Headers */,
DABFB86C1CBE99E500D62B32 /* MGLTypes.h in Headers */,
- 350098C21D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.h in Headers */,
DABFB8691CBE99E500D62B32 /* MGLShape.h in Headers */,
- 350098CB1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h in Headers */,
3510FFEB1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.h in Headers */,
35E1A4D91D74336F007AA97F /* MGLValueEvaluator.h in Headers */,
7E016D7F1D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.h in Headers */,
DABFB8701CBE9A0F00D62B32 /* MGLMapView+IBAdditions.h in Headers */,
353AFA151D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */,
- 350098D91D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h in Headers */,
3510FFFA1D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.h in Headers */,
35CE61831D4165D9004F2359 /* UIColor+MGLAdditions.h in Headers */,
- 350098B01D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h in Headers */,
DABFB8671CBE99E500D62B32 /* MGLPolygon.h in Headers */,
- 350098C71D48288B004B2AF0 /* NSNumber+MGLStyleAttributeAdditions_Private.h in Headers */,
404C26E81D89C55D000AA13D /* MGLTileSet_Private.h in Headers */,
- 3593E5221D529C29006D9365 /* MGLStyleAttribute.h in Headers */,
+ DAAF722C1DA903C700312FA4 /* MGLStyleValue.h in Headers */,
DABFB8651CBE99E500D62B32 /* MGLOverlay.h in Headers */,
35E79F211D41266300957B9E /* MGLStyleLayer_Private.h in Headers */,
350098DD1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.h in Headers */,
- 3534C7961D4BD1D400D874A4 /* MGLStyleAttributeValue_Private.h in Headers */,
DABFB8681CBE99E500D62B32 /* MGLPolyline.h in Headers */,
- 3534C7931D4BC95400D874A4 /* MGLStyleAttributeFunction_Private.h in Headers */,
DABFB86F1CBE9A0F00D62B32 /* MGLMapView.h in Headers */,
DA6408DC1DA4E7D300908C90 /* MGLVectorStyleLayer.h in Headers */,
353933F31D3FB753003F57D7 /* MGLCircleStyleLayer.h in Headers */,
- 3593E5271D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h in Headers */,
3538AA1E1D542239008EC33D /* MGLForegroundStyleLayer.h in Headers */,
30E578181DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */,
40F887711D7A1E59008ECB67 /* MGLGeoJSONSource_Private.h in Headers */,
@@ -1629,7 +1538,6 @@
DABFB86B1CBE99E500D62B32 /* MGLTilePyramidOfflineRegion.h in Headers */,
4018B1CB1CDC288E00F666AF /* MGLAnnotationView.h in Headers */,
DABFB85F1CBE99E500D62B32 /* MGLGeometry.h in Headers */,
- 354D42DD1D4919F900F400A1 /* NSValue+MGLStyleAttributeAdditions_Private.h in Headers */,
7E016D851D9E890300A29A21 /* MGLPolygon+MGLAdditions.h in Headers */,
353933F61D3FB785003F57D7 /* MGLBackgroundStyleLayer.h in Headers */,
DABFB85D1CBE99E500D62B32 /* MGLAccountManager.h in Headers */,
@@ -1981,14 +1889,10 @@
35136D391D42271A00C20EFD /* MGLBackgroundStyleLayer.mm in Sources */,
3510FFEC1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */,
7E016D801D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.m in Sources */,
- 350098D51D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.mm in Sources */,
- 3593E5231D529C29006D9365 /* MGLStyleAttribute.mm in Sources */,
- 350098B11D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.mm in Sources */,
DAED38651D62D0FC00D7640F /* NSURL+MGLAdditions.m in Sources */,
354B83981D2E873E005D9406 /* MGLUserLocationAnnotationView.m in Sources */,
DA88485D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m in Sources */,
DAD165701CF41981001FF4B9 /* MGLFeature.mm in Sources */,
- 350098C31D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.mm in Sources */,
30E578191DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */,
40EDA1C11CFE0E0500D9EA68 /* MGLAnnotationContainerView.m in Sources */,
DA8848541CBAFB9800AB86E3 /* MGLCompactCalloutView.m in Sources */,
@@ -2008,9 +1912,8 @@
35136D4E1D4277FC00C20EFD /* MGLSource.mm in Sources */,
DA35A2B81CCA9A5D00E826B2 /* MGLClockDirectionFormatter.m in Sources */,
DAD1657A1CF4CDFF001FF4B9 /* MGLShapeCollection.m in Sources */,
- 350098CC1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.mm in Sources */,
35136D451D42275100C20EFD /* MGLSymbolStyleLayer.mm in Sources */,
- 35599DED1D46F14E0048254D /* MGLStyleAttributeFunction.mm in Sources */,
+ 35599DED1D46F14E0048254D /* MGLStyleValue.mm in Sources */,
DA8848211CBAFA6200AB86E3 /* MGLOfflinePack.mm in Sources */,
DA8848591CBAFB9800AB86E3 /* MGLMapView.mm in Sources */,
DA8848501CBAFB9800AB86E3 /* MGLAnnotationImage.m in Sources */,
@@ -2057,14 +1960,10 @@
35136D3A1D42271A00C20EFD /* MGLBackgroundStyleLayer.mm in Sources */,
3510FFED1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */,
7E016D811D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.m in Sources */,
- 350098D61D4830A6004B2AF0 /* NSString+MGLStyleAttributeAdditions.mm in Sources */,
354B83991D2E873E005D9406 /* MGLUserLocationAnnotationView.m in Sources */,
DAA4E4221CBB730400178DFB /* MGLPointAnnotation.mm in Sources */,
- 3593E5241D529C29006D9365 /* MGLStyleAttribute.mm in Sources */,
- 350098B21D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.mm in Sources */,
DAED38661D62D0FC00D7640F /* NSURL+MGLAdditions.m in Sources */,
DAD165711CF41981001FF4B9 /* MGLFeature.mm in Sources */,
- 350098C41D48149E004B2AF0 /* NSNumber+MGLStyleAttributeAdditions.mm in Sources */,
30E5781A1DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */,
40EDA1C21CFE0E0500D9EA68 /* MGLAnnotationContainerView.m in Sources */,
DAA4E4291CBB730400178DFB /* NSBundle+MGLAdditions.m in Sources */,
@@ -2084,10 +1983,9 @@
35136D4F1D4277FC00C20EFD /* MGLSource.mm in Sources */,
DA35A2B91CCA9A5D00E826B2 /* MGLClockDirectionFormatter.m in Sources */,
DAD1657B1CF4CDFF001FF4B9 /* MGLShapeCollection.m in Sources */,
- 350098CD1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.mm in Sources */,
DAA4E4251CBB730400178DFB /* MGLShape.mm in Sources */,
35136D461D42275100C20EFD /* MGLSymbolStyleLayer.mm in Sources */,
- 35599DEE1D46F14E0048254D /* MGLStyleAttributeFunction.mm in Sources */,
+ 35599DEE1D46F14E0048254D /* MGLStyleValue.mm in Sources */,
DAA4E42B1CBB730400178DFB /* NSString+MGLAdditions.m in Sources */,
DAA4E4261CBB730400178DFB /* MGLStyle.mm in Sources */,
DAA4E41D1CBB730400178DFB /* MGLGeometry.mm in Sources */,
diff --git a/platform/ios/src/Mapbox.h b/platform/ios/src/Mapbox.h
index a187737023..04892eb6a1 100644
--- a/platform/ios/src/Mapbox.h
+++ b/platform/ios/src/Mapbox.h
@@ -50,11 +50,5 @@ FOUNDATION_EXPORT const unsigned char MapboxVersionString[];
#import "MGLUserLocation.h"
#import "MGLUserLocationAnnotationView.h"
#import "NSValue+MGLAdditions.h"
-#import "MGLStyleAttributeValue.h"
-#import "MGLStyleAttributeFunction.h"
-#import "UIColor+MGLStyleAttributeAdditions.h"
-#import "NSNumber+MGLStyleAttributeAdditions.h"
-#import "NSValue+MGLStyleAttributeAdditions.h"
-#import "NSString+MGLStyleAttributeAdditions.h"
-#import "NSArray+MGLStyleAttributeAdditions.h"
+#import "MGLStyleValue.h"
#import "MGLTileSet.h"
diff --git a/platform/ios/src/UIColor+MGLAdditions.mm b/platform/ios/src/UIColor+MGLAdditions.mm
index 5a4b4b49f3..52ec84ac84 100644
--- a/platform/ios/src/UIColor+MGLAdditions.mm
+++ b/platform/ios/src/UIColor+MGLAdditions.mm
@@ -1,8 +1,5 @@
#import "UIColor+MGLAdditions.h"
-#import "MGLStyleAttributeValue.h"
-#import "MGLStyleAttributeValue_Private.h"
-
@implementation UIColor (MGLAdditions)
- (mbgl::Color)mbgl_color
diff --git a/platform/ios/src/UIColor+MGLStyleAttributeAdditions.h b/platform/ios/src/UIColor+MGLStyleAttributeAdditions.h
deleted file mode 100644
index 3637ceab6c..0000000000
--- a/platform/ios/src/UIColor+MGLStyleAttributeAdditions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#import <UIKit/UIKit.h>
-
-#import "MGLStyleAttributeValue.h"
-
-@interface UIColor (MGLStyleAttributeAdditions) <MGLStyleAttributeValue>
-
-@end
diff --git a/platform/ios/src/UIColor+MGLStyleAttributeAdditions.mm b/platform/ios/src/UIColor+MGLStyleAttributeAdditions.mm
deleted file mode 100644
index 5a9ac3afe9..0000000000
--- a/platform/ios/src/UIColor+MGLStyleAttributeAdditions.mm
+++ /dev/null
@@ -1,14 +0,0 @@
-#import "UIColor+MGLStyleAttributeAdditions.h"
-
-#import "MGLStyleAttributeValue.h"
-#import "MGLStyleAttributeValue_Private.h"
-#import "UIColor+MGLAdditions.h"
-
-@implementation UIColor (MGLStyleAttributeAdditions)
-
-- (BOOL)isFunction
-{
- return NO;
-}
-
-@end
diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m
index 505678fcc2..e4fe202f3f 100644
--- a/platform/macos/app/MapDocument.m
+++ b/platform/macos/app/MapDocument.m
@@ -494,12 +494,11 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio
- (IBAction)manipulateStyle:(id)sender {
MGLFillStyleLayer *fillStyleLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"water"];
- MGLStyleAttributeFunction *colorFunction = [[MGLStyleAttributeFunction alloc] init];
- colorFunction.stops = @{
- @0.0: [NSColor redColor],
- @10.0: [NSColor yellowColor],
- @20.0: [NSColor blackColor],
- };
+ MGLStyleValue *colorFunction = [MGLStyleValue<NSColor *> valueWithStops:@{
+ @0.0: [MGLStyleValue<NSColor *> valueWithRawValue:[NSColor redColor]],
+ @10.0: [MGLStyleValue<NSColor *> valueWithRawValue:[NSColor yellowColor]],
+ @20.0: [MGLStyleValue<NSColor *> valueWithRawValue:[NSColor blackColor]],
+ }];
fillStyleLayer.fillColor = colorFunction;
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
@@ -508,7 +507,7 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio
[self.mapView.style addSource:source];
MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"test" source:source];
- fillLayer.fillColor = [NSColor greenColor];
+ fillLayer.fillColor = [MGLStyleValue<NSColor *> valueWithRawValue:[NSColor greenColor]];
fillLayer.predicate = [NSPredicate predicateWithFormat:@"%K == %@", @"type", @"park"];
[self.mapView.style addLayer:fillLayer];
}
diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj
index f3da3c0f0e..0d8b4fd22f 100644
--- a/platform/macos/macos.xcodeproj/project.pbxproj
+++ b/platform/macos/macos.xcodeproj/project.pbxproj
@@ -10,9 +10,7 @@
30E5781B1DAA857E0050F07E /* NSImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */; };
3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */; };
3508EC651D749D39009B0EE4 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */; };
- 352742781D4C220900A1ECE6 /* MGLStyleAttributeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742771D4C220900A1ECE6 /* MGLStyleAttributeValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 3527427C1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527427A1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 3527427D1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3527427B1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.m */; };
+ 352742781D4C220900A1ECE6 /* MGLStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742771D4C220900A1ECE6 /* MGLStyleValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
352742811D4C243B00A1ECE6 /* MGLSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527427F1D4C243B00A1ECE6 /* MGLSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
352742821D4C243B00A1ECE6 /* MGLSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742801D4C243B00A1ECE6 /* MGLSource.mm */; };
352742851D4C244700A1ECE6 /* MGLRasterSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742831D4C244700A1ECE6 /* MGLRasterSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -21,9 +19,7 @@
3527428A1D4C245800A1ECE6 /* MGLGeoJSONSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742881D4C245800A1ECE6 /* MGLGeoJSONSource.mm */; };
3527428D1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527428B1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
3527428E1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527428C1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm */; };
- 3527429F1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527429C1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction_Private.h */; };
- 352742A01D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527429D1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 352742A11D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527429E1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.mm */; };
+ 352742A11D4C25BD00A1ECE6 /* MGLStyleValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527429E1D4C25BD00A1ECE6 /* MGLStyleValue.mm */; };
3529039B1D6C63B80002C7DF /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */; };
3529039C1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3529039A1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm */; };
3537CA741D3F93A600380318 /* MGLStyle_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3537CA731D3F93A600380318 /* MGLStyle_Private.h */; };
@@ -38,9 +34,6 @@
35602C001D3EA9B40050646F /* MGLForegroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
35602C011D3EA9B40050646F /* MGLForegroundStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.m */; };
35724FC41D630502002A4AB4 /* amsterdam.geojson in Resources */ = {isa = PBXBuildFile; fileRef = 358EB3AE1D61F0DB00E46D9C /* amsterdam.geojson */; };
- 3593E52A1D52A628006D9365 /* MGLStyleAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 3593E5281D52A628006D9365 /* MGLStyleAttribute.h */; };
- 3593E52B1D52A628006D9365 /* MGLStyleAttribute.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3593E5291D52A628006D9365 /* MGLStyleAttribute.mm */; };
- 3593E52D1D52A680006D9365 /* NSColor+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3593E52C1D52A680006D9365 /* NSColor+MGLStyleAttributeAdditions_Private.h */; };
35C5D8471D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C5D8431D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h */; };
35C5D8481D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D8441D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm */; };
35C5D8491D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C5D8451D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h */; };
@@ -98,19 +91,9 @@
DA8F25971D51CAC70010E6B5 /* MGLVectorSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25951D51CAC70010E6B5 /* MGLVectorSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
DA8F25981D51CAC70010E6B5 /* MGLVectorSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25961D51CAC70010E6B5 /* MGLVectorSource.mm */; };
DA8F259A1D51CAD00010E6B5 /* MGLSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25991D51CAD00010E6B5 /* MGLSource_Private.h */; };
- DA8F259C1D51CB000010E6B5 /* MGLStyleAttributeValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F259B1D51CB000010E6B5 /* MGLStyleAttributeValue_Private.h */; };
- DA8F25A91D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F259D1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- DA8F25AA1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F259E1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.mm */; };
- DA8F25AB1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F259F1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions_Private.h */; };
- DA8F25AC1D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A01D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- DA8F25AD1D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25A11D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.mm */; };
- DA8F25AE1D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A21D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions_Private.h */; };
- DA8F25AF1D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A31D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- DA8F25B01D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25A41D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.mm */; };
- DA8F25B11D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A51D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions_Private.h */; };
- DA8F25B21D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ DA8F259C1D51CB000010E6B5 /* MGLStyleValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F259B1D51CB000010E6B5 /* MGLStyleValue_Private.h */; };
+ DA8F25B21D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */; };
DA8F25B31D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */; };
- DA8F25B41D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A81D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions_Private.h */; };
DAC2ABC51CC6D343006D18C4 /* MGLAnnotationImage_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */; };
DACC22141CF3D3E200D220D9 /* MGLFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = DACC22121CF3D3E200D220D9 /* MGLFeature.h */; settings = {ATTRIBUTES = (Public, ); }; };
DACC22151CF3D3E200D220D9 /* MGLFeature.mm in Sources */ = {isa = PBXBuildFile; fileRef = DACC22131CF3D3E200D220D9 /* MGLFeature.mm */; };
@@ -233,9 +216,7 @@
30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSImage+MGLAdditions.h"; path = "src/NSImage+MGLAdditions.h"; sourceTree = SOURCE_ROOT; };
3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = "<group>"; };
3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSExpression+MGLAdditions.mm"; sourceTree = "<group>"; };
- 352742771D4C220900A1ECE6 /* MGLStyleAttributeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttributeValue.h; sourceTree = "<group>"; };
- 3527427A1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSColor+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
- 3527427B1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSColor+MGLStyleAttributeAdditions.m"; sourceTree = "<group>"; };
+ 352742771D4C220900A1ECE6 /* MGLStyleValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleValue.h; sourceTree = "<group>"; };
3527427F1D4C243B00A1ECE6 /* MGLSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSource.h; sourceTree = "<group>"; };
352742801D4C243B00A1ECE6 /* MGLSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLSource.mm; sourceTree = "<group>"; };
352742831D4C244700A1ECE6 /* MGLRasterSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterSource.h; sourceTree = "<group>"; };
@@ -244,9 +225,7 @@
352742881D4C245800A1ECE6 /* MGLGeoJSONSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLGeoJSONSource.mm; sourceTree = "<group>"; };
3527428B1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCircleStyleLayer.h; sourceTree = "<group>"; };
3527428C1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLCircleStyleLayer.mm; sourceTree = "<group>"; };
- 3527429C1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttributeFunction_Private.h; sourceTree = "<group>"; };
- 3527429D1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttributeFunction.h; sourceTree = "<group>"; };
- 3527429E1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleAttributeFunction.mm; sourceTree = "<group>"; };
+ 3527429E1D4C25BD00A1ECE6 /* MGLStyleValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleValue.mm; sourceTree = "<group>"; };
352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLAdditions.h"; sourceTree = "<group>"; };
3529039A1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSPredicate+MGLAdditions.mm"; sourceTree = "<group>"; };
3537CA731D3F93A600380318 /* MGLStyle_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyle_Private.h; sourceTree = "<group>"; };
@@ -260,9 +239,6 @@
35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer.h; sourceTree = "<group>"; };
35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLForegroundStyleLayer.m; sourceTree = "<group>"; };
358EB3AE1D61F0DB00E46D9C /* amsterdam.geojson */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = amsterdam.geojson; path = ../../darwin/test/amsterdam.geojson; sourceTree = "<group>"; };
- 3593E5281D52A628006D9365 /* MGLStyleAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttribute.h; sourceTree = "<group>"; };
- 3593E5291D52A628006D9365 /* MGLStyleAttribute.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleAttribute.mm; sourceTree = "<group>"; };
- 3593E52C1D52A680006D9365 /* NSColor+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSColor+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
35C5D8431D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSComparisonPredicate+MGLAdditions.h"; sourceTree = "<group>"; };
35C5D8441D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSComparisonPredicate+MGLAdditions.mm"; sourceTree = "<group>"; };
35C5D8451D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCompoundPredicate+MGLAdditions.h"; sourceTree = "<group>"; };
@@ -338,19 +314,9 @@
DA8F25951D51CAC70010E6B5 /* MGLVectorSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorSource.h; sourceTree = "<group>"; };
DA8F25961D51CAC70010E6B5 /* MGLVectorSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLVectorSource.mm; sourceTree = "<group>"; };
DA8F25991D51CAD00010E6B5 /* MGLSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSource_Private.h; sourceTree = "<group>"; };
- DA8F259B1D51CB000010E6B5 /* MGLStyleAttributeValue_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttributeValue_Private.h; sourceTree = "<group>"; };
- DA8F259D1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNumber+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
- DA8F259E1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSNumber+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
- DA8F259F1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNumber+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
- DA8F25A01D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
- DA8F25A11D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSArray+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
- DA8F25A21D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
- DA8F25A31D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
- DA8F25A41D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSString+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
- DA8F25A51D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
+ DA8F259B1D51CB000010E6B5 /* MGLStyleValue_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleValue_Private.h; sourceTree = "<group>"; };
DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSValue+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
- DA8F25A81D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
DA8F25B51D51D2240010E6B5 /* MGLRuntimeStylingTests.m.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLRuntimeStylingTests.m.ejs; sourceTree = "<group>"; };
DA8F25B61D51D2240010E6B5 /* MGLStyleLayer.h.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.h.ejs; sourceTree = "<group>"; };
DA8F25B71D51D2240010E6B5 /* MGLStyleLayer.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.mm.ejs; sourceTree = "<group>"; };
@@ -509,19 +475,6 @@
352742791D4C235C00A1ECE6 /* Categories */ = {
isa = PBXGroup;
children = (
- DA8F25A21D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions_Private.h */,
- DA8F25A01D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.h */,
- DA8F25A11D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.mm */,
- 3593E52C1D52A680006D9365 /* NSColor+MGLStyleAttributeAdditions_Private.h */,
- 3527427A1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.h */,
- 3527427B1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.m */,
- DA8F259F1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions_Private.h */,
- DA8F259D1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.h */,
- DA8F259E1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.mm */,
- DA8F25A51D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions_Private.h */,
- DA8F25A31D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.h */,
- DA8F25A41D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.mm */,
- DA8F25A81D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions_Private.h */,
DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */,
DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */,
);
@@ -550,13 +503,9 @@
352742791D4C235C00A1ECE6 /* Categories */,
35136D471D42295400C20EFD /* Layers */,
3527427E1D4C242B00A1ECE6 /* Sources */,
- 3527429D1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.h */,
- 3527429C1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction_Private.h */,
- 3527429E1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.mm */,
- 3593E5281D52A628006D9365 /* MGLStyleAttribute.h */,
- 3593E5291D52A628006D9365 /* MGLStyleAttribute.mm */,
- 352742771D4C220900A1ECE6 /* MGLStyleAttributeValue.h */,
- DA8F259B1D51CB000010E6B5 /* MGLStyleAttributeValue_Private.h */,
+ 352742771D4C220900A1ECE6 /* MGLStyleValue.h */,
+ DA8F259B1D51CB000010E6B5 /* MGLStyleValue_Private.h */,
+ 3527429E1D4C25BD00A1ECE6 /* MGLStyleValue.mm */,
);
name = Styling;
sourceTree = "<group>";
@@ -679,6 +628,17 @@
path = ../../darwin/src;
sourceTree = "<group>";
};
+ DA90B12C1DB43B180073CF55 /* Categories */ = {
+ isa = PBXGroup;
+ children = (
+ 355BA4EB1D41633E00CCC6D5 /* NSColor+MGLAdditions.h */,
+ 355BA4EC1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm */,
+ 405C03961DB0004E001AC280 /* NSImage+MGLAdditions.h */,
+ 405C03971DB0004E001AC280 /* NSImage+MGLAdditions.mm */,
+ );
+ name = Categories;
+ sourceTree = "<group>";
+ };
DAD1657C1CF4CE6B001FF4B9 /* Formatters */ = {
isa = PBXGroup;
children = (
@@ -852,8 +812,7 @@
DAE6C39E1CC31E7C00DB3429 /* Kit */ = {
isa = PBXGroup;
children = (
- 405C03961DB0004E001AC280 /* NSImage+MGLAdditions.h */,
- 405C03971DB0004E001AC280 /* NSImage+MGLAdditions.mm */,
+ DA90B12C1DB43B180073CF55 /* Categories */,
DAE6C39F1CC31E9400DB3429 /* MGLAnnotationImage.h */,
DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */,
DAE6C3A71CC31EF300DB3429 /* MGLAnnotationImage.m */,
@@ -869,8 +828,6 @@
DAE6C3A21CC31E9400DB3429 /* MGLMapViewDelegate.h */,
DAE6C3AF1CC31EF300DB3429 /* MGLOpenGLLayer.h */,
DAE6C3B01CC31EF300DB3429 /* MGLOpenGLLayer.mm */,
- 355BA4EB1D41633E00CCC6D5 /* NSColor+MGLAdditions.h */,
- 355BA4EC1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm */,
);
name = Kit;
path = src;
@@ -891,14 +848,11 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 3593E52D1D52A680006D9365 /* NSColor+MGLStyleAttributeAdditions_Private.h in Headers */,
DA8F258F1D51CA600010E6B5 /* MGLRasterStyleLayer.h in Headers */,
3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */,
DAE6C38D1CC31E2A00DB3429 /* MGLOfflineRegion_Private.h in Headers */,
408AA8651DAEEE3400022900 /* MGLPolygon+MGLAdditions.h in Headers */,
- DA8F25AB1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions_Private.h in Headers */,
- DA8F259C1D51CB000010E6B5 /* MGLStyleAttributeValue_Private.h in Headers */,
- DA8F25B41D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions_Private.h in Headers */,
+ DA8F259C1D51CB000010E6B5 /* MGLStyleValue_Private.h in Headers */,
DAE6C35B1CC31E0400DB3429 /* MGLAnnotation.h in Headers */,
DAE6C3B61CC31EF300DB3429 /* MGLMapView_Private.h in Headers */,
3527428D1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h in Headers */,
@@ -907,16 +861,14 @@
35C5D8471D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h in Headers */,
DAE6C3A31CC31E9400DB3429 /* MGLAnnotationImage.h in Headers */,
DAE6C3A41CC31E9400DB3429 /* MGLMapView.h in Headers */,
- 352742A01D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.h in Headers */,
355BA4ED1D41633E00CCC6D5 /* NSColor+MGLAdditions.h in Headers */,
DAE6C3611CC31E0400DB3429 /* MGLOfflineStorage.h in Headers */,
- 352742781D4C220900A1ECE6 /* MGLStyleAttributeValue.h in Headers */,
+ 352742781D4C220900A1ECE6 /* MGLStyleValue.h in Headers */,
DAE6C35E1CC31E0400DB3429 /* MGLMultiPoint.h in Headers */,
35602BFF1D3EA9B40050646F /* MGLStyleLayer_Private.h in Headers */,
DAE6C3971CC31E2A00DB3429 /* NSBundle+MGLAdditions.h in Headers */,
DAED385F1D62CED700D7640F /* NSURL+MGLAdditions.h in Headers */,
DAD165741CF4CD7A001FF4B9 /* MGLShapeCollection.h in Headers */,
- DA8F25AF1D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.h in Headers */,
DAE6C3631CC31E0400DB3429 /* MGLPointAnnotation.h in Headers */,
DAC2ABC51CC6D343006D18C4 /* MGLAnnotationImage_Private.h in Headers */,
DAE6C35F1CC31E0400DB3429 /* MGLOfflinePack.h in Headers */,
@@ -926,20 +878,16 @@
DAE6C3861CC31E2A00DB3429 /* MGLGeometry_Private.h in Headers */,
DAE6C3841CC31E2A00DB3429 /* MGLAccountManager_Private.h in Headers */,
DAE6C3691CC31E0400DB3429 /* MGLTypes.h in Headers */,
- DA8F25AE1D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions_Private.h in Headers */,
DAE6C3991CC31E2A00DB3429 /* NSException+MGLAdditions.h in Headers */,
DA8F25871D51C9E10010E6B5 /* MGLBackgroundStyleLayer.h in Headers */,
30E5781B1DAA857E0050F07E /* NSImage+MGLAdditions.h in Headers */,
DAE6C3661CC31E0400DB3429 /* MGLShape.h in Headers */,
352742811D4C243B00A1ECE6 /* MGLSource.h in Headers */,
DAE6C3C21CC31F4500DB3429 /* Mapbox.h in Headers */,
- 3527427C1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.h in Headers */,
DAE6C3641CC31E0400DB3429 /* MGLPolygon.h in Headers */,
DA35A2BF1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.h in Headers */,
35602BFA1D3EA99F0050646F /* MGLFillStyleLayer.h in Headers */,
DA35A2A41CC9EB1A00E826B2 /* MGLCoordinateFormatter.h in Headers */,
- DA8F25B11D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions_Private.h in Headers */,
- 3593E52A1D52A628006D9365 /* MGLStyleAttribute.h in Headers */,
35C5D8491D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h in Headers */,
DD0902B31DB1AC6400C5BDCE /* MGLNetworkConfiguration.h in Headers */,
DAE6C3621CC31E0400DB3429 /* MGLOverlay.h in Headers */,
@@ -951,8 +899,6 @@
408AA8661DAEEE3600022900 /* MGLPolyline+MGLAdditions.h in Headers */,
DAE6C3601CC31E0400DB3429 /* MGLOfflineRegion.h in Headers */,
DAE6C3681CC31E0400DB3429 /* MGLTilePyramidOfflineRegion.h in Headers */,
- DA8F25AC1D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.h in Headers */,
- 3527429F1D4C25BD00A1ECE6 /* MGLStyleAttributeFunction_Private.h in Headers */,
DA35A2CF1CCAAED300E826B2 /* NSValue+MGLAdditions.h in Headers */,
DAE6C3A61CC31E9400DB3429 /* MGLMapViewDelegate.h in Headers */,
DAE6C38B1CC31E2A00DB3429 /* MGLOfflinePack_Private.h in Headers */,
@@ -963,7 +909,6 @@
35602C001D3EA9B40050646F /* MGLForegroundStyleLayer.h in Headers */,
DAE6C35D1CC31E0400DB3429 /* MGLMapCamera.h in Headers */,
DAE6C3B41CC31EF300DB3429 /* MGLCompassCell.h in Headers */,
- DA8F25A91D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.h in Headers */,
3537CA741D3F93A600380318 /* MGLStyle_Private.h in Headers */,
DA8F259A1D51CAD00010E6B5 /* MGLSource_Private.h in Headers */,
DA8F25931D51CA750010E6B5 /* MGLSymbolStyleLayer.h in Headers */,
@@ -1162,7 +1107,6 @@
40ABDB561DB0022100372083 /* NSImage+MGLAdditions.mm in Sources */,
DAE6C3901CC31E2A00DB3429 /* MGLPointAnnotation.mm in Sources */,
DAE6C3981CC31E2A00DB3429 /* NSBundle+MGLAdditions.m in Sources */,
- DA8F25AA1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.mm in Sources */,
DAE6C3B71CC31EF300DB3429 /* MGLMapView.mm in Sources */,
40B77E461DB11BCD003DA2FE /* NSArray+MGLAdditions.mm in Sources */,
DAE6C38C1CC31E2A00DB3429 /* MGLOfflinePack.mm in Sources */,
@@ -1182,7 +1126,6 @@
3527428E1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm in Sources */,
35602C011D3EA9B40050646F /* MGLForegroundStyleLayer.m in Sources */,
408AA86A1DAEEE5D00022900 /* NSDictionary+MGLAdditions.mm in Sources */,
- 3527427D1D4C238F00A1ECE6 /* NSColor+MGLStyleAttributeAdditions.m in Sources */,
DA8F25881D51C9E10010E6B5 /* MGLBackgroundStyleLayer.mm in Sources */,
DAE6C3B81CC31EF300DB3429 /* MGLMapView+IBAdditions.mm in Sources */,
DA35A2D01CCAAED300E826B2 /* NSValue+MGLAdditions.m in Sources */,
@@ -1203,9 +1146,7 @@
35C5D84A1D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.mm in Sources */,
408AA8681DAEEE5200022900 /* MGLPolygon+MGLAdditions.m in Sources */,
DAE6C3951CC31E2A00DB3429 /* MGLTilePyramidOfflineRegion.mm in Sources */,
- 3593E52B1D52A628006D9365 /* MGLStyleAttribute.mm in Sources */,
DAE6C3851CC31E2A00DB3429 /* MGLAccountManager.m in Sources */,
- DA8F25B01D51CB270010E6B5 /* NSString+MGLStyleAttributeAdditions.mm in Sources */,
DAE6C3921CC31E2A00DB3429 /* MGLPolyline.mm in Sources */,
3527428A1D4C245800A1ECE6 /* MGLGeoJSONSource.mm in Sources */,
DAE6C3B51CC31EF300DB3429 /* MGLCompassCell.m in Sources */,
@@ -1214,12 +1155,11 @@
35C5D8481D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm in Sources */,
DA35A2AE1CCA091800E826B2 /* MGLCompassDirectionFormatter.m in Sources */,
DA8F258C1D51CA540010E6B5 /* MGLLineStyleLayer.mm in Sources */,
- DA8F25AD1D51CB270010E6B5 /* NSArray+MGLStyleAttributeAdditions.mm in Sources */,
408AA8691DAEEE5500022900 /* MGLPolyline+MGLAdditions.m in Sources */,
DA8F25941D51CA750010E6B5 /* MGLSymbolStyleLayer.mm in Sources */,
3529039C1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm in Sources */,
DA8F25981D51CAC70010E6B5 /* MGLVectorSource.mm in Sources */,
- 352742A11D4C25BD00A1ECE6 /* MGLStyleAttributeFunction.mm in Sources */,
+ 352742A11D4C25BD00A1ECE6 /* MGLStyleValue.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/platform/macos/src/Mapbox.h b/platform/macos/src/Mapbox.h
index 6323196ba4..67e3775100 100644
--- a/platform/macos/src/Mapbox.h
+++ b/platform/macos/src/Mapbox.h
@@ -45,10 +45,4 @@ FOUNDATION_EXPORT const unsigned char MapboxVersionString[];
#import "MGLTilePyramidOfflineRegion.h"
#import "MGLTypes.h"
#import "NSValue+MGLAdditions.h"
-#import "MGLStyleAttributeValue.h"
-#import "MGLStyleAttributeFunction.h"
-#import "NSColor+MGLStyleAttributeAdditions.h"
-#import "NSNumber+MGLStyleAttributeAdditions.h"
-#import "NSValue+MGLStyleAttributeAdditions.h"
-#import "NSString+MGLStyleAttributeAdditions.h"
-#import "NSArray+MGLStyleAttributeAdditions.h"
+#import "MGLStyleValue.h"