MTFillExtrusionLayer

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

A fill-extrusion style layer renders one or more filled (and optionally stroked) extruded (3D) polygons on a map.

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.

    Declaration

    Swift

    public var maxZoom: Double?
  • The minimum zoom level for the layer. Optional number between 0 and 24.

    Declaration

    Swift

    public var minZoom: Double?
  • Layer to use from a vector tile source. Required for vector tile sources; prohibited for others.

    Declaration

    Swift

    public var sourceLayer: String?

Paint properties

  • The height with which to extrude the base of this layer. Must be less than or equal to fill-extrusion-height. Units in meters. Supports expressions.

    Declaration

    Swift

    public var base: MTStyleValue?
  • The base color of the extruded fill. Supports expressions.

    Declaration

    Swift

    public var color: MTStyleValue?
  • The height with which to extrude this layer. Units in meters. Supports expressions.

    Declaration

    Swift

    public var height: MTStyleValue?
  • The opacity of the entire fill extrusion layer. Supports expressions. Default 1.

    Declaration

    Swift

    public var opacity: MTStyleValue?
  • Name of image in sprite to use for drawing images on extruded fills.

    Declaration

    Swift

    public var pattern: String?
  • The geometry’s offset. Values are [x, y] in pixels.

    Declaration

    Swift

    public var translate: [Double]?
  • Controls the frame of reference for translate.

    Declaration

    Swift

    public var translateAnchor: MTFillExtrusionTranslateAnchor?
  • Whether to apply a vertical gradient to the sides of a fill-extrusion layer. Defaults to true.

    Declaration

    Swift

    public var verticalGradient: Bool?

Layout properties

Filters

Initializers

Codable

  • 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 MTStyle.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 base(_ value: MTStyleValue) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func color(_ value: MTStyleValue) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func height(_ value: MTStyleValue) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func opacity(_ value: MTStyleValue) -> Self
  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

    @discardableResult
    public func translate(_ value: [Double]) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func translateAnchor(_ value: MTFillExtrusionTranslateAnchor) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func verticalGradient(_ value: Bool) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func visibility(_ value: MTLayerVisibility) -> Self
  • Modifier. Sets the initial filter to apply upon add.

    Declaration

    Swift

    @discardableResult
    public func withFilter(_ value: MTPropertyValue) -> Self
  • Declaration

    Swift

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