MLNSymbolStyleLayer class

An MLNSymbolStyleLayer 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 feature labels. These features can come from vector tiles loaded by an MLNSymbolStyleLayer object, or they can be MLNSymbolStyleLayer or MLNSymbolStyleLayer instances in an MLNSymbolStyleLayer or MLNSymbolStyleLayer object.

You can access an existing symbol style layer using the MLNStyle/layerWithIdentifier: method if you know its identifier; otherwise, find it using the MLNStyle/layers property. You can also create a new symbol style layer and add it to the style using a method such as MLNStyle/addLayer:.

See the Dynamically style interactive points and Use images to cluster point data examples learn how to style data on your map using this layer.

Example

Inheritance

Constructors

MLNSymbolStyleLayer()
Returns a new instance of MLNSymbolStyleLayer constructed with the default new method.
factory
MLNSymbolStyleLayer.castFrom(ObjCObjectBase other)
Constructs a MLNSymbolStyleLayer that points to the same underlying object as other.
MLNSymbolStyleLayer.castFromPointer(Pointer<ObjCObject> other, {bool retain = false, bool release = false})
Constructs a MLNSymbolStyleLayer that wraps the given raw object pointer.

Properties

debugDescription$1 → NSString
debugDescription
no setterinherited
description$1 → NSString
description
no setterinherited
hash$1 int
hash
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
iconAllowOverlap NSExpression
iconAllowOverlap
getter/setter pair
iconAllowsOverlap NSExpression
If true, the icon will be visible even if it collides with other previously drawn symbols.
getter/setter pair
iconAnchor NSExpression
Part of the icon placed closest to the anchor.
getter/setter pair
iconColor NSExpression
The tint color to apply to the icon. The iconImageName property must be set to a template image.
getter/setter pair
iconColorTransition MLNTransition
The transition affecting any changes to this layer’s iconColor property.
getter/setter pair
iconHaloBlur NSExpression
Fade out the halo towards the outside.
getter/setter pair
iconHaloBlurTransition MLNTransition
The transition affecting any changes to this layer’s iconHaloBlur property.
getter/setter pair
iconHaloColor NSExpression
The color of the icon’s halo. The iconImageName property must be set to a template image.
getter/setter pair
iconHaloColorTransition MLNTransition
The transition affecting any changes to this layer’s iconHaloColor property.
getter/setter pair
iconHaloWidth NSExpression
Distance of halo to the icon outline. The unit is in points only for SDF sprites that were created with a blur radius of 8, multiplied by the display density. I.e., the radius needs to be 16 for @2x sprites, etc.
getter/setter pair
iconHaloWidthTransition MLNTransition
The transition affecting any changes to this layer’s iconHaloWidth property.
getter/setter pair
iconIgnorePlacement NSExpression
iconIgnorePlacement
getter/setter pair
iconIgnoresPlacement NSExpression
If true, other symbols can be visible even if they collide with the icon.
getter/setter pair
iconImage NSExpression
iconImage
getter/setter pair
iconImageName NSExpression
Name of a style image to use for drawing an image background.
getter/setter pair
iconKeepUpright NSExpression
iconKeepUpright
getter/setter pair
iconOffset NSExpression
Offset distance of icon from its anchor.
getter/setter pair
iconOpacity NSExpression
The opacity at which the icon will be drawn.
getter/setter pair
iconOpacityTransition MLNTransition
The transition affecting any changes to this layer’s iconOpacity property.
getter/setter pair
iconOptional NSExpression
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
getter/setter pair
iconPadding NSExpression
Size of additional area round the icon bounding box used for detecting symbol collisions.
getter/setter pair
iconPitchAlignment NSExpression
Orientation of icon when map is pitched.
getter/setter pair
iconRotate NSExpression
iconRotate
getter/setter pair
iconRotation NSExpression
Rotates the icon clockwise.
getter/setter pair
iconRotationAlignment NSExpression
In combination with symbolPlacement, determines the rotation behavior of icons.
getter/setter pair
iconScale NSExpression
Scales the original size of the icon by the provided factor. The new point size of the image will be the original point size multiplied by iconScale. 1 is the original size; 3 triples the size of the image.
getter/setter pair
iconSize NSExpression
iconSize
getter/setter pair
iconTextFit NSExpression
The directions in which the icon stretches to fit around the text. If the icon image is a resizable image, the resizable areas may be stretched, while the cap insets are always drawn at the original scale.
getter/setter pair
iconTextFitPadding NSExpression
Size of the additional area added to dimensions determined by iconTextFit.
getter/setter pair
iconTranslate NSExpression
iconTranslate
getter/setter pair
iconTranslateAnchor NSExpression
iconTranslateAnchor
getter/setter pair
iconTranslation NSExpression
Distance that the icon's anchor is moved from its original placement.
getter/setter pair
iconTranslationAnchor NSExpression
Controls the frame of reference for iconTranslation.
getter/setter pair
iconTranslationTransition MLNTransition
The transition affecting any changes to this layer’s iconTranslation property.
getter/setter pair
identifier → NSString
A string that uniquely identifies the style layer in the style to which it is added.
no setterinherited
isProxy bool
isProxy
no setterinherited
keepsIconUpright NSExpression
If true, the icon may be flipped to prevent it from being rendered upside-down.
getter/setter pair
keepsTextUpright NSExpression
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
getter/setter pair
maximumTextAngle NSExpression
Maximum angle change between adjacent characters.
getter/setter pair
maximumTextWidth NSExpression
The maximum line width for text wrapping.
getter/setter pair
maximumZoomLevel double
The maximum zoom level at which the layer gets parsed and appears. This value is a floating-point number.
getter/setter pairinherited
minimumZoomLevel double
The minimum zoom level at which the layer gets parsed and appears. This value is a floating-point number.
getter/setter pairinherited
predicate NSPredicate?
The style layer’s predicate.
getter/setter pairinherited
ref → ObjCObjectRef
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceIdentifier → NSString?
Identifier of the source from which the receiver obtains the data to style.
no setterinherited
sourceLayerIdentifier ↔ NSString?
Identifier of the layer within the source identified by the sourceIdentifier property from which the receiver obtains the data to style.
getter/setter pairinherited
superclass$1 → ObjCObjectBase
superclass
no setterinherited
symbolAvoidEdges NSExpression
symbolAvoidEdges
getter/setter pair
symbolAvoidsEdges NSExpression
Whether symbols in this layer avoid colliding with symbols in adjacent tiles.
getter/setter pair
symbolPlacement NSExpression
Label placement relative to its geometry.
getter/setter pair
symbolScreenSpace NSExpression
Internal use only
getter/setter pair
symbolSortKey NSExpression
Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When iconAllowsOverlap or textAllowsOverlap is false, features with a lower sort key will have priority during placement. When iconAllowsOverlap or textAllowsOverlap is set to YES, features with a higher sort key will overlap over features with a lower sort key.
getter/setter pair
symbolSpacing NSExpression
Distance between two symbol anchors.
getter/setter pair
symbolZOrder NSExpression
Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use symbolSortKey.
getter/setter pair
text NSExpression
Value to use for a text label.
getter/setter pair
textAllowOverlap NSExpression
textAllowOverlap
getter/setter pair
textAllowsOverlap NSExpression
If true, the text will be visible even if it collides with other previously drawn symbols.
getter/setter pair
textAnchor NSExpression
Part of the text placed closest to the anchor.
getter/setter pair
textColor NSExpression
The color with which the text will be drawn.
getter/setter pair
textColorTransition MLNTransition
The transition affecting any changes to this layer’s textColor property.
getter/setter pair
textField NSExpression
textField
getter/setter pair
textFont NSExpression
textFont
getter/setter pair
textFontNames NSExpression
An array of font face names used to display the text.
getter/setter pair
textFontSize NSExpression
Font size.
getter/setter pair
textHaloBlur NSExpression
The halo's fadeout distance towards the outside.
getter/setter pair
textHaloBlurTransition MLNTransition
The transition affecting any changes to this layer’s textHaloBlur property.
getter/setter pair
textHaloColor NSExpression
The color of the text's halo, which helps it stand out from backgrounds.
getter/setter pair
textHaloColorTransition MLNTransition
The transition affecting any changes to this layer’s textHaloColor property.
getter/setter pair
textHaloWidth NSExpression
Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
getter/setter pair
textHaloWidthTransition MLNTransition
The transition affecting any changes to this layer’s textHaloWidth property.
getter/setter pair
textIgnorePlacement NSExpression
textIgnorePlacement
getter/setter pair
textIgnoresPlacement NSExpression
If true, other symbols can be visible even if they collide with the text.
getter/setter pair
textJustification NSExpression
Text justification options.
getter/setter pair
textJustify NSExpression
textJustify
getter/setter pair
textKeepUpright NSExpression
textKeepUpright
getter/setter pair
textLetterSpacing NSExpression
Text tracking amount.
getter/setter pair
textLineHeight NSExpression
Text leading value for multi-line text.
getter/setter pair
textMaxAngle NSExpression
textMaxAngle
getter/setter pair
textMaxWidth NSExpression
textMaxWidth
getter/setter pair
textOffset NSExpression
Offset distance of text from its anchor.
getter/setter pair
textOpacity NSExpression
The opacity at which the text will be drawn.
getter/setter pair
textOpacityTransition MLNTransition
The transition affecting any changes to this layer’s textOpacity property.
getter/setter pair
textOptional NSExpression
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
getter/setter pair
textPadding NSExpression
Size of the additional area around the text bounding box used for detecting symbol collisions.
getter/setter pair
textPitchAlignment NSExpression
Orientation of text when map is pitched.
getter/setter pair
textRadialOffset NSExpression
Radial offset of text, in the direction of the symbol's anchor. Useful in combination with textVariableAnchor, which defaults to using the two-dimensional textOffset if present.
getter/setter pair
textRotate NSExpression
textRotate
getter/setter pair
textRotation NSExpression
Rotates the text clockwise.
getter/setter pair
textRotationAlignment NSExpression
In combination with symbolPlacement, determines the rotation behavior of the individual glyphs forming the text.
getter/setter pair
textSize NSExpression
textSize
getter/setter pair
textTransform NSExpression
Specifies how to capitalize text.
getter/setter pair
textTranslate NSExpression
textTranslate
getter/setter pair
textTranslateAnchor NSExpression
textTranslateAnchor
getter/setter pair
textTranslation NSExpression
Distance that the text's anchor is moved from its original placement.
getter/setter pair
textTranslationAnchor NSExpression
Controls the frame of reference for textTranslation.
getter/setter pair
textTranslationTransition MLNTransition
The transition affecting any changes to this layer’s textTranslation property.
getter/setter pair
textVariableAnchor NSExpression
To increase the chance of placing high-priority labels on the map, you can provide an array of textAnchor locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use textJustify: auto to choose justification based on anchor position. To apply an offset, use the textRadialOffset or the two-dimensional textOffset.
getter/setter pair
textVariableAnchorOffset NSExpression
To increase the chance of placing high-priority labels on the map, you can provide an array of textAnchor locations, each paired with an offset value. The renderer will attempt to place the label at each location, in order, before moving on to the next location+offset. Use textJustify: auto to choose justification based on anchor position.
getter/setter pair
textWritingMode NSExpression
textWritingMode
getter/setter pair
textWritingModes NSExpression
The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.
getter/setter pair
visible bool
Whether this layer is displayed. A value of NO hides the layer.
getter/setter pairinherited

