// This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. #import "MGLSource.h" #import "MGLMapView_Private.h" #import "NSPredicate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGLSymbolStyleLayer.h" #include namespace mbgl { MBGL_DEFINE_ENUM(MGLIconRotationAlignment, { { MGLIconRotationAlignmentMap, "map" }, { MGLIconRotationAlignmentViewport, "viewport" }, { MGLIconRotationAlignmentAuto, "auto" }, }); MBGL_DEFINE_ENUM(MGLIconTextFit, { { MGLIconTextFitNone, "none" }, { MGLIconTextFitWidth, "width" }, { MGLIconTextFitHeight, "height" }, { MGLIconTextFitBoth, "both" }, }); MBGL_DEFINE_ENUM(MGLSymbolPlacement, { { MGLSymbolPlacementPoint, "point" }, { MGLSymbolPlacementLine, "line" }, }); MBGL_DEFINE_ENUM(MGLTextAnchor, { { MGLTextAnchorCenter, "center" }, { MGLTextAnchorLeft, "left" }, { MGLTextAnchorRight, "right" }, { MGLTextAnchorTop, "top" }, { MGLTextAnchorBottom, "bottom" }, { MGLTextAnchorTopLeft, "top-left" }, { MGLTextAnchorTopRight, "top-right" }, { MGLTextAnchorBottomLeft, "bottom-left" }, { MGLTextAnchorBottomRight, "bottom-right" }, }); MBGL_DEFINE_ENUM(MGLTextJustify, { { MGLTextJustifyLeft, "left" }, { MGLTextJustifyCenter, "center" }, { MGLTextJustifyRight, "right" }, }); MBGL_DEFINE_ENUM(MGLTextPitchAlignment, { { MGLTextPitchAlignmentMap, "map" }, { MGLTextPitchAlignmentViewport, "viewport" }, { MGLTextPitchAlignmentAuto, "auto" }, }); MBGL_DEFINE_ENUM(MGLTextRotationAlignment, { { MGLTextRotationAlignmentMap, "map" }, { MGLTextRotationAlignmentViewport, "viewport" }, { MGLTextRotationAlignmentAuto, "auto" }, }); MBGL_DEFINE_ENUM(MGLTextTransform, { { MGLTextTransformNone, "none" }, { MGLTextTransformUppercase, "uppercase" }, { MGLTextTransformLowercase, "lowercase" }, }); MBGL_DEFINE_ENUM(MGLIconTranslateAnchor, { { MGLIconTranslateAnchorMap, "map" }, { MGLIconTranslateAnchorViewport, "viewport" }, }); MBGL_DEFINE_ENUM(MGLTextTranslateAnchor, { { MGLTextTranslateAnchorMap, "map" }, { MGLTextTranslateAnchorViewport, "viewport" }, }); } @interface MGLSymbolStyleLayer () @property (nonatomic) mbgl::style::SymbolLayer *rawLayer; @end @implementation MGLSymbolStyleLayer { std::unique_ptr _pendingLayer; } - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { if (self = [super initWithIdentifier:identifier source:source]) { auto layer = std::make_unique(identifier.UTF8String, source.identifier.UTF8String); _pendingLayer = std::move(layer); _rawLayer = _pendingLayer.get(); } return self; } - (NSString *)sourceLayerIdentifier { MGLAssertStyleLayerIsValid(); auto layerID = _rawLayer->getSourceLayer(); return layerID.empty() ? nil : @(layerID.c_str()); } - (void)setSourceLayerIdentifier:(NSString *)sourceLayerIdentifier { MGLAssertStyleLayerIsValid(); _rawLayer->setSourceLayer(sourceLayerIdentifier.UTF8String ?: ""); } - (void)setPredicate:(NSPredicate *)predicate { MGLAssertStyleLayerIsValid(); _rawLayer->setFilter(predicate.mgl_filter); } - (NSPredicate *)predicate { MGLAssertStyleLayerIsValid(); return [NSPredicate mgl_predicateWithFilter:_rawLayer->getFilter()]; } #pragma mark - Adding to and removing from a map view - (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer { if (_pendingLayer == nullptr) { [NSException raise:@"MGLRedundantLayerException" format:@"This instance %@ was already added to %@. Adding the same layer instance " \ "to the style more than once is invalid.", self, mapView.style]; } if (otherLayer) { const mbgl::optional belowLayerId{otherLayer.identifier.UTF8String}; mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId); } else { mapView.mbglMap->addLayer(std::move(_pendingLayer)); } } - (void)removeFromMapView:(MGLMapView *)mapView { _pendingLayer = nullptr; _rawLayer = nullptr; auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String); if (!removedLayer) { return; } mbgl::style::SymbolLayer *layer = dynamic_cast(removedLayer.get()); if (!layer) { return; } removedLayer.release(); _pendingLayer = std::unique_ptr(layer); _rawLayer = _pendingLayer.get(); } #pragma mark - Accessing the Layout Attributes - (void)setIconAllowOverlap:(MGLStyleValue *)iconAllowOverlap { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconAllowOverlap); _rawLayer->setIconAllowOverlap(mbglValue); } - (MGLStyleValue *)iconAllowOverlap { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconAllowOverlap() ?: _rawLayer->getDefaultIconAllowOverlap(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconIgnorePlacement:(MGLStyleValue *)iconIgnorePlacement { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconIgnorePlacement); _rawLayer->setIconIgnorePlacement(mbglValue); } - (MGLStyleValue *)iconIgnorePlacement { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconIgnorePlacement() ?: _rawLayer->getDefaultIconIgnorePlacement(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconImageName:(MGLStyleValue *)iconImageName { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconImageName); _rawLayer->setIconImage(mbglValue); } - (MGLStyleValue *)iconImageName { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconImage() ?: _rawLayer->getDefaultIconImage(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconKeepUpright:(MGLStyleValue *)iconKeepUpright { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconKeepUpright); _rawLayer->setIconKeepUpright(mbglValue); } - (MGLStyleValue *)iconKeepUpright { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconKeepUpright() ?: _rawLayer->getDefaultIconKeepUpright(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconOffset:(MGLStyleValue *)iconOffset { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(iconOffset); _rawLayer->setIconOffset(mbglValue); } - (MGLStyleValue *)iconOffset { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconOffset() ?: _rawLayer->getDefaultIconOffset(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setIconOptional:(MGLStyleValue *)iconOptional { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconOptional); _rawLayer->setIconOptional(mbglValue); } - (MGLStyleValue *)iconOptional { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconOptional() ?: _rawLayer->getDefaultIconOptional(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconPadding:(MGLStyleValue *)iconPadding { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconPadding); _rawLayer->setIconPadding(mbglValue); } - (MGLStyleValue *)iconPadding { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconPadding() ?: _rawLayer->getDefaultIconPadding(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconRotate:(MGLStyleValue *)iconRotate { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconRotate); _rawLayer->setIconRotate(mbglValue); } - (MGLStyleValue *)iconRotate { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconRotate() ?: _rawLayer->getDefaultIconRotate(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconRotationAlignment:(MGLStyleValue *)iconRotationAlignment { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(iconRotationAlignment); _rawLayer->setIconRotationAlignment(mbglValue); } - (MGLStyleValue *)iconRotationAlignment { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconRotationAlignment() ?: _rawLayer->getDefaultIconRotationAlignment(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setIconScale:(MGLStyleValue *)iconScale { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconScale); _rawLayer->setIconSize(mbglValue); } - (MGLStyleValue *)iconScale { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconSize() ?: _rawLayer->getDefaultIconSize(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconTextFit:(MGLStyleValue *)iconTextFit { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(iconTextFit); _rawLayer->setIconTextFit(mbglValue); } - (MGLStyleValue *)iconTextFit { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconTextFit() ?: _rawLayer->getDefaultIconTextFit(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setIconTextFitPadding:(MGLStyleValue *)iconTextFitPadding { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(iconTextFitPadding); _rawLayer->setIconTextFitPadding(mbglValue); } - (MGLStyleValue *)iconTextFitPadding { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconTextFitPadding() ?: _rawLayer->getDefaultIconTextFitPadding(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setSymbolAvoidEdges:(MGLStyleValue *)symbolAvoidEdges { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(symbolAvoidEdges); _rawLayer->setSymbolAvoidEdges(mbglValue); } - (MGLStyleValue *)symbolAvoidEdges { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getSymbolAvoidEdges() ?: _rawLayer->getDefaultSymbolAvoidEdges(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setSymbolPlacement:(MGLStyleValue *)symbolPlacement { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(symbolPlacement); _rawLayer->setSymbolPlacement(mbglValue); } - (MGLStyleValue *)symbolPlacement { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getSymbolPlacement() ?: _rawLayer->getDefaultSymbolPlacement(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setSymbolSpacing:(MGLStyleValue *)symbolSpacing { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(symbolSpacing); _rawLayer->setSymbolSpacing(mbglValue); } - (MGLStyleValue *)symbolSpacing { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getSymbolSpacing() ?: _rawLayer->getDefaultSymbolSpacing(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextAllowOverlap:(MGLStyleValue *)textAllowOverlap { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textAllowOverlap); _rawLayer->setTextAllowOverlap(mbglValue); } - (MGLStyleValue *)textAllowOverlap { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextAllowOverlap() ?: _rawLayer->getDefaultTextAllowOverlap(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextAnchor:(MGLStyleValue *)textAnchor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textAnchor); _rawLayer->setTextAnchor(mbglValue); } - (MGLStyleValue *)textAnchor { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextAnchor() ?: _rawLayer->getDefaultTextAnchor(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextField:(MGLStyleValue *)textField { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textField); _rawLayer->setTextField(mbglValue); } - (MGLStyleValue *)textField { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextField() ?: _rawLayer->getDefaultTextField(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextFont:(MGLStyleValue *> *)textFont { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSArray *, std::string>().toPropertyValue(textFont); _rawLayer->setTextFont(mbglValue); } - (MGLStyleValue *> *)textFont { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextFont() ?: _rawLayer->getDefaultTextFont(); return MGLStyleValueTransformer, NSArray *, std::string>().toStyleValue(propertyValue); } - (void)setTextIgnorePlacement:(MGLStyleValue *)textIgnorePlacement { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textIgnorePlacement); _rawLayer->setTextIgnorePlacement(mbglValue); } - (MGLStyleValue *)textIgnorePlacement { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextIgnorePlacement() ?: _rawLayer->getDefaultTextIgnorePlacement(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextJustify:(MGLStyleValue *)textJustify { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textJustify); _rawLayer->setTextJustify(mbglValue); } - (MGLStyleValue *)textJustify { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextJustify() ?: _rawLayer->getDefaultTextJustify(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextKeepUpright:(MGLStyleValue *)textKeepUpright { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textKeepUpright); _rawLayer->setTextKeepUpright(mbglValue); } - (MGLStyleValue *)textKeepUpright { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextKeepUpright() ?: _rawLayer->getDefaultTextKeepUpright(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextLetterSpacing:(MGLStyleValue *)textLetterSpacing { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textLetterSpacing); _rawLayer->setTextLetterSpacing(mbglValue); } - (MGLStyleValue *)textLetterSpacing { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextLetterSpacing() ?: _rawLayer->getDefaultTextLetterSpacing(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextLineHeight:(MGLStyleValue *)textLineHeight { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textLineHeight); _rawLayer->setTextLineHeight(mbglValue); } - (MGLStyleValue *)textLineHeight { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextLineHeight() ?: _rawLayer->getDefaultTextLineHeight(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextMaxAngle:(MGLStyleValue *)textMaxAngle { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textMaxAngle); _rawLayer->setTextMaxAngle(mbglValue); } - (MGLStyleValue *)textMaxAngle { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextMaxAngle() ?: _rawLayer->getDefaultTextMaxAngle(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextMaxWidth:(MGLStyleValue *)textMaxWidth { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textMaxWidth); _rawLayer->setTextMaxWidth(mbglValue); } - (MGLStyleValue *)textMaxWidth { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextMaxWidth() ?: _rawLayer->getDefaultTextMaxWidth(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextOffset:(MGLStyleValue *)textOffset { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(textOffset); _rawLayer->setTextOffset(mbglValue); } - (MGLStyleValue *)textOffset { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextOffset() ?: _rawLayer->getDefaultTextOffset(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setTextOptional:(MGLStyleValue *)textOptional { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textOptional); _rawLayer->setTextOptional(mbglValue); } - (MGLStyleValue *)textOptional { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextOptional() ?: _rawLayer->getDefaultTextOptional(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextPadding:(MGLStyleValue *)textPadding { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textPadding); _rawLayer->setTextPadding(mbglValue); } - (MGLStyleValue *)textPadding { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextPadding() ?: _rawLayer->getDefaultTextPadding(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextPitchAlignment:(MGLStyleValue *)textPitchAlignment { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textPitchAlignment); _rawLayer->setTextPitchAlignment(mbglValue); } - (MGLStyleValue *)textPitchAlignment { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextPitchAlignment() ?: _rawLayer->getDefaultTextPitchAlignment(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextRotate:(MGLStyleValue *)textRotate { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textRotate); _rawLayer->setTextRotate(mbglValue); } - (MGLStyleValue *)textRotate { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextRotate() ?: _rawLayer->getDefaultTextRotate(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextRotationAlignment:(MGLStyleValue *)textRotationAlignment { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textRotationAlignment); _rawLayer->setTextRotationAlignment(mbglValue); } - (MGLStyleValue *)textRotationAlignment { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextRotationAlignment() ?: _rawLayer->getDefaultTextRotationAlignment(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextSize:(MGLStyleValue *)textSize { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textSize); _rawLayer->setTextSize(mbglValue); } - (MGLStyleValue *)textSize { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextSize() ?: _rawLayer->getDefaultTextSize(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextTransform:(MGLStyleValue *)textTransform { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textTransform); _rawLayer->setTextTransform(mbglValue); } - (MGLStyleValue *)textTransform { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextTransform() ?: _rawLayer->getDefaultTextTransform(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } #pragma mark - Accessing the Paint Attributes - (void)setIconColor:(MGLStyleValue *)iconColor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconColor); _rawLayer->setIconColor(mbglValue); } - (MGLStyleValue *)iconColor { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconColor() ?: _rawLayer->getDefaultIconColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconHaloBlur:(MGLStyleValue *)iconHaloBlur { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloBlur); _rawLayer->setIconHaloBlur(mbglValue); } - (MGLStyleValue *)iconHaloBlur { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconHaloBlur() ?: _rawLayer->getDefaultIconHaloBlur(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconHaloColor:(MGLStyleValue *)iconHaloColor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloColor); _rawLayer->setIconHaloColor(mbglValue); } - (MGLStyleValue *)iconHaloColor { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconHaloColor() ?: _rawLayer->getDefaultIconHaloColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconHaloWidth:(MGLStyleValue *)iconHaloWidth { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloWidth); _rawLayer->setIconHaloWidth(mbglValue); } - (MGLStyleValue *)iconHaloWidth { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconHaloWidth() ?: _rawLayer->getDefaultIconHaloWidth(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconOpacity:(MGLStyleValue *)iconOpacity { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconOpacity); _rawLayer->setIconOpacity(mbglValue); } - (MGLStyleValue *)iconOpacity { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconOpacity() ?: _rawLayer->getDefaultIconOpacity(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconTranslate:(MGLStyleValue *)iconTranslate { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(iconTranslate); _rawLayer->setIconTranslate(mbglValue); } - (MGLStyleValue *)iconTranslate { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconTranslate() ?: _rawLayer->getDefaultIconTranslate(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setIconTranslateAnchor:(MGLStyleValue *)iconTranslateAnchor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(iconTranslateAnchor); _rawLayer->setIconTranslateAnchor(mbglValue); } - (MGLStyleValue *)iconTranslateAnchor { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getIconTranslateAnchor() ?: _rawLayer->getDefaultIconTranslateAnchor(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextColor:(MGLStyleValue *)textColor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textColor); _rawLayer->setTextColor(mbglValue); } - (MGLStyleValue *)textColor { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextColor() ?: _rawLayer->getDefaultTextColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextHaloBlur:(MGLStyleValue *)textHaloBlur { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloBlur); _rawLayer->setTextHaloBlur(mbglValue); } - (MGLStyleValue *)textHaloBlur { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextHaloBlur() ?: _rawLayer->getDefaultTextHaloBlur(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextHaloColor:(MGLStyleValue *)textHaloColor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloColor); _rawLayer->setTextHaloColor(mbglValue); } - (MGLStyleValue *)textHaloColor { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextHaloColor() ?: _rawLayer->getDefaultTextHaloColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextHaloWidth:(MGLStyleValue *)textHaloWidth { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloWidth); _rawLayer->setTextHaloWidth(mbglValue); } - (MGLStyleValue *)textHaloWidth { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextHaloWidth() ?: _rawLayer->getDefaultTextHaloWidth(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextOpacity:(MGLStyleValue *)textOpacity { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textOpacity); _rawLayer->setTextOpacity(mbglValue); } - (MGLStyleValue *)textOpacity { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextOpacity() ?: _rawLayer->getDefaultTextOpacity(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextTranslate:(MGLStyleValue *)textTranslate { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(textTranslate); _rawLayer->setTextTranslate(mbglValue); } - (MGLStyleValue *)textTranslate { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextTranslate() ?: _rawLayer->getDefaultTextTranslate(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setTextTranslateAnchor:(MGLStyleValue *)textTranslateAnchor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textTranslateAnchor); _rawLayer->setTextTranslateAnchor(mbglValue); } - (MGLStyleValue *)textTranslateAnchor { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getTextTranslateAnchor() ?: _rawLayer->getDefaultTextTranslateAnchor(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } @end