---
title: "MTStylable | Mobile sdk | Mobile sdk ios | Ios"
description: "Defines methods for map styling methods."
---

> 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.

# MTStylable

```
@MainActor
public protocol MTStylable
```

Defines methods for map styling methods.

-   `[setGlyphs(url:options:)](#/s:11MapTilerSDK10MTStylableP9setGlyphs3url7optionsy10Foundation3URLV_AA20MTStyleSetterOptionsVSgtYaF)` Asynchronous
    
    Sets the value of the style’s glyphs property.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setGlyphs(url: URL, options: MTStyleSetterOptions?) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>url</em></code></td><td><div><p>URL pointing to the glyphs resource.</p></div></td></tr><tr><td><code><em>options</em></code></td><td><div><p>Style setter options.</p></div></td></tr></tbody></table>
    
-   `[setLanguage(_:)](#/s:11MapTilerSDK10MTStylableP11setLanguageyyAA10MTLanguageOYaF)` Asynchronous
    
    Sets the map labels language.
    
    The language generally depends on the style. Whenever a label is not supported in the defined language, it falls back to `Latin`.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setLanguage(_ language: MTLanguage) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>language</em></code></td><td><div><p>The language to be applied.</p></div></td></tr></tbody></table>
    
-   `[setSecondaryLanguage(_:)](#/s:11MapTilerSDK10MTStylableP20setSecondaryLanguageyyAA10MTLanguageOYaF)` Asynchronous
    
    Sets the map labels secondary language.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setSecondaryLanguage(_ language: MTLanguage) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>language</em></code></td><td><div><p>The language to be applied.</p></div></td></tr></tbody></table>
    
-   `[setSprite(_:)](#/s:11MapTilerSDK10MTStylableP9setSpriteyy10Foundation3URLVYaF)` Asynchronous
    
    Sets the map sprite.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setSprite(_ url: URL) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>url</em></code></td><td><div><p>The URL pointing to the sprite resource.</p></div></td></tr></tbody></table>
    
-   `[setLight(_:options:)](#/s:11MapTilerSDK10MTStylableP8setLight_7optionsyAA7MTLightV_AA20MTStyleSetterOptionsVSgtYaF)` Asynchronous
    
    Sets the any combination of light values.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setLight(_ light: MTLight, options: MTStyleSetterOptions?) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>light</em></code></td><td><div><p>Light options.</p></div></td></tr><tr><td><code><em>options</em></code></td><td><div><p>Style setter options.</p></div></td></tr></tbody></table>
    
-   `[setSky(_:options:)](#/s:11MapTilerSDK10MTStylableP6setSky_7optionsyAA5MTSkyV_AA20MTStyleSetterOptionsVSgtYaF)` Asynchronous
    
    Sets the sky configuration for the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setSky(_ sky: MTSky, options: MTStyleSetterOptions?) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>sky</em></code></td><td><div><p>Sky definition.</p></div></td></tr><tr><td><code><em>options</em></code></td><td><div><p>Style setter options.</p></div></td></tr></tbody></table>
    
-   `[setSpace(_:)](#/s:11MapTilerSDK10MTStylableP8setSpaceyyAA13MTSpaceOptionOYaF)` Asynchronous
    
    Sets the space background for globe projection (cubemap/spacebox).
    
    Note
    
    Make sure space is enabled and projection is set to Globe before initializing the map via MTMapOptions.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setSpace(_ space: MTSpaceOption) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>space</em></code></td><td><div><p>Space configuration or a boolean to enable default.</p></div></td></tr></tbody></table>
    
-   `[setHalo(_:)](#/s:11MapTilerSDK10MTStylableP7setHaloyyAA12MTHaloOptionOYaF)` Asynchronous
    
    Sets the atmospheric halo (glow) around the globe.
    
    Note
    
    Make sure halo is enabled and projection is set to Globe before initializing the map via MTMapOptions.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setHalo(_ halo: MTHaloOption) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>halo</em></code></td><td><div><p>Halo configuration or a boolean to enable default.</p></div></td></tr></tbody></table>
    
