MTHeatmapLayer
public class MTHeatmapLayer : MTLayer, @unchecked Sendable, Codable
extension MTHeatmapLayer: Equatable
A heatmap style layer renders a range of colors to represent the density of points in an area.
-
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?
-
Defines the color of each pixel based on its density value in a heatmap. Should generally be an expression using [“heatmap-density”].
Declaration
Swift
public var color: MTStyleValue? -
Similar to heatmap-weight but controls the intensity of the heatmap globally.
Declaration
Swift
public var intensity: MTStyleValue? -
The global opacity at which the heatmap layer will be drawn.
Declaration
Swift
public var opacity: MTStyleValue? -
Radius of influence of one heatmap point in pixels.
Declaration
Swift
public var radius: MTStyleValue? -
A measure of how much an individual point contributes to the heatmap.
Declaration
Swift
public var weight: MTStyleValue?
-
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 after the layer 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: color: intensity: opacity: radius: weight: visibility: ) Initializes the layer with all options.
Declaration
Swift
public init( identifier: String, sourceIdentifier: String, maxZoom: Double? = nil, minZoom: Double? = nil, sourceLayer: String? = nil, color: MTStyleValue? = nil, intensity: MTStyleValue? = .number(1.0), opacity: MTStyleValue? = .number(1.0), radius: MTStyleValue? = .number(30.0), weight: MTStyleValue? = .number(1.0), 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) -
Declaration
Swift
public static func == (lhs: MTHeatmapLayer, rhs: MTHeatmapLayer) -> Bool