diff options
Diffstat (limited to 'platform/darwin/src/MGLFillStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLFillStyleLayer.mm | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm new file mode 100644 index 0000000000..95e82a2e52 --- /dev/null +++ b/platform/darwin/src/MGLFillStyleLayer.mm @@ -0,0 +1,89 @@ +// This file is generated. +// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. + +#import "MGLStyleLayer_Private.hpp" +#import "MGLStyleAttributeValue.h" +#import "MGLFillStyleLayer.h" + +#include <mbgl/style/layers/fill_layer.hpp> + +@interface MGLFillStyleLayer () + +@property (nonatomic) mbgl::style::FillLayer *layer; +@property (nonatomic, readwrite) NSString *layerIdentifier; +@property (nonatomic, readwrite) NSString *sourceIdentifier; + +@end + +@implementation MGLFillStyleLayer + +@synthesize mapView; + +- (instancetype)initWithLayerIdentifier:(NSString *)layerIdentifier sourceIdentifier:(NSString *)sourceIdentifier { + if (self = [super init]) { + _layerIdentifier = layerIdentifier; + _sourceIdentifier = sourceIdentifier; + _layer = new mbgl::style::FillLayer(layerIdentifier.UTF8String, sourceIdentifier.UTF8String); + } + return self; +} + +#pragma mark - Accessing the Paint Attributes + +- (void)setFillAntialias:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillAntialias { + self.layer->setFillAntialias(fillAntialias.mbgl_boolPropertyValue); +} + +- (id <MGLStyleAttributeValue>)fillAntialias { + return [MGLStyleAttribute mbgl_boolPropertyValueWith:self.layer->getFillAntialias()]; +} + +- (void)setFillOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillOpacity { + self.layer->setFillOpacity(fillOpacity.mbgl_floatPropertyValue); +} + +- (id <MGLStyleAttributeValue>)fillOpacity { + return [MGLStyleAttribute mbgl_numberPropertyValueWith:self.layer->getFillOpacity()]; +} + +- (void)setFillColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillColor { + self.layer->setFillColor(fillColor.mbgl_colorPropertyValue); +} + +- (id <MGLStyleAttributeValue>)fillColor { + return [MGLStyleAttribute mbgl_colorPropertyValueWith:self.layer->getFillColor()]; +} + +- (void)setFillOutlineColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillOutlineColor { + self.layer->setFillOutlineColor(fillOutlineColor.mbgl_colorPropertyValue); +} + +- (id <MGLStyleAttributeValue>)fillOutlineColor { + return [MGLStyleAttribute mbgl_colorPropertyValueWith:self.layer->getFillOutlineColor()]; +} + +- (void)setFillTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillTranslate { + self.layer->setFillTranslate(fillTranslate.mbgl_offsetPropertyValue); +} + +- (id <MGLStyleAttributeValue>)fillTranslate { + return [MGLStyleAttribute mbgl_offsetPropertyValueWith:self.layer->getFillTranslate()]; +} + +- (void)setFillTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillTranslateAnchor { + MGLSetEnumProperty(fillTranslateAnchor, FillTranslateAnchor, TranslateAnchorType, MGLFillStyleLayerFillTranslateAnchor); +} + +- (id <MGLStyleAttributeValue>)fillTranslateAnchor { + MGLGetEnumProperty(FillTranslateAnchor, TranslateAnchorType, MGLFillStyleLayerFillTranslateAnchor); +} + +- (void)setFillPattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillPattern { + self.layer->setFillPattern(fillPattern.mbgl_stringPropertyValue); +} + +- (id <MGLStyleAttributeValue>)fillPattern { + return [MGLStyleAttribute mbgl_stringPropertyValueWith:self.layer->getFillPattern()]; +} + +@end |