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.
-
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?
-
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?
-
Whether this layer is displayed. Defaults to “visible”.
Declaration
Swift
public var visibility: MTLayerVisibility?
-
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: ) 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 )
-
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)
-
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