---
title: "MTSymbolLayer | Mobile sdk | Mobile sdk ios | Ios"
description: "The symbol style that layer renders icon and text labels at points or along lines on a map."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# MTSymbolLayer

```
public class MTSymbolLayer : MTLayer, @unchecked Sendable, Codable
```

```
extension MTSymbolLayer: Equatable
```

The symbol style that layer renders icon and text labels at points or along lines on a map.

-   `[identifier](#/s:11MapTilerSDK13MTSymbolLayerC10identifierSSvp)`
    
    Unique layer identifier.
    
    #### Declaration
    
    Swift
    
    ```
    public var identifier: String
    ```
    
-   `[type](#/s:11MapTilerSDK13MTSymbolLayerC4typeAA11MTLayerTypeOvp)`
    
    Type of the layer.
    
    #### Declaration
    
    Swift
    
    ```
    public private(set) var type: MTLayerType { get }
    ```
    
-   `[sourceIdentifier](#/s:11MapTilerSDK13MTSymbolLayerC16sourceIdentifierSSvp)`
    
    Identifier of the source to be used for this layer.
    
    #### Declaration
    
    Swift
    
    ```
    public var sourceIdentifier: String
    ```
    
-   `[maxZoom](#/s:11MapTilerSDK13MTSymbolLayerC7maxZoomSdSgvp)`
    
    The maximum zoom level for the layer.
    
    Optional number between 0 and 24. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
    
    #### Declaration
    
    Swift
    
    ```
    public var maxZoom: Double?
    ```
    
-   `[minZoom](#/s:11MapTilerSDK13MTSymbolLayerC7minZoomSdSgvp)`
    
    The minimum zoom level for the layer.
    
    Optional number between 0 and 24. At zoom levels less than the minzoom, the layer will be hidden.
    
    #### Declaration
    
    Swift
    
    ```
    public var minZoom: Double?
    ```
    
-   `[sourceLayer](#/s:11MapTilerSDK13MTSymbolLayerC06sourceE0SSSgvp)`
    
    Layer to use from a vector tile source.
    
    Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
    
    #### Declaration
    
    Swift
    
    ```
    public var sourceLayer: String?
    ```
    
-   `[icon](#/s:11MapTilerSDK13MTSymbolLayerC4iconSo7UIImageCSgvp)`
    
    Icon to use for the layer.
    
    #### Declaration
    
    Swift
    
    ```
    public var icon: UIImage?
    ```
    
-   `[visibility](#/s:11MapTilerSDK13MTSymbolLayerC10visibilityAA17MTLayerVisibilityOSgvp)`
    
    Enum controlling whether this layer is displayed.
    
    #### Declaration
    
    Swift
    
    ```
    public var visibility: MTLayerVisibility?
    ```
    
-   `[initialFilter](#/s:11MapTilerSDK13MTSymbolLayerC13initialFilterAA15MTPropertyValueOSgvp)`
    
    Optional initial filter to apply after the layer is added to the map.
    
    #### Declaration
    
    Swift
    
    ```
    public var initialFilter: MTPropertyValue?
    ```
    

