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.
-
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?
-
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?
-
Whether this layer is displayed. Defaults to “visible”.
Declaration
Swift
public var visibility: MTLayerVisibility?
-
Inline filter expression to be embedded in the layer JSON.
Declaration
Swift
public var filterExpression: MTPropertyValue? -
Optional filter to apply to this layer after it is added to the map.
Declaration
Swift
public var initialFilter: MTPropertyValue?
-
Initializes the layer with a unique identifier and source identifier.
Declaration
Swift
public init(identifier: String, sourceIdentifier: String) -
init(identifier:sourceIdentifier: maxZoom: minZoom: sourceLayer: base: color: height: opacity: pattern: translate: translateAnchor: verticalGradient: visibility: ) Initializes the layer with all options.
Declaration
Swift
public init( identifier: String, sourceIdentifier: String, maxZoom: Double? = nil, minZoom: Double? = nil, sourceLayer: String? = nil, base: MTStyleValue? = nil, color: MTStyleValue? = .color(.black), height: MTStyleValue? = nil, opacity: MTStyleValue? = .number(1.0), pattern: String? = nil, translate: [Double]? = [0.0, 0.0], translateAnchor: MTFillExtrusionTranslateAnchor? = .map, verticalGradient: Bool? = true, 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 MTStyle.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 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