Methods

autorelease() MLNSymbolStyleLayer
autorelease
override
class$1() → ObjCObjectBase
class
inherited
conformsToProtocol$1(Protocol aProtocol) bool
conformsToProtocol:
inherited
copy() → ObjCObjectBase
copy
inherited
dealloc() → void
dealloc
inherited
doesNotRecognizeSelector(Pointer<ObjCSelector> aSelector) → void
doesNotRecognizeSelector:
inherited
forwardingTargetForSelector(Pointer<ObjCSelector> aSelector) → ObjCObjectBase
forwardingTargetForSelector:
inherited
forwardInvocation(NSInvocation anInvocation) → void
forwardInvocation:
inherited
init() MLNSymbolStyleLayer
init
override
initWithIdentifier(NSString identifier, {required MLNSource source}) MLNSymbolStyleLayer
Returns a symbol style layer initialized with an identifier and source.
isEqual(ObjCObjectBase object) bool
isEqual:
inherited
isKindOfClass(ObjCObjectBase aClass) bool
isKindOfClass:
inherited
isMemberOfClass(ObjCObjectBase aClass) bool
isMemberOfClass:
inherited
methodForSelector(Pointer<ObjCSelector> aSelector) Pointer<NativeFunction<Void Function()>>
methodForSelector:
inherited
methodSignatureForSelector(Pointer<ObjCSelector> aSelector) → NSMethodSignature
methodSignatureForSelector:
inherited
mutableCopy() → ObjCObjectBase
mutableCopy
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performSelector(Pointer<ObjCSelector> aSelector) → ObjCObjectBase
performSelector:
inherited
performSelector$1(Pointer<ObjCSelector> aSelector, {required ObjCObjectBase withObject}) → ObjCObjectBase
performSelector:withObject:
inherited
performSelector$2(Pointer<ObjCSelector> aSelector, {required ObjCObjectBase withObject, required ObjCObjectBase withObject$1}) → ObjCObjectBase
performSelector:withObject:withObject:
inherited
release() → void
release
inherited
respondsToSelector(Pointer<ObjCSelector> aSelector) bool
respondsToSelector:
inherited
retain() MLNSymbolStyleLayer
retain
override
retainCount() int
retainCount
inherited
self$1() MLNSymbolStyleLayer
self
override
toString() String
A string representation of this object.
inherited
zone() Pointer<NSZone>
zone
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

alloc() MLNSymbolStyleLayer
alloc
override
allocWithZone(Pointer<NSZone> zone) MLNSymbolStyleLayer
allocWithZone:
override
isInstance(ObjCObjectBase obj) bool
Returns whether obj is an instance of MLNSymbolStyleLayer.
override
new$() MLNSymbolStyleLayer
new
override