MGLSymbolStyleLayer
@interface MGLSymbolStyleLayer : MGLVectorStyleLayer
An MGLSymbolStyleLayer is a style layer that renders icon and text labels at
points or along lines on the map.
Use a symbol style layer to configure the visual appearance of labels for
features in vector tiles loaded by an MGLVectorSource object or MGLShape or
MGLFeature instances in an MGLShapeSource object.
You can access an existing symbol style layer using the
-[MGLStyle layerWithIdentifier:] method if you know its identifier;
otherwise, find it using the MGLStyle.layers property. You can also create a
new symbol style layer and add it to the style using a method such as
-[MGLStyle addLayer:].
Example
let layer = MGLSymbolStyleLayer(identifier: coffeeshops
, source: pois)
layer.sourceLayerIdentifier = pois
layer.iconImageName = MGLStyleValue(rawValue: coffee
)
layer.iconScale = MGLStyleValue(rawValue: 0.5)
layer.text = MGLStyleValue(rawValue: {name}
)
layer.textTranslation = MGLStyleValue(rawValue: NSValue(cgVector: CGVector(dx: 10, dy: 0)))
layer.textJustification = MGLStyleValue(rawValue: NSValue(mglTextJustification: .left))
layer.textAnchor = MGLStyleValue(rawValue: NSValue(mglTextAnchor: .left))
layer.predicate = NSPredicate(format: %K == %@
, venue-type
, coffee
)
mapView.style?.addLayer(layer)
-
If true, the icon will be visible even if it collides with other previously drawn symbols.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingNO. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.This attribute corresponds to the
icon-allow-overlaplayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconAllowsOverlap;Swift
var iconAllowsOverlap: MGLStyleValue -
If true, other symbols can be visible even if they collide with the icon.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingNO. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.This attribute corresponds to the
icon-ignore-placementlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconIgnoresPlacement;Swift
var iconIgnoresPlacement: MGLStyleValue -
A string with {tokens} replaced, referencing the data property to pull from.
This attribute corresponds to the
icon-imagelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSString *> *iconImageName;Swift
var iconImageName: MGLStyleValue -
Offset distance of icon from its anchor.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containing aCGVectorstruct set to 0 rightward and 0 upward. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconOffset;Swift
var iconOffset: MGLStyleValue -
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingNO. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil, andtextis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (getter=isIconOptional, assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOptional;Swift
var iconOptional: MGLStyleValue -
Size of the additional area around the icon bounding box used for detecting symbol collisions.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float2. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconPadding;Swift
var iconPadding: MGLStyleValue -
Rotates the icon clockwise.
This property is measured in degrees.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float0. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.This attribute corresponds to the
icon-rotatelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconRotation;Swift
var iconRotation: MGLStyleValue -
In combination with
symbolPlacement, determines the rotation behavior of icons.The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLIconRotationAlignmentAuto. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconRotationAlignment;Swift
var iconRotationAlignment: MGLStyleValue -
Scale factor for icon. 1 is original size, 3 triples the size.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float1. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.This attribute corresponds to the
icon-sizelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconScale;Swift
var iconScale: MGLStyleValue -
Scales the icon to fit around the associated text.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLIconTextFitNone. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil, andtextis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTextFit;Swift
var iconTextFit: MGLStyleValue -
Size of the additional area added to dimensions determined by
iconTextFit.This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingNSEdgeInsetsZero. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil, andtextis non-nil, andiconTextFitis set to anMGLStyleValueobject containing anNSValueobject containingMGLIconTextFitBoth,MGLIconTextFitWidth, orMGLIconTextFitHeight. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTextFitPadding;Swift
var iconTextFitPadding: MGLStyleValue -
If true, the icon may be flipped to prevent it from being rendered upside-down.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingNO. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil, andiconRotationAlignmentis set to anMGLStyleValueobject containing anNSValueobject containingMGLIconRotationAlignmentMap, andsymbolPlacementis set to anMGLStyleValueobject containing anNSValueobject containingMGLSymbolPlacementLine. Otherwise, it is ignored.This attribute corresponds to the
icon-keep-uprightlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *keepsIconUpright;Swift
var keepsIconUpright: MGLStyleValue -
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingYES. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil, andtextRotationAlignmentis set to anMGLStyleValueobject containing anNSValueobject containingMGLTextRotationAlignmentMap, andsymbolPlacementis set to anMGLStyleValueobject containing anNSValueobject containingMGLSymbolPlacementLine. Otherwise, it is ignored.This attribute corresponds to the
text-keep-uprightlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *keepsTextUpright;Swift
var keepsTextUpright: MGLStyleValue -
Maximum angle change between adjacent characters.
This property is measured in degrees.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float45. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil, andsymbolPlacementis set to anMGLStyleValueobject containing anNSValueobject containingMGLSymbolPlacementLine. Otherwise, it is ignored.This attribute corresponds to the
text-max-anglelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *maximumTextAngle;Swift
var maximumTextAngle: MGLStyleValue -
The maximum line width for text wrapping.
This property is measured in ems.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float10. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-max-widthlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *maximumTextWidth;Swift
var maximumTextWidth: MGLStyleValue -
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don’t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingNO. Set this property tonilto reset it to the default value.This attribute corresponds to the
symbol-avoid-edgeslayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolAvoidsEdges;Swift
var symbolAvoidsEdges: MGLStyleValue -
Label placement relative to its geometry.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLSymbolPlacementPoint. Set this property tonilto reset it to the default value.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *symbolPlacement;Swift
var symbolPlacement: MGLStyleValue -
Distance between two symbol anchors.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float250. Set this property tonilto reset it to the default value.This property is only applied to the style if
symbolPlacementis set to anMGLStyleValueobject containing anNSValueobject containingMGLSymbolPlacementLine. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolSpacing;Swift
var symbolSpacing: MGLStyleValue -
Value to use for a text label. Feature properties are specified using tokens like {field_name}.
The default value of this property is an
MGLStyleValueobject containing the empty string. Set this property tonilto reset it to the default value.This attribute corresponds to the
text-fieldlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSString *> *text;Swift
var text: MGLStyleValue -
If true, the text will be visible even if it collides with other previously drawn symbols.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingNO. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-allow-overlaplayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textAllowsOverlap;Swift
var textAllowsOverlap: MGLStyleValue -
Part of the text placed closest to the anchor.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLTextAnchorCenter. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textAnchor;Swift
var textAnchor: MGLStyleValue -
An array of font face names used to display the text.
Each font name must be included in the
{fontstack}portion of the JSON stylesheet’sglyphsproperty. You can register a custom font when designing the style in Mapbox Studio. Fonts installed on the system are not used.The first font named in the array is applied to the text. For each character in the text, if the first font lacks a glyph for the character, the next font is applied as a fallback, and so on.
The default value of this property is an
MGLStyleValueobject containing the arrayOpen Sans Regular,Arial Unicode MS Regular. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-fontlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSArray<NSString *> *> *textFontNames;Swift
var textFontNames: MGLStyleValue -
Font size.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float16. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-sizelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textFontSize;Swift
var textFontSize: MGLStyleValue -
If true, other symbols can be visible even if they collide with the text.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingNO. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-ignore-placementlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textIgnoresPlacement;Swift
var textIgnoresPlacement: MGLStyleValue -
Text justification options.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLTextJustificationCenter. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-justifylayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textJustification;Swift
var textJustification: MGLStyleValue -
Text tracking amount.
This property is measured in ems.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float0. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLetterSpacing;Swift
var textLetterSpacing: MGLStyleValue -
Text leading value for multi-line text.
This property is measured in ems.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float1.2. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLineHeight;Swift
var textLineHeight: MGLStyleValue -
Offset distance of text from its anchor.
This property is measured in ems.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containing aCGVectorstruct set to 0 ems rightward and 0 ems upward. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textOffset;Swift
var textOffset: MGLStyleValue -
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containingNO. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil, andiconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (getter=isTextOptional, assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOptional;Swift
var textOptional: MGLStyleValue -
Size of the additional area around the text bounding box used for detecting symbol collisions.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float2. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textPadding;Swift
var textPadding: MGLStyleValue -
Orientation of text when map is pitched.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLTextPitchAlignmentAuto. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textPitchAlignment;Swift
var textPitchAlignment: MGLStyleValue -
Rotates the text clockwise.
This property is measured in degrees.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float0. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-rotatelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textRotation;Swift
var textRotation: MGLStyleValue -
In combination with
symbolPlacement, determines the rotation behavior of the individual glyphs forming the text.The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLTextRotationAlignmentAuto. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textRotationAlignment;Swift
var textRotationAlignment: MGLStyleValue -
Specifies how to capitalize text.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLTextTransformNone. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTransform;Swift
var textTransform: MGLStyleValue
-
The tint color to apply to the icon. The
iconImageNameproperty must be set to a template image.The default value of this property is an
MGLStyleValueobject containingNSColor.blackColor. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSColor *> *iconColor;Swift
var iconColor: MGLStyleValue -
Fade out the halo towards the outside.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float0. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloBlur;Swift
var iconHaloBlur: MGLStyleValue -
The color of the icon’s halo. The
iconImageNameproperty must be set to a template image.The default value of this property is an
MGLStyleValueobject containingNSColor.clearColor. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSColor *> *iconHaloColor;Swift
var iconHaloColor: MGLStyleValue -
Distance of halo to the icon outline.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float0. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloWidth;Swift
var iconHaloWidth: MGLStyleValue -
The opacity at which the icon will be drawn.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float1. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOpacity;Swift
var iconOpacity: MGLStyleValue -
Distance that the icon’s anchor is moved from its original placement.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containing aCGVectorstruct set to 0 points rightward and 0 points upward. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil. Otherwise, it is ignored.This attribute corresponds to the
icon-translatelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTranslation;Swift
var iconTranslation: MGLStyleValue -
Controls the translation reference point.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLIconTranslationAnchorMap. Set this property tonilto reset it to the default value.This property is only applied to the style if
iconImageNameis non-nil, andiconTranslationis non-nil. Otherwise, it is ignored.This attribute corresponds to the
icon-translate-anchorlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTranslationAnchor;Swift
var iconTranslationAnchor: MGLStyleValue -
The color with which the text will be drawn.
The default value of this property is an
MGLStyleValueobject containingNSColor.blackColor. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSColor *> *textColor;Swift
var textColor: MGLStyleValue -
The halo’s fadeout distance towards the outside.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float0. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloBlur;Swift
var textHaloBlur: MGLStyleValue -
The color of the text’s halo, which helps it stand out from backgrounds.
The default value of this property is an
MGLStyleValueobject containingNSColor.clearColor. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSColor *> *textHaloColor;Swift
var textHaloColor: MGLStyleValue -
Distance of halo to the font outline. Max text halo width is ¼ of the font-size.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float0. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloWidth;Swift
var textHaloWidth: MGLStyleValue -
The opacity at which the text will be drawn.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float1. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOpacity;Swift
var textOpacity: MGLStyleValue -
Distance that the text’s anchor is moved from its original placement.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containing aCGVectorstruct set to 0 points rightward and 0 points upward. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-translatelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTranslation;Swift
var textTranslation: MGLStyleValue -
Controls the translation reference point.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLTextTranslationAnchorMap. Set this property tonilto reset it to the default value.This property is only applied to the style if
textis non-nil, andtextTranslationis non-nil. Otherwise, it is ignored.This attribute corresponds to the
text-translate-anchorlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTranslationAnchor;Swift
var textTranslationAnchor: MGLStyleValue
Install in Dash
MGLSymbolStyleLayer Class Reference