---
title: "MTHeatmapLayerHelper | Mobile sdk | Mobile sdk ios | Ios"
description: "Helper for creating a heatmap visualization layer from data and styling options."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# MTHeatmapLayerHelper

```
public final class MTHeatmapLayerHelper : MTVectorLayerHelper, @unchecked Sendable
```

Helper for creating a heatmap visualization layer from data and styling options.

-   `[style](#/s:11MapTilerSDK20MTHeatmapLayerHelperC5styleAA7MTStyleCvp)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public var style: MTStyle { get }
    ```
    
-   `[init(_:)](#/s:11MapTilerSDK20MTHeatmapLayerHelperCyAcA7MTStyleCcfc)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public init(_ style: MTStyle)
    ```
    
-   `[addHeatmap(_:completionHandler:)](#/s:11MapTilerSDK20MTHeatmapLayerHelperC10addHeatmap_17completionHandleryAA0dE7OptionsV_ys6ResultOyAA0deL0VAA7MTErrorOGcSgtF)`
    
    Adds a heatmap layer based on the provided options.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addHeatmap(
        _ options: MTHeatmapLayerOptions,
        completionHandler: ((Result<MTHeatmapLayerResult, MTError>) -> Void)? = nil
    )
    ```
    
-   `[addHeatmap(_:)](#/s:11MapTilerSDK20MTHeatmapLayerHelperC10addHeatmapyAA0dE6ResultVAA0dE7OptionsVYaKF)` Asynchronous
    
    Adds a heatmap layer based on the provided options (async).
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func addHeatmap(
        _ options: MTHeatmapLayerOptions
    ) async throws -> MTHeatmapLayerResult
    ```
    
-   `[addHeatmap(_:colorRamp:in:)](#/s:11MapTilerSDK20MTHeatmapLayerHelperC10addHeatmap_9colorRamp2inAA0dE6ResultVAA0dE7OptionsV_AA07MTColorJ0CSgAA9MTMapViewCtYaKF)` Asynchronous
    
    Adds a heatmap layer using a ColorRamp for styling (async).
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func addHeatmap(
        _ options: MTHeatmapLayerOptions,
        colorRamp: MTColorRamp? = nil,
        in mapView: MTMapView
    ) async throws -> MTHeatmapLayerResult
    ```
    
-   `[removeHeatmap(result:completionHandler:)](#/s:11MapTilerSDK20MTHeatmapLayerHelperC13removeHeatmap6result17completionHandleryAA0dE6ResultV_ys0L0OyytAA7MTErrorOGcSgtF)`
    
    Removes the layers and source created by the `addHeatmap` helper
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func removeHeatmap(
        result: MTHeatmapLayerResult,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
-   `[removeHeatmap(result:)](#/s:11MapTilerSDK20MTHeatmapLayerHelperC13removeHeatmap6resultyAA0dE6ResultV_tYaKF)` Asynchronous
    
    Removes the layers and source created by the `addHeatmap` helper
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func removeHeatmap(result: MTHeatmapLayerResult) async throws
    ```
