---
title: "MTLight | Mobile sdk | Mobile sdk ios | Ios"
description: "A style’s light property provides a global light source for that style."
---

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

# MTLight

```
public struct MTLight : Sendable, Codable
```

A style’s light property provides a global light source for that style.

-   `[init(anchor:color:intensity:position:)](#/s:11MapTilerSDK7MTLightV6anchor5color9intensity8positionAcA0D6AnchorOSg_AA7MTColorVSgSdSgSaySdGSgtcfc)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        anchor: MTLightAnchor? = nil,
        color: MTColor? = nil,
        intensity: Double? = nil,
        position: [Double]? = nil
    )
    ```
    
-   `[init(from:)](#/s:Se4fromxs7Decoder_p_tKcfc)`
    
    #### Declaration
    
    Swift
    
    ```
    public init(from decoder: any Decoder) throws
    ```
    
-   `[encode(to:)](#/s:SE6encode2toys7Encoder_p_tKF)`
    
    #### Declaration
    
    Swift
    
    ```
    public func encode(to encoder: Encoder) throws
    ```
