// 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 "MGLFillStyleLayer.h" #include @interface MGLFillStyleLayer () @property (nonatomic) mbgl::style::FillLayer *layer; @end @implementation MGLFillStyleLayer - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { if (self = [super initWithIdentifier:identifier source:source]) { _layer = new mbgl::style::FillLayer(identifier.UTF8String, source.identifier.UTF8String); } return self; } - (NSString *)sourceLayerIdentifier { auto layerID = self.layer->getSourceLayer(); return layerID.empty() ? nil : @(layerID.c_str()); } - (void)setSourceLayerIdentifier:(NSString *)sourceLayerIdentifier { self.layer->setSourceLayer(sourceLayerIdentifier.UTF8String ?: ""); } - (void)setPredicate:(NSPredicate *)predicate { self.layer->setFilter(predicate.mgl_filter); } - (NSPredicate *)predicate { return [NSPredicate mgl_predicateWithFilter:self.layer->getFilter()]; } #pragma mark - Accessing the Paint Attributes - (void)setFillAntialias:(MGLStyleValue *)fillAntialias { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillAntialias); self.layer->setFillAntialias(mbglValue); } - (MGLStyleValue *)fillAntialias { auto propertyValue = self.layer->getFillAntialias() ?: self.layer->getDefaultFillAntialias(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setFillOpacity:(MGLStyleValue *)fillOpacity { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillOpacity); self.layer->setFillOpacity(mbglValue); } - (MGLStyleValue *)fillOpacity { auto propertyValue = self.layer->getFillOpacity() ?: self.layer->getDefaultFillOpacity(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setFillColor:(MGLStyleValue *)fillColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillColor); self.layer->setFillColor(mbglValue); } - (MGLStyleValue *)fillColor { auto propertyValue = self.layer->getFillColor() ?: self.layer->getDefaultFillColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setFillOutlineColor:(MGLStyleValue *)fillOutlineColor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillOutlineColor); self.layer->setFillOutlineColor(mbglValue); } - (MGLStyleValue *)fillOutlineColor { auto propertyValue = self.layer->getFillOutlineColor() ?: self.layer->getDefaultFillOutlineColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setFillTranslate:(MGLStyleValue *)fillTranslate { auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(fillTranslate); self.layer->setFillTranslate(mbglValue); } - (MGLStyleValue *)fillTranslate { auto propertyValue = self.layer->getFillTranslate() ?: self.layer->getDefaultFillTranslate(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setFillTranslateAnchor:(MGLStyleValue *)fillTranslateAnchor { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillTranslateAnchor); self.layer->setFillTranslateAnchor(mbglValue); } - (MGLStyleValue *)fillTranslateAnchor { auto propertyValue = self.layer->getFillTranslateAnchor() ?: self.layer->getDefaultFillTranslateAnchor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setFillPattern:(MGLStyleValue *)fillPattern { auto mbglValue = MGLStyleValueTransformer().toPropertyValue(fillPattern); self.layer->setFillPattern(mbglValue); } - (MGLStyleValue *)fillPattern { auto propertyValue = self.layer->getFillPattern() ?: self.layer->getDefaultFillPattern(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } @end