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 properties

  • Unique layer identifier.

    Declaration

    Swift

    public var identifier: String
  • Type of the layer.

    Declaration

    Swift

    public private(set) var type: MTLayerType { get }
  • Identifier of the source to be used for this layer.

    Declaration

    Swift

    public var sourceIdentifier: String
  • 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?
  • 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?
  • 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 properties

  • 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?
  • Intensity of the hillshade. Optional number between 0 and 1 inclusive. Defaults to 0.5.

    Declaration

    Swift

    public var exaggeration: Double?
  • The shading color of areas that face towards the light source. Defaults to white (“#FFFFFF”).

    Declaration

    Swift

    public var highlightColor: UIColor?
  • Direction of light source when map is rotated. Defaults to “viewport”.

    Declaration

    Swift

    public var illuminationAnchor: MTHillshadeIlluminationAnchor?
  • 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?
  • The shading color of areas that face away from the light source. Defaults to black (“#000000”).

    Declaration

    Swift

    public var shadowColor: UIColor?

Layout properties

Initializers

Codable

  • Initializes the layer from the decoder.

    Declaration

    Swift

    public required init(from decoder: any Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Adds layer to map DSL style.

    Prefer addLayer(_:) on MTMapView instead.

    Declaration

    Swift

    public func addToMap(_ mapView: MTMapView)

Modifiers (not to be used outside DSL)

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func maxZoom(_ value: Double) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func minZoom(_ value: Double) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func sourceLayer(_ value: String) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func accentColor(_ value: UIColor) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func exaggeration(_ value: Double) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func highlightColor(_ value: UIColor) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func illuminationAnchor(_ value: MTHillshadeIlluminationAnchor) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func illuminationDirection(_ value: Double) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func shadowColor(_ value: UIColor) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func visibility(_ value: MTLayerVisibility) -> Self