---
title: "MTHillshadeLayer | Mobile sdk | Mobile sdk ios | Ios"
description: "A hillshade style layer renders digital elevation model (DEM) data on the client-side. Supports Terrain RGB and Mapzen Terrarium tiles via a raster-dem source."
---

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

# MTHillshadeLayer

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

A hillshade style layer renders digital elevation model (DEM) data on the client-side. Supports Terrain RGB and Mapzen Terrarium tiles via a `raster-dem` source.

[](#/Core%20properties)

### Core properties

-   `[identifier](#/s:11MapTilerSDK16MTHillshadeLayerC10identifierSSvp)`
    
    Unique layer identifier.
    
    #### Declaration
    
    Swift
    
    ```
    public var identifier: String
    ```
    
-   `[type](#/s:11MapTilerSDK16MTHillshadeLayerC4typeAA11MTLayerTypeOvp)`
    
    Type of the layer.
    
    #### Declaration
    
    Swift
    
    ```
    public private(set) var type: MTLayerType { get }
    ```
    
-   `[sourceIdentifier](#/s:11MapTilerSDK16MTHillshadeLayerC16sourceIdentifierSSvp)`
    
    Identifier of the source to be used for this layer.
    
    #### Declaration
    
    Swift
    
    ```
    public var sourceIdentifier: String
    ```
    
-   `[maxZoom](#/s:11MapTilerSDK16MTHillshadeLayerC7maxZoomSdSgvp)`
    
    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:11MapTilerSDK16MTHillshadeLayerC7minZoomSdSgvp)`
    
    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:11MapTilerSDK16MTHillshadeLayerC06sourceE0SSSgvp)`
    
    Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types.
    
    #### Declaration
    
    Swift
    
    ```
    public var sourceLayer: String?
    ```
    