-   `[disableHaloAnimations()](#/s:11MapTilerSDK10MTStylableP21disableHaloAnimationsyyYaF)` Asynchronous
    
    Disables state transitions/animations for halo updates.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func disableHaloAnimations() async
    ```
    
-   `[disableSpaceAnimations()](#/s:11MapTilerSDK10MTStylableP22disableSpaceAnimationsyyYaF)` Asynchronous
    
    Disables state transitions/animations for space updates.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func disableSpaceAnimations() async
    ```
    
-   `[setShouldRenderWorldCopies(_:)](#/s:11MapTilerSDK10MTStylableP26setShouldRenderWorldCopiesyySbYaF)` Asynchronous
    
    Sets the state where multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setShouldRenderWorldCopies(_ shouldRenderWorldCopies: Bool) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>shouldRenderWorldCopies</em></code></td><td><div><p>Boolean indicating whether world copies should be rendered.</p></div></td></tr></tbody></table>
    
-   `[addImage(name:image:options:)](#/s:11MapTilerSDK10MTStylableP8addImage4name5image7optionsySS_So7UIImageCAA07MTStyleF7OptionsVSgtYaF)` Asynchronous
    
    Registers an image with the current style so it can be referenced by layers and annotations.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func addImage(name: String, image: UIImage, options: MTStyleImageOptions?) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>name</em></code></td><td><div><p>Unique identifier for the image.</p></div></td></tr><tr><td><code><em>image</em></code></td><td><div><p>Image to register.</p></div></td></tr><tr><td><code><em>options</em></code></td><td><div><p>Additional configuration that controls how the image is rendered.</p></div></td></tr></tbody></table>
    
-   `[removeImage(name:)](#/s:11MapTilerSDK10MTStylableP11removeImage4nameySS_tYaF)` Asynchronous
    
    Removes a previously added image by name. Use to clean up icons no longer referenced by layers.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func removeImage(name: String) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>name</em></code></td><td><div><p>Unique identifier for the image to remove.</p></div></td></tr></tbody></table>
    
-   `[addSprite(id:url:)](#/s:11MapTilerSDK10MTStylableP9addSprite2id3urlySS_10Foundation3URLVtYaF)` Asynchronous
    
    Registers a sprite with the current style so it can be referenced by layers and annotations.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func addSprite(id: String, url: URL) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>id</em></code></td><td><div><p>Unique identifier for the sprite.</p></div></td></tr><tr><td><code><em>url</em></code></td><td><div><p>URL pointing to the sprite resource.</p></div></td></tr></tbody></table>
    
-   `[removeSprite(id:)](#/s:11MapTilerSDK10MTStylableP12removeSprite2idySS_tYaF)` Asynchronous
    
    Removes a sprite from the current style. Use to detach a sprite and free related resources.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func removeSprite(id: String) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>id</em></code></td><td><div><p>Unique identifier for the sprite.</p></div></td></tr></tbody></table>
    
-   `[addMarker(_:)](#/s:11MapTilerSDK10MTStylableP9addMarkeryyAA8MTMarkerCYaF)` Asynchronous
    
    Adds the marker to the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func addMarker(_ marker: MTMarker) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>marker</em></code></td><td><div><p>Marker to add to the map.</p></div></td></tr></tbody></table>
    
-   `[addMarkers(_:withSingleIcon:)](#/s:11MapTilerSDK10MTStylableP10addMarkers_14withSingleIconySayAA8MTMarkerCG_So7UIImageCSgtYaF)` Asynchronous
    
    Adds multiple markers to the map.
    
    Batch adding is preferred way of adding multiple markers to the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func addMarkers(_ markers: [MTMarker], withSingleIcon: UIImage?) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>markers</em></code></td><td><div><p>Markers to be added to the map.</p></div></td></tr><tr><td><code><em>withSingleIcon</em></code></td><td><div><p>Optional single image to use for all markers.</p></div></td></tr></tbody></table>
    
-   `[removeMarker(_:)](#/s:11MapTilerSDK10MTStylableP12removeMarkeryyAA8MTMarkerCYaF)` Asynchronous
    
    Removes a marker from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func removeMarker(_ marker: MTMarker) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>marker</em></code></td><td><div><p>Marker to be removed from the map.</p></div></td></tr></tbody></table>
    
-   `[removeMarkers(_:)](#/s:11MapTilerSDK10MTStylableP13removeMarkersyySayAA8MTMarkerCGYaF)` Asynchronous
    
    Removes multiple markers from the map.
    
    Batch removing is preferred way of removing multiple markers from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func removeMarkers(_ markers: [MTMarker]) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>markers</em></code></td><td><div><p>Markers to be removed from the map.</p></div></td></tr></tbody></table>
    
-   `[enableGlobeProjection()](#/s:11MapTilerSDK10MTStylableP21enableGlobeProjectionyyYaF)` Asynchronous
    
    Enables the globe projection visualization.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func enableGlobeProjection() async
    ```
    
-   `[enableMercatorProjection()](#/s:11MapTilerSDK10MTStylableP24enableMercatorProjectionyyYaF)` Asynchronous
    
    Enables the mercator projection visualization.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func enableMercatorProjection() async
    ```
    
-   `[isGlobeProjection()](#/s:11MapTilerSDK10MTStylableP17isGlobeProjectionSbyYaF)` Asynchronous
    
    Returns true if the current projection is globe; otherwise false.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func isGlobeProjection() async -> Bool
    ```
    
-   `[enableTerrain(exaggerationFactor:)](#/s:11MapTilerSDK10MTStylableP13enableTerrain18exaggerationFactorySd_tYaF)` Asynchronous
    
    Enables the 3D terrain visualization.
    
    Note
    
    Default is 1.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func enableTerrain(exaggerationFactor: Double) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>exaggerationFactor</em></code></td><td><div><p>Factor for volume boosting.</p></div></td></tr></tbody></table>
    
-   `[disableTerrain()](#/s:11MapTilerSDK10MTStylableP14disableTerrainyyYaF)` Asynchronous
    
    Disables the 3D terrain visualization.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func disableTerrain() async
    ```
    
-   `[setTerrainExaggeration(_:animate:)](#/s:11MapTilerSDK10MTStylableP22setTerrainExaggeration_7animateySd_SbtYaF)` Asynchronous
    
    Sets the terrain exaggeration.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTerrainExaggeration(_ exaggeration: Double, animate: Bool) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>exaggeration</em></code></td><td><div><p>The new exaggeration factor.</p></div></td></tr><tr><td><code><em>animate</em></code></td><td><div><p>Whether to animate the transition. Defaults to <code>true</code>.</p></div></td></tr></tbody></table>
    
-   `[setTerrainAnimationDuration(_:)](#/s:11MapTilerSDK10MTStylableP27setTerrainAnimationDurationyySdYaF)` Asynchronous
    
    Sets the animation duration of the terrain transitions.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTerrainAnimationDuration(_ duration: Double) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>duration</em></code></td><td><div><p>The duration in milliseconds.</p></div></td></tr></tbody></table>
    
-   `[setTerrain(sourceId:exaggeration:)](#/s:11MapTilerSDK10MTStylableP10setTerrain8sourceId12exaggerationySS_SdSgtYaF)` Asynchronous
    
    Sets the 3D terrain on the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTerrain(sourceId: String, exaggeration: Double?) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>sourceId</em></code></td><td><div><p>The ID of the terrain source.</p></div></td></tr><tr><td><code><em>exaggeration</em></code></td><td><div><p>Factor for volume boosting.</p></div></td></tr></tbody></table>
    
-   `[setTerrain()](#/s:11MapTilerSDK10MTStylableP10setTerrainyyYaF)` Asynchronous
    
    Removes the 3D terrain from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTerrain() async
    ```
    
-   `[hasTerrain()](#/s:11MapTilerSDK10MTStylableP10hasTerrainSbyYaF)` Asynchronous
    
    Returns true if 3D terrain visualization is enabled.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func hasTerrain() async -> Bool
    ```
    
-   `[setVerticalFieldOfView(degrees:)](#/s:11MapTilerSDK10MTStylableP22setVerticalFieldOfView7degreesySd_tYaF)` Asynchronous
    
    Sets the map’s vertical field of view, in degrees.
    
    The internal camera has a default vertical field of view of a wide ~36.86 degrees. In globe mode, such a large FOV reduces the amount of the Earth that can be seen at once and exaggerates the central part, comparably to a fisheye lens. In many cases, a narrower FOV is preferable.
    
    Note
    
    Default is 36.87.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setVerticalFieldOfView(degrees: Double) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>degrees</em></code></td><td><div><p>The vertical field of view to set, in degrees (0-180).</p></div></td></tr></tbody></table>
    
-   `[isSourceLoaded(id:)](#/s:11MapTilerSDK10MTStylableP14isSourceLoaded2idSbSS_tYaF)` Asynchronous
    
    Returns boolean value indicating whether the source with provided id is loaded.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func isSourceLoaded(id: String) async -> Bool
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>id</em></code></td><td><div><p>The id of the source.</p></div></td></tr></tbody></table>
