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
MGLStyleValue
object containing anNSNumber
object containingNO
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
icon-allow-overlap
layout 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
MGLStyleValue
object containing anNSNumber
object containingNO
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
icon-ignore-placement
layout 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-image
layout 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
MGLStyleValue
object containing anNSValue
object containing aCGVector
struct set to 0 rightward and 0 upward. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is 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
MGLStyleValue
object containing anNSNumber
object containingNO
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
, andtext
is 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
MGLStyleValue
object containing anNSNumber
object containing the float2
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is 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
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
icon-rotate
layout 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
MGLStyleValue
object containing anNSValue
object containingMGLIconRotationAlignmentAuto
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is 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
MGLStyleValue
object containing anNSNumber
object containing the float1
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
icon-size
layout 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
MGLStyleValue
object containing anNSValue
object containingMGLIconTextFitNone
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
, andtext
is 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
MGLStyleValue
object containing anNSValue
object containingNSEdgeInsetsZero
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
, andtext
is non-nil
, andiconTextFit
is set to anMGLStyleValue
object containing anNSValue
object 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
MGLStyleValue
object containing anNSNumber
object containingNO
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
, andiconRotationAlignment
is set to anMGLStyleValue
object containing anNSValue
object containingMGLIconRotationAlignmentMap
, andsymbolPlacement
is set to anMGLStyleValue
object containing anNSValue
object containingMGLSymbolPlacementLine
. Otherwise, it is ignored.This attribute corresponds to the
icon-keep-upright
layout 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
MGLStyleValue
object containing anNSNumber
object containingYES
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
, andtextRotationAlignment
is set to anMGLStyleValue
object containing anNSValue
object containingMGLTextRotationAlignmentMap
, andsymbolPlacement
is set to anMGLStyleValue
object containing anNSValue
object containingMGLSymbolPlacementLine
. Otherwise, it is ignored.This attribute corresponds to the
text-keep-upright
layout 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
MGLStyleValue
object containing anNSNumber
object containing the float45
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
, andsymbolPlacement
is set to anMGLStyleValue
object containing anNSValue
object containingMGLSymbolPlacementLine
. Otherwise, it is ignored.This attribute corresponds to the
text-max-angle
layout 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
MGLStyleValue
object containing anNSNumber
object containing the float10
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-max-width
layout 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
MGLStyleValue
object containing anNSNumber
object containingNO
. Set this property tonil
to reset it to the default value.This attribute corresponds to the
symbol-avoid-edges
layout 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
MGLStyleValue
object containing anNSValue
object containingMGLSymbolPlacementPoint
. Set this property tonil
to 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
MGLStyleValue
object containing anNSNumber
object containing the float250
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
symbolPlacement
is set to anMGLStyleValue
object containing anNSValue
object 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
MGLStyleValue
object containing the empty string. Set this property tonil
to reset it to the default value.This attribute corresponds to the
text-field
layout 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
MGLStyleValue
object containing anNSNumber
object containingNO
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-allow-overlap
layout 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
MGLStyleValue
object containing anNSValue
object containingMGLTextAnchorCenter
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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’sglyphs
property. 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
MGLStyleValue
object containing the arrayOpen Sans Regular
,Arial Unicode MS Regular
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-font
layout 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
MGLStyleValue
object containing anNSNumber
object containing the float16
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-size
layout 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
MGLStyleValue
object containing anNSNumber
object containingNO
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-ignore-placement
layout 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
MGLStyleValue
object containing anNSValue
object containingMGLTextJustificationCenter
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-justify
layout 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
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSNumber
object containing the float1.2
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSValue
object containing aCGVector
struct set to 0 ems rightward and 0 ems upward. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSNumber
object containingNO
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
, andiconImageName
is 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
MGLStyleValue
object containing anNSNumber
object containing the float2
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSValue
object containingMGLTextPitchAlignmentAuto
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-rotate
layout 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
MGLStyleValue
object containing anNSValue
object containingMGLTextRotationAlignmentAuto
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSValue
object containingMGLTextTransformNone
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
iconImageName
property must be set to a template image.The default value of this property is an
MGLStyleValue
object containingNSColor.blackColor
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is 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
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is 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
iconImageName
property must be set to a template image.The default value of this property is an
MGLStyleValue
object containingNSColor.clearColor
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is 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
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is 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
MGLStyleValue
object containing anNSNumber
object containing the float1
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is 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
MGLStyleValue
object containing anNSValue
object containing aCGVector
struct set to 0 points rightward and 0 points upward. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
icon-translate
layout 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
MGLStyleValue
object containing anNSValue
object containingMGLIconTranslationAnchorMap
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImageName
is non-nil
, andiconTranslation
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
icon-translate-anchor
layout 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
MGLStyleValue
object containingNSColor.blackColor
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containingNSColor.clearColor
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSNumber
object containing the float1
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is 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
MGLStyleValue
object containing anNSValue
object containing aCGVector
struct set to 0 points rightward and 0 points upward. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-translate
layout 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
MGLStyleValue
object containing anNSValue
object containingMGLTextTranslationAnchorMap
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
text
is non-nil
, andtextTranslation
is non-nil
. Otherwise, it is ignored.This attribute corresponds to the
text-translate-anchor
layout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTranslationAnchor;
Swift
var textTranslationAnchor: MGLStyleValue