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?

Paint properties

  • 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?

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)
  • 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