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.

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

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

Layout properties

Optional filter hooks

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 addLayer(_:) on MTMapView instead.

    Declaration

    Swift

    public func addToMap(_ mapView: MTMapView)
  • Declaration

    Swift

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