// 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(MGLTextJustification, { { MGLTextJustificationLeft, "left" }, { MGLTextJustificationCenter, "center" }, { MGLTextJustificationRight, "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); self.rawLayer = _pendingLayer.get(); } return self; } - (mbgl::style::SymbolLayer *)rawLayer { return (mbgl::style::SymbolLayer *)super.rawLayer; } - (void)setRawLayer:(mbgl::style::SymbolLayer *)rawLayer { super.rawLayer = rawLayer; } - (NSString *)sourceLayerIdentifier { MGLAssertStyleLayerIsValid(); auto layerID = self.rawLayer->getSourceLayer(); return layerID.empty() ? nil : @(layerID.c_str()); } - (void)setSourceLayerIdentifier:(NSString *)sourceLayerIdentifier { MGLAssertStyleLayerIsValid(); self.rawLayer->setSourceLayer(sourceLayerIdentifier.UTF8String ?: ""); } - (void)setPredicate:(NSPredicate *)predicate { MGLAssertStyleLayerIsValid(); self.rawLayer->setFilter(predicate.mgl_filter); } - (NSPredicate *)predicate { MGLAssertStyleLayerIsValid(); return [NSPredicate mgl_predicateWithFilter:self.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; self.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); self.rawLayer = _pendingLayer.get(); } #pragma mark - Accessing the Layout Attributes - (void)setIconAllowsOverlap:(MGLStyleValue *)iconAllowsOverlap { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconAllowsOverlap); self.rawLayer->setIconAllowOverlap(mbglValue); } - (MGLStyleValue *)iconAllowsOverlap { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconAllowOverlap() ?: self.rawLayer->getDefaultIconAllowOverlap(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconAllowOverlap:(MGLStyleValue *)iconAllowOverlap { self.iconAllowsOverlap = iconAllowOverlap; } - (MGLStyleValue *)iconAllowOverlap { return self.iconAllowsOverlap; } - (void)setIconIgnoresPlacement:(MGLStyleValue *)iconIgnoresPlacement { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconIgnoresPlacement); self.rawLayer->setIconIgnorePlacement(mbglValue); } - (MGLStyleValue *)iconIgnoresPlacement { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconIgnorePlacement() ?: self.rawLayer->getDefaultIconIgnorePlacement(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconIgnorePlacement:(MGLStyleValue *)iconIgnorePlacement { self.iconIgnoresPlacement = iconIgnorePlacement; } - (MGLStyleValue *)iconIgnorePlacement { return self.iconIgnoresPlacement; } - (void)setIconImageName:(MGLStyleValue *)iconImageName { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconImageName); self.rawLayer->setIconImage(mbglValue); } - (MGLStyleValue *)iconImageName { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconImage() ?: self.rawLayer->getDefaultIconImage(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconImage:(MGLStyleValue *)iconImage { self.iconImageName = iconImage; } - (MGLStyleValue *)iconImage { return self.iconImageName; } - (void)setIconOffset:(MGLStyleValue *)iconOffset { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(iconOffset); self.rawLayer->setIconOffset(mbglValue); } - (MGLStyleValue *)iconOffset { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconOffset() ?: self.rawLayer->getDefaultIconOffset(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setIconOptional:(MGLStyleValue *)iconOptional { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconOptional); self.rawLayer->setIconOptional(mbglValue); } - (MGLStyleValue *)isIconOptional { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconOptional() ?: self.rawLayer->getDefaultIconOptional(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconPadding:(MGLStyleValue *)iconPadding { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconPadding); self.rawLayer->setIconPadding(mbglValue); } - (MGLStyleValue *)iconPadding { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconPadding() ?: self.rawLayer->getDefaultIconPadding(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconRotation:(MGLStyleValue *)iconRotation { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconRotation); self.rawLayer->setIconRotate(mbglValue); } - (MGLStyleValue *)iconRotation { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconRotate() ?: self.rawLayer->getDefaultIconRotate(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconRotate:(MGLStyleValue *)iconRotate { self.iconRotation = iconRotate; } - (MGLStyleValue *)iconRotate { return self.iconRotation; } - (void)setIconRotationAlignment:(MGLStyleValue *)iconRotationAlignment { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(iconRotationAlignment); self.rawLayer->setIconRotationAlignment(mbglValue); } - (MGLStyleValue *)iconRotationAlignment { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconRotationAlignment() ?: self.rawLayer->getDefaultIconRotationAlignment(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setIconScale:(MGLStyleValue *)iconScale { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconScale); self.rawLayer->setIconSize(mbglValue); } - (MGLStyleValue *)iconScale { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconSize() ?: self.rawLayer->getDefaultIconSize(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconSize:(MGLStyleValue *)iconSize { self.iconScale = iconSize; } - (MGLStyleValue *)iconSize { return self.iconScale; } - (void)setIconTextFit:(MGLStyleValue *)iconTextFit { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(iconTextFit); self.rawLayer->setIconTextFit(mbglValue); } - (MGLStyleValue *)iconTextFit { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconTextFit() ?: self.rawLayer->getDefaultIconTextFit(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setIconTextFitPadding:(MGLStyleValue *)iconTextFitPadding { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(iconTextFitPadding); self.rawLayer->setIconTextFitPadding(mbglValue); } - (MGLStyleValue *)iconTextFitPadding { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconTextFitPadding() ?: self.rawLayer->getDefaultIconTextFitPadding(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setKeepsIconUpright:(MGLStyleValue *)keepsIconUpright { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(keepsIconUpright); self.rawLayer->setIconKeepUpright(mbglValue); } - (MGLStyleValue *)keepsIconUpright { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconKeepUpright() ?: self.rawLayer->getDefaultIconKeepUpright(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconKeepUpright:(MGLStyleValue *)iconKeepUpright { self.keepsIconUpright = iconKeepUpright; } - (MGLStyleValue *)iconKeepUpright { return self.keepsIconUpright; } - (void)setKeepsTextUpright:(MGLStyleValue *)keepsTextUpright { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(keepsTextUpright); self.rawLayer->setTextKeepUpright(mbglValue); } - (MGLStyleValue *)keepsTextUpright { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextKeepUpright() ?: self.rawLayer->getDefaultTextKeepUpright(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextKeepUpright:(MGLStyleValue *)textKeepUpright { self.keepsTextUpright = textKeepUpright; } - (MGLStyleValue *)textKeepUpright { return self.keepsTextUpright; } - (void)setMaximumTextAngle:(MGLStyleValue *)maximumTextAngle { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(maximumTextAngle); self.rawLayer->setTextMaxAngle(mbglValue); } - (MGLStyleValue *)maximumTextAngle { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextMaxAngle() ?: self.rawLayer->getDefaultTextMaxAngle(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextMaxAngle:(MGLStyleValue *)textMaxAngle { self.maximumTextAngle = textMaxAngle; } - (MGLStyleValue *)textMaxAngle { return self.maximumTextAngle; } - (void)setMaximumTextWidth:(MGLStyleValue *)maximumTextWidth { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(maximumTextWidth); self.rawLayer->setTextMaxWidth(mbglValue); } - (MGLStyleValue *)maximumTextWidth { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextMaxWidth() ?: self.rawLayer->getDefaultTextMaxWidth(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextMaxWidth:(MGLStyleValue *)textMaxWidth { self.maximumTextWidth = textMaxWidth; } - (MGLStyleValue *)textMaxWidth { return self.maximumTextWidth; } - (void)setSymbolAvoidsEdges:(MGLStyleValue *)symbolAvoidsEdges { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(symbolAvoidsEdges); self.rawLayer->setSymbolAvoidEdges(mbglValue); } - (MGLStyleValue *)symbolAvoidsEdges { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getSymbolAvoidEdges() ?: self.rawLayer->getDefaultSymbolAvoidEdges(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setSymbolAvoidEdges:(MGLStyleValue *)symbolAvoidEdges { self.symbolAvoidsEdges = symbolAvoidEdges; } - (MGLStyleValue *)symbolAvoidEdges { return self.symbolAvoidsEdges; } - (void)setSymbolPlacement:(MGLStyleValue *)symbolPlacement { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(symbolPlacement); self.rawLayer->setSymbolPlacement(mbglValue); } - (MGLStyleValue *)symbolPlacement { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getSymbolPlacement() ?: self.rawLayer->getDefaultSymbolPlacement(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setSymbolSpacing:(MGLStyleValue *)symbolSpacing { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(symbolSpacing); self.rawLayer->setSymbolSpacing(mbglValue); } - (MGLStyleValue *)symbolSpacing { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getSymbolSpacing() ?: self.rawLayer->getDefaultSymbolSpacing(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextAllowsOverlap:(MGLStyleValue *)textAllowsOverlap { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textAllowsOverlap); self.rawLayer->setTextAllowOverlap(mbglValue); } - (MGLStyleValue *)textAllowsOverlap { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextAllowOverlap() ?: self.rawLayer->getDefaultTextAllowOverlap(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextAllowOverlap:(MGLStyleValue *)textAllowOverlap { self.textAllowsOverlap = textAllowOverlap; } - (MGLStyleValue *)textAllowOverlap { return self.textAllowsOverlap; } - (void)setTextAnchor:(MGLStyleValue *)textAnchor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textAnchor); self.rawLayer->setTextAnchor(mbglValue); } - (MGLStyleValue *)textAnchor { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextAnchor() ?: self.rawLayer->getDefaultTextAnchor(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextField:(MGLStyleValue *)textField { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textField); self.rawLayer->setTextField(mbglValue); } - (MGLStyleValue *)textField { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextField() ?: self.rawLayer->getDefaultTextField(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextFont:(MGLStyleValue *> *)textFont { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSArray *, std::string>().toPropertyValue(textFont); self.rawLayer->setTextFont(mbglValue); } - (MGLStyleValue *> *)textFont { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextFont() ?: self.rawLayer->getDefaultTextFont(); return MGLStyleValueTransformer, NSArray *, std::string>().toStyleValue(propertyValue); } - (void)setTextIgnoresPlacement:(MGLStyleValue *)textIgnoresPlacement { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textIgnoresPlacement); self.rawLayer->setTextIgnorePlacement(mbglValue); } - (MGLStyleValue *)textIgnoresPlacement { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextIgnorePlacement() ?: self.rawLayer->getDefaultTextIgnorePlacement(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextIgnorePlacement:(MGLStyleValue *)textIgnorePlacement { self.textIgnoresPlacement = textIgnorePlacement; } - (MGLStyleValue *)textIgnorePlacement { return self.textIgnoresPlacement; } - (void)setTextJustification:(MGLStyleValue *)textJustification { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textJustification); self.rawLayer->setTextJustify(mbglValue); } - (MGLStyleValue *)textJustification { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextJustify() ?: self.rawLayer->getDefaultTextJustify(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextJustify:(MGLStyleValue *)textJustify { self.textJustification = textJustify; } - (MGLStyleValue *)textJustify { return self.textJustification; } - (void)setTextLetterSpacing:(MGLStyleValue *)textLetterSpacing { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textLetterSpacing); self.rawLayer->setTextLetterSpacing(mbglValue); } - (MGLStyleValue *)textLetterSpacing { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextLetterSpacing() ?: self.rawLayer->getDefaultTextLetterSpacing(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextLineHeight:(MGLStyleValue *)textLineHeight { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textLineHeight); self.rawLayer->setTextLineHeight(mbglValue); } - (MGLStyleValue *)textLineHeight { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextLineHeight() ?: self.rawLayer->getDefaultTextLineHeight(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextOffset:(MGLStyleValue *)textOffset { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(textOffset); self.rawLayer->setTextOffset(mbglValue); } - (MGLStyleValue *)textOffset { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextOffset() ?: self.rawLayer->getDefaultTextOffset(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setTextOptional:(MGLStyleValue *)textOptional { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textOptional); self.rawLayer->setTextOptional(mbglValue); } - (MGLStyleValue *)isTextOptional { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextOptional() ?: self.rawLayer->getDefaultTextOptional(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextPadding:(MGLStyleValue *)textPadding { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textPadding); self.rawLayer->setTextPadding(mbglValue); } - (MGLStyleValue *)textPadding { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextPadding() ?: self.rawLayer->getDefaultTextPadding(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextPitchAlignment:(MGLStyleValue *)textPitchAlignment { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textPitchAlignment); self.rawLayer->setTextPitchAlignment(mbglValue); } - (MGLStyleValue *)textPitchAlignment { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextPitchAlignment() ?: self.rawLayer->getDefaultTextPitchAlignment(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextRotation:(MGLStyleValue *)textRotation { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textRotation); self.rawLayer->setTextRotate(mbglValue); } - (MGLStyleValue *)textRotation { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextRotate() ?: self.rawLayer->getDefaultTextRotate(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextRotate:(MGLStyleValue *)textRotate { self.textRotation = textRotate; } - (MGLStyleValue *)textRotate { return self.textRotation; } - (void)setTextRotationAlignment:(MGLStyleValue *)textRotationAlignment { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textRotationAlignment); self.rawLayer->setTextRotationAlignment(mbglValue); } - (MGLStyleValue *)textRotationAlignment { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextRotationAlignment() ?: self.rawLayer->getDefaultTextRotationAlignment(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextSize:(MGLStyleValue *)textSize { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textSize); self.rawLayer->setTextSize(mbglValue); } - (MGLStyleValue *)textSize { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextSize() ?: self.rawLayer->getDefaultTextSize(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextTransform:(MGLStyleValue *)textTransform { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textTransform); self.rawLayer->setTextTransform(mbglValue); } - (MGLStyleValue *)textTransform { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextTransform() ?: self.rawLayer->getDefaultTextTransform(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } #pragma mark - Accessing the Paint Attributes - (void)setIconColor:(MGLStyleValue *)iconColor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconColor); self.rawLayer->setIconColor(mbglValue); } - (MGLStyleValue *)iconColor { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconColor() ?: self.rawLayer->getDefaultIconColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconHaloBlur:(MGLStyleValue *)iconHaloBlur { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloBlur); self.rawLayer->setIconHaloBlur(mbglValue); } - (MGLStyleValue *)iconHaloBlur { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconHaloBlur() ?: self.rawLayer->getDefaultIconHaloBlur(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconHaloColor:(MGLStyleValue *)iconHaloColor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloColor); self.rawLayer->setIconHaloColor(mbglValue); } - (MGLStyleValue *)iconHaloColor { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconHaloColor() ?: self.rawLayer->getDefaultIconHaloColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconHaloWidth:(MGLStyleValue *)iconHaloWidth { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconHaloWidth); self.rawLayer->setIconHaloWidth(mbglValue); } - (MGLStyleValue *)iconHaloWidth { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconHaloWidth() ?: self.rawLayer->getDefaultIconHaloWidth(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconOpacity:(MGLStyleValue *)iconOpacity { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(iconOpacity); self.rawLayer->setIconOpacity(mbglValue); } - (MGLStyleValue *)iconOpacity { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconOpacity() ?: self.rawLayer->getDefaultIconOpacity(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setIconTranslate:(MGLStyleValue *)iconTranslate { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(iconTranslate); self.rawLayer->setIconTranslate(mbglValue); } - (MGLStyleValue *)iconTranslate { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconTranslate() ?: self.rawLayer->getDefaultIconTranslate(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setIconTranslateAnchor:(MGLStyleValue *)iconTranslateAnchor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(iconTranslateAnchor); self.rawLayer->setIconTranslateAnchor(mbglValue); } - (MGLStyleValue *)iconTranslateAnchor { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getIconTranslateAnchor() ?: self.rawLayer->getDefaultIconTranslateAnchor(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } - (void)setTextColor:(MGLStyleValue *)textColor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textColor); self.rawLayer->setTextColor(mbglValue); } - (MGLStyleValue *)textColor { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextColor() ?: self.rawLayer->getDefaultTextColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextHaloBlur:(MGLStyleValue *)textHaloBlur { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloBlur); self.rawLayer->setTextHaloBlur(mbglValue); } - (MGLStyleValue *)textHaloBlur { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextHaloBlur() ?: self.rawLayer->getDefaultTextHaloBlur(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextHaloColor:(MGLStyleValue *)textHaloColor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloColor); self.rawLayer->setTextHaloColor(mbglValue); } - (MGLStyleValue *)textHaloColor { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextHaloColor() ?: self.rawLayer->getDefaultTextHaloColor(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextHaloWidth:(MGLStyleValue *)textHaloWidth { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textHaloWidth); self.rawLayer->setTextHaloWidth(mbglValue); } - (MGLStyleValue *)textHaloWidth { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextHaloWidth() ?: self.rawLayer->getDefaultTextHaloWidth(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextOpacity:(MGLStyleValue *)textOpacity { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toPropertyValue(textOpacity); self.rawLayer->setTextOpacity(mbglValue); } - (MGLStyleValue *)textOpacity { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextOpacity() ?: self.rawLayer->getDefaultTextOpacity(); return MGLStyleValueTransformer().toStyleValue(propertyValue); } - (void)setTextTranslate:(MGLStyleValue *)textTranslate { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer, NSValue *>().toPropertyValue(textTranslate); self.rawLayer->setTextTranslate(mbglValue); } - (MGLStyleValue *)textTranslate { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextTranslate() ?: self.rawLayer->getDefaultTextTranslate(); return MGLStyleValueTransformer, NSValue *>().toStyleValue(propertyValue); } - (void)setTextTranslateAnchor:(MGLStyleValue *)textTranslateAnchor { MGLAssertStyleLayerIsValid(); auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textTranslateAnchor); self.rawLayer->setTextTranslateAnchor(mbglValue); } - (MGLStyleValue *)textTranslateAnchor { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextTranslateAnchor() ?: self.rawLayer->getDefaultTextTranslateAnchor(); return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); } @end