diff options
Diffstat (limited to 'platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm')
-rw-r--r-- | platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm b/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm new file mode 100644 index 0000000000..163105d2fa --- /dev/null +++ b/platform/darwin/src/NSNumber+MGLStyleAttributeAdditions.mm @@ -0,0 +1,22 @@ +#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 |