MTSymbolLayer

public class MTSymbolLayer : MTLayer, @unchecked Sendable, Codable
extension MTSymbolLayer: Equatable

The symbol style that layer renders icon and text labels at points or along lines on a map.

  • 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, including GeoJSON sources.

    Declaration

    Swift

    public var sourceLayer: String?
  • Icon to use for the layer.

    Declaration

    Swift

    public var icon: UIImage?
  • Enum controlling whether this layer is displayed.

    Declaration

    Swift

    public var visibility: MTLayerVisibility?
  • Initializes the layer with unique identifier, source identifier, max and min zoom levels and source layer, which is required for vector tile sources.

    Declaration

    Swift

    public init(
        identifier: String,
        sourceIdentifier: String,
        maxZoom: Double,
        minZoom: Double,
        sourceLayer: String? = nil
    )
  • Initializes the layer with the unique identifier and a source identifier.

    Declaration

    Swift

    public init(
        identifier: String,
        sourceIdentifier: String
    )
  • Undocumented

    Declaration

    Swift

    public init(
        identifier: String,
        sourceIdentifier: String,
        maxZoom: Double? = nil,
        minZoom: Double? = nil,
        sourceLayer: String? = nil,
        icon: UIImage? = nil,
        visibility: MTLayerVisibility? = .visible
    )
  • 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 icon.

    Note

    Not to be used outside of DSL.

    Declaration

    Swift

    public func icon(_ value: UIImage) -> Self
  • Modifier. Sets the visibility.

    Note

    Not to be used outside of DSL.

    Declaration

    Swift

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

    Swift

    public static func == (lhs: MTSymbolLayer, rhs: MTSymbolLayer) -> Bool