[](#/Paint%20properties)

### Paint properties

-   `[accentColor](#/s:11MapTilerSDK16MTHillshadeLayerC11accentColorSo7UIColorCSgvp)`
    
    The shading color used to accentuate rugged terrain like sharp cliffs and gorges. Optional color. Defaults to black (“#000000”).
    
    #### Declaration
    
    Swift
    
    ```
    public var accentColor: UIColor?
    ```
    
-   `[exaggeration](#/s:11MapTilerSDK16MTHillshadeLayerC12exaggerationSdSgvp)`
    
    Intensity of the hillshade. Optional number between 0 and 1 inclusive. Defaults to 0.5.
    
    #### Declaration
    
    Swift
    
    ```
    public var exaggeration: Double?
    ```
    
-   `[highlightColor](#/s:11MapTilerSDK16MTHillshadeLayerC14highlightColorSo7UIColorCSgvp)`
    
    The shading color of areas that face towards the light source. Defaults to white (“#FFFFFF”).
    
    #### Declaration
    
    Swift
    
    ```
    public var highlightColor: UIColor?
    ```
    
-   `[illuminationAnchor](#/s:11MapTilerSDK16MTHillshadeLayerC18illuminationAnchorAA0d12IlluminationG0OSgvp)`
    
    Direction of light source when map is rotated. Defaults to “viewport”.
    
    #### Declaration
    
    Swift
    
    ```
    public var illuminationAnchor: MTHillshadeIlluminationAnchor?
    ```
    
-   `[illuminationDirection](#/s:11MapTilerSDK16MTHillshadeLayerC21illuminationDirectionSdSgvp)`
    
    The direction of the light source used to generate the hillshading with 0 as the top of the viewport if hillshade-illumination-anchor is set to viewport and due north if set to map. Defaults to 335.
    
    #### Declaration
    
    Swift
    
    ```
    public var illuminationDirection: Double?
    ```
    
-   `[shadowColor](#/s:11MapTilerSDK16MTHillshadeLayerC11shadowColorSo7UIColorCSgvp)`
    
    The shading color of areas that face away from the light source. Defaults to black (“#000000”).
    
    #### Declaration
    
    Swift
    
    ```
    public var shadowColor: UIColor?
    ```
    

[](#/Layout%20properties)

### Layout properties

-   `[visibility](#/s:11MapTilerSDK16MTHillshadeLayerC10visibilityAA17MTLayerVisibilityOSgvp)`
    
    Whether this layer is displayed. Defaults to “visible”.
    
    #### Declaration
    
    Swift
    
    ```
    public var visibility: MTLayerVisibility?
    ```
    

[](#/Initializers)

### Initializers

-   `[init(identifier:sourceIdentifier:)](#/s:11MapTilerSDK16MTHillshadeLayerC10identifier16sourceIdentifierACSS_SStcfc)`
    
    Initializes the layer with required identifiers.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        identifier: String,
        sourceIdentifier: String
    )
    ```
    
-   `[init(identifier:sourceIdentifier:maxZoom:minZoom:sourceLayer:accentColor:exaggeration:highlightColor:illuminationAnchor:illuminationDirection:shadowColor:visibility:)](#/s:11MapTilerSDK16MTHillshadeLayerC10identifier16sourceIdentifier7maxZoom03minJ00gE011accentColor12exaggeration09highlightM018illuminationAnchor0P9Direction06shadowM010visibilityACSS_SSSdSgAPSSSgSo7UIColorCSgAptA0d12IlluminationQ0OSgAptA17MTLayerVisibilityOSgtcfc)`
    
    Initializes the layer with all options.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        identifier: String,
        sourceIdentifier: String,
        maxZoom: Double? = nil,
        minZoom: Double? = nil,
        sourceLayer: String? = nil,
        accentColor: UIColor? = .black,
        exaggeration: Double? = 0.5,
        highlightColor: UIColor? = .white,
        illuminationAnchor: MTHillshadeIlluminationAnchor? = .viewport,
        illuminationDirection: Double? = 335.0,
        shadowColor: UIColor? = .black,
        visibility: MTLayerVisibility? = .visible
    )
    ```
    

[](#/Codable)

### Codable

-   `[init(from:)](#/s:11MapTilerSDK16MTHillshadeLayerC4fromACs7Decoder_p_tKcfc)`
    
    Initializes the layer from the decoder.
    
    #### 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:11MapTilerSDK16MTHillshadeLayerC05addToA0yyAA9MTMapViewCF)`
    
    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)
    ```
    

[](#/Modifiers%20%28not%20to%20be%20used%20outside%20DSL%29)

### Modifiers (not to be used outside DSL)

-   `[maxZoom(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC7maxZoomyACXDSdF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func maxZoom(_ value: Double) -> Self
    ```
    
-   `[minZoom(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC7minZoomyACXDSdF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func minZoom(_ value: Double) -> Self
    ```
    
-   `[sourceLayer(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC06sourceE0yACXDSSF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func sourceLayer(_ value: String) -> Self
    ```
    
-   `[accentColor(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC11accentColoryACXDSo7UIColorCF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func accentColor(_ value: UIColor) -> Self
    ```
    
-   `[exaggeration(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC12exaggerationyACXDSdF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func exaggeration(_ value: Double) -> Self
    ```
    
-   `[highlightColor(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC14highlightColoryACXDSo7UIColorCF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func highlightColor(_ value: UIColor) -> Self
    ```
    
-   `[illuminationAnchor(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC18illuminationAnchoryACXDAA0d12IlluminationG0OF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func illuminationAnchor(_ value: MTHillshadeIlluminationAnchor) -> Self
    ```
    
-   `[illuminationDirection(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC21illuminationDirectionyACXDSdF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func illuminationDirection(_ value: Double) -> Self
    ```
    
-   `[shadowColor(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC11shadowColoryACXDSo7UIColorCF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func shadowColor(_ value: UIColor) -> Self
    ```
    
-   `[visibility(_:)](#/s:11MapTilerSDK16MTHillshadeLayerC10visibilityyACXDAA17MTLayerVisibilityOF)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func visibility(_ value: MTLayerVisibility) -> Self
    ```
