// This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. #import "MGLSource.h" #import "NSPredicate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGLBackgroundStyleLayer.h" #include @interface MGLBackgroundStyleLayer () @property (nonatomic) mbgl::style::BackgroundLayer *layer; @end @implementation MGLBackgroundStyleLayer - (instancetype)initWithIdentifier:(NSString *)identifier { if (self = [super initWithIdentifier:identifier]) { _layer = new mbgl::style::BackgroundLayer(identifier.UTF8String); } return self; } #pragma mark - Accessing the Paint Attributes - (void)setBackgroundColor:(MGLStyleValue *)backgroundColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(backgroundColor); self.layer->setBackgroundColor(mbglValue); } - (MGLStyleValue *)backgroundColor { auto propertyValue = self.layer->getBackgroundColor() ?: self.layer->getDefaultBackgroundColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setBackgroundPattern:(MGLStyleValue *)backgroundPattern { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(backgroundPattern); self.layer->setBackgroundPattern(mbglValue); } - (MGLStyleValue *)backgroundPattern { auto propertyValue = self.layer->getBackgroundPattern() ?: self.layer->getDefaultBackgroundPattern(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setBackgroundOpacity:(MGLStyleValue *)backgroundOpacity { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(backgroundOpacity); self.layer->setBackgroundOpacity(mbglValue); } - (MGLStyleValue *)backgroundOpacity { auto propertyValue = self.layer->getBackgroundOpacity() ?: self.layer->getDefaultBackgroundOpacity(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } @end