MGLSymbolStyleLayer
@interface MGLSymbolStyleLayer : MGLVectorStyleLayer
A symbol layer which allows customization of styling properties at runtime. You may
instantiate a new symbol layer to add to a map style or you may query an
MGLMapView
for its style
and obtain existing layers using the
-[MGLStyle layerWithIdentifier:]
method.
-
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
-
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.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *symbolAvoidEdges;
Swift
var symbolAvoidEdges: MGLStyleValue
-
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
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconAllowOverlap;
Swift
var iconAllowOverlap: 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
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconIgnorePlacement;
Swift
var iconIgnorePlacement: 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
iconImage
is non-nil
, andtextField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOptional;
Swift
var iconOptional: 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
iconImage
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
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconSize;
Swift
var iconSize: 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
iconImage
is non-nil
, andtextField
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
, in clockwise order: top, right, bottom, left.This property is measured in points.
The default value of this property is an
MGLStyleValue
object containing anNSValue
object containingNSEdgeInsetsZero
orUIEdgeInsetsZero
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImage
is non-nil
, andtextField
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
-
A string with {tokens} replaced, referencing the data property to pull from.
Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSString *> *iconImage;
Swift
var iconImage: 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
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconRotate;
Swift
var iconRotate: 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
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconPadding;
Swift
var iconPadding: 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
iconImage
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.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconKeepUpright;
Swift
var iconKeepUpright: MGLStyleValue
-
Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up.
The default value of this property is an
MGLStyleValue
object containing anNSValue
object containing aCGVector
struct set to 0 from the left and 0 from the top. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconOffset;
Swift
var iconOffset: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textPitchAlignment;
Swift
var textPitchAlignment: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textRotationAlignment;
Swift
var textRotationAlignment: 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 string `. Set this property to
nil` to reset it to the default value.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSString *> *textField;
Swift
var textField: MGLStyleValue
-
Font stack to use for displaying text.
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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSArray<NSString *> *> *textFont;
Swift
var textFont: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textSize;
Swift
var textSize: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textMaxWidth;
Swift
var textMaxWidth: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLineHeight;
Swift
var textLineHeight: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textLetterSpacing;
Swift
var textLetterSpacing: MGLStyleValue
-
Text justification options.
The default value of this property is an
MGLStyleValue
object containing anNSValue
object containingMGLTextJustifyCenter
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textJustify;
Swift
var textJustify: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textAnchor;
Swift
var textAnchor: 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
textField
is non-nil
, andsymbolPlacement
is set to anMGLStyleValue
object containing anNSValue
object containingMGLSymbolPlacementLine
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textMaxAngle;
Swift
var textMaxAngle: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textRotate;
Swift
var textRotate: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textPadding;
Swift
var textPadding: 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
textField
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.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textKeepUpright;
Swift
var textKeepUpright: MGLStyleValue
-
Specifies how to capitalize text, similar to the CSS
text-transform
property.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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTransform;
Swift
var textTransform: MGLStyleValue
-
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.
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 from the left and 0 ems from the top. Set this property tonil
to reset it to the default value.This property is only applied to the style if
textField
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, 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textAllowOverlap;
Swift
var textAllowOverlap: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textIgnorePlacement;
Swift
var textIgnorePlacement: 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
textField
is non-nil
, andiconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOptional;
Swift
var textOptional: 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
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconOpacity;
Swift
var iconOpacity: MGLStyleValue
-
The color of the icon. This can only be used with sdf icons.
The default value of this property is an
MGLStyleValue
object containingUIColor.blackColor
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<UIColor *> *iconColor;
Swift
var iconColor: MGLStyleValue
-
The color of the icon’s halo. Icon halos can only be used with SDF icons.
The default value of this property is an
MGLStyleValue
object containingUIColor.clearColor
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<UIColor *> *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
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloWidth;
Swift
var iconHaloWidth: 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
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconHaloBlur;
Swift
var iconHaloBlur: MGLStyleValue
-
Distance that the icon’s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
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 from the left and 0 points from the top. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImage
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTranslate;
Swift
var iconTranslate: MGLStyleValue
-
Controls the translation reference point.
The default value of this property is an
MGLStyleValue
object containing anNSValue
object containingMGLIconTranslateAnchorMap
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
iconImage
is non-nil
, andiconTranslate
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTranslateAnchor;
Swift
var iconTranslateAnchor: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textOpacity;
Swift
var textOpacity: MGLStyleValue
-
The color with which the text will be drawn.
The default value of this property is an
MGLStyleValue
object containingUIColor.blackColor
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<UIColor *> *textColor;
Swift
var textColor: 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 containingUIColor.clearColor
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<UIColor *> *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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloWidth;
Swift
var textHaloWidth: 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
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *textHaloBlur;
Swift
var textHaloBlur: MGLStyleValue
-
Distance that the text’s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
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 from the left and 0 points from the top. Set this property tonil
to reset it to the default value.This property is only applied to the style if
textField
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTranslate;
Swift
var textTranslate: MGLStyleValue
-
Controls the translation reference point.
The default value of this property is an
MGLStyleValue
object containing anNSValue
object containingMGLTextTranslateAnchorMap
. Set this property tonil
to reset it to the default value.This property is only applied to the style if
textField
is non-nil
, andtextTranslate
is non-nil
. Otherwise, it is ignored.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTranslateAnchor;
Swift
var textTranslateAnchor: MGLStyleValue