[](#/Layout%3A%20text%20properties)

### Layout: text properties

-   `[textField](#/s:11MapTilerSDK13MTSymbolLayerC9textFieldSSSgvp)`
    
    Text field (tokens allowed), e.g. “{point\_count\_abbreviated}”
    
    #### Declaration
    
    Swift
    
    ```
    public var textField: String?
    ```
    
-   `[textSize](#/s:11MapTilerSDK13MTSymbolLayerC8textSizeSdSgvp)`
    
    Text size in px
    
    #### Declaration
    
    Swift
    
    ```
    public var textSize: Double?
    ```
    
-   `[textAllowOverlap](#/s:11MapTilerSDK13MTSymbolLayerC16textAllowOverlapSbSgvp)`
    
    Text allow overlap
    
    #### Declaration
    
    Swift
    
    ```
    public var textAllowOverlap: Bool?
    ```
    
-   `[textAnchor](#/s:11MapTilerSDK13MTSymbolLayerC10textAnchorAA06MTTextG0OSgvp)`
    
    Text anchor
    
    #### Declaration
    
    Swift
    
    ```
    public var textAnchor: MTTextAnchor?
    ```
    
-   `[textFont](#/s:11MapTilerSDK13MTSymbolLayerC8textFontSaySSGSgvp)`
    
    Text font stack
    
    #### Declaration
    
    Swift
    
    ```
    public var textFont: [String]?
    ```
    
-   `[filterExpression](#/s:11MapTilerSDK13MTSymbolLayerC16filterExpressionAA15MTPropertyValueOSgvp)`
    
    Inline filter expression for this layer
    
    #### Declaration
    
    Swift
    
    ```
    public var filterExpression: MTPropertyValue?
    ```
    

[](#/Paint%3A%20text%20properties)

### Paint: text properties

-   `[textColor](#/s:11MapTilerSDK13MTSymbolLayerC9textColorSo7UIColorCSgvp)`
    
    Text color
    
    #### Declaration
    
    Swift
    
    ```
    public var textColor: UIColor?
    ```
    
-   `[init(identifier:sourceIdentifier:maxZoom:minZoom:sourceLayer:)](#/s:11MapTilerSDK13MTSymbolLayerC10identifier16sourceIdentifier7maxZoom03minJ00gE0ACSS_SSS2dSSSgtcfc)`
    
    Initializes the layer with unique identifier, source identifier, max and min zoom levels and source layer, which is required for vector tile sources.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        identifier: String,
        sourceIdentifier: String,
        maxZoom: Double,
        minZoom: Double,
        sourceLayer: String? = nil
    )
    ```
    
-   `[init(identifier:sourceIdentifier:)](#/s:11MapTilerSDK13MTSymbolLayerC10identifier16sourceIdentifierACSS_SStcfc)`
    
    Initializes the layer with the unique identifier and a source identifier.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        identifier: String,
        sourceIdentifier: String
    )
    ```
    
-   `[init(identifier:sourceIdentifier:maxZoom:minZoom:sourceLayer:icon:visibility:)](#/s:11MapTilerSDK13MTSymbolLayerC10identifier16sourceIdentifier7maxZoom03minJ00gE04icon10visibilityACSS_SSSdSgAKSSSgSo7UIImageCSgAA17MTLayerVisibilityOSgtcfc)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        identifier: String,
        sourceIdentifier: String,
        maxZoom: Double? = nil,
        minZoom: Double? = nil,
        sourceLayer: String? = nil,
        icon: UIImage? = nil,
        visibility: MTLayerVisibility? = .visible
    )
    ```
    
-   `[init(from:)](#/s:Se4fromxs7Decoder_p_tKcfc)`
    
    #### Declaration
    
    Swift
    
    ```
    public required init(from decoder: any Decoder) throws
    ```
    
-   `[encode(to:)](#/s:SE6encode2toys7Encoder_p_tKF)`
    
    #### Declaration
    
    Swift
    
    ```
    public func encode(to encoder: Encoder) throws
    ```
    
-   `[addToMap(_:)](#/s:11MapTilerSDK13MTSymbolLayerC05addToA0yyAA9MTMapViewCF)`
    
    Adds layer to map DSL style.
    
    Prefer `[addLayer(_:)](https://docs.maptiler.com/mobile-sdk/ios/api/Classes/MTStyle/#/s:11MapTilerSDK7MTStyleC8addLayeryyAA7MTLayer_pYaKF)` on MTMapView instead.
    
    #### Declaration
    
    Swift
    
    ```
    public func addToMap(_ mapView: MTMapView)
    ```
    
-   `[maxZoom(_:)](#/s:11MapTilerSDK13MTSymbolLayerC7maxZoomyACXDSdF)`
    
    Modifier. Sets the `[maxZoom](https://docs.maptiler.com/mobile-sdk/ios/api/Classes/MTSymbolLayer/#/s:11MapTilerSDK13MTSymbolLayerC7maxZoomSdSgvp)`.
    
    Note
    
    Not to be used outside of DSL.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func maxZoom(_ value: Double) -> Self
    ```
    
-   `[minZoom(_:)](#/s:11MapTilerSDK13MTSymbolLayerC7minZoomyACXDSdF)`
    
    Modifier. Sets the `[minZoom](https://docs.maptiler.com/mobile-sdk/ios/api/Classes/MTSymbolLayer/#/s:11MapTilerSDK13MTSymbolLayerC7minZoomSdSgvp)`.
    
    Note
    
    Not to be used outside of DSL.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func minZoom(_ value: Double) -> Self
    ```
    
-   `[sourceLayer(_:)](#/s:11MapTilerSDK13MTSymbolLayerC06sourceE0yACXDSSF)`
    
    Modifier. Sets the `[sourceLayer](https://docs.maptiler.com/mobile-sdk/ios/api/Classes/MTSymbolLayer/#/s:11MapTilerSDK13MTSymbolLayerC06sourceE0SSSgvp)`.
    
    Note
    
    Not to be used outside of DSL.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func sourceLayer(_ value: String) -> Self
    ```
    
-   `[icon(_:)](#/s:11MapTilerSDK13MTSymbolLayerC4iconyACXDSo7UIImageCF)`
    
    Modifier. Sets the `[icon](https://docs.maptiler.com/mobile-sdk/ios/api/Classes/MTSymbolLayer/#/s:11MapTilerSDK13MTSymbolLayerC4iconSo7UIImageCSgvp)`.
    
    Note
    
    Not to be used outside of DSL.
    
    #### Declaration
    
    Swift
    
    ```
    public func icon(_ value: UIImage) -> Self
    ```
    
-   `[textField(_:)](#/s:11MapTilerSDK13MTSymbolLayerC9textFieldyACXDSSF)`
    
    Sets the symbol text field (tokens allowed).
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func textField(_ value: String) -> Self
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>value</em></code></td><td><div><p>Text field string, e.g. “{point_count_abbreviated}”.</p></div></td></tr></tbody></table>
    
-   `[textSize(_:)](#/s:11MapTilerSDK13MTSymbolLayerC8textSizeyACXDSdF)`
    
    Sets the symbol text size.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func textSize(_ value: Double) -> Self
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>value</em></code></td><td><div><p>Text size in points.</p></div></td></tr></tbody></table>
    
-   `[textAllowOverlap(_:)](#/s:11MapTilerSDK13MTSymbolLayerC16textAllowOverlapyACXDSbF)`
    
    Sets whether text labels can overlap.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func textAllowOverlap(_ value: Bool) -> Self
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>value</em></code></td><td><div><p>True to allow overlap.</p></div></td></tr></tbody></table>
    
-   `[textAnchor(_:)](#/s:11MapTilerSDK13MTSymbolLayerC10textAnchoryACXDAA06MTTextG0OF)`
    
    Sets the text anchor position.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func textAnchor(_ value: MTTextAnchor) -> Self
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>value</em></code></td><td><div><p>Anchor for text placement.</p></div></td></tr></tbody></table>
    
-   `[textFont(_:)](#/s:11MapTilerSDK13MTSymbolLayerC8textFontyACXDSaySSGF)`
    
    Sets the preferred text fonts.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func textFont(_ value: [String]) -> Self
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>value</em></code></td><td><div><p>Ordered list of font family names.</p></div></td></tr></tbody></table>
    
-   `[paintTextColor(_:)](#/s:11MapTilerSDK13MTSymbolLayerC14paintTextColoryACXDSo7UIColorCF)`
    
    Sets a constant text color for the symbol.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func paintTextColor(_ value: UIColor) -> Self
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>value</em></code></td><td><div><p>UIColor value.</p></div></td></tr></tbody></table>
    
-   `[visibility(_:)](#/s:11MapTilerSDK13MTSymbolLayerC10visibilityyACXDAA17MTLayerVisibilityOF)`
    
    Modifier. Sets the `[visibility](https://docs.maptiler.com/mobile-sdk/ios/api/Classes/MTSymbolLayer/#/s:11MapTilerSDK13MTSymbolLayerC10visibilityAA17MTLayerVisibilityOSgvp)`.
    
    Note
    
    Not to be used outside of DSL.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func visibility(_ value: MTLayerVisibility) -> Self
    ```
    
-   `[withFilter(_:)](#/s:11MapTilerSDK13MTSymbolLayerC10withFilteryACXDAA15MTPropertyValueOF)`
    
    Sets an inline filter expression for this layer.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func withFilter(_ value: MTPropertyValue) -> Self
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>value</em></code></td><td><div><p>Filter expression.</p></div></td></tr></tbody></table>
    
-   `[==(_:_:)](#/s:SQ2eeoiySbx_xtFZ)`
    
    #### Declaration
    
    Swift
    
    ```
    public static func == (lhs: MTSymbolLayer, rhs: MTSymbolLayer) -> Bool
    ```
