MTRasterLayer
public class MTRasterLayer : MTLayer, @unchecked Sendable, Codable
The raster style layer renders raster map textures such as imagery.
-
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?
-
Increase or reduce the brightness of the image. The value is the maximum brightness. Optional number between 0 and 1 inclusive. Defaults to 1.
Declaration
Swift
public var brightnessMax: Double? -
Increase or reduce the brightness of the image. The value is the minimum brightness. Optional number between 0 and 1 inclusive. Defaults to 0.
Declaration
Swift
public var brightnessMin: Double? -
Increase or reduce the contrast of the image. Optional number between -1 and 1 inclusive. Defaults to 0.
Declaration
Swift
public var contrast: Double? -
Fade duration when a new tile is added. Units in milliseconds. Defaults to 300.
Declaration
Swift
public var fadeDuration: Double? -
Rotates hues around the color wheel. Units in degrees. Defaults to 0.
Declaration
Swift
public var hueRotate: Double? -
The opacity at which the image will be drawn. Optional number between 0 and 1 inclusive. Defaults to 1.
Declaration
Swift
public var opacity: Double? -
The resampling/interpolation method to use for overscaling. Defaults to “linear”.
Declaration
Swift
public var resampling: MTRasterResampling? -
Increase or reduce the saturation of the image. Optional number between -1 and 1 inclusive. Defaults to 0.
Declaration
Swift
public var saturation: Double?
-
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: brightnessMax: brightnessMin: contrast: fadeDuration: hueRotate: opacity: resampling: saturation: visibility: ) Initializes the layer with all options.
Declaration
Swift
public init( identifier: String, sourceIdentifier: String, maxZoom: Double? = nil, minZoom: Double? = nil, sourceLayer: String? = nil, brightnessMax: Double? = 1.0, brightnessMin: Double? = 0.0, contrast: Double? = 0.0, fadeDuration: Double? = 300.0, hueRotate: Double? = 0.0, opacity: Double? = 1.0, resampling: MTRasterResampling? = .linear, saturation: Double? = 0.0, 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) -
Modifier. Sets the
maxZoom.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func maxZoom(_ value: Double) -> Self -
Modifier. Sets the
minZoom.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func minZoom(_ value: Double) -> Self -
Modifier. Sets the
sourceLayer.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func sourceLayer(_ value: String) -> Self -
Modifier. Sets the
brightnessMax.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func brightnessMax(_ value: Double) -> Self -
Modifier. Sets the
brightnessMin.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func brightnessMin(_ value: Double) -> Self -
Modifier. Sets the
contrast.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func contrast(_ value: Double) -> Self -
Modifier. Sets the
fadeDuration.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func fadeDuration(_ value: Double) -> Self -
Modifier. Sets the
hueRotate.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func hueRotate(_ value: Double) -> Self -
Modifier. Sets the
opacity.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func opacity(_ value: Double) -> Self -
Modifier. Sets the
resampling.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func resampling(_ value: MTRasterResampling) -> Self -
Modifier. Sets the
saturation.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func saturation(_ value: Double) -> Self -
Modifier. Sets the
visibility.Note
Not to be used outside of DSL.Declaration
Swift
@discardableResult public func visibility(_ value: MTLayerVisibility) -> Self